|
@@ -154,48 +154,45 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
|
|
|
// ASN类型的且要到仓储区的任务进行判断入库条件
|
|
// ASN类型的且要到仓储区的任务进行判断入库条件
|
|
if (flowConfigHeaderVO.getId().equals(Long.valueOf("9")) || flowConfigHeaderVO.getId().equals(Long.valueOf("10"))
|
|
if (flowConfigHeaderVO.getId().equals(Long.valueOf("9")) || flowConfigHeaderVO.getId().equals(Long.valueOf("10"))
|
|
- || flowConfigHeaderVO.getId().equals(Long.valueOf("12"))
|
|
|
|
- || flowConfigHeaderVO.getId().equals(Long.valueOf("13"))){
|
|
|
|
|
|
+ || flowConfigHeaderVO.getId().equals(Long.valueOf("12"))
|
|
|
|
+ || flowConfigHeaderVO.getId().equals(Long.valueOf("13"))) {
|
|
// 查询同班组的库存
|
|
// 查询同班组的库存
|
|
- List<AgvCallItemDTO> agvCallItemDTOList = agvCallDTO.getAgvCallItemDTOList();
|
|
|
|
- if (agvCallItemDTOList != null && agvCallItemDTOList.size() >= 0){
|
|
|
|
- String team = agvCallItemDTOList.get(0).getLotattDTO().getLotatt09();
|
|
|
|
- List<BaseLocationInfo> locationInfos = new ArrayList();
|
|
|
|
- String currentColNo = null;// 当前列
|
|
|
|
- Long currentZoneId = null; // 当前库区
|
|
|
|
- for(BaseLocationInfo baseLocationInfo : locationToList){
|
|
|
|
- if (baseLocationInfo.getColNo().equals(currentColNo) && baseLocationInfo.getZoneId().equals(currentZoneId)){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- // 标记当前列分配
|
|
|
|
- Boolean columnAvailable = true;
|
|
|
|
- // 查询当前库位的库存包含批次属性
|
|
|
|
- List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattByLocationId(baseLocationInfo.getId());
|
|
|
|
- for (InvLotLocIdLotattVO invLotLocIdLotattVO : invLotLocIdLotattVOS){
|
|
|
|
- // 库存当前某列有不同班组
|
|
|
|
- if (Objects.nonNull(invLotLocIdLotattVO) && !invLotLocIdLotattVO.getLotatt09().equals(team)){
|
|
|
|
- // 标记当前列不分配
|
|
|
|
- columnAvailable = false;
|
|
|
|
- currentColNo = baseLocationInfo.getColNo();
|
|
|
|
- currentZoneId = baseLocationInfo.getZoneId();
|
|
|
|
- log.info("==========当前库位有不同班组批次{}{}",baseLocationInfo,invLotLocIdLotattVO.getLotatt09());
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ String team = agvCallDTO.getTeamNo();
|
|
|
|
+ List<BaseLocationInfo> locationInfos = new ArrayList();
|
|
|
|
+ String currentColNo = null;// 当前列
|
|
|
|
+ Long currentZoneId = null; // 当前库区
|
|
|
|
+ for (BaseLocationInfo baseLocationInfo : locationToList) {
|
|
|
|
+ if (baseLocationInfo.getColNo().equals(currentColNo) && baseLocationInfo.getZoneId().equals(currentZoneId)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ // 标记当前列分配
|
|
|
|
+ Boolean columnAvailable = true;
|
|
|
|
+ // 查询当前库位的库存包含批次属性
|
|
|
|
+ List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattByLocationId(baseLocationInfo.getId());
|
|
|
|
+ for (InvLotLocIdLotattVO invLotLocIdLotattVO : invLotLocIdLotattVOS) {
|
|
|
|
+ // 库存当前某列有不同班组
|
|
|
|
+ if (Objects.nonNull(invLotLocIdLotattVO) && !invLotLocIdLotattVO.getLotatt09().equals(team)) {
|
|
|
|
+ // 标记当前列不分配
|
|
|
|
+ columnAvailable = false;
|
|
|
|
+ currentColNo = baseLocationInfo.getColNo();
|
|
|
|
+ currentZoneId = baseLocationInfo.getZoneId();
|
|
|
|
+ log.info("==========当前库位有不同班组批次{}{}", baseLocationInfo, invLotLocIdLotattVO.getLotatt09());
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
- if (columnAvailable){ // 当前列同班组或者为空
|
|
|
|
- // 判断当前库位同列是否有不同类型任务
|
|
|
|
- List<BaseLocationInfo> blsList = baseLocationInfoService.selectWcsSameColumnAndTeamNotFinish(baseLocationInfo.getColNo(),
|
|
|
|
- team, baseLocationInfo.getZoneId(), Constant.WAREHOUSE_ID, "ASN");
|
|
|
|
- // 当前列有不同类型未完成任务 继续遍历下一库位
|
|
|
|
- if (blsList != null && blsList.size() > 0){
|
|
|
|
- log.info("==========当前库位同列有未完成的出库任务,库位编号{}列{}",baseLocationInfo.getId(),baseLocationInfo.getColNo());
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- locationInfos.add(baseLocationInfo);
|
|
|
|
|
|
+ }
|
|
|
|
+ if (columnAvailable) { // 当前列同班组或者为空
|
|
|
|
+ // 判断当前库位同列是否有不同类型任务
|
|
|
|
+ List<BaseLocationInfo> blsList = baseLocationInfoService.selectWcsSameColumnAndTeamNotFinish(baseLocationInfo.getColNo(),
|
|
|
|
+ team, baseLocationInfo.getZoneId(), Constant.WAREHOUSE_ID, "ASN");
|
|
|
|
+ // 当前列有不同类型未完成任务 继续遍历下一库位
|
|
|
|
+ if (blsList != null && blsList.size() > 0) {
|
|
|
|
+ log.info("==========当前库位同列有未完成的出库任务,库位编号{}列{}", baseLocationInfo.getId(), baseLocationInfo.getColNo());
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
|
|
+ locationInfos.add(baseLocationInfo);
|
|
}
|
|
}
|
|
- locationToList = locationInfos;
|
|
|
|
}
|
|
}
|
|
|
|
+ locationToList = locationInfos;
|
|
}
|
|
}
|
|
|
|
|
|
locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "ASN", asnSoStrategy, token, flowConfigHeaderVO.getId());
|
|
locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "ASN", asnSoStrategy, token, flowConfigHeaderVO.getId());
|
|
@@ -227,8 +224,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
List<BaseLocationInfo> locationToList = this.convertLocation(paramLocationTo, agvCallDTO.getWarehouseId(), null);
|
|
List<BaseLocationInfo> locationToList = this.convertLocation(paramLocationTo, agvCallDTO.getWarehouseId(), null);
|
|
|
|
|
|
// 如果是从仓储区出库的任务 检查同列未完成任务类型是否相同
|
|
// 如果是从仓储区出库的任务 检查同列未完成任务类型是否相同
|
|
- if (flowConfigHeaderVO.getId().equals(Long.valueOf("14")) || flowConfigHeaderVO.getId().equals(Long.valueOf("15"))){
|
|
|
|
- Assert.isTrue(checkWcsSameColumnNotFinish(locationFromListEnd, "SO"),"同列有未完成的入库任务");
|
|
|
|
|
|
+ if (flowConfigHeaderVO.getId().equals(Long.valueOf("14")) || flowConfigHeaderVO.getId().equals(Long.valueOf("15"))) {
|
|
|
|
+ Assert.isTrue(checkWcsSameColumnNotFinish(locationFromListEnd, "SO"), "同列有未完成的入库任务");
|
|
}
|
|
}
|
|
|
|
|
|
locationFrom = this.zoneLocationAllocation(locationFromListEnd, "locationFrom", "SO", asnSoStrategy, token, flowConfigHeaderVO.getId());
|
|
locationFrom = this.zoneLocationAllocation(locationFromListEnd, "locationFrom", "SO", asnSoStrategy, token, flowConfigHeaderVO.getId());
|
|
@@ -259,18 +256,19 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 检查同列的未完成任务类型是否与当前任务类型一致
|
|
* 检查同列的未完成任务类型是否与当前任务类型一致
|
|
|
|
+ *
|
|
* @param baseLocationInfoList
|
|
* @param baseLocationInfoList
|
|
* @param type
|
|
* @param type
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Boolean checkWcsSameColumnNotFinish(List<BaseLocationInfo> baseLocationInfoList,String type){
|
|
|
|
|
|
+ public Boolean checkWcsSameColumnNotFinish(List<BaseLocationInfo> baseLocationInfoList, String type) {
|
|
log.info("检查同列的未完成任务类型是否与当前任务类型一致============");
|
|
log.info("检查同列的未完成任务类型是否与当前任务类型一致============");
|
|
- for(BaseLocationInfo locationInfo: baseLocationInfoList){
|
|
|
|
|
|
+ for (BaseLocationInfo locationInfo : baseLocationInfoList) {
|
|
// 查询任务状态不为2(完成),6(卸货完成),7(取消)的同列任务
|
|
// 查询任务状态不为2(完成),6(卸货完成),7(取消)的同列任务
|
|
List<BaseLocationInfo> blsList = baseLocationInfoService.selectWcsSameColumnNotFinish(locationInfo.getColNo(),
|
|
List<BaseLocationInfo> blsList = baseLocationInfoService.selectWcsSameColumnNotFinish(locationInfo.getColNo(),
|
|
locationInfo.getColIndex(), locationInfo.getZoneId(), Constant.WAREHOUSE_ID, type);
|
|
locationInfo.getColIndex(), locationInfo.getZoneId(), Constant.WAREHOUSE_ID, type);
|
|
// 如果同列有不同类型的未完成任务
|
|
// 如果同列有不同类型的未完成任务
|
|
- if (blsList != null && blsList.size() > 0){
|
|
|
|
|
|
+ if (blsList != null && blsList.size() > 0) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -279,19 +277,20 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 检查同列的未完成任务类型及班组是否与当前任务类型一致
|
|
* 检查同列的未完成任务类型及班组是否与当前任务类型一致
|
|
|
|
+ *
|
|
* @param baseLocationInfoList
|
|
* @param baseLocationInfoList
|
|
* @param type
|
|
* @param type
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<BaseLocationInfo> checkWcsSameColumnAndTeamNotFinish(List<BaseLocationInfo> baseLocationInfoList,String type,String team){
|
|
|
|
|
|
+ public List<BaseLocationInfo> checkWcsSameColumnAndTeamNotFinish(List<BaseLocationInfo> baseLocationInfoList, String type, String team) {
|
|
log.info("检查同列的未完成任务类型及班组是否与当前任务类型一致============");
|
|
log.info("检查同列的未完成任务类型及班组是否与当前任务类型一致============");
|
|
List<BaseLocationInfo> resultList = new ArrayList<>();
|
|
List<BaseLocationInfo> resultList = new ArrayList<>();
|
|
- for(BaseLocationInfo locationInfo: baseLocationInfoList){
|
|
|
|
|
|
+ for (BaseLocationInfo locationInfo : baseLocationInfoList) {
|
|
// 查询任务状态不为2(完成),6(卸货完成),7(取消)的同列任务
|
|
// 查询任务状态不为2(完成),6(卸货完成),7(取消)的同列任务
|
|
List<BaseLocationInfo> blsList = baseLocationInfoService.selectWcsSameColumnAndTeamNotFinish(locationInfo.getColNo(),
|
|
List<BaseLocationInfo> blsList = baseLocationInfoService.selectWcsSameColumnAndTeamNotFinish(locationInfo.getColNo(),
|
|
team, locationInfo.getZoneId(), Constant.WAREHOUSE_ID, type);
|
|
team, locationInfo.getZoneId(), Constant.WAREHOUSE_ID, type);
|
|
// 如果同列有不同类型的未完成任务
|
|
// 如果同列有不同类型的未完成任务
|
|
- if (blsList != null && blsList.size() > 0){
|
|
|
|
|
|
+ if (blsList != null && blsList.size() > 0) {
|
|
resultList.addAll(blsList);
|
|
resultList.addAll(blsList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -411,9 +410,9 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
if (locationType.equals("locationFrom")) {
|
|
if (locationType.equals("locationFrom")) {
|
|
|
|
|
|
// 如果是从仓储区出库 调用无需判断阻挡的方法
|
|
// 如果是从仓储区出库 调用无需判断阻挡的方法
|
|
- if (type.equals("SO") && (flowId.equals(Long.valueOf("14")) || flowId.equals(Long.valueOf("15")))){
|
|
|
|
|
|
+ if (type.equals("SO") && (flowId.equals(Long.valueOf("14")) || flowId.equals(Long.valueOf("15")))) {
|
|
locationInfo = checkTheSameColumnLocationSO(locationInfoList, token);
|
|
locationInfo = checkTheSameColumnLocationSO(locationInfoList, token);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
locationInfo = checkTheSameColumnLocation(locationInfoList, token, false);
|
|
locationInfo = checkTheSameColumnLocation(locationInfoList, token, false);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -429,9 +428,9 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// 是到仓储区的入库任务
|
|
// 是到仓储区的入库任务
|
|
- if (type.equals("ASN") && !flowId.equals(Long.valueOf("8")) && !flowId.equals(Long.valueOf("11"))){
|
|
|
|
|
|
+ if (type.equals("ASN") && !flowId.equals(Long.valueOf("8")) && !flowId.equals(Long.valueOf("11"))) {
|
|
locationInfo = checkTheSameColumnLocationASN(locationInfoList, token, true);
|
|
locationInfo = checkTheSameColumnLocationASN(locationInfoList, token, true);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
locationInfo = checkTheSameColumnLocation(locationInfoList, token, true);
|
|
locationInfo = checkTheSameColumnLocation(locationInfoList, token, true);
|
|
}
|
|
}
|
|
if (locationInfo == null) {
|
|
if (locationInfo == null) {
|
|
@@ -450,6 +449,7 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 入库判断目标点位
|
|
* 入库判断目标点位
|
|
|
|
+ *
|
|
* @param locationInfoList
|
|
* @param locationInfoList
|
|
* @param token
|
|
* @param token
|
|
* @param isReleaseGoods
|
|
* @param isReleaseGoods
|
|
@@ -502,13 +502,13 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
//同列是否有任务
|
|
//同列是否有任务
|
|
List<BaseLocationInfo> occupyByLocs = baseLocationInfoMapper.queryByListOccupyByLoc(location);
|
|
List<BaseLocationInfo> occupyByLocs = baseLocationInfoMapper.queryByListOccupyByLoc(location);
|
|
if (occupyByLocs.size() > 0) {
|
|
if (occupyByLocs.size() > 0) {
|
|
- log.info("同列有任务=========={}",occupyByLocs);
|
|
|
|
|
|
+ log.info("同列有任务=========={}", occupyByLocs);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
//同列前方是否有阻挡
|
|
//同列前方是否有阻挡
|
|
List<BaseLocationInfo> inStockByLocs = baseLocationInfoMapper.queryByListInStockByLoc(location);
|
|
List<BaseLocationInfo> inStockByLocs = baseLocationInfoMapper.queryByListInStockByLoc(location);
|
|
if (inStockByLocs.size() > 0) {
|
|
if (inStockByLocs.size() > 0) {
|
|
- log.info("同列有阻挡=========={}",inStockByLocs);
|
|
|
|
|
|
+ log.info("同列有阻挡=========={}", inStockByLocs);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -539,6 +539,7 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* AGV出库任务生成时的起始位置不判断是否阻挡
|
|
* AGV出库任务生成时的起始位置不判断是否阻挡
|
|
|
|
+ *
|
|
* @param basLocationList
|
|
* @param basLocationList
|
|
* @param token
|
|
* @param token
|
|
* @return
|
|
* @return
|
|
@@ -746,7 +747,7 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
public AjaxResult sendTask(WcsTask wcsTask) {
|
|
public AjaxResult sendTask(WcsTask wcsTask) {
|
|
BaseLocationInfo locFrom = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(wcsTask.getLocationFrom(), Constant.WAREHOUSE_ID);
|
|
BaseLocationInfo locFrom = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(wcsTask.getLocationFrom(), Constant.WAREHOUSE_ID);
|
|
BaseLocationInfo locTo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(wcsTask.getLocationTo(), Constant.WAREHOUSE_ID);
|
|
BaseLocationInfo locTo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(wcsTask.getLocationTo(), Constant.WAREHOUSE_ID);
|
|
- log.info("进入AMS任务下发=========={}",wcsTask);
|
|
|
|
|
|
+ log.info("进入AMS任务下发=========={}", wcsTask);
|
|
AmsTask amsTask = new AmsTask();
|
|
AmsTask amsTask = new AmsTask();
|
|
amsTask.setTaskNo(wcsTask.getTaskNo());
|
|
amsTask.setTaskNo(wcsTask.getTaskNo());
|
|
if (wcsTask.getBusinessType() == null || wcsTask.getBusinessType().equals("")) {
|
|
if (wcsTask.getBusinessType() == null || wcsTask.getBusinessType().equals("")) {
|
|
@@ -761,11 +762,11 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
amsTask.setExt1(wcsTask.getExt1());
|
|
amsTask.setExt1(wcsTask.getExt1());
|
|
amsTask.setExt2(wcsTask.getExt2());
|
|
amsTask.setExt2(wcsTask.getExt2());
|
|
amsTask.setExt3(wcsTask.getExt3());
|
|
amsTask.setExt3(wcsTask.getExt3());
|
|
- if(wcsTask.getBusinessType().equals(Constant.TASK_BUSINESS_TYPE.TASK_POWER.getValue())){
|
|
|
|
|
|
+ if (wcsTask.getBusinessType().equals(Constant.TASK_BUSINESS_TYPE.TASK_POWER.getValue())) {
|
|
amsTask.setStFrom(Integer.valueOf(wcsTask.getLocationFrom()));
|
|
amsTask.setStFrom(Integer.valueOf(wcsTask.getLocationFrom()));
|
|
amsTask.setStTo(Integer.valueOf(wcsTask.getLocationTo()));
|
|
amsTask.setStTo(Integer.valueOf(wcsTask.getLocationTo()));
|
|
amsTask.setDeviceName(wcsTask.getDeviceName());
|
|
amsTask.setDeviceName(wcsTask.getDeviceName());
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
amsTask.setStFrom(locFrom.getAgvStation().intValue());
|
|
amsTask.setStFrom(locFrom.getAgvStation().intValue());
|
|
amsTask.setStTo(locTo.getAgvStation().intValue());
|
|
amsTask.setStTo(locTo.getAgvStation().intValue());
|
|
}
|
|
}
|