This commit is contained in:
zds
2022-12-04 19:31:20 +08:00
parent e368618537
commit a9157637a9
3 changed files with 121 additions and 99 deletions

View File

@@ -132,9 +132,6 @@ public class FactorywarrantymstServiceImpl implements FactorywarrantymstService
JSONObject jsonSheet = sheetDtlTab.query("material_id = '" + MapUtil.getStr(map, "material_id") + "' and pcsn = '" + MapUtil.getStr(map, "pcsn") + "'").uniqueResult(0); JSONObject jsonSheet = sheetDtlTab.query("material_id = '" + MapUtil.getStr(map, "material_id") + "' and pcsn = '" + MapUtil.getStr(map, "pcsn") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSheet)) {
throw new BadRequestException("此批次物料质检单不存在,请联系相关人员新增!");
}
/* /*
* 插入厂家质保书主表 * 插入厂家质保书主表
*/ */
@@ -174,8 +171,7 @@ public class FactorywarrantymstServiceImpl implements FactorywarrantymstService
* 传递参数 param:inspection_type,remark,pcsn,other_device_no,other_device_wd,inspection_code * 传递参数 param:inspection_type,remark,pcsn,other_device_no,other_device_wd,inspection_code
*/ */
if (ObjectUtil.isEmpty(jsonSheet)) { if (ObjectUtil.isEmpty(jsonSheet)) {
throw new BadRequestException("此批次物料质检单不存在,请联系相关人员新增!"); HashMap<String, String> param = new HashMap<>();
/*HashMap<String, String> param = new HashMap<>();
// 判断此物料是什么类型 // 判断此物料是什么类型
String material_type_id = jsonMater.getString("material_type_id"); String material_type_id = jsonMater.getString("material_type_id");
//是否原料 //是否原料
@@ -201,7 +197,7 @@ public class FactorywarrantymstServiceImpl implements FactorywarrantymstService
JSONObject SheetM = WQLObject.getWQLObject("QL_TEST_InspectionSheetMst").query("inspection_id = '" + SheetD.getString("inspection_id") + "'").uniqueResult(0); JSONObject SheetM = WQLObject.getWQLObject("QL_TEST_InspectionSheetMst").query("inspection_id = '" + SheetD.getString("inspection_id") + "'").uniqueResult(0);
jsonFat.put("source_bill_id", SheetM.getString("inspection_id")); jsonFat.put("source_bill_id", SheetM.getString("inspection_id"));
jsonFat.put("source_bill_code", SheetM.getString("inspection_code")); jsonFat.put("source_bill_code", SheetM.getString("inspection_code"));
jsonFat.put("source_bill_type", SheetM.getString("inspection_type"));*/ jsonFat.put("source_bill_type", SheetM.getString("inspection_type"));
} }
fatMstTab.insert(jsonFat); fatMstTab.insert(jsonFat);

View File

