|
@@ -195,64 +195,79 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
|
|
pageList.setTotal(syCostLossReviewMapper.querylistCount(syCostLossReview, sumList, new ArrayList<>()));
|
|
pageList.setTotal(syCostLossReviewMapper.querylistCount(syCostLossReview, sumList, new ArrayList<>()));
|
|
}
|
|
}
|
|
|
|
|
|
- for (SyCostLossReview sy:pageList.getRecords()) {
|
|
|
|
-
|
|
|
|
- //赋值制单人
|
|
|
|
- List<String> list = syCostLossReviewService.queryMakerByplanNo(sy.getPlanNo());
|
|
|
|
- if (list.size() == 0) {
|
|
|
|
- sy.setMaker("");
|
|
|
|
- } else {
|
|
|
|
- for (int i = 0; i < list.size(); i++) {
|
|
|
|
- if (i == 0) {
|
|
|
|
- sy.setMaker(list.get(0));
|
|
|
|
- } else {
|
|
|
|
- sy.setMaker(sy.getMaker() + "," + list.get(i));
|
|
|
|
- }
|
|
|
|
|
|
+ //赋值制单人
|
|
|
|
+ List<SyCostLossReview> listPlanNo = syCostLossReviewService.queryMakerByplanNo();
|
|
|
|
+ Map<String, String> nameByCode = listPlanNo.stream()
|
|
|
|
+ .collect(Collectors.toMap(SyCostLossReview::getPlanNo, SyCostLossReview::getMaker));
|
|
|
|
+ //赋值面损审批数据
|
|
|
|
+ List<SyCostLossReview> list2 = syCostLossReviewService.querySyFabricLossByCode();
|
|
|
|
+ Map<String, SyCostLossReview> map2 = list2.stream()
|
|
|
|
+ .collect(Collectors.toMap(SyCostLossReview::getPlanNo, c2 -> c2));
|
|
|
|
+ //赋值成本审批数据
|
|
|
|
+ List<SyCostLossReview> list3 = syCostLossReviewService.queryCostAllocationByCode();
|
|
|
|
+ Map<String, SyCostLossReview> map3 = list3.stream()
|
|
|
|
+ .collect(Collectors.toMap(SyCostLossReview::getPlanNo, c3 -> c3));
|
|
|
|
+
|
|
|
|
+ //赋值计划统计单保存的数据
|
|
|
|
+ QueryWrapper wrapper = new QueryWrapper();
|
|
|
|
+ List<SyPlanStatistics> planStatistics =syPlanStatisticsService.list(wrapper);
|
|
|
|
+ Map<String, SyPlanStatistics> map4 = planStatistics.stream()
|
|
|
|
+ .collect(Collectors.toMap(SyPlanStatistics::getPlanNum, c4 -> c4));
|
|
|
|
+
|
|
|
|
+ //将制单人集合放进原始数据中去
|
|
|
|
+ pageList.getRecords().forEach(data -> data.setMaker(nameByCode.get(data.getPlanNo())));
|
|
|
|
+
|
|
|
|
+ pageList.getRecords().stream()
|
|
|
|
+ .map(c1 -> {
|
|
|
|
+ SyCostLossReview c2 = map2.get(c1.getPlanNo());
|
|
|
|
+ if (c2 != null) {
|
|
|
|
+ c1.setFsubmitDate(c2.getFsubmitDate());
|
|
|
|
+ c1.setFfirstApproveDate(c2.getFfirstApproveDate());
|
|
|
|
+ c1.setFfinalApproveDate(c2.getFfinalApproveDate());
|
|
|
|
+ c1.setFrejectDate(c2.getFrejectDate());
|
|
|
|
+ c1.setFstatus(c2.getFstatus());
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
- //赋值面损审批数据
|
|
|
|
- SyCostLossReview f = syCostLossReviewService.querySyFabricLossByCode(sy.getPlanNo());
|
|
|
|
- if(f!=null){
|
|
|
|
- sy.setFsubmitDate(f.getFsubmitDate());
|
|
|
|
- sy.setFfirstApproveDate(f.getFfirstApproveDate());
|
|
|
|
- sy.setFfinalApproveDate(f.getFfinalApproveDate());
|
|
|
|
- sy.setFrejectDate(f.getFrejectDate());
|
|
|
|
- sy.setFstatus(f.getFstatus());
|
|
|
|
-// //赋值成本审批数据
|
|
|
|
-// sy.setCsubmitDate(f.getCsubmitDate());
|
|
|
|
-// sy.setCfirstApproveDate(f.getCfirstApproveDate());
|
|
|
|
-// sy.setCfinalApproveDate(f.getCfinalApproveDate());
|
|
|
|
-// sy.setCrejectDate(f.getCrejectDate());
|
|
|
|
-// sy.setCstatus(f.getCstatus());
|
|
|
|
-// //计划单数据
|
|
|
|
-// sy.setPlanMan(f.getPlanMan());
|
|
|
|
-// sy.setRemarks(f.getRemarks());
|
|
|
|
-// sy.setId(f.getId());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //赋值成本审批数据
|
|
|
|
- SyCostLossReview c = syCostLossReviewService.queryCostAllocationByCode(sy.getPlanNo());
|
|
|
|
- if(c!=null){
|
|
|
|
- sy.setCsubmitDate(c.getCsubmitDate());
|
|
|
|
- sy.setCfirstApproveDate(c.getCfirstApproveDate());
|
|
|
|
- sy.setCfinalApproveDate(c.getCfinalApproveDate());
|
|
|
|
- sy.setCrejectDate(c.getCrejectDate());
|
|
|
|
- sy.setCstatus(c.getCstatus());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- QueryWrapper wrapper = new QueryWrapper();
|
|
|
|
- wrapper.eq("plan_num",sy.getPlanNo());
|
|
|
|
- List<SyPlanStatistics> planStatistics =syPlanStatisticsService.list(wrapper);
|
|
|
|
- if(planStatistics!=null && planStatistics.size()>0){
|
|
|
|
- sy.setPlanMan(planStatistics.get(0).getPlanMan());
|
|
|
|
- sy.setRemarks(planStatistics.get(0).getRemarks());
|
|
|
|
- sy.setId(planStatistics.get(0).getId());
|
|
|
|
- //刷成衣结束日期
|
|
|
|
- sy.setReadyEndDate(planStatistics.get(0).getReadyEndDate());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ return c1;
|
|
|
|
+ })
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ pageList.getRecords().stream()
|
|
|
|
+ .map(c1 -> {
|
|
|
|
+ SyCostLossReview c2 = map3.get(c1.getPlanNo());
|
|
|
|
+ if (c2 != null) {
|
|
|
|
+ c1.setCsubmitDate(c2.getCsubmitDate());
|
|
|
|
+ c1.setCfirstApproveDate(c2.getCfirstApproveDate());
|
|
|
|
+ c1.setCfinalApproveDate(c2.getCfinalApproveDate());
|
|
|
|
+ c1.setCrejectDate(c2.getCrejectDate());
|
|
|
|
+ c1.setCstatus(c2.getCstatus());
|
|
|
|
+ }
|
|
|
|
+ return c1;
|
|
|
|
+ })
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ pageList.getRecords().stream()
|
|
|
|
+ .map(c1 -> {
|
|
|
|
+ SyPlanStatistics c2 = map4.get(c1.getPlanNo());
|
|
|
|
+ if (c2 != null) {
|
|
|
|
+ c1.setPlanMan(c2.getPlanMan());
|
|
|
|
+ c1.setRemarks(c2.getRemarks());
|
|
|
|
+ c1.setId(c2.getId());
|
|
|
|
+ //刷成衣结束日期
|
|
|
|
+ c1.setReadyEndDate(c2.getReadyEndDate());
|
|
|
|
+ }
|
|
|
|
+ return c1;
|
|
|
|
+ })
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// for (SyCostLossReview sy:pageList.getRecords()) {
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// if(planStatistics!=null && planStatistics.size()>0){
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// }
|
|
result.setResult(pageList);
|
|
result.setResult(pageList);
|
|
result.setSuccess(true);
|
|
result.setSuccess(true);
|
|
result.setMessage("查询成功!");
|
|
result.setMessage("查询成功!");
|