Commit 2aa4b15c LN

增加锁定物料功能

1 个父辈 b1ebd671
...@@ -174,6 +174,7 @@ public class MenuInit { ...@@ -174,6 +174,7 @@ public class MenuInit {
//报表:出入库、库存 //报表:出入库、库存
Menu pMenuReport = Menu.CreatePMenu("报表", 7, "report","inOutData",null); Menu pMenuReport = Menu.CreatePMenu("报表", 7, "report","inOutData",null);
addDefaultFunctionMenu(70, pMenuReport, "锁定物料", "lockMaterials", "system/lockMaterials/index", "lockMaterial");
addDefaultFunctionMenu(71, pMenuReport, "出入库", "inOutData", "neolight/inOutData/index", "outPut"); addDefaultFunctionMenu(71, pMenuReport, "出入库", "inOutData", "neolight/inOutData/index", "outPut");
addDefaultFunctionMenu(72, pMenuReport,"库存", "inventory", "neolight/inventory/index", "inventory"); addDefaultFunctionMenu(72, pMenuReport,"库存", "inventory", "neolight/inventory/index", "inventory");
addDefaultFunctionMenu(73, pMenuReport,"温湿度", "humiture", "humiture/humitureReport/index", "humiture"); addDefaultFunctionMenu(73, pMenuReport,"温湿度", "humiture", "humiture/humitureReport/index", "humiture");
......
...@@ -18,17 +18,12 @@ import java.util.List; ...@@ -18,17 +18,12 @@ import java.util.List;
@Setter @Setter
public class HumitureDto { public class HumitureDto {
/**
* 最高温度
*/
@ApiModelProperty("最高温度") @ApiModelProperty("最高温度")
private float maxTemperature = 38.0F; private float maxTemperature = 38.0F;
@ApiModelProperty("最低温度") @ApiModelProperty("最低温度")
private float minTemperature = 0.0F; private float minTemperature = 0.0F;
/**
* 最大湿度值
*/
@ApiModelProperty("最大湿度") @ApiModelProperty("最大湿度")
private float maxHumidity = 100.0F; private float maxHumidity = 100.0F;
......
package com.neotel.smfcore.core.storage.rest;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.rest.dto.CheckOutDto;
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.StoragePos;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "物料管理:锁定物料")
@RequestMapping("api/lockMaterials")
public class LockMaterialController {
private static String lockId="ml";
private static String lockName="ml";
@Autowired
private DataCache dataCache;
@Autowired
private final IStoragePosManager storagePosManager;
@ApiOperation(value = "锁定物料:增加锁定")
@PutMapping("/lock")
public ResultBean lock(@RequestBody CheckOutDto checkOutDto) {
if (checkOutDto.getPids() == null) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"ID"});
}
for (String pid : checkOutDto.getPids()) {
StoragePos pos = storagePosManager.get(pid);
if (pos == null||pos.getBarcode()==null) {
continue;
}
Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage == null) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"storageId", pos.getStorageId()});
}
Barcode code = pos.getBarcode();
//如果已经锁定,直接跳过
if(code.getLockId()!=null){
log.info("锁定物料:增加锁定时物料已被锁定: 位置【" + pos.getPosName() + "】条码【"+code.getBarcode()+"】【"+code.getLockId()+"】");
continue;
}
code.setLockId(lockId);
code.setLockName(lockName);
pos.setBarcode(code);
storagePosManager.save(pos);
dataCache.lockOneReel(storage.getCid(),code.getPartNumber());
log.info("锁定物料:增加锁定 "+lockId+" 位置【" + pos.getPosName() + "】【"+code.getBarcode()+"】");
}
return ResultBean.newOkResult("");
}
@ApiOperation(value = "锁定物料:解除锁定")
@PutMapping("/unlock")
public ResultBean unlock( @RequestBody CheckOutDto checkOutDto) {
if (checkOutDto.getPids() == null) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"ID"});
}
for (String pid : checkOutDto.getPids()) {
StoragePos pos = storagePosManager.get(pid);
if (pos == null||pos.getBarcode()==null) {
continue;
}
Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage == null) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"storageId", pos.getStorageId()});
}
Barcode code = pos.getBarcode();
if(code.getLockId()==null){
log.info("锁定物料:解除锁定时物料未锁定: 位置【" + pos.getPosName() + "】条码【"+code.getBarcode()+"】");
continue;
}
if(!code.getLockId().equals(lockId)){
log.info("锁定物料:解除锁定时物料被其他工单锁定: 位置【" + pos.getPosName() + "】条码【"+code.getBarcode()+"】lockId=【"+code.getLockId()+"】");
continue;
}
code.setLockId(null);
code.setLockName(null);
pos.setBarcode(code);
storagePosManager.save(pos);
dataCache.lockOneReel(storage.getCid(),code.getPartNumber());
log.info("锁定物料:解除锁定【" + storage.getName() + "_" + storage.getCid() + "】位置【" + pos.getPosName() + "】【"+code.getBarcode()+"】");
}
return ResultBean.newOkResult("");
}
}
...@@ -387,6 +387,14 @@ public class StoragePosController { ...@@ -387,6 +387,14 @@ public class StoragePosController {
} }
} }
if(criteria.locked==null){
}
else if (criteria.locked == true) {
query.addCriteria(Criteria.where("barcode.lockId").ne(null));
} else {
query.addCriteria(Criteria.where("barcode.lockId").is(null));
}
query.addCriteria(baseCriteria); query.addCriteria(baseCriteria);
return query; return query;
} }
......
...@@ -107,4 +107,8 @@ public class StoragePosFindCriteria { ...@@ -107,4 +107,8 @@ public class StoragePosFindCriteria {
} }
return -1; return -1;
} }
@ApiModelProperty("是否锁定,true=锁定,false=未锁定")
public Boolean locked;
} }
...@@ -342,6 +342,7 @@ smfcore.updatePass.hasNoAccess=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650 ...@@ -342,6 +342,7 @@ smfcore.updatePass.hasNoAccess=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650
smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7 smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7
smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2} smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0} #smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1} #smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F #smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
...@@ -342,3 +342,4 @@ smfcore.updatePass.hasNoAccess=No operating rights ...@@ -342,3 +342,4 @@ smfcore.updatePass.hasNoAccess=No operating rights
smfcore.selfAudit.noPos=Self Audit{0}No depot number found smfcore.selfAudit.noPos=Self Audit{0}No depot number found
smfcore.task.updatePutInFail=Cannot update the status of the inbound task {0}[{1}] to {2} smfcore.task.updatePutInFail=Cannot update the status of the inbound task {0}[{1}] to {2}
smfcore.saveOk=save successfully smfcore.saveOk=save successfully
smfcore.lockMaterials=Locking Materials
\ No newline at end of file \ No newline at end of file
...@@ -339,3 +339,4 @@ smfcore.updatePass.hasNoAccess=\u64CD\u4F5C\u6A29\u306A\u3057 ...@@ -339,3 +339,4 @@ smfcore.updatePass.hasNoAccess=\u64CD\u4F5C\u6A29\u306A\u3057
smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7 smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7
smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2} smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
\ No newline at end of file \ No newline at end of file
...@@ -339,3 +339,4 @@ smfcore.updatePass.hasNoAccess=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650 ...@@ -339,3 +339,4 @@ smfcore.updatePass.hasNoAccess=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650
smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7 smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7
smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2} smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
\ No newline at end of file \ No newline at end of file
...@@ -340,3 +340,4 @@ smfcore.updatePass.hasNoAccess=\u6C92\u6709\u64CD\u4F5C\u6B0A\u9650 ...@@ -340,3 +340,4 @@ smfcore.updatePass.hasNoAccess=\u6C92\u6709\u64CD\u4F5C\u6B0A\u9650
smfcore.selfAudit.noPos=\u76E4\u9EDE{0}\u672A\u627E\u5230\u5EAB\u4F4D\u865F smfcore.selfAudit.noPos=\u76E4\u9EDE{0}\u672A\u627E\u5230\u5EAB\u4F4D\u865F
smfcore.task.updatePutInFail=\u5165\u5EAB\u4EFB\u52D9{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72C0\u614B\u70BA{2} smfcore.task.updatePutInFail=\u5165\u5EAB\u4EFB\u52D9{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72C0\u614B\u70BA{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9396\u5B9A\u7269\u6599
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!