jihs 4 gadi atpakaļ
vecāks
revīzija
d2239054bf

+ 1 - 0
src/main/java/org/jeecg/modules/archives/service/impl/projectManageBusinessOtherServiceImpl.java

@@ -43,6 +43,7 @@ public class projectManageBusinessOtherServiceImpl extends ServiceImpl<ProjectMa
         if(StringUtils.isNotBlank(other.getId())){
             lambdaQueryWrapper.eq(ProjectManageBusinessOther::getId, other.getId());
         }
+        lambdaQueryWrapper.orderByAsc(ProjectManageBusinessOther::getSort);
         return list(lambdaQueryWrapper);
     }
 }

+ 1 - 1
src/main/java/org/jeecg/modules/basedata/service/IBaseArchivesCollectionLineService.java

@@ -15,5 +15,5 @@ public interface IBaseArchivesCollectionLineService extends IService<BaseArchive
     /**
      * @desc 收付款条线所有数据 (key: id, value: name)
      */
-    Map<String, String> getDataMap();
+    Map<String, BaseArchivesCollectionLine> getDataMap();
 }

+ 2 - 2
src/main/java/org/jeecg/modules/basedata/service/impl/BaseArchivesCollectionLineServiceImpl.java

@@ -28,8 +28,8 @@ public class BaseArchivesCollectionLineServiceImpl extends ServiceImpl<BaseArchi
      * @desc 收付款条线所有数据 (key: id, value: name)
      */
     @Override
-    public Map<String, String> getDataMap() {
+    public Map<String, BaseArchivesCollectionLine> getDataMap() {
         List<BaseArchivesCollectionLine> list = list(new LambdaQueryWrapper<BaseArchivesCollectionLine>().eq(BaseArchivesCollectionLine :: getDelFlag, "0"));
-        return list.stream().collect(Collectors.toMap(BaseArchivesCollectionLine::getId, BaseArchivesCollectionLine::getName));
+        return list.stream().collect(Collectors.toMap(BaseArchivesCollectionLine::getId, t->t));
     }
 }

+ 73 - 18
src/main/java/org/jeecg/modules/report/service/impl/ProReportServiceImpl.java

@@ -18,6 +18,7 @@ import org.jeecg.modules.archives.entity.ProjectManageBusinessOther;
 import org.jeecg.modules.archives.service.ProjectManageArchivesAndBusinessService;
 import org.jeecg.modules.archives.service.ProjectManageArchivesService;
 import org.jeecg.modules.archives.service.ProjectManageBusinessOtherService;
+import org.jeecg.modules.basedata.entity.BaseArchivesCollectionLine;
 import org.jeecg.modules.basedata.service.IBaseArchivesCollectionLineService;
 import org.jeecg.modules.invoice.entity.InvoiceManagePurchase;
 import org.jeecg.modules.invoice.service.InvoiceManagePurchaseService;
