rev:生箔流程优化
This commit is contained in:
@@ -138,6 +138,17 @@ public class SlitterTaskUtil {
|
||||
System.out.println(getComposePaperTubeInformation("玻璃纤维及其制品|FRP管|6英寸|15|1100", "1"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串是否为数字(整数、小数、负数)
|
||||
*/
|
||||
public static boolean isNumeric(String str) {
|
||||
if (str == null || str.isEmpty() || str.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
String s = str.trim();
|
||||
return s.matches("-?\\d+(\\.\\d+)?");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置所需的套管纸管信息
|
||||
* @param param 任务参数
|
||||
|
||||
@@ -98,7 +98,7 @@ public class LuceneLogServiceImpl implements EsLogService {
|
||||
@Override
|
||||
public JSONObject query(LogQuery logQuery) {
|
||||
JSONObject res = new JSONObject();
|
||||
PageResult page = new PageResult();
|
||||
PageResult page = new PageResult();
|
||||
page.setPage(logQuery.getPage());
|
||||
page.setPageSize(logQuery.getSize());
|
||||
try {
|
||||
|
||||
@@ -44,7 +44,6 @@ public class RawFoilController {
|
||||
|
||||
@PostMapping("/queryRawFoilList")
|
||||
@Log("查询生箔工单")
|
||||
|
||||
public ResponseEntity<Object> queryRawFoilList(@RequestBody JSONObject whereJson) {
|
||||
HttpContext ctx = new HttpContext("11");
|
||||
ctx.setPage((String) (whereJson.get("page")));
|
||||
@@ -66,18 +65,18 @@ public class RawFoilController {
|
||||
return new ResponseEntity<>(rawFoilService.confirmBlanking(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/scrollDowm")
|
||||
@Log("下卷")
|
||||
@PostMapping("/needEmptyAxis")
|
||||
@Log("呼叫")
|
||||
|
||||
public ResponseEntity<Object> scrollDowm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(rawFoilService.scrollDowm(whereJson), HttpStatus.OK);
|
||||
public ResponseEntity<Object> needEmptyAxis(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(rawFoilService.needEmptyAxis(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/scrollDowmTest")
|
||||
@Log("下卷")
|
||||
@PostMapping("/needEmptyAxisTest")
|
||||
@Log("呼叫")
|
||||
|
||||
public ResponseEntity<Object> scrollDowmTest(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(rawFoilService.scrollDowmTest(whereJson), HttpStatus.OK);
|
||||
return new ResponseEntity<>(rawFoilService.needEmptyAxisTest(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmWeight")
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface RawFoilService {
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject scrollDowm(JSONObject whereJson);
|
||||
JSONObject needEmptyAxis(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 下卷
|
||||
@@ -61,7 +61,7 @@ public interface RawFoilService {
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject scrollDowmTest(JSONObject whereJson);
|
||||
JSONObject needEmptyAxisTest(JSONObject whereJson);
|
||||
|
||||
JSONObject query(JSONObject whereJson, HttpContext ctx);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.b_lms.sch.point.dao.mapper.StIvtCoolregionioMapper;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.dao.mapper.SchBaseTaskMapper;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdMeMaterialBase;
|
||||
import org.nl.b_lms.storage_manage.md.dao.mapper.MdMeMaterialBaseMapper;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -32,6 +33,7 @@ import org.nl.modules.wql.core.content.HttpContext;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
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.pda.mps.eum.RegionTypeEnum;
|
||||
@@ -40,10 +42,7 @@ import org.nl.wms.pda.mps.service.HandleBakingService;
|
||||
import org.nl.wms.pdm.rawfoilworkorder.service.dao.*;
|
||||
import org.nl.wms.pdm.rawfoilworkorder.service.dao.mapper.*;
|
||||
import org.nl.wms.pdm.rawfoilworkorder.service.dto.HotPointIvtDto;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.InCoolIvtTask;
|
||||
import org.nl.wms.sch.tasks.InHotTask;
|
||||
import org.nl.wms.sch.tasks.OutHotTask;
|
||||
import org.nl.wms.sch.tasks.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -113,6 +112,12 @@ public class BakingServiceImpl implements BakingService {
|
||||
String temperature = whereJson.getString("temperature"); // 温度
|
||||
String hours = whereJson.getString("hours"); // 时间
|
||||
String point_code1 = whereJson.getString("point_code"); // 点位
|
||||
if (!SlitterTaskUtil.isNumeric(hours)) {
|
||||
throw new BadRequestException("请输入合法的时间!");
|
||||
}
|
||||
if (!SlitterTaskUtil.isNumeric(temperature)) {
|
||||
throw new BadRequestException("请输入合法的温度!");
|
||||
}
|
||||
//查询该点位是否存在未完成的任务
|
||||
JSONObject hasTask = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '" + point_code1 + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (hasTask != null) {
|
||||
@@ -136,11 +141,14 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("未查询到母卷号:" + container_name + "对应的生箔机台编号!");
|
||||
}
|
||||
|
||||
String mes_used = paramService.findByCode("mes_used").getValue();
|
||||
if (StrUtil.equals("1", mes_used)) {
|
||||
if (!"1".equals(rawfoilWorkOrder.getIs_baking())) {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!");
|
||||
}
|
||||
// String mes_used = paramService.findByCode("mes_used").getValue();
|
||||
// if (StrUtil.equals("1", mes_used)) {
|
||||
// if (!"1".equals(rawfoilWorkOrder.getIs_baking())) {
|
||||
// throw new BadRequestException("该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!");
|
||||
// }
|
||||
// }
|
||||
if (StrUtil.equals("1", sbPointIvt.getMes_used()) && !"1".equals(rawfoilWorkOrder.getIs_baking())) {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(container_name)) {
|
||||
throw new BadRequestException("母卷号不能为空");
|
||||
@@ -155,6 +163,11 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("点位不能为空");
|
||||
}
|
||||
|
||||
String maxHour = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MAX_HOUR").getValue();
|
||||
|
||||
if (Integer.parseInt(hours) >= Integer.parseInt(maxHour)) {
|
||||
throw new BadRequestException("设置的最大烘烤时间不能超过"+maxHour+"分钟");
|
||||
}
|
||||
/*
|
||||
* 根据点位判断是 冷却区入烘箱还是烘箱对接位入烘箱
|
||||
*/
|
||||
@@ -856,7 +869,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
param.put("product_area", jsonPoint.getProduct_area());
|
||||
|
||||
|
||||
InCoolIvtTask inCoolIvtTask = new InCoolIvtTask();
|
||||
InCoolIvtTask inCoolIvtTask = SpringContextHolder.getBean(InCoolIvtTask.class);
|
||||
String task_id = inCoolIvtTask.createTask(param);
|
||||
|
||||
// 生成冷却区出入表
|
||||
|
||||
@@ -166,10 +166,10 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
|
||||
@Override
|
||||
public JSONObject queryRawFoilList(JSONObject whereJson, HttpContext ctx) {
|
||||
PageHelper.startPage(Integer.parseInt(ctx.getPage()), Integer.parseInt(ctx.getRows()));
|
||||
// PageHelper.startPage(Integer.parseInt(ctx.getPage()), Integer.parseInt(ctx.getRows()));
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("point_code", whereJson.getString("point_code"));
|
||||
map.put("container_name", whereJson.getString("container_name"));
|
||||
// map.put("container_name", whereJson.getString("container_name"));
|
||||
map.put("product_area", whereJson.getString("product_area"));
|
||||
//获取人员对应的区域
|
||||
UserAreaServiceImpl userAreaService = new UserAreaServiceImpl();
|
||||
@@ -251,15 +251,22 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
public JSONObject confirmBlanking(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
|
||||
//查询该点位对应的任务
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '" + point_code + "' OR point_code2 = '" + point_code + "' OR point_code3 = '" + point_code + "' OR point_code4 = '" + point_code + "' and task_status <> '07' AND is_delete = '0'").uniqueResult(0);
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
RawfoilWorkOrder rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
.eq(RawfoilWorkOrder::getWorkorder_id, raw_jo.getString("workorder_id")));
|
||||
if (!rawfoilWorkOrder.getStatus().equals("02")){
|
||||
throw new BadRequestException("工单状态不为空轴搬出");
|
||||
}
|
||||
//查询该母卷号对应的任务
|
||||
String container_name = rawfoilWorkOrder.getContainer_name();
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '" + container_name + "' and task_status <> '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("点位编码【" + point_code + "】的任务不存在!");
|
||||
throw new BadRequestException("当前母卷AGV搬运任务不存在或已被强制完成!");
|
||||
}
|
||||
|
||||
// 查询生箔点位库存表
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(SbPointIvt::getPoint_code, point_code.substring(0, point_code.length()-2)));
|
||||
.eq(SbPointIvt::getExt_code, rawfoilWorkOrder.getResource_name()));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位设备不存在");
|
||||
}
|
||||
@@ -280,6 +287,10 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
throw new BadRequestException("操作失败:" + result.getString("message "));
|
||||
}
|
||||
|
||||
// 更新工单状态为确认下卷
|
||||
rawfoilWorkOrder.setStatus("03");
|
||||
rawfoilWorkOrderMapper.updateById(rawfoilWorkOrder);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
@@ -288,37 +299,74 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject scrollDowm(JSONObject whereJson) {
|
||||
public JSONObject needEmptyAxis(JSONObject whereJson) {
|
||||
String message = "操作完成!";
|
||||
String type = whereJson.getString("type");
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
String point_code = whereJson.getString("point_code");
|
||||
JSONObject param = new JSONObject();
|
||||
if ("1".equals(type) || "3".equals(type)) {// 1:取空取满放空放满,
|
||||
handleType1And3(raw_jo, param, type);
|
||||
} else if ("2".equals(type)) {//2:单上空轴
|
||||
handleType2(point_code, param);
|
||||
} else if ("4".equals(type)) {//4:单下空轴
|
||||
handleType4(point_code, param);
|
||||
}
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("生箔工单不能为空!");
|
||||
}
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(ObjectUtil.isNotEmpty(raw_jo.getString("point_code")), SbPointIvt::getPoint_code, raw_jo.getString("point_code")));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("material_code = '" + raw_jo.getString("container_name") + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException("该生箔工单存在未完成的任务,请先完成任务!");
|
||||
}
|
||||
RawfoilWorkOrder rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
.eq(ObjectUtil.isNotEmpty(raw_jo.getString("workorder_id")), RawfoilWorkOrder::getWorkorder_id, raw_jo.getString("workorder_id")));
|
||||
if (!StrUtil.equals(rawfoilWorkOrder.getStatus(), "01")) {
|
||||
throw new BadRequestException("工单状态不为开始");
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
map.put("point_location", stIvtSbpointivt.getPoint_location());
|
||||
map.put("point_type", "1");
|
||||
map.put("empty_point_status", "02");
|
||||
map.put("full_point_status", "01");
|
||||
List<CoolPointIvt> coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
|
||||
//如果没找到则继续找下一节点
|
||||
if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
String point_location = stIvtSbpointivt.getPoint_location();
|
||||
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
throw new BadRequestException("未查询到合适的冷却区点位");
|
||||
}
|
||||
}
|
||||
CoolPointIvt jsonIvt = coolPointIvtList.get(0);
|
||||
param.put("point_code1", jsonIvt.getEmpty_point_code());
|
||||
param.put("point_code2", stIvtSbpointivt.getEmpty_point_code());
|
||||
param.put("point_code3", stIvtSbpointivt.getFull_point_code());
|
||||
param.put("point_code4", jsonIvt.getFull_point_code());
|
||||
param.put("task_type", "010101");
|
||||
|
||||
param.put("material_code", rawfoilWorkOrder.getContainer_name());
|
||||
param.put("product_area", rawfoilWorkOrder.getProduct_area());
|
||||
|
||||
CallEmpReelTask callEmpReelTask = SpringContextHolder.getBean(CallEmpReelTask.class);
|
||||
callEmpReelTask.createTask(param);
|
||||
// 更新工单状态
|
||||
if ("1".equals(type) || "3".equals(type)) {
|
||||
RawfoilWorkOrder rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
.eq(ObjectUtil.isNotEmpty(raw_jo.getString("workorder_id")), RawfoilWorkOrder::getWorkorder_id, raw_jo.getString("workorder_id")));
|
||||
rawfoilWorkOrder.setStatus("10");
|
||||
rawfoilWorkOrder.setUpdate_time(DateUtil.now());
|
||||
rawfoilWorkOrderMapper.updateById(rawfoilWorkOrder);
|
||||
}
|
||||
|
||||
rawfoilWorkOrder.setStatus("02");
|
||||
rawfoilWorkOrder.setUpdate_time(DateUtil.now());
|
||||
rawfoilWorkOrderMapper.updateById(rawfoilWorkOrder);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", message);
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject scrollDowmTest(JSONObject whereJson) {
|
||||
public JSONObject needEmptyAxisTest(JSONObject whereJson) {
|
||||
SbPointIvt sbPointIvt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>().eq(ObjectUtil.isNotEmpty(whereJson.getString("point_code")), SbPointIvt::getPoint_code, whereJson.getString("point_code")));
|
||||
if (ObjectUtil.isEmpty(sbPointIvt)) {
|
||||
throw new BadRequestException("点位设备不存在");
|
||||
@@ -335,9 +383,9 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
rawfoilWorkOrder.setUp_coiler_date(DateUtil.now());
|
||||
rawfoilWorkOrder.setIs_reload_send("0");
|
||||
rawfoilWorkOrder.setOrder_type("2");
|
||||
rawfoilWorkOrder.setProduct_area("B2");
|
||||
rawfoilWorkOrder.setProduct_area("A4");
|
||||
rawfoilWorkOrder.setRealstart_time(DateUtil.now());
|
||||
rawfoilWorkOrder.setStatus("00");
|
||||
rawfoilWorkOrder.setStatus("01");
|
||||
rawfoilWorkOrder.setIs_delete("0");
|
||||
rawfoilWorkOrder.setAgvno("0");
|
||||
rawfoilWorkOrder.setProductin_qty(BigDecimal.valueOf(0));
|
||||
@@ -406,52 +454,49 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleType1And3(JSONObject raw_jo, JSONObject param, String type) {
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("生箔工单不能为空!");
|
||||
}
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(ObjectUtil.isNotEmpty(raw_jo.getString("point_code")), SbPointIvt::getPoint_code, raw_jo.getString("point_code")));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("material_code = '" + raw_jo.getString("container_name") + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException("该生箔工单存在未完成的任务,请先完成任务!");
|
||||
}
|
||||
RawfoilWorkOrder rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
.eq(ObjectUtil.isNotEmpty(raw_jo.getString("workorder_id")), RawfoilWorkOrder::getWorkorder_id, raw_jo.getString("workorder_id")));
|
||||
if (!StrUtil.equals(rawfoilWorkOrder.getStatus(), "30")) {
|
||||
throw new BadRequestException("工单状态不为开始生产");
|
||||
}
|
||||
if (StrUtil.equals("02", stIvtSbpointivt.getFull_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getEmpty_point_status())) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
map.put("point_location", stIvtSbpointivt.getPoint_location());
|
||||
map.put("point_type", "1");
|
||||
if ("1".equals(type)) {
|
||||
map.put("empty_point_status", "02");
|
||||
map.put("full_point_status", "01");
|
||||
} else {
|
||||
map.put("empty_point_status", "01");
|
||||
map.put("full_point_status", "01");
|
||||
}
|
||||
List<CoolPointIvt> coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
|
||||
String start_pint_code = "";
|
||||
String next_pint_code = "";
|
||||
String point_code4 = "";
|
||||
CoolPointIvt jsonIvt;
|
||||
//如果没找到则继续找下一节点
|
||||
if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
// adjustPointLocation(map, stIvtSbpointivt);
|
||||
// coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
// if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
// throw new BadRequestException("未查询到合适的点位");
|
||||
// }
|
||||
// private void handleType1And3(JSONObject raw_jo, JSONObject param, String type) {
|
||||
// if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
// throw new BadRequestException("生箔工单不能为空!");
|
||||
// }
|
||||
// SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
// .eq(ObjectUtil.isNotEmpty(raw_jo.getString("point_code")), SbPointIvt::getPoint_code, raw_jo.getString("point_code")));
|
||||
// if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
// throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
// }
|
||||
// if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
// throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
// }
|
||||
// JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("material_code = '" + raw_jo.getString("container_name") + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
// if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
// throw new BadRequestException("该生箔工单存在未完成的任务,请先完成任务!");
|
||||
// }
|
||||
// RawfoilWorkOrder rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
// .eq(ObjectUtil.isNotEmpty(raw_jo.getString("workorder_id")), RawfoilWorkOrder::getWorkorder_id, raw_jo.getString("workorder_id")));
|
||||
// if (!StrUtil.equals(rawfoilWorkOrder.getStatus(), "01")) {
|
||||
// throw new BadRequestException("工单状态不为开始");
|
||||
// }
|
||||
// if (StrUtil.equals("02", stIvtSbpointivt.getFull_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getEmpty_point_status())) {
|
||||
// JSONObject map = new JSONObject();
|
||||
// map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
// map.put("point_location", stIvtSbpointivt.getPoint_location());
|
||||
// map.put("point_type", "1");
|
||||
// if ("1".equals(type)) {
|
||||
// map.put("empty_point_status", "02");
|
||||
// map.put("full_point_status", "01");
|
||||
// } else {
|
||||
// map.put("empty_point_status", "01");
|
||||
// map.put("full_point_status", "01");
|
||||
// }
|
||||
// List<CoolPointIvt> coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
//
|
||||
// String start_pint_code = "";
|
||||
// String next_pint_code = "";
|
||||
// String point_code4 = "";
|
||||
// CoolPointIvt jsonIvt;
|
||||
// //如果没找到则继续找下一节点
|
||||
// if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
// throw new BadRequestException("未查询到合适的冷却区点位");
|
||||
// } else {
|
||||
// jsonIvt = coolPointIvtList.get(0);
|
||||
// if ("1".equals(type)) {
|
||||
// start_pint_code = jsonIvt.getEmpty_point_code();
|
||||
@@ -459,140 +504,130 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
// } else {
|
||||
// next_pint_code = jsonIvt.getFull_point_code();
|
||||
// }
|
||||
throw new BadRequestException("未查询到合适的冷却区点位");
|
||||
|
||||
} else {
|
||||
jsonIvt = coolPointIvtList.get(0);
|
||||
if ("1".equals(type)) {
|
||||
start_pint_code = jsonIvt.getEmpty_point_code();
|
||||
point_code4 = jsonIvt.getFull_point_code();
|
||||
} else {
|
||||
next_pint_code = jsonIvt.getFull_point_code();
|
||||
}
|
||||
}
|
||||
|
||||
if ("1".equals(type)) {
|
||||
param.put("point_code1", start_pint_code);
|
||||
param.put("point_code2", stIvtSbpointivt.getEmpty_point_code());
|
||||
param.put("point_code3", stIvtSbpointivt.getFull_point_code());
|
||||
param.put("point_code4", point_code4);
|
||||
param.put("task_type", "010101");
|
||||
} else {
|
||||
param.put("point_code1", stIvtSbpointivt.getFull_point_code());
|
||||
param.put("point_code2", next_pint_code);
|
||||
param.put("task_type", "010102");
|
||||
}
|
||||
|
||||
param.put("material_code", rawfoilWorkOrder.getContainer_name());
|
||||
param.put("product_area", rawfoilWorkOrder.getProduct_area());
|
||||
} else {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "不为有满卷且空轴位为空的状态!");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleType2(String point_code, JSONObject param) {
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(SbPointIvt::getPoint_code, point_code));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
if (StrUtil.equals("01", stIvtSbpointivt.getEmpty_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getFull_point_status())) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
map.put("point_location", stIvtSbpointivt.getPoint_location());
|
||||
map.put("empty_point_status", "02");
|
||||
map.put("full_point_status", "01");
|
||||
List<CoolPointIvt> coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
String start_pint_code = "";
|
||||
//如果没找到则继续找下一节点
|
||||
CoolPointIvt jsonIvt;
|
||||
if (ObjectUtil.isEmpty(coolPointIvtList)) {
|
||||
// adjustPointLocation(map, stIvtSbpointivt);
|
||||
// coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
// if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
// throw new BadRequestException("未查询到合适的点位");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if ("1".equals(type)) {
|
||||
// param.put("point_code1", start_pint_code);
|
||||
// param.put("point_code2", stIvtSbpointivt.getEmpty_point_code());
|
||||
// param.put("point_code3", stIvtSbpointivt.getFull_point_code());
|
||||
// param.put("point_code4", point_code4);
|
||||
// param.put("task_type", "010101");
|
||||
// } else {
|
||||
// param.put("point_code1", stIvtSbpointivt.getFull_point_code());
|
||||
// param.put("point_code2", next_pint_code);
|
||||
// param.put("task_type", "010102");
|
||||
// }
|
||||
//
|
||||
// param.put("material_code", rawfoilWorkOrder.getContainer_name());
|
||||
// param.put("product_area", rawfoilWorkOrder.getProduct_area());
|
||||
// } else {
|
||||
// throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "不为有满卷且空轴位为空的状态!");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void handleType2(String point_code, JSONObject param) {
|
||||
// if (ObjectUtil.isEmpty(point_code)) {
|
||||
// throw new BadRequestException("点位不能为空!");
|
||||
// }
|
||||
// SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
// .eq(SbPointIvt::getPoint_code, point_code));
|
||||
// if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
// throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
// }
|
||||
// if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
// throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
// }
|
||||
// if (StrUtil.equals("01", stIvtSbpointivt.getEmpty_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getFull_point_status())) {
|
||||
// JSONObject map = new JSONObject();
|
||||
// map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
// map.put("point_location", stIvtSbpointivt.getPoint_location());
|
||||
// map.put("empty_point_status", "02");
|
||||
// map.put("full_point_status", "01");
|
||||
// List<CoolPointIvt> coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
// String start_pint_code = "";
|
||||
// //如果没找到则继续找下一节点
|
||||
// CoolPointIvt jsonIvt;
|
||||
// if (ObjectUtil.isEmpty(coolPointIvtList)) {
|
||||
//// adjustPointLocation(map, stIvtSbpointivt);
|
||||
//// coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
//// if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
//// throw new BadRequestException("未查询到合适的点位");
|
||||
//// }
|
||||
//// jsonIvt = coolPointIvtList.get(0);
|
||||
//// start_pint_code = jsonIvt.getEmpty_point_code();
|
||||
// throw new BadRequestException("未查询到合适的冷却区点位");
|
||||
// } else {
|
||||
// jsonIvt = coolPointIvtList.get(0);
|
||||
// start_pint_code = jsonIvt.getEmpty_point_code();
|
||||
throw new BadRequestException("未查询到合适的冷却区点位");
|
||||
} else {
|
||||
jsonIvt = coolPointIvtList.get(0);
|
||||
start_pint_code = jsonIvt.getEmpty_point_code();
|
||||
}
|
||||
param.put("point_code1", start_pint_code);
|
||||
param.put("point_code2", stIvtSbpointivt.getEmpty_point_code());
|
||||
param.put("task_type", "010103");
|
||||
param.put("product_area", jsonIvt.getProduct_area());
|
||||
} else {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "空轴位或者满轴位不为空!");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleType4(String point_code, JSONObject param) {
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(SbPointIvt::getPoint_code, point_code));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
List<RawfoilWorkOrder> rawfoilWorkOrderList = rawfoilWorkOrderMapper.selectList(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
.eq(ObjectUtil.isNotEmpty(stIvtSbpointivt.getExt_code()), RawfoilWorkOrder::getResource_name, stIvtSbpointivt.getExt_code())
|
||||
.eq(RawfoilWorkOrder::getStatus, "30"));
|
||||
if (rawfoilWorkOrderList.size() > 0) {
|
||||
throw new BadRequestException("该机台已经存在开始生产的工单,请先维护再重试!");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("02", stIvtSbpointivt.getEmpty_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getFull_point_status())) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
map.put("point_location", stIvtSbpointivt.getPoint_location());
|
||||
map.put("empty_point_status", "01");
|
||||
map.put("full_point_status", "01");
|
||||
List<CoolPointIvt> coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
|
||||
String next_pint_code = "";
|
||||
CoolPointIvt jsonIvt;
|
||||
//如果没找到则继续找下一节点
|
||||
if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
// adjustPointLocation(map, stIvtSbpointivt);
|
||||
// coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
// if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
// throw new BadRequestException("未查询到合适的点位");
|
||||
// }
|
||||
// }
|
||||
// param.put("point_code1", start_pint_code);
|
||||
// param.put("point_code2", stIvtSbpointivt.getEmpty_point_code());
|
||||
// param.put("task_type", "010103");
|
||||
// param.put("product_area", jsonIvt.getProduct_area());
|
||||
// } else {
|
||||
// throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "空轴位或者满轴位不为空!");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void handleType4(String point_code, JSONObject param) {
|
||||
// if (ObjectUtil.isEmpty(point_code)) {
|
||||
// throw new BadRequestException("点位不能为空!");
|
||||
// }
|
||||
// SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
// .eq(SbPointIvt::getPoint_code, point_code));
|
||||
// if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
// throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
// }
|
||||
// if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
// throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
// }
|
||||
// List<RawfoilWorkOrder> rawfoilWorkOrderList = rawfoilWorkOrderMapper.selectList(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
// .eq(ObjectUtil.isNotEmpty(stIvtSbpointivt.getExt_code()), RawfoilWorkOrder::getResource_name, stIvtSbpointivt.getExt_code())
|
||||
// .eq(RawfoilWorkOrder::getStatus, "30"));
|
||||
// if (rawfoilWorkOrderList.size() > 0) {
|
||||
// throw new BadRequestException("该机台已经存在开始生产的工单,请先维护再重试!");
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.equals("02", stIvtSbpointivt.getEmpty_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getFull_point_status())) {
|
||||
// JSONObject map = new JSONObject();
|
||||
// map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
// map.put("point_location", stIvtSbpointivt.getPoint_location());
|
||||
// map.put("empty_point_status", "01");
|
||||
// map.put("full_point_status", "01");
|
||||
// List<CoolPointIvt> coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
//
|
||||
// String next_pint_code = "";
|
||||
// CoolPointIvt jsonIvt;
|
||||
// //如果没找到则继续找下一节点
|
||||
// if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
//// adjustPointLocation(map, stIvtSbpointivt);
|
||||
//// coolPointIvtList = coolPointIvtMapper.queryCoolPointIvt(map);
|
||||
//// if (CollectionUtil.isEmpty(coolPointIvtList)) {
|
||||
//// throw new BadRequestException("未查询到合适的点位");
|
||||
//// }
|
||||
//// jsonIvt = coolPointIvtList.get(0);
|
||||
//// next_pint_code = jsonIvt.getEmpty_point_code();
|
||||
// throw new BadRequestException("未查询到合适的冷却区点位");
|
||||
// } else {
|
||||
// jsonIvt = coolPointIvtList.get(0);
|
||||
// next_pint_code = jsonIvt.getEmpty_point_code();
|
||||
throw new BadRequestException("未查询到合适的冷却区点位");
|
||||
} else {
|
||||
jsonIvt = coolPointIvtList.get(0);
|
||||
next_pint_code = jsonIvt.getEmpty_point_code();
|
||||
}
|
||||
|
||||
param.put("point_code1", stIvtSbpointivt.getEmpty_point_code());
|
||||
param.put("point_code2", next_pint_code);
|
||||
param.put("task_type", "010104");
|
||||
param.put("product_area", jsonIvt.getProduct_area());
|
||||
} else {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "不是满轴位为空且空轴位不为空的状态!");
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustPointLocation(JSONObject map, SbPointIvt stIvtSbpointivt) {
|
||||
String point_location = stIvtSbpointivt.getPoint_location();
|
||||
if (StrUtil.equals(point_location, "0")) {
|
||||
map.put("point_location", "1");
|
||||
} else if (StrUtil.equals(point_location, "1")) {
|
||||
map.put("point_location", "0");
|
||||
}
|
||||
}
|
||||
// }
|
||||
//
|
||||
// param.put("point_code1", stIvtSbpointivt.getEmpty_point_code());
|
||||
// param.put("point_code2", next_pint_code);
|
||||
// param.put("task_type", "010104");
|
||||
// param.put("product_area", jsonIvt.getProduct_area());
|
||||
// } else {
|
||||
// throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "不是满轴位为空且空轴位不为空的状态!");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void adjustPointLocation(JSONObject map, SbPointIvt stIvtSbpointivt) {
|
||||
// String point_location = stIvtSbpointivt.getPoint_location();
|
||||
// if (StrUtil.equals(point_location, "0")) {
|
||||
// map.put("point_location", "1");
|
||||
// } else if (StrUtil.equals(point_location, "1")) {
|
||||
// map.put("point_location", "0");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -107,17 +107,14 @@
|
||||
AND full_point_status = '01'
|
||||
AND empty_point_status = '01'
|
||||
|
||||
<!-- 动态条件:point_type 不为空时查询对应值 -->
|
||||
<if test="point_type != null and point_type != ''">
|
||||
AND point_type = #{point_type}
|
||||
</if>
|
||||
|
||||
<!-- 动态条件:point_type 为空时默认为 '1' -->
|
||||
<if test="point_type == null or point_type == ''">
|
||||
AND point_type = '1'
|
||||
</if>
|
||||
|
||||
<!-- 检查不存在关联任务 -->
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sch_base_task
|
||||
@@ -127,12 +124,10 @@
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
<!-- product_area 不为空时添加条件 -->
|
||||
<if test="product_area != null and product_area != ''">
|
||||
AND product_area = #{product_area}
|
||||
</if>
|
||||
|
||||
<!-- point_location 不为空时添加条件 -->
|
||||
<if test="point_location != null and point_location != ''">
|
||||
AND point_location = #{point_location}
|
||||
</if>
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
PDM_BI_RawFoilWorkOrder der
|
||||
LEFT JOIN st_ivt_sbpointivt sb ON sb.ext_code = der.resource_name
|
||||
WHERE
|
||||
der.status = '00'
|
||||
OR der.status = '10'
|
||||
der.status = '01'
|
||||
AND der.is_delete = '0'
|
||||
AND sb.product_area IN
|
||||
<foreach collection="areas" item="areaId" open="(" separator="," close=")">
|
||||
@@ -49,15 +48,17 @@
|
||||
<if test="map.getString('product_area') != null and map.getString('product_area') != ''">
|
||||
AND der.product_area = #{map.product_area}
|
||||
</if>
|
||||
order by der.container_name
|
||||
</select>
|
||||
<select id="queryRawFoilList" resultType="org.nl.wms.pdm.rawfoilworkorder.service.dto.RawfoilWorkOrderDto"
|
||||
parameterType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
CASE der.status
|
||||
WHEN '00' THEN '初始化'
|
||||
WHEN '10' THEN '配送中'
|
||||
WHEN '30' THEN '开始生产'
|
||||
WHEN '40' THEN '结束'
|
||||
WHEN '01' THEN '开始'
|
||||
WHEN '02' THEN '空轴搬出'
|
||||
WHEN '03' THEN '准备就绪'
|
||||
WHEN '04' THEN '下卷完成'
|
||||
WHEN '09' THEN '结束'
|
||||
END AS status_name,
|
||||
der.mfg_order_name AS mfg_order_name,
|
||||
der.container_name AS container_name,
|
||||
@@ -77,7 +78,7 @@
|
||||
LEFT JOIN st_ivt_sbpointivt ivt ON ivt.ext_code = der.resource_name
|
||||
WHERE
|
||||
der.is_delete = '0'
|
||||
AND der.status != '40'
|
||||
AND der.status != '09'
|
||||
AND ivt.product_area IN
|
||||
<foreach collection="areas" item="areaId" open="(" separator="," close=")">
|
||||
#{areaId}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class RawfoilWorkOrderServiceImpl extends ServiceImpl<RawfoilWorkOrderMap
|
||||
dto.setAgvno("0");
|
||||
dto.setIs_delete("0");
|
||||
dto.setRealstart_time(DateUtil.now());
|
||||
dto.setStatus("00");
|
||||
dto.setStatus("01");
|
||||
if (ObjectUtil.isEmpty(dto.getProductin_qty())) {
|
||||
dto.setProductin_qty(BigDecimal.valueOf(0));
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public class RawfoilWorkOrderServiceImpl extends ServiceImpl<RawfoilWorkOrderMap
|
||||
|
||||
RawfoilWorkOrder rawfoilWorkOrder = new RawfoilWorkOrder();
|
||||
rawfoilWorkOrder.setWorkorder_id(whereJson.getLong("workorder_id"));
|
||||
rawfoilWorkOrder.setStatus("40");
|
||||
rawfoilWorkOrder.setStatus("09");
|
||||
rawfoilWorkOrder.setFinish_type("02");
|
||||
rawfoilWorkOrder.setRealend_time(DateUtil.now());
|
||||
rawfoilWorkOrder.setUpdate_optid(currentUserId);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SbPointIvtServiceImpl extends ServiceImpl<SbPointIvtMapper, SbPoint
|
||||
wrapper.like(ObjectUtil.isNotEmpty(whereJson.get("point_code")), SbPointIvt::getPoint_code, whereJson.get("point_code"));
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(whereJson.get("product_area")), SbPointIvt::getProduct_area, whereJson.get("product_area"));
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(whereJson.get("is_used")), SbPointIvt::getIs_used, whereJson.get("is_used"));
|
||||
wrapper.like(ObjectUtil.isNotEmpty(whereJson.get("search")), SbPointIvt::getPoint_code, whereJson.get("search"));
|
||||
wrapper.like(ObjectUtil.isNotEmpty(whereJson.get("mes_used")), SbPointIvt::getPoint_code, whereJson.get("mes_used"));
|
||||
// wrapper.in(ObjectUtil.isNotEmpty(in_area_id), SbPointIvt::getProduct_area, in_area_id);
|
||||
IPage<SbPointIvt> pages = new Page<>(page.getOffset() + 1, page.getPageSize());
|
||||
IPage<SbPointIvt> sbPointIvtList = sbPointIvtMapper.selectPage(pages, wrapper);
|
||||
|
||||
@@ -122,7 +122,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
if (ObjectUtil.isNotEmpty(schBaseTask.getMaterial_code())) {
|
||||
rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
.eq(RawfoilWorkOrder::getContainer_name, schBaseTask.getMaterial_code())
|
||||
.ne(RawfoilWorkOrder::getStatus, "40")
|
||||
.ne(RawfoilWorkOrder::getStatus, "09")
|
||||
.eq(RawfoilWorkOrder::getIs_delete, "0"));
|
||||
}
|
||||
String car_no = taskObj.getString("car_no");
|
||||
@@ -146,7 +146,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
|
||||
// 更新生箔工单状态为初始化、清除称重信息
|
||||
if (rawfoilWorkOrder != null) {
|
||||
rawfoilWorkOrder.setStatus("00");
|
||||
rawfoilWorkOrder.setStatus("01");
|
||||
rawfoilWorkOrder.setProductin_qty(new BigDecimal(0));
|
||||
rawfoilWorkOrder.setUpdate_time(DateUtil.now());
|
||||
rawfoilWorkOrderMapper.updateById(rawfoilWorkOrder);
|
||||
@@ -161,109 +161,55 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
String point_code1 = schBaseTask.getPoint_code1();
|
||||
String point_code2 = schBaseTask.getPoint_code2();
|
||||
String point_code3 = schBaseTask.getPoint_code3();
|
||||
String point_code4 = schBaseTask.getPoint_code4();
|
||||
// 取空取满放空放满
|
||||
if ("010101".equals(schBaseTask.getTask_type())) {
|
||||
if (rawfoilWorkOrder == null) {
|
||||
throw new BadRequestException("工单不存在");
|
||||
}
|
||||
//更新生箔机点位库存
|
||||
updateSbIvt(point_code3, "01", "02");
|
||||
//更新冷却区点位库存
|
||||
updateIvtIvt(point_code4, "02", "01", rawfoilWorkOrder);
|
||||
}
|
||||
//取满放满
|
||||
if ("010102".equals(schBaseTask.getTask_type())) {
|
||||
if (rawfoilWorkOrder == null) {
|
||||
throw new BadRequestException("工单不存在");
|
||||
}
|
||||
//更新生箔机点位库存
|
||||
updateSbIvt(point_code1, "01", null);
|
||||
//更新冷却区点位库存
|
||||
updateIvtIvt(point_code2, "02", null, rawfoilWorkOrder);
|
||||
}
|
||||
//起点是冷却区 取空放空
|
||||
if ("010103".equals(schBaseTask.getTask_type())) {
|
||||
//更新生箔机点位库存
|
||||
updateSbIvt(point_code2, null, "02");
|
||||
//更新冷却区点位库存
|
||||
updateIvtIvt(point_code1, null, "01", rawfoilWorkOrder);
|
||||
}
|
||||
//起点是生箔机 取空放空
|
||||
if ("010104".equals(schBaseTask.getTask_type())) {
|
||||
//更新生箔机点位库存
|
||||
updateSbIvt(point_code1, null, "01");
|
||||
//更新冷却区点位库存
|
||||
updateIvtIvt(point_code2, null, "02", rawfoilWorkOrder);
|
||||
}
|
||||
if ("010101".equals(schBaseTask.getTask_type()) || "010102".equals(schBaseTask.getTask_type())) {
|
||||
//更新母卷工单状态
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
rawfoilWorkOrder.setStatus("40");
|
||||
rawfoilWorkOrder.setOrigin("1");
|
||||
rawfoilWorkOrder.setRoll_status("0");
|
||||
rawfoilWorkOrder.setRealend_time(DateUtil.now());
|
||||
rawfoilWorkOrder.setUpdate_optid(currentUserId);
|
||||
rawfoilWorkOrder.setUpdate_optname(currentUsername);
|
||||
rawfoilWorkOrder.setFinish_type("01");
|
||||
rawfoilWorkOrder.setUpdate_time(DateUtil.now());
|
||||
rawfoilWorkOrderMapper.updateById(rawfoilWorkOrder);
|
||||
}
|
||||
// 更改任务状态为完成
|
||||
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
schBaseTask.setUpdate_optid(currentUserId);
|
||||
schBaseTask.setUpdate_optname(currentUsername);
|
||||
schBaseTask.setUpdate_time(DateUtil.now());
|
||||
schBaseTaskMapper.updateById(schBaseTask);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSbIvt(String fullPointCode,
|
||||
String fullStatus, String emptyStatus) {
|
||||
SbPointIvt sbPointIvt;
|
||||
String point_code1 = schBaseTask.getPoint_code1();
|
||||
String point_code2 = schBaseTask.getPoint_code2();
|
||||
String point_code3 = schBaseTask.getPoint_code3();
|
||||
String point_code4 = schBaseTask.getPoint_code4();
|
||||
if (rawfoilWorkOrder == null) {
|
||||
throw new BadRequestException("工单不存在");
|
||||
}
|
||||
CoolPointIvt coolPointIvt = coolPointIvtMapper.selectOne(new LambdaQueryWrapper<CoolPointIvt>().eq(CoolPointIvt::getEmpty_point_code, point_code1));
|
||||
if (coolPointIvt == null) {
|
||||
throw new BadRequestException("未找到可用点位:" + point_code1);
|
||||
}
|
||||
//更新冷却区空轴位库存状态
|
||||
coolPointIvt.setEmpty_point_status("01");
|
||||
coolPointIvt.setEmpty_vehicle_code("");
|
||||
coolPointIvtMapper.updateById(coolPointIvt);
|
||||
|
||||
if (fullPointCode.endsWith("M")) {
|
||||
sbPointIvt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(SbPointIvt::getFull_point_code, fullPointCode));
|
||||
} else {
|
||||
sbPointIvt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(SbPointIvt::getEmpty_point_code, fullPointCode));
|
||||
}
|
||||
if (sbPointIvt == null) {
|
||||
throw new BadRequestException("未找到对应的点位: " + fullPointCode);
|
||||
}
|
||||
if (fullStatus != null) sbPointIvt.setFull_point_status(fullStatus);
|
||||
if (emptyStatus != null) sbPointIvt.setEmpty_point_status(emptyStatus);
|
||||
sbPointIvtMapper.updateById(sbPointIvt);
|
||||
}
|
||||
CoolPointIvt coolPointIvt2 = coolPointIvtMapper.selectOne(new LambdaQueryWrapper<CoolPointIvt>().eq(CoolPointIvt::getFull_point_code, point_code4));
|
||||
if (coolPointIvt2 == null) {
|
||||
throw new BadRequestException("未找到可用点位:" + point_code4);
|
||||
}
|
||||
|
||||
rawfoilWorkOrder.setStatus("09");
|
||||
rawfoilWorkOrder.setOrigin("1");
|
||||
rawfoilWorkOrder.setRoll_status("0");
|
||||
rawfoilWorkOrder.setRealend_time(DateUtil.now());
|
||||
rawfoilWorkOrder.setUpdate_optid(currentUserId);
|
||||
rawfoilWorkOrder.setUpdate_optname(currentUsername);
|
||||
rawfoilWorkOrder.setFinish_type("01");
|
||||
rawfoilWorkOrder.setUpdate_time(DateUtil.now());
|
||||
rawfoilWorkOrderMapper.updateById(rawfoilWorkOrder);
|
||||
|
||||
// 更新冷却位满轴位库存状态
|
||||
coolPointIvt2.setFull_point_status("02");
|
||||
coolPointIvt2.setInstorage_time(DateUtil.now());
|
||||
coolPointIvt2.setContainer_name(rawfoilWorkOrder.getContainer_name());
|
||||
coolPointIvt2.setWorkorder_id(String.valueOf(rawfoilWorkOrder.getWorkorder_id()));
|
||||
coolPointIvt2.setIvt_qty(rawfoilWorkOrder.getProductin_qty());
|
||||
coolPointIvt2.setCool_ivt_status("01");
|
||||
coolPointIvt2.setEmpty_vehicle_code("");
|
||||
coolPointIvtMapper.updateById(coolPointIvt2);
|
||||
|
||||
private void updateIvtIvt(String fullPointCode,
|
||||
String fullStatus,
|
||||
String emptyStatus,
|
||||
RawfoilWorkOrder rawfoilWorkOrder) {
|
||||
CoolPointIvt coolPointIvt;
|
||||
if (fullPointCode.endsWith("M")) {
|
||||
coolPointIvt = coolPointIvtMapper.selectOne(new LambdaQueryWrapper<CoolPointIvt>()
|
||||
.eq(CoolPointIvt::getFull_point_code, fullPointCode));
|
||||
} else {
|
||||
coolPointIvt = coolPointIvtMapper.selectOne(new LambdaQueryWrapper<CoolPointIvt>()
|
||||
.eq(CoolPointIvt::getEmpty_point_code, fullPointCode));
|
||||
}
|
||||
if (coolPointIvt == null) {
|
||||
throw new BadRequestException("未找到对应的点位: " + fullPointCode);
|
||||
}
|
||||
coolPointIvt.setFull_point_status(fullStatus);
|
||||
coolPointIvt.setEmpty_point_status(emptyStatus);
|
||||
if (rawfoilWorkOrder != null) {
|
||||
coolPointIvt.setInstorage_time(DateUtil.now());
|
||||
coolPointIvt.setContainer_name(rawfoilWorkOrder.getContainer_name());
|
||||
coolPointIvt.setWorkorder_id(String.valueOf(rawfoilWorkOrder.getWorkorder_id()));
|
||||
}
|
||||
coolPointIvtMapper.updateById(coolPointIvt);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -279,11 +225,10 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
CutConveyorTask cutConveyorTask = new CutConveyorTask();
|
||||
CutConveyorTask cutConveyorTask = SpringContextHolder.getBean(CutConveyorTask.class);
|
||||
|
||||
String point_code1 = form.getString("point_code1");
|
||||
String point_code2 = form.getString("point_code2");
|
||||
|
||||
Reference in New Issue
Block a user