Sfoglia il codice sorgente

项目登记中的合同可以查询所有

huangguoce 1 settimana fa
parent
commit
57981c9e7a

+ 28 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractInfoController.java

@@ -185,4 +185,32 @@ public class ContractInfoController {
         }
 
     }
+
+    /**
+     * 项目登记时,查询所有合同
+     * @param info
+     * @return
+     */
+    @ApiOperation(value = "项目登记查询所有合同")
+    @GetMapping("/projectRegContractList")
+    public ResponseEntity<IPage<ContractInfo>> projectRegContractList(ContractInfo info, Page<ContractInfo> page) throws Exception {
+        QueryWrapper<ContractInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ContractInfo.class);
+        IPage<ContractInfo> list = service.projectRegContractList(page,info,wrapper);
+        list.getRecords().stream().forEach(i -> {
+            // 项目登记
+            if (StringUtils.isNotBlank(i.getTaskId()) && StringUtils.isNotBlank(i.getStatus())) {
+                if ("2".equals(i.getStatus())) { // “审核中”的数据要获取数据审核人
+                    i.setAuditUserIds(flowTaskService.getTaskAuditUsers(i.getTaskId()));  // 获取数据审核人
+                }
+            }
+            // 纸质归档
+            if (StringUtils.isNotBlank(i.getFilePaperTaskId()) && StringUtils.isNotBlank(i.getFiledPaperType())) {
+                if ("2".equals(i.getFiledPaperType())) { // “审核中”的数据要获取数据审核人
+                    i.setAuditUserIdsFP(flowTaskService.getTaskAuditUsers(i.getFilePaperTaskId()));  // 获取数据审核人
+                }
+            }
+        });
+        return ResponseEntity.ok(list);
+    }
+
 }

+ 7 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractInfoMapper.java

@@ -95,4 +95,11 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
      * @return
      */
     List<ContractInfo> getByContractNameList(@Param("contractNameList") List<String> contractNameList, @Param("userId") String userId);
+
+    /**
+     * 项目登记时,查询所有合同
+     * @return
+     */
+    IPage<ContractInfo> projectRegContractList(Page<ContractInfo> page, @Param("officeIds") String officeIds, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
 }

+ 65 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractInfoMapper.xml

@@ -299,4 +299,69 @@
         </where>
     </select>
 
+    <select id="projectRegContractList" resultType="com.jeeplus.finance.contractRegistration.domain.ContractInfo">
+        SELECT
+            DISTINCT a.id,
+                     c.`name` AS create_by,
+                     c.`name` AS createName,
+                     c.`id` AS createId,
+                     a.create_time,
+                     a.update_by_id,
+                     a.update_time,
+                     a.del_flag,
+                     a.contract_no as contractNo,
+                     a.contract_name as contractName,
+                     a.payer_subject as payerSubject,
+                     a.payment_method as paymentMethod,
+                     DATE_FORMAT(a.signing_date,'%Y-%m-%d') as signingDate,
+                     a.contract_amount as contractAmount,
+                     a.actual_contract_amount as actualContractAmount,
+                     a.contract_num as contractNum,
+                     a.payment_agreement as paymentAgreement,
+                     a.change_num as changeNum,
+                     a.department,
+                     a.client_contacts as clientContacts,
+                     a.client_contacts_phone as clientContactsPhone,
+                     a.contract_approval_type as contractApprovalType,
+                     a.proc_ins_id as procInsId,
+                     a.process_definition_id as processDefinitionId,
+                     a.contract_amount_type,
+                     a.contract_opposite,
+                     a.contract_fee,
+                     a.payment_describe,
+                     a.contract_type,
+                     a.contract_serial_number,
+                     a.fees,
+                     a.status,
+                     b.filed_type as filedType,
+                     e.ID_ as taskFiledId,
+                     b.proc_ins_id as taskFiledProcInsId,
+                     d.name as departmentName,
+                     f.borrow_type,
+                     f.create_by_id as borrowUserId,
+                     g.ID_ as task_borrow_id,
+                     h.filed_paper_type as filedPaperType,
+                     h.filed_no as filedNo,
+                     h.confirm_filed_no as confirmFiledNo,
+                     h.proc_ins_id as taskFiledPaperProcInsId,
+                     cw_wcb.name as client_contacts_name,
+                     art.ID_ as task_id,
+                     art_fp.ID_ as file_paper_task_id
+        FROM
+            cw_work_contract_info a
+                LEFT JOIN cw_work_contract_file b on a.id = b.contract_info_id
+                LEFT JOIN sys_user c ON a.create_by_id = c.id
+                left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+                LEFT JOIN act_ru_task e ON b.proc_ins_id = e.PROC_INST_ID_
+                LEFT JOIN sys_office d on a.department = d.id
+                LEFT JOIN cw_work_contract_borrow f ON a.id = f.contract_info_id
+                LEFT JOIN act_ru_task g ON f.proc_ins_id = g.PROC_INST_ID_
+                LEFT JOIN cw_work_contract_file_paper h on a.id = h.contract_info_id
+                LEFT JOIN cw_work_client_base cw_wcb on a.client_contacts = cw_wcb.id and cw_wcb.del_flag = '0'
+                LEFT JOIN act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+                LEFT JOIN act_ru_task art_fp ON h.proc_ins_id = art_fp.PROC_INST_ID_
+            ${ew.customSqlSegment}
+        ORDER BY a.update_time DESC
+    </select>
+
 </mapper>

