fix: 收卷辊满入空出异常处理
This commit is contained in:
@@ -59,6 +59,12 @@ public class AcsToWmsController {
|
||||
public ResponseEntity<Object> applyNewPoint(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.applyNewPoint(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/applyRollUpRollerNewPoint")
|
||||
@Log(value = "收卷辊库满入空出申请新点位", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> applyRollUpRollerNewPoint(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.applyRollUpRollerNewPoint(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/receiveWasteFoilWeight")
|
||||
@Log(value = "废箔重量反馈", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@SaIgnore
|
||||
|
||||
@@ -146,4 +146,11 @@ public interface AcsToWmsService {
|
||||
* @return
|
||||
*/
|
||||
JSONObject applyNewPoint(JSONObject param);
|
||||
|
||||
/**
|
||||
* 收卷辊满入空出
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
JSONObject applyRollUpRollerNewPoint(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -188,4 +188,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
public JSONObject applyNewPoint(JSONObject param) {
|
||||
return nbjOperationService.tubeExceptionHandling(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject applyRollUpRollerNewPoint(JSONObject param) {
|
||||
return otherOperationService.takeUpRollExceptionHandling(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,11 @@ public interface OtherOperationService {
|
||||
* @return /
|
||||
*/
|
||||
JSONObject acsRequestWasteFoilWeight(JSONObject param);
|
||||
|
||||
/**
|
||||
* 收卷辊异常处理
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject takeUpRollExceptionHandling(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch.task_manage.service.NbjOperationService;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -21,11 +22,8 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.nl.wms.util.PointUtils.clearPoint;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
@@ -42,7 +40,7 @@ public class NbjOperationServiceImpl implements NbjOperationService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject tubeExceptionHandling(JSONObject param) {
|
||||
MDC.put(GeneralDefinition.MDC_KEY, TagNameEnum.ERROR_GX_IN_OUT.getTag());
|
||||
log.info("ACS请求满入/空出异常处理 - {}", param);
|
||||
log.info("ACS请求管芯满入/空出异常处理 - {}", param);
|
||||
// type: 1满入,2空出、target: 异常点位、barcode:条码、task_code: 任务编码
|
||||
String type = param.getString("type");
|
||||
String deviceCode = param.getString("target");
|
||||
@@ -65,7 +63,9 @@ public class NbjOperationServiceImpl implements NbjOperationService {
|
||||
if (ObjectUtil.isEmpty(task)) {
|
||||
throw new BadRequestException("任务[ {" + taskCode + "} ]不存在!");
|
||||
}
|
||||
// 空出: 根据点位的载具类型查找相同位置: 应该查找没有任务的点位
|
||||
// 空出: 点位清空
|
||||
PointUtils.clearPoint(exceptionPoint, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
// 根据点位的载具类型查找相同位置: 应该查找没有任务的点位
|
||||
allGxPoints = pointService.getAllBusinessNotTaskPoint("A1", "A1-GXK",
|
||||
"3", "2", null, vehicleCode);
|
||||
if (allGxPoints.size() > 0) {
|
||||
|
||||
@@ -3,8 +3,10 @@ package org.nl.wms.sch.task_manage.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.md.wastefoilrecord.service.IWastefoilrecordService;
|
||||
import org.nl.wms.md.wastefoilrecord.service.dao.Wastefoilrecord;
|
||||
@@ -12,13 +14,17 @@ import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch.task_manage.service.OtherOperationService;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -79,4 +85,50 @@ public class OtherOperationServiceImpl implements OtherOperationService {
|
||||
result.put("message", "废箔重量反馈成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject takeUpRollExceptionHandling(JSONObject param) {
|
||||
// 收卷辊异常处理
|
||||
log.info("ACS请求收卷辊满入/空出异常处理 - {}", param);
|
||||
// type: 1-满入,2-空出、task_code:任务编码、target:异常点位
|
||||
String type = param.getString("type");
|
||||
String deviceCode = param.getString("target");
|
||||
String taskCode = param.getString("task_code");
|
||||
SchBaseTask task = taskService.getByCode(taskCode);
|
||||
if (ObjectUtil.isEmpty(task)) {
|
||||
throw new BadRequestException("任务[ {" + taskCode + "} ]不存在!");
|
||||
}
|
||||
SchBasePoint exceptionPoint = pointService.getById(deviceCode);
|
||||
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
||||
List<SchBasePoint> allSjgPoints;
|
||||
if ("1".equals(type)) {
|
||||
// 满入:把对应的点位禁用,并且发起通知,从新获取新点位
|
||||
exceptionPoint.setIs_used(false);
|
||||
exceptionPoint.setUpdate_time(DateUtil.now());
|
||||
log.info("满入禁用点位");
|
||||
pointService.updateById(exceptionPoint);
|
||||
// 查找空位终点即可
|
||||
allSjgPoints = pointService.getAllBusinessNotTaskPoint("A1",
|
||||
"A1-SJGK", "3", "1", null, null);
|
||||
} else {
|
||||
// 空出:点位清空,从新获取新点位
|
||||
PointUtils.clearPoint(exceptionPoint, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
allSjgPoints = pointService.getWindRollNotTaskPoints(requestObj.getString("ext_code"));
|
||||
}
|
||||
if (allSjgPoints.size() == 0) {
|
||||
throw new BadRequestException("收卷辊重新分配货位失败!");
|
||||
}
|
||||
SchBasePoint point = allSjgPoints.get(0);
|
||||
task.setPoint_code3(point.getPoint_code());
|
||||
task.setRemark("重新分配货位");
|
||||
TaskUtils.setUpdateByDefault(task);
|
||||
taskService.updateById(task);
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("device_code", point.getPoint_code());
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "满入空出异常处理请求成功!");
|
||||
result.put("data", data);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user