Explorar o código

会计合同添加流程功能

user5 %!s(int64=2) %!d(string=hai) anos
pai
achega
730ea7db65

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java

@@ -46,7 +46,7 @@ public class ContractInfoController {
      * 合同登记新增/修改    cw:workContract:add
      */
     @ApiOperation(value = "合同登记新增/修改")
-    @PreAuthorize("hasAnyAuthority('cw:workContract:add')")
+    @PreAuthorize("hasAnyAuthority('cw:workContract:add','cw:workContract:edit')")
     @PostMapping(value = "save")
     public ResponseEntity<String> save(@RequestBody ContractInfo info) throws Exception{
         String id = service.saveInfo(info);

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java

@@ -50,6 +50,7 @@ public class ContractInfo extends BaseEntity {
     private Date signingDate;             //签约日期
     @Query(tableColumn = "a.contract_amount")
     private Double contractAmount;          //合同金额(元)
+    private Double predictAmount;          //预计金额(元)
     private Double actualContractAmount;    //合同实际金额
     private String contractNum;             //合同份数
     private String paymentAgreement;        //付款约定

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml

@@ -119,6 +119,7 @@
             a.contract_approval_type as contractApprovalType,
             a.proc_ins_id as procInsId,
             a.status,
+            a.predict_amount as "predictAmount",
             b.filed_type as filedType,
             d.filed_paper_type as filedPaperType,
             d.filed_no as filedNo,

+ 4 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFilePaperService.java

@@ -83,13 +83,13 @@ public class ContractFilePaperService {
         file.setUpdateBy(userDTO.getId());
         file.setUpdateDate(new Date());
         mapper.updateById(file);
-        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        /*List<WorkAttachmentDto> list = filePaper.getContractInfoList();
         if (CollectionUtils.isNotEmpty(list)) {
             updateFiles(list, userDTO, file.getId());
         }else {
             //删除文件信息
             mapper.deleteFileInfo(file.getId());
-        }
+        }*/
         return file.getId();
     }
 
@@ -109,10 +109,10 @@ public class ContractFilePaperService {
         file.setUpdateBy(userDTO.getId());
         file.setUpdateDate(new Date());
         mapper.insert(file);
-        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        /*List<WorkAttachmentDto> list = filePaper.getContractInfoList();
         if (CollectionUtils.isNotEmpty(list)) {
             saveFiles(list, userDTO, id);
-        }
+        }*/
         return id;
     }
 

+ 51 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java

@@ -87,6 +87,11 @@ public class ContractInfoService {
      */
     public void updatePaperInfo(ContractInfo info) {
         mapper.updatePaperInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType(), info.getFiledPaperType());
+        List<WorkAttachmentDto> list = info.getContractInfoList();
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, info.getId());
+        }
     }
 
     public IPage<ContractInfo> list(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
@@ -133,8 +138,15 @@ public class ContractInfoService {
             }
         }
         //7、状态
-        if (StringUtils.isNotEmpty(info.getStatus())) {
-            wrapper.like("a.status", info.getStatus());
+        //判断 状态是否包含 逗号
+        if(StringUtils.isNotBlank(info.getStatus())){
+            if (info.getStatus().contains(",")) {
+                List<String> statusList = Lists.newLinkedList();
+                statusList = Arrays.asList(info.getStatus().split(","));
+                wrapper.in("a.status", statusList);
+            }else{
+                wrapper.like("a.status", info.getStatus());
+            }
         }
         //8、归档状态
         if (StringUtils.isNotEmpty(info.getFiledType())) {
@@ -144,6 +156,10 @@ public class ContractInfoService {
         if (StringUtils.isNotEmpty(info.getFiledPaperType())) {
             wrapper.like("a.filed_paper_type", info.getFiledPaperType());
         }
+        //委托方名称
+        if (StringUtils.isNotBlank(info.getClientContactsName())) {
+            wrapper.like("cw_wcb.name", info.getClientContactsName());
+        }
         wrapper.eq("a.del_flag","0");
 
 
@@ -206,6 +222,7 @@ public class ContractInfoService {
     public ContractInfo findById(String id) {
 
         ContractInfo dto = mapper.findById(id);
+        List<WorkAttachmentDto> fileList = Lists.newArrayList();
 
         if (dto != null){
             List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
@@ -217,6 +234,7 @@ public class ContractInfoService {
                     i.setCreateBy(UserUtils.get(i.getBy()));
                 }
             }
+            fileList.addAll(dtos);
             List<CwWorkClientBaseDTO> list = new ArrayList<>();
             if (participant.size()>0){
                 participant.forEach(cw->{
@@ -248,12 +266,13 @@ public class ContractInfoService {
                     for (WorkAttachmentDto i : fileDtos) {
                         i.setCreateBy(UserUtils.get(i.getBy()));
                     }
-                    dto.setContractInfoList(fileDtos);
+                    fileList.addAll(fileDtos);
+                    //dto.setContractInfoList(fileDtos);
                 }
             }
 
             dto.setCwWorkClientContactDTOList(list);
-            dto.setContractProperList(dtos);
+            dto.setContractProperList(fileList);
         } else {
             //穿来的是归档的id
             ContractFile infoByConId = fileMapper.getById(id);
@@ -269,6 +288,7 @@ public class ContractInfoService {
                             i.setCreateBy(UserUtils.get(i.getBy()));
                         }
                     }
+                    fileList.addAll(dtos);
                     List<CwWorkClientBaseDTO> list = new ArrayList<>();
                     if (participant.size()>0){
                         participant.forEach(cw->{
@@ -286,12 +306,13 @@ public class ContractInfoService {
                             for (WorkAttachmentDto i : fileDtos) {
                                 i.setCreateBy(UserUtils.get(i.getBy()));
                             }
-                            dto.setContractInfoList(fileDtos);
+                            fileList.addAll(fileDtos);
+                            //dto.setContractInfoList(fileDtos);
                         }
                     }
 
                     dto.setCwWorkClientContactDTOList(list);
-                    dto.setContractProperList(dtos);
+                    dto.setContractProperList(fileList);
                 }
             } else {
                 //传过来的是纸质归档的id
@@ -309,6 +330,7 @@ public class ContractInfoService {
                                 i.setCreateBy(UserUtils.get(i.getBy()));
                             }
                         }
+                        fileList.addAll(dtos);
                         List<CwWorkClientBaseDTO> list = new ArrayList<>();
                         if (participant.size()>0){
                             participant.forEach(cw->{
@@ -325,7 +347,8 @@ public class ContractInfoService {
                             for (WorkAttachmentDto i : fileDtos) {
                                 i.setCreateBy(UserUtils.get(i.getBy()));
                             }
-                            dto.setContractInfoList(fileDtos);
+                            fileList.addAll(fileDtos);
+                            //dto.setContractInfoList(fileDtos);
                         }
 //                        //估计合同登记id查出归档信息
 //                        ContractFile contractFile = fileMapper.getInfoByConId(dto.getId());
@@ -341,7 +364,7 @@ public class ContractInfoService {
 //                        }
 
                         dto.setCwWorkClientContactDTOList(list);
-                        dto.setContractProperList(dtos);
+                        dto.setContractProperList(fileList);
                     }
                 }
             }
@@ -426,12 +449,31 @@ public class ContractInfoService {
     public String update(ContractInfo info) throws Exception{
         //获取当前登录人信息
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
-        //合同编号生成
+
         ContractInfo contractInfo = new ContractInfo();
         BeanUtils.copyProperties(info, contractInfo);
         contractInfo.setUpdateBy(userDTO.getId());
         contractInfo.setUpdateDate(new Date());
 
+        //合同编号生成
+        String serialNum = "";
+        if (StringUtils.isNotBlank(contractInfo.getContractType()) && StringUtils.isBlank(contractInfo.getContractNo())){
+            if (contractInfo.getContractType().equals("1")){
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER1);
+            } else if (contractInfo.getContractType().equals("2")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER2);
+            } else if (contractInfo.getContractType().equals("3")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER3);
+            } else if (contractInfo.getContractType().equals("4")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER4);
+            } else if (contractInfo.getContractType().equals("5")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER5);
+            } else if (contractInfo.getContractType().equals("6")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER6);
+            }
+            contractInfo.setContractNo(serialNum);
+        }
+
         if (StringUtils.isNotEmpty(contractInfo.getStatus()) &&!contractInfo.getStatus().equals("5")){
             int num = Integer.parseInt(contractInfo.getChangeNum()) + 1;
             contractInfo.setChangeNum(num + "");