@@ -38,6 +39,7 @@ import java.math.BigDecimal;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -115,7 +117,7 @@ public class ProReportServiceImpl implements ProReportService {
          //项目档案计划信息表Map
          Map<String, List<ProjectManageArchivesAndBusiness>> businessMap = businesses.stream().collect(Collectors.groupingBy(t -> t.getPlanType()+"&"+t.getPlanId()));
          //获取收付款条线
-         Map<String, String> CoLineMap = baseArchivesCollectionLineService.getDataMap();
+         Map<String, BaseArchivesCollectionLine> CoLineMap = baseArchivesCollectionLineService.getDataMap();
         //获取项目档案计划信息表数据
          List<ProjectManageBusinessOther> otherList = projectManageBusinessOtherService.getAll(new ProjectManageBusinessOther(id));
          //获取里程碑确认单
@@ -173,7 +175,7 @@ public class ProReportServiceImpl implements ProReportService {
     /**
      * @desc 配置收付款线条数据
      */
-    private void setSecondChildren(List<ProjectManageArchivesAndBusiness> businesses, ProStatisticsRespDTO respDTO, Map<String, String> CoLineMap,
+    private void setSecondChildren(List<ProjectManageArchivesAndBusiness> businesses, ProStatisticsRespDTO respDTO, Map<String, BaseArchivesCollectionLine> CoLineMap,
         List<ProjectManageBusinessOther> otherList, Map<String, List<ProjectManageArchivesAndBusiness>> businessMap, Map<String, List<ProWorkLogic>> logicMap,
         Map<String, List<ProWorkMilestone>> milestoneMap,  Map<String, List<PurchaseDataDTO>> purchaseDataMap, Map<String, List<SlipAllListDTO>> slipMap) {
         List<ProStatisticsTwoRespDTO> list = Lists.newArrayList();
@@ -189,19 +191,12 @@ public class ProReportServiceImpl implements ProReportService {
                         if(business.getPlanType() == 3){
                             continue;
                         }
-                        //处理其他数据
-                        if(i == 4){
-                            ProStatisticsTwoRespDTO twoRespDTO = new ProStatisticsTwoRespDTO(business, respDTO.getId());
-                            //处理回款计划
-                            twoRespDTO.setChildren(null);
-                            twoRespDTO.setIsLeaf(true);
-                            list.add(twoRespDTO);
-                            continue;
-                        }
 
+
+                        //里程碑1
                         ProStatisticsTwoRespDTO twoRespDTO = new ProStatisticsTwoRespDTO(business, respDTO.getId());
                         if(StringUtils.isNotBlank(business.getMileId1())){
-                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()));
+                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()).getCode());
                             twoRespDTO.setMileId(business.getMileId1());
                             twoRespDTO.setMileName(business.getMilestone1());
                             List<ProjectManageArchivesAndBusiness> others = businessMap.get("3&"+business.getPlanId());
@@ -213,8 +208,9 @@ public class ProReportServiceImpl implements ProReportService {
                             setThreeChildren(twoRespDTO, otherList, i, logicMap, milestoneMap, purchaseDataMap, slipMap);
 
                         }
+                        //里程碑2
                         if(StringUtils.isNotBlank(business.getMileId2())){
-                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()));
+                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()).getCode());
                             twoRespDTO.setMileId(business.getMileId2());
                             twoRespDTO.setMileName(business.getMilestone2());
                             List<ProjectManageArchivesAndBusiness> others = businessMap.get("3&"+business.getPlanId());
@@ -223,8 +219,9 @@ public class ProReportServiceImpl implements ProReportService {
                             }
                             setThreeChildren(twoRespDTO, otherList, i, logicMap, milestoneMap, purchaseDataMap, slipMap);
                         }
+                        //里程碑3
                         if(StringUtils.isNotBlank(business.getMileId3())){
-                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()));
+                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()).getCode());
                             twoRespDTO.setMileId(business.getMileId3());
                             twoRespDTO.setMilePrice(business.getPrice3());
                             twoRespDTO.setMileName(business.getMilestone3());
@@ -234,8 +231,9 @@ public class ProReportServiceImpl implements ProReportService {
                             }
                             setThreeChildren(twoRespDTO, otherList, i, logicMap, milestoneMap, purchaseDataMap, slipMap);
                         }
+                        //里程碑4
                         if(StringUtils.isNotBlank(business.getMileId4())){
-                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()));
+                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()).getCode());
                             twoRespDTO.setMileId(business.getMileId4());
                             twoRespDTO.setMileName(business.getMilestone4());
                             List<ProjectManageArchivesAndBusiness> others = businessMap.get("3&"+business.getPlanId());
@@ -244,8 +242,9 @@ public class ProReportServiceImpl implements ProReportService {
                             }
                             setThreeChildren(twoRespDTO, otherList, i, logicMap, milestoneMap, purchaseDataMap, slipMap);
                         }
+                        //里程碑5
                         if(StringUtils.isNotBlank(business.getMileId5())){
-                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()));
+                            twoRespDTO.setCoArchivesCode(CoLineMap.get(business.getPlanId()).getCode());
                             twoRespDTO.setMileId(business.getMileId5());
                             twoRespDTO.setMilePrice(business.getPrice5());
                             twoRespDTO.setMileName(business.getMilestone5());
