Jelajahi Sumber

OA消息优化

ljy121 1 tahun lalu
induk
melakukan
c840d7dadf

+ 3 - 0
zjugis-business/src/main/java/com/zjugis/business/bean/dto/ContractInvoiceDto.java

@@ -4,6 +4,7 @@ import com.zjugis.framework.common.pojo.PageParam;
 import lombok.Data;
 
 import java.time.LocalDate;
+import java.util.List;
 
 
 /**
@@ -45,6 +46,8 @@ public class ContractInvoiceDto extends PageParam {
 
     private String managerId;
 
+    private List<String> idList;
+
 
 }
 

+ 15 - 10
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectCostServiceImpl.java

@@ -1,13 +1,14 @@
 package com.zjugis.business.service.impl;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.zjugis.business.bean.dto.ContractSubCostDto;
 import com.zjugis.business.bean.dto.ProjectCostDto;
 import com.zjugis.business.bean.entity.ProjectCost;
 import com.zjugis.business.bean.response.ProjectCostResponse;
 import com.zjugis.business.bean.response.ProjectMonthCostResponse;
 import com.zjugis.business.flow.commoncost.service.CommonCostService;
 import com.zjugis.business.flow.travelcost.service.TravelCostService;
+import com.zjugis.business.flow.usemoney.controller.vo.UseMoneyTypeRespVO;
+import com.zjugis.business.flow.usemoney.service.UseMoneyService;
 import com.zjugis.business.mapper.ContractMapper;
 import com.zjugis.business.mapper.ProjectCostMapper;
 import com.zjugis.business.service.ContractApplyService;
@@ -21,7 +22,6 @@ import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -40,6 +40,9 @@ public class ProjectCostServiceImpl implements ProjectCostService {
     @Autowired
     private ContractMapper contractMapper;
 
+    @Autowired
+    private UseMoneyService useMoneyService;
+
     @Autowired
     private ContractApplyService contractApplyService;
 
@@ -85,12 +88,12 @@ public class ProjectCostServiceImpl implements ProjectCostService {
     @Override
     public Map<String,ProjectCostResponse> calculateCostMap(ProjectCostDto projectCostDto) {
         List<ProjectCostResponse> costList = projectCostMapper.calculateList(projectCostDto);
-        List<ContractSubCostDto> subCostList = contractApplyService.selectSubCostByProjectIds(projectCostDto.getProjectIds());
+        List<UseMoneyTypeRespVO> subCostList = useMoneyService.getDataByProject(projectCostDto.getProjectIds());
         Map<String, BigDecimal> commonCostMap = commonCostService.getProjectCostMap(projectCostDto.getProjectIds());
         Map<String, BigDecimal> travelCostMap = travelCostService.getProjectCostMap(projectCostDto.getProjectIds());
-        Map<String, List<ContractSubCostDto>> subCostMap = null;
+        Map<String, List<UseMoneyTypeRespVO>> subCostMap = null;
         if(subCostList != null){
-            subCostMap = subCostList.stream().collect(Collectors.groupingBy(ContractSubCostDto::getProjectId));
+            subCostMap = subCostList.stream().collect(Collectors.groupingBy(UseMoneyTypeRespVO::getProjectId));
         }
         Map<String,ProjectCostResponse> costMap = new HashMap<>(costList.size());
         for (ProjectCostResponse item : costList) {
@@ -99,12 +102,14 @@ public class ProjectCostServiceImpl implements ProjectCostService {
             item.setReimbursementCost(commonCost == null ?BigDecimal.ZERO : commonCost);
             item.setTravelCost(travelCost== null ?BigDecimal.ZERO : travelCost);
             if(subCostMap != null && !subCostMap.isEmpty()){
-                List<ContractSubCostDto> list = subCostMap.get(item.getProjectId());
+                List<UseMoneyTypeRespVO> list = subCostMap.get(item.getProjectId());
                 if(list != null) {
-                    Optional<ContractSubCostDto> subCost = list.stream().filter(i -> (i.getContractType() != null && i.getContractType() == 1)).findFirst();
-                    Optional<ContractSubCostDto> outCost = list.stream().filter(i -> (i.getContractType() != null && i.getContractType() == 2)).findFirst();
-                    item.setSubcontractCost(subCost.isPresent() ? subCost.get().getSubCost() : BigDecimal.ZERO);
-                    item.setOutsourceCost(outCost.isPresent() ? outCost.get().getOutCost() : BigDecimal.ZERO);
+                    BigDecimal subCost = list.get(0).getSubAmount();
+                    BigDecimal outCost = list.get(0).getOutAmount();
+                    BigDecimal otherAmount = list.get(0).getOtherAmount();
+                    item.setSubcontractCost(subCost != null ? subCost : BigDecimal.ZERO);
+                    item.setOutsourceCost(outCost != null ? outCost : BigDecimal.ZERO);
+                    item.setPaymentCost(otherAmount != null ? otherAmount : BigDecimal.ZERO);
                 }
             }
             item.calcCost();

+ 6 - 0
zjugis-business/src/main/resources/mapper/oracle/ContractInvoiceMapper.xml

@@ -177,6 +177,12 @@
             <if test="params != null and params.isReturn == 1">
                 AND T3.rc > 0
             </if>
+            <if test="params != null and params.idList != null">
+                and T.ID IN
+                <foreach item="id" index="index" collection="params.idList" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
         </where>
         ORDER BY
         T.FLOW_FINISHTIME desc nulls last,

+ 6 - 1
zjugis-module-infra/zjugis-module-infra-biz/src/main/java/com/zjugis/module/infra/service/ding/DingServiceImpl.java

@@ -69,7 +69,12 @@ public class DingServiceImpl implements DingService{
     private void buildOA(OapiMessageCorpconversationAsyncsendV2Request.Msg msg, OA oa) {
         msg.setMsgtype("oa");
         OapiMessageCorpconversationAsyncsendV2Request.OA entity = new OapiMessageCorpconversationAsyncsendV2Request.OA();
-        BeanUtils.copyProperties(oa,entity);
+        OapiMessageCorpconversationAsyncsendV2Request.Head head = new OapiMessageCorpconversationAsyncsendV2Request.Head();
+        OapiMessageCorpconversationAsyncsendV2Request.Body body = new OapiMessageCorpconversationAsyncsendV2Request.Body();
+        BeanUtils.copyProperties(oa.getHead(),head);
+        BeanUtils.copyProperties(oa.getBody(),body);
+        entity.setHead(head);
+        entity.setBody(body);
         msg.setOa(entity);
     }