|
@@ -152,7 +152,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
|
|
|
totalGrossWeight = totalGrossWeight.add(li.getGrossWeight());//总毛重
|
|
|
totalNetWeight = totalNetWeight.add(li.getNetWeight());//总净重
|
|
|
- if(li.getReadyFabric().equals("面料")){
|
|
|
+ if(li.getReadyFabric().equals("面料") || li.getReadyFabric().equals("辅料")){
|
|
|
//查询装箱单面料子表数据
|
|
|
QueryWrapper<SyPackingListFabricItem> queryWrapper = new QueryWrapper<SyPackingListFabricItem>();
|
|
|
queryWrapper.in("id",fabricItemIdList);
|
|
@@ -316,7 +316,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
}
|
|
|
//新增人名币
|
|
|
List<SyRmb> rmbList = syShippingOrder.getRmbList();
|
|
|
- if(rmbList.size()!=0){
|
|
|
+ if(rmbList.size()!=0 && oConvertUtils.isNotEmpty(rmbList.get(0).getAmount())){
|
|
|
for(SyRmb li:rmbList){
|
|
|
li.setId(oConvertUtils.id());
|
|
|
li.setSyLetterDepositId(id);
|
|
@@ -326,7 +326,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
}
|
|
|
//新增美元
|
|
|
List<SyUsd> usdList = syShippingOrder.getUsdList();
|
|
|
- if(usdList.size()!=0){
|
|
|
+ if(usdList.size()!=0 && oConvertUtils.isNotEmpty(usdList.get(0).getAmount())){
|
|
|
for(SyUsd li:usdList){
|
|
|
li.setId(oConvertUtils.id());
|
|
|
li.setSyLetterDepositId(id);
|
|
@@ -362,7 +362,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
List<SyShippingOrderItem> itemList = syShippingOrder.getSyShippingOrderItemList();
|
|
|
for(SyShippingOrderItem li:itemList){
|
|
|
|
|
|
- if(li.getReadyFabric().equals("面料")){
|
|
|
+ if(li.getReadyFabric().equals("面料") || li.getReadyFabric().equals("辅料")){
|
|
|
|
|
|
//查询预装箱但面料数据
|
|
|
SyPackingListFabric syPackingListFabric = syPackingListFabricService.getById(li.getTailoringFabricId());
|
|
@@ -575,115 +575,119 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
//业务场景
|
|
|
//一张托书有五个销售订单号,美元代币有三个,人民币代币有三个,此时需要生成30张销售费用支出单,每一个销售订单需要生成6个费用支出单,所以(5*6=30)
|
|
|
for(Map<String,Object> li: itemList){
|
|
|
- //人民币信息
|
|
|
- for(Map<String,Object> rmb:rmbList){
|
|
|
- ii++;
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
- Map<String,Object> mapPo;
|
|
|
|
|
|
- String orderId = li.get("orderId").toString();
|
|
|
- mapPo = syShippingOrderMapper.querySOMain(orderId);//li.get("orderId").toString()
|
|
|
+ if(rmbList.size()!=0) {
|
|
|
+ //人民币信息
|
|
|
+ for (Map<String, Object> rmb : rmbList) {
|
|
|
+ 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()
|
|
|
+
|
|
|
+ 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"));//业务员
|
|
|
+ map.put("cDepCode", mapPo.get("cDepCode"));//部门
|
|
|
+ map.put("cCusCode", mapPo.get("cCusCode"));//客户简称
|
|
|
+ map.put("cDefine10", map1.get("shippingOrderNumber"));//外销发票号
|
|
|
+ map.put("cVouchType", "PO");//单据类型
|
|
|
+ map.put("cMaker", map1.get("createBy"));//制单人
|
|
|
+ map.put("iSourceId", mapPo.get("ID"));//来源ID、
|
|
|
+ map.put("cSourceCode", li.get("orderNumber"));//订单号
|
|
|
+ map.put("cSOCode", li.get("orderNumber"));//订单号
|
|
|
+ map.put("cnextsystem", "其他应付单");//单据流向
|
|
|
+ map.put("iexchrate", "1");//汇率
|
|
|
+ map.put("Cexch_Name", "人民币");
|
|
|
+ map.put("iVTid", "57");
|
|
|
+
|
|
|
+ map.put("cvencode", rmb.get("freightForwarder"));
|
|
|
+ listmap.add(map);
|
|
|
+
|
|
|
+
|
|
|
+ //添加子表信息
|
|
|
+ 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("ID", id);
|
|
|
+ maps.put("irowno", "1");//行号
|
|
|
+ listmaps.add(maps);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(rmbList.size()!=0) {
|
|
|
+ //美元信息
|
|
|
+ for (Map<String, Object> usd : usdList) {
|
|
|
+ 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()
|
|
|
|
|
|
- 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("cSPVCode", cCode);//单据号
|
|
|
+ map.put("ID", id);//ID
|
|
|
//map.put("cVouchID",cVouchID);
|
|
|
- map.put("ID",id);//ID
|
|
|
- }
|
|
|
- map.put("dDate",sf.format(new Date()));//日期
|
|
|
- map.put("cPersonCode",mapPo.get("cPersonCode"));//业务员
|
|
|
- map.put("cDepCode",mapPo.get("cDepCode"));//部门
|
|
|
- map.put("cCusCode",mapPo.get("cCusCode"));//客户简称
|
|
|
- map.put("cDefine10",map1.get("shippingOrderNumber"));//外销发票号
|
|
|
- map.put("cVouchType","PO");//单据类型
|
|
|
- map.put("cMaker",map1.get("createBy"));//制单人
|
|
|
- map.put("iSourceId",mapPo.get("ID"));//来源ID、
|
|
|
- map.put("cSourceCode",li.get("orderNumber"));//订单号
|
|
|
- map.put("cSOCode",li.get("orderNumber"));//订单号
|
|
|
- map.put("cnextsystem","其他应付单");//单据流向
|
|
|
- map.put("iexchrate","1");//汇率
|
|
|
- map.put("Cexch_Name","人民币");
|
|
|
- map.put("iVTid","57");
|
|
|
-
|
|
|
- map.put("cvencode","");
|
|
|
- listmap.add(map);
|
|
|
-
|
|
|
-
|
|
|
- //添加子表信息
|
|
|
- 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("ID", id);
|
|
|
- maps.put("irowno","1");//行号
|
|
|
- listmaps.add(maps);
|
|
|
- }
|
|
|
|
|
|
- //美元信息
|
|
|
- for(Map<String,Object> usd:usdList){
|
|
|
- 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);
|
|
|
-
|
|
|
- map.put("dDate",sf.format(new Date()));//日期
|
|
|
- map.put("cPersonCode",mapPo.get("cPersonCode"));//业务员
|
|
|
- map.put("cDepCode",mapPo.get("cDepCode"));//部门
|
|
|
- map.put("cCusCode",mapPo.get("cCusCode"));//客户简称
|
|
|
- map.put("cDefine10",map1.get("shippingOrderNumber"));//外销发票号
|
|
|
- map.put("cVouchType","PO");//单据类型
|
|
|
- map.put("cMaker",map1.get("createBy"));//制单人
|
|
|
- map.put("iSourceId",mapPo.get("ID"));//来源ID、
|
|
|
- map.put("cSourceCode","SYW440-马菲羊-面料");//订单号li.get("orderNumber")
|
|
|
- map.put("cSOCode","SYW440-马菲羊-面料");//订单号
|
|
|
- map.put("cnextsystem","其他应付单");//单据流向
|
|
|
- map.put("iexchrate","1");//汇率
|
|
|
- map.put("Cexch_Name","美元");
|
|
|
- map.put("iVTid","57");//单据模板号
|
|
|
-
|
|
|
- listmap.add(map);
|
|
|
-
|
|
|
-
|
|
|
- //添加子表信息
|
|
|
- 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("ID", id);
|
|
|
- maps.put("irowno","1");//行号
|
|
|
- listmaps.add(maps);
|
|
|
- }
|
|
|
+ map.put("dDate", sf.format(new Date()));//日期
|
|
|
+ map.put("cPersonCode", mapPo.get("cPersonCode"));//业务员
|
|
|
+ map.put("cDepCode", mapPo.get("cDepCode"));//部门
|
|
|
+ map.put("cCusCode", mapPo.get("cCusCode"));//客户简称
|
|
|
+ map.put("cDefine10", map1.get("shippingOrderNumber"));//外销发票号
|
|
|
+ map.put("cVouchType", "PO");//单据类型
|
|
|
+ map.put("cMaker", map1.get("createBy"));//制单人
|
|
|
+ map.put("iSourceId", mapPo.get("ID"));//来源ID、
|
|
|
+ map.put("cSourceCode", li.get("orderNumber"));//订单号li.get("orderNumber")
|
|
|
+ map.put("cSOCode", li.get("orderNumber"));//订单号
|
|
|
+ map.put("cnextsystem", "其他应付单");//单据流向
|
|
|
+ map.put("iexchrate", "1");//汇率
|
|
|
+ map.put("Cexch_Name", "美元");
|
|
|
+ map.put("iVTid", "57");//单据模板号
|
|
|
+ map.put("cvencode", usd.get("freightForwarder"));
|
|
|
+ listmap.add(map);
|
|
|
+
|
|
|
+
|
|
|
+ //添加子表信息
|
|
|
+ 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("ID", id);
|
|
|
+ maps.put("irowno", "1");//行号
|
|
|
+ listmaps.add(maps);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
//循环新增主表
|
|
|
for(Map<String,Object> ma:listmap){
|
|
|
- // syShippingOrderMapper.saveSalePayVouch(ma);
|
|
|
+ syShippingOrderMapper.saveSalePayVouch(ma);
|
|
|
}
|
|
|
|
|
|
//循环新增子表
|
|
|
for(Map<String,Object> ma:listmaps){
|
|
|
- // syShippingOrderMapper.saveSalePayVouchs(ma);
|
|
|
+ syShippingOrderMapper.saveSalePayVouchs(ma);
|
|
|
}
|
|
|
|
|
|
//修改最大编码
|
|
|
- // purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(cCode),"09");
|
|
|
+ purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(cCode),"09");
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|