Merge remote-tracking branch 'origin/b_lms' into b_lms

This commit is contained in:
2024-02-28 16:06:01 +08:00
15 changed files with 500 additions and 1 deletions

View File

@@ -170,5 +170,12 @@ public class AcsToWmsController {
return new ResponseEntity<>(acsToWmsService.deviceApplyTwo(whereJson), HttpStatus.OK);
}
@PostMapping("/deviceApplyExceptional")
@Log(value = "二期任务异常反馈", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
@SaIgnore
public ResponseEntity<Object> deviceApplyExceptional(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(acsToWmsService.deviceApplyExceptional(whereJson), HttpStatus.OK);
}
}

View File

@@ -155,4 +155,16 @@ public interface AcsToWmsService {
* @return
*/
JSONObject deviceApplyTwo(JSONObject whereJson);
/**
* 二期任务异常反馈
* @param whereJson:{
* type :异常类型
* task_code : 任务编码
* }
* @return JSONObject {
* point_code: 货位编码
* }
*/
JSONObject deviceApplyExceptional(JSONObject whereJson);
}

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.google.common.collect.Interner;
import com.google.common.collect.Interners;
@@ -21,6 +22,7 @@ import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.sch.tasks.TwoBoxExcepTask;
import org.nl.b_lms.sch.tasks.first_floor_area.MzhcwTask;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.b_lms.storage_manage.ios.enums.TASKEnum;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.*;
import org.nl.common.enums.NoticeTypeEnum;
import org.nl.common.enums.PackageInfoIvtEnum;
@@ -110,6 +112,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
*/
private final InBoxManageService inBoxManageService;
/**
* 木箱出库处理服务
*/
private final OutBoxManageService outBoxManageService;
@Resource
private IschBaseTaskService taskService;
@@ -1957,4 +1964,69 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return result;
}
@Override
@Transactional
@SneakyThrows
public JSONObject deviceApplyExceptional(JSONObject whereJson) {
log.info("deviceApplyExceptional请求参数---------------------------------------------" + whereJson.toString());
JSONObject result = new JSONObject();
// 异常类型
String type = whereJson.getString("type");
RLock lock = redissonClient.getLock("acs_to_wms_two_c:" + type);
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
try {
if (tryLock) {
SchBaseTask taskDao = taskService.getOne(
new QueryWrapper<SchBaseTask>().lambda()
.eq(SchBaseTask::getTask_code, whereJson.getString("task_code"))
);
String point_code = "";
// 判断任务类型
if (taskDao.getTask_type().equals(TASKEnum.BOX_TYPE.code("木箱入库"))) {
// 木箱入库:满入、浅货位有货-放货时
if (type.equals("1") || type.equals("4")) {
point_code = inBoxManageService.taskExceptional(whereJson);
}
} else if (taskDao.getTask_type().equals(TASKEnum.BOX_TYPE.code("木箱出库"))) {
// 木箱出库:空出、浅货位有货-取货时
if (type.equals("2") || type.equals("3")) {
point_code = outBoxManageService.taskExceptional(whereJson);
}
} else if (taskDao.getTask_type().equals(TASKEnum.VEHICLE_TYPE.code("托盘入库"))) {
// 托盘入库:满入、浅货位有货-放货时
if (type.equals("1") || type.equals("4")) {
point_code = inVehicleManageService.taskExceptional(whereJson);
}
} else if (taskDao.getTask_type().equals(TASKEnum.VEHICLE_TYPE.code("托盘出库"))) {
// 托盘出库:空出、浅货位有货-取货时
if (type.equals("2") || type.equals("3")) {
point_code = outVehicleManageService.taskExceptional(whereJson);
}
} else if (taskDao.getTask_type().equals(TASKEnum.PROUD_TYPE.code("成品入库"))) {
// 成品入库:满入、浅货位有货-放货时
if (type.equals("1") || type.equals("4")) {
point_code = inBussManageService.taskExceptional(whereJson);
}
}
result.put("status", HttpStatus.OK.value());
result.put("message", "下发成功!");
result.put("point_code", point_code);
log.info("deviceApplyExceptional返回参数---------------------------------------------" + result.toString());
return result;
}
} finally {
if (tryLock) {
lock.unlock();
}
}
result.put("status", HttpStatus.BAD_REQUEST.value());
result.put("message", "申请任务超时!" + type);
log.info("deviceApplyExceptional返回参数---------------------------------------------" + result.toString());
return result;
}
}