Forráskód Böngészése

成本分配查询销售订单附件

zengtx 1 éve
szülő
commit
4b3cc90469

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/controller/SyCostAllocationController.java

@@ -28,6 +28,7 @@ import org.jeecg.modules.cost.entity.*;
 import org.jeecg.modules.cost.service.*;
 import org.jeecg.modules.cost.vo.SyCostAllocationPage;
 import org.jeecg.modules.demo.test.entity.JoaDemo;
+import org.jeecg.modules.report.entity.AccessorItem;
 import org.jeecg.modules.report.entity.FabricLoss;
 import org.jeecg.modules.report.entity.SyFabricLossReport;
 import org.jeecg.modules.report.mapper.FabricLossMapper;
@@ -87,6 +88,8 @@ public class SyCostAllocationController {
     CommonController commonController;
     @Autowired
     private IFabricLossService fabricLossService;
+    @Autowired
+    private FabricLossMapper fabricLossMapper;
 
     /**
      * 分页列表查询
@@ -126,10 +129,18 @@ public class SyCostAllocationController {
             throw new JeecgBootException("计划号不能为空!");
         }
         if(type.equals("query")){
+            // 销售订单附件
+            List<AccessorItem> accessorItemList = new ArrayList<>();
             List<SyCostJson> list = syCostAllocationService.queryByCostJson(plannum,0,1);
             if(list.size()>0){
                 syCostAllocation = JSON.parseObject(JSON.toJSONString(list.get(0).getCostInfo()), SyCostAllocation.class);
                 syCostAllocation.setAttachs(list.get(0).getAttachs());
+
+                if (org.jeecg.modules.system.util.oConvertUtils.isNotEmpty(syCostAllocation.getGarmentContractno())) {
+                    accessorItemList = fabricLossMapper.getSoAccList(Arrays.asList(syCostAllocation.getGarmentContractno().split(",")));
+                    accessorItemList.forEach(e -> e.setFileurl("/report/FabricLoss/getFile?fileId=" + e.getCFileId() + "&filename=" + e.getFilename()));
+                }
+                syCostAllocation.setAccessorItemList(accessorItemList);
                 Result.OK(syCostAllocation);
             }else {
                 syCostAllocation=syCostAllocationService.queryByPlanNum(plannum,type);