|
@@ -703,27 +703,27 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
|
|
|
@Override
|
|
|
@DS("multi-one")
|
|
|
- public void one(List<SyPackingListFabric> mains, Map<String, Object> map) {
|
|
|
- saveBatch(mains,map);
|
|
|
+ public void one(SyPackingListFabric main, Map<String, Object> map) {
|
|
|
+ saveBatch(main,map);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@DS("multi-two")
|
|
|
- public void two(List<SyPackingListFabric> mains, Map<String, Object> map) {
|
|
|
- saveBatch(mains,map);
|
|
|
+ public void two(SyPackingListFabric main, Map<String, Object> map) {
|
|
|
+ saveBatch(main,map);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@DS("multi-three")
|
|
|
- public void three(List<SyPackingListFabric> mains, Map<String, Object> map) {
|
|
|
- saveBatch(mains,map);
|
|
|
+ public void three(SyPackingListFabric main, Map<String, Object> map) {
|
|
|
+ saveBatch(main,map);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- Map<String,Object> saveBatch(List<SyPackingListFabric> mains,Map<String,Object> mapt){
|
|
|
+ Map<String,Object> saveBatch(SyPackingListFabric main,Map<String,Object> mapt){
|
|
|
mapt.put("customerCode","xxx");
|
|
|
- if(mains==null||mains.size()==0){
|
|
|
+ if(main==null){
|
|
|
return new HashMap();
|
|
|
}
|
|
|
JSONArray mapList=new JSONArray();
|
|
@@ -737,7 +737,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
|
|
|
JSONArray mapLists=new JSONArray();
|
|
|
|
|
|
- for (SyPackingListFabric main : mains){
|
|
|
+ if (main!=null){
|
|
|
Map<String,String> mapSort=new HashMap<>();
|
|
|
|
|
|
String createBy="进出口平台管理员";
|
|
@@ -972,9 +972,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
map6.put("DETAILList",mapItems6);
|
|
|
mapList6.add(map6);
|
|
|
|
|
|
- if(mapt.get("customerCode").equals("0001")&&!mapt.get("account").equals("901")){
|
|
|
+ if(mapt.get("customerCode").equals("T020001")&&!mapt.get("account").equals("901")){
|
|
|
mapt.put("account","901");
|
|
|
- }else if(mapt.get("customerCode").equals("T020001")&&!mapt.get("account").equals("902")){
|
|
|
+ }else if(mapt.get("customerCode").equals("0001")&&!mapt.get("account").equals("902")){
|
|
|
mapt.put("account","902");
|
|
|
}else{
|
|
|
mapt.put("account","904");
|
|
@@ -984,25 +984,101 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
text(mapList,"采购入库单");
|
|
|
text(mapList3,"销售发货单");
|
|
|
text(mapList5,"采购发票单");
|
|
|
- JSONArray resturn1 = InterfaceConnUtils.doPost(mapList,"purchasein_import");
|
|
|
-
|
|
|
- JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");
|
|
|
- JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");
|
|
|
|
|
|
- result(resturn1,"采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+
|
|
|
+ String recording=null;
|
|
|
+ if(main.getRecording()!=null){
|
|
|
+ String[] recordings=main.getRecording().split(",");
|
|
|
+ Map<String,Map<String,String>> maps=new HashMap<>();
|
|
|
+ for (int i=0;i<recordings.length;i++){
|
|
|
+ Map<String,String> map=new HashMap<>();
|
|
|
+ map.put("index",recordings[i].split("-")[1]);
|
|
|
+ map.put("code",recordings[i].split("-")[2]);
|
|
|
+ maps.put(recordings[i].split("-")[0],map);
|
|
|
+ }
|
|
|
+ String account=mapList.getJSONObject(0).get("CACCID").toString();
|
|
|
+ if (maps.containsKey(account)){
|
|
|
+ switch (maps.get(account).get("index")){
|
|
|
+ case "1":
|
|
|
+ JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");
|
|
|
+ recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");
|
|
|
+ maps.get(account).put("code",resturn3.getJSONObject(0).get("U8ReceiptNo").toString());
|
|
|
+ recording(main,recording);
|
|
|
+ String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
|
|
|
+ case "2":
|
|
|
+ JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");
|
|
|
+ recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");
|
|
|
+ recording(main,recording);
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
|
|
|
+ case "3":
|
|
|
+ String consignmentName=maps.get(account).get("code");
|
|
|
+ List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
|
|
|
+ if(consignmentMaps!=null){
|
|
|
+ for (Map map : consignmentMaps){
|
|
|
+ JSONObject jsonObject=mapList4.getJSONObject(0);
|
|
|
+ List<Map<String,Object>> mapItems4= (List<Map<String,Object>>) jsonObject.get("DETAILList");
|
|
|
+ for (Map itemMap4 : mapItems4){
|
|
|
+ if(itemMap4.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap4.get("IQUANTITY").toString())
|
|
|
+ ==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")){
|
|
|
+ getcFree((JSONObject) itemMap4,map);
|
|
|
+ itemMap4.put("AUTOID_SO",map.get("iDLsID"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("mapItems4\t"+mapItems4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ text(mapList4,"销售出库单");
|
|
|
+ JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");
|
|
|
+ recording=result(main,resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),"4");
|
|
|
+ maps.get(account).put("code",resturn4.getJSONObject(0).get("U8ReceiptNo").toString());
|
|
|
+ recording(main,recording);
|
|
|
+ case "4":
|
|
|
+ String saleoutName=maps.get(account).get("code");
|
|
|
+
|
|
|
+ this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
|
|
|
+
|
|
|
+ List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
|
|
|
+ if(saleoutMaps!=null){
|
|
|
+ for (Map map : saleoutMaps){
|
|
|
+ JSONObject jsonObject=mapList6.getJSONObject(0);
|
|
|
+ List<Map<String,Object>> mapItems6= (List<Map<String,Object>>) jsonObject.get("DETAILList");
|
|
|
+ for (Map itemMap6 : mapItems6){
|
|
|
+ itemMap6.put("DISAUTOIDCOL","AUTOID");
|
|
|
+ if(itemMap6.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap6.get("IQUANTITY").toString())
|
|
|
+ ==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap6.containsKey("AUTOID_DIS")){
|
|
|
+ itemMap6.put("AUTOID_DIS",map.get("autoid"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ text(mapList6,"销售发票单");
|
|
|
+ JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");
|
|
|
+ recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");
|
|
|
+ recording(main,recording);
|
|
|
+ }
|
|
|
+ return mapt;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONArray resturn1 = InterfaceConnUtils.doPost(mapList,"purchasein_import");
|
|
|
+ recording=result(main,resturn1,"采购入库单",((Map) mapList.get(0)).get("CACCID").toString(),"1");
|
|
|
+ recording(main,recording);
|
|
|
this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
|
|
|
|
|
|
- result(resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+ JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");
|
|
|
+ recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");
|
|
|
+ recording(main,recording);
|
|
|
String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
|
|
|
this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
|
|
|
|
|
|
-
|
|
|
- result(resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+ JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");
|
|
|
+ recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");
|
|
|
+ recording(main,recording);
|
|
|
this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
|
|
|
|
|
|
JSONObject jsonObject3=resturn3.getJSONObject(0);
|
|
|
String consignmentName=jsonObject3.get("U8ReceiptNo").toString();
|
|
|
-
|
|
|
List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
|
|
|
if(consignmentMaps!=null){
|
|
|
for (Map map : consignmentMaps){
|
|
@@ -1021,17 +1097,15 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
|
|
|
text(mapList4,"销售出库单");
|
|
|
JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");
|
|
|
- result(resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
-
|
|
|
+ recording=result(main,resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),"4");
|
|
|
+ recording(main,recording);
|
|
|
|
|
|
JSONObject jsonObject4=resturn4.getJSONObject(0);
|
|
|
String saleoutName=jsonObject4.get("U8ReceiptNo").toString();
|
|
|
|
|
|
this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
|
|
|
|
|
|
-
|
|
|
List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
|
|
|
-
|
|
|
if(saleoutMaps!=null){
|
|
|
for (Map map : saleoutMaps){
|
|
|
JSONObject jsonObject=mapList6.getJSONObject(0);
|
|
@@ -1047,9 +1121,12 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
text(mapList6,"销售发票单");
|
|
|
JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");
|
|
|
- result(resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),mains.get(0).getId());
|
|
|
+ recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");
|
|
|
+ recording(main,recording);
|
|
|
|
|
|
return mapt;
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void text(JSONArray mapList,String tableName){
|
|
@@ -1065,11 +1142,25 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void result(JSONArray jsonArray,String tableName ,String account,String id){
|
|
|
+ public void recording(SyPackingListFabric syPackingListTailoring,String recording){
|
|
|
+ if(syPackingListTailoring.getRecording()!=null){
|
|
|
+ if(syPackingListTailoring.getRecording().substring(0,3).equals(recording.substring(0,3))){
|
|
|
+ syPackingListTailoring.setRecording(recording);
|
|
|
+ }else{
|
|
|
+ syPackingListTailoring.setRecording(syPackingListTailoring.getRecording()+","+recording);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ syPackingListTailoring.setRecording(recording);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public String result(SyPackingListFabric main,JSONArray jsonArray,String tableName ,String account,String index){
|
|
|
JSONObject jsonObject=jsonArray.getJSONObject(0);
|
|
|
if(jsonObject.get("Result").equals("F")){
|
|
|
- throw new JeecgBootException("账套"+account+"接口"+tableName+",原因\t"+ jsonObject.get("Description"));
|
|
|
+ throw new JeecgBootException("账套"+account+"接口"+tableName+",原因"+ jsonObject.get("Description"));
|
|
|
}
|
|
|
+ return account+"-"+index+"-"+jsonObject.get("ReceiptNo");
|
|
|
}
|
|
|
|
|
|
public void getcFree(JSONObject itemMap,Map<String,Object> mapPOPodetails){
|
|
@@ -1173,7 +1264,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
"and cInvCCode not like '03%'\n" +
|
|
|
"and cInvCCode not like '04%'\n" +
|
|
|
"and cInvCCode not like '19%'\n" +
|
|
|
- "and cCusCode='0001' and\n" +
|
|
|
+ "and cCusCode='T020001' and\n" +
|
|
|
" f.AutoID in (" + maps.get(account).toString().substring(1, maps.get(account).toString().length() - 1) + ") ";
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
if (account.equals("903")) {
|