Commit d89842e4 zshaohui

增加报表和虚拟仓增加库别

1 个父辈 4311ee91
正在显示 28 个修改的文件 包含 1205 行增加184 行删除
...@@ -234,14 +234,14 @@ public class DataInitManager { ...@@ -234,14 +234,14 @@ public class DataInitManager {
addNewFunctionMenu(84,pMenuReport,"feeding","喂料","feeding","neolight/feeding/index","feeding",functionMenuMap); addNewFunctionMenu(84,pMenuReport,"feeding","喂料","feeding","neolight/feeding/index","feeding",functionMenuMap);
addNewFunctionMenu(85,pMenuReport,"innerInventory","库存","innerInventory","innerWarehouse/inventory/index","inventory",functionMenuMap); addNewFunctionMenu(85,pMenuReport,"innerInventory","库存","innerInventory","innerWarehouse/inventory/index","inventory",functionMenuMap);
addNewFunctionMenu(86,pMenuReport,"innerMaterial","备料清单","innerMaterial","innerWarehouse/materialPreList/index","mPreListReport",functionMenuMap); addNewFunctionMenu(86,pMenuReport,"innerMaterial","备料清单","innerMaterial","innerWarehouse/materialPreList/index","mPreListReport",functionMenuMap);
addNewFunctionMenu(87,pMenuReport,"innerChangeReport","异动","innerChangeReport","innerWarehouse/changeReport/index","chageReport",functionMenuMap); addNewFunctionMenu(87,pMenuReport,"innerChangeReport","事务报表","innerChangeReport","innerWarehouse/changeReport/index","chageReport",functionMenuMap);
addNewFunctionMenu(88,pMenuReport,"innerIssueReport","发料","innerIssueReport","innerWarehouse/issueReport/index","IssueRe",functionMenuMap); addNewFunctionMenu(88,pMenuReport,"innerIssueReport","发料","innerIssueReport","innerWarehouse/issueReport/index","IssueRe",functionMenuMap);
addNewFunctionMenu(89,pMenuReport,"innerMaShortReport","缺料","innerMaShortReport","innerWarehouse/maShortReport/index","maShort",functionMenuMap); addNewFunctionMenu(89,pMenuReport,"innerMaShortReport","缺料","innerMaShortReport","innerWarehouse/maShortReport/index","maShort",functionMenuMap);
addNewFunctionMenu(90,pMenuReport,"innerProLimitReport","禁限用","innerProLimitReport","innerWarehouse/proLimitReport/index","proLimit",functionMenuMap); addNewFunctionMenu(90,pMenuReport,"innerProLimitReport","禁限用","innerProLimitReport","innerWarehouse/proLimitReport/index","proLimit",functionMenuMap);
addNewFunctionMenu(91,pMenuReport,"imDetailsReport","导入明细","imDetailsReport","innerWarehouse/imDetailsReport/index","feeding",functionMenuMap); addNewFunctionMenu(91,pMenuReport,"imDetailsReport","导入明细","imDetailsReport","innerWarehouse/imDetailsReport/index","feeding",functionMenuMap);
//内外仓都有 //内外仓都有
addNewFunctionMenu(92,pMenuReport,"expiredReport","库存物料状态表","expiredReport","report/expiredReport/index","inventory",functionMenuMap); addNewFunctionMenu(92,pMenuReport,"expiredReport","过期报表","expiredReport","report/expiredReport/index","inventory",functionMenuMap);
//可观测性:物料追踪 //可观测性:物料追踪
Menu guanceMenu = Menu.CreatePMenu("可观测性", 8, "observability", 2, "scanKey",null); Menu guanceMenu = Menu.CreatePMenu("可观测性", 8, "observability", 2, "scanKey",null);
......
...@@ -160,7 +160,7 @@ public class Barcode extends BasePo implements Serializable { ...@@ -160,7 +160,7 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 卷数 * 卷数
*/ */
private int reelAmount = 0; private int reelAmount = 1;
/** /**
* 关联条码,夹具时关联相关的物料,用于入库完成时插入相关物料 * 关联条码,夹具时关联相关的物料,用于入库完成时插入相关物料
*/ */
...@@ -269,7 +269,7 @@ public class Barcode extends BasePo implements Serializable { ...@@ -269,7 +269,7 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 库别 * 库别
*/ */
private String warehouseCode; private String warehouseCode = "W10B";
/** /**
......
...@@ -66,5 +66,6 @@ public enum OP_STATUS { ...@@ -66,5 +66,6 @@ public enum OP_STATUS {
/** /**
* 需要从流水线上拿走 * 需要从流水线上拿走
*/ */
NEED_AWAY NEED_AWAY,
OUT_POS
} }
...@@ -356,10 +356,10 @@ public class NLShelfHandler extends BaseDeviceHandler { ...@@ -356,10 +356,10 @@ public class NLShelfHandler extends BaseDeviceHandler {
private ResultBean outProcess(String code, String sourceId, String loginUser){ private ResultBean outProcess(String code, String sourceId, String loginUser){
//判断是否有打印标签的需求,如果有,则返回错误 //判断是否有打印标签的需求,如果有,则返回错误
String nlLabelOrderItemId = innerBoxRestController.getLabelOrderItemId(); /*String nlLabelOrderItemId = innerBoxRestController.getLabelOrderItemId();
if (StringUtils.isNotBlank(nlLabelOrderItemId)){ if (StringUtils.isNotBlank(nlLabelOrderItemId)){
return ResultBean.newErrorResult(1,"","上一个物料标签请打印完成后再进行出库操作"); return ResultBean.newErrorResult(1,"","上一个物料标签请打印完成后再进行出库操作");
} }*/
String barcodeStr = "=1x1=" + code; String barcodeStr = "=1x1=" + code;
Barcode barcode = codeResolve.resolveOneValideBarcode(barcodeStr); Barcode barcode = codeResolve.resolveOneValideBarcode(barcodeStr);
StoragePos inPos = storagePosManager.getByBarcode(barcode.getBarcode()); StoragePos inPos = storagePosManager.getByBarcode(barcode.getBarcode());
...@@ -377,10 +377,10 @@ public class NLShelfHandler extends BaseDeviceHandler { ...@@ -377,10 +377,10 @@ public class NLShelfHandler extends BaseDeviceHandler {
} }
} }
//设置nlLable //设置nlLable
if (StringUtils.isNotBlank(task.getSubSourceId())) { /*if (StringUtils.isNotBlank(task.getSubSourceId())) {
log.info(task.getBarcode() + "设置的标签orderItemId:" + task.getSubSourceId()); log.info(task.getBarcode() + "设置的标签orderItemId:" + task.getSubSourceId());
innerBoxRestController.setLabelOrderItemId(task.getCid(),task.getSubSourceId()); innerBoxRestController.setLabelOrderItemId(task.getCid(),task.getSubSourceId());
} }*/
taskService.addTaskToFinished(inPos, null, loginUser); taskService.addTaskToFinished(inPos, null, loginUser);
opPosLight("close", inPos, ""); opPosLight("close", inPos, "");
log.info(code + " 出库完成, 库位[" + inPos.getPosName() + "]灭灯"); log.info(code + " 出库完成, 库位[" + inPos.getPosName() + "]灭灯");
......
...@@ -237,12 +237,14 @@ public class DeviceController { ...@@ -237,12 +237,14 @@ public class DeviceController {
barcode = barcodeApi; barcode = barcodeApi;
} }
for (DataLog dataLog : taskService.getQueueTasks()) { for (DataLog dataLog : taskService.getAllTasks()) {
// if(!dataLog.isPackageReel()){ // if(!dataLog.isPackageReel()){
//已经在任务当中,返回对应的信息 //已经在任务当中,返回对应的信息
if (dataLog.getBarcode().equals(barcode.getBarcode())) { if (dataLog.getBarcode().equals(barcode.getBarcode())) {
//如果有任务,直接ng //如果有任务,直接ng
throw new ValidateException("smfcore.error.barcode.executing","条码[{0}}]任务正在执行",new String[]{barcode.getBarcode()}); if (!dataLog.isFinished()) {
throw new ValidateException("smfcore.error.barcode.executing", "条码[{0}}]任务正在执行", new String[]{barcode.getBarcode()});
}
/* if (dataLog.isPutInTask()) { /* if (dataLog.isPutInTask()) {
//已有入库任务 //已有入库任务
errorMsg = "物料[" + dataLog.getBarcode() + "]已有入库任务,需继续执行入库动作"; errorMsg = "物料[" + dataLog.getBarcode() + "]已有入库任务,需继续执行入库动作";
......
...@@ -11,6 +11,7 @@ import com.neotel.smfcore.core.barcode.service.manager.IComponentManager; ...@@ -11,6 +11,7 @@ import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.service.po.Component; import com.neotel.smfcore.core.barcode.service.po.Component;
import com.neotel.smfcore.core.barcode.utils.CodeResolve; import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.inList.util.InListCache; import com.neotel.smfcore.core.inList.util.InListCache;
import com.neotel.smfcore.core.language.service.bean.LanguageInfo; import com.neotel.smfcore.core.language.service.bean.LanguageInfo;
import com.neotel.smfcore.core.language.util.MessageUtils; import com.neotel.smfcore.core.language.util.MessageUtils;
...@@ -26,6 +27,7 @@ import com.neotel.smfcore.core.system.service.dao.ICacheItemDao; ...@@ -26,6 +27,7 @@ import com.neotel.smfcore.core.system.service.dao.ICacheItemDao;
import com.neotel.smfcore.core.system.service.dao.ISettingsDao; import com.neotel.smfcore.core.system.service.dao.ISettingsDao;
import com.neotel.smfcore.core.system.service.po.CacheItem; import com.neotel.smfcore.core.system.service.po.CacheItem;
import com.neotel.smfcore.core.system.service.po.Settings; import com.neotel.smfcore.core.system.service.po.Settings;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -95,6 +97,10 @@ public class DataCache { ...@@ -95,6 +97,10 @@ public class DataCache {
cacheMap = Maps.newConcurrentMap(); cacheMap = Maps.newConcurrentMap();
List<CacheItem> all = cacheItemDao.findAll(); List<CacheItem> all = cacheItemDao.findAll();
for (CacheItem cacheItem : all) { for (CacheItem cacheItem : all) {
if (cacheItem.getCacheKey() == null || cacheItem.getCacheValue() == null){
log.info(cacheItem.getCacheKey()+"---"+cacheItem.getCacheValue());
continue;
}
cacheMap.put(cacheItem.getCacheKey(), cacheItem.getCacheValue()); cacheMap.put(cacheItem.getCacheKey(), cacheItem.getCacheValue());
} }
if (cacheMap.get(Constants.CACHE_StopOut) == null) { if (cacheMap.get(Constants.CACHE_StopOut) == null) {
...@@ -662,10 +668,10 @@ public class DataCache { ...@@ -662,10 +668,10 @@ public class DataCache {
public List<String> getAvailableStorageIds(){ public List<String> getAvailableStorageIds(){
List<String> availableStorageIds = new ArrayList<>(); List<String> availableStorageIds = new ArrayList<>();
for (Storage storage : getAllStorage().values()) { for (Storage storage : getAllStorage().values()) {
/*StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid()); StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (bean == null || bean.timeOut() || !bean.isAvailable()) { if (bean == null || bean.timeOut() || !bean.isAvailable()) {
continue; continue;
}*/ }
availableStorageIds.add(storage.getId()); availableStorageIds.add(storage.getId());
} }
return availableStorageIds; return availableStorageIds;
......
...@@ -35,6 +35,7 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil; ...@@ -35,6 +35,7 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService; 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.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;
...@@ -492,6 +493,13 @@ public class LiteOrderCache { ...@@ -492,6 +493,13 @@ public class LiteOrderCache {
return checkOutOrder(cacheOrder).getMsgKey(); return checkOutOrder(cacheOrder).getMsgKey();
} }
//获取是否有出料口
String exportStr = StorageExportUtil.getExportByOrderNo(cacheOrder.getOrderNo());
if (StringUtils.isBlank(exportStr)) {
log.info(cacheOrder.getOrderNo() + "没有空闲的出料口");
return "没有空闲的出料口";
}
log.info("开始执行工单[" + orderNo + "] outBom=" + outBom); log.info("开始执行工单[" + orderNo + "] outBom=" + outBom);
cacheOrder.setTaskReelCount(0); cacheOrder.setTaskReelCount(0);
cacheOrder.setTaskFinishedTime(-1); cacheOrder.setTaskFinishedTime(-1);
...@@ -606,9 +614,7 @@ public class LiteOrderCache { ...@@ -606,9 +614,7 @@ public class LiteOrderCache {
task.setSubSourceInfo(orderItem.getFeederInfo()); task.setSubSourceInfo(orderItem.getFeederInfo());
task.setType(OP.CHECKOUT); task.setType(OP.CHECKOUT);
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage.isType(new DeviceType[]{DeviceType.SMD_XLR})) { task.setExtendType(ExtendType.ORDER_CHECKOUT); //工单出库
task.setExtendType(ExtendType.STORAGE_CHECKOUT); //智能仓储出库
}
task.setLightColor(nextColor.getRgb()); task.setLightColor(nextColor.getRgb());
task.setStatus(OP_STATUS.WAIT.name()); task.setStatus(OP_STATUS.WAIT.name());
task.setPartNumber(pos.getBarcode().getPartNumber()); //料号 task.setPartNumber(pos.getBarcode().getPartNumber()); //料号
...@@ -623,6 +629,11 @@ public class LiteOrderCache { ...@@ -623,6 +629,11 @@ public class LiteOrderCache {
task.setProviderNumber(pos.getBarcode().getProviderNumber()); //厂商代码 task.setProviderNumber(pos.getBarcode().getProviderNumber()); //厂商代码
task.setProvider(pos.getBarcode().getProvider()); //厂商 task.setProvider(pos.getBarcode().getProvider()); //厂商
task.setTableNo(orderItem.getTableNo()); task.setTableNo(orderItem.getTableNo());
task.setW(pos.getBarcode().getPlateSize());
task.setWarehouseCode(pos.getBarcode().getWarehouseCode());
task.setH(pos.getBarcode().getHeight());
task.setDescribe(pos.getBarcode().getDescribe());
task.setKeeperCode(pos.getBarcode().getKeeperCode());
// task = dataLogDao.save(task); // task = dataLogDao.save(task);
taskService.addTaskToExecute(task); taskService.addTaskToExecute(task);
} }
...@@ -649,6 +660,9 @@ public class LiteOrderCache { ...@@ -649,6 +660,9 @@ public class LiteOrderCache {
//return "工单无可执行的任务"; //return "工单无可执行的任务";
return "smfcore.order.out.noTask"; return "smfcore.order.out.noTask";
} }
StorageExportUtil.updateExport(exportStr, cacheOrder.getOrderNo(), cacheOrder.getLine(), taskReelCount);
return ""; return "";
} }
/** /**
......
...@@ -671,7 +671,7 @@ public class StoragePosController { ...@@ -671,7 +671,7 @@ public class StoragePosController {
// } // }
log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】"); log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】");
String outResult = taskService.checkout(storage, pos, isSingleOut,SecurityUtils.getCurrentUsername(),null); String outResult = taskService.checkout(storage, pos, isSingleOut,SecurityUtils.getCurrentUsername(),null,ExtendType.MANUAL_CHECKOUT);
if (!Strings.isNullOrEmpty(outResult)) { if (!Strings.isNullOrEmpty(outResult)) {
throw new ValidateException("smfcore.error", outResult); throw new ValidateException("smfcore.error", outResult);
} }
...@@ -739,4 +739,28 @@ public class StoragePosController { ...@@ -739,4 +739,28 @@ public class StoragePosController {
return dto; return dto;
} }
@ApiOperation("批量启用或禁用库位")
@PutMapping("/batchEnabledOrDisabledPos")
@PreAuthorize("@el.check('storagePos:edit')")
public ResultBean batchEnabledOrDisabledPos(@RequestBody StoragePosEnabledDto enabledDto) {
List<String> idList = enabledDto.getIdList();
if (idList == null || idList.isEmpty()) {
return ResultBean.newErrorResult(1,"smfcore.valueCanotNull", "{0}不能为空", new String[]{"ID"});
}
storagePosManager.batchUpdatePosEnabled(idList, enabledDto.isEnabled());
//查询库位具体信息,更新缓存
List<StoragePos> posList = storagePosManager.findPosByIdList(idList);
for (StoragePos pos : posList) {
//dataCache.updateDisablePos(pos);
log.info("启用或禁用库位:库位号[" + pos.getId() + "][" + pos.getPosName() + "]=" + enabledDto.isEnabled());
DeviceMessageUtil.addEnabledPosMessage(pos, SecurityUtils.getCurrentUsername());
}
for (Storage storage : dataCache.getAllStorage().values()) {
dataCache.reloadStorage(storage, "");
}
return ResultBean.newOkResult("");
}
} }
...@@ -5,6 +5,7 @@ import lombok.Getter; ...@@ -5,6 +5,7 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
@Getter @Getter
@Setter @Setter
...@@ -14,4 +15,7 @@ public class StoragePosEnabledDto implements Serializable { ...@@ -14,4 +15,7 @@ public class StoragePosEnabledDto implements Serializable {
@ApiModelProperty("启用/禁用") @ApiModelProperty("启用/禁用")
private boolean enabled = true; private boolean enabled = true;
@ApiModelProperty("库位ID列表")
private List<String> idList;
} }
...@@ -90,4 +90,8 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> { ...@@ -90,4 +90,8 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
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); List<StoragePos> findPartNumberListInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType, String brand);
void batchUpdatePosEnabled(List<String> idList, boolean enabled);
List<StoragePos> findPosByIdList(List<String> idList);
} }
...@@ -837,4 +837,18 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -837,4 +837,18 @@ public class StoragePosManagerImpl implements IStoragePosManager {
Query q = new Query(c); Query q = new Query(c);
return storagePosDao.findByQuery(q); return storagePosDao.findByQuery(q);
} }
@Override
public void batchUpdatePosEnabled(List<String> idList, boolean enabled) {
Query query = new Query(Criteria.where("id").in(idList));
Update update = new Update();
update.set("enabled",enabled);
storagePosDao.updateMulti(query,update);
}
@Override
public List<StoragePos> findPosByIdList(List<String> idList) {
Query query = new Query(Criteria.where("id").in(idList));
return storagePosDao.findByQuery(query);
}
} }
...@@ -353,6 +353,15 @@ public class DataLog extends BasePo implements Serializable { ...@@ -353,6 +353,15 @@ public class DataLog extends BasePo implements Serializable {
*/ */
private Date fristPutInDate; private Date fristPutInDate;
/**
* 盘宽
*/
private int plateSize = 0;
/**
* 盘高
*/
private int height = 0;
public String getBarcode() { public String getBarcode() {
if(barcode == null){ if(barcode == null){
return ""; return "";
......
...@@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* Created by sunke on 2021/7/13. * Created by sunke on 2021/7/13.
...@@ -103,8 +104,15 @@ public class TaskService { ...@@ -103,8 +104,15 @@ public class TaskService {
DataLog task = new DataLog(storage, barcode, storagePos); DataLog task = new DataLog(storage, barcode, storagePos);
task.setType(OP.PUT_IN); task.setType(OP.PUT_IN);
task.setStatus(OP_STATUS.EXECUTING.name()); task.setStatus(OP_STATUS.EXECUTING.name());
task.setExtendType(ExtendType.STORAGE_PUTIN); //智能仓储入库 task.setExtendType(ExtendType.AUTO_PUTIN); //自动入库
if(barcode!=null){ if(barcode!=null){
task.setWarehouseCode(barcode.getWarehouseCode());
task.setDescribe(barcode.getDescribe());
task.setBatchInfo(barcode.getBatch());
task.setDateCode(barcode.getDateCode());
task.setProvider(barcode.getProvider());
task.setProviderNumber(barcode.getProviderNumber());
task.setKeeperCode(barcode.getKeeperCode());
barcode.setPutInTime(System.currentTimeMillis()); barcode.setPutInTime(System.currentTimeMillis());
barcode.updateSluggishTime(dataCache.getPNsluggishDay(barcode.getPartNumber())); barcode.updateSluggishTime(dataCache.getPNsluggishDay(barcode.getPartNumber()));
barcodeManager.saveBarcode(barcode); barcodeManager.saveBarcode(barcode);
...@@ -119,6 +127,11 @@ public class TaskService { ...@@ -119,6 +127,11 @@ public class TaskService {
return task; return task;
} }
public synchronized String checkout(Storage storage, StoragePos pos, boolean isSingleOut, String opUserName,String stationName) throws ValidateException {
return checkout(storage,pos,isSingleOut,opUserName,stationName,-1);
}
/** /**
* 库位出库 * 库位出库
* *
...@@ -128,11 +141,11 @@ public class TaskService { ...@@ -128,11 +141,11 @@ public class TaskService {
* @return * @return
* @throws ValidateException * @throws ValidateException
*/ */
public synchronized String checkout(Storage storage, StoragePos pos, boolean isSingleOut, String opUserName,String stationName) throws ValidateException { public synchronized String checkout(Storage storage, StoragePos pos, boolean isSingleOut, String opUserName,String stationName,int extendType) throws ValidateException {
if (pos.getBarcode() == null) { if (pos.getBarcode() == null) {
String msg = "库位[" + pos.getPosName() + "]中已无物料,忽略"; String msg = "库位[" + pos.getPosName() + "]中已无物料,忽略";
log.info(msg); log.info(msg);
throw new ValidateException("smfcore.allBoxView.noReel", "库位{0}中无物料",new String[]{pos.getPosName()}); throw new ValidateException("smfcore.allBoxView.noReel", "库位{0}中无物料", new String[]{pos.getPosName()});
// Barcode barcode=new Barcode(); // Barcode barcode=new Barcode();
...@@ -160,7 +173,7 @@ public class TaskService { ...@@ -160,7 +173,7 @@ public class TaskService {
task.setSingleOut(isSingleOut); task.setSingleOut(isSingleOut);
task.setOperator(opUserName); task.setOperator(opUserName);
task.setStorageId(storage.getId()); task.setStorageId(storage.getId());
if (StringUtils.isNotBlank(stationName)){ if (StringUtils.isNotBlank(stationName)) {
task.setLoc(stationName); task.setLoc(stationName);
} }
task.setBoxPosName(pos.getPosName()); task.setBoxPosName(pos.getPosName());
...@@ -168,8 +181,21 @@ public class TaskService { ...@@ -168,8 +181,21 @@ public class TaskService {
task.setStatus(OP_STATUS.FINISHED.name()); task.setStatus(OP_STATUS.FINISHED.name());
addTaskToFinished(pos,barcode,SecurityUtils.getCurrentUsername()); addTaskToFinished(pos,barcode,SecurityUtils.getCurrentUsername());
} else {*/ } else {*/
task.setStatus(OP_STATUS.WAIT.name()); task.setStatus(OP_STATUS.WAIT.name());
addTaskToExecute(task); task.setWarehouseCode(barcode.getWarehouseCode());
task.setDescribe(barcode.getDescribe());
task.setBatchInfo(barcode.getBatch());
task.setDateCode(barcode.getDateCode());
task.setProvider(barcode.getProvider());
task.setProviderNumber(barcode.getProviderNumber());
task.setKeeperCode(barcode.getKeeperCode());
if (StringUtils.isNotBlank(SecurityUtils.getLoginUsername())){
task.setCreator(SecurityUtils.getLoginUsername());
}
if (extendType != -1) {
task.setExtendType(extendType);
}
addTaskToExecute(task);
//} //}
return ""; return "";
} }
...@@ -412,20 +438,20 @@ public class TaskService { ...@@ -412,20 +438,20 @@ public class TaskService {
if (task.isPutInTask()) { if (task.isPutInTask()) {
log.error("cid[" + cid + "]已有入库任务,不可再分配出库任务"); log.error("cid[" + cid + "]已有入库任务,不可再分配出库任务");
return null; return null;
} else if (task.needReSendToClient() && task.isCheckOutTask()) {//超过30秒仍未完成的出库再次发送到客户端 } else if (task.needReSendToClient() && task.isCheckOutTask() && task.isExecuting()) {//超过30秒仍未完成的出库再次发送到客户端
log.error("cid[" + cid + "]的出库任务[" + task.getPosName() + "]超过60秒仍未完成,重新发送到客户端!"); log.error("cid[" + cid + "]的出库任务[" + task.getPosName() + "]超过60秒仍未完成,重新发送到客户端!");
task.setUpdateDate(new Date()); task.setUpdateDate(new Date());
return task; return task;
} }
//只能同时有两个正在执行的出库任务,如果超过两个不再分配了 //只能同时有两个正在执行的出库任务,如果超过两个不再分配了
if (task.isCheckOutTask()) { /*if (task.isCheckOutTask()) {
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;
} }
} }*/
} }
} }
...@@ -457,17 +483,22 @@ public class TaskService { ...@@ -457,17 +483,22 @@ public class TaskService {
} }
//判断发送的任务与当前执行的工单是否一致 //判断发送的任务与当前执行的工单是否一致
if (outTask != null) { if (outTask != null) {
List<DataLog> dataLogList = new ArrayList<>();
for (DataLog task : allTasks) { for (DataLog task : allTasks) {
if (outTask.getCid().equals(task.getCid())) { if (outTask.getCid().equals(task.getCid())) {
if (StringUtils.isNotBlank(outTask.getSourceName())) { if (StringUtils.isNotBlank(outTask.getSourceName())) {
if (!outTask.getSourceName().equals(task.getSourceName())) { if (outTask.getSourceName().equals(task.getSourceName())){
if (task.isExecuting() || task.isOnInnerLine()) { if (task.isWait()) {
return null; dataLogList.add(task);
} }
} }
} }
} }
} }
if (dataLogList != null && !dataLogList.isEmpty()){
dataLogList = dataLogList.stream().sorted(Comparator.comparing(DataLog::getW).reversed()).collect(Collectors.toList());
outTask = dataLogList.get(0);
}
} }
return outTask; return outTask;
} }
...@@ -745,7 +776,7 @@ public class TaskService { ...@@ -745,7 +776,7 @@ public class TaskService {
Collection<String> operatingPosIds = excludePosIds(); Collection<String> operatingPosIds = excludePosIds();
log.debug("尝试从[" + storage.getCid() + "]中为[" + barcode.getBarcode() + "]查找空位"); log.debug("尝试从[" + storage.getCid() + "]中为[" + barcode.getBarcode() + "]查找空位");
StoragePos pos = null; StoragePos pos = null;
if (storage.isType(new DeviceType[]{DeviceType.SMD_XLR})) { /*if (storage.isType(new DeviceType[]{DeviceType.SMD_XLR})) {
//根据cid获取下一个放入的面别 //根据cid获取下一个放入的面别
String side = posSideMap.get(storage.getCid()); String side = posSideMap.get(storage.getCid());
if (side != null) { if (side != null) {
...@@ -769,9 +800,9 @@ public class TaskService { ...@@ -769,9 +800,9 @@ public class TaskService {
posSideMap.put(storage.getCid(),posSide); posSideMap.put(storage.getCid(),posSide);
pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId, posSide); pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId, posSide);
} }
} else { } else {*/
pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId); pos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds, lastPosId);
} //}
if (pos != null) { if (pos != null) {
return pos; return pos;
} }
...@@ -942,7 +973,7 @@ public class TaskService { ...@@ -942,7 +973,7 @@ public class TaskService {
task.setOperator(opUser); task.setOperator(opUser);
task.setStatus(OP_STATUS.FINISHED.name()); task.setStatus(OP_STATUS.FINISHED.name());
task.setExtendType(ExtendType.CLEAR_POS); //手动清空库位 //task.setExtendType(ExtendType.CLEAR_POS); //手动清空库位
updateFinishedTask(task); updateFinishedTask(task);
} catch (Exception e) { } catch (Exception e) {
...@@ -1066,9 +1097,17 @@ public class TaskService { ...@@ -1066,9 +1097,17 @@ public class TaskService {
task.setType(OP.CHECKOUT); task.setType(OP.CHECKOUT);
task.setExtendType(ExtendType.MANUAL_CHECKOUT); //手动出库 task.setExtendType(ExtendType.MANUAL_CHECKOUT); //手动出库
task.setOperator(SecurityUtils.getCurrentUsername()); task.setOperator(SecurityUtils.getCurrentUsername());
task.setCreator(SecurityUtils.getCurrentUsername());
task.setSingleOut(true); task.setSingleOut(true);
task.setSourceId(null); task.setSourceId(null);
task.setSourceName("PN"); task.setSourceName("PN");
task.setWarehouseCode(pos.getBarcode().getWarehouseCode());
task.setDescribe(pos.getBarcode().getDescribe());
task.setBatchInfo(pos.getBarcode().getBatch());
task.setDateCode(pos.getBarcode().getDateCode());
task.setProvider(pos.getBarcode().getProvider());
task.setProviderNumber(pos.getBarcode().getProviderNumber());
task.setKeeperCode(pos.getBarcode().getKeeperCode());
addTaskToExecute(task); addTaskToExecute(task);
} }
} }
......
...@@ -17,7 +17,9 @@ import com.neotel.smfcore.core.device.util.DataCache; ...@@ -17,7 +17,9 @@ import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.order.LiteOrderCache; import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.order.service.po.LiteOrder; import com.neotel.smfcore.core.order.service.po.LiteOrder;
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.po.Storage; import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.custom.lizhen.agvBox.bean.GrLabel; import com.neotel.smfcore.custom.lizhen.agvBox.bean.GrLabel;
import com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem; import com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem;
...@@ -41,6 +43,9 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -41,6 +43,9 @@ public class LizhenApi extends DefaultSmfApiListener {
private IBarcodeManager barcodeManager; private IBarcodeManager barcodeManager;
@Autowired @Autowired
private IStoragePosManager storagePosManager;
@Autowired
private DataCache dataCache; private DataCache dataCache;
@Value("${api.fetchGRUrl}") @Value("${api.fetchGRUrl}")
...@@ -274,7 +279,12 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -274,7 +279,12 @@ public class LizhenApi extends DefaultSmfApiListener {
Barcode barcodeOri = barcodeManager.findByBarcode(barcode.getBarcode()); Barcode barcodeOri = barcodeManager.findByBarcode(barcode.getBarcode());
if (barcodeOri != null){ if (barcodeOri != null){
barcodeOri.setDisableMsg(resultStr); barcodeOri.setDisableMsg(resultStr);
barcodeManager.save(barcodeOri); barcode = barcodeManager.save(barcodeOri);
StoragePos storagePos = storagePosManager.getByBarcode(barcode.getBarcode());
if (storagePos != null){
storagePos.setBarcode(barcode);
storagePosManager.save(storagePos);
}
} }
if (StringUtils.isNotBlank(resultStr)) { if (StringUtils.isNotBlank(resultStr)) {
...@@ -562,16 +572,16 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -562,16 +572,16 @@ public class LizhenApi extends DefaultSmfApiListener {
* @return * @return
*/ */
public boolean checkReelMeasure(Barcode barcode) { public boolean checkReelMeasure(Barcode barcode) {
if (StringUtils.isBlank(checkReelMeasureUrl)){ if (StringUtils.isBlank(checkReelMeasureUrl)) {
return true; return true;
} }
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("reelID", barcode.getBarcode()); paramMap.put("reelID", barcode.getBarcode());
paramMap.put("ipn", barcode.getPartNumber()); paramMap.put("ipn", barcode.getPartNumber());
try { try {
log.info("散料量测接口入参为-----" + JSON.toJSONString(paramMap)); log.info(barcode.getBarcode() + "散料量测接口入参为-----" + JSON.toJSONString(paramMap)+",接口地址为:"+checkReelMeasureUrl);
String result = HttpHelper.postJson(checkReelMeasureUrl, paramMap); String result = HttpHelper.postJson(checkReelMeasureUrl, paramMap);
log.info("散料量测接口出参为-----" + result); log.info(barcode.getBarcode() + "散料量测接口出参为-----" + result);
JSONObject jsonObject = JSON.parseObject(result); JSONObject jsonObject = JSON.parseObject(result);
if (jsonObject.getInteger("status") == 200) { if (jsonObject.getInteger("status") == 200) {
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");
......
...@@ -61,6 +61,12 @@ public class LizhenController { ...@@ -61,6 +61,12 @@ public class LizhenController {
@Value("${lizhen.F5.url}") @Value("${lizhen.F5.url}")
private String F5Url; private String F5Url;
@Value("${lizhen.F4.line}")
private String F4Line;
@Value("${lizhen.F4.url}")
private String F4Url;
private static Map<String, String> lineUrlMap = new HashMap<>(); private static Map<String, String> lineUrlMap = new HashMap<>();
//初始化加载需要配送的地址 //初始化加载需要配送的地址
...@@ -72,9 +78,12 @@ public class LizhenController { ...@@ -72,9 +78,12 @@ public class LizhenController {
F3Url = dataCache.getConfigCache("F3Url", F3Url); F3Url = dataCache.getConfigCache("F3Url", F3Url);
F5Line = dataCache.getConfigCache("F5Line", F5Line); F5Line = dataCache.getConfigCache("F5Line", F5Line);
F5Url = dataCache.getConfigCache("F5Url", F5Url); F5Url = dataCache.getConfigCache("F5Url", F5Url);
F4Line = dataCache.getConfigCache("F4Line", F4Line);
F4Url = dataCache.getConfigCache("F4Url", F4Url);
lineUrlMap.put(F2Line, F2Url); lineUrlMap.put(F2Line, F2Url);
lineUrlMap.put(F3Line, F3Url); lineUrlMap.put(F3Line, F3Url);
lineUrlMap.put(F5Line, F5Url); lineUrlMap.put(F5Line, F5Url);
lineUrlMap.put(F4Line, F4Url);
} }
...@@ -171,11 +180,11 @@ public class LizhenController { ...@@ -171,11 +180,11 @@ public class LizhenController {
for (Map<String, String> param : params) { for (Map<String, String> param : params) {
String line = param.get("LINE"); String line = param.get("LINE");
String forwardUrl = getForwardUrl(line); String forwardUrl = getForwardUrl(line);
log.info("Mes缺料预警---" + JSONObject.toJSONString(param) + ",地址为:" + forwardUrl);
if (StringUtils.isBlank(forwardUrl)){ if (StringUtils.isBlank(forwardUrl)){
log.info(line+"没有对应的地址,跳过"); log.info(line+"没有对应的地址,跳过");
continue; continue;
} }
log.info("Mes缺料预警---" + JSONObject.toJSONString(param) + ",地址为:" + forwardUrl);
String id = param.get("ID"); String id = param.get("ID");
try { try {
String result = HttpHelper.postJson(forwardUrl, param); String result = HttpHelper.postJson(forwardUrl, param);
......
package com.neotel.smfcore.custom.lizhen.innerBox.bean;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class StorageExport {
/**
* 工单序号
*/
private String hSerial = "";
/**
* 目的地(线体)
*/
private String line = "";
/**
* 当前料仓剩余未出的需求单数量
*/
private int remainTaskCount = 0;
}
...@@ -88,11 +88,22 @@ public class ExtendType { ...@@ -88,11 +88,22 @@ public class ExtendType {
public final static int VIRTUAL_PICKING_DETAIL = 15; public final static int VIRTUAL_PICKING_DETAIL = 15;
/**
* 工单出库
*/
public final static int ORDER_CHECKOUT = 16;
/**
* 自动入库
*/
public final static int AUTO_PUTIN = 17;
public static String getName(int type) { public static String getName(int type) {
String name = ""; String name = "";
switch (type) { switch (type) {
case 0: case 0:
name = "智能仓储入库"; name = "自动入库";
break; break;
case 1: case 1:
name = "智能仓储出库"; name = "智能仓储出库";
...@@ -139,6 +150,12 @@ public class ExtendType { ...@@ -139,6 +150,12 @@ public class ExtendType {
case 15: case 15:
name = "虚拟仓pk发料"; name = "虚拟仓pk发料";
break; break;
case 16:
name = "工单出库";
break;
case 17:
name = "自动入库";
break;
} }
return name; return name;
} }
......
package com.neotel.smfcore.custom.lizhen.innerBox.rest; package com.neotel.smfcore.custom.lizhen.innerBox.rest;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.common.utils.QueryHelp; import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.ReelLockPosUtil; import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.StringUtils; import com.neotel.smfcore.common.utils.StringUtils;
...@@ -18,28 +16,22 @@ import com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager; ...@@ -18,28 +16,22 @@ 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.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager; import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.Storage; import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos; import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.manager.IDataLogManager; import com.neotel.smfcore.core.system.service.manager.IDataLogManager;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.innerBox.bean.OutLotInfo; import com.neotel.smfcore.custom.lizhen.innerBox.bean.StorageExport;
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.OutLotInfoCache;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.jsonwebtoken.lang.Maps;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
...@@ -103,6 +95,12 @@ public class InnerBoxRestController { ...@@ -103,6 +95,12 @@ public class InnerBoxRestController {
String boxSide = request.getParameter("boxSide"); //料箱隔口 String boxSide = request.getParameter("boxSide"); //料箱隔口
log.info("IA 出库更新任务状态--barcode:{},status:{},loc:{},hSerial:{},outlet:{},boxSide:{}", code, status, loc, hSerial, outlet, boxSide); log.info("IA 出库更新任务状态--barcode:{},status:{},loc:{},hSerial:{},outlet:{},boxSide:{}", code, status, loc, hSerial, outlet, boxSide);
CodeBean codeBean = codeResolve.resolveSingleCode(code);
Barcode barcode = codeBean.getBarcode();
if (barcode != null){
code = barcode.getBarcode();
}
//获取到当前执行的任务 //获取到当前执行的任务
DataLog opTask = null; DataLog opTask = null;
Collection<DataLog> allTasks = taskService.getAllTasks(); Collection<DataLog> allTasks = taskService.getAllTasks();
...@@ -132,7 +130,7 @@ public class InnerBoxRestController { ...@@ -132,7 +130,7 @@ public class InnerBoxRestController {
taskService.updateQueueTask(opTask); taskService.updateQueueTask(opTask);
} else { } else {
taskService.moveTaskToFinished(opTask); taskService.moveTaskToFinished(opTask);
if (OP_STATUS.ON_INNER_LINE.name().equals(status)) { if (OP_STATUS.OUT_POS.name().equals(status)) {
//从库位中取出,需要移到完成队列中,并且清理库存 //从库位中取出,需要移到完成队列中,并且清理库存
outFromPos(opTask); outFromPos(opTask);
//清理锁定库位 //清理锁定库位
...@@ -147,65 +145,26 @@ public class InnerBoxRestController { ...@@ -147,65 +145,26 @@ public class InnerBoxRestController {
//清理锁定库位 //清理锁定库位
ReelLockPosUtil.removeReelLockPosInfo(code); ReelLockPosUtil.removeReelLockPosInfo(code);
//物料与箱子绑定
LiteOrder liteOrder = liteOrderManager.get(opTask.getSourceId()); LiteOrder liteOrder = liteOrderManager.get(opTask.getSourceId());
//如果工单号不为空时,则修改出口状态缓存 //设置绑定库位
if (StringUtils.isNotBlank(hSerial)) { StorageExport storageExport = StorageExportUtil.getExport(outlet);
List<OutLotInfo> outLotInfos = OutLotInfoCache.getOutLotInfoByCid(cid); if (storageExport != null){
List<OutLotInfo> newOutLotInfos = new ArrayList<>(); if (liteOrder != null){
boolean hasOutLot = false; storageExport.setLine(liteOrder.getLine());
if (outLotInfos != null && !outLotInfos.isEmpty()) { storageExport.setHSerial(liteOrder.getOrderNo());
for (OutLotInfo outLotInfo : outLotInfos) {
if (outLotInfo.getOutlet().equals(outlet)) { int remainTaskCount = 0;
hasOutLot = true; List<DataLog> dataLogList = taskService.getAllTasks();
if (outLotInfo.getRfid().startsWith(loc)) { for (DataLog dataLog : dataLogList) {
if ("T".equals(boxSide)) { if (dataLog.getSourceId().equals(opTask.getSourceId())){
int boxTCount = outLotInfo.getBoxTCount(); if (!dataLog.isFinished()){
outLotInfo.setBoxTCount(boxTCount + 1); remainTaskCount ++;
} else if ("B".equals(boxSide)) {
int boxBCount = outLotInfo.getBoxBCount();
outLotInfo.setBoxBCount(boxBCount + 1);
}
} else {
outLotInfo = new OutLotInfo();
if (liteOrder != null) {
outLotInfo.setLine(liteOrder.getLine());
outLotInfo.setOutlet(outlet);
outLotInfo.setCid(cid);
if ("T".equals(boxSide)) {
int boxTCount = outLotInfo.getBoxTCount();
outLotInfo.setBoxTCount(boxTCount + 1);
} else if ("B".equals(boxSide)) {
int boxBCount = outLotInfo.getBoxBCount();
outLotInfo.setBoxBCount(boxBCount + 1);
}
outLotInfo.setHSerial(hSerial);
outLotInfo.setRfid(loc);
}
} }
} }
newOutLotInfos.add(outLotInfo);
} }
storageExport.setRemainTaskCount(remainTaskCount);
StorageExportUtil.updateExport(outlet,storageExport.getHSerial(),storageExport.getLine(),storageExport.getRemainTaskCount());
} }
if (!hasOutLot) {
OutLotInfo outLotInfo = new OutLotInfo();
if (liteOrder != null) {
outLotInfo.setLine(liteOrder.getLine());
outLotInfo.setOutlet(outlet);
outLotInfo.setCid(cid);
if ("T".equals(boxSide)) {
int boxTCount = outLotInfo.getBoxTCount();
outLotInfo.setBoxTCount(boxTCount + 1);
} else if ("B".equals(boxSide)) {
int boxBCount = outLotInfo.getBoxBCount();
outLotInfo.setBoxBCount(boxBCount + 1);
}
outLotInfo.setHSerial(hSerial);
outLotInfo.setRfid(loc);
}
newOutLotInfos.add(outLotInfo);
}
OutLotInfoCache.updateOutLotInfo(cid, newOutLotInfos);
} }
} }
} }
...@@ -214,21 +173,11 @@ public class InnerBoxRestController { ...@@ -214,21 +173,11 @@ public class InnerBoxRestController {
log.info(code + "更新状态时未找到状态:" + status + ""); log.info(code + "更新状态时未找到状态:" + status + "");
} }
//得到当前料箱状态 return ResultBean.newOkResult(StorageExportUtil.getExport(outlet));
OutLotInfo outLotInfo = null;
try {
if (StringUtils.isNotBlank(loc)) {
outLotInfo = getOutLotInfoByRfid(loc, cid);
}
} catch (Exception e) {
log.error(loc + "异常");
e.printStackTrace();
}
return ResultBean.newOkResult(outLotInfo);
} }
@ApiOperation("IB 获取料箱状态信息") /*@ApiOperation("IB 获取料箱状态信息")
@RequestMapping("/getBoxStatusInfo") @RequestMapping("/getBoxStatusInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean getBoxStatusInfo(HttpServletRequest request) { public ResultBean getBoxStatusInfo(HttpServletRequest request) {
...@@ -244,9 +193,9 @@ public class InnerBoxRestController { ...@@ -244,9 +193,9 @@ public class InnerBoxRestController {
e.printStackTrace(); e.printStackTrace();
} }
return ResultBean.newOkResult(resultMap); return ResultBean.newOkResult(resultMap);
} }*/
@ApiOperation("IC 获取料架标签打印信息 或者 补打印信息") /*@ApiOperation("IC 获取料架标签打印信息 或者 补打印信息")
@RequestMapping("/rack/getPrintInfo") @RequestMapping("/rack/getPrintInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean rackPrintLabel(HttpServletRequest request) { public ResultBean rackPrintLabel(HttpServletRequest request) {
...@@ -278,9 +227,9 @@ public class InnerBoxRestController { ...@@ -278,9 +227,9 @@ public class InnerBoxRestController {
return ResultBean.newErrorResult(-1, "", "未找到需要打印的标签信息", null, false); return ResultBean.newErrorResult(-1, "", "未找到需要打印的标签信息", null, false);
} }
return ResultBean.newOkResult(resultMap); return ResultBean.newOkResult(resultMap);
} }*/
@ApiOperation("ID 料架标签打印完成通知 或 补打印完成通知") /*@ApiOperation("ID 料架标签打印完成通知 或 补打印完成通知")
@RequestMapping("/rack/finishPrint") @RequestMapping("/rack/finishPrint")
@AnonymousAccess @AnonymousAccess
public ResultBean finishPrintLabel(HttpServletRequest request) { public ResultBean finishPrintLabel(HttpServletRequest request) {
...@@ -290,38 +239,43 @@ public class InnerBoxRestController { ...@@ -290,38 +239,43 @@ public class InnerBoxRestController {
labelOrderItemMap.remove(cid); labelOrderItemMap.remove(cid);
} }
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }*/
@ApiOperation("IE 贴标前获取站位信息") @ApiOperation("IE 贴标前获取站位信息")
@RequestMapping("/getFeederInfo") @RequestMapping("/getFeederInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean getFeederInfo(HttpServletRequest request) { public ResultBean getFeederInfo(HttpServletRequest request) {
String barcode = request.getParameter("barcode");
Collection<DataLog> dataLogs = taskService.getAllTasks();
Map<String, String> resultMap = new HashMap<>(); Map<String, String> resultMap = new HashMap<>();
for (DataLog dataLog : dataLogs) {
if (dataLog.getBarcode().equals(barcode)) { String barcode = request.getParameter("barcode");
if (!dataLog.isCancel() && !dataLog.isFinished()) { CodeBean codeBean = codeResolve.resolveSingleCode(barcode);
LiteOrder liteOrder = liteOrderManager.get(dataLog.getSourceId());
LiteOrderItem liteOrderItem = liteOrderItemManager.get(dataLog.getSubSourceId()); if (codeBean.getBarcode() != null) {
if (liteOrder != null && liteOrderItem != null) { Collection<DataLog> dataLogs = taskService.getAllTasks();
resultMap.put("barcode", barcode); for (DataLog dataLog : dataLogs) {
resultMap.put("pn", dataLog.getPartNumber()); if (dataLog.getBarcode().equals(codeBean.getBarcode().getBarcode())) {
resultMap.put("station", liteOrderItem.getTableNo()); if (!dataLog.isCancel() && !dataLog.isFinished()) {
resultMap.put("side", liteOrderItem.getSide()); LiteOrder liteOrder = liteOrderManager.get(dataLog.getSourceId());
resultMap.put("hSerial", liteOrder.getOrderNo()); LiteOrderItem liteOrderItem = liteOrderItemManager.get(dataLog.getSubSourceId());
resultMap.put("line", liteOrder.getLine()); if (liteOrder != null && liteOrderItem != null) {
resultMap.put("slot", liteOrderItem.getSlot()); resultMap.put("barcode", dataLog.getBarcode());
resultMap.put("subSlot", liteOrderItem.getSubSlot()); resultMap.put("pn", dataLog.getPartNumber());
resultMap.put("station", liteOrderItem.getTableNo());
resultMap.put("side", liteOrderItem.getSide());
resultMap.put("hSerial", liteOrder.getOrderNo());
resultMap.put("line", liteOrder.getLine());
resultMap.put("slot", liteOrderItem.getSlot());
resultMap.put("subSlot", liteOrderItem.getSubSlot());
}
break;
} }
break;
} }
} }
} }
return ResultBean.newOkResult(resultMap); return ResultBean.newOkResult(resultMap);
} }
@ApiOperation("周转箱取走") /*@ApiOperation("周转箱取走")
@RequestMapping("/boxTakeAway") @RequestMapping("/boxTakeAway")
@AnonymousAccess @AnonymousAccess
public ResultBean boxTakeAway(HttpServletRequest request) { public ResultBean boxTakeAway(HttpServletRequest request) {
...@@ -346,9 +300,9 @@ public class InnerBoxRestController { ...@@ -346,9 +300,9 @@ public class InnerBoxRestController {
} }
} }
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }*/
@ApiOperation("获取当前执行的工单,是否全部都是料架信息") /*@ApiOperation("获取当前执行的工单,是否全部都是料架信息")
@RequestMapping("/getNlOutInfo") @RequestMapping("/getNlOutInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean getNlOutInfo() { public ResultBean getNlOutInfo() {
...@@ -385,10 +339,10 @@ public class InnerBoxRestController { ...@@ -385,10 +339,10 @@ public class InnerBoxRestController {
return ResultBean.newErrorResult(-1, "", "料仓与料架都有出库任务"); return ResultBean.newErrorResult(-1, "", "料仓与料架都有出库任务");
} }
return ResultBean.newOkResult(resultMap); return ResultBean.newOkResult(resultMap);
} }*/
@ApiOperation("根据料仓编号获取料仓两个出料口料箱信息") /*@ApiOperation("根据料仓编号获取料仓两个出料口料箱信息")
@RequestMapping("/getOutStateInfo") @RequestMapping("/getOutStateInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean getOutStateInfo(HttpServletRequest request) { public ResultBean getOutStateInfo(HttpServletRequest request) {
...@@ -399,10 +353,10 @@ public class InnerBoxRestController { ...@@ -399,10 +353,10 @@ public class InnerBoxRestController {
List<OutLotInfo> outLotInfos = OutLotInfoCache.getOutLotInfoByCid(cid); List<OutLotInfo> outLotInfos = OutLotInfoCache.getOutLotInfoByCid(cid);
log.info(cid + "--出料口信息为:" + JsonUtil.toJsonStr(outLotInfos)); log.info(cid + "--出料口信息为:" + JsonUtil.toJsonStr(outLotInfos));
return ResultBean.newOkResult(outLotInfos); return ResultBean.newOkResult(outLotInfos);
} }*/
//料箱送上AGV后,调用此接口,服务器将料口状态信息另存, 把当前料口状态置空 //料箱送上AGV后,调用此接口,服务器将料口状态信息另存, 把当前料口状态置空
@ApiOperation("料箱送上AGV") /*@ApiOperation("料箱送上AGV")
@RequestMapping("/boxToAgv") @RequestMapping("/boxToAgv")
@AnonymousAccess @AnonymousAccess
public ResultBean boxToAgv(HttpServletRequest request) { public ResultBean boxToAgv(HttpServletRequest request) {
...@@ -412,10 +366,10 @@ public class InnerBoxRestController { ...@@ -412,10 +366,10 @@ public class InnerBoxRestController {
log.info("料箱送上AGV---出口位置为:" + outlet + ",rfid为:" + rfid + ",AGV为:" + AGVName); log.info("料箱送上AGV---出口位置为:" + outlet + ",rfid为:" + rfid + ",AGV为:" + AGVName);
OutLotInfoCache.outLotInfoMapToOutInfos(outlet, rfid); OutLotInfoCache.outLotInfoMapToOutInfos(outlet, rfid);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }*/
@ApiOperation("获取AGV目的地") /*@ApiOperation("获取AGV目的地")
@RequestMapping("/getAgvLineInfo") @RequestMapping("/getAgvLineInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean getAgvLineInfo(HttpServletRequest request) { public ResultBean getAgvLineInfo(HttpServletRequest request) {
...@@ -437,10 +391,10 @@ public class InnerBoxRestController { ...@@ -437,10 +391,10 @@ public class InnerBoxRestController {
outLotInfo.setRackTaskCount(rackTaskCount); outLotInfo.setRackTaskCount(rackTaskCount);
log.info(rfid + "--AGV目的信息为:" + JsonUtil.toJsonStr(outLotInfo)); log.info(rfid + "--AGV目的信息为:" + JsonUtil.toJsonStr(outLotInfo));
return ResultBean.newOkResult(outLotInfo); return ResultBean.newOkResult(outLotInfo);
} }*/
@ApiOperation("博众agv获取小车目的地") /*@ApiOperation("博众agv获取小车目的地")
@RequestMapping("/getBoZhongAgvLineInfo") @RequestMapping("/getBoZhongAgvLineInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean getBoZhongAgvLineInfo(HttpServletRequest request) { public ResultBean getBoZhongAgvLineInfo(HttpServletRequest request) {
...@@ -448,10 +402,10 @@ public class InnerBoxRestController { ...@@ -448,10 +402,10 @@ public class InnerBoxRestController {
OutLotInfo outLotInfo = OutLotInfoCache.getOutLotInfoByRfidMap(rfid); OutLotInfo outLotInfo = OutLotInfoCache.getOutLotInfoByRfidMap(rfid);
log.info("获取博众AGV目的地---rfid为:" + rfid + ",outLotInfo为:" + JsonUtil.toJsonStr(outLotInfo)); log.info("获取博众AGV目的地---rfid为:" + rfid + ",outLotInfo为:" + JsonUtil.toJsonStr(outLotInfo));
return ResultBean.newOkResult(outLotInfo.getLine()); return ResultBean.newOkResult(outLotInfo.getLine());
} }*/
@ApiOperation("清理料箱信息") /* @ApiOperation("清理料箱信息")
@RequestMapping("/clearRfidInfo") @RequestMapping("/clearRfidInfo")
@AnonymousAccess @AnonymousAccess
public ResultBean clearRfidInfo(HttpServletRequest request) { public ResultBean clearRfidInfo(HttpServletRequest request) {
...@@ -460,7 +414,7 @@ public class InnerBoxRestController { ...@@ -460,7 +414,7 @@ public class InnerBoxRestController {
log.info("清理料箱信息---rfid为:" + rfid + ",source为:" + source); log.info("清理料箱信息---rfid为:" + rfid + ",source为:" + source);
OutLotInfoCache.clearRfidInfo(rfid); OutLotInfoCache.clearRfidInfo(rfid);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }*/
@ApiOperation("补打印标签信息") @ApiOperation("补打印标签信息")
@PostMapping("/fillPrint") @PostMapping("/fillPrint")
...@@ -490,14 +444,55 @@ public class InnerBoxRestController { ...@@ -490,14 +444,55 @@ public class InnerBoxRestController {
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
@ApiOperation("手动发料")
@ApiOperation("根据条码获取目的地信息")
@RequestMapping("/getLine")
@AnonymousAccess
public Map<String, Object> getLineByBarcode(@RequestBody Map<String,String> paramMap) {
Map<String, Object> resultMap = new HashMap<>();
String barcode = paramMap.get("barcode");
log.info(barcode+"获取目的地信息");
CodeBean codeBean = codeResolve.resolveSingleCode(barcode);
if (codeBean.getBarcode() != null) {
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog dataLog : allTasks) {
if (dataLog.getBarcode().equals(codeBean.getBarcode().getBarcode())) {
String sourceName = dataLog.getSourceName();
String export = StorageExportUtil.getExportByOrderNo(sourceName);
resultMap.put("export", export);
resultMap.put("height", codeBean.getBarcode().getHeight());
resultMap.put("plateSize", codeBean.getBarcode().getPlateSize());
resultMap.put("barcode", codeBean.getBarcode().getBarcode());
}
}
}
return resultMap;
}
@ApiOperation("清空出料口缓存信息")
@RequestMapping("/clearExport")
@AnonymousAccess
public ResultBean clearExport(String export){
StorageExportUtil.clearExport(export);
return ResultBean.newOkResult("");
}
@ApiOperation("获取出料口信息")
@RequestMapping("/getExport")
@AnonymousAccess
public ResultBean getExport(String export) {
StorageExport storageExport = StorageExportUtil.getExport(export);
return ResultBean.newOkResult(storageExport);
}
/*@ApiOperation("手动发料")
@PostMapping("/manualFeeding") @PostMapping("/manualFeeding")
@AnonymousAccess @AnonymousAccess
public ResultBean manualFeeding(@RequestBody Map<String, String> paramMap) { public ResultBean manualFeeding(@RequestBody Map<String, String> paramMap) {
/*if (StringUtils.isNotBlank(getManualOrderItemId())) { *//*if (StringUtils.isNotBlank(getManualOrderItemId())) {
return ResultBean.newErrorResult(-1,"","上一个物料标签请打印完成后再进行手动发料操作"); return ResultBean.newErrorResult(-1,"","上一个物料标签请打印完成后再进行手动发料操作");
}*/ }*//*
String barcodestr = paramMap.get("barcodestr"); String barcodestr = paramMap.get("barcodestr");
String orderItemId = paramMap.get("orderItemId"); String orderItemId = paramMap.get("orderItemId");
...@@ -700,7 +695,7 @@ public class InnerBoxRestController { ...@@ -700,7 +695,7 @@ public class InnerBoxRestController {
return ResultBean.newErrorResult(-1, "smfcore.order.supplementOutFail", "未找到可以出库的补料"); return ResultBean.newErrorResult(-1, "smfcore.order.supplementOutFail", "未找到可以出库的补料");
} }
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }*/
public void setLabelOrderItemId(String cid,String orderItemId) { public void setLabelOrderItemId(String cid,String orderItemId) {
...@@ -744,7 +739,7 @@ public class InnerBoxRestController { ...@@ -744,7 +739,7 @@ public class InnerBoxRestController {
dataCache.updateInventory(storagePos, barcode); dataCache.updateInventory(storagePos, barcode);
} }
private OutLotInfo getOutLotInfoByRfid(String rfid, String cid) { /*private OutLotInfo getOutLotInfoByRfid(String rfid, String cid) {
if (rfid.endsWith("A") || rfid.endsWith("B")) { if (rfid.endsWith("A") || rfid.endsWith("B")) {
rfid = rfid.substring(0, rfid.length() - 1); rfid = rfid.substring(0, rfid.length() - 1);
} }
...@@ -773,7 +768,7 @@ public class InnerBoxRestController { ...@@ -773,7 +768,7 @@ public class InnerBoxRestController {
outLotInfo.setRackTaskCount(rackTaskCount); outLotInfo.setRackTaskCount(rackTaskCount);
} }
return outLotInfo; return outLotInfo;
} }*/
private Map<String, Object> getBoxStatusByBoxNumber(String boxNumber, String cid) { private Map<String, Object> getBoxStatusByBoxNumber(String boxNumber, String cid) {
/*if (boxNumber.indexOf("-") != -1) { /*if (boxNumber.indexOf("-") != -1) {
...@@ -842,7 +837,7 @@ public class InnerBoxRestController { ...@@ -842,7 +837,7 @@ public class InnerBoxRestController {
return resultMap; return resultMap;
} }
public static void setManualOrderItemIdList(String orderItemId) { /*public static void setManualOrderItemIdList(String orderItemId) {
manualOrderItemIdList.add(orderItemId); manualOrderItemIdList.add(orderItemId);
} }
...@@ -874,5 +869,5 @@ public class InnerBoxRestController { ...@@ -874,5 +869,5 @@ public class InnerBoxRestController {
return "false"; return "false";
} }
return ""; return "";
} }*/
} }
...@@ -92,6 +92,7 @@ public class VirtualRestController { ...@@ -92,6 +92,7 @@ public class VirtualRestController {
public synchronized ResultBean putIn(@RequestBody Map<String, String> paramMap) { public synchronized ResultBean putIn(@RequestBody Map<String, String> paramMap) {
String posName = paramMap.get("posName"); String posName = paramMap.get("posName");
String code = paramMap.get("code"); String code = paramMap.get("code");
String warehouseCode = paramMap.get("warehouseCode");
String newCode = code.toUpperCase(); String newCode = code.toUpperCase();
//开始解析code //开始解析code
CodeBean codeBean = codeResolve.resolveSingleCode("=7x8=" + newCode); CodeBean codeBean = codeResolve.resolveSingleCode("=7x8=" + newCode);
...@@ -157,7 +158,7 @@ public class VirtualRestController { ...@@ -157,7 +158,7 @@ public class VirtualRestController {
//判断是否为禁用料 //判断是否为禁用料
try { try {
smfApi.canPutInAfterResolve(barcode); barcode = smfApi.canPutInAfterResolve(barcode);
} catch (Exception e){ } catch (Exception e){
return ResultBean.newErrorResult(-1,"",e.getMessage()); return ResultBean.newErrorResult(-1,"",e.getMessage());
} }
...@@ -168,6 +169,9 @@ public class VirtualRestController { ...@@ -168,6 +169,9 @@ public class VirtualRestController {
return ResultBean.newErrorResult(-1, "smfcore.storagePos.existBarcode", "{}已存在库位{}中", new String[]{barcode.getBarcode(), pos.getPosName()}); return ResultBean.newErrorResult(-1, "smfcore.storagePos.existBarcode", "{}已存在库位{}中", new String[]{barcode.getBarcode(), pos.getPosName()});
} }
//放入虚拟仓 //放入虚拟仓
if (StringUtils.isNotBlank(warehouseCode)){
barcode.setWarehouseCode(warehouseCode);
}
intoVirtualPos(posName,barcode,""); intoVirtualPos(posName,barcode,"");
return ResultBean.newOkResult(barcode.getBarcode()+"已经放入库位中:"+posName); return ResultBean.newOkResult(barcode.getBarcode()+"已经放入库位中:"+posName);
} }
...@@ -204,6 +208,14 @@ public class VirtualRestController { ...@@ -204,6 +208,14 @@ public class VirtualRestController {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.noValidCode", "无效的条码"); return ResultBean.newErrorResult(-1, "smfcore.error.barcode.noValidCode", "无效的条码");
} }
Barcode barcode = codeBean.getBarcode(); Barcode barcode = codeBean.getBarcode();
//判断是否为禁用料
try {
barcode = smfApi.canPutInAfterResolve(barcode);
} catch (Exception e){
return ResultBean.newErrorResult(-1,"",e.getMessage());
}
//判断是否为虚拟仓 //判断是否为虚拟仓
String barcodeStr = barcode.getBarcode(); String barcodeStr = barcode.getBarcode();
StoragePos pos = storagePosManager.getByBarcode(barcodeStr); StoragePos pos = storagePosManager.getByBarcode(barcodeStr);
...@@ -215,11 +227,16 @@ public class VirtualRestController { ...@@ -215,11 +227,16 @@ public class VirtualRestController {
DataLog dataLog = new DataLog(storage, barcode, pos); DataLog dataLog = new DataLog(storage, barcode, pos);
dataLog.setStatus(OP_STATUS.FINISHED.name()); dataLog.setStatus(OP_STATUS.FINISHED.name());
dataLog.setType(OP.CHECKOUT); dataLog.setType(OP.CHECKOUT);
if (storage.isVirtual()) { dataLog.setExtendType(ExtendType.MANUAL_CHECKOUT); //手动出库
dataLog.setExtendType(ExtendType.VIRTUAL_CHECKOUT); //虚拟出库 dataLog.setWarehouseCode(barcode.getWarehouseCode());
} else { dataLog.setDescribe(barcode.getDescribe());
dataLog.setExtendType(ExtendType.STORAGE_CHECKOUT); //手动出库 dataLog.setBatchInfo(barcode.getBatch());
} dataLog.setDateCode(barcode.getDateCode());
dataLog.setProvider(barcode.getProvider());
dataLog.setProviderNumber(barcode.getProviderNumber());
dataLog.setKeeperCode(barcode.getKeeperCode());
dataLog.setCreator(SecurityUtils.getCurrentUsername());
barcodeManager.delete(barcode); barcodeManager.delete(barcode);
taskService.updateFinishedTask(dataLog); taskService.updateFinishedTask(dataLog);
taskService.removeFinishedTask(dataLog); taskService.removeFinishedTask(dataLog);
...@@ -237,6 +254,13 @@ public class VirtualRestController { ...@@ -237,6 +254,13 @@ public class VirtualRestController {
dataLog.setType(OP.CHECKOUT); dataLog.setType(OP.CHECKOUT);
//dataLog.setPosName("人工"); //dataLog.setPosName("人工");
dataLog.setExtendType(ExtendType.MANUAL_CHECKOUT); //手动出库 dataLog.setExtendType(ExtendType.MANUAL_CHECKOUT); //手动出库
dataLog.setWarehouseCode(barcode.getWarehouseCode());
dataLog.setDescribe(barcode.getDescribe());
dataLog.setBatchInfo(barcode.getBatch());
dataLog.setDateCode(barcode.getDateCode());
dataLog.setProvider(barcode.getProvider());
dataLog.setKeeperCode(barcode.getKeeperCode());
dataLog.setCreator(SecurityUtils.getCurrentUsername());
taskService.updateFinishedTask(dataLog); taskService.updateFinishedTask(dataLog);
taskService.removeFinishedTask(dataLog); taskService.removeFinishedTask(dataLog);
} }
...@@ -401,7 +425,16 @@ public class VirtualRestController { ...@@ -401,7 +425,16 @@ public class VirtualRestController {
pos.setStorageId(storage.getId()); pos.setStorageId(storage.getId());
pos = storagePosManager.save(pos); pos = storagePosManager.save(pos);
DataLog dataLog = generateTask(storage, barcode, pos, OP.PUT_IN, OP_STATUS.FINISHED.name(), null); DataLog dataLog = generateTask(storage, barcode, pos, OP.PUT_IN, OP_STATUS.FINISHED.name(), null);
dataLog.setExtendType(ExtendType.VIRTUAL_PUTIN); //虚拟入库 dataLog.setExtendType(ExtendType.MANUAL_PUTIN); //手动入库
dataLog.setWarehouseCode(barcode.getWarehouseCode());
dataLog.setDescribe(barcode.getDescribe());
dataLog.setBatchInfo(barcode.getBatch());
dataLog.setDateCode(barcode.getDateCode());
dataLog.setProvider(barcode.getProvider());
dataLog.setProviderNumber(barcode.getProviderNumber());
dataLog.setKeeperCode(barcode.getKeeperCode());
dataLog.setCreator(SecurityUtils.getCurrentUsername());
if (StringUtils.isNotBlank(orderNo)){ if (StringUtils.isNotBlank(orderNo)){
dataLog.setSourceName(orderNo); dataLog.setSourceName(orderNo);
} }
......
/*
package com.neotel.smfcore.custom.lizhen.innerBox.util; package com.neotel.smfcore.custom.lizhen.innerBox.util;
import com.neotel.smfcore.common.utils.Constants; import com.neotel.smfcore.common.utils.Constants;
...@@ -50,12 +51,14 @@ public class OutLotInfoCache { ...@@ -50,12 +51,14 @@ public class OutLotInfoCache {
} }
} }
/** */
/**
* 根据cid获取料口状态信息 * 根据cid获取料口状态信息
* *
* @param cid * @param cid
* @return * @return
*/ *//*
public static List<OutLotInfo> getOutLotInfoByCid(String cid) { public static List<OutLotInfo> getOutLotInfoByCid(String cid) {
List<OutLotInfo> outLotInfos = outLotInfoMap.get(cid); List<OutLotInfo> outLotInfos = outLotInfoMap.get(cid);
if (outLotInfos == null) { if (outLotInfos == null) {
...@@ -64,13 +67,16 @@ public class OutLotInfoCache { ...@@ -64,13 +67,16 @@ public class OutLotInfoCache {
return outLotInfos; return outLotInfos;
} }
/** */
/**
* 修改缓存信息 * 修改缓存信息
* @param cid * @param cid
* @param outLotInfos * @param outLotInfos
*/ *//*
public static synchronized void updateOutLotInfo(String cid, List<OutLotInfo> outLotInfos) { public static synchronized void updateOutLotInfo(String cid, List<OutLotInfo> outLotInfos) {
/* List<OutLotInfo> outLotInfos = outLotInfoMap.get(cid); */
/* List<OutLotInfo> outLotInfos = outLotInfoMap.get(cid);
List<OutLotInfo> newOutLotInfos = new ArrayList<>(); List<OutLotInfo> newOutLotInfos = new ArrayList<>();
boolean hasOutLot = false; boolean hasOutLot = false;
if (outLotInfos != null && !outLotInfos.isEmpty()) { if (outLotInfos != null && !outLotInfos.isEmpty()) {
...@@ -85,7 +91,8 @@ public class OutLotInfoCache { ...@@ -85,7 +91,8 @@ public class OutLotInfoCache {
if (!hasOutLot) { if (!hasOutLot) {
newOutLotInfos.add(outLotInfo); newOutLotInfos.add(outLotInfo);
}*/ }*//*
outLotInfoMap.put(cid, outLotInfos); outLotInfoMap.put(cid, outLotInfos);
dataCache.updateCache(Constants.CACHE_outLotInfoMap, outLotInfoMap); dataCache.updateCache(Constants.CACHE_outLotInfoMap, outLotInfoMap);
} }
...@@ -146,7 +153,9 @@ public class OutLotInfoCache { ...@@ -146,7 +153,9 @@ public class OutLotInfoCache {
List<OutLotInfo> newOutLotInfos = new ArrayList<>(); List<OutLotInfo> newOutLotInfos = new ArrayList<>();
List<OutLotInfo> outLotInfoValues = outLotInfoEntry.getValue(); List<OutLotInfo> outLotInfoValues = outLotInfoEntry.getValue();
for (OutLotInfo outLotInfoValue : outLotInfoValues) { for (OutLotInfo outLotInfoValue : outLotInfoValues) {
if (outLotInfoValue.getRfid().startsWith(rfid) /*&& outLotInfoValue.getOutlet().equals(outlet)*/) { if (outLotInfoValue.getRfid().startsWith(rfid) */
/*&& outLotInfoValue.getOutlet().equals(outlet)*//*
) {
outLotInfo = outLotInfoValue; outLotInfo = outLotInfoValue;
} else { } else {
newOutLotInfos.add(outLotInfoValue); newOutLotInfos.add(outLotInfoValue);
...@@ -173,3 +182,4 @@ public class OutLotInfoCache { ...@@ -173,3 +182,4 @@ public class OutLotInfoCache {
OutLotInfoCache.dataCache = dataCache; OutLotInfoCache.dataCache = dataCache;
} }
} }
*/
package com.neotel.smfcore.custom.lizhen.innerBox.util;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.lizhen.innerBox.bean.StorageExport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Component
public class StorageExportUtil {
private static DataCache dataCache;
@Autowired
void setDataCache(DataCache cache) {
dataCache = cache;
}
//出料口名称
private final String[] exportStr = new String[]{"MU1_1", "MU1_2", "MU2_1", "MU4_1", "MU4_2", "MU5_1", "MU5_2"};
//料仓前缀
private static final String EXPORT_PREFIX = "Storage_Export";
//出口信息缓存
private static Map<String, StorageExport> exportMap = new ConcurrentHashMap<>();
//初始化出料口信息
@PostConstruct
void initExport() {
for (String export : exportStr) {
StorageExport storageExport = dataCache.getCache(EXPORT_PREFIX + "_" + export);
if (storageExport == null) {
storageExport = new StorageExport();
}
exportMap.put(export, storageExport);
}
}
//根据工单号,获取目的地信息
public static synchronized String getExportByOrderNo(String orderNo) {
if (StringUtils.isBlank(orderNo)) {
return "";
}
String exportStr = "";
//判断是否有相同工单
for (Map.Entry<String, StorageExport> entry : exportMap.entrySet()) {
StorageExport export = entry.getValue();
if (orderNo.equals(export.getHSerial())) {
exportStr = entry.getKey();
break;
}
}
//判断是否为新工单
if (StringUtils.isBlank(exportStr)) {
for (Map.Entry<String, StorageExport> entry : exportMap.entrySet()) {
StorageExport export = entry.getValue();
if (StringUtils.isBlank(export.getHSerial())){
exportStr = entry.getKey();
break;
}
}
}
return exportStr;
}
//清空出料口信息
public static void clearExport(String key) {
if (exportMap.get(key) != null) {
StorageExport storageExport = new StorageExport();
exportMap.put(key, storageExport);
dataCache.updateCache(EXPORT_PREFIX + "_" + key, storageExport);
}
}
//更新出料口信息
public static void updateExport(String key, String hSerial, String line, int remainTaskCount) {
StorageExport storageExport = exportMap.get(key);
if (storageExport != null) {
if (StringUtils.isNotBlank(hSerial)) {
storageExport.setHSerial(hSerial);
}
if (StringUtils.isNotBlank(line)) {
storageExport.setLine(line);
}
storageExport.setRemainTaskCount(remainTaskCount);
exportMap.put(key,storageExport);
dataCache.updateCache(EXPORT_PREFIX + "_" + key, storageExport);
}
}
//获取出料口信息
public static StorageExport getExport(String key) {
StorageExport storageExport = exportMap.get(key);
if (storageExport == null) {
storageExport = new StorageExport();
}
return storageExport;
}
}
package com.neotel.smfcore.custom.lizhen.report.bacheng;
import com.google.common.collect.Lists;
import com.neotel.smfcore.common.base.IExcelDownLoad;
import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.rest.mapstruct.StoragePosMapper;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.manager.IDataLogManager;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.custom.lizhen.report.bacheng.bean.dto.BCChange;
import com.neotel.smfcore.custom.lizhen.report.bacheng.bean.dto.BCExpire;
import com.neotel.smfcore.custom.lizhen.report.bacheng.bean.dto.BCInventory;
import com.neotel.smfcore.custom.lizhen.report.bacheng.bean.query.BcQuery;
import com.neotel.smfcore.custom.lizhen.util.ExpireDateUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@RestController
@RequestMapping("/bcReport")
public class BCReportController {
//厂别
@Value("${bc.plant}")
private String BCPlant;
//厂区
@Value("${bc.factory}")
private String BCFactory;
@Autowired
private IStoragePosManager storagePosManager;
@Autowired
private IDataLogManager dataLogManager;
@Autowired
private DataCache dataCache;
/**
* 库位报表
*
* @param query
* @param pageable
* @return
*/
@RequestMapping("/getInventory")
@AnonymousAccess
public PageData getInventory(BcQuery query, Pageable pageable) {
Query q = QueryHelp.getQuery(query);
q.addCriteria(Criteria.where("barcode").exists(true));
PageData<StoragePos> pageData = storagePosManager.findByPage(q, pageable);
List<BCInventory> inventoryList = getBCInventory(pageData.getContent());
return new PageData(inventoryList, pageData.getTotalElements());
}
/**
* 库存导出
* @param query
*/
@RequestMapping("/getInventory/download")
@AnonymousAccess
public void getInventoryDownload(BcQuery query, Pageable pageable, HttpServletResponse response) {
Query q = QueryHelp.getQuery(query);
q.addCriteria(Criteria.where("barcode").exists(true));
try {
FileUtil.downloadExcel(q, pageable, response, new IExcelDownLoad() {
@Override
public List<List<String>> getHeader() {
List<List<String>> headerList = new ArrayList<>();
headerList.add(Lists.newArrayList("厂别"));
headerList.add(Lists.newArrayList("厂区"));
headerList.add(Lists.newArrayList("库别"));
headerList.add(Lists.newArrayList("料号"));
headerList.add(Lists.newArrayList("物料描述"));
headerList.add(Lists.newArrayList("ID NO"));
headerList.add(Lists.newArrayList("储位"));
headerList.add(Lists.newArrayList("数量"));
headerList.add(Lists.newArrayList("卷数"));
headerList.add(Lists.newArrayList("厂商"));
headerList.add(Lists.newArrayList("LOT"));
headerList.add(Lists.newArrayList("D/C"));
headerList.add(Lists.newArrayList("keeper"));
headerList.add(Lists.newArrayList("禁用信息"));
headerList.add(Lists.newArrayList("入库时间"));
headerList.add(Lists.newArrayList("工号"));
return headerList;
}
@Override
public List<List<Object>> getPageData(Query query, Pageable pageable) {
List<List<Object>> dataList = new ArrayList<>();
List<StoragePos> storagePosList = storagePosManager.findByQuery(query, pageable);
List<BCInventory> inventoryList = getBCInventory(storagePosList);
for (BCInventory bcInventory : inventoryList) {
List<Object> result = new ArrayList<>();
result.add(bcInventory.getPlant());
result.add(bcInventory.getFactory());
result.add(bcInventory.getWarehouseCode());
result.add(bcInventory.getPartNumber());
result.add(bcInventory.getDescribe());
result.add(bcInventory.getBarcode());
result.add(bcInventory.getPosName());
result.add(bcInventory.getAmount());
result.add(bcInventory.getReelAmount());
result.add(bcInventory.getProvider());
result.add(bcInventory.getBatch());
result.add(bcInventory.getDateCode());
result.add(bcInventory.getKeeperCode());
result.add(bcInventory.getDisableMsg());
result.add(bcInventory.getPutInDate());
result.add(bcInventory.getCreator());
dataList.add(result);
}
return dataList;
}
});
} catch (IOException e) {
e.printStackTrace();
log.error("库存导出失败", e);
}
}
/**
* 过期报表
*
* @param query
* @param pageable
* @return
*/
@RequestMapping("/getExpire")
@AnonymousAccess
public PageData getExpire(BcQuery query, Pageable pageable) {
Query q = QueryHelp.getQuery(query);
q.addCriteria(Criteria.where("barcode").exists(true).and("barcode.expireDate").lt(new Date()));
PageData<StoragePos> pageData = storagePosManager.findByPage(q, pageable);
List<BCExpire> expireList = getBCExpire(pageData.getContent());
return new PageData(expireList, pageData.getTotalElements());
}
/**
* 过期报表导出
* @param query
* @param pageable
* @param response
*/
@RequestMapping("/getExpire/download")
@AnonymousAccess
public void expireDownload(BcQuery query, Pageable pageable, HttpServletResponse response){
Query q = QueryHelp.getQuery(query);
q.addCriteria(Criteria.where("barcode").exists(true).and("barcode.expireDate").lt(new Date()));
try {
FileUtil.downloadExcel(q, pageable, response, new IExcelDownLoad() {
@Override
public List<List<String>> getHeader() {
List<List<String>> headerList = new ArrayList<>();
headerList.add(Lists.newArrayList("厂别"));
headerList.add(Lists.newArrayList("厂区"));
headerList.add(Lists.newArrayList("库别"));
headerList.add(Lists.newArrayList("料号"));
headerList.add(Lists.newArrayList("物料描述"));
headerList.add(Lists.newArrayList("数量"));
headerList.add(Lists.newArrayList("储位"));
headerList.add(Lists.newArrayList("keeper"));
headerList.add(Lists.newArrayList("ID NO"));
headerList.add(Lists.newArrayList("LOT"));
headerList.add(Lists.newArrayList("D/C"));
headerList.add(Lists.newArrayList("增加物料保质期"));
headerList.add(Lists.newArrayList("过期天数"));
headerList.add(Lists.newArrayList("过期日期"));
headerList.add(Lists.newArrayList("备注"));
return headerList;
}
@Override
public List<List<Object>> getPageData(Query query, Pageable pageable) {
List<List<Object>> dataList = new ArrayList<>();
List<StoragePos> storagePosList = storagePosManager.findByQuery(query, pageable);
List<BCExpire> bcExpireList = getBCExpire(storagePosList);
for (BCExpire expire : bcExpireList) {
List<Object> result = new ArrayList<>();
result.add(expire.getPlant());
result.add(expire.getFactory());
result.add(expire.getWarehouseCode());
result.add(expire.getPartNumber());
result.add(expire.getDescribe());
result.add(expire.getAmount());
result.add(expire.getPosName());
result.add(expire.getKeeperCode());
result.add(expire.getBarcode());
result.add(expire.getBatch());
result.add(expire.getDateCode());
result.add(expire.getExpireYear());
result.add(expire.getExpireDays());
result.add(expire.getExpireDate());
result.add(expire.getRemark());
dataList.add(result);
}
return dataList;
}
});
} catch (IOException e) {
e.printStackTrace();
log.error("过期报表导出失败",e);
}
}
/**
* 事务报表
*
* @param query
* @param pageable
* @return
*/
@RequestMapping("/change")
@AnonymousAccess
public PageData change(BcQuery query, Pageable pageable) {
Query q = QueryHelp.getQuery(query);
PageData<DataLog> pageData = dataLogManager.findByPage(q, pageable);
return new PageData(getChange(pageData.getContent()), pageData.getTotalElements());
}
/**
* 异动导出
*
* @param
* @return
*/
@RequestMapping("/change/download")
@AnonymousAccess
public void changeDownload(BcQuery query, Pageable pageable, HttpServletResponse response) {
Query q = QueryHelp.getQuery(query);
try {
FileUtil.downloadExcel(q, pageable, response, new IExcelDownLoad() {
@Override
public List<List<String>> getHeader() {
List<List<String>> headerList = new ArrayList<>();
headerList.add(Lists.newArrayList("厂别"));
headerList.add(Lists.newArrayList("厂区"));
headerList.add(Lists.newArrayList("库别"));
headerList.add(Lists.newArrayList("料号"));
headerList.add(Lists.newArrayList("物料描述"));
headerList.add(Lists.newArrayList("异动数量"));
headerList.add(Lists.newArrayList("卷数"));
headerList.add(Lists.newArrayList("储位"));
headerList.add(Lists.newArrayList("异动类型"));
headerList.add(Lists.newArrayList("ID NO"));
headerList.add(Lists.newArrayList("LOT"));
headerList.add(Lists.newArrayList("D/C"));
headerList.add(Lists.newArrayList("厂商"));
headerList.add(Lists.newArrayList("厂商代码"));
headerList.add(Lists.newArrayList("keeper"));
headerList.add(Lists.newArrayList("事务日期"));
headerList.add(Lists.newArrayList("工号"));
return headerList;
}
@Override
public List<List<Object>> getPageData(Query query, Pageable pageable) {
List<List<Object>> resultList = new ArrayList<>();
PageData<DataLog> pageData = dataLogManager.findByPage(query, pageable);
List<DataLog> dataLogList = pageData.getContent();
List<BCChange> changeList = getChange(dataLogList);
for (BCChange bcChange : changeList) {
List<Object> dataList = new ArrayList<>();
dataList.add(bcChange.getPlant());
dataList.add(bcChange.getFactory());
dataList.add(bcChange.getWarehouseCode());
dataList.add(bcChange.getPartNumber());
dataList.add(bcChange.getDescribe());
dataList.add(bcChange.getNum());
dataList.add(bcChange.getReelAmount());
dataList.add(bcChange.getPosName());
dataList.add(bcChange.getType());
dataList.add(bcChange.getBarcode());
dataList.add(bcChange.getBatch());
dataList.add(bcChange.getDateCode());
dataList.add(bcChange.getProvider());
dataList.add(bcChange.getProviderNumber());
dataList.add(bcChange.getKeeperCode());
dataList.add(bcChange.getCreateDate());
dataList.add(bcChange.getCreator());
resultList.add(dataList);
}
return resultList;
}
});
} catch (IOException e) {
e.printStackTrace();
log.error("异动导出失败");
}
}
/**
* 分组
*
* @param type 0是按厂商 其他按料号
* @return
*/
@RequestMapping("/group")
@AnonymousAccess
public PageData group(String type) {
Map<String, Long> resultMap = new HashMap<>();
List<StoragePos> storagePosList = storagePosManager.findNotEmpty();
List<Barcode> barcodeList = storagePosList.stream().map(item -> item.getBarcode()).collect(Collectors.toList());
if ("1".equals(type)) {
resultMap = barcodeList.stream().collect(Collectors.groupingBy(Barcode::getProvider, Collectors.counting()));
} else if ("2".equals(type)) {
resultMap = barcodeList.stream().collect(Collectors.groupingBy(Barcode::getPartNumber, Collectors.counting()));
}
List<Map<String, Object>> resultList = new ArrayList<>();
for (Map.Entry<String, Long> entry : resultMap.entrySet()) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("pn", entry.getKey());
paramMap.put("amount", entry.getValue());
resultList.add(paramMap);
}
return new PageData(resultList, resultList.size());
}
private List<BCChange> getChange(List<DataLog> dataLogList) {
List<BCChange> changeList = new ArrayList<>();
for (DataLog dataLog : dataLogList) {
BCChange bcChange = new BCChange();
BeanUtils.copyProperties(dataLog,bcChange);
bcChange.setPlant(BCPlant);
bcChange.setFactory(BCFactory);
bcChange.setReelAmount(1);
bcChange.setPosName(dataLog.getPosStr());
//TODO 要修改
bcChange.setType(ExtendType.getName(dataLog.getExtendType()));
bcChange.setBatch(dataLog.getBatchInfo());
bcChange.setProviderNumber(dataLog.getProviderNumber());
bcChange.setNum(dataLog.getNum());
changeList.add(bcChange);
}
return changeList;
}
private List<BCExpire> getBCExpire(List<StoragePos> storagePosList) {
List<BCExpire> expireList = new ArrayList<>();
for (StoragePos storagePos : storagePosList) {
BCExpire expire = new BCExpire();
BeanUtils.copyProperties(storagePos, expire);
Barcode barcode = storagePos.getBarcode();
BeanUtils.copyProperties(barcode, expire);
expire.setPlant(BCPlant);
expire.setFactory(BCFactory);
expire.setExpireDays(ExpireDateUtil.getExpireDays(expire.getExpireDate()));
expire.setReelAmount(1);
expire.setPosName(dataCache.getStorageById(storagePos.getStorageId()).getName() + "[" + storagePos.getPosName() + "]");
expireList.add(expire);
}
return expireList;
}
private List<BCInventory> getBCInventory(List<StoragePos> storagePosList) {
List<BCInventory> inventoryList = new ArrayList<>();
for (StoragePos storagePos : storagePosList) {
BCInventory bcInventory = new BCInventory();
BeanUtils.copyProperties(storagePos, bcInventory);
Barcode barcode = storagePos.getBarcode();
BeanUtils.copyProperties(barcode, bcInventory);
bcInventory.setPlant(BCPlant);
bcInventory.setFactory(BCFactory);
bcInventory.setReelAmount(1);
bcInventory.setPosName(dataCache.getStorageById(storagePos.getStorageId()).getName() + "[" + storagePos.getPosName() + "]");
inventoryList.add(bcInventory);
}
return inventoryList;
}
}
package com.neotel.smfcore.custom.lizhen.report.bacheng.bean.dto;
import lombok.Data;
import java.util.Date;
/**
* 异动报表
*/
@Data
public class BCChange {
//厂别
private String plant;
//厂区
private String factory;
//库别
private String warehouseCode;
//料号
private String partNumber;
//物料描述
private String describe;
//异动数量
private int num;
//卷数
private int reelAmount;
//储位
private String posName;
//异动类型
private String type;
//ID NO
private String barcode;
//LOT
private String batch;
//D/C
private String dateCode;
//厂商
private String provider;
//厂商代码
private String providerNumber;
//Keeper
private String keeperCode;
//事务日期
private Date createDate;
//工号
private String creator;
}
package com.neotel.smfcore.custom.lizhen.report.bacheng.bean.dto;
import lombok.Data;
import java.util.Date;
@Data
public class BCExpire {
/**
* 厂别
*/
private String plant;
/**
* 厂区
*/
private String factory;
/**
* 料号
*/
private String partNumber;
/**
* 描述
*/
private String describe;
/**
* ID NO
*/
private String barcode;
/**
* 储位
*/
private String posName;
/**
* 数量
*/
private int amount;
/**
* 卷数
*/
private int reelAmount = 1;
/**
* 厂商
*/
private String provider;
/**
* lot
*/
private String batch = "";
/**
* d/c
*/
private String dateCode;
/**
* keeper
*/
private String keeperCode;
/**
* 物料保质期(年)
*/
private int expireYear = 1;
/**
* 过期天数
*/
private long expireDays;
/**
* 过期时间
*/
private Date expireDate;
/**
* 备注
*/
private String remark;
/**
* 库别
*/
private String warehouseCode;
}
package com.neotel.smfcore.custom.lizhen.report.bacheng.bean.dto;
import lombok.Data;
import java.util.Date;
@Data
public class BCInventory {
/**
* 厂别
*/
private String plant;
/**
* 厂区
*/
private String factory;
/**
* 库别
*/
private String warehouseCode;
/**
* 料号
*/
private String partNumber;
/**
* 描述
*/
private String describe;
/**
* ID NO
*/
private String barcode;
/**
* 储位
*/
private String posName;
/**
* 数量
*/
private int amount;
/**
* 卷数
*/
private int reelAmount = 1;
/**
* 厂商
*/
private String provider;
/**
* lot
*/
private String batch="";
/**
* d/c
*/
private String dateCode;
/**
* keeper
*/
private String keeperCode;
/**
* 禁用信息
*/
private String disableMsg;
/**
* 入库时间
*/
private Date putInDate;
/**
* 工号
*/
private String creator;
}
package com.neotel.smfcore.custom.lizhen.report.bacheng.bean.query;
import com.neotel.smfcore.common.annotation.QueryCondition;
import com.neotel.smfcore.common.bean.BetweenData;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class BcQuery {
@QueryCondition(blurry = "barcode.partNumber,partNumber")
private String pn;
@QueryCondition(blurry = "barcode.partNumber")
private String partNumber;
@QueryCondition(blurry = "barcode.provider")
private String provider;
@QueryCondition(blurry = "barcode.warehouseCode,warehouseCode")
private String warehouseCode;
@QueryCondition(blurry = "posName")
private String posName;
@QueryCondition(blurry = "barcode.barcode,barcode")
private String barcode;
@QueryCondition(blurry = "barcode.dateCode")
private String dateCode;
@QueryCondition(blurry = "barcode.batch")
private String batch;
@QueryCondition(blurry = "barcode.keeperCode")
private String keeperCode;
@QueryCondition(propName = "extendType",type = QueryCondition.Type.EQ)
private Integer extendType;
@QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "updateDate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private BetweenData<Date> updateDate;
}
...@@ -537,7 +537,7 @@ public class InnerReportController { ...@@ -537,7 +537,7 @@ public class InnerReportController {
@AnonymousAccess @AnonymousAccess
public PageData disable(ReportQueryCondition queryCondition, Pageable pageable) { public PageData disable(ReportQueryCondition queryCondition, Pageable pageable) {
Query query = QueryHelp.getQuery(queryCondition); Query query = QueryHelp.getQuery(queryCondition);
query.addCriteria(Criteria.where("disableMsg").nin("").exists(true)); query.addCriteria(Criteria.where("disableMsg").nin("").exists(true).and("posName").ne("").exists(true));
PageData<BarcodeDto> resultData = new PageData<>(); PageData<BarcodeDto> resultData = new PageData<>();
if (pageable != null) { if (pageable != null) {
PageData<Barcode> data = barcodeManager.findByPage(query, pageable); PageData<Barcode> data = barcodeManager.findByPage(query, pageable);
......
...@@ -3,20 +3,26 @@ server: ...@@ -3,20 +3,26 @@ server:
api: api:
name: Lizhen name: Lizhen
inCheckUrl: #http://172.30.170.148:8001/Npm/WmsCheckReelfob #禁用料 inCheckUrl: #http://10.190.25.124:8001/Npm/WmsCheckReelfob #禁用料
batchCheckUrl: #http://172.30.60.117:8001/Npm/WmsCheckReelfob_Batch #批量禁用料 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://10.190.25.124: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://10.190.25.124:8001/Sct/GetReelInfo #mes数量
fetchGRUrl: #http://10.42.25.199:8082/api/wcs/fetchGR #gr标签 fetchGRUrl: #http://10.42.25.199:8082/api/wcs/fetchGR #gr标签
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://172.30.60.117:8001/Sct/CheckReelMeasure #外仓散料仓量测接口 checkReelMeasure: #http://10.190.25.149:8001/Sct/CheckReelMeasure #散料量测接口
plant: W337 plant:
werks: W337 werks:
outerFactory: B15 outerFactory:
bc:
plant: 2810
factory: B3
#缺料预警对应的地址 #缺料预警对应的地址
lizhen: lizhen:
...@@ -32,6 +38,11 @@ lizhen: ...@@ -32,6 +38,11 @@ lizhen:
name: 5F name: 5F
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
F4:
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
url: http://172.25.252.12:8001/smf-core/api/Mes/machineCallMaterial
#转发地址 #转发地址
forward: forward:
...@@ -87,5 +98,5 @@ app: ...@@ -87,5 +98,5 @@ app:
type: "" type: ""
menu: menu:
show: show: menu,workOrder,virWarehous,warehouseMaintenance,innerInventory,expiredReport,menu,innerChangeReport,innerProLimitReport
hide: hide:
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!