修改
This commit is contained in:
@@ -136,7 +136,11 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
return result;
|
||||
}
|
||||
|
||||
JSONArray list = new JSONArray();
|
||||
|
||||
String UserName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("UserName",UserName);
|
||||
param.put("Password",Password);
|
||||
|
||||
// String url = acsUrl + api;
|
||||
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
* 1.第二条任务出现异常后 如何再次触发
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject ovenInAndOut(JSONObject whereJson) {
|
||||
|
||||
String option = whereJson.getString("option"); // 1-入箱 2-出箱
|
||||
@@ -80,9 +80,9 @@ public class BakingServiceImpl implements BakingService {
|
||||
// 1.查询烘箱对应的空位
|
||||
JSONObject jsonMap = new JSONObject();
|
||||
jsonMap.put("flag", "1");
|
||||
jsonMap.put("product_area",jsonPointZc.getString("product_area"));
|
||||
jsonMap.put("temperature",temperature);
|
||||
jsonMap.put("point_location",jsonPointZc.getString("point_location"));
|
||||
jsonMap.put("product_area", jsonPointZc.getString("product_area"));
|
||||
jsonMap.put("temperature", temperature);
|
||||
jsonMap.put("point_location", jsonPointZc.getString("point_location"));
|
||||
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
|
||||
// 2.创建暂存位 --> 烘烤区任务
|
||||
@@ -103,6 +103,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
hotParam.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
hotParam.put("material_id", jsonMater.getString("material_id"));
|
||||
hotParam.put("qty", jsonRaw.get("productin_qty"));
|
||||
hotParam.put("io_type", "1");
|
||||
hotParam.put("qty_unit_id", jsonMater.getString("base_unit_id"));
|
||||
hotParam.put("task_id", task_id);
|
||||
hotParam.put("start_point_code", point_code1);
|
||||
@@ -173,9 +174,9 @@ public class BakingServiceImpl implements BakingService {
|
||||
|
||||
JSONObject jsonMap = new JSONObject();
|
||||
jsonMap.put("flag", "1");
|
||||
jsonMap.put("product_area",product_area);
|
||||
jsonMap.put("temperature",temperature);
|
||||
jsonMap.put("point_location",map.getString("point_location"));
|
||||
jsonMap.put("product_area", product_area);
|
||||
jsonMap.put("temperature", temperature);
|
||||
jsonMap.put("point_location", map.getString("point_location"));
|
||||
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
|
||||
|
||||
@@ -202,8 +203,9 @@ public class BakingServiceImpl implements BakingService {
|
||||
hotParam.put("qty", jsonRaw.get("productin_qty"));
|
||||
hotParam.put("qty_unit_id", jsonMater.getString("base_unit_id"));
|
||||
hotParam.put("task_id", task_id);
|
||||
hotParam.put("io_type", "0");
|
||||
hotParam.put("start_point_code", point_code1);
|
||||
hotParam.put("next_point_code", jsonHotIvt.getString("point_code"));
|
||||
hotParam.put("end_point_code", jsonHotIvt.getString("point_code"));
|
||||
hotParam.put("temperature", temperature);
|
||||
hotParam.put("oven_time", hours);
|
||||
this.createHotIoMst(hotParam);
|
||||
@@ -292,18 +294,22 @@ public class BakingServiceImpl implements BakingService {
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
String task_id = outHotTask.createTask(param);
|
||||
|
||||
// 4.插入烘箱区出入明细表
|
||||
JSONObject jsonHotReMst = hosReMstTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and bill_status <> '50' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonHotReMst)) throw new BadRequestException("烘箱区出入主表不存在");
|
||||
//查询该母卷对应最近的一条入烘箱记录
|
||||
JSONObject last_hot_mst = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst").query("container_name = '" + jsonHotIvt.getString("container_name") + "' AND io_type = '0' order by confirm_time desc").uniqueResult(0);
|
||||
|
||||
// 创建明细
|
||||
JSONObject hotParam = new JSONObject();
|
||||
hotParam.put("container_name", last_hot_mst.getString("container_name"));
|
||||
hotParam.put("workorder_id", last_hot_mst.getString("workorder_id"));
|
||||
hotParam.put("material_id", last_hot_mst.getString("material_id"));
|
||||
hotParam.put("qty", last_hot_mst.get("qty"));
|
||||
hotParam.put("io_type", "1");
|
||||
hotParam.put("qty_unit_id", last_hot_mst.getString("qty_unit_id"));
|
||||
hotParam.put("task_id", task_id);
|
||||
hotParam.put("iostorinv_id", jsonHotReMst.getString("iostorinv_id"));
|
||||
hotParam.put("start_point_code", point_code1);
|
||||
hotParam.put("next_point_code", point_code2);
|
||||
hotParam.put("temperature", jsonHotIvt.getString("temperature"));
|
||||
this.createHotDtl(hotParam);
|
||||
hotParam.put("end_point_code", point_code2);
|
||||
hotParam.put("temperature", last_hot_mst.getString("temperature"));
|
||||
hotParam.put("oven_time", last_hot_mst.getString("oven_time"));
|
||||
this.createHotIoMst(hotParam);
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
@@ -311,7 +317,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject inCoolIvt(JSONObject whereJson) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位点
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
@@ -356,7 +362,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
InCoolIvtTask inCoolIvtTask = new InCoolIvtTask();
|
||||
String task_id = inCoolIvtTask.createTask(param);
|
||||
|
||||
// 4.插入明细
|
||||
/* // 4.插入明细
|
||||
JSONObject jsonHotMst = hotMstTab.query("container_name = '" + container_name + "' and is_delete = '0' and bill_status <> '50'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonHotMst)) throw new BadRequestException("烘烤区出入主表不存在");
|
||||
JSONObject hotParam = new JSONObject();
|
||||
@@ -364,7 +370,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
hotParam.put("iostorinv_id", jsonHotMst.getString("iostorinv_id"));
|
||||
hotParam.put("start_point_code", point_code1);
|
||||
hotParam.put("next_point_code", jsonCooIvt.getString("full_point_code"));
|
||||
this.createHotDtl(hotParam);
|
||||
this.createHotDtl(hotParam);*/
|
||||
|
||||
// 生成冷却区出入表
|
||||
Long currentUserId = 2L;
|
||||
@@ -416,6 +422,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonHotMst.put("workorder_id", param.getString("workorder_id"));
|
||||
jsonHotMst.put("material_id", param.get("material_id"));
|
||||
jsonHotMst.put("qty", param.getString("qty"));
|
||||
jsonHotMst.put("io_type", param.getString("io_type"));
|
||||
jsonHotMst.put("bill_status", "50");
|
||||
jsonHotMst.put("qty_unit_id", param.getString("qty_unit_id"));
|
||||
jsonHotMst.put("start_point_code", param.getString("start_point_code"));
|
||||
|
||||
@@ -9,9 +9,12 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.pda.mps.service.BakingService;
|
||||
import org.nl.wms.pda.mps.service.HandleBakingService;
|
||||
@@ -47,11 +50,8 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
|
||||
String option = whereJson.getString("option"); // 1-入箱 2-出箱
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位表
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
|
||||
WQLObject hosIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烤箱区点位库存表
|
||||
WQLObject hosReMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烤箱区出入主表
|
||||
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
||||
@@ -63,6 +63,12 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
String point_code1 = whereJson.getString("point_code"); // 起点
|
||||
String next_point_code = whereJson.getString("next_point_code"); // 终点
|
||||
|
||||
JSONObject cool_ivt = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
String on_container_name = cool_ivt.getString("container_name");
|
||||
if (!on_container_name.equals(container_name)) {
|
||||
throw new BadRequestException("点位上子卷不符!");
|
||||
}
|
||||
|
||||
Long currentUserId = 2L;
|
||||
String currentUsername = "默认用户";
|
||||
|
||||
@@ -127,13 +133,16 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
hotParam.put("qty", jsonRaw.get("productin_qty"));
|
||||
hotParam.put("qty_unit_id", jsonMater.getString("base_unit_id"));
|
||||
hotParam.put("start_point_code", point_code1);
|
||||
hotParam.put("next_point_code", next_point_code);
|
||||
hotParam.put("end_point_code", next_point_code);
|
||||
hotParam.put("temperature", temperature);
|
||||
hotParam.put("oven_time", hours);
|
||||
this.createHotIoMst(hotParam);
|
||||
|
||||
// 更新烘箱区库存状态
|
||||
JSONObject jsonHotIvt = hosIvtTab.query("point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(jsonHotIvt.getString("container_name"))){
|
||||
throw new BadRequestException("目的点上存在母卷!");
|
||||
}
|
||||
jsonHotIvt.put("point_status", "02");
|
||||
jsonHotIvt.put("container_name", container_name);
|
||||
jsonHotIvt.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
@@ -198,6 +207,9 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
|
||||
//更新冷却区库存
|
||||
JSONObject jsonIvt = coolIvtTab.query("full_point_code ='" + next_point_code + "'").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(jsonIvt.getString("container_name"))){
|
||||
throw new BadRequestException("目的点上存在母卷!");
|
||||
}
|
||||
jsonIvt.put("full_point_status", "02");
|
||||
jsonIvt.put("cool_ivt_status", "03");
|
||||
jsonIvt.put("instorage_time", DateUtil.now());
|
||||
@@ -217,20 +229,33 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
String container_name = whereJson.getString("container_name");
|
||||
|
||||
if (StrUtil.isEmpty(point_code)){
|
||||
if (StrUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(container_name)){
|
||||
if (StrUtil.isEmpty(container_name)) {
|
||||
throw new BadRequestException("母卷不能为空!");
|
||||
}
|
||||
|
||||
JSONObject cool_ivt = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '"+point_code+"'").uniqueResult(0);
|
||||
String on_container_name = cool_ivt.getString("on_container_name");
|
||||
if (!on_container_name.equals(container_name)){
|
||||
JSONObject cool_ivt = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + point_code + "'").uniqueResult(0);
|
||||
String on_container_name = cool_ivt.getString("container_name");
|
||||
if (!on_container_name.equals(container_name)) {
|
||||
throw new BadRequestException("点位上子卷不符!");
|
||||
}
|
||||
|
||||
cool_ivt.put("cool_ivt_status","04");
|
||||
cool_ivt.put("cool_ivt_status", "04");
|
||||
|
||||
//调用回传MES的半成品入库接口
|
||||
// 将入冷却信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String passWord = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("iContainerName", on_container_name);
|
||||
param.put("iArrivalTime", DateUtil.now());
|
||||
param.put("iWarehouse", 2);
|
||||
param.put("UserName", userName);
|
||||
param.put("PassWord", passWord);
|
||||
|
||||
new LmsToMesServiceImpl().momRollSemiFGInboundComplete(param);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
@@ -252,6 +277,7 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
jsonHotMst.put("material_id", param.get("material_id"));
|
||||
jsonHotMst.put("qty", param.getString("qty"));
|
||||
jsonHotMst.put("bill_status", "50");
|
||||
jsonHotMst.put("io_type", param.get("io_type"));
|
||||
jsonHotMst.put("qty_unit_id", param.getString("qty_unit_id"));
|
||||
jsonHotMst.put("start_point_code", param.getString("start_point_code"));
|
||||
jsonHotMst.put("end_point_code", param.getString("end_point_code"));
|
||||
|
||||
@@ -145,7 +145,7 @@ public class OutServiceImpl implements OutService {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("point_code1", point_code);
|
||||
jo.put("point_code2", delivery_point.getString("point_code"));
|
||||
jo.put("point_code3", delivery_point.getString("point_code"));
|
||||
jo.put("point_code3",delivery_point.getString("point_code"));
|
||||
jo.put("point_code4", point_code);
|
||||
jo.put("vehicle_code", delivery_point.getString("qzzno"));
|
||||
jo.put("vehicle_code2", cut_qzzno);
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND full_point_status = '01'
|
||||
AND empty_point_status = '01'
|
||||
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
@@ -95,7 +96,7 @@
|
||||
OPTION 输入.point_location <> ""
|
||||
point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
|
||||
ORDER BY sort_seq desc
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -62,11 +62,11 @@ public class CoolInServiceImpl implements CoolInService {
|
||||
String is_bake = whereJson.getString("is_bake"); // 是否烘烤完成
|
||||
|
||||
// 查询终点在冷却区是否存在
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("point_code = '" + point_code + "' and full_point_status = '01' and empty_point_status = '01' and is_used = '1'").uniqueResult(0);
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + point_code + "' and full_point_status = '01' and empty_point_status = '01' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("此点位不存在或被占用"+point_code);
|
||||
|
||||
//查询该点位是否存在任务
|
||||
JSONObject task_jo = WQLObject.getWQLObject("").query("(point_code1 like '%"+jsonCoolIvt.getString("point_code")+"%' OR point_code2 like '%"+jsonCoolIvt.getString("point_code")+"%') AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%"+jsonCoolIvt.getString("point_code")+"%' OR point_code2 like '%"+jsonCoolIvt.getString("point_code")+"%') AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)){
|
||||
throw new BadRequestException("该点位存在未完成的任务,不允许绑定!");
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
输入.is_used TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.container_name TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.dtl_status TYPEAS s_string
|
||||
输入.task_code TYPEAS s_string
|
||||
@@ -83,34 +84,18 @@
|
||||
SELECT
|
||||
mst.bill_code,
|
||||
mst.container_name,
|
||||
dtl.start_point_code,
|
||||
dtl.next_point_code,
|
||||
dtl.temperature,
|
||||
dtl.oven_time,
|
||||
dtl.create_name,
|
||||
dtl.create_time,
|
||||
dtl.confirm_optname,
|
||||
dtl.confirm_time,
|
||||
(
|
||||
CASE
|
||||
dtl.dtl_status
|
||||
WHEN '10' THEN '生成'
|
||||
WHEN '40' THEN '执行中'
|
||||
WHEN '50' THEN '确认'
|
||||
END
|
||||
) AS dtl_status,
|
||||
(
|
||||
CASE
|
||||
dtl.task_type
|
||||
WHEN '0' THEN 'AGV任务'
|
||||
WHEN '1' THEN '桁架任务'
|
||||
END
|
||||
) AS task_type,
|
||||
mst.start_point_code,
|
||||
mst.end_point_code,
|
||||
mst.temperature,
|
||||
mst.oven_time,
|
||||
mst.create_name,
|
||||
mst.create_time,
|
||||
mst.confirm_optname,
|
||||
mst.confirm_time,
|
||||
task.task_code
|
||||
FROM
|
||||
ST_IVT_HotRegionIODtl dtl
|
||||
LEFT JOIN ST_IVT_HotRegionIOMst mst ON mst.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dtl.task_id
|
||||
ST_IVT_HotRegionIOMst mst
|
||||
LEFT JOIN sch_base_task task ON task.task_id = mst.task_id
|
||||
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
@@ -119,28 +104,28 @@
|
||||
mst.bill_code = 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.dtl_status <> ""
|
||||
dtl.dtl_status = 输入.dtl_status
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.task_code <> ""
|
||||
task.task_code like 输入.task_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.start_point_code <> ""
|
||||
dtl.start_point_code like 输入.start_point_code
|
||||
mst.start_point_code like 输入.start_point_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.next_point_code <> ""
|
||||
dtl.next_point_code like 输入.next_point_code
|
||||
mst.end_point_code like 输入.next_point_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
dtl.create_time >= 输入.begin_time
|
||||
mst.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
dtl.create_time <= 输入.end_time
|
||||
mst.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.container_name = 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
|
||||
Binary file not shown.
@@ -157,7 +157,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2);
|
||||
|
||||
// 更新工单状态为完成
|
||||
jsonRaw.put("status", "09");
|
||||
jsonRaw.put("status", "09");
|
||||
rawTab.update(jsonRaw);
|
||||
|
||||
// 更新冷却库存状态
|
||||
@@ -179,7 +179,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
JSONObject jsonRegion = new JSONObject();
|
||||
jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonRegion.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
||||
jsonRegion.put("io_type", "1");
|
||||
jsonRegion.put("io_type", "0");
|
||||
jsonRegion.put("material_id", jsonMater.getString("material_id"));
|
||||
jsonRegion.put("pcsn", jsonRaw.getString("container_name"));
|
||||
jsonRegion.put("vehicle_code", "");
|
||||
@@ -194,6 +194,12 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
jsonRegion.put("create_id", currentUserId);
|
||||
jsonRegion.put("create_name", currentUsername);
|
||||
jsonRegion.put("create_time", DateUtil.now());
|
||||
jsonRegion.put("update_optid", currentUserId);
|
||||
jsonRegion.put("update_optname", currentUsername);
|
||||
jsonRegion.put("update_time", DateUtil.now());
|
||||
jsonRegion.put("confirm_optid", currentUserId);
|
||||
jsonRegion.put("confirm_optname", currentUsername);
|
||||
jsonRegion.put("confirm_time", DateUtil.now());
|
||||
coolTab.insert(jsonRegion);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +66,6 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工序工单表
|
||||
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱出入主表
|
||||
WQLObject hotDtlTab = WQLObject.getWQLObject("ST_IVT_HotRegionIODtl"); // 烘箱出入明细表
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
@@ -76,9 +74,6 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
// 取消删除任务
|
||||
taskTab.delete("task_id = '"+task_id+"'");
|
||||
|
||||
// 删除烘箱任务明细
|
||||
hotDtlTab.delete("task_id = '"+task_id+"'");
|
||||
|
||||
// 删除冷却区出入表
|
||||
coolTab.delete("task_id = '"+task_id+"'");
|
||||
}
|
||||
@@ -118,29 +113,16 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
// 更新冷却库存状态
|
||||
JSONObject jsonHotMst = hotMstTab.query("container_name = '" + jsonTask.getString("material_code") + "'").uniqueResult(0);
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + jsonTask.getString("material_code") + "'").uniqueResult(0);
|
||||
|
||||
jsonIvt.put("full_point_status", "02");
|
||||
jsonIvt.put("cool_ivt_status", "03");
|
||||
jsonIvt.put("cool_ivt_status", "04");
|
||||
jsonIvt.put("instorage_time", DateUtil.now());
|
||||
jsonIvt.put("container_name", jsonHotMst.getString("container_name"));
|
||||
jsonIvt.put("workorder_id", jsonHotMst.getString("workorder_id"));
|
||||
jsonIvt.put("ivt_qty", jsonHotMst.getString("qty"));
|
||||
jsonIvt.put("container_name", raw_jo.getString("container_name"));
|
||||
jsonIvt.put("workorder_id", raw_jo.getString("workorder_id"));
|
||||
jsonIvt.put("ivt_qty", raw_jo.getString("qty"));
|
||||
ivtTab.update(jsonIvt);
|
||||
|
||||
// 更新冷却出入主表状态
|
||||
JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonCool.put("bill_status", "50");
|
||||
coolTab.update(jsonCool);
|
||||
|
||||
// 更新烘烤出入主表为完成
|
||||
jsonHotMst.put("bill_status", "50");
|
||||
hotMstTab.update(jsonHotMst);
|
||||
|
||||
// 更新烘烤出入明细表为完成
|
||||
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonHotDtl.put("dtl_status", "50");
|
||||
hotDtlTab.update(jsonHotDtl);
|
||||
|
||||
// 将入冷却信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
|
||||
@@ -64,31 +64,14 @@ public class InHotTask extends AbstractAcsTask {
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
WQLObject hotIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烘箱区库存表
|
||||
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
|
||||
WQLObject hotDtlTab = WQLObject.getWQLObject("ST_IVT_HotRegionIODtl"); // 烘箱区出入明细表
|
||||
WQLObject coolIoTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 判断此条明细是否是冷却区 -> 烘箱,是则删除主表
|
||||
if (ObjectUtil.isNotEmpty(jsonTask.getString("point_code3"))) {
|
||||
|
||||
// 删除烘箱主表
|
||||
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonHotDtl)) throw new BadRequestException("明细单据不存在");
|
||||
|
||||
hotMstTab.delete("iostorinv_id = '" + jsonHotDtl.getString("iostorinv_id") + "'");
|
||||
|
||||
// 删除冷却出入表
|
||||
coolIoTab.delete("task_id = '" + task_id + "'");
|
||||
}
|
||||
|
||||
// 取消删除任务
|
||||
taskTab.delete("task_id = '" + task_id + "'");
|
||||
|
||||
// 删除烘箱明细
|
||||
hotDtlTab.delete("task_id = '" + task_id + "'");
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -96,23 +79,6 @@ public class InHotTask extends AbstractAcsTask {
|
||||
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
// 更新明细表状态
|
||||
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonHotDtl.put("dtl_status", "40");
|
||||
hotDtlTab.update(jsonHotDtl);
|
||||
|
||||
// 更新主表状态
|
||||
JSONObject jsonHotMst = hotMstTab.query("iostorinv_id = '" + jsonHotDtl.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
jsonHotMst.put("bill_status", "40");
|
||||
hotMstTab.update(jsonHotMst);
|
||||
|
||||
// 如果是冷却区入烘箱则更新 冷却区出入表状态
|
||||
if (ObjectUtil.isNotEmpty(jsonTask.getString("point_code3"))) {
|
||||
JSONObject jsonCoolIo = coolIoTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonCoolIo.put("bill_status", "40");
|
||||
coolIoTab.update(jsonCoolIo);
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
@@ -126,16 +92,8 @@ public class InHotTask extends AbstractAcsTask {
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
// 更新明细表
|
||||
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonHotDtl.put("dtl_status", "50");
|
||||
jsonHotDtl.put("confirm_optid", currentUserId);
|
||||
jsonHotDtl.put("confirm_optname", currentUsername);
|
||||
jsonHotDtl.put("confirm_time", DateUtil.now());
|
||||
hotDtlTab.update(jsonHotDtl);
|
||||
|
||||
// 更新主表: 什么时候更新主表
|
||||
JSONObject jsonHotMst = hotMstTab.query("iostorinv_id = '" + jsonHotDtl.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
JSONObject jsonHotMst = hotMstTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
String hot_point_code = "";
|
||||
// 判断此任务是否有三个点位
|
||||
@@ -210,8 +168,8 @@ public class InHotTask extends AbstractAcsTask {
|
||||
param.put("iContainerName", jsonHotMst.getString("container_name"));
|
||||
param.put("iResourceName", hot_point_code);
|
||||
param.put("iMoveInDate", DateUtil.now());
|
||||
param.put("iPlanBakingTemperature", jsonHotDtl.getDoubleValue("temperature"));
|
||||
param.put("iPlanBakingTimer", jsonHotDtl.getDoubleValue("oven_time"));
|
||||
param.put("iPlanBakingTemperature", jsonHotMst.getDoubleValue("temperature"));
|
||||
param.put("iPlanBakingTimer", jsonHotMst.getDoubleValue("oven_time"));
|
||||
param.put("UserName", userName);
|
||||
param.put("PassWord", passWord);
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
WQLObject hotIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烘箱区库存表
|
||||
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
|
||||
WQLObject hotDtlTab = WQLObject.getWQLObject("ST_IVT_HotRegionIODtl"); // 烘箱区出入明细表
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
@@ -71,8 +70,7 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
// 取消删除任务
|
||||
taskTab.delete("task_id = '" + task_id + "'");
|
||||
|
||||
// 删除出入烘箱任务明细
|
||||
hotDtlTab.delete("task_id = '" + task_id + "'");
|
||||
hotMstTab.delete("task_id = '" + task_id + "'");
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -81,11 +79,6 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
// 更新明细表状态
|
||||
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonHotDtl.put("dtl_status", "40");
|
||||
hotDtlTab.update(jsonHotDtl);
|
||||
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
@@ -101,22 +94,8 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
|
||||
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
|
||||
// 更新明细表
|
||||
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
Date date1 = DateUtil.parse(jsonHotIvt.getString("instorage_time"));
|
||||
Date date2 = DateUtil.parse(DateUtil.now());
|
||||
long betweenDay = DateUtil.between(date1, date2, DateUnit.MINUTE);
|
||||
|
||||
jsonHotDtl.put("dtl_status", "50");
|
||||
jsonHotDtl.put("confirm_optid", currentUserId);
|
||||
jsonHotDtl.put("confirm_optname", currentUsername);
|
||||
jsonHotDtl.put("confirm_time", DateUtil.now());
|
||||
jsonHotDtl.put("oven_time", Double.valueOf(betweenDay));
|
||||
hotDtlTab.update(jsonHotDtl);
|
||||
|
||||
// 更新主表: 什么时候更新主表
|
||||
JSONObject jsonHotMst = hotMstTab.query("iostorinv_id = '" + jsonHotDtl.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
JSONObject jsonHotMst = hotMstTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
// 更新暂存区点位状态
|
||||
JSONObject jsonPoint2 = pointTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
@@ -140,10 +119,8 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
param.put("iContainerName", jsonHotMst.getString("container_name"));
|
||||
param.put("iResourceName", jsonHotIvt.getString("point_code"));
|
||||
param.put("iMoveOutDate", DateUtil.now());
|
||||
param.put("iabxActualBakingTemperature", jsonHotDtl.getDoubleValue("temperature"));
|
||||
param.put("iabxActualBakingTimer", jsonHotDtl.getDoubleValue("oven_time"));
|
||||
param.put("UserName", "");
|
||||
param.put("PassWord", "");
|
||||
param.put("iabxActualBakingTemperature", jsonHotMst.getDoubleValue("temperature"));
|
||||
param.put("iabxActualBakingTimer", jsonHotMst.getDoubleValue("oven_time"));
|
||||
|
||||
JSONObject result = new LmsToMesServiceImpl().momRollBakeOutBound(param);
|
||||
}
|
||||
|
||||
@@ -2088,11 +2088,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
|
||||
//查询对应明细
|
||||
JSONObject dtl_jo = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinvdtl_id = '"+dis.getString("iostorinvdtl_id")+"'").uniqueResult(0);
|
||||
// 更新子卷包装关系表 状态 - 3
|
||||
JSONObject jsonSub = subTab.query("container_name = '" + dis.getString("pcsn") + "' and status = '2'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSub)) throw new BadRequestException("此子卷不存在或不为入库状态:" + dis.getString("pcsn"));
|
||||
// 如果是拆分入库则将包装关系改为生成状态
|
||||
if (jo_mst.getString("bill_type").equals("1005")){
|
||||
if (jo_mst.getString("bill_type").equals("1005") || (jo_mst.getString("bill_type").equals("1009") && StrUtil.isNotEmpty(dtl_jo.getString("source_bill_code")))){
|
||||
jsonSub.put("status", "0");
|
||||
} else {
|
||||
jsonSub.put("status", "3");
|
||||
|
||||
@@ -119,6 +119,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
jo_mst.put("upload_mes", "1");
|
||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||
jo_mst.put("upload_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,6 +214,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
if (jo_mst.getString("upload_sap").equals("1")) {
|
||||
jo_mst.put("is_upload", "1");
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -305,6 +307,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
|
||||
jo_mst.put("upload_sap", "1");
|
||||
jo_mst.put("is_upload", "1");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||
|
||||
}
|
||||
|
||||
@@ -374,6 +377,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
if (jo_mst.getString("upload_mes").equals("1") || is_productstore.equals("0")) {
|
||||
jo_mst.put("is_upload", "1");
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||
}
|
||||
|
||||
// 改切出库
|
||||
@@ -434,6 +438,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
if (jo_mst.getString("upload_mes").equals("1")) {
|
||||
jo_mst.put("is_upload", "1");
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -499,6 +504,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
jo_mst.put("upload_mes", "1");
|
||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||
jo_mst.put("upload_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user