+ 83 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractInfoService.java

@@ -911,4 +911,87 @@ public class ContractInfoService {
     public List<ContractInfo> getByContractNameList(List<String> contractNameList,String userId) {
         return mapper.getByContractNameList(contractNameList,userId);
     }
+
+    /**
+     * 项目登记时,查询所有合同
+     * @param page
+     * @param info
+     * @param wrapper
+     * @return
+     */
+    public IPage<ContractInfo> projectRegContractList(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
+        //1、合同编号
+        if (StringUtils.isNotBlank(info.getContractNo())) {
+            wrapper.like("a.contract_no", info.getContractNo());
+        }
+        //案卷号
+        if (StringUtils.isNotBlank(info.getFiledNo())) {
+            wrapper.like("h.filed_no", info.getFiledNo());
+        }
+        //2、合同名称
+        if (StringUtils.isNotBlank(info.getContractName())) {
+            wrapper.like("a.contract_name", info.getContractName());
+        }
+        //3、合同金额(区间)
+        String[] contractAmounts = info.getContractAmounts();
+        if (contractAmounts != null) {
+            if (StringUtils.isNotBlank(contractAmounts[0])) {
+                wrapper.ge("a.contract_amount",contractAmounts[0]);
+            }
+            if (contractAmounts.length>1 && StringUtils.isNotBlank(contractAmounts[1])) {
+                wrapper.le("a.contract_amount", contractAmounts[1]);
+            }
+        }
+        //4、签约时间(区间)
+        String[] contractDates = info.getContractDates();
+        if (contractDates != null) {
+
+            wrapper.between("a.signing_date", contractDates[0], contractDates[1]);
+        }
+        //5、创建人
+        if (StringUtils.isNotBlank(info.getCreateById())) {
+            wrapper.like("c.`id`", info.getCreateById()).or().like("c.name", info.getCreateById());
+        }
+        //6、所属部门
+        if (StringUtils.isNotBlank(info.getDepartment())) {
+            //先根据id查出是否是父节点,是父节点则查出所有的子节点信息
+            List<String> childIds = mapper.findChildIds(info.getDepartment());
+            if ( null != childIds & childIds.size()>0){
+                childIds.add(info.getDepartment());
+                wrapper.in("a.department",childIds);
+            }else {
+                wrapper.eq("a.department", info.getDepartment());
+            }
+        }
+        //7、状态
+        //判断 状态是否包含 逗号
+        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.isNotBlank(info.getFiledType())) {
+            wrapper.like("a.filed_type", info.getFiledType());
+        }
+        //纸质归档
+        if (StringUtils.isNotBlank(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");
+
+        StringBuilder officeIds = new StringBuilder();
+
+        IPage<ContractInfo> pageList = mapper.projectRegContractList(page, officeIds.toString(), wrapper);
+
+        return pageList;
+    }
 }