Commit a8bc1204 zshaohui

1.移库优先找里侧的库位

2.其他功能优化
1 个父辈 65d01ef4
...@@ -220,7 +220,7 @@ public class XLRBoxHandler extends BaseDeviceHandler { ...@@ -220,7 +220,7 @@ public class XLRBoxHandler extends BaseDeviceHandler {
checkoutSize++; checkoutSize++;
if (checkoutSize >= 2) { if (checkoutSize >= 2) {
//log.error("cid["+cid + "]的BOX["+ boxId+"]的出库任务已经超过2个,不再分配!"); //log.error("cid["+cid + "]的BOX["+ boxId+"]的出库任务已经超过2个,不再分配!");
//return null; return null;
} }
} }
} }
......
...@@ -886,7 +886,14 @@ public class DeviceController { ...@@ -886,7 +886,14 @@ public class DeviceController {
if(loopCount>=10 ){ if(loopCount>=10 ){
log.info(barcode.getBarcode()+"已循环查找10次 直接跳出循环"); log.info(barcode.getBarcode()+"已循环查找10次 直接跳出循环");
} }
pos = taskService.findEmptyPosForMoveIn(storageList, barcode, "", "",needMovePosName); //优先找B结束的,如果没有再找F的
String endStr = "B";
pos = taskService.findEmptyPosForMoveIn(storageList, barcode, "", "",needMovePosName,endStr);
if (pos == null){
endStr = "F";
pos = taskService.findEmptyPosForMoveIn(storageList, barcode, "", "",needMovePosName,endStr);
break;
}
if (pos == null){ if (pos == null){
break; break;
} }
...@@ -1052,6 +1059,10 @@ public class DeviceController { ...@@ -1052,6 +1059,10 @@ public class DeviceController {
dataCache.updateInventory(needMovePos, barcode); dataCache.updateInventory(needMovePos, barcode);
//重新设置barcode的库位
barcode.setPosName(targetPos.getPosName());
barcodeManager.save(barcode);
//生成一条入库任务 //生成一条入库任务
DataLog targetPosTask = new DataLog(storage, barcode, targetPos); DataLog targetPosTask = new DataLog(storage, barcode, targetPos);
targetPosTask.setOperator("admin-move"); targetPosTask.setOperator("admin-move");
......
...@@ -50,5 +50,10 @@ public enum EquipmentType { ...@@ -50,5 +50,10 @@ public enum EquipmentType {
/** /**
* 韩华 * 韩华
*/ */
HANWHA() HANWHA(),
/**
* 线体流水线
*/
OUTLINE()
} }
...@@ -227,6 +227,9 @@ public class BoxKanbanController { ...@@ -227,6 +227,9 @@ public class BoxKanbanController {
dtos.add(boxTaskMapper.toDto(datalog)); dtos.add(boxTaskMapper.toDto(datalog));
} }
} }
if (dtos != null && !dtos.isEmpty()){
dtos = dtos.stream().sorted(Comparator.comparing(BoxTaskDto :: getUpdateDate)).collect(Collectors.toList());
}
return new PageData<>(dtos, dtos.size()); return new PageData<>(dtos, dtos.size());
} }
......
...@@ -97,4 +97,7 @@ public class BoxTaskDto { ...@@ -97,4 +97,7 @@ public class BoxTaskDto {
private Date createDate = new Date(); private Date createDate = new Date();
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Date updateDate=new Date(); private Date updateDate=new Date();
@ApiModelProperty("出料口")
private String export = "";
} }
...@@ -760,7 +760,7 @@ public class LiteOrderCache { ...@@ -760,7 +760,7 @@ public class LiteOrderCache {
if (task.isCheckOutTask()) { if (task.isCheckOutTask()) {
String posId = task.getPosId(); String posId = task.getPosId();
if (!Strings.isNullOrEmpty(posId)) { if (!Strings.isNullOrEmpty(posId)) {
log.info("需要排除的库位为:" + task.getPosName() + ",barcode为:" + task.getBarcode() + ",任务状态为:" + task.getStatus() + ",上一次修改时间为:" + task.getUpdateDate()+",物料编号为:"+task.getPartNumber()); //log.info("需要排除的库位为:" + task.getPosName() + ",barcode为:" + task.getBarcode() + ",任务状态为:" + task.getStatus() + ",上一次修改时间为:" + task.getUpdateDate()+",物料编号为:"+task.getPartNumber());
operatingPosIds.add(task.getPosId()); operatingPosIds.add(task.getPosId());
} }
} }
......
...@@ -49,7 +49,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> { ...@@ -49,7 +49,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId) throws ValidateException; StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId) throws ValidateException;
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId,String needMovePosName) throws ValidateException; StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId,String needMovePosName,String endStr) throws ValidateException;
StoragePos getEmptyPosByStorage(Storage storage, int size, int height, Collection<String> excludePosIds) throws ValidateException; StoragePos getEmptyPosByStorage(Storage storage, int size, int height, Collection<String> excludePosIds) throws ValidateException;
......
...@@ -465,11 +465,11 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -465,11 +465,11 @@ public class StoragePosManagerImpl implements IStoragePosManager {
@Override @Override
public StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds,String lastPosId) throws ValidateException { public StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds,String lastPosId) throws ValidateException {
return getEmptyPosByStorage(storage,barcode,excludePosIds,lastPosId,""); return getEmptyPosByStorage(storage,barcode,excludePosIds,lastPosId,"","");
} }
@Override @Override
public StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds,String lastPosId,String needMovePosName) throws ValidateException { public StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds,String lastPosId,String needMovePosName,String endStr) throws ValidateException {
Criteria c = Criteria.where("storageId").is(storage.getId()); Criteria c = Criteria.where("storageId").is(storage.getId());
...@@ -491,8 +491,12 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -491,8 +491,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
if (excludePosIds != null && !excludePosIds.isEmpty()) { if (excludePosIds != null && !excludePosIds.isEmpty()) {
c = c.and("id").nin(excludePosIds); c = c.and("id").nin(excludePosIds);
} }
if (StringUtils.isNotEmpty(needMovePosName)){
c.and("posName").nin(needMovePosName); if (StringUtils.isNotEmpty(needMovePosName) && StringUtils.isNotEmpty(endStr)) {
Criteria posNameCriteria = new Criteria();
String regex = ""+endStr+"$";
posNameCriteria.andOperator(Criteria.where("posName").ne(needMovePosName), Criteria.where("posName").regex(Pattern.compile(regex)));
c.andOperator(posNameCriteria);
} }
......
...@@ -822,7 +822,7 @@ public class TaskService { ...@@ -822,7 +822,7 @@ public class TaskService {
* @param barcode * @param barcode
* @return * @return
*/ */
public StoragePos findEmptyPosForMoveIn(List<Storage> storageList, Barcode barcode, String inRFID, String lastPosId,String needMovePosName) throws ValidateException { public StoragePos findEmptyPosForMoveIn(List<Storage> storageList, Barcode barcode, String inRFID, String lastPosId,String needMovePosName,String endStr) throws ValidateException {
Collection<DataLog> queueTasks = getQueueTasks(); Collection<DataLog> queueTasks = getQueueTasks();
List<DataLog> allTasksa = getFinishedTasks(); List<DataLog> allTasksa = getFinishedTasks();
if (!queueTasks.isEmpty()) { if (!queueTasks.isEmpty()) {
...@@ -928,14 +928,14 @@ public class TaskService { ...@@ -928,14 +928,14 @@ public class TaskService {
} }
}); });
return findEmptyPosInStorages(barcode, availbleStorageList, hasOutTaskStorageIds, lastPosId,needMovePosName); return findEmptyPosInStorages(barcode, availbleStorageList, hasOutTaskStorageIds, lastPosId,needMovePosName,endStr);
} }
private synchronized StoragePos findEmptyPosInStorages(Barcode barcode, List<Storage> availbleStorageList, final Set<String> hasOutTaskStorageIds, String lastPosId){ private synchronized StoragePos findEmptyPosInStorages(Barcode barcode, List<Storage> availbleStorageList, final Set<String> hasOutTaskStorageIds, String lastPosId){
return findEmptyPosInStorages(barcode,availbleStorageList,hasOutTaskStorageIds,lastPosId,""); return findEmptyPosInStorages(barcode,availbleStorageList,hasOutTaskStorageIds,lastPosId,"","");
} }
private synchronized StoragePos findEmptyPosInStorages(Barcode barcode, List<Storage> availbleStorageList, final Set<String> hasOutTaskStorageIds, String lastPosId,String needMovePosName) { private synchronized StoragePos findEmptyPosInStorages(Barcode barcode, List<Storage> availbleStorageList, final Set<String> hasOutTaskStorageIds, String lastPosId,String needMovePosName,String endStr) {
//第一遍查找,先不查找有出库任务的料仓 //第一遍查找,先不查找有出库任务的料仓
for (Storage storage : availbleStorageList) { for (Storage storage : availbleStorageList) {
...@@ -947,7 +947,7 @@ public class TaskService { ...@@ -947,7 +947,7 @@ public class TaskService {
try { try {
Collection<String> operatingPosIds = excludePosIds(); Collection<String> operatingPosIds = excludePosIds();
log.debug("尝试从[" + storage.getCid() + "]中为[" + barcode.getBarcode() + "]查找空位"); log.debug("尝试从[" + storage.getCid() + "]中为[" + barcode.getBarcode() + "]查找空位");
StoragePos pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId,needMovePosName); StoragePos pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId,needMovePosName,endStr);
if (pos != null) { if (pos != null) {
return pos; return pos;
} }
...@@ -960,7 +960,7 @@ public class TaskService { ...@@ -960,7 +960,7 @@ public class TaskService {
try { try {
Collection<String> operatingPosIds = excludePosIds(); Collection<String> operatingPosIds = excludePosIds();
log.debug("尝试从[" + storage.getCid() + "]中为[" + barcode.getBarcode() + "]查找空位"); log.debug("尝试从[" + storage.getCid() + "]中为[" + barcode.getBarcode() + "]查找空位");
StoragePos pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId,needMovePosName); StoragePos pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId,needMovePosName,endStr);
if (pos != null) { if (pos != null) {
return pos; return pos;
} }
......
...@@ -3,6 +3,7 @@ package com.neotel.smfcore.custom.Jkem21481.bean.query; ...@@ -3,6 +3,7 @@ package com.neotel.smfcore.custom.Jkem21481.bean.query;
import com.neotel.smfcore.common.annotation.QueryCondition; import com.neotel.smfcore.common.annotation.QueryCondition;
import com.neotel.smfcore.common.bean.BetweenData; import com.neotel.smfcore.common.bean.BetweenData;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
...@@ -12,6 +13,7 @@ public class ReturnStorageQueryCondition { ...@@ -12,6 +13,7 @@ public class ReturnStorageQueryCondition {
@QueryCondition(blurry = "orderNo,pn,returnBarcode,feederInfo") @QueryCondition(blurry = "orderNo,pn,returnBarcode,feederInfo")
private String blurry; private String blurry;
@QueryCondition(type = QueryCondition.Type.BETWEEN) @QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "createDate")
@DateTimeFormat(pattern = "yyyy-MM-dd HH")
private BetweenData<Date> createDate; private BetweenData<Date> createDate;
} }
...@@ -367,9 +367,8 @@ public class JkemController { ...@@ -367,9 +367,8 @@ public class JkemController {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
String barcodeStr = paramMap.get("barcode"); String barcodeStr = paramMap.get("barcode");
log.info(barcodeStr + "获取目的地信息"); log.info(barcodeStr + "获取目的地信息");
CodeBean codeBean = codeResolve.resolveSingleCode(barcodeStr); Barcode barcode = codeResolve.resolveOneValideBarcode(barcodeStr);
Barcode barcode = codeBean.getBarcode(); /*if(barcode == null){
if(barcode == null){
if (barcodeStr.endsWith("##")){ if (barcodeStr.endsWith("##")){
barcodeStr=barcodeStr.substring(0,barcodeStr.length()-2); barcodeStr=barcodeStr.substring(0,barcodeStr.length()-2);
codeBean=codeResolve.resolveSingleCode(barcodeStr); codeBean=codeResolve.resolveSingleCode(barcodeStr);
...@@ -378,7 +377,7 @@ public class JkemController { ...@@ -378,7 +377,7 @@ public class JkemController {
} }
if (barcode == null) { if (barcode == null) {
barcode = codeResolve.resolveOneValideBarcode(barcodeStr); barcode = codeResolve.resolveOneValideBarcode(barcodeStr);
} }*/
if (barcode != null) { if (barcode != null) {
log.info("解析到的条码信息为:"+barcode.getBarcode()); log.info("解析到的条码信息为:"+barcode.getBarcode());
...@@ -437,9 +436,8 @@ public class JkemController { ...@@ -437,9 +436,8 @@ public class JkemController {
String x = request.getParameter("x"); String x = request.getParameter("x");
String y = request.getParameter("y"); String y = request.getParameter("y");
log.info("IA 出库更新任务状态--barcode:{},status:{},loc:{},hSerial:{},outlet:{},boxSide:{},cid:{},outlet:{},x:{},y:{}", code, status, loc, hSerial, outlet, boxSide, cid, outlet, x, y); log.info("IA 出库更新任务状态--barcode:{},status:{},loc:{},hSerial:{},outlet:{},boxSide:{},cid:{},outlet:{},x:{},y:{}", code, status, loc, hSerial, outlet, boxSide, cid, outlet, x, y);
CodeBean codeBean = codeResolve.resolveSingleCode(code); Barcode barcode = codeResolve.resolveOneValideBarcode(code);
Barcode barcode = codeBean.getBarcode(); /*if(barcode == null){
if(barcode == null){
if (code.endsWith("##")){ if (code.endsWith("##")){
code=code.substring(0,code.length()-2); code=code.substring(0,code.length()-2);
codeBean=codeResolve.resolveSingleCode(code); codeBean=codeResolve.resolveSingleCode(code);
...@@ -448,7 +446,7 @@ public class JkemController { ...@@ -448,7 +446,7 @@ public class JkemController {
} }
if (barcode == null){ if (barcode == null){
barcode = codeResolve.resolveOneValideBarcode(code); barcode = codeResolve.resolveOneValideBarcode(code);
} }*/
if (barcode == null) { if (barcode == null) {
return ResultBean.newErrorResult(-1,"smfcore.error.barcode.invalid","{0}不是有效的条码",new String[]{code}); return ResultBean.newErrorResult(-1,"smfcore.error.barcode.invalid","{0}不是有效的条码",new String[]{code});
......
...@@ -80,8 +80,8 @@ public class StackerController { ...@@ -80,8 +80,8 @@ public class StackerController {
@ApiOperation("根据料串信息,获取可用的料仓") @ApiOperation("根据料串信息,获取可用的料仓")
@RequestMapping("/getAvailableStorageByStacker") @RequestMapping("/getAvailableStorageByStacker")
@AnonymousAccess @AnonymousAccess
public ResultBean getAvailableStorageByStacker(String stacker) { public ResultBean getAvailableStorageByStacker(String stacker,String storageCid) {
log.info("获取可用料仓[{}]信息", stacker); log.info("获取可用料仓[{}]信息,排除的cid为{}", stacker,storageCid);
if (StringUtils.isEmpty(stacker)) { if (StringUtils.isEmpty(stacker)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"stacker"}); return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"stacker"});
} }
...@@ -89,13 +89,13 @@ public class StackerController { ...@@ -89,13 +89,13 @@ public class StackerController {
if (!bindStacker) { if (!bindStacker) {
return ResultBean.newErrorResult(-1, "smfcore.valueNotFind", "未找到{0}[{1}]", new String[]{"stacker", stacker}); return ResultBean.newErrorResult(-1, "smfcore.valueNotFind", "未找到{0}[{1}]", new String[]{"stacker", stacker});
} }
List<String> availableStorageList = getAvailableStorage(stacker); List<String> availableStorageList = getAvailableStorage(stacker,storageCid);
return ResultBean.newOkResult(availableStorageList); return ResultBean.newOkResult(availableStorageList);
} }
private static final List<String> msdCidList = Arrays.asList("XLR4A","XLR4B","XLR5A","XLR5B","XLR6A","XLR6B"); private static final List<String> msdCidList = Arrays.asList("XLR4A","XLR4B","XLR5A","XLR5B","XLR6A","XLR6B");
private List<String> getAvailableStorage(String stacker) { private List<String> getAvailableStorage(String stacker,String storageCid) {
List<StackerCache> stackerCacheList = StackerUtil.getDetailByStacker(stacker); List<StackerCache> stackerCacheList = StackerUtil.getDetailByStacker(stacker);
//Msd和非Msd列表 //Msd和非Msd列表
List<StackerCache> msdList = new ArrayList<>(); List<StackerCache> msdList = new ArrayList<>();
...@@ -105,12 +105,25 @@ public class StackerController { ...@@ -105,12 +105,25 @@ public class StackerController {
} }
} }
if (msdList != null && !msdList.isEmpty()) { if (msdList != null && !msdList.isEmpty()) {
log.info("料串[{}]的msd不为空,信息为[{}],直接返回Msd列表", stacker, JSON.toJSONString(msdList)); List<String> resultList = new ArrayList<>();
return msdCidList; for (String msdCid : msdCidList) {
if (StringUtils.isNotEmpty(storageCid)){
if (storageCid.equals(msdCid));
continue;
}
resultList.add(msdCid);
}
log.info("料串[{}]的msd不为空,信息为[{}],直接返回Msd列表", stacker, JSON.toJSONString(resultList));
return resultList;
} }
//不是msd的料仓 //不是msd的料仓
List<Storage> noMsdStorageList = new ArrayList<>(); List<Storage> noMsdStorageList = new ArrayList<>();
for (Storage storage : dataCache.getAllStorage().values()) { for (Storage storage : dataCache.getAllStorage().values()) {
if (StringUtils.isNotEmpty(storageCid)){
if (storageCid.equals(storage.getCid()));
continue;
}
if (!msdCidList.contains(storage.getCid())) { if (!msdCidList.contains(storage.getCid())) {
noMsdStorageList.add(storage); noMsdStorageList.add(storage);
} }
...@@ -122,6 +135,10 @@ public class StackerController { ...@@ -122,6 +135,10 @@ public class StackerController {
//msd的料仓 //msd的料仓
List<Storage> msdStorageList = new ArrayList<>(); List<Storage> msdStorageList = new ArrayList<>();
for (Storage storage : dataCache.getAllStorage().values()) { for (Storage storage : dataCache.getAllStorage().values()) {
if (StringUtils.isNotEmpty(storageCid)){
if (storageCid.equals(storage.getCid()));
continue;
}
if (msdCidList.contains(storage.getCid())) { if (msdCidList.contains(storage.getCid())) {
msdStorageList.add(storage); msdStorageList.add(storage);
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!