fix:出空木箱改为定时器下发;新增载具解绑木箱手持功能
This commit is contained in:
@@ -97,5 +97,12 @@ public class ProductOutTwoController {
|
|||||||
return new ResponseEntity<>(productOutTwoService.outExcepionPointPass(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(productOutTwoService.outExcepionPointPass(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/vehicleUnbind")
|
||||||
|
@Log("空托盘解绑")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> vehicleUnbind(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(productOutTwoService.vehicleUnbind(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,4 +92,6 @@ public interface ProductOutTwoService {
|
|||||||
JSONObject boxOut(JSONObject whereJson);
|
JSONObject boxOut(JSONObject whereJson);
|
||||||
|
|
||||||
JSONObject outExcepionPointPass(JSONObject whereJson);
|
JSONObject outExcepionPointPass(JSONObject whereJson);
|
||||||
|
|
||||||
|
JSONObject vehicleUnbind(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
package org.nl.b_lms.pda.service.impl;
|
package org.nl.b_lms.pda.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.druid.util.StringUtils;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
||||||
import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
|
import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
|
||||||
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||||
|
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||||
|
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxlashboundService;
|
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxlashboundService;
|
||||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxlashbound;
|
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxlashbound;
|
||||||
@@ -52,6 +58,12 @@ public class ProductOutTwoServiceImpl implements ProductOutTwoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OutBoxManageService outBoxManageService;
|
private OutBoxManageService outBoxManageService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IschBaseTaskService ischBaseTaskService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject ivtQuery(JSONObject whereJson) {
|
public JSONObject ivtQuery(JSONObject whereJson) {
|
||||||
@@ -238,4 +250,64 @@ public class ProductOutTwoServiceImpl implements ProductOutTwoService {
|
|||||||
result.put("message", "成功放行!");
|
result.put("message", "成功放行!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject vehicleUnbind(JSONObject whereJson) {
|
||||||
|
String vehicle_code = whereJson.getString("vehicle_code");
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(vehicle_code)) {
|
||||||
|
throw new BadRequestException("托盘号不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
WQLObject vehicle_ext = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||||
|
|
||||||
|
JSONObject vehicle_info = vehicle_ext.query("storagevehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(vehicle_info)) {
|
||||||
|
throw new BadRequestException("未查询到载具【" + vehicle_code + "】对应的绑定关系");
|
||||||
|
}
|
||||||
|
|
||||||
|
String box_no = vehicle_info.getString("pcsn");
|
||||||
|
if (StringUtils.isEmpty(box_no)) {
|
||||||
|
throw new BadRequestException("载具【" + vehicle_code + "】上未绑定木箱!");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PdmBiSubpackagerelation> list = ipdmBiSubpackagerelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, box_no));
|
||||||
|
if (ObjectUtil.isNotEmpty(list)) {
|
||||||
|
boolean anyMatch = list.stream().anyMatch(sub -> sub.getStatus().equals("1") || sub.getStatus().equals("2"));
|
||||||
|
if (anyMatch) {
|
||||||
|
throw new BadRequestException("载具上木箱【" + box_no + "】的包装关系为包装或者入库状态!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String collect = list.stream().map(sub -> sub.getContainer_name()).collect(Collectors.joining("','"));
|
||||||
|
|
||||||
|
JSONArray ivt_arr = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn IN ('" + collect + "')").getResultJSONArray(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(ivt_arr)) {
|
||||||
|
throw new BadRequestException("载具【" + vehicle_code + "】上绑定的木箱【" + box_no + "】存在库存,不能进行解绑!");
|
||||||
|
}
|
||||||
|
|
||||||
|
int hasTask = ischBaseTaskService.count(new QueryWrapper<SchBaseTask>()
|
||||||
|
.eq("is_delete", "0")
|
||||||
|
.eq("vehicle_code2", vehicle_code)
|
||||||
|
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||||
|
|
||||||
|
if (hasTask > 0) {
|
||||||
|
throw new BadRequestException("该托盘【" + vehicle_code + "】存在正在执行中的任务,不能进行解绑!");
|
||||||
|
}
|
||||||
|
|
||||||
|
int hasTask2 = ischBaseTaskService.count(new QueryWrapper<SchBaseTask>()
|
||||||
|
.eq("is_delete", "0")
|
||||||
|
.eq("vehicle_code", box_no)
|
||||||
|
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||||
|
|
||||||
|
if (hasTask2 > 0) {
|
||||||
|
throw new BadRequestException("该木箱【" + box_no + "】存在正在执行中的任务,不能进行解绑!");
|
||||||
|
}
|
||||||
|
|
||||||
|
vehicle_info.put("pcsn", "");
|
||||||
|
vehicle_ext.update(vehicle_info);
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("message", "操作成功!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,11 +179,6 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
|||||||
packageInfo.put("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
packageInfo.put("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
||||||
packageInfo.put("container_name", jsonTask.getString("vehicle_code"));
|
packageInfo.put("container_name", jsonTask.getString("vehicle_code"));
|
||||||
packageinfoivt.update(packageInfo);
|
packageinfoivt.update(packageInfo);
|
||||||
RedissonUtils.lock(c -> {
|
|
||||||
if (status.equals(TaskStatusEnum.FINISHED.getCode())) {
|
|
||||||
immediateNotifyAcs(null);
|
|
||||||
}
|
|
||||||
}, "zjInBound", 20, this);
|
|
||||||
}
|
}
|
||||||
// 取消
|
// 取消
|
||||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user