Browse Source

成本报表 发运明细

liuchaohui 2 years ago
parent
commit
e75bbdd1ea

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/impl/SyCostAllocationServiceImpl.java

@@ -244,6 +244,21 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
             list4.add(Ingredient);
         }
 
+        //发运明细
+        String sqlShipdetail = "SELECT sh.cDefine10 as invoiceNum,sh.iExchRate as exchangeRate,sh.cSOCode as orderNum,c.cInvName AS poStyleNum," +
+                "shs.iTaxUnitPrice as exportUnitPrice" +
+                " FROM SaleBillVouch sh join SaleBillVouchs shs on sh.SBVID = shs.SBVID " +
+                " left join Inventory c on c.cInvCode=shs.cInvCode" +
+                " WHERE sh.cSOCode = '"+syCostAllocation.getGarmentContractno()+"'";
+        List<Map<String, Object>> listShipdetail  = senYuDataSourceOne.queryForList(sqlShipdetail);
+        List<JSONObject> Shipdetail = JsonChangeUtils.toJSONObject(listShipdetail);
+        List<SyCostAllocationShipdetail> Shipdetails = new ArrayList<>();
+        for (int i=0;i<Shipdetail.size();i++) {
+            SyCostAllocationShipdetail ship = JSONObject.toJavaObject(jianSon2.get(i), SyCostAllocationShipdetail.class);
+            Shipdetails.add(ship);
+        }
+
+
         //费用支出
         String sqlCostpay = "SELECT " +
                 "  sp.cSPVCode as disbursementSlipNo, " +
@@ -274,8 +289,10 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
             JSONObject jSONObject=new JSONObject();
             List<SyCostAllocationFabric> list3b = list3.stream().filter(t -> t.getProcessUnit().equals(unit)).collect(Collectors.toList());
             List<SyCostAllocationIngredient> list4b = list4.stream().filter(t -> t.getProcessUnit().equals(unit)).collect(Collectors.toList());
+            List<SyCostAllocationShipdetail> list5b = Shipdetails.stream().filter(t -> t.getProcessUnit().equals(unit)).collect(Collectors.toList());
             jSONObject.put("syCostAllocationFabricList", list3b);
             jSONObject.put("syCostAllocationIngredientList",list4b);
+            jSONObject.put("SyCostAllocationShipdetail",list5b);
             processUnitList.add(jSONObject);
         }
         syCostAllocation.setProcessUnitList(processUnitList);