Browse Source

合同需求修改查询,返回字段

yusm 2 tháng trước cách đây
mục cha
commit
ba52acdf46

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Contract.java

@@ -223,7 +223,7 @@ public class Contract extends Model<Contract> {
     private Integer departmentId;
 
     @TableField(exist = false)
-    private Integer departmentName;
+    private String departmentName;
 
     @TableField(exist = false)
     private BigDecimal invoicedAmount;

+ 12 - 16
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -147,25 +147,21 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             }
             List<Contract> contracts = new ArrayList<>();
             Long totalCnt=0L;
-            if (user.getCompanyId()== Constant.JUN_TIAN_COMPANY_ID){
-                int type=0;
-                Integer dept=user.getDepartmentId();
-                String userId=user.getId();
-                if (isAll){
-                    type=1;//查看全部
-                }else if (isNotAll) {
-                    type=2;//查看对应部门
-                }else {
-                    type=3;//查看个人
-                }
-                contracts = contractMapper.selectContractWithType(user.getCompanyId(), pageStart, pageSize, number, name , typeName , status, startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,type,dept,userId);
-                totalCnt = contractMapper.selectContractCntWithType(user.getCompanyId(), number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,type,dept,userId);
 
+            int type=0;
+            Integer dept=user.getDepartmentId();
+            String userId=user.getId();
+            if (isAll){
+                type=1;//查看全部
+            }else if (isNotAll) {
+                type=2;//查看对应部门
             }else {
-                contracts = contractMapper.selectContract(user.getCompanyId(), pageStart, pageSize, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId, customerOrg, finishStatus);
-                totalCnt = contractMapper.selectContractCnt(user.getCompanyId(), number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId, customerOrg, finishStatus);
-
+                type=3;//查看个人
             }
+            contracts = contractMapper.selectContractWithType(user.getCompanyId(), pageStart, pageSize, number, name , typeName , status, startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,type,dept,userId);
+            totalCnt = contractMapper.selectContractCntWithType(user.getCompanyId(), number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,type,dept,userId);
+
+
             //首先获取所有合同的Id
             List<Integer> contractCollect = contracts.stream().map(c -> c.getId()).collect(Collectors.toList());
             List<ContractPayment> contractPaymentList = contractPaymentMapper.selectList(new QueryWrapper<ContractPayment>().in("contract_id", contractCollect));

+ 3 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ContractMapper.xml

@@ -31,7 +31,7 @@
         select contract.id,contract.company_id,contract.creator_id,contract.number,contract.name,contract.amounts,contract.type_id,sys_dict.name typeName,contract.status,contract.indate,contract.remarks,
         contract.start_date as startDate,contract.end_date as endDate,contract_type_sec.sec_type_name,contract.sec_type_id,
         user.name as creatorName,user.corpwx_userid as creatorWxCorpId, contract.project_id, contract.payment, cp.pay_date AS next_payment_date, cp.amount AS next_payment_amount,
-        contract.plate1,contract.plate2,contract.plate3,contract.plate4,contract.plate5,contract.need_pin,contract.pin_time,contract.department_id,d.department_name as departmentName
+        contract.plate1,contract.plate2,contract.plate3,contract.plate4,contract.plate5,contract.need_pin,contract.pin_time,contract.department_id
         from contract
         left join sys_dict on contract.type_id = sys_dict.id
         left join contract_type_sec on contract.sec_type_id = contract_type_sec.id
@@ -39,7 +39,6 @@
         left join user
         on contract.creator_id = user.id
         left join contract_custom cc on cc.contract_id=contract.id
-        left join department d.department_id=contract.department_id
         where contract.company_id = #{companyId}
         <if test="number!=null">
             and number like CONCAT('%', #{number}, '%')
@@ -168,7 +167,7 @@
         left join user
         on contract.creator_id = user.id
         left join contract_custom cc on cc.contract_id=contract.id
-        left join department d.department_id=contract.department_id
+        left join department d on  d.department_id=contract.department_id
         where contract.company_id = #{companyId}
         <if test="number!=null">
             and number like CONCAT('%', #{number}, '%')
@@ -216,7 +215,7 @@
         left join user
         on contract.creator_id = user.id
         left join contract_custom cc on cc.contract_id=contract.id
-        left join department d.department_id=contract.department_id
+        left join department d on d.department_id=contract.department_id
         where contract.company_id = #{companyId}
         <if test="number!=null">
             and number like CONCAT('%', #{number}, '%')