rev:新增表处中转功能

This commit is contained in:
zhouz
2024-04-24 09:41:37 +08:00
parent 9177f733f7
commit b57ed27a56
4 changed files with 62 additions and 31 deletions

View File

@@ -208,7 +208,6 @@ public class BakingServiceImpl implements BakingService {
if (ObjectUtil.isEmpty(point_code2_jo)) {
throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!");
}
String point_code2 = point_code2_jo.getString("point_code");
/*if (ObjectUtil.isEmpty(pointArr)) {
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
@@ -234,15 +233,16 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException("烘烤区没有合适温度的空位!");
}
}
}else {
throw new BadRequestException("烘烤区没有合适温度的空位!");
}
throw new BadRequestException("烘烤区没有合适温度的空位!");
}
// 3.创建冷却区 --> 烘烤区任务
JSONObject param = new JSONObject();
param.put("type", "1"); // 1- 冷却区入烘箱 2- 暂存位入烘箱
param.put("point_code1", point_code1);
param.put("point_code2", point_code2);
param.put("point_code2", point_code2_jo.getString("point_code"));
param.put("point_code3", jsonHotIvt.getString("point_code"));
param.put("material_code", container_name);
param.put("product_area", product_area);

View File

@@ -278,34 +278,44 @@ public class FeedingServiceImpl implements FeedingService {
if (!StrUtil.equals(cool_jo.getString("full_point_status"), "02")) {
throw new BadRequestException("该点位上不存在母卷!");
}
JSONObject jo = new JSONObject();
//查询该分切机对应的点位
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
JSONObject zz_jo = WQLObject.getWQLObject("sch_base_point").query("point_type = '8' AND is_used = '1' AND is_delete = '0' AND point_code = '"+next_point_code+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo)) {
throw new BadRequestException("请扫描或者输入分切区域的满轴点位做为终点!");
}
if (StrUtil.isNotEmpty(cut_jo.getString("container_name")) || "02".equals(cut_jo.getString("full_point_status"))) {
throw new BadRequestException("该分切机对应的上料位存在母卷,不能下发搬运任务!");
}
JSONObject jo = new JSONObject();
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
//查询中转区的点位
if (ObjectUtil.isEmpty(zz_jo)){
throw new BadRequestException("请扫描或者输入分切区域的满轴点位或表处中转区做为终点!");
}
if (zz_jo.getString("point_status").equals("2")){
throw new BadRequestException("该表处中转区点位上存在母卷,不能下发搬运任务!");
}
jo.put("point_code1", point_code);
jo.put("point_code2", next_point_code);
jo.put("vehicle_code", cool_jo.getString("container_name"));
jo.put("product_area", cut_jo.getString("product_area"));
jo.put("task_type", "010302");
} else {
jo.put("point_code1", point_code);
jo.put("point_code2", next_point_code);
jo.put("point_code3", cut_jo.getString("empty_point_code"));
jo.put("point_code4", cool_jo.getString("empty_point_code"));
jo.put("vehicle_code", cool_jo.getString("container_name"));
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
jo.put("product_area", cut_jo.getString("product_area"));
jo.put("task_type", "010301");
jo.put("product_area", zz_jo.getString("product_area"));
jo.put("task_type", "010305");
}else {
if (StrUtil.isNotEmpty(cut_jo.getString("container_name")) || "02".equals(cut_jo.getString("full_point_status"))) {
throw new BadRequestException("该分切机对应的上料位存在母卷,不能下发搬运任务!");
}
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
jo.put("point_code1", point_code);
jo.put("point_code2", next_point_code);
jo.put("vehicle_code", cool_jo.getString("container_name"));
jo.put("product_area", cut_jo.getString("product_area"));
jo.put("task_type", "010302");
} else {
jo.put("point_code1", point_code);
jo.put("point_code2", next_point_code);
jo.put("point_code3", cut_jo.getString("empty_point_code"));
jo.put("point_code4", cool_jo.getString("empty_point_code"));
jo.put("vehicle_code", cool_jo.getString("container_name"));
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
jo.put("product_area", cut_jo.getString("product_area"));
jo.put("task_type", "010301");
}
}
//查询该母卷号对应的生箔信息
@@ -336,7 +346,7 @@ public class FeedingServiceImpl implements FeedingService {
jsonCool.put("task_id", task_id);
jsonCool.put("qty_unit_id", "1");
jsonCool.put("start_point_code", cool_jo.getString("full_point_code"));
jsonCool.put("end_point_code", cut_jo.getString("full_point_code"));
jsonCool.put("end_point_code", ObjectUtil.isNotEmpty(cut_jo) ? cut_jo.getString("full_point_code") : zz_jo.getString("point_code"));
jsonCool.put("create_mode", "03");
jsonCool.put("create_id", currentUserId);
jsonCool.put("create_name", currentUsername);
@@ -351,7 +361,7 @@ public class FeedingServiceImpl implements FeedingService {
JSONObject result = new JSONObject();
result.put("message", "操作成功!");
return jo;
return result;
}
@Transactional(rollbackFor = Exception.class)

View File

@@ -30,7 +30,10 @@ public class SerfaceServiceImpl implements SerfaceService {
String device_code = whereJson.getString("point_code");
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + container_name + "'").uniqueResult(0);
if (raw_jo.getString("order_type").equals("2")){
if (ObjectUtil.isEmpty(raw_jo)) {
throw new BadRequestException("未查询到该母卷号对应的生箔工单!");
}
if (raw_jo.getString("order_type").equals("2")) {
throw new BadRequestException("当前工单为锂电工单,不允许表处!");
}
JSONObject device_jo = WQLObject.getWQLObject("st_ivt_stpointivt").query("point_code = '" + device_code + "'").uniqueResult(0);
@@ -40,7 +43,7 @@ public class SerfaceServiceImpl implements SerfaceService {
param.put("Type", option);
MesToLmsService bean = SpringContextHolder.getBean(MesToLmsService.class);
JSONObject jsonObject = bean.sendProcessInfo(param);
if (jsonObject.getString("RTYPE").equals("E")){
if (jsonObject.getString("RTYPE").equals("E")) {
throw new BadRequestException(jsonObject.getString("RTMSG"));
}
}
@@ -49,8 +52,8 @@ public class SerfaceServiceImpl implements SerfaceService {
public void confirm(JSONObject whereJson) {
String point_code = whereJson.getString("point_code");
//查询该点位对应的任务
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%"+point_code+"%' + OR point_code2 like '%"+point_code+"%' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(task_jo)){
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 like '%" + point_code + "%' + OR point_code2 like '%" + point_code + "%' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(task_jo)) {
throw new BadRequestException("未查询到该点位对应的任务!");
}

View File

@@ -244,6 +244,24 @@ public class CoolCutTask extends AbstractAcsTask {
WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2);
}
if ("010305".equals(jsonTask.getString("task_type"))) {
//更新冷却区空轴库存
JSONObject jsonCoolIvt2 = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
String container_name = jsonCoolIvt2.getString("container_name");
jsonCoolIvt2.put("full_point_status", "01");
jsonCoolIvt2.put("container_name", "");
jsonCoolIvt2.put("workorder_id", "");
jsonCoolIvt2.put("ivt_qty", "0");
jsonCoolIvt2.put("cool_ivt_status", "01");
WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2);
//更新中转区点位库存
JSONObject point_jo2 = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code2 + "'").uniqueResult(0);
point_jo2.put("point_status", "2");
point_jo2.put("material_code", container_name);
WQLObject.getWQLObject("sch_base_point").update(point_jo2);
}
}
}