Browse Source

新增U8费用支出单

zengtx 1 year ago
parent
commit
f9275a15db

+ 21 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/service/impl/SyShippingOrderServiceImpl.java

@@ -498,12 +498,13 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
      * @param
      * @return
      */
+    @DS("multi-one")
     @Override
     public Integer saveSalePayVouchOne(Map<String,Object> map,List<Map<String,Object>> itemList,List<Map<String,Object>> rmbList,List<Map<String,Object>> udsList) {
         int i = this.saveSalePayVouch(map,itemList,rmbList,udsList);
         return i;
     }
-
+    @DS("multi-two")
     @Override
     public Integer saveSalePayVouchTwo(Map<String,Object> map,List<Map<String,Object>> itemList,List<Map<String,Object>> rmbList,List<Map<String,Object>> udsList) {
         int i = this.saveSalePayVouch(map,itemList,rmbList,udsList);
@@ -545,7 +546,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
 
 
     /**
-     * 新增
+     * 新增U8费用支出单
      * @param map1
      * @return
      */
@@ -622,29 +623,36 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
                     //添加子表信息
                     Map<String, Object> maps = new HashMap<>();
                     maps.put("cSPVCode", cCode);//销售支出单号
-                    maps.put("iMoney", new BigDecimal(li.get("grossWeight").toString()).multiply(new BigDecimal(rmb.get("amount").toString())));
-                    maps.put("cExpCode", "0000" + ii);//项目编码
+                    maps.put("iMoney", rmb.get("amount"));
+                    maps.put("cExpCode", rmb.get("itemColumn"));//项目编码
                     maps.put("ID", id);
                     maps.put("irowno", "1");//行号
                     listmaps.add(maps);
                 }
             }
 
-            if(rmbList.size()!=0) {
+            if(usdList.size()!=0) {
                 //美元信息
                 for (Map<String, Object> usd : usdList) {
+                    ii++;
                     Map<String, Object> map = new HashMap<>();
                     Map<String, Object> mapPo;
 
                     String orderId = li.get("orderId").toString();
                     mapPo = syShippingOrderMapper.querySOMain(orderId.substring(3, orderId.length()));//li.get("orderId").toString()
 
-                    cCode = org.jeecg.modules.system.util.oConvertUtils.addOne(cCode);
-                    //cVouchID = org.jeecg.modules.system.util.oConvertUtils.addOne(cVouchID);
-                    id = org.jeecg.modules.system.util.oConvertUtils.addOne(id);
-                    map.put("cSPVCode", cCode);//单据号
-                    map.put("ID", id);//ID
-                    //map.put("cVouchID",cVouchID);
+                    if (ii > 1) {
+                        cCode = org.jeecg.modules.system.util.oConvertUtils.addOne(cCode);
+                        //cVouchID = org.jeecg.modules.system.util.oConvertUtils.addOne(cVouchID);
+                        id = org.jeecg.modules.system.util.oConvertUtils.addOne(id);
+                        map.put("cSPVCode", cCode);//单据号
+                        // map.put("cVouchID",cVouchID);
+                        map.put("ID", id);//ID
+                    } else {
+                        map.put("cSPVCode", cCode);//单据号
+                        //map.put("cVouchID",cVouchID);
+                        map.put("ID", id);//ID
+                    }
 
                     map.put("dDate", sf.format(new Date()));//日期
                     map.put("cPersonCode", mapPo.get("cPersonCode"));//业务员
@@ -667,8 +675,8 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
                     //添加子表信息
                     Map<String, Object> maps = new HashMap<>();
                     maps.put("cSPVCode", cCode);//销售支出单号
-                    maps.put("iMoney", new BigDecimal(li.get("grossWeight").toString()).multiply(new BigDecimal(usd.get("amount").toString())));
-                    maps.put("cExpCode", "0000" + ii);//项目编码
+                    maps.put("iMoney", usd.get("amount"));
+                    maps.put("cExpCode",usd.get("itemColumn"));//项目编码
 
                     maps.put("ID", id);
                     maps.put("irowno", "1");//行号
@@ -677,7 +685,6 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
             }
         }
 
-
             //循环新增主表
             for(Map<String,Object> ma:listmap){
                 syShippingOrderMapper.saveSalePayVouch(ma);