@@ -282,7 +281,7 @@ public class ProReportServiceImpl implements ProReportService {
           Map<String, List<SlipAllListDTO>> slipMap) {
 
         List<ProStatisticsThreeRespDTO> respDTOS = Lists.newArrayList();
-        //计划类型 1.商务 2.实施 3.开发 4.服务
+        //计划类型 1.商务 2.实施 3.开发 4.服务 5.其他
          i++;
          for(ProjectManageBusinessOther other : otherList){
              if(other.getPlanType() == i && other.getMuilesId().equals(twoRespDTO.getMileId())){
@@ -353,12 +352,68 @@ public class ProReportServiceImpl implements ProReportService {
                  respDTOS.add(threeRespDTO);
              }
          }
+          //设置其他数据
+         if(i == 5){
+             ProjectManageBusinessOther other = new ProjectManageBusinessOther();
+             ProStatisticsThreeRespDTO threeRespDTO = new ProStatisticsThreeRespDTO(other, twoRespDTO);
+             threeRespDTO.setKey(UUID.randomUUID().toString());
+             threeRespDTO.setTitle(twoRespDTO.getMileName());
+             threeRespDTO.setMilesName(twoRespDTO.getMileName());
+
+             //配置 里程碑开票金额(销售发票)
+             List<PurchaseDataDTO> purchaseDataDTOS = purchaseDataMap.get("2");
+             if(!CollectionUtils.isEmpty(purchaseDataDTOS)) {
+                 for(PurchaseDataDTO purchaseDataDTO : purchaseDataDTOS) {
+                     if(twoRespDTO.getCoArchivesName().equals(purchaseDataDTO.getCoArchivesName()) &&
+                             threeRespDTO.getMilesName().equals(purchaseDataDTO.getProArchivesMilestone())) {
+                         threeRespDTO.setMileInvoice(purchaseDataDTO.getCoPrice());
+                     }
+                 }
+             }
+
+             //配置 里程碑收票(采购发票)
+             List<PurchaseDataDTO> purchaseDataDTOS2 = purchaseDataMap.get("1");
+             if(!CollectionUtils.isEmpty(purchaseDataDTOS2)) {
+                 for(PurchaseDataDTO purchaseDataDTO : purchaseDataDTOS2) {
+                     if(twoRespDTO.getCoArchivesName().equals(purchaseDataDTO.getCoArchivesName()) &&
+                             threeRespDTO.getMilesName().equals(purchaseDataDTO.getProArchivesMilestone())) {
+                         threeRespDTO.setMileTicket(purchaseDataDTO.getCoPrice());
+                     }
+                 }
+             }
+             //里程碑实际收款 (收款单)
+             List<SlipAllListDTO> slipAllListDTOS = slipMap.get("1");
+             if(!CollectionUtils.isEmpty(slipAllListDTOS)) {
+                 for(SlipAllListDTO slipAllListDTO : slipAllListDTOS) {
+                     if(slipAllListDTO.getCoArchivesName().equals(twoRespDTO.getCoArchivesName()) &&
+                             slipAllListDTO.getProArchivesMilestone().equals(threeRespDTO.getMilesName())) {
+                         threeRespDTO.setMileRealCollecion(slipAllListDTO.getCoPrvice());
+                     }
+                 }
+             }
+             //里程碑实际收款 (收款单)
+             List<SlipAllListDTO> slipAllListDTOS2 = slipMap.get("2");
+             if(!CollectionUtils.isEmpty(slipAllListDTOS2)) {
+                 for(SlipAllListDTO slipAllListDTO : slipAllListDTOS2) {
+                     if(slipAllListDTO.getCoArchivesName().equals(twoRespDTO.getCoArchivesName()) &&
+                             slipAllListDTO.getProArchivesMilestone().equals(threeRespDTO.getMilesName())) {
+                         threeRespDTO.setMileRealPayment(slipAllListDTO.getCoPrvice());
+                     }
+                 }
+             }
+             threeRespDTO.setIsLeaf(true);
+             threeRespDTO.setChilderen(null);
+             respDTOS.add(threeRespDTO);
+
+         }
+
 
          if(CollectionUtils.isEmpty(twoRespDTO.getChildren())){
              twoRespDTO.setChildren(CollectionUtils.isEmpty(respDTOS)? null : respDTOS);
              return;
          }
-        twoRespDTO.setChildren(CollectionUtils.isEmpty(respDTOS)? null : Stream.concat(respDTOS.stream(), twoRespDTO.getChildren().stream()).collect(Collectors.toList()));
+        twoRespDTO.setChildren(CollectionUtils.isEmpty(respDTOS)? null : Stream.concat(twoRespDTO.getChildren().stream(),
+                respDTOS.stream()).collect(Collectors.toList()));
     }