|
@@ -49,7 +49,7 @@ public class JyWorkContractService {
|
|
|
if (StringUtils.isNotEmpty(workContractInfoDto.getId())) {
|
|
|
JyWorkContractInfo info = jyWorkContractInfoMapper.selectById(workContractInfoDto.getId());
|
|
|
if (info != null) {
|
|
|
- workContractInfoDto.setContractTypes(null);
|
|
|
+// workContractInfoDto.setContractTypes(null);
|
|
|
return update(workContractInfoDto);
|
|
|
}
|
|
|
}
|
|
@@ -152,32 +152,35 @@ public class JyWorkContractService {
|
|
|
contractTypes = workContractInfoDto.getContractTypes();
|
|
|
String contractNo="";
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
- for (List<String> contractType : contractTypes) {
|
|
|
- if (contractType.size()>0){
|
|
|
- switch (contractType.get(0)){
|
|
|
- case "1": //环境监测
|
|
|
- contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
|
|
|
- break;
|
|
|
- case "2": //环境影响评价
|
|
|
- contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
|
|
|
- break;
|
|
|
- case "3": //水土保持
|
|
|
- contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
|
|
|
- break;
|
|
|
- case "4": //其他
|
|
|
- contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
|
|
|
- break;
|
|
|
- default:
|
|
|
- return null;
|
|
|
+ if (CollectionUtil.isNotEmpty(contractTypes)){
|
|
|
+ for (List<String> contractType : contractTypes) {
|
|
|
+ if (contractType.size()>0){
|
|
|
+ switch (contractType.get(0)){
|
|
|
+ case "1": //环境监测
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ case "2": //环境影响评价
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ case "3": //水土保持
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ case "4": //其他
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断合同类型是否有二级
|
|
|
+ if (contractType.size()>1){
|
|
|
+ sb.append(contractType.get(1)+",");
|
|
|
+ newType=sb.substring(0,sb.lastIndexOf(","));
|
|
|
}
|
|
|
- }
|
|
|
- //判断合同类型是否有二级
|
|
|
- if (contractType.size()>1){
|
|
|
- sb.append(contractType.get(1)+",");
|
|
|
- newType=sb.substring(0,sb.lastIndexOf(","));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//生成id
|
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
@@ -196,7 +199,9 @@ public class JyWorkContractService {
|
|
|
info.setClosingDate(workContractInfoDto.getClosingDate()); //结束日期
|
|
|
info.setContractDate(workContractInfoDto.getContractDate()); //签订日期
|
|
|
info.setContractType(newType);//合同类型(小类)
|
|
|
- info.setContractTypeFirst(contractTypes.get(0).get(0));
|
|
|
+ if (CollectionUtil.isNotEmpty(contractTypes)){
|
|
|
+ info.setContractTypeFirst(contractTypes.get(0).get(0));
|
|
|
+ }
|
|
|
info.setName(workContractInfoDto.getContractName()); //合同名称
|
|
|
info.setContractOpposite(workContractInfoDto.getContractOpposite()); //对方合同编号
|
|
|
info.setDepartment(workContractInfoDto.getDepartment());//所属部门
|
|
@@ -240,6 +245,43 @@ public class JyWorkContractService {
|
|
|
// info.setNo(serialNum);
|
|
|
info.setUpdateById(userDTO.getId());
|
|
|
info.setUpdateTime(new Date());
|
|
|
+ if (StringUtils.isBlank(workContractInfoDto.getContractNo())){
|
|
|
+ //合同编号生成
|
|
|
+ List<List<String>> contractTypes = new ArrayList<>();
|
|
|
+ String newType="";
|
|
|
+ contractTypes = workContractInfoDto.getContractTypes();
|
|
|
+ String contractNo="";
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (List<String> contractType : contractTypes) {
|
|
|
+ if (contractType.size()>0){
|
|
|
+ switch (contractType.get(0)){
|
|
|
+ case "1": //环境监测
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE4,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ case "2": //环境影响评价
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE3,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ case "3": //水土保持
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE2,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ case "4": //其他
|
|
|
+ contractNo=SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), JyWorkContractInfoDto.BIZ_CODE1,TokenProvider.getCurrentToken());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断合同类型是否有二级
|
|
|
+ if (contractType.size()>1){
|
|
|
+ sb.append(contractType.get(1)+",");
|
|
|
+ newType=sb.substring(0,sb.lastIndexOf(","));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ info.setNo(contractNo); //合同编号
|
|
|
+ info.setContractType(newType);//合同类型(小类)
|
|
|
+ info.setContractTypeFirst(contractTypes.get(0).get(0));
|
|
|
+ }
|
|
|
+ info.setName(workContractInfoDto.getContractName()); //合同名称
|
|
|
jyWorkContractInfoMapper.updateById(info);
|
|
|
List<WorkAttachmentInfo> list = workContractInfoDto.getWorkAttachmentList();
|
|
|
// if (CollectionUtil.isNotEmpty(list)) {
|