This commit is contained in:
zds
2022-11-15 09:44:05 +08:00
parent 06a3ea258d
commit 328449b1cc
3 changed files with 26 additions and 22 deletions

View File

@@ -493,26 +493,6 @@ public class ReceivemstServiceImpl implements ReceivemstService {
}
JSONObject jsonFactMst = factMstTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn + "' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMst)) {
//插入质检单
HashMap<Object, Object> param = new HashMap<>();
param.put("material_id", String.valueOf(material_id));
boolean is_YL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.YL.getCode(), material_id, null);
boolean is_FL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.FL.getCode(), material_id, null);
boolean is_BCP = materialBaseService.isAlongMaterType(MaterOptTypeEnum.BCP.getCode(), material_id, null);
if (is_YL) param.put("inspection_type", "10");
if (is_FL) param.put("inspection_type", "20");
if (is_BCP) param.put("inspection_type", "30");
param.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
param.put("source_bill_id", MapUtil.getStr(whereJson, "receivedtl_id"));
param.put("source_bill_code", MapUtil.getStr(whereJson, "receive_code"));
param.put("source_bill_type", MapUtil.getStr(whereJson, "receive_type"));
param.put("source_bill_table", "PCS_RC_ReceiveDtl");
param.put("source_bill_table_pk", "");
param.put("base_bill_id", jsonReMst.get("source_id"));
param.put("base_bill_type", jsonReMst.get("source_type"));
inspectionsheetmstService.create(param);
}
if (ObjectUtil.isEmpty(jsonFactMst)) {
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + material_id + "'").uniqueResult(0);
JSONObject jsonUnit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
@@ -544,6 +524,30 @@ public class ReceivemstServiceImpl implements ReceivemstService {
jsonFat.put("manufactor", MapUtil.getStr(whereJson, "source_name"));
factMstTab.insert(jsonFat);
}else{
throw new PdaRequestException("厂家质保书已存在,不允许重复插入!");
}
if (ObjectUtil.isEmpty(jsonMst)) {
//插入质检单
HashMap<Object, Object> param = new HashMap<>();
param.put("material_id", String.valueOf(material_id));
boolean is_YL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.YL.getCode(), material_id, null);
boolean is_FL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.FL.getCode(), material_id, null);
boolean is_BCP = materialBaseService.isAlongMaterType(MaterOptTypeEnum.BCP.getCode(), material_id, null);
if (is_YL) param.put("inspection_type", "10");
if (is_FL) param.put("inspection_type", "20");
if (is_BCP) param.put("inspection_type", "30");
param.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
param.put("source_bill_id", MapUtil.getStr(whereJson, "receivedtl_id"));
param.put("source_bill_code", MapUtil.getStr(whereJson, "receive_code"));
param.put("source_bill_type", MapUtil.getStr(whereJson, "receive_type"));
param.put("source_bill_table", "PCS_RC_ReceiveDtl");
param.put("source_bill_table_pk", "");
param.put("base_bill_id", jsonReMst.get("source_id"));
param.put("base_bill_type", jsonReMst.get("source_type"));
inspectionsheetmstService.create(param);
}else{
throw new PdaRequestException("质检单已存在,不允许重复插入!");
}
}

View File

@@ -907,7 +907,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
Long deptId = currentUser.getDeptId();
JSONObject oldPhyMst = phyMstTab.query("is_delete='0' and inspection_id = '" + json.getString("inspection_id") + "'").uniqueResult(0);
JSONArray oldPhydtlArr = phyDtlTab.query("is_delete='0' and inspection_id = '" + json.getString("inspection_id") + "'").getResultJSONArray(0);
JSONArray oldPhydtlArr = phyDtlTab.query("inspection_id = '" + json.getString("inspection_id") + "'").getResultJSONArray(0);
// 单据状态必须为确认
if (!StrUtil.equals(oldPhyMst.getString("bill_status"), "99")) throw new BadRequestException("单据状态必须为完成!");

View File

@@ -410,7 +410,7 @@ export default {
for (let i = 0; i < _selectData.length; i++) {
const data = _selectData[i]
crudReceivemst.createQc(data).then(res => {
this.crud.notify('生成成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
}