fix:出库问题处理
This commit is contained in:
@@ -247,7 +247,13 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
//均衡获取木箱出库装箱区对接位
|
//均衡获取木箱出库装箱区对接位
|
||||||
//= getPointCode(packagerelationList.size());
|
//= getPointCode(packagerelationList.size());
|
||||||
String deviceCode = "ZXQ_1_1";
|
String deviceCode = "ZXQ_1_1";
|
||||||
try {
|
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||||
|
.eq("point_code2", deviceCode)
|
||||||
|
.eq("task_type", "010704")
|
||||||
|
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||||
|
if (count>2){
|
||||||
|
throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||||
|
}
|
||||||
List<String> workIdList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
|
List<String> workIdList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
|
||||||
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||||
.map(String::valueOf)
|
.map(String::valueOf)
|
||||||
@@ -284,9 +290,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
.max(Integer::compareTo)
|
.max(Integer::compareTo)
|
||||||
.orElse(0) + 1;
|
.orElse(0) + 1;
|
||||||
outBox(workIdList, containerNameList, deviceCode, maxBoxGroup, whereJson, totalWeight);
|
outBox(workIdList, containerNameList, deviceCode, maxBoxGroup, whereJson, totalWeight);
|
||||||
} catch (Exception e) {
|
|
||||||
throw new BadRequestException(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkEntityList(JSONObject whereJson, List<PdmBiSubpackagerelation> packagerelationList) {
|
private void checkEntityList(JSONObject whereJson, List<PdmBiSubpackagerelation> packagerelationList) {
|
||||||
@@ -326,7 +329,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
/**
|
/**
|
||||||
* 空木箱出库
|
* 空木箱出库
|
||||||
*/
|
*/
|
||||||
private void outBox(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer maxBoxGroup, JSONObject whereJson, BigDecimal totalWeight) {
|
public void outBox(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer maxBoxGroup, JSONObject whereJson, BigDecimal totalWeight) {
|
||||||
JSONObject boxInfo = new JSONObject();
|
JSONObject boxInfo = new JSONObject();
|
||||||
//确定木箱出库装箱区
|
//确定木箱出库装箱区
|
||||||
boxInfo.put("device_code", deviceCode);
|
boxInfo.put("device_code", deviceCode);
|
||||||
@@ -342,22 +345,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
totalWeight = totalWeight.add(boxWeight);
|
totalWeight = totalWeight.add(boxWeight);
|
||||||
//更新及子卷包装状态已分配规格及木箱规格组
|
//更新及子卷包装状态已分配规格及木箱规格组
|
||||||
String weightTotal = totalWeight.toString();
|
String weightTotal = totalWeight.toString();
|
||||||
CompletableFuture.runAsync(() -> {
|
|
||||||
try {
|
|
||||||
updateBoxGroup(maxBoxGroup, workIdList, boxDao, weightTotal);
|
updateBoxGroup(maxBoxGroup, workIdList, boxDao, weightTotal);
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("子卷装箱异常,updateBoxGroup更新子卷包装关系异常,木箱号为:" + boxSn + ",异常信息:" + e);
|
|
||||||
}
|
|
||||||
}, pool);
|
|
||||||
agvTransfer(containerNameList, deviceCode, boxSn);
|
agvTransfer(containerNameList, deviceCode, boxSn);
|
||||||
//待检区->装箱区agv任务
|
|
||||||
CompletableFuture.runAsync(() -> {
|
|
||||||
try {
|
|
||||||
agvTransfer(containerNameList, deviceCode, boxSn);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("子卷装箱异常,agvTransfer待检区->装箱区agv确定起点任务创建异常,木箱号为:" + boxSn + ",异常信息:" + e);
|
|
||||||
}
|
|
||||||
}, pool);
|
|
||||||
//给MES传输子卷包装关系
|
//给MES传输子卷包装关系
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
@@ -558,8 +547,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SneakyThrows
|
|
||||||
protected void agvTransfer(Set<String> containerNameList, String deviceCode, String boxSn) {
|
protected void agvTransfer(Set<String> containerNameList, String deviceCode, String boxSn) {
|
||||||
//待检区点位
|
//待检区点位
|
||||||
List<BstIvtPackageinfoivt> djqPointList = packageinfoivtService
|
List<BstIvtPackageinfoivt> djqPointList = packageinfoivtService
|
||||||
@@ -573,11 +560,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//任务组id
|
//任务组id
|
||||||
String groupId = deviceCode.substring(deviceCode.indexOf("_") + 1, deviceCode.indexOf("_", deviceCode.indexOf("_") + 1));
|
String groupId = deviceCode.substring(deviceCode.indexOf("_") + 1, deviceCode.indexOf("_", deviceCode.indexOf("_") + 1));
|
||||||
RLock lock = redissonClient.getLock(groupId);
|
|
||||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
|
||||||
try {
|
|
||||||
if (tryLock) {
|
|
||||||
//确定起点,安装装箱组标识加入任务队列
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
for (int i1 = 0; i1 < djqPoints.size(); i1++) {
|
for (int i1 = 0; i1 < djqPoints.size(); i1++) {
|
||||||
BstIvtPackageinfoivt item = djqPoints.get(i1);
|
BstIvtPackageinfoivt item = djqPoints.get(i1);
|
||||||
@@ -597,14 +579,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
zxqTask.createTaskReturnTask(jo);
|
zxqTask.createTaskReturnTask(jo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.info("待检区->装箱区任务队列正在创建被锁住。");
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
if (tryLock) {
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -283,10 +283,7 @@ public class ZxqTask extends AbstractAcsTask {
|
|||||||
SchBaseTask task = new SchBaseTask();
|
SchBaseTask task = new SchBaseTask();
|
||||||
BeanUtils.copyProperties(schBaseTaskVo, task);
|
BeanUtils.copyProperties(schBaseTaskVo, task);
|
||||||
taskService.save(task);
|
taskService.save(task);
|
||||||
//如果目标点位没有空位先创建不下发
|
|
||||||
if (isSend) {
|
|
||||||
this.immediateNotifyAcs(null);
|
|
||||||
}
|
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
|||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvMapper;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvMapper;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
||||||
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
@@ -357,9 +358,10 @@ public class InBussManageServiceImpl implements InBussManageService {
|
|||||||
iStIvtIostorinvService.unDivStruct(pram);
|
iStIvtIostorinvService.unDivStruct(pram);
|
||||||
|
|
||||||
// 标记原货位为满入异常锁
|
// 标记原货位为满入异常锁
|
||||||
JSONObject jsonAttr = attrTab.query("struct_code = '" + taskDao.getPoint_code2() + "'").uniqueResult(0);
|
attrTab.update(
|
||||||
jsonAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("货位异常锁"));
|
MapOf.of("lock_type", IOSEnum.LOCK_TYPE.code("货位异常锁")
|
||||||
attrTab.update(jsonAttr);
|
,"update_time",DateUtil.now(),"remark",taskDao.getTask_id()+"满入申请")
|
||||||
|
, "struct_code = '" + taskDao.getPoint_code2() + "'");
|
||||||
|
|
||||||
// 2.重新分配货位
|
// 2.重新分配货位
|
||||||
String iostorinv_id = disDaoList.get(0).get("iostorinv_id").toString();
|
String iostorinv_id = disDaoList.get(0).get("iostorinv_id").toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user