代码更新

This commit is contained in:
2022-11-02 20:19:52 +08:00
parent 69a36aad9a
commit 204e5bde5f
5 changed files with 34 additions and 22 deletions

View File

@@ -215,10 +215,13 @@ public class MesToLmsServiceImpl implements MesToLmsService {
JSONObject result = new JSONObject();
WQLObject sbTab = WQLObject.getWQLObject("st_ivt_sbpointivt"); // 生箔点位库存表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
try {
String containerName = param.getString("ContainerName");
String resourceName = param.getString("ResourceName");
if (ObjectUtil.isEmpty(resourceName)) throw new BadRequestException("机台编码不能为空");
if (ObjectUtil.isEmpty(containerName)) throw new BadRequestException("母卷号不能为空");
JSONObject jsonSb = sbTab.query("ext_code = '" + resourceName + "' and is_used = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSb)) throw new BadRequestException("点位设备不存在");
@@ -235,6 +238,11 @@ public class MesToLmsServiceImpl implements MesToLmsService {
throw new BadRequestException(resultAcs.getString("message "));
}
// 更新工单状态
JSONObject jsonRaw = rawTab.query("container_name = '" + containerName + "'").uniqueResult(0);
jsonRaw.put("status", "03");
rawTab.update(jsonRaw);
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);

View File

@@ -162,7 +162,7 @@ public class BakingServiceImpl implements BakingService {
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有空暂存位");
// 查询烘箱对应的空位
JSONObject jsonHotIvt = hosIvtTab.query("product_area = '" + product_area + "' and temperature = '" + temperature + "' and point_location = '" + map.getString("point_location") + "' and is_used = '1' and point_status = '00' order by point_code ASC").uniqueResult(0);
JSONObject jsonHotIvt = hosIvtTab.query("product_area = '" + product_area + "' and temperature = '" + temperature + "' and point_location = '" + map.getString("point_location") + "' and is_used = '1' and point_status = '01' order by point_code ASC").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
// 3.创建冷却区 --> 烘烤区任务
@@ -199,8 +199,8 @@ public class BakingServiceImpl implements BakingService {
this.createHotDtl(hotParam);
// 生成冷却区出入表
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
Long currentUserId = 2L;
String currentUsername = "mes用户";
JSONObject jsonCool = new JSONObject();
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
@@ -353,8 +353,8 @@ public class BakingServiceImpl implements BakingService {
this.createHotDtl(hotParam);
// 生成冷却区出入表
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
Long currentUserId = 2L;
String currentUsername = "mes用户";
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
@@ -406,8 +406,8 @@ public class BakingServiceImpl implements BakingService {
jsonHotMst.put("qty_unit_id", param.getString("qty_unit_id"));
jsonHotMst.put("create_mode", "03");
jsonHotMst.put("task_id", param.getString("task_id"));
jsonHotMst.put("create_id", SecurityUtils.getCurrentUserId());
jsonHotMst.put("create_name", SecurityUtils.getCurrentUsername());
jsonHotMst.put("create_id", 2);
jsonHotMst.put("create_name", "mes用户");
jsonHotMst.put("create_time", DateUtil.now());
hotMstTab.insert(jsonHotMst);
@@ -430,8 +430,8 @@ public class BakingServiceImpl implements BakingService {
jsonHotDtl.put("oven_time", param.getString("oven_time"));
jsonHotDtl.put("task_type", "1");
jsonHotDtl.put("task_id", param.getString("task_id"));
jsonHotDtl.put("create_id", SecurityUtils.getCurrentUserId());
jsonHotDtl.put("create_name", SecurityUtils.getCurrentUsername());
jsonHotDtl.put("create_id", 2);
jsonHotDtl.put("create_name", "mes用户");
jsonHotDtl.put("create_time", DateUtil.now());
jsonHotDtl.put("dtl_status", "10");
hotDtlTab.insert(jsonHotDtl);

View File

@@ -123,26 +123,30 @@ public class RawFoilServiceImpl implements RawFoilService {
@Transactional(rollbackFor = Exception.class)
public JSONObject needEmptyAxis(JSONObject whereJson) {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料信息表
WQLObject sbTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt"); // 生箔点位库存表
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "01")) throw new BadRequestException("工单状态不为开始");
JSONObject jsonSb = sbTab.query("ext_code = '" + jsonRaw.getString("resource_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSb)) throw new BadRequestException("生箔点位不存在");
String start_pint_code = "";
// 2.根据就近原则查对应空卷抽
JSONObject map = new JSONObject();
map.put("flag", "1");
map.put("product_area", raw_jo.getString("product_area"));
map.put("point_location", raw_jo.getString("point_location"));
map.put("product_area", jsonSb.getString("product_area"));
map.put("point_location", jsonSb.getString("point_location"));
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
// 3.如果没找到则继续找下一节点
if (ObjectUtil.isEmpty(jsonIvt)) {
String point_location = raw_jo.getString("point_location");
String point_location = jsonSb.getString("point_location");
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
@@ -158,12 +162,12 @@ public class RawFoilServiceImpl implements RawFoilService {
String point_code4= "";
JSONObject map4 = new JSONObject();
map4.put("flag", "2");
map4.put("product_area", raw_jo.getString("product_area"));
map4.put("point_location", raw_jo.getString("point_location"));
map4.put("product_area", jsonSb.getString("product_area"));
map4.put("point_location", jsonSb.getString("point_location"));
JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map4).process().uniqueResult(0);
// 3.如果没找到则继续找下一节点
if (ObjectUtil.isEmpty(jsonIvt4)) {
String point_location = raw_jo.getString("point_location");
String point_location = jsonSb.getString("point_location");
if (StrUtil.equals(point_location, "0")) {
map4.put("point_location", "1");
}
@@ -182,8 +186,8 @@ public class RawFoilServiceImpl implements RawFoilService {
// 起点和终点确定 生成任务
JSONObject param = new JSONObject();
param.put("point_code1", start_pint_code);
param.put("point_code2", jsonRaw.getString("point_code"));
param.put("point_code3", jsonRaw.getString("point_code"));
param.put("point_code2", jsonSb.getString("point_code"));
param.put("point_code3", jsonSb.getString("point_code"));
param.put("point_code4", point_code4);
param.put("task_type", "010101");
param.put("material_code", jsonRaw.getString("container_name"));
@@ -208,7 +212,7 @@ public class RawFoilServiceImpl implements RawFoilService {
jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
jsonRegion.put("qty_unit_id", jsonMater.get("base_unit_id"));
jsonRegion.put("bill_status", "10");
jsonRegion.put("start_point_code", jsonRaw.getString("point_code"));
jsonRegion.put("start_point_code", jsonSb.getString("point_code"));
jsonRegion.put("end_point_code", point_code4);
jsonRegion.put("cust_id", "");
jsonRegion.put("create_mode", "03");

View File

@@ -50,7 +50,7 @@
WHERE
is_delete = '0'
AND is_used = '1'
AND point_status = '00'
AND point_status = '1'
OPTION 输入.reging_id <> ""
region_id = 输入.reging_id

View File

@@ -126,7 +126,7 @@ public class OutHotTask extends AbstractAcsTask {
pointTab.update(jsonPoint2);
// 更新烘箱区库存状态
jsonHotIvt.put("point_status", "00");
jsonHotIvt.put("point_status", "01");
jsonHotIvt.put("container_name","" );
jsonHotIvt.put("workorder_id","" );
jsonHotIvt.put("ivt_qty",0 );