@@ -636,12 +636,16 @@ public class InspectionsheetmstServiceImpl implements InspectionsheetmstService
.addParam("flag", "2") .addParam("flag", "2")
.addParam("material_id", jsonDtl.getString("material_id")) .addParam("material_id", jsonDtl.getString("material_id"))
.addParam("pcsn", jsonDtl.getString("pcsn")).process().getResultJSONArray(0); .addParam("pcsn", jsonDtl.getString("pcsn")).process().getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(jsonDtl.getString("source_bill_id"))) {
if (ObjectUtil.isNotEmpty(ivtDtlArr)) { if (ObjectUtil.isNotEmpty(ivtDtlArr)) {
for (int j = 0; j < ivtDtlArr.size(); j++) { for (int j = 0; j < ivtDtlArr.size(); j++) {
JSONObject json = ivtDtlArr.getJSONObject(j); JSONObject json = ivtDtlArr.getJSONObject(j);
JSONObject jsonReDtl = reDtlTab.query("receivedtl_id = '" + json.getString("source_billdtl_id") + "'").uniqueResult(0); JSONObject jsonReDtl = reDtlTab.query("receivedtl_id = '" + json.getString("source_billdtl_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonReDtl)) throw new BadRequestException("找不到到货通知单明细"); if (ObjectUtil.isEmpty(jsonReDtl)) {
throw new BadRequestException("找不到到货通知单明细");
}
if ("99".equals(jsonReDtl.getString("status"))) {
continue;
}
// 如果是合格或者是放行就存入 入库数 // 如果是合格或者是放行就存入 入库数
if (StrUtil.equals(jsonDtl.getString("result"), "01") || StrUtil.equals(jsonDtl.getString("result"), "03")) { if (StrUtil.equals(jsonDtl.getString("result"), "01") || StrUtil.equals(jsonDtl.getString("result"), "03")) {
jsonReDtl.put("instor_qty", json.getDoubleValue("real_qty")); jsonReDtl.put("instor_qty", json.getDoubleValue("real_qty"));
@@ -692,7 +696,6 @@ public class InspectionsheetmstServiceImpl implements InspectionsheetmstService
} }
} }
} }
}
//判断质检单是否合格;不合格就走退货流程 //判断质检单是否合格;不合格就走退货流程
if (StrUtil.equals(jsonDtl.getString("result"), "02") && ObjectUtil.isNotEmpty(ivtDtlArr)) { if (StrUtil.equals(jsonDtl.getString("result"), "02") && ObjectUtil.isNotEmpty(ivtDtlArr)) {
/* /*

View File

@@ -3,6 +3,7 @@ package org.nl.wms.st.core.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@@ -13,6 +14,7 @@ import org.nl.utils.SecurityUtils;
import org.nl.wms.pcs.Enum.ProcStatusEnum; import org.nl.wms.pcs.Enum.ProcStatusEnum;
import org.nl.wms.pcs.Enum.ReceiveStatusEnum; import org.nl.wms.pcs.Enum.ReceiveStatusEnum;
import org.nl.wms.st.core.service.StorPublicService; import org.nl.wms.st.core.service.StorPublicService;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject; import org.nl.wql.core.bean.WQLObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -311,12 +313,27 @@ public class InbillServiceImpl {
flag = true; flag = true;
} }
} }
if(flag){ if(flag){
JSONObject jsonReDtl = reDtlTab.query("receivedtl_id = '" + jo.getString("source_billdtl_id") + "'").uniqueResult(0); /*
if(jsonReDtl!=null){ * 更新到货通知单明细表
*/
JSONArray ivtDtlArr = WQL.getWO("QL_TEST_INSPECTIONSHEET002")
.addParam("flag", "2")
.addParam("material_id", jo.getString("material_id"))
.addParam("pcsn", jo.getString("pcsn"))
.process().getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(ivtDtlArr)) {
for (int j = 0; j < ivtDtlArr.size(); j++) {
JSONObject json = ivtDtlArr.getJSONObject(j);
JSONObject jsonReDtl = reDtlTab.query("receivedtl_id = '" + json.getString("source_billdtl_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonReDtl)) {
throw new BadRequestException("找不到到货通知单明细");
}
if ("99".equals(jsonReDtl.getString("status"))) {
continue;
}
// 如果是合格或者是放行就存入 入库数 // 如果是合格或者是放行就存入 入库数
jsonReDtl.put("instor_qty", jo.getDoubleValue("real_qty")+jsonReDtl.getDouble("instor_qty")); jsonReDtl.put("instor_qty", json.getDoubleValue("real_qty"));
//判断到货明细表中的数量与到货入库数是否相等,相同就完成,不相等就到货中 //判断到货明细表中的数量与到货入库数是否相等,相同就完成,不相等就到货中
if (jsonReDtl.getDoubleValue("receive_qty") <= jsonReDtl.getDoubleValue("instor_qty")) { if (jsonReDtl.getDoubleValue("receive_qty") <= jsonReDtl.getDoubleValue("instor_qty")) {
jsonReDtl.put("status", ReceiveStatusEnum.AFFIRM.getCode()); jsonReDtl.put("status", ReceiveStatusEnum.AFFIRM.getCode());
@@ -324,15 +341,16 @@ public class InbillServiceImpl {
jsonReDtl.put("status", ReceiveStatusEnum.ARRIVAL_NOTICE.getCode()); jsonReDtl.put("status", ReceiveStatusEnum.ARRIVAL_NOTICE.getCode());
} }
reDtlTab.update(jsonReDtl); reDtlTab.update(jsonReDtl);
}
/* /*
* 判断到货明细单中的状态是否完成,全部完成则更新到货通知单主表完成 * 判断到货明细单中的状态是否完成,全部完成则更新到货通知单主表完成
*/ */
JSONArray reDtlArr = reDtlTab.query("receive_id = '" + jsonReDtl.getString("receive_id") + "'").getResultJSONArray(0); JSONArray reDtlArr = reDtlTab.query("receive_id = '" + jsonReDtl.getString("receive_id") + "'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(reDtlArr)) {
throw new BadRequestException("到货单明细不存在!");
}
int flag2 = 0; int flag2 = 0;
for (int j = 0; j < reDtlArr.size(); j++) { for (int m = 0; m < reDtlArr.size(); m++) {
JSONObject json1 = reDtlArr.getJSONObject(j); JSONObject json1 = reDtlArr.getJSONObject(m);
if (StrUtil.equals(json1.getString("status"), ReceiveStatusEnum.AFFIRM.getCode())) { if (StrUtil.equals(json1.getString("status"), ReceiveStatusEnum.AFFIRM.getCode())) {
flag2 = flag2 + 1; flag2 = flag2 + 1;
} }
@@ -350,6 +368,9 @@ public class InbillServiceImpl {
*/ */
if (StrUtil.equals(jsonReMst.getString("status"), ReceiveStatusEnum.AFFIRM.getCode())) { if (StrUtil.equals(jsonReMst.getString("status"), ReceiveStatusEnum.AFFIRM.getCode())) {
JSONObject jsonProc = procTab.query("id = '" + jsonReDtl.getString("source_billdtl_id") + "'").uniqueResult(0); JSONObject jsonProc = procTab.query("id = '" + jsonReDtl.getString("source_billdtl_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonProc)) {
throw new BadRequestException("订单不存在");
}
// 到货数量 = 订单数量,为完成,否则为采购中 // 到货数量 = 订单数量,为完成,否则为采购中
if ((jsonReDtl.getDoubleValue("instor_qty") >= jsonProc.getDoubleValue("qty")) && (StrUtil.equals(jsonReDtl.getString("status"), "99"))) { if ((jsonReDtl.getDoubleValue("instor_qty") >= jsonProc.getDoubleValue("qty")) && (StrUtil.equals(jsonReDtl.getString("status"), "99"))) {
jsonProc.put("proc_status", ProcStatusEnum.FULFILL.getCode()); jsonProc.put("proc_status", ProcStatusEnum.FULFILL.getCode());
@@ -361,6 +382,8 @@ public class InbillServiceImpl {
} }
} }
} }
}
}
//更新主表状态为99 //更新主表状态为99
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo); WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);