mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 10:00:30 +08:00
feat(m2): add signing/effective/end date fields to contracts
This commit is contained in:
+34
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
|
|
||||||
@TableName("platform_contract")
|
@TableName("platform_contract")
|
||||||
@@ -25,6 +26,15 @@ public class PlatformContract {
|
|||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@TableField("signing_date")
|
||||||
|
private LocalDate signingDate;
|
||||||
|
|
||||||
|
@TableField("effective_date")
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
|
||||||
|
@TableField("end_date")
|
||||||
|
private LocalDate endDate;
|
||||||
|
|
||||||
@TableField("created_at")
|
@TableField("created_at")
|
||||||
private OffsetDateTime createdAt;
|
private OffsetDateTime createdAt;
|
||||||
|
|
||||||
@@ -79,6 +89,30 @@ public class PlatformContract {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDate getSigningDate() {
|
||||||
|
return signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSigningDate(LocalDate signingDate) {
|
||||||
|
this.signingDate = signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getEffectiveDate() {
|
||||||
|
return effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEffectiveDate(LocalDate effectiveDate) {
|
||||||
|
this.effectiveDate = effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(LocalDate endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
public OffsetDateTime getCreatedAt() {
|
public OffsetDateTime getCreatedAt() {
|
||||||
return createdAt;
|
return createdAt;
|
||||||
}
|
}
|
||||||
|
|||||||
+13
@@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.server.ResponseStatusException;
|
import org.springframework.web.server.ResponseStatusException;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -68,6 +69,9 @@ public class ContractService {
|
|||||||
c.setProjectId(request.getProjectId());
|
c.setProjectId(request.getProjectId());
|
||||||
c.setTitle(blankToNull(request.getTitle()));
|
c.setTitle(blankToNull(request.getTitle()));
|
||||||
c.setRemarks(blankToNull(request.getRemarks()));
|
c.setRemarks(blankToNull(request.getRemarks()));
|
||||||
|
if (request.getSigningDate() != null) c.setSigningDate(LocalDate.parse(request.getSigningDate()));
|
||||||
|
if (request.getEffectiveDate() != null) c.setEffectiveDate(LocalDate.parse(request.getEffectiveDate()));
|
||||||
|
if (request.getEndDate() != null) c.setEndDate(LocalDate.parse(request.getEndDate()));
|
||||||
c.setStatus(ContractStatus.DRAFT.name());
|
c.setStatus(ContractStatus.DRAFT.name());
|
||||||
c.setCreatedAt(now);
|
c.setCreatedAt(now);
|
||||||
c.setUpdatedAt(now);
|
c.setUpdatedAt(now);
|
||||||
@@ -122,6 +126,9 @@ public class ContractService {
|
|||||||
if (request.getRemarks() != null) {
|
if (request.getRemarks() != null) {
|
||||||
c.setRemarks(blankToNull(request.getRemarks()));
|
c.setRemarks(blankToNull(request.getRemarks()));
|
||||||
}
|
}
|
||||||
|
if (request.getSigningDate() != null) c.setSigningDate(LocalDate.parse(request.getSigningDate()));
|
||||||
|
if (request.getEffectiveDate() != null) c.setEffectiveDate(LocalDate.parse(request.getEffectiveDate()));
|
||||||
|
if (request.getEndDate() != null) c.setEndDate(LocalDate.parse(request.getEndDate()));
|
||||||
c.setUpdatedAt(OffsetDateTime.now(ZoneOffset.UTC));
|
c.setUpdatedAt(OffsetDateTime.now(ZoneOffset.UTC));
|
||||||
contractMapper.updateById(c);
|
contractMapper.updateById(c);
|
||||||
auditService.record(
|
auditService.record(
|
||||||
@@ -321,6 +328,9 @@ public class ContractService {
|
|||||||
m.put("projectId", c.getProjectId());
|
m.put("projectId", c.getProjectId());
|
||||||
m.put("title", c.getTitle());
|
m.put("title", c.getTitle());
|
||||||
m.put("remarks", c.getRemarks());
|
m.put("remarks", c.getRemarks());
|
||||||
|
m.put("signingDate", c.getSigningDate());
|
||||||
|
m.put("effectiveDate", c.getEffectiveDate());
|
||||||
|
m.put("endDate", c.getEndDate());
|
||||||
m.put("status", c.getStatus());
|
m.put("status", c.getStatus());
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
@@ -354,6 +364,9 @@ public class ContractService {
|
|||||||
r.setTitle(c.getTitle());
|
r.setTitle(c.getTitle());
|
||||||
r.setRemarks(c.getRemarks());
|
r.setRemarks(c.getRemarks());
|
||||||
r.setStatus(c.getStatus());
|
r.setStatus(c.getStatus());
|
||||||
|
r.setSigningDate(c.getSigningDate() != null ? c.getSigningDate().toString() : null);
|
||||||
|
r.setEffectiveDate(c.getEffectiveDate() != null ? c.getEffectiveDate().toString() : null);
|
||||||
|
r.setEndDate(c.getEndDate() != null ? c.getEndDate().toString() : null);
|
||||||
r.setCreatedAt(c.getCreatedAt());
|
r.setCreatedAt(c.getCreatedAt());
|
||||||
r.setUpdatedAt(c.getUpdatedAt());
|
r.setUpdatedAt(c.getUpdatedAt());
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
+30
@@ -15,6 +15,12 @@ public class ContractCreateRequest {
|
|||||||
@Size(max = 4000)
|
@Size(max = 4000)
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
private String signingDate;
|
||||||
|
|
||||||
|
private String effectiveDate;
|
||||||
|
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
public Long getCustomerId() {
|
public Long getCustomerId() {
|
||||||
return customerId;
|
return customerId;
|
||||||
}
|
}
|
||||||
@@ -46,4 +52,28 @@ public class ContractCreateRequest {
|
|||||||
public void setRemarks(String remarks) {
|
public void setRemarks(String remarks) {
|
||||||
this.remarks = remarks;
|
this.remarks = remarks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSigningDate() {
|
||||||
|
return signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSigningDate(String signingDate) {
|
||||||
|
this.signingDate = signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEffectiveDate() {
|
||||||
|
return effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEffectiveDate(String effectiveDate) {
|
||||||
|
this.effectiveDate = effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(String endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+27
@@ -13,6 +13,9 @@ public class ContractResponse {
|
|||||||
private String title;
|
private String title;
|
||||||
private String remarks;
|
private String remarks;
|
||||||
private String status;
|
private String status;
|
||||||
|
private String signingDate;
|
||||||
|
private String effectiveDate;
|
||||||
|
private String endDate;
|
||||||
private OffsetDateTime createdAt;
|
private OffsetDateTime createdAt;
|
||||||
private OffsetDateTime updatedAt;
|
private OffsetDateTime updatedAt;
|
||||||
/** 仅详情接口填充;列表分页省略该字段。 */
|
/** 仅详情接口填充;列表分页省略该字段。 */
|
||||||
@@ -67,6 +70,30 @@ public class ContractResponse {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSigningDate() {
|
||||||
|
return signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSigningDate(String signingDate) {
|
||||||
|
this.signingDate = signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEffectiveDate() {
|
||||||
|
return effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEffectiveDate(String effectiveDate) {
|
||||||
|
this.effectiveDate = effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(String endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
public OffsetDateTime getCreatedAt() {
|
public OffsetDateTime getCreatedAt() {
|
||||||
return createdAt;
|
return createdAt;
|
||||||
}
|
}
|
||||||
|
|||||||
+30
@@ -10,6 +10,12 @@ public class ContractUpdateRequest {
|
|||||||
@Size(max = 4000)
|
@Size(max = 4000)
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
private String signingDate;
|
||||||
|
|
||||||
|
private String effectiveDate;
|
||||||
|
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
@@ -25,4 +31,28 @@ public class ContractUpdateRequest {
|
|||||||
public void setRemarks(String remarks) {
|
public void setRemarks(String remarks) {
|
||||||
this.remarks = remarks;
|
this.remarks = remarks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSigningDate() {
|
||||||
|
return signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSigningDate(String signingDate) {
|
||||||
|
this.signingDate = signingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEffectiveDate() {
|
||||||
|
return effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEffectiveDate(String effectiveDate) {
|
||||||
|
this.effectiveDate = effectiveDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(String endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
ALTER TABLE platform_contract
|
||||||
|
ADD COLUMN signing_date DATE,
|
||||||
|
ADD COLUMN effective_date DATE,
|
||||||
|
ADD COLUMN end_date DATE;
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="contract && isDraft" class="head-actions">
|
<div v-if="contract && isDraft" class="head-actions">
|
||||||
<el-button type="primary" :loading="saving" @click="saveHeader">保存</el-button>
|
<el-button v-permission="'contract:rw'" type="primary" :loading="saving" @click="saveHeader">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
<div v-if="transitionButtons.length" class="transition-bar">
|
<div v-if="transitionButtons.length" class="transition-bar">
|
||||||
<span class="label">状态操作:</span>
|
<span class="label">状态操作:</span>
|
||||||
<el-button
|
<el-button
|
||||||
|
v-permission="'contract:rw'"
|
||||||
v-for="btn in transitionButtons"
|
v-for="btn in transitionButtons"
|
||||||
:key="btn.status"
|
:key="btn.status"
|
||||||
:type="btn.danger ? 'danger' : 'primary'"
|
:type="btn.danger ? 'danger' : 'primary'"
|
||||||
@@ -51,7 +52,7 @@
|
|||||||
|
|
||||||
<h3 class="section-title">合同明细</h3>
|
<h3 class="section-title">合同明细</h3>
|
||||||
<div v-if="isDraft" class="line-toolbar">
|
<div v-if="isDraft" class="line-toolbar">
|
||||||
<el-button type="primary" @click="openLineDialog()">添加明细</el-button>
|
<el-button v-permission="'contract:rw'" type="primary" @click="openLineDialog()">添加明细</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="lineRows" border stripe style="width: 100%">
|
<el-table :data="lineRows" border stripe style="width: 100%">
|
||||||
<el-table-column prop="itemName" label="标的/行项" min-width="200" show-overflow-tooltip />
|
<el-table-column prop="itemName" label="标的/行项" min-width="200" show-overflow-tooltip />
|
||||||
@@ -60,8 +61,8 @@
|
|||||||
<el-table-column prop="amount" label="金额" width="120" />
|
<el-table-column prop="amount" label="金额" width="120" />
|
||||||
<el-table-column v-if="isDraft" label="操作" width="140" fixed="right">
|
<el-table-column v-if="isDraft" label="操作" width="140" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button type="primary" link @click="openLineDialog(row)">编辑</el-button>
|
<el-button v-permission="'contract:rw'" type="primary" link @click="openLineDialog(row)">编辑</el-button>
|
||||||
<el-button type="danger" link @click="onDeleteLine(row)">删除</el-button>
|
<el-button v-permission="'contract:rw'" type="danger" link @click="onDeleteLine(row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -75,7 +76,7 @@
|
|||||||
:on-change="handleFileChange"
|
:on-change="handleFileChange"
|
||||||
:accept="'.pdf,.doc,.docx,.xls,.xlsx,.zip'"
|
:accept="'.pdf,.doc,.docx,.xls,.xlsx,.zip'"
|
||||||
>
|
>
|
||||||
<el-button type="primary" v-if="isDraft || isEffective">上传附件</el-button>
|
<el-button v-permission="'contract:rw'" type="primary" v-if="isDraft || isEffective">上传附件</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-table :data="attachments" stripe size="small" style="margin-top:8px">
|
<el-table :data="attachments" stripe size="small" style="margin-top:8px">
|
||||||
<el-table-column prop="fileName" label="文件名" min-width="200" />
|
<el-table-column prop="fileName" label="文件名" min-width="200" />
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
<div class="footer-actions">
|
<div class="footer-actions">
|
||||||
<el-button v-if="step > 0" @click="step -= 1">上一步</el-button>
|
<el-button v-if="step > 0" @click="step -= 1">上一步</el-button>
|
||||||
<el-button v-if="step < 2" type="primary" @click="nextStep">下一步</el-button>
|
<el-button v-if="step < 2" type="primary" @click="nextStep">下一步</el-button>
|
||||||
<el-button v-if="step === 2" type="primary" :loading="submitting" @click="submit">提交创建(草稿)</el-button>
|
<el-button v-permission="'contract:rw'" v-if="step === 2" type="primary" :loading="submitting" @click="submit">提交创建(草稿)</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user