合同提交审批、合同主信息字段修改、合同明细字段修改、合同内容校验、zt-module-base-server引入版本号引用变量修改
This commit is contained in:
@@ -17,5 +17,6 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode CONTRACT_PAPER_NUMBER_EXISTS = new ErrorCode(1_027_000_002, "合同编号已存在");
|
||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_027_000_003, "合同不存在");
|
||||
ErrorCode CONTRACT_ID_NOT_EXISTS = new ErrorCode(1_027_000_004, "合同主键为空");
|
||||
ErrorCode CONTRACT_STATUS_NOT_UPDATE = new ErrorCode(1_027_000_004, "{}合同不允许修改");
|
||||
ErrorCode CONTRACT_STATUS_NOT_UPDATE = new ErrorCode(1_027_000_005, "{}合同不允许修改");
|
||||
ErrorCode CONTRACT_DATA_NOT_EXISTS = new ErrorCode(1_027_000_006, "{}不存在");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.zt.plat.module.contractorder.enums;
|
||||
|
||||
public class ProcessConstants {
|
||||
|
||||
// 合同审批流程
|
||||
public static String CONTRACT_APPROVAL_PROCESS = "contract_approval_process";
|
||||
}
|
||||
@@ -13,12 +13,86 @@ public class TableFieldConstants {
|
||||
/* 合同主信息表 */
|
||||
// 合同名称;与ERP(HTMC)对应,校验唯一
|
||||
public static final String BSE_CTRT_MAIN_CTRT_NAME = "CTRT_NAME";
|
||||
public static final String BSE_CTRT_MAIN_CTRT_NAME_LABEL = "合同名称";
|
||||
// 合同编号;与ERP(HTBH)对应,校验唯一
|
||||
public static final String BSE_CTRT_MAIN_CTRT_PPR_NUM = "CTRT_PPR_NUM";
|
||||
public static final String BSE_CTRT_MAIN_CTRT_PPR_NUM_LABEL = "合同编号";
|
||||
// 甲方公司编号
|
||||
public static final String BSE_CTRT_MAIN_PRCH_CPN_NUM_LABEL = "甲方公司编号";
|
||||
// 甲方公司名称
|
||||
public static final String BSE_CTRT_MAIN_PRCH_CPN_NAME_LABEL = "甲方公司名称";
|
||||
// 甲方地址
|
||||
public static final String BSE_CTRT_MAIN_PRCH_ADR_LABEL = "甲方地址";
|
||||
// 甲方法定代表人
|
||||
public static final String BSE_CTRT_MAIN_PRCH_LDR_LABEL = "甲方法定代表人";
|
||||
// 乙方公司编号
|
||||
public static final String BSE_CTRT_MAIN_SALE_CPN_NUM_LABEL = "乙方公司编号";
|
||||
// 乙方公司名称
|
||||
public static final String BSE_CTRT_MAIN_SALE_CPN_NAME_LABEL = "乙方公司名称";
|
||||
// 乙方地址
|
||||
public static final String BSE_CTRT_MAIN_SALE_ADR_LABEL = "乙方地址";
|
||||
// 乙方法定代表人
|
||||
public static final String BSE_CTRT_MAIN_SALE_PRCH_LDR_LABEL = "乙方法定代表人";
|
||||
// 类别
|
||||
public static final String BSE_CTRT_MAIN_CTGR_LABEL = "类别";
|
||||
// 收支性质
|
||||
public static final String BSE_CTRT_MAIN_DRCT_LABEL = "收支性质";
|
||||
// 签署日期
|
||||
public static final String BSE_CTRT_MAIN_SGN_DT_LABEL = "签署日期";
|
||||
// 开始日期
|
||||
public static final String BSE_CTRT_MAIN_STRT_DT_LABEL = "开始日期";
|
||||
// 结束日期
|
||||
public static final String BSE_CTRT_MAIN_END_DT_LABEL = "结束日期";
|
||||
// 签署地
|
||||
public static final String BSE_CTRT_MAIN_SGN_PLCE_LABEL = "签署地";
|
||||
// 币种
|
||||
public static final String BSE_CTRT_MAIN_CUR_LABEL = "币种";
|
||||
// 本币金额
|
||||
public static final String BSE_CTRT_MAIN_BSC_AMT_LABEL = "本币金额";
|
||||
// 原币金额
|
||||
public static final String BSE_CTRT_MAIN_COO_AMT_LABEL = "原币金额";
|
||||
// 是否有履约保证金
|
||||
public static final String BSE_CTRT_MAIN_HS_DPST_LABEL = "是否有履约保证金";
|
||||
// 原币履约保证金
|
||||
public static final String BSE_CTRT_MAIN_COO_AMT_DPST_LABEL = "原币履约保证金";
|
||||
// 本币履约保证金
|
||||
public static final String BSE_CTRT_MAIN_BSC_AMT_DPST_LABEL = "本币履约保证金";
|
||||
// 是否有预付款
|
||||
public static final String BSE_CTRT_MAIN_HS_PPYM_LABEL = "是否有预付款";
|
||||
// 预付款比例
|
||||
public static final String BSE_CTRT_MAIN_PPYM_RTIO_LABEL = "预付款比例";
|
||||
// 预付款金额
|
||||
public static final String BSE_CTRT_MAIN_PPYM_AMT_LABEL = "预付款金额";
|
||||
// 是否有质保金
|
||||
public static final String BSE_CTRT_MAIN_HS_QLT_AMT_LABEL = "是否有质保金";
|
||||
// 质保金比例
|
||||
public static final String BSE_CTRT_MAIN_QLT_RTIO_LABEL = "质保金比例";
|
||||
// 质保金金额
|
||||
public static final String BSE_CTRT_MAIN_QLT_AMT_LABEL = "质保金金额";
|
||||
// 是否先款后货
|
||||
public static final String BSE_CTRT_MAIN_HS_PYBL_LABEL = "是否先款后贷";
|
||||
// 是否框架合同
|
||||
public static final String BSE_CTRT_MAIN_IS_FMWK_LABEL = "是否框架合同";
|
||||
// 境内/境外
|
||||
public static final String BSE_CTRT_MAIN_IS_DOM_LABEL = "境内/境外";
|
||||
// 施工类型编号
|
||||
public static final String BSE_CTRT_MAIN_CON_TP_NUM_LABEL = "施工类型编号";
|
||||
// 施工类型名称
|
||||
public static final String BSE_CTRT_MAIN_CON_TP_NAME_LABEL = "施工类型名称";
|
||||
// 代理方
|
||||
public static final String BSE_CTRT_MAIN_AGT_LABEL = "代理方";
|
||||
// 是否虚拟合同
|
||||
public static final String BSE_CTRT_MAIN_CTRT_VRTL_LABEL = "是否虚拟合同";
|
||||
|
||||
/* 合同明细表 */
|
||||
// 合同主信息主键
|
||||
public static final String BSE_CTRT_DTL_CTRT_MAIN_ID = "CTRT_MAIN_ID";
|
||||
// 物料名称
|
||||
public static final String BSE_CTRT_DTL_MTRL_NAME_LABEL = "物料名称";
|
||||
// 数量
|
||||
public static final String BSE_CTRT_DTL_QTY_LABEL = "数量";
|
||||
// 计量单位
|
||||
public static final String BSE_CTRT_DTL_UNT_LABEL = "计量单位";
|
||||
|
||||
/* 交货计划条款表 */
|
||||
// 合同明细主键
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.zt.plat.module.contractorder.enums.contract;
|
||||
|
||||
/**
|
||||
* ERP是否枚举
|
||||
*/
|
||||
public enum ErpCtrtYesNoEnum {
|
||||
|
||||
/**
|
||||
* 是
|
||||
*/
|
||||
YES("是","1",null),
|
||||
/**
|
||||
* 否
|
||||
*/
|
||||
NO("否","0",null);
|
||||
|
||||
ErpCtrtYesNoEnum(String label, String code, String remark) {
|
||||
this.label = label;
|
||||
this.code = code;
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
private final String label;
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private final String remark;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
}
|
||||
@@ -129,8 +129,12 @@
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-base-server</artifactId>
|
||||
<version>3.0.41</version>
|
||||
<scope>compile</scope>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-bpm-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -102,10 +102,11 @@ public class ContractController implements BusinessControllerMarker {
|
||||
}
|
||||
|
||||
// TODO
|
||||
@PostMapping("/submit/approval")
|
||||
@Operation(summary = "提交审批")
|
||||
@GetMapping("/submit/approval")
|
||||
@Operation(summary = "合同提交审批")
|
||||
@PreAuthorize("@ss.hasPermission('system:contract:approval')")
|
||||
public void submitApproval() {
|
||||
public CommonResult<String> submitApproval(@RequestParam("id") Long id) {
|
||||
return success(contractService.submitApproval(id));
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
@@ -28,6 +28,9 @@ public class ContractDetailSaveReqVO {
|
||||
@Schema(description = "含税单价", example = "28579")
|
||||
private BigDecimal inTaxUnitPrice;
|
||||
|
||||
@Schema(description = "含税总价")
|
||||
private BigDecimal allInTaxUnitPrice;
|
||||
|
||||
@Schema(description = "金属元素缩写", example = "金属元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
|
||||
@@ -209,6 +209,14 @@ public class ContractSaveReqVO {
|
||||
@ExcelProperty("达到收款条件金额;与ERP(DDSKJE)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
private BigDecimal payeeConditionAmount;
|
||||
|
||||
@Schema(description = "附件对象存储")
|
||||
@ExcelProperty("附件对象存储")
|
||||
private String fileObject;
|
||||
|
||||
@Schema(description = "其它附件对象存储")
|
||||
@ExcelProperty("其它附件对象存储")
|
||||
private String fileObjectOther;
|
||||
|
||||
// 模板部分查询
|
||||
@Schema(description = "模板实例主键", example = "10196")
|
||||
@ExcelProperty("模板实例主键")
|
||||
|
||||
@@ -73,4 +73,9 @@ public class ContractDetailDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("ELEM_NUM")
|
||||
private String elementNumber;
|
||||
/**
|
||||
* 含税总价
|
||||
*/
|
||||
@TableField("ALL_IN_TAX_UPRC")
|
||||
private BigDecimal allInTaxUnitPrice;
|
||||
}
|
||||
|
||||
@@ -279,4 +279,29 @@ public class ContractMainDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("CAUS")
|
||||
private String cause;
|
||||
/**
|
||||
* 流程实例编号
|
||||
*/
|
||||
@TableField("PRCS_INSC_ID")
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
@TableField("RVW_ONN")
|
||||
private String reviewOpinion;
|
||||
/**
|
||||
* 任务节点主键
|
||||
*/
|
||||
@TableField("TSK_NDE_ID")
|
||||
private String taskNodeId;
|
||||
/**
|
||||
* 模板附件对象存储
|
||||
*/
|
||||
@TableField("FILE_OBJ")
|
||||
private String fileObject;
|
||||
/**
|
||||
* 其它附件对象存储
|
||||
*/
|
||||
@TableField("FILE_OBJ_OTH")
|
||||
private String fileObjectOther;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zt.plat.module.contractorder.framework.rpc.config;
|
||||
|
||||
import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||
import com.zt.plat.module.infra.api.businessfile.BusinessFileApi;
|
||||
import com.zt.plat.module.infra.api.file.FileApi;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import com.zt.plat.module.system.api.sequence.SequenceApi;
|
||||
import com.zt.plat.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(value = "contractorderRpcConfiguration", proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {DeptApi.class, SequenceApi.class, BpmProcessInstanceApi.class, AdminUserApi.class, BpmTaskApi.class, BusinessFileApi.class, FileApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
@@ -45,4 +45,12 @@ public interface ContractService {
|
||||
* @return 修改结果
|
||||
*/
|
||||
Boolean update(@Valid ContractSaveReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 合同提交审批
|
||||
*
|
||||
* @param id 合同ID
|
||||
* @return 审批结果
|
||||
*/
|
||||
String submitApproval(Long id);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.service.contract;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.zt.plat.framework.tenant.core.context.CompanyContextHolder;
|
||||
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceItemRespVO;
|
||||
@@ -11,14 +12,24 @@ import com.zt.plat.module.base.dal.dataobject.tmpltp.TemplateInstanceItemDO;
|
||||
import com.zt.plat.module.base.dal.mysql.tmpltp.TemplateInstanceDataMapper;
|
||||
import com.zt.plat.module.base.dal.mysql.tmpltp.TemplateInstanceItemMapper;
|
||||
import com.zt.plat.module.base.service.tmpltp.TemplateInstanceDataService;
|
||||
import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.contract.*;
|
||||
import com.zt.plat.module.contractorder.enums.DateConstants;
|
||||
import com.zt.plat.module.contractorder.enums.ProcessConstants;
|
||||
import com.zt.plat.module.contractorder.enums.TableFieldConstants;
|
||||
import com.zt.plat.module.contractorder.enums.contract.ContractStatusEnum;
|
||||
import com.zt.plat.module.contractorder.enums.DateConstants;
|
||||
import com.zt.plat.module.contractorder.enums.contract.ErpCtrtYesNoEnum;
|
||||
import com.zt.plat.module.system.api.user.AdminUserApi;
|
||||
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -64,6 +75,12 @@ public class ContractServiceImpl implements ContractService {
|
||||
private ContractPriceMapper contractPriceMapper;
|
||||
@Resource
|
||||
private ContractNotMapper contractNotMapper;
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
@Resource
|
||||
private BpmProcessInstanceApi bpmProcessInstanceApi;
|
||||
@Resource
|
||||
private BpmTaskApi bpmTaskApi;
|
||||
|
||||
@Override
|
||||
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||
@@ -315,7 +332,7 @@ public class ContractServiceImpl implements ContractService {
|
||||
|
||||
// 查询合同是否存在
|
||||
ContractMainDO oldContractMainDO = contractMainMapper.selectById(id);
|
||||
if (contractMainMapper.selectById(id) == null) {
|
||||
if (oldContractMainDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@@ -512,6 +529,211 @@ public class ContractServiceImpl implements ContractService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String submitApproval(Long id) {
|
||||
|
||||
// 判断主键
|
||||
if (ObjectUtils.isEmpty(id)) {
|
||||
throw exception(CONTRACT_ID_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 查询合同是否存在
|
||||
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
|
||||
if (contractMainDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 合同内容校验 TODO
|
||||
verifyContract(get(id));
|
||||
|
||||
// 查询用户
|
||||
AdminUserRespDTO adminUserRespDTO = adminUserApi
|
||||
.getUser(SecurityFrameworkUtils.getLoginUserId()).getData();
|
||||
|
||||
// 先创建流程,后更新状态
|
||||
BpmProcessInstanceCreateReqDTO pidto = new BpmProcessInstanceCreateReqDTO();
|
||||
pidto.setProcessDefinitionKey(ProcessConstants.CONTRACT_APPROVAL_PROCESS);
|
||||
pidto.setBusinessKey(String.valueOf(id));
|
||||
String data = bpmProcessInstanceApi.createProcessInstance(adminUserRespDTO.getId(), pidto).getData();
|
||||
if (StringUtils.isNotBlank(data)) {
|
||||
// 获取流程当前审批的任务节点
|
||||
List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(data).getData();
|
||||
contractMainDO.setProcessInstanceId(data);
|
||||
if (CollectionUtils.isNotEmpty(taskList)) {
|
||||
BpmTaskRespDTO undoTask = taskList.get(taskList.size() - 1);
|
||||
contractMainDO.setTaskNodeId(undoTask.getId());
|
||||
}
|
||||
contractMainDO.setStatus(ContractStatusEnum.UNDER_REVIEW.getCode());
|
||||
contractMainMapper.updateById(contractMainDO);
|
||||
return "提交审批成功";
|
||||
}
|
||||
|
||||
return "提交审批失败";
|
||||
}
|
||||
|
||||
private void verifyContract(ContractViewRespVO contract) {
|
||||
|
||||
/* 合同基本信息 */
|
||||
// 甲方公司编号不能为空
|
||||
if (StringUtils.isBlank(contract.getPurchaseCompanyNumber())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PRCH_CPN_NUM_LABEL);
|
||||
}
|
||||
// 甲方公司名称不能为空
|
||||
if (StringUtils.isBlank(contract.getPurchaseCompanyName())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PRCH_CPN_NAME_LABEL);
|
||||
}
|
||||
// 甲方地址不能为空
|
||||
if (StringUtils.isBlank(contract.getPurchaseAddress())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PRCH_ADR_LABEL);
|
||||
}
|
||||
// 甲方法定代表人能为空
|
||||
if (StringUtils.isBlank(contract.getPurchaseLeader())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PRCH_LDR_LABEL);
|
||||
}
|
||||
// 乙方公司编号不能为空
|
||||
if (StringUtils.isBlank(contract.getSalesCompanyNumber())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SALE_CPN_NUM_LABEL);
|
||||
}
|
||||
// 乙方公司名称不能为空
|
||||
if (StringUtils.isBlank(contract.getSalesCompanyName())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SALE_CPN_NAME_LABEL);
|
||||
}
|
||||
// 乙方地址不能为空
|
||||
if (StringUtils.isBlank(contract.getSalesAddress())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SALE_ADR_LABEL);
|
||||
}
|
||||
// 乙方法定代表人能为空
|
||||
if (StringUtils.isBlank(contract.getSalesPurchaseLeader())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SALE_PRCH_LDR_LABEL);
|
||||
}
|
||||
// 合同名称不能为空
|
||||
if (StringUtils.isBlank(contract.getContractName())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_CTRT_NAME_LABEL);
|
||||
}
|
||||
// 合同编号不能为空
|
||||
if (StringUtils.isBlank(contract.getContractPaperNumber())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_CTRT_PPR_NUM_LABEL);
|
||||
}
|
||||
// 类别不能为空
|
||||
if (StringUtils.isBlank(contract.getCategory())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_CTGR_LABEL);
|
||||
}
|
||||
// 收支性质不能为空
|
||||
if (StringUtils.isBlank(contract.getDirection())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_DRCT_LABEL);
|
||||
}
|
||||
// 签署日期不能为空
|
||||
if (contract.getSignDate() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SGN_DT_LABEL);
|
||||
}
|
||||
// 开始日期不能为空
|
||||
if (contract.getStartDate() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_STRT_DT_LABEL);
|
||||
}
|
||||
// 结束日期不能为空
|
||||
if (contract.getEndDate() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_END_DT_LABEL);
|
||||
}
|
||||
// 签署地不能为空
|
||||
if (StringUtils.isBlank(contract.getSignPlace())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SGN_PLCE_LABEL);
|
||||
}
|
||||
|
||||
/* 金额信息 */
|
||||
// 币种不能为空
|
||||
if (StringUtils.isBlank(contract.getCurrency())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_CUR_LABEL);
|
||||
}
|
||||
// 本币金额不能为空
|
||||
if (contract.getBasicAmount() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_BSC_AMT_LABEL);
|
||||
}
|
||||
// 原币金额不能为空
|
||||
if (contract.getCooAmount() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_COO_AMT_LABEL);
|
||||
}
|
||||
// 是否有履约保证金不能为空
|
||||
if (StringUtils.isBlank(contract.getHasDeposit())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_HS_DPST_LABEL);
|
||||
}
|
||||
// 是否有履约保证金为是的情况
|
||||
if (ErpCtrtYesNoEnum.YES.getCode().equals(contract.getHasDeposit())) {
|
||||
// 原币履约保证金不能为空
|
||||
if (contract.getCooAmountDeposit() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_COO_AMT_DPST_LABEL);
|
||||
}
|
||||
// 本币履约保证金不能为空
|
||||
if (contract.getBasicAmountDeposit() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_BSC_AMT_DPST_LABEL);
|
||||
}
|
||||
}
|
||||
// 是否有预付款不能为空
|
||||
if (StringUtils.isBlank(contract.getHasPrepayment())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_HS_PPYM_LABEL);
|
||||
}
|
||||
// 是否有预付款为是的情况
|
||||
if (ErpCtrtYesNoEnum.YES.getCode().equals(contract.getHasPrepayment())) {
|
||||
// 预付款比例不能为空
|
||||
if (contract.getPrepaymentRatio() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PPYM_RTIO_LABEL);
|
||||
}
|
||||
// 预付款金额不能为空
|
||||
if (contract.getPrepaymentAmount() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PPYM_AMT_LABEL);
|
||||
}
|
||||
}
|
||||
// 是否有质保金不能为空
|
||||
if (StringUtils.isBlank(contract.getHasQualityAmount())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_HS_QLT_AMT_LABEL);
|
||||
}
|
||||
// 是否有质保金为是的情况
|
||||
if (ErpCtrtYesNoEnum.YES.getCode().equals(contract.getHasPrepayment())) {
|
||||
// 质保金比例不能为空
|
||||
if (contract.getQualityRatio() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_QLT_RTIO_LABEL);
|
||||
}
|
||||
// 质保金金额不能为空
|
||||
if (contract.getQualityAmount() != null) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_QLT_AMT_LABEL);
|
||||
}
|
||||
}
|
||||
// 是否先款后货不能为空
|
||||
if (StringUtils.isBlank(contract.getHasPayable())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_HS_PYBL_LABEL);
|
||||
}
|
||||
|
||||
/* 物料信息 */
|
||||
// 物料名称不能为空
|
||||
// 数量不能为空
|
||||
// 计量单位不能为空
|
||||
|
||||
/* 扩展信息 */
|
||||
// 是否框架合同不能为空
|
||||
if (StringUtils.isBlank(contract.getIsFramework())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_IS_FMWK_LABEL);
|
||||
}
|
||||
// 境内/境外不能为空
|
||||
if (StringUtils.isBlank(contract.getIsDomestic())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_IS_DOM_LABEL);
|
||||
}
|
||||
// 施工类型编号不能为空
|
||||
if (StringUtils.isBlank(contract.getConstructionTypeNumber())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_CON_TP_NUM_LABEL);
|
||||
}
|
||||
// 施工类型名称不能为空
|
||||
if (StringUtils.isBlank(contract.getConstructionTypeName())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_CON_TP_NAME_LABEL);
|
||||
}
|
||||
// 代理方不能为空
|
||||
if (StringUtils.isBlank(contract.getAgent())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_AGT_LABEL);
|
||||
}
|
||||
// 是否虚拟合同不能为空
|
||||
if (StringUtils.isBlank(contract.getContractVirtual())) {
|
||||
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_CTRT_VRTL_LABEL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成系统合同编号
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user