rev:复烤回退
This commit is contained in:
@@ -1331,11 +1331,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
ivt_shaftivt.update(point1_jo);
|
||||
} else if ("010607".equals(point_type) || "010603".equals(point_type) || "010606".equals(point_type)) {
|
||||
JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
|
||||
point1_jo.put("qzz_size", "");
|
||||
point1_jo.put("qzz_generation", "");
|
||||
point1_jo.put("have_qzz", "0");
|
||||
point1_jo.put("container_name1", "");
|
||||
point1_jo.put("container_name2", "");
|
||||
if(point1_jo.getString("point_type").equals("1")){
|
||||
point1_jo.put("have_qzz", "0");
|
||||
}else {
|
||||
point1_jo.put("qzz_size", "");
|
||||
point1_jo.put("qzz_generation", "");
|
||||
point1_jo.put("have_qzz", "0");
|
||||
point1_jo.put("container_name1", "");
|
||||
point1_jo.put("container_name2", "");
|
||||
}
|
||||
ivt_shaftivt.update(point1_jo);
|
||||
} else {
|
||||
JSONObject point3_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code3") + "'").uniqueResult(0);
|
||||
|
||||
@@ -323,7 +323,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
log.info("母卷:" + ContainerName + "被决策入烘箱,请求烘烤标识改为1");
|
||||
|
||||
String point_code = "";
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04'").uniqueResult(0);
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCoolIvt)) {
|
||||
JSONObject jsonPoint = pointTab.query("material_code ='" + containerName + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPoint)) {
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
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.sch.tasks.CutConveyorTask;
|
||||
@@ -30,8 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -386,33 +383,10 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (ObjectUtil.isEmpty(point_code2)) {
|
||||
throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
|
||||
// 2.找冷却区空货位
|
||||
JSONObject map2 = new JSONObject();
|
||||
map2.put("flag", "2");
|
||||
map2.put("product_area", jsonHotIvt.getString("product_area"));
|
||||
map2.put("point_location", jsonHotIvt.getString("point_location"));
|
||||
|
||||
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map2).process().uniqueResult(0);
|
||||
// 如果为空
|
||||
if (ObjectUtil.isEmpty(jsonCooIvt)) {
|
||||
if (StrUtil.equals(jsonHotIvt.getString("point_location"), "0")) {
|
||||
map2.put("point_location", "1");
|
||||
}
|
||||
if (StrUtil.equals(jsonHotIvt.getString("point_location"), "1")) {
|
||||
map2.put("point_location", "0");
|
||||
}
|
||||
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map2).process().uniqueResult(0);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonCooIvt)) {
|
||||
throw new BadRequestException("冷却区空位不足");
|
||||
}
|
||||
|
||||
// 3.创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code1);
|
||||
param.put("point_code2", point_code2);
|
||||
param.put("point_code3", jsonCooIvt.getString("full_point_code"));
|
||||
param.put("material_code", jsonHotIvt.getString("container_name"));
|
||||
param.put("product_area", jsonHotIvt.getString("product_area"));
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
@@ -456,13 +430,13 @@ public class BakingServiceImpl implements BakingService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject inCoolIvt(JSONObject whereJson) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("st_ivt_coolpointivt"); // 点位点
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位点
|
||||
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
||||
|
||||
|
||||
String point_code1 = whereJson.getString("point_code"); // 冷却区点位:起点
|
||||
String point_code1 = whereJson.getString("point_code"); // 暂存位:起点
|
||||
String container_name = whereJson.getString("container_name"); // 母卷号
|
||||
|
||||
//获取人员对应的区域
|
||||
@@ -493,16 +467,15 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入半成品库,不允许进行入冷却操作!");
|
||||
}
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
// 1.获取此暂存位的生产区域和上下位置
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("请扫描冷却区满轴点位编码!");
|
||||
throw new BadRequestException("请扫描点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
|
||||
if (!in_area_id.contains(jsonPoint.getString("product_area"))) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + jsonPoint.getString("product_area") + "】操作权限");
|
||||
}
|
||||
|
||||
/* // 1.获取此暂存位的生产区域和上下位置
|
||||
// 2.找冷却区空货位
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
@@ -534,9 +507,9 @@ public class BakingServiceImpl implements BakingService {
|
||||
|
||||
InCoolIvtTask inCoolIvtTask = new InCoolIvtTask();
|
||||
String task_id = inCoolIvtTask.createTask(param);
|
||||
*/
|
||||
|
||||
// 生成冷却区出入表
|
||||
/*String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
|
||||
@@ -567,44 +540,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonCool.put("confirm_optid", currentUserId);
|
||||
jsonCool.put("confirm_optname", currentUsername);
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
coolTab.insert(jsonCool);*/
|
||||
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
JSONObject jsonIvt = ivtTab.query("full_point_code ='" + point_code1 + "'").uniqueResult(0);
|
||||
// 更新冷却库存状态
|
||||
jsonIvt.put("full_point_status", "02");
|
||||
jsonIvt.put("cool_ivt_status", "04");
|
||||
jsonIvt.put("instorage_time", DateUtil.now());
|
||||
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);
|
||||
|
||||
|
||||
// 将入冷却信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("iContainerName", container_name);
|
||||
param.put("iArrivalTime", DateUtil.now());
|
||||
param.put("iWarehouse", 2);
|
||||
param.put("UserName", userName);
|
||||
param.put("PassWord", passWord);
|
||||
|
||||
//判断该接口是否需要回传
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'momRollSemiFGInboundComplete'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && "1".equals(back_jo.getString("is_back"))) {
|
||||
String product_area = back_jo.getString("product_area");
|
||||
if (StrUtil.isNotEmpty(product_area) && product_area.contains(jsonPoint.getString("product_area"))) {
|
||||
new LmsToMesServiceImpl().momRollSemiFGInboundComplete(param);
|
||||
}
|
||||
}
|
||||
|
||||
//将该母卷的入冷却标识改为0
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_instor", "0");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + container_name + "'");
|
||||
log.info("母卷:" + container_name + "对应的入冷却任务完成,请求入半成品库标识改为0");
|
||||
coolTab.insert(jsonCool);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
|
||||
@@ -138,7 +138,7 @@ public class AutoCallEmptyVehicle {
|
||||
}
|
||||
form.put("vehicle_code2", empty_vehicle.getString("vehicle_code"));
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", "A1");
|
||||
form.put("product_area", product_area);
|
||||
cutConveyorTask.createTask(form);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,18 +49,13 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.agv_system_type(agv_system_type)
|
||||
.priority(json.getString("priority"))
|
||||
.product_area(product_area)
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
if (StrUtil.isNotEmpty(json.getString("point_code3"))) {
|
||||
dto.setNext_device_code(json.getString("point_code3"));
|
||||
dto.setPut_device_code(json.getString("point_code2"));
|
||||
} else {
|
||||
dto.setNext_device_code(json.getString("point_code2"));
|
||||
}
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
@@ -110,11 +105,11 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
// 更新主表: 什么时候更新主表
|
||||
JSONObject jsonHotMst = hotMstTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
/*// 更新暂存区点位状态
|
||||
// 更新暂存区点位状态
|
||||
JSONObject jsonPoint2 = pointTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
jsonPoint2.put("point_status", "2");
|
||||
jsonPoint2.put("material_code", jsonHotIvt.getString("container_name"));
|
||||
pointTab.update(jsonPoint2);*/
|
||||
pointTab.update(jsonPoint2);
|
||||
|
||||
// 更新烘箱区库存状态
|
||||
jsonHotIvt.put("point_status", "01");
|
||||
@@ -126,24 +121,6 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
jsonHotIvt.put("update_optname", currentUsername);
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
|
||||
// 更新冷却库存状态
|
||||
// 校验终点是否存在
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
JSONObject jsonIvt = ivtTab.query("full_point_code ='" + jsonTask.getString("point_code3") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
throw new BadRequestException("终点未找到可用点位:" + jsonTask.getString("point_code3"));
|
||||
}
|
||||
|
||||
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("instorage_time", DateUtil.now());
|
||||
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);
|
||||
|
||||
log.info("出烘箱wql执行update语句!");
|
||||
hotIvtTab.update(jsonHotIvt);
|
||||
JSONObject update_ivt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
@@ -214,7 +191,6 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("point_code3", form.getString("point_code3"));
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("material_code", form.getString("material_code"));
|
||||
json.put("sort_seq", "1");
|
||||
@@ -229,7 +205,7 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
} else {
|
||||
json.put("priority", priority_jo.getString("value"));
|
||||
}
|
||||
json.put("acs_task_type", "8");
|
||||
json.put("acs_task_type", "6");
|
||||
tab.insert(json);
|
||||
immediateNotifyAcs(json.getString("task_id"));
|
||||
return json.getString("task_id");
|
||||
|
||||
Reference in New Issue
Block a user