代码合并

This commit is contained in:
2022-11-29 15:22:13 +08:00
parent a5a7cb4d4e
commit f489649c62
7 changed files with 88 additions and 41 deletions

View File

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.pda.st.service.VirtualOutService;
@@ -95,37 +96,42 @@ public class VirtualOutServiceImpl implements VirtualOutService {
JSONArray box_rows = whereJson.getJSONArray("box_rows");
HashSet<String> boxSet = new HashSet<>();
String box_no = whereJson.getString("box_no");
if (ObjectUtil.isEmpty(box_no)) throw new BadRequestException("木箱不能为空");
for (int i = 0; i < box_rows.size(); i++) {
/* for (int i = 0; i < box_rows.size(); i++) {
JSONObject json = box_rows.getJSONObject(i);
boxSet.add(json.getString("package_box_sn"));
}
if (!StrUtil.equals(json.getString("package_box_sn"), box_no)) {
throw new BadRequestException("请输入正确的木箱号");
}
}*/
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 disArr = WQL.getWO("PDA_ST_01").addParam("flag", "7").addParam("box_no", box_no).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(disArr)) throw new BadRequestException("木箱码无效");
for (int i = 0; i < disArr.size(); i++) {
JSONObject jsonDis = disArr.getJSONObject(i);
// 更新状态为完成
jsonDis.put("work_status", "99");
disTab.update(jsonDis);
// 判断明细是否全部完成
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);
}
// 判断分配明细是否全部完成
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);
}
}
}
@@ -135,8 +141,8 @@ public class VirtualOutServiceImpl implements VirtualOutService {
}
@Override
public JSONObject printType(JSONObject whereJson){
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag","6").process().getResultJSONArray(0);
public JSONObject printType(JSONObject whereJson) {
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "6").process().getResultJSONArray(0);
JSONObject jo = new JSONObject();
jo.put("data", rows);
jo.put("message", "查询成功!");

View File

@@ -38,6 +38,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
HashMap map = new HashMap<>(whereJson);
String bill_code = MapUtil.getStr(whereJson, "bill_code");
String box_no = MapUtil.getStr(whereJson, "box_no");
String material_search = MapUtil.getStr(whereJson, "material_search");
map.put("flag", "1");
map.put("stor_id", MapUtil.getStr(whereJson, "stor_id"));
@@ -50,6 +51,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
map.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
if (!ObjectUtil.isEmpty(bill_code)) map.put("bill_code", "%" + bill_code + "%");
if (!ObjectUtil.isEmpty(material_search)) map.put("material_search", "%" + material_search + "%");
if (!ObjectUtil.isEmpty(box_no)) map.put("box_no", "%" + box_no + "%");
JSONObject jo = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time desc");
return jo;

View File

@@ -30,6 +30,7 @@
输入.material_type_id TYPEAS f_string
输入.iostorinv_id TYPEAS s_string
输入.ids TYPEAS f_string
输入.box_no TYPEAS s_string
@@ -66,6 +67,7 @@
FROM
st_ivt_iostorinv mst
LEFT JOIN st_ivt_iostorinvdtl dtl ON mst.iostorinv_id = dtl.iostorinv_id
LEFT JOIN ST_IVT_IOStorInvDis dis ON dis.iostorinvdtl_id = dtl.iostorinvdtl_id
LEFT JOIN sys_user user ON user.user_id = mst.upload_optid
INNER JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
WHERE
@@ -86,6 +88,10 @@
mst.bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.box_no <> ""
dis.box_no like 输入.box_no
ENDOPTION
OPTION 输入.bill_status <> ""
mst.bill_status = 输入.bill_status
ENDOPTION