|
|
@@ -959,7 +959,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
strJson.put("TOWareHouse", mapList.get(0).get("askGoodsWarehouseId").toString());//要货仓库ID
|
|
|
strJson.put("FromWareHouse", warehouseWhere);//供货仓库ID
|
|
|
strJson.put("SourceBillDate", DateUtil.dateConversion(mapList.get(0).get("scrq").toString()));//业务日期
|
|
|
- strJson.put("MoveType", mapList.get(0).get("warehouseTransferType").toString());//移动类型
|
|
|
+ strJson.put("MoveType", mapList.get(0).get("warehouseTransferType").toString());//移动类型345
|
|
|
strJson.put("IsRed", 0);//是否红单1
|
|
|
if (realName == null || realName == ""){
|
|
|
realName = "李兆峰" ;
|
|
|
@@ -1685,9 +1685,9 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
.setStorageLocationCode(LocationCode);
|
|
|
System.out.println("封装的数据:"+returnWarehousing.toString());
|
|
|
System.out.println("入库数量:"+goods.getWarehousingNum());
|
|
|
- if (goods.getWarehousingNum().equals("0")){
|
|
|
+// if (goods.getWarehousingNum().equals("0")){
|
|
|
askGoodsMapper.addReturnWarehousing(returnWarehousing);//添加GS返回数据
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1852,7 +1852,8 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
public void jsonError() {
|
|
|
List<Error> errorList = askGoodsMapper.getJsonError();
|
|
|
for (Error error : errorList) {
|
|
|
- System.out.println("字符串为:"+error.getDataVal());
|
|
|
+ System.out.println("字符串为:");
|
|
|
+ System.out.println(error.getDataVal());
|
|
|
JSONObject jsonObject = JSONObject.parseObject(error.getDataVal());
|
|
|
|
|
|
JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("strJson").toString());
|
|
|
@@ -1860,7 +1861,13 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
JSONObject jsonObject2 = new JSONObject();
|
|
|
jsonObject2.put("strJson",jsonObject1.toJSONString());
|
|
|
|
|
|
- System.out.println("toJsonString字符串为:"+ jsonObject2.toJSONString());
|
|
|
+ System.out.println("toJsonString字符串为:");
|
|
|
+ System.out.println(jsonObject2.toJSONString());
|
|
|
+
|
|
|
+ error.setDataVal(jsonObject2.toJSONString());
|
|
|
+
|
|
|
+ //修改
|
|
|
+ askGoodsMapper.updJSONError(error);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1869,6 +1876,74 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 从父子表存入GS返回数据/出库回传
|
|
|
+ * */
|
|
|
+ @Override
|
|
|
+ public void mergeGs() {
|
|
|
+ //查询父表信息
|
|
|
+ List<ReturRemoval> list = askGoodsMapper.getMergeGsF();
|
|
|
+ for (ReturRemoval returRemoval : list) {
|
|
|
+ //存入父表信息
|
|
|
+ ReturRemoval returRemoval1 = new ReturRemoval()
|
|
|
+ .setDocumentId(returRemoval.getAskGoodsId())//单据id1
|
|
|
+ .setRemovalCode(codeGenerateCk())//出库单编号1
|
|
|
+ .setSourceType(returRemoval.getSourceType())//来源类型1
|
|
|
+ .setMoveType(returRemoval.getMoveType())//移动类型1
|
|
|
+ .setDeliveryType(returRemoval.getDeliveryType());//交货类型(DE交货,RD退货)1
|
|
|
+ //查询子表信息
|
|
|
+ List<ReturRemoval> list1 = askGoodsMapper.getMergeGsZ(returRemoval);
|
|
|
+ for (ReturRemoval removal : list1) {
|
|
|
+ //存入子表信息
|
|
|
+ ReturRemoval returRemoval2 = new ReturRemoval()
|
|
|
+ .setDocumentId(returRemoval.getAskGoodsId())//要货申请单id
|
|
|
+ .setMaterialId(removal.getMaterialId())//物料id
|
|
|
+ .setWbs(removal.getWbs())//wbs
|
|
|
+ .setNum(removal.getNum())//出库数量
|
|
|
+ .setEntryNumber(removal.getEntryNumber())//分录号
|
|
|
+ .setDocumentPointsId(" ")//分录单id
|
|
|
+ .setStorageLocationCode("D2-3-2");//库存编号
|
|
|
+ //添加子表信息
|
|
|
+ askGoodsMapper.addReturnGsRemoval(returRemoval2);
|
|
|
+ }
|
|
|
+ //添加父表信息
|
|
|
+ askGoodsMapper.addReturnGsRemovalF(returRemoval1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 移库获取单据物料code分录号数量
|
|
|
+ * */
|
|
|
+ @Override
|
|
|
+ public void jsonErrorParking() {
|
|
|
+ //获取数据
|
|
|
+ List<Error> errorList = askGoodsMapper.getjsonErrorParking();
|
|
|
+ for (Error error : errorList) {
|
|
|
+ System.out.println("字符串为:");
|
|
|
+ System.out.println(error.getDataVal());
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(error.getDataVal());
|
|
|
+
|
|
|
+ JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("strJson").toString());
|
|
|
+ List<JSONObject> bilLs = (List<JSONObject>) jsonObject1.get("BILLs");
|
|
|
+ for (JSONObject bilL : bilLs) {
|
|
|
+ List<JSONObject> billItems = (List<JSONObject>) bilL.get("BillItems");
|
|
|
+ for (JSONObject billItem : billItems) {
|
|
|
+ String WMSCode = bilL.get("WMSCode").toString();
|
|
|
+ String Quantity = billItem.get("Quantity").toString();
|
|
|
+ String Material = billItem.get("Material").toString();
|
|
|
+ String GMReqBillItemID = billItem.get("GMReqBillItemID").toString();
|
|
|
+ //查询物料code
|
|
|
+ String code = askGoodsMapper.getMaterialCode(Material);
|
|
|
+ error.setOrderNumber(WMSCode);//单号
|
|
|
+ error.setMaterialCode(code);//物料code
|
|
|
+ error.setNum(Quantity);//数量
|
|
|
+ error.setClassify(GMReqBillItemID);//分录号
|
|
|
+ askGoodsMapper.updErrorParking(error);//修改error
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void test() {
|
|
|
AskGoods askGoods = new AskGoods();
|