|
@@ -621,29 +621,16 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
List<Map<String,Object>> listmaps = new ArrayList<>();
|
|
|
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd 00:00:00.000");
|
|
|
- SimpleDateFormat sf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
|
|
|
|
//记录每次ID
|
|
|
String id = "";
|
|
|
//记录每次单据号
|
|
|
String cCode = "";
|
|
|
- String cVouchID = "";
|
|
|
- //创建人
|
|
|
- String create = "";
|
|
|
+
|
|
|
//获取单据号加1
|
|
|
cCode= org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cSPVCode","SalePayVouch","cSPVCode"));
|
|
|
//获取ID
|
|
|
id = org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("ID","SalePayVouch","cSPVCode"));
|
|
|
- //单据id
|
|
|
- cVouchID = org.jeecg.modules.system.util.oConvertUtils.addOne(purchaseWarehousingMapper.getMaxCode("cVouchID","SalePayVouch","cSPVCode"));
|
|
|
-
|
|
|
- //设置创建人
|
|
|
- LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
- if(org.jeecg.modules.system.util.oConvertUtils.isEmpty(sysUser)){
|
|
|
- create = "admin";
|
|
|
- }else {
|
|
|
- create = sysUser.getRealname();
|
|
|
- }
|
|
|
//查询U8汇率
|
|
|
Map<String, Object> rate = null;
|
|
|
String nflat = "";
|
|
@@ -669,7 +656,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int ii = 0;
|
|
|
+
|
|
|
//记录运费总金额
|
|
|
Double sumMoney = 0.00;
|
|
|
|
|
@@ -694,7 +681,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
for(Map<String,Object> li: itemList){
|
|
|
|
|
|
if(rmbList.size()!=0) {
|
|
|
-
|
|
|
+ int ii = 0;
|
|
|
//人民币信息
|
|
|
for (Map<String, Object> rmb : rmbList) {
|
|
|
ii++;
|
|
@@ -706,14 +693,11 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
|
|
|
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()));//日期
|
|
@@ -721,7 +705,6 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
map.put("cDepCode", mapPo.get("cDepCode"));//部门
|
|
|
map.put("cCusCode", mapPo.get("cCusCode"));//客户简称
|
|
|
map.put("cDefine10", map1.get("shippingOrderNumber"));//外销发票号
|
|
|
- map.put("cVouchType", "P0");//单据类型
|
|
|
map.put("cMaker", "进出口平台管理员");//制单人
|
|
|
map.put("iSourceId", mapPo.get("ID"));//来源ID、
|
|
|
map.put("cSourceCode", li.get("orderNumber"));//订单号
|
|
@@ -731,25 +714,24 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
map.put("Cexch_Name", "人民币");
|
|
|
map.put("iVTid", "57");
|
|
|
map.put("cvencode", rmb.get("freightForwarder"));
|
|
|
- map.put("cVerifier",create);//审核人
|
|
|
- map.put("dverifydate",sf.format(new Date()));//审核日期
|
|
|
- map.put("dverifysystime",sf2.format(new Date()));//审核时间
|
|
|
+ map.put("cSysBarCode", "||SA09|"+cCode);
|
|
|
listmap.add(map);
|
|
|
|
|
|
|
|
|
//添加子表信息
|
|
|
Map<String, Object> maps = new HashMap<>();
|
|
|
maps.put("cSPVCode", cCode);//销售支出单号
|
|
|
- //金额 = 以销售订单号为维度计算对应销售订单号下的毛重合计数/总毛重“费用支出金额
|
|
|
+ //金额 = 以销售订单号为维度计算对应销售订单号下的毛重合计数/总毛重“费用支出金额
|
|
|
Double money = Double.parseDouble(li.get("grossWeight").toString()) / Double.parseDouble(map1.get("totalGrossWeight").toString());
|
|
|
BigDecimal imoney = new BigDecimal(money).multiply(new BigDecimal(rmb.get("amount").toString())).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
sumImoney = sumImoney.add(imoney);
|
|
|
|
|
|
- // System.out.println("人民币:"+money);
|
|
|
maps.put("iMoney", imoney);
|
|
|
+ maps.put("INatMoney", imoney);
|
|
|
maps.put("cExpCode", rmb.get("itemColumn"));//项目编码
|
|
|
maps.put("ID", id);
|
|
|
maps.put("irowno", ii);//行号
|
|
|
+ maps.put("cbSysBarCode", "||SA09|"+cCode+"|"+ii);
|
|
|
listmaps.add(maps);
|
|
|
|
|
|
|
|
@@ -757,6 +739,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
}
|
|
|
|
|
|
if(usdList.size()!=0) {
|
|
|
+ int ii = 0;
|
|
|
//美元信息
|
|
|
for (Map<String, Object> usd : usdList) {
|
|
|
ii++;
|
|
@@ -768,14 +751,11 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
@@ -784,7 +764,6 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
map.put("cDepCode", mapPo.get("cDepCode"));//部门
|
|
|
map.put("cCusCode", mapPo.get("cCusCode"));//客户简称
|
|
|
map.put("cDefine10", map1.get("shippingOrderNumber"));//外销发票号
|
|
|
- map.put("cVouchType", "P0");//单据类型
|
|
|
map.put("cMaker", "进出口平台管理员");//制单人
|
|
|
map.put("iSourceId", mapPo.get("ID"));//来源ID、
|
|
|
map.put("cSourceCode", li.get("orderNumber"));//订单号li.get("orderNumber")
|
|
@@ -794,12 +773,9 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
map.put("Cexch_Name", "美元");
|
|
|
map.put("iVTid", "57");//单据模板号
|
|
|
map.put("cvencode", usd.get("freightForwarder"));
|
|
|
- map.put("cVerifier",create);//审核人
|
|
|
- map.put("dverifydate",sf.format(new Date()));//审核日期
|
|
|
- map.put("dverifysystime",sf2.format(new Date()));//审核时间
|
|
|
+ map.put("cSysBarCode", "||SA09|"+cCode);
|
|
|
listmap.add(map);
|
|
|
|
|
|
-
|
|
|
//添加子表信息
|
|
|
Map<String, Object> maps = new HashMap<>();
|
|
|
maps.put("cSPVCode", cCode);//销售支出单号
|
|
@@ -807,7 +783,8 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
|
|
|
BigDecimal imoney = new BigDecimal(money).multiply(new BigDecimal(usd.get("amount").toString())).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
sumImoney = sumImoney.add(imoney);
|
|
|
|
|
|
- System.out.println("美元:"+money);
|
|
|
+ maps.put("cbSysBarCode", "||SA09|"+cCode+"|"+ii);
|
|
|
+ maps.put("INatMoney", imoney);
|
|
|
maps.put("iMoney", imoney);
|
|
|
maps.put("cExpCode",usd.get("itemColumn"));//项目编码
|
|
|
maps.put("ID", id);
|