|
@@ -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<>();//存储所有的领料申请子表数据
|
|
|
+// List<Map<String,Object>> dispatchList=new ArrayList<>();//储存所有的领料申请主表数据
|
|
|
+// List<Map<String,Object>> dispatchItemList=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);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|