|
@@ -100,7 +100,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
public void addSAPInventory(Long start,Long end) {
|
|
|
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00007\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00007\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -146,7 +146,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPCurrentStock(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00005\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00005\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -187,7 +187,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPRdrecord10MainAndItems(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00006\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00006\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -259,7 +259,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPVendor(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00008\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00008\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -295,7 +295,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPPO_PoMainAndItems(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00009\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00009\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -380,7 +380,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPPuArrivalvouch(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00011\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00011\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -460,7 +460,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPMaterialappvouchMainAndItem(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00012\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00012\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -470,6 +470,8 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
JSONArray jsonArray=jsonObjectResults.getJSONArray("OUTPUT");
|
|
|
List<Map<String,Object>> addMainList=new ArrayList<>();
|
|
|
List<Map<String,Object>> addItemList=new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
|
|
|
|
|
|
for(int a=0;a<jsonArray.size();a++) {
|
|
@@ -553,7 +555,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPQMCHECKVOUCHER(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00004\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00004\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -605,7 +607,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
@DS("master")
|
|
|
public void addSAPRdrecord32MainAndItem(Long start,Long end) {
|
|
|
|
|
|
- String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00010\",\"GUID\":\"1234567890\",\"USERID\":\"USERNAME\"}}";
|
|
|
+ String jsonSting="{\"TIMELIMIT\":{\"ST\":\""+start+"\",\"ET\":\""+end+"\"},\"COMMON_INFO_REQ\":{\"API_NO\":\"KANB00010\",\"GUID\":\""+UUID.randomUUID().toString()+"\",\"USERID\":\"USERNAME\"}}";
|
|
|
JSONObject jsonObjectP=JSONObject.parseObject(JSONObject.parse(jsonSting).toString());
|
|
|
|
|
|
JSONObject jsonObjectResults= InterfaceConnUtils.doPost(jsonObjectP,"");
|
|
@@ -615,6 +617,8 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
JSONArray jsonArray=jsonObjectResults.getJSONArray("OUTPUT");
|
|
|
List<Map<String,Object>> addMainList=new ArrayList<>();
|
|
|
List<Map<String,Object>> addItemList=new ArrayList<>();
|
|
|
+ List<Map<String,Object>> addDispatchList=new ArrayList<>();
|
|
|
+ List<Map<String,Object>> addDispatchListItemList=new ArrayList<>();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
|
|
|
|
|
|
for(int a=0;a<jsonArray.size();a++) {
|
|
@@ -657,10 +661,21 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
}else {
|
|
|
mapMain.put("postingDate",null);
|
|
|
}
|
|
|
- mapMain.put("deliveryStatus",String.valueOf(jsonObjectMain.get("DELIVERYSTATUS")));
|
|
|
+ String DELIVERYSTATUS=String.valueOf(jsonObjectMain.get("DELIVERYSTATUS"));
|
|
|
+ mapMain.put("deliveryStatus",DELIVERYSTATUS);
|
|
|
mapMain.put("create_time",sdf.format(new Date()));
|
|
|
mapMain.put("pull_date",end+"");
|
|
|
- addMainList.add(mapMain);
|
|
|
+
|
|
|
+
|
|
|
+ if(DELIVERYSTATUS!=null&&DELIVERYSTATUS.equals("A")){
|
|
|
+ mapMain.put("idd",UUID.randomUUID().toString());
|
|
|
+ mapMain.put("DLID",String.valueOf(jsonObjectMain.get("ID")));
|
|
|
+ mapMain.put("cVerifier","审核人");
|
|
|
+ addDispatchList.add(mapMain);
|
|
|
+ }else{
|
|
|
+ addMainList.add(mapMain);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
JSONArray jsonArrayItems=jsonObjectMain.getJSONArray("ITEMS");
|
|
|
for(int b=0;b<jsonArrayItems.size();b++){
|
|
@@ -677,7 +692,15 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
mapItem.put("cWhName",String.valueOf(jsonObjectItem.get("CWHNAME")));
|
|
|
mapItem.put("create_time",sdf.format(new Date()));
|
|
|
mapItem.put("pull_date",end+"");
|
|
|
- addItemList.add(mapItem);
|
|
|
+ if(DELIVERYSTATUS!=null&&DELIVERYSTATUS.equals("A")){
|
|
|
+ mapItem.put("DLID",String.valueOf(jsonObjectItem.get("ID")));
|
|
|
+ mapItem.put("cItemName",String.valueOf(jsonObjectItem.get("CITEMNAME")));
|
|
|
+ mapItem.put("fOutQuantity",0.0);
|
|
|
+ addDispatchListItemList.add(mapItem);
|
|
|
+ }else{
|
|
|
+ addItemList.add(mapItem);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -694,6 +717,20 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
|
|
|
fbsInventoryMapper.addSAPRdrecords32(addItemList);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ if(addDispatchList.size()>0){
|
|
|
+
|
|
|
+ this.baseMapper.deleteSAPDispatchList(addDispatchList);
|
|
|
+ this.baseMapper.deleteSAPDispatchLists(addDispatchList);
|
|
|
+
|
|
|
+ fbsInventoryMapper.addSAPDispatchList(addDispatchList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(addDispatchListItemList.size()>0){
|
|
|
+ fbsInventoryMapper.addSAPDispatchLists(addDispatchListItemList);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|