理化报告同步

This commit is contained in:
2022-09-13 14:08:20 +08:00
parent d0ddc6cf68
commit 3c772a7850
3 changed files with 166 additions and 120 deletions

View File

@@ -131,7 +131,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
String inspection_type = json.getString("inspection_type"); String inspection_type = json.getString("inspection_type");
String inspection_id_gu = json.getString("inspection_id_gu"); String inspection_id_gu = json.getString("inspection_id_gu");
Long inspection_id = json.getLong Long inspection_id = json.getLong
("inspection_id"); ("inspection_id");
if (ObjectUtil.isEmpty("inspection_id")) throw new BadRequestException("质检单标识不能为空!"); if (ObjectUtil.isEmpty("inspection_id")) throw new BadRequestException("质检单标识不能为空!");
//1、 判断批号和物料是否已存在 //1、 判断批号和物料是否已存在
@@ -173,7 +173,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
private void createInspectionSheet(JSONObject json) { private void createInspectionSheet(JSONObject json) {
String pcsn = json.getString("pcsn"); String pcsn = json.getString("pcsn");
Long material_id = json.getLong Long material_id = json.getLong
("material_id"); ("material_id");
String inspection_type = json.getString("inspection_type"); String inspection_type = json.getString("inspection_type");
@@ -216,7 +216,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
JSONObject dtlObj = new JSONObject(); JSONObject dtlObj = new JSONObject();
dtlObj.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId()); dtlObj.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
dtlObj.put("inspection_id", mstObj.getLong dtlObj.put("inspection_id", mstObj.getLong
("inspection_id")); ("inspection_id"));
dtlObj.put("seq_no", 1); dtlObj.put("seq_no", 1);
dtlObj.put("material_id", material_id); dtlObj.put("material_id", material_id);
dtlObj.put("pcsn", pcsn); dtlObj.put("pcsn", pcsn);
@@ -257,7 +257,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
String material_id = form.getString("material_id"); String material_id = form.getString("material_id");
String pcsn = form.getString("pcsn"); String pcsn = form.getString("pcsn");
Long change_material_id = form.getLong Long change_material_id = form.getLong
("change_material_id"); ("change_material_id");
String change_pcsn = form.getString("change_pcsn"); String change_pcsn = form.getString("change_pcsn");
@@ -277,7 +277,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
//质检单重损计算表【QL_TEST_InspectionWeightLost】 //质检单重损计算表【QL_TEST_InspectionWeightLost】
WQLObject lostTab = WQLObject.getWQLObject("QL_TEST_InspectionWeightLost"); WQLObject lostTab = WQLObject.getWQLObject("QL_TEST_InspectionWeightLost");
JSONObject lostObj = lostTab.query("inspectiondtl_id = " + sheetObj.getLong JSONObject lostObj = lostTab.query("inspectiondtl_id = " + sheetObj.getLong
("inspectiondtl_id")).uniqueResult(0); ("inspectiondtl_id")).uniqueResult(0);
if (ObjectUtil.isNotEmpty(lostObj)) { if (ObjectUtil.isNotEmpty(lostObj)) {
form.put("weightlost", lostObj.getString("weightlost")); form.put("weightlost", lostObj.getString("weightlost"));
} }
@@ -337,7 +337,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
//理化报告单明细表【QL_TEST_PhysicalDtl】 //理化报告单明细表【QL_TEST_PhysicalDtl】
WQLObject dtlTab = WQLObject.getWQLObject("QL_TEST_PhysicalDtl"); WQLObject dtlTab = WQLObject.getWQLObject("QL_TEST_PhysicalDtl");
dtlTab.delete("inspection_id = " + form.getLong dtlTab.delete("inspection_id = " + form.getLong
("inspection_id")); ("inspection_id"));
JSONArray rows = form.getJSONArray("tableData"); JSONArray rows = form.getJSONArray("tableData");
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
@@ -437,7 +437,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
JSONObject jsonObject = itemArr.getJSONObject(i); JSONObject jsonObject = itemArr.getJSONObject(i);
String inspection_item_id = jsonObject.getString("inspection_item_id"); String inspection_item_id = jsonObject.getString("inspection_item_id");
JSONObject JsonValue = phyDtlTab.query("inspection_item_id = '" + inspection_item_id + "' and inspection_id = '" + inspection_id + "'").uniqueResult(0); JSONObject JsonValue = phyDtlTab.query("inspection_item_id = '" + inspection_item_id + "' and inspection_id = '" + inspection_id + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(JsonValue)) num = num + 1; if (ObjectUtil.isNotEmpty(JsonValue)) num = num + 1;
} }
// if (itemArr.size() != num) throw new BadRequestException("所有项点必须有值"); // if (itemArr.size() != num) throw new BadRequestException("所有项点必须有值");
@@ -570,7 +570,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
JSONObject resultJson = wmsToLkService.qualityResult(param); JSONObject resultJson = wmsToLkService.qualityResult(param);
if (StrUtil.equals(resultJson.getString("result"), "2")) { if (StrUtil.equals(resultJson.getString("result"), "2")) {
throw new BadRequestException("发送立库失败:"+resultJson.getString("messsage")); throw new BadRequestException("发送立库失败:" + resultJson.getString("messsage"));
} }
} }
} else if (StrUtil.equals(inspection_type, "10") || StrUtil.equals(inspection_type, "20")) { } else if (StrUtil.equals(inspection_type, "10") || StrUtil.equals(inspection_type, "20")) {
@@ -606,7 +606,9 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
sheetDtlTab.update(jsonSheetDtl); sheetDtlTab.update(jsonSheetDtl);
// 调用质检单中的确认 // 调用质检单中的确认
inspectionsheetmstService.confirm(jsonSheetDtl); inspectionsheetmstService.confirm(jsonSheetDtl);
} else {throw new BadRequestException("物料类型错误");} } else {
throw new BadRequestException("物料类型错误");
}
} else if (StrUtil.equals(result, "02")) { } else if (StrUtil.equals(result, "02")) {
// 不合格 // 不合格
/* /*
@@ -783,7 +785,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
* 插入【质检单明细】 * 插入【质检单明细】
*/ */
long inspectiondtl_id = jsonSheetDtl.getLong long inspectiondtl_id = jsonSheetDtl.getLong
("inspectiondtl_id"); // 原质检单明细标识 ("inspectiondtl_id"); // 原质检单明细标识
jsonSheetDtl.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId()); jsonSheetDtl.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonSheetDtl.put("inspection_id", jsonSheetMst.get("inspection_id")); jsonSheetDtl.put("inspection_id", jsonSheetMst.get("inspection_id"));
jsonSheetDtl.put("bill_status", QlBillStatusEnum.FINISH.getCode()); jsonSheetDtl.put("bill_status", QlBillStatusEnum.FINISH.getCode());
@@ -806,11 +808,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
newJsonPhyMst.put("inspection_type", "30"); newJsonPhyMst.put("inspection_type", "30");
newJsonPhyMst.put("biz_date", DateUtil.today()); newJsonPhyMst.put("biz_date", DateUtil.today());
newJsonPhyMst.put("material_id", jsonPhyMst.getLong newJsonPhyMst.put("material_id", jsonPhyMst.getLong
("change_material_id")); ("change_material_id"));
newJsonPhyMst.put("pcsn", jsonPhyMst.getString("change_pcsn")); newJsonPhyMst.put("pcsn", jsonPhyMst.getString("change_pcsn"));
newJsonPhyMst.put("bill_status", QlBillStatusEnum.FINISH.getCode()); newJsonPhyMst.put("bill_status", QlBillStatusEnum.FINISH.getCode());
newJsonPhyMst.put("source_bill_id", jsonSheetDtl.getLong newJsonPhyMst.put("source_bill_id", jsonSheetDtl.getLong
("inspection_id")); ("inspection_id"));
newJsonPhyMst.put("source_bill_type", jsonSheetDtl.getString("inspection_type")); newJsonPhyMst.put("source_bill_type", jsonSheetDtl.getString("inspection_type"));
newJsonPhyMst.put("source_bill_code", jsonSheetDtl.getString("inspection_code")); newJsonPhyMst.put("source_bill_code", jsonSheetDtl.getString("inspection_code"));
newJsonPhyMst.put("create_mode", "01"); newJsonPhyMst.put("create_mode", "01");
@@ -825,7 +827,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
phyMstTab.insert(newJsonPhyMst); phyMstTab.insert(newJsonPhyMst);
// 更新改用后的新理化单 // 更新改用后的新理化单
jsonPhyMst.put("inspection_id_change", newJsonPhyMst.getLong jsonPhyMst.put("inspection_id_change", newJsonPhyMst.getLong
("inspection_id")); ("inspection_id"));
phyMstTab.update(jsonPhyMst); phyMstTab.update(jsonPhyMst);
/* /*
* 插入【理化报告单明细表】 * 插入【理化报告单明细表】
@@ -835,7 +837,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
JSONObject json = jsonDtlArr.getJSONObject(i); JSONObject json = jsonDtlArr.getJSONObject(i);
json.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId()); json.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("inspection_id", newJsonPhyMst.getLong json.put("inspection_id", newJsonPhyMst.getLong
("inspection_id")); ("inspection_id"));
phyDtlTab.insert(json); phyDtlTab.insert(json);
} }
} }
@@ -965,9 +967,9 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
boolean is_GF = materialBaseService.isAlongMaterType(MaterOptTypeEnum.GF.getCode(), string, null); boolean is_GF = materialBaseService.isAlongMaterType(MaterOptTypeEnum.GF.getCode(), string, null);
boolean is_PGF = materialBaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), string, null); boolean is_PGF = materialBaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), string, null);
if (is_THW) jsonObject.put("param","10"); if (is_THW) jsonObject.put("param", "10");
if (is_GF) jsonObject.put("param","20"); if (is_GF) jsonObject.put("param", "20");
if (is_PGF) jsonObject.put("param","30"); if (is_PGF) jsonObject.put("param", "30");
return jsonObject; return jsonObject;
} }
@@ -980,8 +982,8 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("flag", "1"); map.put("flag", "1");
if (ObjectUtil.isNotEmpty(search_material_code)) map.put("search_material_code",search_material_code+"%"); if (ObjectUtil.isNotEmpty(search_material_code)) map.put("search_material_code", search_material_code + "%");
if (ObjectUtil.isNotEmpty(search_pcsn)) map.put("search_pcsn",search_pcsn+"%"); if (ObjectUtil.isNotEmpty(search_pcsn)) map.put("search_pcsn", search_pcsn + "%");
JSONObject json = WQL.getWO("QL_ERP").addParamMap(map).setDbname("dataSource1").pageQuery(WqlUtil.getHttpContext(page), "biz_date DESC"); JSONObject json = WQL.getWO("QL_ERP").addParamMap(map).setDbname("dataSource1").pageQuery(WqlUtil.getHttpContext(page), "biz_date DESC");
@@ -998,34 +1000,38 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
for (int i = 0; i < dataArr.size(); i++) { for (int i = 0; i < dataArr.size(); i++) {
JSONObject json = dataArr.getJSONObject(i); JSONObject json = dataArr.getJSONObject(i);
// 1.将erp物料id转换成本系统物料id JSONObject jsonPhyMst = phyMstTab.query("inspection_id = '"+json.getString("inspection_id")+"'").uniqueResult(0);
String ext_id = json.getString("material_id");
JSONObject jsonMater = materTab.query("ext_id = '" + ext_id + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料"+ext_id+"在mes系统不存在");
String material_id = jsonMater.getString("material_id");
String pcsn = json.getString("pcsn");
// 2.根据物料、批次查询理化报告单 查询是否有此物料、批次的理化报告
JSONObject jsonPhyMst = phyMstTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn + "' and is_delete = '0'").uniqueResult(0);
// 3.如果理化报告不存在则是有问题 先跳过不做处理
if (ObjectUtil.isEmpty(jsonPhyMst)) continue;
if (StrUtil.equals(jsonPhyMst.getString("bill_status"), "99")) { if (StrUtil.equals(jsonPhyMst.getString("bill_status"), "99")) {
throw new BadRequestException("此理化报告:"+jsonPhyMst.getString("inspection_code")+"已完成"); throw new BadRequestException("此理化报告:" + jsonPhyMst.getString("inspection_code") + "已完成");
} }
// 1.将wms物料id转换成本erp物料id
String material_id = json.getString("material_id");
JSONObject jsonMater = materTab.query("material_id = '" + material_id + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料" + material_id + "在mes系统不存在");
String pcsn = json.getString("pcsn");
// 2.根据物料、批次查询erp系统中是否存在此批次的理化报告
JSONObject map = new JSONObject();
map.put("flag", "2");
map.put("ext_id", jsonMater.getString("ext_id"));
map.put("pcsn", pcsn);
JSONObject jsonErp = WQL.getWO("QL_ERP").addParamMap(map).setDbname("dataSource1").process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonErp)) continue;
// 4.更新理化报告主表 // 4.更新理化报告主表
jsonPhyMst.put("result", json.getString("check_result")); jsonPhyMst.put("result", jsonErp.getString("check_result"));
jsonPhyMst.put("grade", "01"); jsonPhyMst.put("grade", "01");
jsonPhyMst.put("other_device_no", json.getString("other_device_no")); jsonPhyMst.put("other_device_no", jsonErp.getString("other_device_no"));
jsonPhyMst.put("other_device_wd", json.getString("other_device_wd")); jsonPhyMst.put("other_device_wd", jsonErp.getString("other_device_wd"));
jsonPhyMst.put("weightlost", json.getString("weightlost")); jsonPhyMst.put("weightlost", jsonErp.getString("weightlost"));
jsonPhyMst.put("remark", json.getString("remark")); jsonPhyMst.put("remark", jsonErp.getString("remark"));
jsonPhyMst.put("bill_status", "30"); jsonPhyMst.put("bill_status", "30");
phyMstTab.update(jsonPhyMst); phyMstTab.update(jsonPhyMst);
// 5.根据erp项点 插入理化报告明细 调用createPhyDtl() // 5.根据erp项点 插入理化报告明细 调用createPhyDtl()
json.put("inspection_id", jsonPhyMst.getString("inspection_id")); jsonErp.put("inspection_id", jsonPhyMst.getString("inspection_id"));
this.createPhyDtl(json); this.createPhyDtl(jsonErp);
// 6.确认单据 // 6.确认单据
this.confirm(jsonPhyMst); this.confirm(jsonPhyMst);
} }
@@ -1033,7 +1039,8 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
} }
/** /**
* 查询理化质检检测项点 公共方法 * 查询理化质检检测项点 公共方法
*
* @param item_code: 项点编码 / * @param item_code: 项点编码 /
* @return json * @return json
*/ */
@@ -1045,7 +1052,8 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
} }
/** /**
* 根据erp项点插入理化报告明细 * 根据erp项点插入理化报告明细
*
* @param json / * @param json /
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -1070,11 +1078,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("midu")); jsonDtl.put("value", json.getDoubleValue("midu"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("midu")); jsonDtlInsert.put("value", json.getDoubleValue("midu"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1092,11 +1100,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("hc")); jsonDtl.put("value", json.getDoubleValue("hc"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("hc")); jsonDtlInsert.put("value", json.getDoubleValue("hc"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1114,11 +1122,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("hra")); jsonDtl.put("value", json.getDoubleValue("hra"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("hra")); jsonDtlInsert.put("value", json.getDoubleValue("hra"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1136,11 +1144,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("ms")); jsonDtl.put("value", json.getDoubleValue("ms"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("ms")); jsonDtlInsert.put("value", json.getDoubleValue("ms"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1158,11 +1166,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("xa100")); jsonDtl.put("value", json.getDoubleValue("xa100"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("xa100")); jsonDtlInsert.put("value", json.getDoubleValue("xa100"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1180,11 +1188,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("xb100")); jsonDtl.put("value", json.getDoubleValue("xb100"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("xb100")); jsonDtlInsert.put("value", json.getDoubleValue("xb100"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1202,11 +1210,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("xc100")); jsonDtl.put("value", json.getDoubleValue("xc100"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("xc100")); jsonDtlInsert.put("value", json.getDoubleValue("xc100"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1224,11 +1232,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("xe100")); jsonDtl.put("value", json.getDoubleValue("xe100"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("xe100")); jsonDtlInsert.put("value", json.getDoubleValue("xe100"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1290,11 +1298,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("jl10")); jsonDtl.put("value", json.getDoubleValue("jl10"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("jl10")); jsonDtlInsert.put("value", json.getDoubleValue("jl10"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1312,11 +1320,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("jl15")); jsonDtl.put("value", json.getDoubleValue("jl15"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("jl15")); jsonDtlInsert.put("value", json.getDoubleValue("jl15"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1334,11 +1342,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("jl20")); jsonDtl.put("value", json.getDoubleValue("jl20"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("jl20")); jsonDtlInsert.put("value", json.getDoubleValue("jl20"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1356,11 +1364,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("jl25")); jsonDtl.put("value", json.getDoubleValue("jl25"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("jl25")); jsonDtlInsert.put("value", json.getDoubleValue("jl25"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1378,11 +1386,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("jl30")); jsonDtl.put("value", json.getDoubleValue("jl30"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("jl30")); jsonDtlInsert.put("value", json.getDoubleValue("jl30"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }
@@ -1400,11 +1408,11 @@ public class PhysicalMstServiceImpl implements PhysicalMstService {
jsonDtl.put("value", json.getDoubleValue("jl_dia")); jsonDtl.put("value", json.getDoubleValue("jl_dia"));
phyDtlTab.update(jsonDtl); phyDtlTab.update(jsonDtl);
} else { } else {
jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1,1).nextId()); jsonDtlInsert.put("inspectiondtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonDtlInsert.put("inspection_id",inspection_id); jsonDtlInsert.put("inspection_id", inspection_id);
jsonDtlInsert.put("seq_no",1); jsonDtlInsert.put("seq_no", 1);
jsonDtlInsert.put("inspection_item_id",inspection_item_id); jsonDtlInsert.put("inspection_item_id", inspection_item_id);
jsonDtlInsert.put("value",json.getDoubleValue("jl_dia")); jsonDtlInsert.put("value", json.getDoubleValue("jl_dia"));
phyDtlTab.insert(jsonDtlInsert); phyDtlTab.insert(jsonDtlInsert);
} }
} }

View File

@@ -14,8 +14,8 @@
## 表字段对应输入参数 ## 表字段对应输入参数
################################################# #################################################
输入.flag TYPEAS s_string 输入.flag TYPEAS s_string
输入.search_material_code TYPEAS s_string 输入.ext_id TYPEAS s_string
输入.search_pcsn TYPEAS s_string 输入.pcsn TYPEAS s_string
[临时表] [临时表]
@@ -63,20 +63,45 @@
ENDIF ENDIF
IF 输入.flag = "2" IF 输入.flag = "2"
PAGEQUERY QUERY
SELECT SELECT
* *
FROM FROM
QL_TEST_PHYSICAL QL_TEST_PHYSICAL
where
is_effective = '1'
AND dr = '0'
OPTION 输入.search_material_code <> "" OPTION 输入.ext_id <> ""
'material_code' like 输入.search_material_code material_id = 输入.ext_id
ENDOPTION ENDOPTION
OPTION 输入.search_pcsn <> "" OPTION 输入.pcsn <> ""
'pcsn' like 输入.search_pcsn pcsn = 输入.pcsn
ENDOPTION ENDOPTION
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDQUERY
ENDIF
IF 输入.flag = "3"
QUERY
SELECT
*
FROM
QL_TEST_PHYSICAL
where
'is_effective' = '1'
AND 'dr' = '0'
OPTION 输入.ext_id <> ""
'material_id' = 输入.ext_id
ENDOPTION
OPTION 输入.pcsn <> ""
'pcsn' = 输入.pcsn
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF ENDIF

View File

@@ -150,7 +150,7 @@
type="success" type="success"
icon="el-icon-refresh" icon="el-icon-refresh"
size="mini" size="mini"
@click="phySyncShow = true" @click="phySync"
> >
理化同步 理化同步
</el-button> </el-button>
@@ -252,7 +252,7 @@
<MaterDtl :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" /> <MaterDtl :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
<Dialog1 :visiable1.sync="visiable1" :inspection-id="inspection_id" /> <Dialog1 :visiable1.sync="visiable1" :inspection-id="inspection_id" />
<RelevancyDialog :dialog-show.sync="RelevancyShow" @RelevancyChanged="RelevancyChanged" /> <RelevancyDialog :dialog-show.sync="RelevancyShow" @RelevancyChanged="RelevancyChanged" />
<PhySyncDialog :dialog-show.sync="phySyncShow" /> <!-- <PhySyncDialog :dialog-show.sync="phySyncShow" />-->
</div> </div>
</template> </template>
@@ -432,6 +432,19 @@ export default {
this.crud.notify('设置成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('设置成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery() this.crud.toQuery()
}) })
},
phySync() {
const _selectData = this.$refs.table.selection
if (_selectData.length === 0) {
return this.crud.notify('请至少选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = {
'data': _selectData
}
crudPhysicalMst.hpySync(data).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
} }
} }
} }