Commit 85f72305 LN

1.增加同条码入库设置。2.工单详情返回工单当前任务数。3.uid出库物料类型筛选: pcb,tray,shoeBox,pizzaBox。4.修改密码功能修改。

1 个父辈 430695fc
......@@ -163,4 +163,8 @@ public class Constants {
* 当前盘点的批次号
*/
public static final String CACHE_SELFAUDIT_BATCHNO="CACHE_selfAudit_batchNo";
/**
* 同条码入库设置:
*/
public static final String CACHE_SAME_BARCODE_SETTINGS ="CACHE_sameBarcode_settings";
}
......@@ -350,10 +350,16 @@ public class RobotBoxHandler extends BaseDeviceHandler {
errorMsg = "Serial No.(S)[" + barcode.getBarcode() + "] already have storage task";
resultMap.put("msg", errorMsg);
//原任务标记NG
dataLog.setNgReel(true);
log.info("获取[" + code + "]的入库库位,条码已有入库任务posname["+dataLog.getPosName()+"],标记入库任务为NG,入库后自动出库");
taskService.updateQueueTask(dataLog);
//判断原任务是否需要NG
Integer barcodeSet=dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
if(barcodeSet==null||barcodeSet==1) {
//原任务标记NG
dataLog.setNgReel(true);
log.info("获取[" + code + "]的入库库位,条码已有入库任务posname[" + dataLog.getPosName() + "],标记入库任务为NG,入库后自动出库");
taskService.updateQueueTask(dataLog);
}else{
log.info("获取[" + code + "]的入库库位,条码已有入库任务posname[" + dataLog.getPosName() + "],CACHE_SAME_BARCODE_SETTINGS="+barcodeSet+",当前物料NG,已入库的任务继续完成");
}
return resultMap;
// //已有入库任务
// errorMsg = "物料[" + dataLog.getBarcode() + "]已有入库任务,需继续执行入库动作";
......
......@@ -501,8 +501,10 @@ public class DataCache {
public List<List<StoragePos>> getAllUsedPosMap() {
List<List<StoragePos>> posList = new ArrayList<>( );
Set<String> keys= allStorage.keySet();
for (String key :
allStorage.keySet()) {
keys) {
List<StoragePos> list=getUsedPosList(key);
if(list.size()>0) {
posList.add(list);
......
......@@ -716,5 +716,21 @@ public class LiteOrderCache {
return null;
}
public int getOrderTaskCount(String orderNo) {
int count = 0;
//有任务的工单不能关闭
List<DataLog> allTask = taskService.getAllTasks();
for (DataLog task : allTask
) {
if (OP.CHECKOUT == task.getType() && (!task.isEnd())) {
//更新工单状态
String taskSourceName = task.getSourceName();
if (!Strings.isNullOrEmpty(taskSourceName) && orderNo.equals(taskSourceName)) {
count++;
}
}
}
return count;
}
}
......@@ -354,6 +354,7 @@ public class OrderController {
dtos.add(orderItemDto);
}
dto.setOrderItems(dtos);
dto.setCurrTaskCount(liteOrderCache.getOrderTaskCount(liteOrder.getOrderNo()));
return dto;
}
......
......@@ -89,4 +89,7 @@ public class OrderDto implements Serializable {
@ApiModelProperty("工单线别")
private String line = "";
@ApiModelProperty("当前任务数,任务数<=0工单可关闭")
private int currTaskCount=0;
}
......@@ -338,6 +338,51 @@ public class StoragePosController {
}
query.addCriteria(baseCriteria);
//判断物料类型
if(ObjectUtil.isNotEmpty(criteria.getReelType())){
;
// 310*80 pcb 330*120 tray 386*86 shoe box 400X70 Pizza box
if(criteria.getReelType().toLowerCase().equals("pcb")){
Criteria c=Criteria.where("barcode.plateSize").is(310);
c.and("barcode.height").is(80);
query.addCriteria(c);
}else if(criteria.getReelType().toLowerCase().equals("tray")){
Criteria c=Criteria.where("barcode.plateSize").is(330);
c.and("barcode.height").is(120);
query.addCriteria(c);
}else if(criteria.getReelType().toLowerCase().equals("shoebox")){
Criteria c=Criteria.where("barcode.plateSize").is(386);
c.and("barcode.height").is(86);
query.addCriteria(c);
}else if(criteria.getReelType().toLowerCase().equals("pizzabox")){
Criteria c=Criteria.where("barcode.plateSize").is(400);
c.and("barcode.height").is(70);
query.addCriteria(c);
}else if(criteria.getReelType().toLowerCase().equals("reel")){
Criteria c = new Criteria().norOperator(
new Criteria().andOperator(
Criteria.where("barcode.plateSize").is(310),
Criteria.where("barcode.height").is(80)
),
new Criteria().andOperator(
Criteria.where("barcode.plateSize").is(330),
Criteria.where("barcode.height").is(120)
),
new Criteria().andOperator(
Criteria.where("barcode.plateSize").is(386),
Criteria.where("barcode.height").is(86)
),
new Criteria().andOperator(
Criteria.where("barcode.plateSize").is(400),
Criteria.where("barcode.height").is(70)
)
);
query.addCriteria(c);
}
}
return query;
}
......
......@@ -86,6 +86,11 @@ public class StoragePosFindCriteria {
@QueryCondition(type = QueryCondition.Type.IN, propName = "barcode.solderStatus")
private List<String> solderStatus;
// 310*80 pcb 330*120 tray 386*86 shoe box 400X70 Pizza box
@ApiModelProperty("物料类型: pcb,tray,shoeBox,pizzaBox")
private String reelType;
public int getComponentType(){
int componentType = getType();
if (componentType != -1) {
......
......@@ -81,6 +81,7 @@ public class SettingsController {
Integer expiresDay=dataCache.getCache(Constants.CACHE_ExpiresDay);
Integer caWarn=dataCache.getCache(Constants.CACHE_CapacityWarn);
Integer backUpMonth = dataCache.getCache(Constants.BACKUP_MONTH_KEY);
Integer barcodeSet=dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
SysSettingsDto dto = new SysSettingsDto();
dto.setStartJob(startJob);
dto.setStopOut(stopOut);
......@@ -88,6 +89,7 @@ public class SettingsController {
dto.setExpiresDay(expiresDay);
dto.setCapacityWarn(caWarn);
dto.setBackUpMonth(backUpMonth);
dto.setSameBarcodeSettings(barcodeSet);
return dto;
}
......@@ -101,8 +103,10 @@ public class SettingsController {
dataCache.updateCache(Constants.CACHE_ExpiresDay,sysSettingsDto.getExpiresDay());
dataCache.updateCache(Constants.CACHE_CapacityWarn,sysSettingsDto.getCapacityWarn());
dataCache.updateCache(Constants.BACKUP_MONTH_KEY,sysSettingsDto.getBackUpMonth());
dataCache.updateCache(Constants.CACHE_SAME_BARCODE_SETTINGS,sysSettingsDto.getSameBarcodeSettings());
log.info("更改系统设置:stopout=" + sysSettingsDto.isStopOut() + ",stopjob=" + sysSettingsDto.isStartJob()+",sluggishDay="+sysSettingsDto.getSluggishDay()
+",expiresDay="+sysSettingsDto.getExpiresDay()+",capacityWarn="+sysSettingsDto.getCapacityWarn()+",backUpMonth="+sysSettingsDto.getBackUpMonth());
+",expiresDay="+sysSettingsDto.getExpiresDay()+",capacityWarn="+sysSettingsDto.getCapacityWarn()+",backUpMonth="+sysSettingsDto.getBackUpMonth()+
" ,sameBarcodeSettings="+sysSettingsDto.getSameBarcodeSettings());
return ResultBean.newOkResult("保存成功");
}
......
......@@ -27,4 +27,7 @@ public class SysSettingsDto implements Serializable {
@ApiModelProperty("备份时间")
private Integer backUpMonth=0;
@ApiModelProperty("同条码入库设置,1=全部NG,2=第二盘NG")
private Integer sameBarcodeSettings=1;
}
......@@ -15,6 +15,7 @@
*/
package com.neotel.smfcore.security.rest;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.csv.CsvReader;
......@@ -176,24 +177,49 @@ public class UserController {
userManager.updateCenter(resources);
return ResultBean.newOkResult("");
}
@ApiOperation("个人中心:修改密码")
//
// @ApiOperation("个人中心:修改密码")
// @PostMapping(value = "/updatePass")
// public ResultBean updatePass(@RequestBody UserPassVo passVo) throws Exception {
// User user = userManager.get(SecurityUtils.getCurrentUserId());
// String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, passVo.getOldPass());
// String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, passVo.getNewPass());
// if (!passwordEncoder.matches(oldPass, user.getPassword())) {
// throw new ValidateException("smfcore.oldPwdError","修改失败,旧密码错误");
// }
// if (passwordEncoder.matches(newPass, user.getPassword())) {
// throw new ValidateException("smfcore.newPwdError","新密码不能与旧密码相同");
// }
// userManager.updatePass(user.getUsername(), passwordEncoder.encode(newPass));
// return ResultBean.newOkResult("");
// }
@ApiOperation("管理员:修改密码")
@PostMapping(value = "/updatePass")
public ResultBean updatePass(@RequestBody UserPassVo passVo) throws Exception {
User user = userManager.get(SecurityUtils.getCurrentUserId());
User currUser = userManager.get(SecurityUtils.getCurrentUserId());
if(!currUser.getUsername() .equals(Constants.SUPER_USERNAME)) {
throw new ValidateException("smfcore.updatePass.hasNoAccess","没有操作权限" );
}
User updateUser = userManager.findByUserName(passVo.getUserName());
if (ObjectUtil.isEmpty(passVo.getUserName())) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"userName"});
}
if (updateUser == null) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"User"});
}
String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, passVo.getOldPass());
String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, passVo.getNewPass());
if (!passwordEncoder.matches(oldPass, user.getPassword())) {
throw new ValidateException("smfcore.oldPwdError","修改失败,旧密码错误");
if (!passwordEncoder.matches(oldPass, updateUser.getPassword())) {
throw new ValidateException("smfcore.oldPwdError", "修改失败,旧密码错误");
}
if (passwordEncoder.matches(newPass, user.getPassword())) {
throw new ValidateException("smfcore.newPwdError","新密码不能与旧密码相同");
if (passwordEncoder.matches(newPass, updateUser.getPassword())) {
throw new ValidateException("smfcore.newPwdError", "新密码不能与旧密码相同");
}
userManager.updatePass(user.getUsername(), passwordEncoder.encode(newPass));
return ResultBean.newOkResult("");
userManager.updatePass(updateUser.getUsername(), passwordEncoder.encode(newPass));
return ResultBean.newOkResult("");
}
@ApiOperation("删除用户")
@DeleteMapping
@PreAuthorize("@el.check('user:del')")
......
......@@ -9,6 +9,9 @@ import org.springframework.stereotype.Service;
@Getter
public class UserPassVo {
@ApiModelProperty ("用户名")
private String userName;
@ApiModelProperty ("旧密码")
private String oldPass;
......
......@@ -27,7 +27,6 @@ smfcore.noAccessUpdate=\u6CA1\u6709\u5220\u9664\u83DC\u5355\u7684\u6743\u9650
smfcore.roleCannotDel=\u89D2\u8272[{0}]\u6709[{1}]\u4E2A\u7528\u6237\u5173\u8054\u6539\u89D2\u8272,\u4E0D\u80FD\u5220\u9664
smfcore.notFindPos=\u672A\u627E\u5230\u9501\u5B9A\u5E93\u4F4D
smfcore.error.barcode.empty=\u672A\u626B\u5230\u6761\u7801
smfcore.error.barcode.many=\u627E\u5230\u591A\u4E2A\u6709\u6548\u6761\u7801,\u65E0\u6CD5\u5165\u5E93
smfcore.error.barcode.expired=\u7269\u6599\u5DF2\u8FC7\u671F,\u65E0\u6CD5\u5165\u5E93.
smfcore.allBoxView.noReel=\u5E93\u4F4D{0}\u4E2D\u65E0\u7269\u6599
smfcore.error.barcode.many=\u627E\u5230\u591A\u4E2A\u6709\u6548\u7684\u6761\u7801
......@@ -339,6 +338,7 @@ smfcore.selfAudit.notExist=\u672A\u627E\u5230\u6279\u6B21\u53F7[{0}]\u7684\u76D8
smfcore.selfAudit.hasEnd=[{0}]\u76D8\u70B9\u5DF2\u5B8C\u6210
smfcore.selfAudit.notFind=\u672A\u627E\u5230\u76D8\u70B9\u4FE1\u606F
smfcore.selfAudit.pause=\u76D8\u70B9{0}\u5DF2\u6682\u505C
smfcore.updatePass.hasNoAccess=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650
#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.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
......@@ -337,4 +337,5 @@ smfcore.selfAudit.noStorage=Please select the equipment to be self audit
smfcore.selfAudit.notExist= [{0}] self audit information not found
smfcore.selfAudit.hasEnd=[{0}] self audit is complete
smfcore.selfAudit.notFind=self audit is not found
smfcore.selfAudit.pause=self audit {0} has Paused
\ No newline at end of file
smfcore.selfAudit.pause=self audit {0} has Paused
smfcore.updatePass.hasNoAccess=No operating rights
\ No newline at end of file
......@@ -334,4 +334,5 @@ smfcore.selfAudit.noStorage=\u30A4\u30F3\u30D9\u30F3\u30C8\u30EA\u5316\u3059\u30
smfcore.selfAudit.notExist=\u30ED\u30C3\u30C8\u756A\u53F7[{0}]\u306E\u30A4\u30F3\u30D9\u30F3\u30C8\u30EA\u60C5\u5831\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcore.selfAudit.hasEnd=[{0}]\u30A4\u30F3\u30D9\u30F3\u30C8\u30EA\u30FC\u5B8C\u6210
smfcore.selfAudit.notFind=\u30A4\u30F3\u30D9\u30F3\u30C8\u30EA\u60C5\u5831\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcore.selfAudit.pause=\u30BB\u30EB\u30D5\u30C6\u30B9\u30C8{0}\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F
\ No newline at end of file
smfcore.selfAudit.pause=\u30BB\u30EB\u30D5\u30C6\u30B9\u30C8{0}\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F
smfcore.updatePass.hasNoAccess=\u64CD\u4F5C\u6A29\u306A\u3057
\ No newline at end of file
......@@ -334,4 +334,5 @@ smfcore.selfAudit.noStorage=\u8BF7\u9009\u62E9\u8981\u76D8\u70B9\u7684\u8BBE\u59
smfcore.selfAudit.notExist=\u672A\u627E\u5230\u6279\u6B21\u53F7[{0}]\u7684\u76D8\u70B9\u4FE1\u606F
smfcore.selfAudit.hasEnd=[{0}]\u76D8\u70B9\u5DF2\u5B8C\u6210
smfcore.selfAudit.notFind=\u672A\u627E\u5230\u76D8\u70B9\u4FE1\u606F
smfcore.selfAudit.pause=\u76D8\u70B9{0}\u5DF2\u6682\u505C
\ No newline at end of file
smfcore.selfAudit.pause=\u76D8\u70B9{0}\u5DF2\u6682\u505C
smfcore.updatePass.hasNoAccess=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650
\ No newline at end of file
......@@ -335,4 +335,5 @@ smfcore.selfAudit.noStorage=\u8ACB\u9078\u64C7\u8981\u76E4\u9EDE\u7684\u8A2D\u50
smfcore.selfAudit.notExist=\u672A\u627E\u5230\u6279\u6B21\u865F[{0}]\u7684\u76E4\u9EDE\u4FE1\u606F
smfcore.selfAudit.hasEnd=[{0}]\u76E4\u9EDE\u5DF2\u5B8C\u6210
smfcore.selfAudit.notFind=\u672A\u627E\u5230\u76E4\u9EDE\u4FE1\u606F
smfcore.selfAudit.pause=\u76E4\u9EDE{0}\u5DF2\u66AB\u505C
\ No newline at end of file
smfcore.selfAudit.pause=\u76E4\u9EDE{0}\u5DF2\u66AB\u505C
smfcore.updatePass.hasNoAccess=\u6C92\u6709\u64CD\u4F5C\u6B0A\u9650
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!