Commit 9b717212 zshaohui

1.立臻看板功能提交

2.缺料预警限制30个去掉
3.料仓已满,不增加出库任务
1 个父辈 c0583e42
正在显示 24 个修改的文件 包含 311 行增加67 行删除
...@@ -152,6 +152,8 @@ public class DataInitManager { ...@@ -152,6 +152,8 @@ public class DataInitManager {
//功能菜单(不包含父级菜单),key为path //功能菜单(不包含父级菜单),key为path
Map<String,Menu> functionMenuMap = new HashMap<>(); Map<String,Menu> functionMenuMap = new HashMap<>();
//巴城电子看板
addNewFunctionMenu(0,null,"bcElecKanban", "电子看板","bcElecKanban", "elecKanban/index","kanban",functionMenuMap);
//AGV看板 //AGV看板
addNewFunctionMenu(1,null,"agvkanban", "AGV看板","agvkanban", "agv/agvkanban/index","agv",functionMenuMap); addNewFunctionMenu(1,null,"agvkanban", "AGV看板","agvkanban", "agv/agvkanban/index","agv",functionMenuMap);
...@@ -313,7 +315,7 @@ public class DataInitManager { ...@@ -313,7 +315,7 @@ public class DataInitManager {
addNewFunctionMenu(134,null,"virWarehous","虚拟仓","virWarehous","virWarehous/virWarehous/index","feeding",functionMenuMap); addNewFunctionMenu(134,null,"virWarehous","虚拟仓","virWarehous","virWarehous/virWarehous/index","feeding",functionMenuMap);
//内外仓电子看板 //内外仓电子看板
addNewFunctionMenu(1,null,"elecKanban", "电子看板","elecKanban", "elecKanban/index","kanban",functionMenuMap); //addNewFunctionMenu(1,null,"elecKanban", "电子看板","elecKanban", "elecKanban/index","kanban",functionMenuMap);
addNewFunctionMenu(135,null,"sysInventory", "盘点出库","sysInventory", "system/sysInventory/index","mIDList",functionMenuMap); addNewFunctionMenu(135,null,"sysInventory", "盘点出库","sysInventory", "system/sysInventory/index","mIDList",functionMenuMap);
//汇总报表 //汇总报表
......
...@@ -349,10 +349,21 @@ public class DeviceController { ...@@ -349,10 +349,21 @@ public class DeviceController {
} }
} else { } else {
boolean hasPos = false;
for (Storage storage : storageList) {
if (storage.canPutIn(barcode.getPlateSize(),barcode.getHeight())) {
resultMap.put("result", "103");
errorMsg = "[" + barcode.getBarcode() + "]料仓已满,等待物料出库重新分配新库位,未找到可用的[" + barcode.getPlateSize() + "x" + barcode.getHeight() + "]仓位";
resultMap.put("msg", errorMsg);
hasPos = true;
break;
}
}
if (!hasPos){
resultMap.put("result", "104"); resultMap.put("result", "104");
errorMsg = "[" + barcode.getBarcode() + "]未找到可用的[" + barcode.getPlateSize() + "x" + barcode.getHeight() + "]仓位"; errorMsg = "[" + barcode.getBarcode() + "]未找到可用的[" + barcode.getPlateSize() + "x" + barcode.getHeight() + "]仓位";
resultMap.put("msg", errorMsg); resultMap.put("msg", errorMsg);
}
} }
} catch (ValidateException ve) { } catch (ValidateException ve) {
errorMsg = ve.getMessage(); errorMsg = ve.getMessage();
......
...@@ -178,7 +178,7 @@ public class BoxKanbanController { ...@@ -178,7 +178,7 @@ public class BoxKanbanController {
String blurry = criteria.getBlurry(); String blurry = criteria.getBlurry();
if (ObjectUtil.isNotEmpty(blurry)) { if (ObjectUtil.isNotEmpty(blurry)) {
String[] blurrys = blurry.split(","); String[] blurrys = blurry.split(",");
String[] valueArray = new String[]{datalog.getPosName(), datalog.getStorageName(), datalog.getCid(), datalog.getPartNumber(), datalog.getBarcode(), datalog.getSourceName()}; String[] valueArray = new String[]{datalog.getPosName(), datalog.getStorageName(), datalog.getCid(), datalog.getPartNumber(), datalog.getBarcode(), datalog.getSourceName(),datalog.getExport()};
for (String s : blurrys) { for (String s : blurrys) {
if(ObjectUtil.isNotEmpty(s)){ if(ObjectUtil.isNotEmpty(s)){
for (String v : for (String v :
......
...@@ -93,6 +93,9 @@ public class BoxTaskDto { ...@@ -93,6 +93,9 @@ public class BoxTaskDto {
@ApiModelProperty("亮灯料架颜色") @ApiModelProperty("亮灯料架颜色")
private String lightColor = ""; private String lightColor = "";
@ApiModelProperty("出口位置")
private String export = "";
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Date createDate = new Date(); private Date createDate = new Date();
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
......
...@@ -25,6 +25,7 @@ import com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager; ...@@ -25,6 +25,7 @@ import com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager; import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager;
import com.neotel.smfcore.core.order.service.po.LiteOrder; import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.order.service.po.LiteOrderItem; import com.neotel.smfcore.core.order.service.po.LiteOrderItem;
import com.neotel.smfcore.core.storage.bean.InventoryItem;
import com.neotel.smfcore.core.storage.enums.CHECKOUT_TYPE; import com.neotel.smfcore.core.storage.enums.CHECKOUT_TYPE;
import com.neotel.smfcore.core.storage.enums.DeviceType; import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager; import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
...@@ -36,6 +37,7 @@ import com.neotel.smfcore.core.system.util.TaskService; ...@@ -36,6 +37,7 @@ import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.LizhenApi; import com.neotel.smfcore.custom.lizhen.LizhenApi;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.custom.lizhen.innerBox.util.StorageExportUtil; import com.neotel.smfcore.custom.lizhen.innerBox.util.StorageExportUtil;
import com.neotel.smfcore.custom.lizhen.report.bean.query.ReportQueryCondition;
import com.sun.org.apache.regexp.internal.RE; import com.sun.org.apache.regexp.internal.RE;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -494,7 +496,7 @@ public class LiteOrderCache { ...@@ -494,7 +496,7 @@ public class LiteOrderCache {
} }
//获取是否有出料口 //获取是否有出料口
String exportStr = StorageExportUtil.getExportByOrderNo(cacheOrder.getOrderNo()); String exportStr = StorageExportUtil.getExportByOrderNo(cacheOrder.getOrderNo(),true);
if (StringUtils.isBlank(exportStr)) { if (StringUtils.isBlank(exportStr)) {
log.info(cacheOrder.getOrderNo() + "没有空闲的出料口"); log.info(cacheOrder.getOrderNo() + "没有空闲的出料口");
return "没有空闲的出料口"; return "没有空闲的出料口";
...@@ -634,6 +636,7 @@ public class LiteOrderCache { ...@@ -634,6 +636,7 @@ public class LiteOrderCache {
task.setH(pos.getBarcode().getHeight()); task.setH(pos.getBarcode().getHeight());
task.setDescribe(pos.getBarcode().getDescribe()); task.setDescribe(pos.getBarcode().getDescribe());
task.setKeeperCode(pos.getBarcode().getKeeperCode()); task.setKeeperCode(pos.getBarcode().getKeeperCode());
task.setExport(exportStr);
// task = dataLogDao.save(task); // task = dataLogDao.save(task);
taskService.addTaskToExecute(task); taskService.addTaskToExecute(task);
} }
...@@ -652,16 +655,21 @@ public class LiteOrderCache { ...@@ -652,16 +655,21 @@ public class LiteOrderCache {
if (taskReelCount <= 0) { if (taskReelCount <= 0) {
finishedOrderTasks(cacheOrder); finishedOrderTasks(cacheOrder);
} }
//任务数大于0,更新出口位置
if (taskReelCount > 0) {
cacheOrder.setExport(exportStr);
}
liteOrderManager.save(cacheOrder); liteOrderManager.save(cacheOrder);
liteOrderMap.put(cacheOrder.getOrderNo(), cacheOrder); liteOrderMap.put(cacheOrder.getOrderNo(), cacheOrder);
if (taskReelCount <= 0) { if (taskReelCount <= 0) {
//return "工单无可执行的任务"; //return "工单无可执行的任务";
return "smfcore.order.out.noTask"; return "smfcore.order.out.noTask";
} }
log.info(cacheOrder.getOrderNo()+"分配出料口为:"+exportStr+"line为:"+cacheOrder.getLine()+"剩余任务数为:"+taskReelCount); log.info(cacheOrder.getOrderNo()+"分配出料口为:"+exportStr+"line为:"+cacheOrder.getLine()+"剩余任务数为:"+taskReelCount);
StorageExportUtil.updateExport(exportStr, cacheOrder.getOrderNo(), cacheOrder.getLine(), taskReelCount); StorageExportUtil.updateExport(exportStr, cacheOrder.getOrderNo(), cacheOrder.getLine(), taskReelCount);
return ""; return "";
...@@ -1210,4 +1218,47 @@ public class LiteOrderCache { ...@@ -1210,4 +1218,47 @@ public class LiteOrderCache {
} }
return storagePos; return storagePos;
} }
public List<LiteOrderItem> getLackItems(Collection<LiteOrder> liteOrders) {
List<LiteOrderItem> lackItems = new ArrayList<>();
//排除虚拟仓的
List<String> storageIds = new ArrayList<>();
for (Storage storage : dataCache.getAllStorage().values()) {
//if (!storage.isVirtual()) {
storageIds.add(storage.getId());
//}
}
//得到库存信息
Map<String, InventoryItem> inventoryMap = dataCache.getAllInventory(storageIds, null);
if (inventoryMap != null) {
for (LiteOrder liteOrder : liteOrders) {
//状态是未关闭的,未出库的
if (!liteOrder.isClosed()) {
List<LiteOrderItem> items = liteOrder.getOrderItems();
for (LiteOrderItem orderItem : items) {
for (DataLog dataLog : taskService.getAllTasks()) {
if (orderItem.getId().equals(dataLog.getSubSourceId()) && !dataLog.isCancel()) {
continue;
}
}
if (orderItem.getOutReelCount() < orderItem.getNeedReelCount()) {
InventoryItem inventoryItem = inventoryMap.get(orderItem.getPn());
if (inventoryItem != null) {
if (inventoryItem.getStockReel() /*- inventoryItem.getLockReel()*/ - inventoryItem.getBindReel() > 0) {
inventoryItem.setBindReel(inventoryItem.getBindReel() + 1);
} else {
lackItems.add(orderItem);
}
inventoryMap.put(orderItem.getPn(), inventoryItem);
} else {
lackItems.add(orderItem);
}
}
}
}
}
}
return lackItems;
}
} }
...@@ -321,6 +321,8 @@ public class OrderController { ...@@ -321,6 +321,8 @@ public class OrderController {
public OrderDto detial(@RequestParam(required = false) String id, @RequestParam(required = false) String orderNo, public OrderDto detial(@RequestParam(required = false) String id, @RequestParam(required = false) String orderNo,
@RequestParam(required = false) String warehouseCode,@RequestParam(required = false) String brand) { @RequestParam(required = false) String warehouseCode,@RequestParam(required = false) String brand) {
List<LiteOrderItem> lackItemList = liteOrderCache.getLackItems(liteOrderCache.getAllLiteOrder());
if (!ObjectUtils.isEmpty(id)) { if (!ObjectUtils.isEmpty(id)) {
LiteOrder liteOrder = liteOrderManager.get(id); LiteOrder liteOrder = liteOrderManager.get(id);
if (liteOrder != null) { if (liteOrder != null) {
...@@ -338,9 +340,20 @@ public class OrderController { ...@@ -338,9 +340,20 @@ public class OrderController {
continue; continue;
} }
} }
if (!dto.isClosed()) {
orderItem.setLack(isLack(lackItemList, orderItem));
}
orderItemsByWarehouseCode.add(orderItem); orderItemsByWarehouseCode.add(orderItem);
} }
if (orderItemsByWarehouseCode != null && !orderItemsByWarehouseCode.isEmpty()){
orderItemsByWarehouseCode = orderItemsByWarehouseCode.stream().sorted(Comparator.comparing(LiteOrderItem :: isLack).reversed()).collect(Collectors.toList());
}
dto.setOrderItems(orderItemMapper.toDto(orderItemsByWarehouseCode)); dto.setOrderItems(orderItemMapper.toDto(orderItemsByWarehouseCode));
if (dto.isClosed() && dto.getStatus() != LITEORDER_STATUS.CLOSED) {
dto.setClosed(false);
}
return dto; return dto;
} }
} else if (!ObjectUtils.isEmpty(orderNo)) { } else if (!ObjectUtils.isEmpty(orderNo)) {
...@@ -360,9 +373,20 @@ public class OrderController { ...@@ -360,9 +373,20 @@ public class OrderController {
continue; continue;
} }
} }
if (!dto.isClosed()) {
orderItem.setLack(isLack(lackItemList, orderItem));
}
orderItemsByWarehouseCode.add(orderItem); orderItemsByWarehouseCode.add(orderItem);
} }
if (orderItemsByWarehouseCode != null && !orderItemsByWarehouseCode.isEmpty()){
orderItemsByWarehouseCode = orderItemsByWarehouseCode.stream().sorted(Comparator.comparing(LiteOrderItem :: isLack).reversed()).collect(Collectors.toList());
}
dto.setOrderItems(orderItemMapper.toDto(orderItemsByWarehouseCode)); dto.setOrderItems(orderItemMapper.toDto(orderItemsByWarehouseCode));
if (dto.isClosed() && dto.getStatus() != LITEORDER_STATUS.CLOSED) {
dto.setClosed(false);
}
return dto; return dto;
} }
} }
...@@ -370,6 +394,17 @@ public class OrderController { ...@@ -370,6 +394,17 @@ public class OrderController {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"orderNo"}); throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"orderNo"});
} }
private boolean isLack(List<LiteOrderItem> lackItemList, LiteOrderItem item) {
if (lackItemList != null && !lackItemList.isEmpty()) {
for (LiteOrderItem orderItem : lackItemList) {
if (orderItem.getId().equals(item.getId())) {
return true;
}
}
}
return false;
}
@ApiOperation("修改工单数量") @ApiOperation("修改工单数量")
@PostMapping(value = "/updateNum") @PostMapping(value = "/updateNum")
......
...@@ -110,4 +110,7 @@ public class OrderDto implements Serializable { ...@@ -110,4 +110,7 @@ public class OrderDto implements Serializable {
@ApiModelProperty("工单完成时间") @ApiModelProperty("工单完成时间")
private Date finishDate; private Date finishDate;
@ApiModelProperty("出口位置")
private String export = "";
} }
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
@Data @Data
public class OrderQueryCondition { public class OrderQueryCondition {
@QueryCondition(blurry = "orderNo") @QueryCondition(blurry = "orderNo,export")
private String blurry; private String blurry;
@QueryCondition(type = QueryCondition.Type.BETWEEN) @QueryCondition(type = QueryCondition.Type.BETWEEN)
......
...@@ -151,6 +151,10 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -151,6 +151,10 @@ public class LiteOrder extends BasePo implements Serializable {
*/ */
private Date finishDate; private Date finishDate;
/**
* 出口位置
*/
private String export = "";
public void setClosed(boolean value){ public void setClosed(boolean value){
this.closed=value; this.closed=value;
......
...@@ -143,6 +143,9 @@ public class TaskDto implements Serializable { ...@@ -143,6 +143,9 @@ public class TaskDto implements Serializable {
@ApiModelProperty("如果是出库任务,需要记录入库时间") @ApiModelProperty("如果是出库任务,需要记录入库时间")
private Date putInDate; private Date putInDate;
@ApiModelProperty("出口位置")
private String export = "";
public String getTaskColor() { public String getTaskColor() {
if (ObjectUtil.isNotEmpty(lightColor)) { if (ObjectUtil.isNotEmpty(lightColor)) {
return "#" + lightColor; return "#" + lightColor;
......
...@@ -14,7 +14,7 @@ import java.util.Date; ...@@ -14,7 +14,7 @@ import java.util.Date;
@ApiModel("查询条件") @ApiModel("查询条件")
public class TaskQueryCondition { public class TaskQueryCondition {
@QueryCondition(blurry = "barcode,partNumber,posName,sourceName,subSourceInfo,memo") @QueryCondition(blurry = "barcode,partNumber,posName,sourceName,subSourceInfo,memo,export")
@ApiModelProperty("模糊搜索") @ApiModelProperty("模糊搜索")
private String blurry; private String blurry;
......
...@@ -362,6 +362,12 @@ public class DataLog extends BasePo implements Serializable { ...@@ -362,6 +362,12 @@ public class DataLog extends BasePo implements Serializable {
*/ */
private int height = 0; private int height = 0;
/**
* 出口位置
*/
private String export = "";
public String getBarcode() { public String getBarcode() {
if(barcode == null){ if(barcode == null){
return ""; return "";
......
...@@ -22,4 +22,9 @@ public class StorageExport { ...@@ -22,4 +22,9 @@ public class StorageExport {
* 当前料仓剩余未出的需求单数量 * 当前料仓剩余未出的需求单数量
*/ */
private int remainTaskCount = 0; private int remainTaskCount = 0;
/**
* 是否禁用
*/
private boolean disable = false;
} }
...@@ -147,7 +147,7 @@ public class InnerBoxRestController { ...@@ -147,7 +147,7 @@ public class InnerBoxRestController {
List<DataLog> dataLogList = taskService.getAllTasks(); List<DataLog> dataLogList = taskService.getAllTasks();
for (DataLog dataLog : dataLogList) { for (DataLog dataLog : dataLogList) {
if(StringUtils.isNotBlank(dataLog.getSourceId())){ if(StringUtils.isNotBlank(dataLog.getSourceId())){
if (dataLog.getSourceId().equals(opTask.getSourceId())){ if (dataLog.getSourceId().equals(opTask.getSourceId()) && !dataLog.getBarcode().equals(opTask.getBarcode())){
if (!dataLog.isFinished()){ if (!dataLog.isFinished()){
remainTaskCount ++; remainTaskCount ++;
} }
...@@ -449,11 +449,11 @@ public class InnerBoxRestController { ...@@ -449,11 +449,11 @@ public class InnerBoxRestController {
String sourceName = dataLog.getSourceName(); String sourceName = dataLog.getSourceName();
String sourceId = dataLog.getSourceId(); String sourceId = dataLog.getSourceId();
if (StringUtils.isNotBlank(sourceId) && StringUtils.isNotBlank(sourceName)) { if (StringUtils.isNotBlank(sourceId) && StringUtils.isNotBlank(sourceName)) {
String export = StorageExportUtil.getExportByOrderNo(sourceName); //String export = StorageExportUtil.getExportByOrderNo(sourceName,false);
log.info(dataLog.getBarcode() + "获取出料口信息为:" + export); log.info(dataLog.getBarcode() + "获取出料口信息为:" + dataLog.getExport());
resultMap.put("export", export); resultMap.put("export", dataLog.getExport());
} else { } else {
String export = StorageExportUtil.getExportByOrderNo(""); String export = StorageExportUtil.getExportByOrderNo("",false);
log.info(dataLog.getBarcode() + "手动出库获取出料口信息为:" + export); log.info(dataLog.getBarcode() + "手动出库获取出料口信息为:" + export);
resultMap.put("export", export); resultMap.put("export", export);
} }
...@@ -491,19 +491,20 @@ public class InnerBoxRestController { ...@@ -491,19 +491,20 @@ public class InnerBoxRestController {
@AnonymousAccess @AnonymousAccess
public ResultBean getExport(String export) { public ResultBean getExport(String export) {
StorageExport storageExport = StorageExportUtil.getExport(export); StorageExport storageExport = StorageExportUtil.getExport(export);
if (StringUtils.isNotBlank(storageExport.getHSerial())){ if (StringUtils.isNotBlank(storageExport.getHSerial())) {
int remainTaskCount = 0; int remainTaskCount = 0;
List<DataLog> allTasks = taskService.getAllTasks(); List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog dataLog : allTasks) { for (DataLog dataLog : allTasks) {
if (dataLog.isCheckOutTask() && storageExport.getHSerial().equals(dataLog.getSourceName())){ if (dataLog.isCheckOutTask() && storageExport.getHSerial().equals(dataLog.getSourceName())) {
if (!dataLog.isFinished() && !dataLog.isCancel()){ if (!dataLog.isFinished() && !dataLog.isCancel()) {
remainTaskCount ++; remainTaskCount++;
} }
} }
} }
storageExport.setRemainTaskCount(remainTaskCount); storageExport.setRemainTaskCount(remainTaskCount);
StorageExportUtil.updateExport(export,storageExport); StorageExportUtil.updateExport(export, storageExport);
} }
log.info(export + "获取出料口信息为:" + JSON.toJSONString(storageExport));
return ResultBean.newOkResult(storageExport); return ResultBean.newOkResult(storageExport);
} }
...@@ -525,18 +526,43 @@ public class InnerBoxRestController { ...@@ -525,18 +526,43 @@ public class InnerBoxRestController {
public ResultBean boxOutStation(String export) { public ResultBean boxOutStation(String export) {
StorageExport storageExport = StorageExportUtil.getExport(export); StorageExport storageExport = StorageExportUtil.getExport(export);
String hSerial = storageExport.getHSerial(); String hSerial = storageExport.getHSerial();
StorageExport outStationExport = new StorageExport();
outStationExport.setDisable(storageExport.isDisable());
outStationExport.setLine(storageExport.getLine());
outStationExport.setHSerial(hSerial);
outStationExport.setRemainTaskCount(storageExport.getRemainTaskCount());
if (StringUtils.isNotBlank(hSerial)) { if (StringUtils.isNotBlank(hSerial)) {
LiteOrder order = liteOrderCache.getOrderSortItems(hSerial); LiteOrder order = liteOrderCache.getOrderSortItems(hSerial);
if (order != null) { if (order != null) {
//工单未结束,满箱离开
if (!order.isClosed() && !order.isTaskFinished()) { if (!order.isClosed() && !order.isTaskFinished()) {
return ResultBean.newErrorResult(-1, "", export + "工位任务未完成,暂不离开"); StorageExportUtil.updateExport(export + StorageExportUtil.OUT_STATION, outStationExport);
log.info(hSerial+":工单未结束,满箱离开,信息为:"+ JSON.toJSONString(outStationExport));
return ResultBean.newOkResult(storageExport);
} }
} }
} }
StorageExportUtil.clearExport(export); StorageExportUtil.clearExport(export);
StorageExportUtil.updateExport(export + StorageExportUtil.OUT_STATION, storageExport); StorageExportUtil.updateExport(export + StorageExportUtil.OUT_STATION, outStationExport);
log.info(export + StorageExportUtil.OUT_STATION + "料箱离开工位,信息为:" + JSON.toJSONString(storageExport)); log.info(export + StorageExportUtil.OUT_STATION + "料箱离开工位,信息为:" + JSON.toJSONString(outStationExport));
return ResultBean.newOkResult(storageExport); return ResultBean.newOkResult(outStationExport);
}
@ApiOperation("禁用出料口")
@AnonymousAccess
@RequestMapping("/disableExport")
public ResultBean disableExport(String name, int type) {
StorageExport storageExport = StorageExportUtil.getExport(name);
if (type == 1) {
storageExport.setDisable(true);
} else {
storageExport.setDisable(false);
}
StorageExportUtil.updateExport(name, storageExport);
return ResultBean.newOkResult("");
} }
......
...@@ -69,7 +69,7 @@ public class PreWarningItemCache { ...@@ -69,7 +69,7 @@ public class PreWarningItemCache {
List<PreWarningItem> lineItems = new ArrayList<>(); List<PreWarningItem> lineItems = new ArrayList<>();
String firstItemLine = ""; String firstItemLine = "";
//每次最多出多少盘 //每次最多出多少盘
int maxReelCount = 30; //int maxReelCount = 30;
//如果取不到,从数据库中取 //如果取不到,从数据库中取
if (queueItemList == null || queueItemList.isEmpty()) { if (queueItemList == null || queueItemList.isEmpty()) {
queueItemList = preWarningItemManager.findAll(); queueItemList = preWarningItemManager.findAll();
...@@ -93,9 +93,9 @@ public class PreWarningItemCache { ...@@ -93,9 +93,9 @@ public class PreWarningItemCache {
if (itemLine.equals(firstItemLine)) { if (itemLine.equals(firstItemLine)) {
lineItems.add(preWarningItem); lineItems.add(preWarningItem);
} }
if (lineItems.size() >= maxReelCount) { /*if (lineItems.size() >= maxReelCount) {
break; break;
} }*/
} }
} }
if (!lineItems.isEmpty()) { if (!lineItems.isEmpty()) {
...@@ -150,6 +150,7 @@ public class PreWarningItemCache { ...@@ -150,6 +150,7 @@ public class PreWarningItemCache {
liteOrder.setTotalTaskReelCount(orderItems.size()); liteOrder.setTotalTaskReelCount(orderItems.size());
liteOrder.setTaskReelCount(orderItems.size()); liteOrder.setTaskReelCount(orderItems.size());
liteOrder = liteOrderManager.createWithItems(liteOrder); liteOrder = liteOrderManager.createWithItems(liteOrder);
log.info("生成工单信息为:"+liteOrder.getOrderNo());
liteOrderCache.addOrderToMap(liteOrder); liteOrderCache.addOrderToMap(liteOrder);
} }
//工单生成后,从缓存中清除 //工单生成后,从缓存中清除
......
...@@ -5,13 +5,18 @@ import com.neotel.smfcore.common.utils.StringUtils; ...@@ -5,13 +5,18 @@ import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.lizhen.innerBox.bean.StorageExport; import com.neotel.smfcore.custom.lizhen.innerBox.bean.StorageExport;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import java.util.LinkedHashSet;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Slf4j @Slf4j
@Component @Component
...@@ -26,14 +31,14 @@ public class StorageExportUtil { ...@@ -26,14 +31,14 @@ public class StorageExportUtil {
public static final String OUT_STATION = "_outStation"; public static final String OUT_STATION = "_outStation";
private static String disableExport = ""; /* private static String disableExport = "";
@Value("${disable.export}") @Value("${disable.export}")
void setDisableExport(String export) { void setDisableExport(String export) {
if (StringUtils.isNotBlank(export)) { if (StringUtils.isNotBlank(export)) {
disableExport = export; disableExport = export;
} }
} }*/
private static String manualCheckoutExport = ""; private static String manualCheckoutExport = "";
...@@ -47,29 +52,35 @@ public class StorageExportUtil { ...@@ -47,29 +52,35 @@ public class StorageExportUtil {
//出料口名称 //出料口名称
private final static String[] exportStr = new String[]{"MU1_1", "MU1_2", "MU2_1", "MU4_1", "MU4_2", "MU5_1", "MU5_2"}; private final static String[] exportStrArr = new String[]{"MU1_1", "MU1_2", "MU2_1", "MU3_1", "MU4_1", "MU4_2", "MU5_1", "MU5_2"};
//料仓前缀 //料仓前缀
private static final String EXPORT_PREFIX = "Storage_Export"; public static final String EXPORT_PREFIX = "Storage_Export";
//出口信息缓存 //出口信息缓存
private static Map<String, StorageExport> exportMap = new ConcurrentHashMap<>(); public static Map<String, StorageExport> exportMap = new ConcurrentHashMap<>();
//初始化出料口信息 //初始化出料口信息
@PostConstruct @PostConstruct
void initExport() { void initExport() {
for (String export : exportStr) { for (String exportStr : exportStrArr) {
StorageExport storageExport = dataCache.getCache(EXPORT_PREFIX + "_" + export); StorageExport exportStation = dataCache.getCache(EXPORT_PREFIX + "_" + exportStr);
if (storageExport == null) { if (exportStation == null) {
storageExport = new StorageExport(); exportStation = new StorageExport();
}
exportMap.put(exportStr, exportStation);
String exportOutStationKey = exportStr + OUT_STATION;
StorageExport exportOutStation = dataCache.getCache(EXPORT_PREFIX + "_" + exportOutStationKey);
if (exportOutStation != null) {
exportMap.put(exportOutStationKey, exportStation);
} }
exportMap.put(export, storageExport); //dataCache.updateCache(EXPORT_PREFIX + "_" + export, storageExport);
dataCache.updateCache(EXPORT_PREFIX+"_"+export,storageExport);
} }
} }
//根据工单号,获取目的地信息 //根据工单号,获取目的地信息
public static synchronized String getExportByOrderNo(String orderNo) { public static synchronized String getExportByOrderNo(String orderNo,boolean hasSameOrder) {
if (StringUtils.isBlank(orderNo)) { if (StringUtils.isBlank(orderNo)) {
return manualCheckoutExport; return manualCheckoutExport;
} }
...@@ -78,23 +89,41 @@ public class StorageExportUtil { ...@@ -78,23 +89,41 @@ public class StorageExportUtil {
for (Map.Entry<String, StorageExport> entry : exportMap.entrySet()) { for (Map.Entry<String, StorageExport> entry : exportMap.entrySet()) {
StorageExport export = entry.getValue(); StorageExport export = entry.getValue();
if (orderNo.equals(export.getHSerial())) { if (orderNo.equals(export.getHSerial())) {
if (hasSameOrder) {
//log.info(orderNo + "出库时,上一次工单未拉走,暂不出库");
return "";
}
exportStr = entry.getKey(); exportStr = entry.getKey();
break; break;
} }
} }
//判断是否为新工单 //判断是否为新工单
if (StringUtils.isBlank(exportStr)) { if (StringUtils.isBlank(exportStr)) {
for (Map.Entry<String, StorageExport> entry : exportMap.entrySet()) {
//按key进行升序排列
Set<Map.Entry<String, StorageExport>> sortMap = exportMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toCollection(LinkedHashSet::new));
for (Map.Entry<String, StorageExport> entry : sortMap) {
//判断是否有禁用工位信息 //判断是否有禁用工位信息
if (StringUtils.isNotBlank(disableExport)) { /*if (StringUtils.isNotBlank(disableExport)) {
if (disableExport.contains(entry.getKey())) { if (disableExport.contains(entry.getKey())) {
continue; continue;
} }
}*/
//分配工单时候,手动出库排除
if (StringUtils.isNotBlank(manualCheckoutExport)){
if (entry.getKey().startsWith(manualCheckoutExport)){
continue;
}
} }
if (entry.getKey().contains(StorageExportUtil.OUT_STATION)) { if (entry.getKey().contains(StorageExportUtil.OUT_STATION)) {
continue; continue;
} }
StorageExport export = entry.getValue(); StorageExport export = entry.getValue();
if (export.isDisable()) {
continue;
}
if (StringUtils.isBlank(export.getHSerial())) { if (StringUtils.isBlank(export.getHSerial())) {
exportStr = entry.getKey(); exportStr = entry.getKey();
break; break;
...@@ -107,18 +136,20 @@ public class StorageExportUtil { ...@@ -107,18 +136,20 @@ public class StorageExportUtil {
//清空出料口信息 //清空出料口信息
public static void clearExport(String key) { public static void clearExport(String key) {
if (exportMap.get(key) != null) { StorageExport oldExport = exportMap.get(key);
log.info("清除出料口信息为:" + JSON.toJSONString(exportMap.get(key))); if (oldExport != null) {
StorageExport storageExport = new StorageExport(); log.info("清除出料口信息为:" + JSON.toJSONString(oldExport));
exportMap.put(key, storageExport); StorageExport newExport = new StorageExport();
dataCache.updateCache(EXPORT_PREFIX + "_" + key, storageExport); newExport.setDisable(oldExport.isDisable());
exportMap.put(key, newExport);
dataCache.updateCache(EXPORT_PREFIX + "_" + key, newExport);
} }
} }
public static void updateExport(String outlet, StorageExport storageExport) { public static void updateExport(String outlet, StorageExport storageExport) {
boolean hasOutLet = false; boolean hasOutLet = false;
for (String export : exportStr) { for (String exportStr : exportStrArr) {
if (outlet.startsWith(export)) { if (outlet.startsWith(exportStr)) {
hasOutLet = true; hasOutLet = true;
break; break;
} }
...@@ -132,7 +163,7 @@ public class StorageExportUtil { ...@@ -132,7 +163,7 @@ public class StorageExportUtil {
//更新出料口信息 //更新出料口信息
public static void updateExport(String key, String hSerial, String line, int remainTaskCount) { public static void updateExport(String key, String hSerial, String line, int remainTaskCount) {
boolean hasOutLet = false; boolean hasOutLet = false;
for (String export : exportStr) { for (String export : exportStrArr) {
if (export.equals(key)) { if (export.equals(key)) {
hasOutLet = true; hasOutLet = true;
break; break;
...@@ -140,19 +171,21 @@ public class StorageExportUtil { ...@@ -140,19 +171,21 @@ public class StorageExportUtil {
} }
if (hasOutLet) { if (hasOutLet) {
StorageExport storageExport = exportMap.get(key); StorageExport storageExport = exportMap.get(key);
if (storageExport == null) {
storageExport = new StorageExport(); StorageExport newExport = new StorageExport();
}
if (StringUtils.isNotBlank(hSerial)) { if (StringUtils.isNotBlank(hSerial)) {
storageExport.setHSerial(hSerial); newExport.setHSerial(hSerial);
} }
if (StringUtils.isNotBlank(line)) { if (StringUtils.isNotBlank(line)) {
storageExport.setLine(line); newExport.setLine(line);
} }
storageExport.setRemainTaskCount(remainTaskCount); newExport.setRemainTaskCount(remainTaskCount);
newExport.setDisable(storageExport.isDisable());
//storageExport.setRemainTaskCount(100); //storageExport.setRemainTaskCount(100);
exportMap.put(key, storageExport); exportMap.put(key, newExport);
dataCache.updateCache(EXPORT_PREFIX + "_" + key, storageExport); dataCache.updateCache(EXPORT_PREFIX + "_" + key, newExport);
} }
} }
......
package com.neotel.smfcore.custom.lizhen.kanban.bacheng.bean;
import lombok.Data;
@Data
public class Status {
/**
* 空闲
*/
public static final int idle = 1;
/**
* 执行任务
*/
public static final int performTask = 2;
/**
* 故障
*/
public static final int fault = 3;
}
package com.neotel.smfcore.custom.lizhen.kanban.bacheng.bean.dto;
import lombok.Data;
@Data
public class BcStationDto {
private String name;
private int status;
}
package com.neotel.smfcore.custom.lizhen.kanban.bacheng.bean.dto;
import lombok.Data;
@Data
public class BcStorageDto {
private String cid;
private int status;
private int total;
private int use;
private int noUse;
}
...@@ -25,6 +25,8 @@ public class KanbanUtils { ...@@ -25,6 +25,8 @@ public class KanbanUtils {
private static String F5; private static String F5;
private static String F4;
private static IDataLogManager dataLogManager; private static IDataLogManager dataLogManager;
private static IStoragePosManager storagePosManager; private static IStoragePosManager storagePosManager;
...@@ -155,12 +157,15 @@ public class KanbanUtils { ...@@ -155,12 +157,15 @@ public class KanbanUtils {
String f2Line = dataCache.getCache("F2Line").toString(); String f2Line = dataCache.getCache("F2Line").toString();
String f3Line = dataCache.getCache("F3Line").toString(); String f3Line = dataCache.getCache("F3Line").toString();
String f5Line = dataCache.getCache("F5Line").toString(); String f5Line = dataCache.getCache("F5Line").toString();
String f4Line = dataCache.getCache("F4Line").toString();
if (F2.equals(floor)) { if (F2.equals(floor)) {
lineList = new ArrayList<>(Arrays.asList(f2Line.split(","))); lineList = new ArrayList<>(Arrays.asList(f2Line.split(",")));
} else if (F3.equals(floor)) { } else if (F3.equals(floor)) {
lineList = new ArrayList<>(Arrays.asList(f3Line.split(","))); lineList = new ArrayList<>(Arrays.asList(f3Line.split(",")));
} else if (F5.equals(floor)) { } else if (F5.equals(floor)) {
lineList = new ArrayList<>(Arrays.asList(f5Line.split(","))); lineList = new ArrayList<>(Arrays.asList(f5Line.split(",")));
} else if (F4.equals(floor)) {
lineList = new ArrayList<>(Arrays.asList(f4Line.split(",")));
} }
return lineList; return lineList;
} }
...@@ -199,4 +204,9 @@ public class KanbanUtils { ...@@ -199,4 +204,9 @@ public class KanbanUtils {
private void setF5Floor(String floor) { private void setF5Floor(String floor) {
F5 = floor; F5 = floor;
} }
@Value("${lizhen.F4.name}")
private void setF4Floor(String floor) {
F4 = floor;
}
} }
...@@ -153,7 +153,7 @@ public class BCReportController { ...@@ -153,7 +153,7 @@ public class BCReportController {
@AnonymousAccess @AnonymousAccess
public PageData getExpire(BcQuery query, Pageable pageable) { public PageData getExpire(BcQuery query, Pageable pageable) {
Query q = QueryHelp.getQuery(query); Query q = QueryHelp.getQuery(query);
q.addCriteria(Criteria.where("barcode").exists(true).and("barcode.expireDate").lt(new Date())); q.addCriteria(Criteria.where("barcode").exists(true)/*.and("barcode.expireDate").lt(new Date())*/);
PageData<StoragePos> pageData = storagePosManager.findByPage(q, pageable); PageData<StoragePos> pageData = storagePosManager.findByPage(q, pageable);
List<BCExpire> expireList = getBCExpire(pageData.getContent()); List<BCExpire> expireList = getBCExpire(pageData.getContent());
return new PageData(expireList, pageData.getTotalElements()); return new PageData(expireList, pageData.getTotalElements());
...@@ -169,7 +169,7 @@ public class BCReportController { ...@@ -169,7 +169,7 @@ public class BCReportController {
@AnonymousAccess @AnonymousAccess
public void expireDownload(BcQuery query, Pageable pageable, HttpServletResponse response){ public void expireDownload(BcQuery query, Pageable pageable, HttpServletResponse response){
Query q = QueryHelp.getQuery(query); Query q = QueryHelp.getQuery(query);
q.addCriteria(Criteria.where("barcode").exists(true).and("barcode.expireDate").lt(new Date())); q.addCriteria(Criteria.where("barcode").exists(true)/*.and("barcode.expireDate").lt(new Date())*/);
try { try {
FileUtil.downloadExcel(q, pageable, response, new IExcelDownLoad() { FileUtil.downloadExcel(q, pageable, response, new IExcelDownLoad() {
......
...@@ -14,8 +14,8 @@ api: ...@@ -14,8 +14,8 @@ api:
brandQtyUrl: #http://172.30.170.199:8082/api/wcs/brandQty #gr标签满卷数 brandQtyUrl: #http://172.30.170.199:8082/api/wcs/brandQty #gr标签满卷数
importUrl: #http://10.42.222.52:8001/smf-core/ext/forward/getDataLogs #内仓导入外仓picking虚拟仓数据 importUrl: #http://10.42.222.52:8001/smf-core/ext/forward/getDataLogs #内仓导入外仓picking虚拟仓数据
checkReelMeasure: #http://10.190.25.149:8001/Sct/CheckReelMeasure #散料量测接口 checkReelMeasure: #http://10.190.25.149:8001/Sct/CheckReelMeasure #散料量测接口
plant: plant: 2810
werks: werks: 2810
outerFactory: outerFactory:
...@@ -40,7 +40,7 @@ lizhen: ...@@ -40,7 +40,7 @@ lizhen:
url: http://172.30.97.63:8001/smf-core/api/Mes/machineCallMaterial url: http://172.30.97.63:8001/smf-core/api/Mes/machineCallMaterial
F4: F4:
name: 4F name: 4F
line: B03-4FSMT-11,B03-4FSMT-01,B03-4FSMT-13,B03-4FSMT-14,B03-4FSMT-03,B03-4FSMT-04,B03-4FSMT-12,B03-4FSMT-02 line: B03-4FSMT-11,B03-4FSMT-01
url: http://172.25.252.12:8001/smf-core/api/Mes/machineCallMaterial url: http://172.25.252.12:8001/smf-core/api/Mes/machineCallMaterial
...@@ -59,10 +59,9 @@ forward: ...@@ -59,10 +59,9 @@ forward:
name: B15 name: B15
url: http://10.42.176.209:8001/smf-core url: http://10.42.176.209:8001/smf-core
#禁用工位信息 #手动出库料箱
disable: manualcheckout:
export: MU_1,MU_2 export: MU3_1
...@@ -100,5 +99,5 @@ app: ...@@ -100,5 +99,5 @@ app:
type: "" type: ""
menu: menu:
show: menu,workOrder,virWarehous,warehouseMaintenance,innerInventory,expiredReport,menu,innerChangeReport,innerProLimitReport show:
hide: hide:
\ No newline at end of file \ No newline at end of file
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
<Policies> <Policies>
<TimeBasedTriggeringPolicy modulate="true" interval="1" /> <TimeBasedTriggeringPolicy modulate="true" interval="1" />
</Policies> </Policies>
<DefaultRolloverStrategy max="180" /> <DefaultRolloverStrategy max="30" />
</RollingFile> </RollingFile>
<RollingFile name="lizhen" fileName="${LOG_HOME}/${LOG_MES}" <RollingFile name="lizhen" fileName="${LOG_HOME}/${LOG_MES}"
filePattern="${LOG_HOME}/%d{yyyy-MM-dd}.${LOG_NAME}" append="true"> filePattern="${LOG_HOME}/%d{yyyy-MM-dd}.${LOG_MES}" append="true">
<PatternLayout charset="GB18030" pattern="%d{yyyy-MM-dd HH:mm:ss:SSS} %-5level [%file:%line] - %msg%n"/> <PatternLayout charset="GB18030" pattern="%d{yyyy-MM-dd HH:mm:ss:SSS} %-5level [%file:%line] - %msg%n"/>
<Policies> <Policies>
<TimeBasedTriggeringPolicy modulate="true" interval="1"/> <TimeBasedTriggeringPolicy modulate="true" interval="1"/>
</Policies> </Policies>
<DefaultRolloverStrategy max="180"/> <DefaultRolloverStrategy max="7"/>
</RollingFile> </RollingFile>
</appenders> </appenders>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!