Commit 4311ee91 zshaohui

立臻功能优化提交

1 个父辈 c14f8ff7
...@@ -551,14 +551,37 @@ public class LiteOrderCache { ...@@ -551,14 +551,37 @@ public class LiteOrderCache {
//PN //PN
do { do {
//首先按空闲料仓进行出库 //首先按空闲料仓进行出库
pos = storagePosManager.findPartNumberInStorages(freeStorageIds, partNumber, excludePosIds, checkoutType,orderItem.getBrand()); List<StoragePos> storagePosList = storagePosManager.findPartNumberListInStorages(freeStorageIds, partNumber, excludePosIds, checkoutType,orderItem.getBrand());
//如果为空的话,则出全部的 //如果为空的话,则出全部的
if (pos == null) { if (storagePosList == null || storagePosList.isEmpty()) {
pos = storagePosManager.findPartNumberInStorages(availableStorageIds, partNumber, excludePosIds, checkoutType,orderItem.getBrand()); storagePosList = storagePosManager.findPartNumberListInStorages(availableStorageIds, partNumber, excludePosIds, checkoutType,orderItem.getBrand());
}
//排序找到最早的
if (storagePosList != null && !storagePosList.isEmpty()) {
List<Barcode> barcodeList = new ArrayList<>();
for (StoragePos storagePos : storagePosList) {
barcodeList.add(storagePos.getBarcode());
}
if (barcodeList != null && !barcodeList.isEmpty()) {
barcodeList = barcodeList.stream().sorted(Comparator.comparing(Barcode::getAmount)
.thenComparing(Barcode::getExpireDate, Comparator.nullsFirst(Date::compareTo))
.thenComparing(Barcode::getCreateDate)).collect(Collectors.toList());
Barcode barcode = barcodeList.get(0);
for (StoragePos storagePos : storagePosList) {
if (storagePos.getBarcode().getBarcode().equals(barcode.getBarcode())) {
pos = storagePos;
break;
} }
}
}
}
if (pos == null) { if (pos == null) {
break; break;
} }
try { try {
smfApi.canPutInAfterResolve(pos.getBarcode()); smfApi.canPutInAfterResolve(pos.getBarcode());
} catch (ValidateException e) { } catch (ValidateException e) {
...@@ -1149,9 +1172,9 @@ public class LiteOrderCache { ...@@ -1149,9 +1172,9 @@ public class LiteOrderCache {
for (StoragePos pos : storagePosList) { for (StoragePos pos : storagePosList) {
for (Barcode barcode : pos.getBarcode().getSubCodeList()) { for (Barcode barcode : pos.getBarcode().getSubCodeList()) {
if (barcode.getPartNumber().equals(partNumber)) { if (barcode.getPartNumber().equals(partNumber)) {
if (barcode.getExpireDate() == null) { /*if (barcode.getExpireDate() == null) {
barcode.setExpireDate(new Date()); barcode.setExpireDate(new Date());
} }*/
barcodeList.add(barcode); barcodeList.add(barcode);
} }
} }
...@@ -1159,7 +1182,7 @@ public class LiteOrderCache { ...@@ -1159,7 +1182,7 @@ public class LiteOrderCache {
//按排序找到最先过期入库的partNumber //按排序找到最先过期入库的partNumber
if (barcodeList != null && !barcodeList.isEmpty()) { if (barcodeList != null && !barcodeList.isEmpty()) {
List<String> posNameList = barcodeList.stream().sorted(Comparator.comparing(Barcode::getExpireDate)).map(item -> item.getPosName()).distinct().collect(Collectors.toList()); List<String> posNameList = barcodeList.stream().sorted(Comparator.comparing(Barcode::getExpireDate, Comparator.nullsFirst(Date::compareTo)).reversed()).map(item -> item.getPosName()).distinct().collect(Collectors.toList());
for (String posName : posNameList) { for (String posName : posNameList) {
for (StoragePos pos : storagePosList) { for (StoragePos pos : storagePosList) {
if (StringUtils.isNotBlank(posName)) { if (StringUtils.isNotBlank(posName)) {
......
...@@ -88,4 +88,6 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> { ...@@ -88,4 +88,6 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
int countByQuery(Query query); int countByQuery(Query query);
List<StoragePos> findStoragePosByPartNumber(List<String> partNumberList); List<StoragePos> findStoragePosByPartNumber(List<String> partNumberList);
List<StoragePos> findPartNumberListInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType, String brand);
} }
...@@ -348,7 +348,7 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -348,7 +348,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
} }
Query q = new Query(c); Query q = new Query(c);
//Sort sort = getSortByCheckOutType(checkOutType); //Sort sort = getSortByCheckOutType(checkOutType);
Sort sort = Sort.by(Sort.Direction.ASC, "barcode.amount", "barcode.expireDate"); Sort sort = Sort.by(Sort.Direction.ASC, "barcode.amount", "barcode.expireDate","barcode.createDate");
q.with(sort); q.with(sort);
StoragePos pos = storagePosDao.findOne(q); StoragePos pos = storagePosDao.findOne(q);
if (pos == null) { if (pos == null) {
...@@ -820,4 +820,21 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -820,4 +820,21 @@ public class StoragePosManagerImpl implements IStoragePosManager {
.and("enabled").is(true).and("barcode.subCodeList.partNumber").in(partNumberList);//可用; .and("enabled").is(true).and("barcode.subCodeList.partNumber").in(partNumberList);//可用;
return storagePosDao.findByQuery(new Query(c)); return storagePosDao.findByQuery(new Query(c));
} }
@Override
public List<StoragePos> findPartNumberListInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType, String brand) {
Criteria c = Criteria.where("barcode.partNumber").is(pn)
.and("id").nin(excludePosIds)
.and("enabled").is(true)//可用
.and("barcode.lockId").is(null);//没有被锁定的仓位;
if (storageIdList != null) {
c = c.and("storageId").in(storageIdList);
}
if (StringUtils.isNotBlank(brand)) {
c.and("barcode.provider").is(brand);
}
Query q = new Query(c);
return storagePosDao.findByQuery(q);
}
} }
...@@ -566,7 +566,7 @@ public class OutLineController { ...@@ -566,7 +566,7 @@ public class OutLineController {
if (dataLogList != null && !dataLogList.isEmpty()){ if (dataLogList != null && !dataLogList.isEmpty()){
taskService.outTaskStatusChange(dataLogList); taskService.outTaskStatusChange(dataLogList);
} }
resultBean.setData(getBoxInfo(boxStr)); resultBean.setData(getBoxInfo(newboxStr));
if (hasBrand) { if (hasBrand) {
resultBean.setCode(3); resultBean.setCode(3);
return resultBean; return resultBean;
......
...@@ -87,7 +87,6 @@ public class OuterKanbanController { ...@@ -87,7 +87,6 @@ public class OuterKanbanController {
@RequestMapping("/getStationInAndOutAmout") @RequestMapping("/getStationInAndOutAmout")
@AnonymousAccess @AnonymousAccess
public ResultBean getStationInAndOutAmout() throws ParseException { public ResultBean getStationInAndOutAmout() throws ParseException {
List<StationInOutDto> resultList = new ArrayList<>();
if (stationInOutTime == null || System.currentTimeMillis() - stationInOutTime >= 1000 * 60 * 5) { if (stationInOutTime == null || System.currentTimeMillis() - stationInOutTime >= 1000 * 60 * 5) {
//先把缓存清空 //先把缓存清空
dtoList.clear(); dtoList.clear();
...@@ -96,11 +95,11 @@ public class OuterKanbanController { ...@@ -96,11 +95,11 @@ public class OuterKanbanController {
Date endDate = DateUtil.addDays(currentDate, 1); Date endDate = DateUtil.addDays(currentDate, 1);
for (int i = 1; i < 6; i++) { for (int i = 1; i < 6; i++) {
StationInOutDto dto = new StationInOutDto(); StationInOutDto dto = new StationInOutDto();
String stationName = "S" + i; String stationName = "s" + i;
dto.setName(stationName.toUpperCase(Locale.ROOT));
int inCount = dataLogManager.getInOutData(currentDate, endDate, OP.PUT_IN, stationName); int inCount = dataLogManager.getInOutData(currentDate, endDate, OP.PUT_IN, stationName);
dto.setInCount(inCount);
int outCount = dataLogManager.getInOutData(currentDate, endDate, OP.CHECKOUT, stationName); int outCount = dataLogManager.getInOutData(currentDate, endDate, OP.CHECKOUT, stationName);
dto.setName(stationName.toUpperCase(Locale.ROOT));
dto.setInCount(inCount);
dto.setOutCount(outCount); dto.setOutCount(outCount);
dtoList.add(dto); dtoList.add(dto);
} }
......
...@@ -4,14 +4,16 @@ server: ...@@ -4,14 +4,16 @@ server:
api: api:
name: Lizhen name: Lizhen
inCheckUrl: #http://172.30.170.148:8001/Npm/WmsCheckReelfob #禁用料 inCheckUrl: #http://172.30.170.148:8001/Npm/WmsCheckReelfob #禁用料
batchCheckUrl: #http://172.30.60.117:8001/Npm/WmsCheckReelfob_Batch #批量禁用料
outNotifyUrl: #http://172.30.170.148:8082/SmtAutoWH/Save2DReelInfo #保存物料(外仓配置) outNotifyUrl: #http://172.30.170.148:8082/SmtAutoWH/Save2DReelInfo #保存物料(外仓配置)
outNotifyUrlPK: #http://172.30.170.148:8001/Sct/SaveReelInfo #PK发料保存(外仓配置) outNotifyUrlPK: #http://172.30.170.148:8001/Sct/SaveReelInfo #PK发料保存(外仓配置)
inNotifyUrl: #http://172.30.170.148:8082/SmtAutoWH/Save2DReelInfo #保存物料(内仓配置) inNotifyUrl: #http://172.30.170.148:8082/SmtAutoWH/Save2DReelInfo #保存物料(内仓配置)
fetchOrderUrl: #http://172.30.170.148:8082/SmtAutoWH/GetWoPickingList #获取工单 fetchOrderUrl: #http://172.30.170.148:8082/SmtAutoWH/GetWoPickingList #获取工单
barcodeInfoUrl: #http://172.30.170.148:8001/Sct/GetReelInfo #mes数量 barcodeInfoUrl: #http://172.30.170.148:8001/Sct/GetReelInfo #mes数量
fetchGRUrl: #http://10.42.25.18:8082/api/wcs/fetchGR #gr标签 fetchGRUrl: #http://10.42.25.199:8082/api/wcs/fetchGR #gr标签
brandQtyUrl: #http://10.42.25.18:8082/api/wcs/brandQty #gr标签满卷数 brandQtyUrl: #http://172.30.170.199:8082/api/wcs/brandQty #gr标签满卷数
importUrl: #http://localhost:8080/smf-core/ext/getDatalogs #内仓导入外仓picking虚拟仓数据 importUrl: #http://10.42.222.52:8001/smf-core/ext/forward/getDataLogs #内仓导入外仓picking虚拟仓数据
checkReelMeasure: #http://172.30.60.117:8001/Sct/CheckReelMeasure #外仓散料仓量测接口
plant: W337 plant: W337
werks: W337 werks: W337
outerFactory: B15 outerFactory: B15
...@@ -31,6 +33,27 @@ lizhen: ...@@ -31,6 +33,27 @@ lizhen:
line: A05-5FSMT-13S,A05-5FSMT-03S,A05-5FSMT-02S,A05-5FSMT-12S #,A05-5FARF-06,A05-5FSMT-01S,A05-5FSMT-11S line: A05-5FSMT-13S,A05-5FSMT-03S,A05-5FSMT-02S,A05-5FSMT-12S #,A05-5FARF-06,A05-5FSMT-01S,A05-5FSMT-11S
url: http://172.30.97.63:8001/smf-core/api/Mes/machineCallMaterial url: http://172.30.97.63:8001/smf-core/api/Mes/machineCallMaterial
#转发地址
forward:
f2:
name: 2F
url: http://172.30.88.19:8001/smf-core
f3:
name: 3F
url: http://172.30.97.99:8001/smf-core
f5:
name: 5F
url: http://172.30.97.63:8001/smf-core
b15:
name: B15
url: http://10.42.176.209:8001/smf-core
# 文件存储路径 # 文件存储路径
file: file:
mac: ~/file/ mac: ~/file/
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!