修改
This commit is contained in:
@@ -615,12 +615,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
result.put("data", data);
|
||||
} else if (type.equals("3")) {
|
||||
//烘箱出箱任务
|
||||
String device_code = whereJson.getString("device_code");
|
||||
JSONObject bake_jo = new JSONObject();
|
||||
bake_jo.put("point_code", device_code);
|
||||
bake_jo.put("option", "2");
|
||||
new BakingServiceImpl().ovenInAndOut(bake_jo);
|
||||
//判断AGV是否启用
|
||||
String agv_status = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("agv_status").getValue();
|
||||
|
||||
if ("0".equals(agv_status)) {
|
||||
log.info("当前AGV未启用,不启用自动出烘箱功能!");
|
||||
} else {
|
||||
//烘箱出箱任务
|
||||
String device_code = whereJson.getString("device_code");
|
||||
JSONObject bake_jo = new JSONObject();
|
||||
bake_jo.put("point_code", device_code);
|
||||
bake_jo.put("option", "2");
|
||||
new BakingServiceImpl().ovenInAndOut(bake_jo);
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("请输入正确的任务类型!");
|
||||
}
|
||||
|
||||
@@ -296,10 +296,10 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
if (ObjectUtil.isEmpty(bakingTimer)) throw new BadRequestException("烘烤时间不能为空");
|
||||
|
||||
//更新生箔工单的是否下发烘烤为是
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("is_baking","1");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map,"container_name = '"+ContainerName+"'");
|
||||
log.info("母卷:"+ContainerName+"被决策入烘箱,请求烘烤标识改为1");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_baking", "1");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + ContainerName + "'");
|
||||
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);
|
||||
@@ -309,7 +309,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
} else {
|
||||
point_code = jsonCoolIvt.getString("full_point_code");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("该母卷现在还未绑定在暂存位或对接点位上,不能进行入烘箱操作!!请检查当前母卷所在位置,并绑定对应位置");
|
||||
if (ObjectUtil.isEmpty(point_code))
|
||||
throw new BadRequestException("该母卷已经被烘烤或现在还未绑定在暂存位或对接点位上,不能进行入烘箱操作!!请检查当前母卷所在位置,并绑定对应位置");
|
||||
|
||||
// 调用接口输入参数
|
||||
jsonParam.put("option", "1");
|
||||
@@ -326,21 +327,59 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
* 入冷却区
|
||||
*/
|
||||
//更新生箔工单的是否下发烘烤为是
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("is_instor","1");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map,"container_name = '"+ContainerName+"'");
|
||||
log.info("母卷:"+ContainerName+"被决策入半成品库,请求入半成品库标识改为1");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_instor", "1");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + ContainerName + "'");
|
||||
log.info("母卷:" + ContainerName + "被决策入半成品库,请求入半成品库标识改为1");
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("material_code = '" + containerName + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("母卷不存在烘箱对接位上!");
|
||||
//判断AGV是否启用
|
||||
String agv_status = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("agv_status").getValue();
|
||||
|
||||
// 调用接口输入参数
|
||||
jsonParam.put("point_code", jsonPoint.getString("point_code"));
|
||||
jsonParam.put("container_name", containerName);
|
||||
if (agv_status.equals("1")) {
|
||||
log.info("当前AGV启用参数为是");
|
||||
JSONObject jsonPoint = pointTab.query("material_code = '" + containerName + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("当前AGV已启用,且母卷不存在烘箱对接位上!");
|
||||
|
||||
// 调用手持接口
|
||||
BakingServiceImpl bakingService = new BakingServiceImpl();
|
||||
bakingService.inCoolIvt(jsonParam);
|
||||
// 调用接口输入参数
|
||||
jsonParam.put("point_code", jsonPoint.getString("point_code"));
|
||||
jsonParam.put("container_name", containerName);
|
||||
|
||||
// 调用手持接口
|
||||
BakingServiceImpl bakingService = new BakingServiceImpl();
|
||||
bakingService.inCoolIvt(jsonParam);
|
||||
} else {
|
||||
log.info("当前AGV启用参数为否");
|
||||
//判断当前位置是否在冷却区如果不在则提醒人工报错
|
||||
JSONObject container_jo = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(container_jo)) {
|
||||
throw new BadRequestException("该母卷已经被烘烤或现在还未绑定在冷却区上,且AGV未启用!请使用人工烘烤功能【出箱】将母卷绑定到冷却区!");
|
||||
}
|
||||
container_jo.put("cool_ivt_status", "04");
|
||||
container_jo.put("instorage_time", DateUtil.now());
|
||||
coolIvtTab.update(container_jo);
|
||||
|
||||
// 将入冷却信息发送给mes
|
||||
JSONObject mes_jo = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
mes_jo.put("iContainerName", containerName);
|
||||
mes_jo.put("iArrivalTime", DateUtil.now());
|
||||
mes_jo.put("iWarehouse", 2);
|
||||
mes_jo.put("UserName", userName);
|
||||
mes_jo.put("PassWord", passWord);
|
||||
|
||||
//判断该接口是否需要回传
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'momRollSemiFGInboundComplete'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
|
||||
new LmsToMesServiceImpl().momRollSemiFGInboundComplete(param);
|
||||
}
|
||||
|
||||
//将该母卷的入冷却标识改为0
|
||||
HashMap<String, String> con_map = new HashMap<>();
|
||||
con_map.put("is_instor", "0");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + ContainerName + "'");
|
||||
log.info("母卷:" + containerName + "对应的入冷却任务完成,请求入半成品库标识改为0");
|
||||
}
|
||||
}
|
||||
}
|
||||
result.put("RTYPE", "S");
|
||||
@@ -466,7 +505,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
json.put("is_child_tz_ok", "0");
|
||||
json.put("is_child_ps_ok", "0");
|
||||
json.put("is_delete", "0");
|
||||
tab.insert(json);
|
||||
tab.insert(json);
|
||||
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
@@ -753,8 +792,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
|
||||
//查询当前子卷号状态
|
||||
String now_status = plan_jo.getString("status");
|
||||
if (!now_status.equals("05")){
|
||||
log.info("子卷号:"+row.getString("ContainerGroup")+"当前状态为:"+now_status+",被MES的开始分切接口改为入站完成!");
|
||||
if (!now_status.equals("05")) {
|
||||
log.info("子卷号:" + row.getString("ContainerGroup") + "当前状态为:" + now_status + ",被MES的开始分切接口改为入站完成!");
|
||||
}
|
||||
//如果入站的分切计划气涨轴为空,则虚拟一个气a涨轴编号
|
||||
if (StrUtil.isEmpty(plan_jo.getString("qzzno"))) {
|
||||
@@ -796,7 +835,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
if ("0".equals(need_down)) {
|
||||
plan_jo.put("status", "09");
|
||||
WQLObject.getWQLObject("pdm_bi_slittingproductionplan").update(plan_jo);
|
||||
log.info("子卷号:"+row.getString("ContainerGroup")+"MES上选择了不需要下卷,不生成任务!");
|
||||
log.info("子卷号:" + row.getString("ContainerGroup") + "MES上选择了不需要下卷,不生成任务!");
|
||||
} else {
|
||||
if (row.getString("ContainerPosition").equals("1")) {
|
||||
if (StrUtil.isEmpty(up_qzz)) {
|
||||
|
||||
@@ -300,7 +300,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
map.put("point_type", "5");
|
||||
|
||||
JSONArray pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有可用的点位类型为出箱的烘箱对接位!");
|
||||
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
|
||||
|
||||
// 2.判断暂存位是否有任务:找到无任务的暂存位
|
||||
String point_code2 = "";
|
||||
@@ -317,7 +317,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有可用的点位类型为出箱的烘箱对接位!");
|
||||
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
|
||||
// 3.创建任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code1);
|
||||
@@ -391,7 +391,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
|
||||
// 1.获取此暂存位的生产区域和上下位置
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("冷却区内此点位不存在!");
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("请扫描点位类型为出箱的烘箱对接位!");
|
||||
|
||||
// 2.找冷却区空货位
|
||||
JSONObject map = new JSONObject();
|
||||
@@ -528,6 +528,13 @@ public class BakingServiceImpl implements BakingService {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
if (point_code.endsWith("BJD")){
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", json);
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
JSONObject jsonCool = coolIvtTab.query("full_point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonCool) && ObjectUtil.isNotEmpty(jsonCool.getString("container_name"))) {
|
||||
json.put("container_name", jsonCool.getString("container_name"));
|
||||
|
||||
@@ -7,7 +7,9 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.pda.mps.service.EmptyVehicleService;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -61,6 +63,11 @@ public class EmptyVehicleServiceImpl implements EmptyVehicleService {
|
||||
if (point_jo.getString("full_point_status").equals("02")) {
|
||||
throw new BadRequestException("该点位上存在母卷,不能进行绑定空轴!");
|
||||
}
|
||||
CutConveyorTask cutConveyorTask = SpringContextHolder.getBean(CutConveyorTask.class);
|
||||
//判断当前点位上是否存在任务
|
||||
if (cutConveyorTask.isSingleTask(point_code)){
|
||||
throw new BadRequestException("点位:" + point_code + "存在未完成的任务!");
|
||||
}
|
||||
point_jo.put("empty_vehicle_code", vehicle_code);
|
||||
point_jo.put("empty_point_status", "02");
|
||||
}
|
||||
|
||||
@@ -250,6 +250,9 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
if (StrUtil.equals(jsonIvt.getString("empty_point_status"),"02")) {
|
||||
throw new BadRequestException("目的点上存在空轴!");
|
||||
}
|
||||
if (jsonIvt.getString("is_used").equals("0")){
|
||||
throw new BadRequestException("当前点位未启用!");
|
||||
}
|
||||
jsonIvt.put("full_point_status", "02");
|
||||
jsonIvt.put("cool_ivt_status", "03");
|
||||
jsonIvt.put("instorage_time", DateUtil.now());
|
||||
|
||||
@@ -155,7 +155,7 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
new LmsToMesServiceImpl().momRollSemiFGInboundComplete(param);
|
||||
}
|
||||
|
||||
//将该母卷的入烘箱标识改为0
|
||||
//将该母卷的入冷却标识改为0
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_instor", "0");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + jsonTask.getString("material_code") + "'");
|
||||
|
||||
Reference in New Issue
Block a user