修改
This commit is contained in:
@@ -303,7 +303,13 @@ 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("该母卷现在不存在暂存位或对接点位上,不能进行入烘箱操作!");
|
||||
|
||||
//更新生箔工单的是否下发烘烤为是
|
||||
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");
|
||||
|
||||
// 调用接口输入参数
|
||||
jsonParam.put("option", "1");
|
||||
@@ -319,6 +325,12 @@ 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");
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("material_code = '" + containerName + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("母卷不存在");
|
||||
|
||||
@@ -1257,7 +1269,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
}
|
||||
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + ContainerName + "'").uniqueResult(0);
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + ContainerName + "' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("系统中不存在子卷号为:" + ContainerName + "的分切计划!");
|
||||
}
|
||||
|
||||
@@ -71,6 +71,24 @@ public class BakingServiceImpl implements BakingService {
|
||||
String hours = whereJson.getString("hours"); // 时间
|
||||
String point_code1 = whereJson.getString("point_code"); // 点位
|
||||
|
||||
//校验该设备是否启用,且母卷MES是否请求烘烤
|
||||
//查询该母卷号、设备号对应的生箔工单
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").query("container_name ='" + container_name + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("未查询到对应的生箔工单!");
|
||||
}
|
||||
String resource_name = raw_jo.getString("resource_name");
|
||||
JSONObject sb_jo = WQLObject.getWQLObject("st_ivt_sbpointivt").query("ext_code ='" + resource_name + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sb_jo)) {
|
||||
throw new BadRequestException("未查询到母卷号:" + container_name + "对应的生箔机台编号!");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("1", sb_jo.getString("is_used")) && !raw_jo.getString("is_baking").equals("1")) {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!");
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtil.isEmpty(container_name)) throw new BadRequestException("母卷号不能为空");
|
||||
if (ObjectUtil.isEmpty(temperature)) throw new BadRequestException("温度不能为空");
|
||||
if (ObjectUtil.isEmpty(hours)) throw new BadRequestException("时间不能为空");
|
||||
@@ -101,7 +119,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
param.put("point_code2", jsonHotIvt.getString("point_code"));
|
||||
param.put("material_code", container_name);
|
||||
param.put("product_area", jsonPointZc.getString("product_area"));
|
||||
param.put("request_param", NumberUtil.mul(Double.parseDouble(hours),60));
|
||||
param.put("request_param", NumberUtil.mul(Double.parseDouble(hours), 60));
|
||||
|
||||
InHotTask inHotTask = new InHotTask();
|
||||
String task_id = inHotTask.createTask(param);
|
||||
@@ -159,7 +177,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
map.put("point_type", "4");
|
||||
|
||||
JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_code2_jo)){
|
||||
if (ObjectUtil.isEmpty(point_code2_jo)) {
|
||||
throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!");
|
||||
}
|
||||
String point_code2 = point_code2_jo.getString("point_code");
|
||||
@@ -174,8 +192,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
JSONObject jsonMap = new JSONObject();
|
||||
jsonMap.put("flag", "1");
|
||||
jsonMap.put("product_area", product_area);
|
||||
jsonMap.put("min_temperature", NumberUtil.sub(temperature, temperature_lose)+"");
|
||||
jsonMap.put("max_temperature", NumberUtil.add(temperature, temperature_lose)+"");
|
||||
jsonMap.put("min_temperature", NumberUtil.sub(temperature, temperature_lose) + "");
|
||||
jsonMap.put("max_temperature", NumberUtil.add(temperature, temperature_lose) + "");
|
||||
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("烘烤区没有合适温度的空位!");
|
||||
@@ -188,7 +206,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
param.put("point_code3", jsonHotIvt.getString("point_code"));
|
||||
param.put("material_code", container_name);
|
||||
param.put("product_area", product_area);
|
||||
param.put("request_param", NumberUtil.mul(Double.parseDouble(hours),60));
|
||||
param.put("request_param", NumberUtil.mul(Double.parseDouble(hours), 60));
|
||||
|
||||
// 创建冷却区 --> 暂存位的任务
|
||||
InHotTask inHotTask = new InHotTask();
|
||||
@@ -327,9 +345,9 @@ public class BakingServiceImpl implements BakingService {
|
||||
hotParam.put("start_point_code", point_code1);
|
||||
hotParam.put("end_point_code", point_code2);
|
||||
hotParam.put("temperature", jsonHotIvt.getString("temperature"));
|
||||
if (ObjectUtil.isEmpty(last_hot_mst)){
|
||||
if (ObjectUtil.isEmpty(last_hot_mst)) {
|
||||
hotParam.put("oven_time", "480");
|
||||
}else {
|
||||
} else {
|
||||
hotParam.put("oven_time", last_hot_mst.getString("oven_time"));
|
||||
}
|
||||
this.createHotIoMst(hotParam);
|
||||
@@ -354,6 +372,23 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (ObjectUtil.isEmpty(point_code1)) throw new BadRequestException("点位不能为空");
|
||||
if (ObjectUtil.isEmpty(container_name)) throw new BadRequestException("母卷号不能为空");
|
||||
|
||||
//校验该设备是否启用,且母卷MES是否请求烘烤
|
||||
//查询该母卷号、设备号对应的生箔工单
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").query("container_name ='" + container_name + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("未查询到对应的生箔工单!");
|
||||
}
|
||||
String resource_name = raw_jo.getString("resource_name");
|
||||
JSONObject sb_jo = WQLObject.getWQLObject("st_ivt_sbpointivt").query("ext_code ='" + resource_name + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sb_jo)) {
|
||||
throw new BadRequestException("未查询到母卷号:" + container_name + "对应的生箔机台编号!");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("1", sb_jo.getString("is_used")) && !raw_jo.getString("is_instor").equals("1")) {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入半成品库,不允许进行入冷却操作!");
|
||||
}
|
||||
|
||||
// 1.获取此暂存位的生产区域和上下位置
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("冷却区内此点位不存在!");
|
||||
@@ -474,9 +509,9 @@ public class BakingServiceImpl implements BakingService {
|
||||
public JSONObject release(JSONObject whereJson) {
|
||||
JSONArray rows = new JSONArray();
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code",whereJson.getString("point_code"));
|
||||
jo.put("code","to_command");
|
||||
jo.put("value","0");
|
||||
jo.put("device_code", whereJson.getString("point_code"));
|
||||
jo.put("code", "to_command");
|
||||
jo.put("value", "0");
|
||||
rows.add(jo);
|
||||
new WmsToAcsServiceImpl().action(rows);
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
@@ -18,21 +18,21 @@ public class EmptyVehicleServiceImpl implements EmptyVehicleService {
|
||||
@Override
|
||||
public JSONObject pointStatusQuery(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
if (StrUtil.isEmpty(point_code)){
|
||||
if (StrUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
|
||||
String empty_vehicle_code = "";
|
||||
JSONObject point_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("empty_point_code = '"+point_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(point_jo)){
|
||||
JSONObject point_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("empty_point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(point_jo)) {
|
||||
empty_vehicle_code = point_jo.getString("empty_vehicle_code");
|
||||
}
|
||||
|
||||
JSONObject vehicle_jo = new JSONObject();
|
||||
vehicle_jo.put("vehicle_code",empty_vehicle_code);
|
||||
vehicle_jo.put("vehicle_code", empty_vehicle_code);
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data",vehicle_jo);
|
||||
jo.put("message","操作成功!");
|
||||
jo.put("data", vehicle_jo);
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@@ -40,29 +40,33 @@ public class EmptyVehicleServiceImpl implements EmptyVehicleService {
|
||||
public JSONObject pointOperate(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
if (StrUtil.isEmpty(point_code)){
|
||||
if (StrUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(vehicle_code)){
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("载具码不能为空!");
|
||||
}
|
||||
|
||||
String option = whereJson.getString("option");
|
||||
JSONObject point_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("empty_point_code = '"+point_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)){
|
||||
JSONObject point_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("empty_point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("空轴点位不存在!");
|
||||
}
|
||||
if (option.equals("0")){
|
||||
point_jo.put("empty_vehicle_code","");
|
||||
point_jo.put("empty_point_status","01");
|
||||
if (option.equals("0")) {
|
||||
point_jo.put("empty_vehicle_code", "");
|
||||
point_jo.put("empty_point_status", "01");
|
||||
}
|
||||
if (option.equals("1")){
|
||||
point_jo.put("empty_vehicle_code",vehicle_code);
|
||||
point_jo.put("empty_point_status","02");
|
||||
if (option.equals("1")) {
|
||||
//绑定的时候判断点位上是否存在母卷存在母卷不允许进行绑定
|
||||
if (point_jo.getString("full_point_status").equals("02")) {
|
||||
throw new BadRequestException("该点位上存在母卷,不能进行绑定空轴!");
|
||||
}
|
||||
point_jo.put("empty_vehicle_code", vehicle_code);
|
||||
point_jo.put("empty_point_status", "02");
|
||||
}
|
||||
WQLObject.getWQLObject("st_ivt_coolpointivt").update(point_jo);
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message","操作成功!");
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -209,6 +209,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
jsonIvt2.put("container_name", jsonRaw.getString("container_name"));
|
||||
jsonIvt2.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
jsonIvt2.put("ivt_qty", jsonRaw.getString("productin_qty"));
|
||||
jsonIvt2.put("cool_ivt_status", "01");
|
||||
ivtTab.update(jsonIvt2);
|
||||
|
||||
// 插入入库单
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -47,10 +48,10 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
|
||||
String product_area = json.getString("product_area");
|
||||
String agv_system_type = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")){
|
||||
if (product_area.equals("A1") || product_area.equals("A2")) {
|
||||
agv_system_type = "2";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")){
|
||||
if (product_area.equals("A3") || product_area.equals("A4")) {
|
||||
agv_system_type = "3";
|
||||
}
|
||||
|
||||
@@ -81,15 +82,15 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
if (StrUtil.equals(status,"0")) {
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 取消删除任务
|
||||
taskTab.delete("task_id = '"+task_id+"'");// 更新删除字段
|
||||
jsonTask.put("is_delete","1");
|
||||
taskTab.delete("task_id = '" + task_id + "'");// 更新删除字段
|
||||
jsonTask.put("is_delete", "1");
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
// 删除冷却区出入表
|
||||
coolTab.delete("task_id = '"+task_id+"'");
|
||||
coolTab.delete("task_id = '" + task_id + "'");
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -100,9 +101,9 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
|
||||
if(StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
// 更改任务状态为完成
|
||||
jsonTask.put("task_status",TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||
jsonTask.put("update_optname", SecurityUtils.getCurrentUsername());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
@@ -122,8 +123,8 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
|
||||
// 更新暂存位状态为空位
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
jsonPoint.put("point_status","1");
|
||||
jsonPoint.put("material_code","");
|
||||
jsonPoint.put("point_status", "1");
|
||||
jsonPoint.put("material_code", "");
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
// 更新冷却库存状态
|
||||
@@ -150,9 +151,16 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
|
||||
//判断该接口是否需要回传
|
||||
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")){
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
|
||||
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 = '" + jsonTask.getString("material_code") + "'");
|
||||
log.info("母卷:" + jsonTask.getString("material_code") + "对应的入冷却任务完成,请求入半成品库标识改为0");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,16 +185,16 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
|
||||
String point_code1 = form.getString("point_code1");
|
||||
String point_code2 = form.getString("point_code2");
|
||||
if (cutConveyorTask.isSingleTask(point_code1)){
|
||||
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
|
||||
if (cutConveyorTask.isSingleTask(point_code1)) {
|
||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||
}
|
||||
if (cutConveyorTask.isSingleTask(point_code2)){
|
||||
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
|
||||
if (cutConveyorTask.isSingleTask(point_code2)) {
|
||||
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_type", "010204");
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", point_code1);
|
||||
@@ -199,13 +207,13 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
//根据类型获取对应的任务优先级
|
||||
JSONObject priority_jo = WQL.getWO("PDA_COOLIN").addParam("flag","3").addParam("task_type",json.getString("task_type")).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(priority_jo)){
|
||||
JSONObject priority_jo = WQL.getWO("PDA_COOLIN").addParam("flag", "3").addParam("task_type", json.getString("task_type")).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(priority_jo)) {
|
||||
json.put("priority", "1");
|
||||
}else {
|
||||
} else {
|
||||
json.put("priority", priority_jo.getString("value"));
|
||||
}
|
||||
json.put("acs_task_type","3" );
|
||||
json.put("acs_task_type", "3");
|
||||
tab.insert(json);
|
||||
|
||||
this.immediateNotifyAcs(null);
|
||||
@@ -221,7 +229,6 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -205,6 +206,12 @@ public class InHotTask extends AbstractAcsTask {
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
|
||||
new LmsToMesServiceImpl().momRollBakeInBound(param);
|
||||
}
|
||||
|
||||
//将该母卷的入烘箱标识改为0
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("is_baking","0");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map,"container_name = '"+jsonHotMst.getString("container_name")+"'");
|
||||
log.info("母卷:"+jsonHotMst.getString("container_name")+"对应的入烘箱任务完成,请求烘烤标识改为0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user