代码更新
This commit is contained in:
@@ -63,7 +63,8 @@ public class ProductionOutServiceImpl implements ProductionOutService {
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
|
||||
JSONObject box_no = whereJson.getJSONObject("box_no");
|
||||
String box_no = whereJson.getString("box_no");
|
||||
if (ObjectUtil.isEmpty(box_no)) throw new BadRequestException("木箱不能为空");
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("vehicle_code = '" + box_no + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
/*
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.nl.wms.st.outbill.service.impl.CheckOutBillServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
@@ -91,30 +93,39 @@ public class VirtualOutServiceImpl implements VirtualOutService {
|
||||
WQLObject disTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); // 出入库分配明细表
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库明细表
|
||||
|
||||
String box_no = whereJson.getString("box_no"); // 箱号
|
||||
JSONArray box_rows = whereJson.getJSONArray("box_rows");
|
||||
|
||||
JSONArray disArr = WQL.getWO("PDA_ST_01").addParam("flag", "7").addParam("box_no", box_no).process().getResultJSONArray(0);
|
||||
for (int i = 0; i < disArr.size(); i++) {
|
||||
JSONObject jsonDis = disArr.getJSONObject(i);
|
||||
// 更新状态为完成
|
||||
jsonDis.put("work_status", "99");
|
||||
disTab.update(jsonDis);
|
||||
HashSet<String> boxSet = new HashSet<>();
|
||||
|
||||
// 判断分配明细是否全部完成
|
||||
JSONArray disNoArr = disTab.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "' and work_status <> '99'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(disNoArr)) {
|
||||
// 更新明细表状态为完成
|
||||
JSONObject jsonDtl = dtlTab.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
jsonDtl.put("bill_status", "99");
|
||||
dtlTab.update(jsonDtl);
|
||||
for (int i = 0; i < box_rows.size(); i++) {
|
||||
JSONObject json = box_rows.getJSONObject(i);
|
||||
boxSet.add(json.getString("package_box_sn"));
|
||||
}
|
||||
|
||||
// 判断此明细是否全部完成
|
||||
JSONArray dtlNoArr = dtlTab.query("iostorinv_id = '" + jsonDis.getString("iostorinv_id") + "' and bill_status <> '99'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(dtlNoArr)) {
|
||||
// 调用强制完成接口
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("iostorinv_id",jsonDis.getString("iostorinv_id"));
|
||||
checkOutBillService.confirm(param);
|
||||
for (String box_no : boxSet) {
|
||||
JSONArray disArr = WQL.getWO("PDA_ST_01").addParam("flag", "7").addParam("box_no", box_no).process().getResultJSONArray(0);
|
||||
for (int i = 0; i < disArr.size(); i++) {
|
||||
JSONObject jsonDis = disArr.getJSONObject(i);
|
||||
// 更新状态为完成
|
||||
jsonDis.put("work_status", "99");
|
||||
disTab.update(jsonDis);
|
||||
|
||||
// 判断分配明细是否全部完成
|
||||
JSONArray disNoArr = disTab.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "' and work_status <> '99'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(disNoArr)) {
|
||||
// 更新明细表状态为完成
|
||||
JSONObject jsonDtl = dtlTab.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
jsonDtl.put("bill_status", "99");
|
||||
dtlTab.update(jsonDtl);
|
||||
|
||||
// 判断此明细是否全部完成
|
||||
JSONArray dtlNoArr = dtlTab.query("iostorinv_id = '" + jsonDis.getString("iostorinv_id") + "' and bill_status <> '99'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(dtlNoArr)) {
|
||||
// 调用强制完成接口
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("iostorinv_id",jsonDis.getString("iostorinv_id"));
|
||||
checkOutBillService.confirm(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1988,7 +1988,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
param.put("HEAD", paramSapMstArr);
|
||||
|
||||
// 调用接口回传
|
||||
new LmsToSapServiceImpl().returnDelivery(param);
|
||||
try {
|
||||
new LmsToSapServiceImpl().returnDelivery(param);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("回传sap失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
// 2.回传mes
|
||||
JSONObject paramMesMst = new JSONObject();
|
||||
@@ -2015,8 +2019,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
paramMesMst.put("item", paramArr);
|
||||
|
||||
// 调用接口回传
|
||||
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
||||
try {
|
||||
// 调用接口回传
|
||||
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("回传mes失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
// 手工出库
|
||||
if (StrUtil.equals(bill_type, "1009")) {
|
||||
@@ -2080,8 +2089,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
param.put("HEAD", paramSapMstArr);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(vbeln)) {
|
||||
// 调用接口回传
|
||||
new LmsToSapServiceImpl().returnDelivery(param);
|
||||
try {
|
||||
// 调用接口回传
|
||||
new LmsToSapServiceImpl().returnDelivery(param);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("回传sap失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2134,9 +2148,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
paramMst.put("T_ITEM", paramArr);
|
||||
|
||||
// 调用接口回传
|
||||
System.out.println(paramMst.toString());
|
||||
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
||||
try {
|
||||
// 调用接口回传
|
||||
System.out.println(paramMst.toString());
|
||||
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("回传sap失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
//调用母卷配送到位接口
|
||||
JSONObject mes_jo = new JSONObject();
|
||||
@@ -2163,8 +2181,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user