Quellcode durchsuchen

成本报表 表头添加数据字段

liuchaohui vor 2 Jahren
Ursprung
Commit
c3295f857c

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

@@ -164,7 +164,8 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
         //查询U8数据 表头
         String sqlQueryhard = "SELECT " +
                 "max(o.omCode) as planNum,max(c.cInvName) as poStyleNum,max(pe.cPersonName) as exportSales,max(ss.cSOCode) as garmentContractno," +
-                "max(de.cDepName) as department,max(cc.cCusAbbName) as customerShortame,v.cVenName as processUnit,max(ss.dDate) as outdata" +
+                "max(de.cDepName) as department,max(cc.cCusAbbName) as customerShortame,v.cVenName as processUnit,max(ss.dDate) as outdata," +
+                "max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal,sum(s.iSum) as salesrrdersOriginaltotal" +
                 " FROM" +
                 " SO_SODetails s" +
                 " LEFT JOIN SO_SOMain ss on ss.ID= s.ID" +
@@ -277,6 +278,18 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
         for (int i=0;i<costpay.size();i++) {
             SyCostAllocationCostpay syCostAllocationCostpay = JSONObject.toJavaObject(costpay.get(i), SyCostAllocationCostpay.class);
             syCostAllocationCostpays.add(syCostAllocationCostpay);
+            //费用支出单原币本币汇总 并 赋值给表头
+            if(syCostAllocation.getUsdExpense()==null){
+                syCostAllocation.setUsdExpense(syCostAllocationCostpay.getDisbursedOriginalmoney());
+            }else {
+                syCostAllocation.setUsdExpense(syCostAllocation.getUsdExpense().add(syCostAllocationCostpay.getDisbursedOriginalmoney()));
+            }
+
+            if(syCostAllocation.getRmbExpense()==null){
+                syCostAllocation.setRmbExpense(syCostAllocationCostpay.getDisbursedLocalmoney());
+            }else {
+                syCostAllocation.setRmbExpense(syCostAllocation.getRmbExpense().add(syCostAllocationCostpay.getDisbursedLocalmoney()));
+            }
         }
         syCostAllocation.setSyCostAllocationCostpayList(syCostAllocationCostpays);