|
@@ -670,17 +670,17 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
private PurchaseWarehousingMapper purchaseWarehousingMapper;
|
|
|
|
|
|
@DS("multi-one")
|
|
|
- public Map<String,String> one(List<SyPackingListTailoring> mains,Map<String,String> map){
|
|
|
+ public Map<String,Object> one(List<SyPackingListTailoring> mains,Map<String,Object> map){
|
|
|
return saveBatch(mains,map);
|
|
|
}
|
|
|
|
|
|
@DS("multi-two")
|
|
|
- public Map<String,String> two(List<SyPackingListTailoring> mains,Map<String,String> map){
|
|
|
+ public Map<String,Object> two(List<SyPackingListTailoring> mains,Map<String,Object> map){
|
|
|
return saveBatch(mains,map);
|
|
|
}
|
|
|
|
|
|
@DS("multi-three")
|
|
|
- public Map<String,String> three(List<SyPackingListTailoring> mains,Map<String,String> map){
|
|
|
+ public Map<String,Object> three(List<SyPackingListTailoring> mains,Map<String,Object> map){
|
|
|
return saveBatch(mains,map);
|
|
|
}
|
|
|
|
|
@@ -688,7 +688,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
return syPackingListTailoringMapper.getOrderDataId(id);
|
|
|
}
|
|
|
|
|
|
- Map<String,String> saveBatch(List<SyPackingListTailoring> mains,Map<String,String> mapt){
|
|
|
+ Map<String,Object> saveBatch(List<SyPackingListTailoring> mains,Map<String,Object> mapt){
|
|
|
if(mains==null||mains.size()==0){
|
|
|
return new HashMap();
|
|
|
}
|
|
@@ -704,6 +704,8 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
JSONArray mapLists=new JSONArray();
|
|
|
|
|
|
for (SyPackingListTailoring main : mains){
|
|
|
+ Map<String,String> mapSort=new HashMap<>();
|
|
|
+
|
|
|
String createBy="进出口平台管理员";
|
|
|
JSONObject map=new JSONObject();
|
|
|
map.put("CVOUCHCODE",purchaseWarehousingMapper.getMaxCode("id+1","RdRecord01","dnmaketime"));
|
|
@@ -751,19 +753,23 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
Map<String,Object> orderData=null;
|
|
|
|
|
|
if(mapt.get("account").equals("903")){
|
|
|
- orderData=syPackingListTailoringMapper.getOmOrPo("om_momain","cCode='"+map.get("mpOrder")+"'","moid");
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("om_momain","cCode='"+mapt.get("mpOrder")+"'","moid");
|
|
|
map.put("CRDCODE","委外入库");
|
|
|
+ map.put("CGLTYPE","委外订单");
|
|
|
|
|
|
}else {
|
|
|
if(mapt.get("orderNumber").equals("one")){
|
|
|
- orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+map.get("mpOrder")+"'","POID");
|
|
|
+ orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+mapt.get("mpOrder")+"'","POID");
|
|
|
}else{
|
|
|
orderData=syPackingListTailoringMapper.getOmOrPo("PO_POMAIN","cPOID='"+mapt.get("orderNumber")+"'","POID");
|
|
|
}
|
|
|
map.put("CRDCODE","采购入库");
|
|
|
+ map.put("CGLTYPE","采购订单");
|
|
|
|
|
|
}
|
|
|
if(orderData!=null){
|
|
|
+ map.put("CVENCODE",orderData.get("cvencode"));
|
|
|
+ mapt.put("CVENCODE",orderData.get("cvencode"));
|
|
|
map5.put("IEXCHRATE",orderData.get("nflat"));
|
|
|
map5.put("CPAYCODE",orderData.get("cPayCode"));
|
|
|
}
|
|
@@ -785,7 +791,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
|
|
|
|
|
|
|
|
|
- Map<String,Object> orderDataItem=null;
|
|
|
+ Map<String,Object> orderDataItem=null;
|
|
|
if(!mapt.get("account").equals("903")){
|
|
|
if(mapt.get("orderNumber").equals("one")){
|
|
|
orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("PO_PoDetails", "ID='"+item.getOmpoIdItem()+"'","ID");
|
|
@@ -797,19 +803,22 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
"xxxxxxxx" +
|
|
|
"xxxxxxx","ID");
|
|
|
}
|
|
|
+ Map<String,Object> orderDataItem2=purchaseWarehousingMapper.getPOPodetails(orderDataItem.get("id").toString());
|
|
|
+ getcFree(mapItem,orderDataItem2);
|
|
|
mapItem.put("POAUTOIDCOL","ID");
|
|
|
mapItem.put("AUTOID_PO",orderDataItem.get("id"));
|
|
|
+ map5.put("CGLTYPE","采购订单");
|
|
|
mapItem5.put("POAUTOIDCOL","ID");
|
|
|
mapItem5.put("AUTOID_PO",orderDataItem.get("id"));
|
|
|
- }{
|
|
|
+ }else{
|
|
|
|
|
|
orderDataItem=syPackingListTailoringMapper.getOmOrPoItem("OM_MODetails", "MODetailsID='"+item.getOmpoIdItem()+"'","MODetailsID");
|
|
|
- Map<String,Object> orderDataItem2=purchaseWarehousingMapper.getOMMoDetails(item.getOmpoIdItem());
|
|
|
- System.out.println("orderDataItme2\t"+orderDataItem2);
|
|
|
+ Map<String,Object> orderDataItem2=purchaseWarehousingMapper.getOMMoDetails(item.getOmpoIdItem());
|
|
|
getcFree(mapItem,orderDataItem2);
|
|
|
System.out.println("mapItem\t"+mapItem);
|
|
|
mapItem.put("POAUTOIDCOL","MODetailsID");
|
|
|
mapItem.put("AUTOID_PO",orderDataItem.get("id"));
|
|
|
+ map5.put("CGLTYPE","委外订单");
|
|
|
|
|
|
mapItem2.put("ALLCAUTOIDCOL","AllocateId");
|
|
|
mapItem5.put("POAUTOIDCOL","MODetailsID");
|
|
@@ -818,14 +827,12 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
mapItem5.put("IORIMONEY",orderDataItem.get("iMoney"));
|
|
|
mapItem5.put("IMONEY",orderDataItem.get("iNatMoney"));
|
|
|
|
|
|
-
|
|
|
- if(item.getSupplierCode()!=null){
|
|
|
- map.put("CVENCODE",orderData.get("cVenCode"));
|
|
|
- String wheCode=syPackingListTailoringMapper.getWhCodeByVenCode(item.getSupplierCode());
|
|
|
+ if(!mapt.get("CVENCODE").equals("one")){
|
|
|
+ String wheCode=syPackingListTailoringMapper.getWhCodeByVenCode(mapt.get("CVENCODE").toString());
|
|
|
if(wheCode!=null){
|
|
|
map.put("CWHCODE",wheCode);
|
|
|
|
|
|
- map4.put("CWHCODE",main.getCreateBy());
|
|
|
+ map4.put("CWHCODE",wheCode);
|
|
|
mapItem3.put("CWHCODE",wheCode);
|
|
|
mapItem6.put("CWHCODE",wheCode);
|
|
|
}
|
|
@@ -834,15 +841,20 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
|
|
|
if(item.getSyOrderDataItemId()!=null){
|
|
|
Map<String,Object> orderDataItem2=syPackingListTailoringMapper.getSoMainItem(orderDataItem.get("iSOsID").toString());
|
|
|
+ System.out.println("irowno\t"+orderDataItem2.get("irowno"));
|
|
|
+ System.out.println("id\t"+item.getId());
|
|
|
+ mapSort.put(item.getId(),orderDataItem2.get("irowno").toString());
|
|
|
mapItem3.put("ITAXUNITPRICE",orderDataItem2.get("iTaxUnitPrice"));
|
|
|
mapItem3.put("ITAXRATE",orderDataItem2.get("iTaxRate"));
|
|
|
mapItem3.put("SOAUTOIDCOL","ISOSID");
|
|
|
mapItem3.put("AUTOID_SO",orderDataItem2.get("iSOsID"));
|
|
|
- mapt.put("orderNumber", orderDataItem2.get("id").toString());
|
|
|
+ mapt.put("orderNumber", orderDataItem2.get("id"));
|
|
|
}
|
|
|
|
|
|
if(!mapt.get("orderNumber").equals("one")){
|
|
|
- Map<String,Object> order=syPackingListTailoringMapper.getSoMain(mapt.get("orderNumber"));
|
|
|
+ Map<String,Object> order=syPackingListTailoringMapper.getSoMain(mapt.get("orderNumber").toString());
|
|
|
+ mapt.put("orderNumber",order.get("cSOCode"));
|
|
|
+ mapt.put("customerCode",order.get("cCusCode"));
|
|
|
if(order!=null){
|
|
|
|
|
|
|
|
@@ -859,6 +871,8 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
|
|
|
mapItem.put("CINVCODE",item.getInventoryCode());
|
|
|
mapItem.put("IQUANTITY",item.getTotal());
|
|
|
+ mapItem.put("INUM",orderDataItem.get("inum"));
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -898,6 +912,15 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
mapList5.add(map5);
|
|
|
map6.put("DETAILList",mapItems6);
|
|
|
mapList6.add(map6);
|
|
|
+
|
|
|
+ if(mapt.get("customerCode").equals("0001")){
|
|
|
+ mapt.put("account","901");
|
|
|
+ }else if(mapt.get("customerCode").equals("T020001")){
|
|
|
+ mapt.put("account","902");
|
|
|
+ }else{
|
|
|
+ mapt.put("account","904");
|
|
|
+ }
|
|
|
+ mapt.put("itemSort",mapSort);
|
|
|
}
|
|
|
|
|
|
mapLists.addAll(mapList);
|
|
@@ -920,7 +943,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
System.out.println("mapList5\n"+mapList5);
|
|
|
System.out.println("mapList6\n"+mapList6);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");
|
|
|
JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");
|
|
@@ -935,7 +958,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
System.out.println("调用接口后返回的信息resturn6\n"+resturn6);*/
|
|
|
|
|
|
try{
|
|
|
- FileWriter file =new FileWriter ("D:\\test\\test.txt",true);
|
|
|
+ FileWriter file =new FileWriter ("D:\\test1\\test.txt",true);
|
|
|
|
|
|
|
|
|
|
|
@@ -946,39 +969,37 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- return new HashMap<>();
|
|
|
+ return mapt;
|
|
|
}
|
|
|
|
|
|
|
|
|
public void getcFree(JSONObject itemMap,Map<String,Object> mapPOPodetails){
|
|
|
- itemMap.put("cDefine22",setNull(mapPOPodetails.get("cDefine22")));
|
|
|
- itemMap.put("cDefine23",setNull(mapPOPodetails.get("cDefine23")));
|
|
|
- itemMap.put("cDefine24",setNull(mapPOPodetails.get("cDefine24")));
|
|
|
- itemMap.put("cDefine25",setNull(mapPOPodetails.get("cDefine25")));
|
|
|
- itemMap.put("cDefine26",setNull(mapPOPodetails.get("cDefine26")));
|
|
|
- itemMap.put("cDefine27",setNull(mapPOPodetails.get("cDefine27")));
|
|
|
- itemMap.put("cDefine28",setNull(mapPOPodetails.get("cDefine28")));
|
|
|
- itemMap.put("cDefine29",setNull(mapPOPodetails.get("cDefine29")));
|
|
|
- itemMap.put("cDefine30",setNull(mapPOPodetails.get("cDefine30")));
|
|
|
- itemMap.put("cDefine31",setNull(mapPOPodetails.get("cDefine31")));
|
|
|
- itemMap.put("cDefine32",setNull(mapPOPodetails.get("cDefine32")));
|
|
|
- itemMap.put("cDefine33",setNull(mapPOPodetails.get("cDefine33")));
|
|
|
- itemMap.put("cDefine34",setNull(mapPOPodetails.get("cDefine34")));
|
|
|
- itemMap.put("cDefine35",setNull(mapPOPodetails.get("cDefine35")));
|
|
|
- itemMap.put("cDefine36",setNull(mapPOPodetails.get("cDefine36")));
|
|
|
- itemMap.put("cDefine37",setNull(mapPOPodetails.get("cDefine37")));
|
|
|
- itemMap.put("cFree1",setNull(mapPOPodetails.get("cFree1")));
|
|
|
- itemMap.put("cFree2",setNull(mapPOPodetails.get("cFree2")));
|
|
|
- itemMap.put("cFree3",setNull(mapPOPodetails.get("cFree3")));
|
|
|
- itemMap.put("cFree4",setNull(mapPOPodetails.get("cFree4")));
|
|
|
- itemMap.put("cFree5",setNull(mapPOPodetails.get("cFree5")));
|
|
|
- itemMap.put("cFree6",setNull(mapPOPodetails.get("cFree6")));
|
|
|
- itemMap.put("cFree7",setNull(mapPOPodetails.get("cFree7")));
|
|
|
- itemMap.put("cFree8",setNull(mapPOPodetails.get("cFree8")));
|
|
|
- itemMap.put("cFree9",setNull(mapPOPodetails.get("cFree9")));
|
|
|
- itemMap.put("cFree10",setNull(mapPOPodetails.get("cFree10")));
|
|
|
+ itemMap.put("CDEFINE22",setNull(mapPOPodetails.get("cDefine22")));
|
|
|
+ itemMap.put("CDEFINE23",setNull(mapPOPodetails.get("cDefine23")));
|
|
|
+ itemMap.put("CDEFINE24",setNull(mapPOPodetails.get("cDefine24")));
|
|
|
+ itemMap.put("CDEFINE25",setNull(mapPOPodetails.get("cDefine25")));
|
|
|
+ itemMap.put("CDEFINE26",setNull(mapPOPodetails.get("cDefine26")));
|
|
|
+ itemMap.put("CDEFINE27",setNull(mapPOPodetails.get("cDefine27")));
|
|
|
+ itemMap.put("CDEFINE28",setNull(mapPOPodetails.get("cDefine28")));
|
|
|
+ itemMap.put("CDEFINE29",setNull(mapPOPodetails.get("cDefine29")));
|
|
|
+ itemMap.put("CDEFINE30",setNull(mapPOPodetails.get("cDefine30")));
|
|
|
+ itemMap.put("CDEFINE31",setNull(mapPOPodetails.get("cDefine31")));
|
|
|
+ itemMap.put("CDEFINE32",setNull(mapPOPodetails.get("cDefine32")));
|
|
|
+ itemMap.put("CDEFINE33",setNull(mapPOPodetails.get("cDefine33")));
|
|
|
+ itemMap.put("CDEFINE34",setNull(mapPOPodetails.get("cDefine34")));
|
|
|
+ itemMap.put("CDEFINE35",setNull(mapPOPodetails.get("cDefine35")));
|
|
|
+ itemMap.put("CDEFINE36",setNull(mapPOPodetails.get("cDefine36")));
|
|
|
+ itemMap.put("CDEFINE37",setNull(mapPOPodetails.get("cDefine37")));
|
|
|
+ itemMap.put("CFREE1",setNull(mapPOPodetails.get("cFree1")));
|
|
|
+ itemMap.put("CFREE2",setNull(mapPOPodetails.get("cFree2")));
|
|
|
+ itemMap.put("CFREE3",setNull(mapPOPodetails.get("cFree3")));
|
|
|
+ itemMap.put("CFREE4",setNull(mapPOPodetails.get("cFree4")));
|
|
|
+ itemMap.put("CFREE5",setNull(mapPOPodetails.get("cFree5")));
|
|
|
+ itemMap.put("CFREE6",setNull(mapPOPodetails.get("cFree6")));
|
|
|
+ itemMap.put("CFREE7",setNull(mapPOPodetails.get("cFree7")));
|
|
|
+ itemMap.put("CFREE8",setNull(mapPOPodetails.get("cFree8")));
|
|
|
+ itemMap.put("CFREE9",setNull(mapPOPodetails.get("cFree9")));
|
|
|
+ itemMap.put("CFREE10",setNull(mapPOPodetails.get("cFree10")));
|
|
|
}
|
|
|
|
|
|
public Object setNull(Object o){
|