Commit e91fb981 sunke

Merge remote-tracking branch 'origin/master'

2 个父辈 2d5342eb 8d0266a7
正在显示 52 个修改的文件 包含 1127 行增加248 行删除
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<name>smf-core</name> <name>smf-core</name>
<description>SMF project for Spring Boot</description> <description>SMF project for Spring Boot</description>
<properties> <properties>
<maven.build.timestamp.format>M.dd</maven.build.timestamp.format> <maven.build.timestamp.format>MM.dd.HHmmss</maven.build.timestamp.format>
<main.version>1.${maven.build.timestamp}</main.version> <main.version>1.${maven.build.timestamp}</main.version>
<app.version>${main.version}${current.time}</app.version> <app.version>${main.version}</app.version>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<jjwt.version>0.11.1</jjwt.version> <jjwt.version>0.11.1</jjwt.version>
<!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 --> <!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 -->
......
...@@ -41,13 +41,11 @@ public class DataInitManager { ...@@ -41,13 +41,11 @@ public class DataInitManager {
IRoleManager roleManager; IRoleManager roleManager;
@Autowired @Autowired
IMenuManager menuManager; IMenuManager menuManager;
// @Autowired
// IGroupManager groupManager;
@Autowired
TaskService taskService;
@Autowired @Autowired
IDataLogManager dataLogManager; MainTimer mainTimer;
@Autowired @Autowired
PermissionInitUtil annotationUtil; PermissionInitUtil annotationUtil;
...@@ -101,7 +99,7 @@ public class DataInitManager { ...@@ -101,7 +99,7 @@ public class DataInitManager {
} }
} }
initTask(); mainTimer.init();
allPermissionSet= annotationUtil.initPermission(); allPermissionSet= annotationUtil.initPermission();
} catch (Exception exception) { } catch (Exception exception) {
...@@ -109,20 +107,7 @@ public class DataInitManager { ...@@ -109,20 +107,7 @@ public class DataInitManager {
} }
} }
private void initTask() {
log.info("开始加载未完成的任务...");
List<DataLog> unExecuteTasks = dataLogManager.findUnFinishedTasks();
for (DataLog unExecuteTask : unExecuteTasks) {
if (unExecuteTask.isExecuting() || unExecuteTask.isWait()) {
try {
taskService.addTaskToExecute(unExecuteTask);
}catch (Exception e){
log.error("初始化任务["+unExecuteTask+"]出错:"+e);
}
}
}
log.info("加载未完成的任务完成,共[" + unExecuteTasks.size() + "]条数据...");
}
private int sortValue=0; private int sortValue=0;
...@@ -206,9 +191,12 @@ public class DataInitManager { ...@@ -206,9 +191,12 @@ public class DataInitManager {
Menu menuOut = new Menu(new ArrayList<Menu>(), 1, "checkOut", "查找出库", 1, "singleOuput", "neolight/singleOuput/index", "", 0, "export1"); Menu menuOut = new Menu(new ArrayList<Menu>(), 1, "checkOut", "查找出库", 1, "singleOuput", "neolight/singleOuput/index", "", 0, "export1");
Menu celueOut = new Menu(new ArrayList<Menu>(), 1, "tacticsOuput", "策略出库", 1, "tacticsOuput", "neolight/tacticsOuput/index", "", 0, "workOrder"); Menu celueOut = new Menu(new ArrayList<Menu>(), 1, "tacticsOuput", "策略出库", 1, "tacticsOuput", "neolight/tacticsOuput/index", "", 0, "workOrder");
Menu groupOut = new Menu(new ArrayList<Menu>(), 1, "labelOuput", "物料分组", 1, "labelOuput", "neolight/labelOuput/index", "", 0, "export1"); Menu groupOut = new Menu(new ArrayList<Menu>(), 1, "labelOuput", "物料分组", 1, "labelOuput", "neolight/labelOuput/index", "", 0, "export1");
Menu manualOut = new Menu(new ArrayList<Menu>(), 1, "manualOut", "手动出库", 1, "manualOut", "neolight/manualOut/index", "", 0, "export1");
Menu materialBox = new Menu(new ArrayList<Menu>(), 1, "materialBox", "料盒操作", 1, "materialBox", "neolight/materialBox/index", "", 0, "export1");
celueOut.setHidden(true); celueOut.setHidden(true);
groupOut.setHidden(true); groupOut.setHidden(true);
menus.addAll(createMenus(poutOut, menuOrder, menuOut,celueOut,groupOut)); manualOut.setHidden(true);
menus.addAll(createMenus(poutOut, menuOrder, menuOut,celueOut,groupOut,manualOut,materialBox));
//设置:料仓管理,菜单管理 //设置:料仓管理,菜单管理
Menu poutSet = Menu.CreatePMenu("设置", 30, "system", 2, "system"); Menu poutSet = Menu.CreatePMenu("设置", 30, "system", 2, "system");
......
package com.neotel.smfcore.common.init;
import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.system.service.manager.IDataLogManager;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@Service
public class MainTimer {
protected final transient Logger log = LogManager.getLogger(getClass());
ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(1);
@Autowired
TaskService taskService;
@Autowired
IDataLogManager dataLogManager;
@Autowired
LiteOrderCache liteOrderCache;
public void init(){
initTask();
liteOrderCache.loadUnEndOrderInfos();
log.info("主定时器开启,60秒后开始执行, 每10s执行一次");
//1 分钟之后执行,每秒钟执行一次
scheduledThreadPool.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
timerTask();
}
}, 60, 10, TimeUnit.SECONDS);
}
private void initTask() {
log.info("开始加载未完成的任务...");
List<DataLog> unExecuteTasks = dataLogManager.findUnFinishedTasks();
for (DataLog unExecuteTask : unExecuteTasks) {
if (unExecuteTask.isExecuting() || unExecuteTask.isWait()) {
try {
taskService.addTaskToExecute(unExecuteTask);
}catch (Exception e){
log.error("初始化任务["+unExecuteTask+"]出错:"+e);
}
}
}
log.info("加载未完成的任务完成,共[" + unExecuteTasks.size() + "]条数据...");
}
private void timerTask(){
try{
liteOrderCache.runTimer();
}catch (Exception e){
log.error("定时器执行出错",e);
}finally {
}
}
}
...@@ -10,6 +10,8 @@ public class Constants { ...@@ -10,6 +10,8 @@ public class Constants {
* 超级管理员用户名 * 超级管理员用户名
*/ */
public static final String SUPER_USERNAME= "admin"; public static final String SUPER_USERNAME= "admin";
public static final String USER_DEFAULTP_PWD="123456";
/** /**
* Assets Version constant * Assets Version constant
*/ */
...@@ -97,5 +99,8 @@ public class Constants { ...@@ -97,5 +99,8 @@ public class Constants {
*/ */
public static final String CACHE_StopJob="stopJob"; public static final String CACHE_StopJob="stopJob";
/**
* 出库方式类型 出库策略配置
*/
public static final String CACHE_CheckOutType="checkoutType"; public static final String CACHE_CheckOutType="checkoutType";
} }
...@@ -497,7 +497,7 @@ public class BarcodeRule { ...@@ -497,7 +497,7 @@ public class BarcodeRule {
} }
codeBean.setCodeStr(codeStr); codeBean.setCodeStr(codeStr);
if(!isValidRule()){ if(!isValidRule()){
codeBean.setError("error.barcode.noRule","解析规则未定义"); codeBean.setError("smfcode.error.barcode.noRule","解析规则未定义");
return codeBean; return codeBean;
} }
String[] codeArr = new String[]{codeStr}; String[] codeArr = new String[]{codeStr};
...@@ -506,7 +506,7 @@ public class BarcodeRule { ...@@ -506,7 +506,7 @@ public class BarcodeRule {
//条码与规则长度对应不上 //条码与规则长度对应不上
if(codeArr.length != length){ if(codeArr.length != length){
log.info("条码["+codeStr+"]与规则【"+ruleStr+"】长度不同"); log.info("条码["+codeStr+"]与规则【"+ruleStr+"】长度不同");
codeBean.setError("error.barcode.wrongLength",new String[]{}, "条码["+codeStr+"]长度错误"); codeBean.setError("smfcode.error.barcode.wrongLength",new String[]{codeStr}, "条码[{0}]长度错误");
return codeBean; return codeBean;
}else{ }else{
codeArr = codeStr.split(separator,length); codeArr = codeStr.split(separator,length);
...@@ -515,7 +515,7 @@ public class BarcodeRule { ...@@ -515,7 +515,7 @@ public class BarcodeRule {
Barcode b = new Barcode(); Barcode b = new Barcode();
b.setFullCode(codeStr);
String reelId = ""; String reelId = "";
if(whole_reelId_item.hasThisField()){ if(whole_reelId_item.hasThisField()){
reelId = codeStr; reelId = codeStr;
...@@ -525,7 +525,7 @@ public class BarcodeRule { ...@@ -525,7 +525,7 @@ public class BarcodeRule {
if(Strings.isNullOrEmpty(reelId)){ if(Strings.isNullOrEmpty(reelId)){
log.info("条码解析失败,未找到RI字段"); log.info("条码解析失败,未找到RI字段");
codeBean.setError("error.barcode.noField",new String[]{"RI"},"条码解析失败,未找到RI字段"); codeBean.setError("smfcode.error.barcode.noField",new String[]{"RI"},"条码解析失败,未找到{0}字段");
return codeBean; return codeBean;
} }
...@@ -533,7 +533,7 @@ public class BarcodeRule { ...@@ -533,7 +533,7 @@ public class BarcodeRule {
if(Strings.isNullOrEmpty(partNumber)){ if(Strings.isNullOrEmpty(partNumber)){
log.info("条码解析失败,未找到PN字段"); log.info("条码解析失败,未找到PN字段");
codeBean.setError("error.barcode.noField",new String[]{"PN"}, "条码解析失败,未找到PN字段"); codeBean.setError("smfcode.error.barcode.noField",new String[]{"PN"}, "条码解析失败,未找到{0}字段");
return codeBean; return codeBean;
} }
if(batch_item.hasThisField()){ if(batch_item.hasThisField()){
...@@ -545,7 +545,7 @@ public class BarcodeRule { ...@@ -545,7 +545,7 @@ public class BarcodeRule {
quantity = quantity_item.getIntValue(codeArr); quantity = quantity_item.getIntValue(codeArr);
if(quantity == -1){ if(quantity == -1){
log.info("条码解析失败,未找到QTY 字段"); log.info("条码解析失败,未找到QTY 字段");
codeBean.setError("error.barcode.noField",new String[]{"QTY"},"条码解析失败,未找到QTY 字段"); codeBean.setError("smfcode.error.barcode.noField",new String[]{"QTY"},"条码解析失败,未找到{0}字段");
return codeBean; return codeBean;
} }
} }
...@@ -553,7 +553,7 @@ public class BarcodeRule { ...@@ -553,7 +553,7 @@ public class BarcodeRule {
Date produceDate= produceDate_item.getDateValue(codeArr); Date produceDate= produceDate_item.getDateValue(codeArr);
if(produceDate_item.hasThisField() && produceDate == null){ if(produceDate_item.hasThisField() && produceDate == null){
log.info("条码解析失败,PRODATE字段不合规则"); log.info("条码解析失败,PRODATE字段不合规则");
codeBean.setError("error.barcode.noField",new String[]{"PRODATE"},"条码解析失败,未找到PRODATE字段"); codeBean.setError("smfcode.error.barcode.noField",new String[]{"PRODATE"},"条码解析失败,未找到{0}字段");
return codeBean; return codeBean;
} }
Date expireDate= expireDate_item.getDateValue(codeArr); Date expireDate= expireDate_item.getDateValue(codeArr);
...@@ -700,6 +700,10 @@ public class BarcodeRule { ...@@ -700,6 +700,10 @@ public class BarcodeRule {
codeStr = "327203324369301963"; codeStr = "327203324369301963";
rule = "PN[-1_32:0:-1_3]RI[-1:0:-1]"; rule = "PN[-1_32:0:-1_3]RI[-1:0:-1]";
codeStr="TJM210215000771&10446507326&15000&2021-01-18&NAUK11263MAB&&10446&&R107920210124A13OG";
rule="RI&PN&QTY&PRODATEyyyy-MM-dd&5&6&7&8&9";
BarcodeRule br = BarcodeRule.newRule(rule); BarcodeRule br = BarcodeRule.newRule(rule);
Barcode b = br.toCodeBean(codeStr).getBarcode(); Barcode b = br.toCodeBean(codeStr).getBarcode();
if(b != null){ if(b != null){
......
...@@ -90,4 +90,18 @@ public class ComponentController { ...@@ -90,4 +90,18 @@ public class ComponentController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@ApiOperation("搜索框匹配元器件")
@GetMapping(value = "/searchMatching")
@PreAuthorize("@el.check('component:list')")
public List<String> searchMatching(ComponentQueryCriteria criteria) {
Query query = QueryHelp.getQuery(criteria);
query.limit(20);
List<Component> list = componentManager.findByQuery(query);
List<String> array = new ArrayList<>();
for (Component com :
list) {
array.add(com.getPartNumber());
}
return array;
}
} }
package com.neotel.smfcore.core.barcode.rest.bean.dto; package com.neotel.smfcore.core.barcode.rest.bean.dto;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS; import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE; import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS; import com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS;
...@@ -13,6 +12,9 @@ import org.springframework.data.annotation.Transient; ...@@ -13,6 +12,9 @@ import org.springframework.data.annotation.Transient;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
@Getter @Getter
@Setter @Setter
public class BarcodeDto implements Serializable { public class BarcodeDto implements Serializable {
...@@ -205,5 +207,8 @@ public class BarcodeDto implements Serializable { ...@@ -205,5 +207,8 @@ public class BarcodeDto implements Serializable {
return (""+plateSize+"X"+height); return (""+plateSize+"X"+height);
} }
/**
* 料箱中的物料信息
*/
private Map<String, BarcodeDto> subCodeMap;
} }
...@@ -4,7 +4,9 @@ import com.google.common.collect.Lists; ...@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS; import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE; import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS; import com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString; import lombok.ToString;
...@@ -30,10 +32,16 @@ public class CodeDto implements Serializable { ...@@ -30,10 +32,16 @@ public class CodeDto implements Serializable {
@ApiModelProperty("高度") @ApiModelProperty("高度")
private int height=0; private int height=0;
/**
* 原始条码
*/
@ApiModelProperty("原始条码") @ApiModelProperty("原始条码")
private String fullCode; private String fullCode;
@ApiModelProperty("库位信息/仓位")
private String posName;
@ApiModelProperty("数量")
private int amount;
@ApiModelProperty("错误提示")
private String error;
} }
...@@ -189,7 +189,7 @@ public class BarcodeManagerImpl implements IBarcodeManager { ...@@ -189,7 +189,7 @@ public class BarcodeManagerImpl implements IBarcodeManager {
// throw new ValidateException("批次不能为空"); // throw new ValidateException("批次不能为空");
} }
if (barcode.getAmount() < 0) { if (barcode.getAmount() < 0) {
throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"batch"} ); throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"amout"} );
// throw new ValidateException("["+barcode.getBarcode()+"]barcode.error.amount.negative" ); // throw new ValidateException("["+barcode.getBarcode()+"]barcode.error.amount.negative" );
} }
if (!validateUnique(barcode)) { if (!validateUnique(barcode)) {
......
...@@ -60,7 +60,7 @@ public class ComponentManagerImpl implements IComponentManager { ...@@ -60,7 +60,7 @@ public class ComponentManagerImpl implements IComponentManager {
@Override @Override
public List<Component> findByQuery(Query query) { public List<Component> findByQuery(Query query) {
return componentDao.findOne(query); return componentDao.findByQuery(query);
} }
@Override @Override
...@@ -71,6 +71,9 @@ public class ComponentManagerImpl implements IComponentManager { ...@@ -71,6 +71,9 @@ public class ComponentManagerImpl implements IComponentManager {
Component component = componentDao.findOneByCondition(new String[]{"partNumber", "provider"}, new String[]{partNumber, provider}); Component component = componentDao.findOneByCondition(new String[]{"partNumber", "provider"}, new String[]{partNumber, provider});
if (component == null) { if (component == null) {
component = componentDao.findOneByCondition(new String[]{"partNumber", "provider"}, new String[]{partNumber, null}); component = componentDao.findOneByCondition(new String[]{"partNumber", "provider"}, new String[]{partNumber, null});
if(component==null){
component = componentDao.findOneByCondition(new String[]{"partNumber", "provider"}, new String[]{partNumber, ""});
}
if (component != null) { if (component != null) {
component.setProvider(provider); component.setProvider(provider);
component = componentDao.save(component); component = componentDao.save(component);
......
...@@ -3,7 +3,6 @@ package com.neotel.smfcore.core.barcode.service.po; ...@@ -3,7 +3,6 @@ package com.neotel.smfcore.core.barcode.service.po;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.neotel.smfcore.common.base.BasePo; import com.neotel.smfcore.common.base.BasePo;
import com.neotel.smfcore.common.utils.DateUtil; import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.common.utils.StorageConstants;
import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS; import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE; import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS; import com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS;
...@@ -13,8 +12,7 @@ import org.springframework.data.annotation.Transient; ...@@ -13,8 +12,7 @@ import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.*;
import java.util.List;
@Data @Data
@Document @Document
...@@ -23,6 +21,11 @@ public class Barcode extends BasePo implements Serializable { ...@@ -23,6 +21,11 @@ public class Barcode extends BasePo implements Serializable {
* 条码编号 * 条码编号
*/ */
private String barcode; private String barcode;
/**
* 扩展料盒的条码ID
*/
private String hostBarcodeId;
/** /**
* 物料类型:PCB,锡膏,或其他 * 物料类型:PCB,锡膏,或其他
*/ */
...@@ -73,16 +76,16 @@ public class Barcode extends BasePo implements Serializable { ...@@ -73,16 +76,16 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 盘宽 * 盘宽
*/ */
private int plateSize=0; private int plateSize = 0;
/** /**
* 盘高 * 盘高
*/ */
private int height=0; private int height = 0;
private String provider; private String provider;
/** /**
* 批次 * 批次
*/ */
private String batch; private String batch="";
private String msl; private String msl;
//备用字段1(配套单号))或 family //备用字段1(配套单号))或 family
...@@ -156,19 +159,25 @@ public class Barcode extends BasePo implements Serializable { ...@@ -156,19 +159,25 @@ public class Barcode extends BasePo implements Serializable {
*/ */
@Transient @Transient
private List<String> relationCodes; private List<String> relationCodes;
/**
* 料盒条码:料盒内所有物料条码,key=barcode
*/
private Map<String, Barcode> subCodeMap;
/** /**
* 是否是锡膏 * 是否是锡膏
*/ */
public boolean isSolder(){ public boolean isSolder() {
return type == COMPONENT_TYPE.SOLDERPASTE; return type == COMPONENT_TYPE.SOLDERPASTE;
} }
public List<String> getRelationCodes() { public List<String> getRelationCodes() {
if (relationCodes == null) { if (relationCodes == null) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
return relationCodes; return relationCodes;
} }
/** /**
* 上次使用时间(出入库时更改) * 上次使用时间(出入库时更改)
*/ */
...@@ -197,6 +206,7 @@ public class Barcode extends BasePo implements Serializable { ...@@ -197,6 +206,7 @@ public class Barcode extends BasePo implements Serializable {
* 原始条码 * 原始条码
*/ */
private String fullCode; private String fullCode;
/** /**
* 添加相关联条码 * 添加相关联条码
* *
...@@ -208,12 +218,13 @@ public class Barcode extends BasePo implements Serializable { ...@@ -208,12 +218,13 @@ public class Barcode extends BasePo implements Serializable {
} }
relationCodes.add(relationCode); relationCodes.add(relationCode);
} }
public long getPutInTime() { public long getPutInTime() {
return putInTime; return putInTime;
} }
public void setPutInTime(long putInTime) { public void setPutInTime(long putInTime) {
if(this.putInTime == -1){ if (this.putInTime == -1) {
this.putInTime = putInTime; this.putInTime = putInTime;
this.putInDate = new Date(putInTime); this.putInDate = new Date(putInTime);
} }
...@@ -229,8 +240,8 @@ public class Barcode extends BasePo implements Serializable { ...@@ -229,8 +240,8 @@ public class Barcode extends BasePo implements Serializable {
return putInDate; return putInDate;
} }
public String getPutInDateStr(){ public String getPutInDateStr() {
if(putInDate == null){ if (putInDate == null) {
return ""; return "";
} }
return DateUtil.toDateTimeString(putInDate); return DateUtil.toDateTimeString(putInDate);
...@@ -240,13 +251,13 @@ public class Barcode extends BasePo implements Serializable { ...@@ -240,13 +251,13 @@ public class Barcode extends BasePo implements Serializable {
this.putInDate = putInDate; this.putInDate = putInDate;
} }
private void updateExpTime(){ private void updateExpTime() {
if(expTime == null && maxStorageTime != 0F && putInTime != -1){ if (expTime == null && maxStorageTime != 0F && putInTime != -1) {
Float maxStorageTimeMill = maxStorageTime * 60 * 60 * 1000; Float maxStorageTimeMill = maxStorageTime * 60 * 60 * 1000;
expTime = new Date(putInTime + maxStorageTimeMill.longValue()); expTime = new Date(putInTime + maxStorageTimeMill.longValue());
if(expireDate != null){ if (expireDate != null) {
//如果是在包装上的过期时间之前,使用包装上的过期时间 //如果是在包装上的过期时间之前,使用包装上的过期时间
if(expireDate.getTime()< expTime.getTime()){ if (expireDate.getTime() < expTime.getTime()) {
expTime = expireDate; expTime = expireDate;
} }
} }
...@@ -256,9 +267,9 @@ public class Barcode extends BasePo implements Serializable { ...@@ -256,9 +267,9 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 到达回温的时间 * 到达回温的时间
*/ */
public long getReachWarmTime(){ public long getReachWarmTime() {
long reachWarmTime = System.currentTimeMillis(); long reachWarmTime = System.currentTimeMillis();
if(COMPONENT_TYPE.SOLDERPASTE == type && putInTime != -1){ if (COMPONENT_TYPE.SOLDERPASTE == type && putInTime != -1) {
reachWarmTime = putInTime + warmTime * 60 * 60 * 1000; reachWarmTime = putInTime + warmTime * 60 * 60 * 1000;
} }
return reachWarmTime; return reachWarmTime;
...@@ -267,22 +278,22 @@ public class Barcode extends BasePo implements Serializable { ...@@ -267,22 +278,22 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 是否达到回温时间,只有锡膏才需要判定 * 是否达到回温时间,只有锡膏才需要判定
*/ */
public boolean isReachedWarmTime(){ public boolean isReachedWarmTime() {
return getReachWarmTime() <= System.currentTimeMillis(); return getReachWarmTime() <= System.currentTimeMillis();
} }
public long getInStoreHour(){ public long getInStoreHour() {
if(putInTime != -1){ if (putInTime != -1) {
return (System.currentTimeMillis() - putInTime) / 60 / 60 / 1000; return (System.currentTimeMillis() - putInTime) / 60 / 60 / 1000;
} }
return 0; return 0;
} }
public long getInStoreMiniute(){ public long getInStoreMiniute() {
if(putInTime != -1){ if (putInTime != -1) {
long minutes = (System.currentTimeMillis() - getPutInTime()) / 60000 % 60; long minutes = (System.currentTimeMillis() - getPutInTime()) / 60000 % 60;
if(minutes == 0){ if (minutes == 0) {
if(getInStoreHour() == 0){ if (getInStoreHour() == 0) {
minutes = 1; minutes = 1;
} }
} }
...@@ -290,44 +301,47 @@ public class Barcode extends BasePo implements Serializable { ...@@ -290,44 +301,47 @@ public class Barcode extends BasePo implements Serializable {
} }
return 0; return 0;
} }
public void setCheckOutDate(Date checkOutDate, String opor) { public void setCheckOutDate(Date checkOutDate, String opor) {
this.checkOutDate = checkOutDate; this.checkOutDate = checkOutDate;
this.outOpor = opor; this.outOpor = opor;
if(checkOutDate != null){//出库时判断是否过期 if (checkOutDate != null) {//出库时判断是否过期
updateExpTime(); updateExpTime();
if(expTime != null && checkOutDate.after(expTime)){ if (expTime != null && checkOutDate.after(expTime)) {
//过期时间小于出库时间,说明出库的时候已经过期了 //过期时间小于出库时间,说明出库的时候已经过期了
status = BARCODE_STATUS.OUT_EXPIRED; status = BARCODE_STATUS.OUT_EXPIRED;
}else{ } else {
status = BARCODE_STATUS.OUT_NORMAL; status = BARCODE_STATUS.OUT_NORMAL;
} }
} }
} }
public void setInOpor(String inOpor) { public void setInOpor(String inOpor) {
if(putInTime == -1){ if (putInTime == -1) {
this.inOpor = inOpor; this.inOpor = inOpor;
} }
} }
public int getSolderStatus() { public int getSolderStatus() {
if(solderStatus == SOLDER_STATUS.REWARMING){ if (solderStatus == SOLDER_STATUS.REWARMING) {
//如果状态是回温中,且回温时间已经大于warmTime,修改状态为待搅拌 //如果状态是回温中,且回温时间已经大于warmTime,修改状态为待搅拌
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
if(startWarmTime - now > warmTime * 60 * 60 * 1000){ if (startWarmTime - now > warmTime * 60 * 60 * 1000) {
solderStatus = SOLDER_STATUS.TO_BE_MIXED; solderStatus = SOLDER_STATUS.TO_BE_MIXED;
} }
} }
return solderStatus; return solderStatus;
} }
public String getNeedOutDateStr(){
if(needOutDate == null){ public String getNeedOutDateStr() {
if (needOutDate == null) {
return ""; return "";
} }
return DateUtil.toDateTimeString(needOutDate); return DateUtil.toDateTimeString(needOutDate);
} }
public String getExpireDateStr(){ public String getExpireDateStr() {
if(expireDate != null){ if (expireDate != null) {
return DateUtil.toDateString(expireDate); return DateUtil.toDateString(expireDate);
} }
return ""; return "";
...@@ -336,8 +350,8 @@ public class Barcode extends BasePo implements Serializable { ...@@ -336,8 +350,8 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 是否已过期 * 是否已过期
*/ */
public boolean isExpired(){ public boolean isExpired() {
if(expireDate != null){ if (expireDate != null) {
return expireDate.before(new Date()); return expireDate.before(new Date());
} }
return false; return false;
...@@ -346,12 +360,12 @@ public class Barcode extends BasePo implements Serializable { ...@@ -346,12 +360,12 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 是否即将(3天内)过期,已过期后,此字段变为false * 是否即将(3天内)过期,已过期后,此字段变为false
*/ */
public boolean isWillExpired(){ public boolean isWillExpired() {
if(isExpired()){ if (isExpired()) {
return false; return false;
} }
if(expireDate != null){ if (expireDate != null) {
return expireDate.before(DateUtil.addDays(new Date(),3)); return expireDate.before(DateUtil.addDays(new Date(), 3));
} }
return false; return false;
} }
...@@ -359,10 +373,38 @@ public class Barcode extends BasePo implements Serializable { ...@@ -359,10 +373,38 @@ public class Barcode extends BasePo implements Serializable {
/** /**
* 是否是小料(7x8)的料 * 是否是小料(7x8)的料
*/ */
public boolean isSmallReel(){ public boolean isSmallReel() {
if(getPlateSize() == 7){ if (getPlateSize() == 7) {
return getHeight() == 8 || getHeight() == 12; return getHeight() == 8 || getHeight() == 12;
} }
return false; return false;
} }
public Barcode getSubCode(String pnStr) {
if (subCodeMap == null) {
return null;
}
for (Barcode barcode :subCodeMap.values()
) {
if (barcode.getPartNumber().equals(pnStr)) {
return barcode;
}
}
return null;
}
public void UpdateSubCode(Barcode barcode) {
if (subCodeMap == null) {
subCodeMap = new HashMap<>();
}
if (barcode.getAmount() <= 0) {
if (subCodeMap.containsKey(barcode.getBarcode())) {
subCodeMap.remove(barcode.getBarcode());
}
} else {
subCodeMap.put(barcode.getBarcode(), barcode);
}
}
} }
...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.exception.ValidateException; ...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.DateUtil; import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.core.barcode.bean.BarcodeRule; import com.neotel.smfcore.core.barcode.bean.BarcodeRule;
import com.neotel.smfcore.core.barcode.bean.CodeBean; import com.neotel.smfcore.core.barcode.bean.CodeBean;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager; import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager; 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;
...@@ -13,6 +14,7 @@ import com.neotel.smfcore.core.barcode.service.po.Component; ...@@ -13,6 +14,7 @@ import com.neotel.smfcore.core.barcode.service.po.Component;
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.stereotype.Service; import org.springframework.stereotype.Service;
import org.yaml.snakeyaml.comments.CommentType;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
...@@ -42,15 +44,18 @@ public class CodeResolve { ...@@ -42,15 +44,18 @@ public class CodeResolve {
} }
} }
public CodeBean resolveSingleCode(String barcodeItemStr ){
return resolveSingleCode(barcodeItemStr, COMPONENT_TYPE.COMPONENT);
}
/** /**
* 解析条码为单个 Barcode,自动保存到数据库 * 解析条码为单个 Barcode,自动保存到数据库
*/ */
public CodeBean resolveSingleCode(String barcodeItemStr){ public CodeBean resolveSingleCode(String barcodeItemStr,int type){
if(barcodeRuleList == null || barcodeRuleList.isEmpty()){ if(barcodeRuleList == null || barcodeRuleList.isEmpty()){
CodeBean codeBean = new CodeBean(); CodeBean codeBean = new CodeBean();
codeBean.setBarcode(null); codeBean.setBarcode(null);
codeBean.setError("error.barcode.noRules", "解析规则未定义"); codeBean.setError("smfcode.error.barcode.noRules", "解析规则未定义");
codeBean.setCodeStr(barcodeItemStr); codeBean.setCodeStr(barcodeItemStr);
return codeBean; return codeBean;
} }
...@@ -112,19 +117,19 @@ public class CodeResolve { ...@@ -112,19 +117,19 @@ public class CodeResolve {
barcode.setLabelAmount(currentLabelAmount); barcode.setLabelAmount(currentLabelAmount);
needUpdate = true; needUpdate = true;
} }
// Date produceDate = barcodeFromRule.getProduceDate(); Date produceDate = barcodeFromRule.getProduceDate();
// if(produceDate != null){ if(produceDate != null){
// //抓取到了生产日期,未抓取到过期日期,重新设置过期日期 //抓取到了生产日期,未抓取到过期日期,重新设置过期日期
// if(barcode.getExpireDate() == null){ if(barcode.getExpireDate() == null){
// if(validDay > 0){ if(validDay > 0){
// log.info("重新设置"+codeBeanFromRule.getCodeStr()+"生产日期和过期日期"); log.info("重新设置"+codeBeanFromRule.getCodeStr()+"生产日期和过期日期");
// Date expireDate = DateUtil.addDays(produceDate, validDay); Date expireDate = DateUtil.addDays(produceDate, validDay);
// barcode.setExpireDate(expireDate); barcode.setExpireDate(expireDate);
// barcode.setProduceDate(produceDate); barcode.setProduceDate(produceDate);
// needUpdate = true; needUpdate = true;
// } }
// } }
// } }
if(needUpdate){ if(needUpdate){
try { try {
...@@ -141,7 +146,20 @@ public class CodeResolve { ...@@ -141,7 +146,20 @@ public class CodeResolve {
return codeBeanFromRule; return codeBeanFromRule;
}else if(codeBeanFromRule.isValid()){//数据库中不存在,但解析成功 }else if(codeBeanFromRule.isValid()){//数据库中不存在,但解析成功
Barcode barcodeFromRule = codeBeanFromRule.getBarcode(); Barcode barcodeFromRule = codeBeanFromRule.getBarcode();
try{ try{
if(type== COMPONENT_TYPE.FIXTURE||type==COMPONENT_TYPE.OTHERS){
//夹具类型,默认设置尺寸,数量
if(!codeBeanFromRule.hasReelSizeInfo()){
codeBeanFromRule.setReelHeight(1);
codeBeanFromRule.setReelWidth(1);
barcodeFromRule.setAmount(1);
barcodeFromRule.setHeight(1);
barcodeFromRule.setPlateSize(1);
}
}
//如果有料盘尺寸,重新设置料盘尺寸信息,没有档案时自动添加档案 //如果有料盘尺寸,重新设置料盘尺寸信息,没有档案时自动添加档案
if(codeBeanFromRule.hasReelSizeInfo()){ if(codeBeanFromRule.hasReelSizeInfo()){
//log.info("料盘["+barcode.getBarcode()+"]的尺寸信息从["+barcode.getPlateSize()+"x"+barcode.getHeight()+"]设置为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]"); //log.info("料盘["+barcode.getBarcode()+"]的尺寸信息从["+barcode.getPlateSize()+"x"+barcode.getHeight()+"]设置为["+codeBeanFromRule.getReelWidth()+"x"+codeBeanFromRule.getReelHeight()+"]");
...@@ -192,28 +210,30 @@ public class CodeResolve { ...@@ -192,28 +210,30 @@ public class CodeResolve {
} }
} }
barcode = barcodeManager.save(barcodeFromRule); barcode = barcodeManager.save(barcodeFromRule);
codeBeanFromRule.setCodeStr(barcode.getBarcode()); codeBeanFromRule.setCodeStr(barcode.getBarcode());
codeBeanFromRule.setBarcode(barcode); codeBeanFromRule.setBarcode(barcode);
codeBeanFromRule.setError(null,null); codeBeanFromRule.setError(null,null);
} }
}catch (ValidateException ve){ }catch (ValidateException ve){
//档案不存在 //档案不存在
codeBeanFromRule.setError("error.barcode.pnNotExist",new String[]{barcodeFromRule.getPartNumber()},"x档案 "+barcodeFromRule.getPartNumber()+" 不存在"); codeBeanFromRule.setError("smfcode.error.barcode.pnNotExist",new String[]{barcodeFromRule.getPartNumber()},"档案 {0} 不存在");
log.warn("x档案"+barcodeFromRule.getPartNumber()+"不存在"); log.warn("档案"+barcodeFromRule.getPartNumber()+"不存在");
} }
//解析成功了,直接返回 //解析成功了,直接返回
return codeBeanFromRule; return codeBeanFromRule;
}else{ }else{
//在数据库中不存在,且未解析成功,用其他规则再解析 //在数据库中不存在,且未解析成功,用其他规则再解析
codeBeanFromRule.setError("error.barcode.invalid",new String[]{barcodeItemStr}, barcodeItemStr + "不是有效的条码"); codeBeanFromRule.setError("smfcode.error.barcode.invalid",new String[]{barcodeItemStr}, "{0}不是有效的条码");
} }
} }
if(codeBeanFromRule == null){ if(codeBeanFromRule == null){
codeBeanFromRule = new CodeBean(); codeBeanFromRule = new CodeBean();
codeBeanFromRule.setBarcode(null); codeBeanFromRule.setBarcode(null);
codeBeanFromRule.setError("error.barcode.invalid",new String[]{barcodeItemStr}, barcodeItemStr + "不是有效的条码"); codeBeanFromRule.setError("smfcode.error.barcode.invalid",new String[]{barcodeItemStr}, "{0}不是有效的条码");
codeBeanFromRule.setCodeStr(barcodeItemStr); codeBeanFromRule.setCodeStr(barcodeItemStr);
return codeBeanFromRule; return codeBeanFromRule;
} }
...@@ -221,7 +241,6 @@ public class CodeResolve { ...@@ -221,7 +241,6 @@ public class CodeResolve {
} }
/** /**
* 解析条码为单个 Barcode * 解析条码为单个 Barcode
*/ */
......
...@@ -136,10 +136,10 @@ public class StatusBean { ...@@ -136,10 +136,10 @@ public class StatusBean {
} }
/** /**
* 是否超时(3秒) * 是否超时(10秒)
*/ */
public boolean timeOut(){ public boolean timeOut(){
return System.currentTimeMillis() - time > 10 * 1000; return (System.currentTimeMillis() - time) >( 10 * 1000);
} }
/** /**
......
package com.neotel.smfcore.core.device.handler.impl;
import com.neotel.smfcore.core.device.api.IOpAuthApi;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.order.enums.ORDER_COLOR;
import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.system.service.po.DataLog;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@Slf4j
public class AccShelfHandler extends BaseDeviceHandler{
public AccShelfHandler(List<IOpAuthApi> apiList) {
super(apiList);
}
@Override
public StatusBean handleClientRequest(StatusBean statusBean, HttpServletRequest request) {
handleMsg(statusBean);
statusBean = saveAlarmAndHumidity(statusBean);
//亮灯
Collection<DataLog> queueTasks = taskService.getQueueTasks(statusBean.getCid());
for (DataLog queueTask : queueTasks) {
if(queueTask.isWait()){
queueTask.setStatus(OP_STATUS.EXECUTING.name());
taskService.updateQueueTask(queueTask);
String rgb = queueTask.getLightColor();
ORDER_COLOR color = ORDER_COLOR.fromRgb(rgb);
if(color == null){
if(queueTask.isPutInTask()){
color = ORDER_COLOR.DARKGREEN;
}else{
color = ORDER_COLOR.BLUE;
}
}
statusBean.addData("open",queueTask.getPosName()+"="+color.name());
log.info("库位["+queueTask.getPosName()+"]+亮灯:" + color.name());
}
}
return statusBean;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.ACCSHELF;
}
}
package com.neotel.smfcore.core.device.handler.impl; package com.neotel.smfcore.core.device.handler.impl;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.ReelLockPosUtil; import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StorageConstants; import com.neotel.smfcore.common.utils.StorageConstants;
import com.neotel.smfcore.core.barcode.bean.CodeBean; import com.neotel.smfcore.core.barcode.bean.CodeBean;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE; import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
...@@ -515,10 +518,10 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -515,10 +518,10 @@ public class BaseDeviceHandler implements IDeviceHandler {
protected void finishedOutPos(String cid, String posName,int executeTime) throws ValidateException { protected void finishedOutPos(String cid, String posName,int executeTime) throws ValidateException {
DataLog task = taskService.findExecutingTask(cid, posName); DataLog task = taskService.findExecutingTask(cid, posName);
if (task != null && task.isCheckOutTask()) { if (task != null && task.isCheckOutTask()) {
if(executeTime>0){ if (executeTime > 0) {
task.setExecuteTime(executeTime); task.setExecuteTime(executeTime);
} }
log.info(task.getBarcode() + "出仓位[" + task.getPosName() + "]完成,执行时间["+executeTime+"]秒"); log.info(task.getBarcode() + "出仓位[" + task.getPosName() + "]完成,执行时间[" + executeTime + "]秒");
DataLog cancelTask = taskService.findFinishedTask(cid, posName); DataLog cancelTask = taskService.findFinishedTask(cid, posName);
if (cancelTask != null && cancelTask.isCancel()) { if (cancelTask != null && cancelTask.isCancel()) {
//将相同库位已经取消的任务从完成队列里删除 //将相同库位已经取消的任务从完成队列里删除
...@@ -532,17 +535,30 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -532,17 +535,30 @@ public class BaseDeviceHandler implements IDeviceHandler {
task = taskService.findFinishedTask(cid, posName); task = taskService.findFinishedTask(cid, posName);
if (task != null && task.isCheckOutTask()) { if (task != null && task.isCheckOutTask()) {
if (task.isCancel()) {//被取消的任务,客户端发完成信号过来,修改取消状态为已完成 if (task.isCancel()) {//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
if(executeTime>0){ if (executeTime > 0) {
task.setExecuteTime(executeTime); task.setExecuteTime(executeTime);
} }
log.info(task.getBarcode() + "出仓位[" + task.getPosName() + "]完成,但任务已被取消,修改为完成,执行时间["+executeTime+"]秒"); log.info(task.getBarcode() + "出仓位[" + task.getPosName() + "]完成,但任务已被取消,修改为完成,执行时间[" + executeTime + "]秒");
updateCheckoutData(task); updateCheckoutData(task);
} }
} else { } else {
StoragePos storagePos = storagePosManager.getByPosName(posName);
if (storagePos != null && storagePos.isUsed()) {
String barcode = storagePos.getBarcode().getBarcode();
//查找库位是否为空,如果库位有料,调用清理手动出库的方法清理库存
if (ObjectUtil.isNotEmpty(barcode)) {
log.info(cid + "出仓位[" + posName + "]完成时任务不存在,清理库位中的库存[" + barcode + "]");
taskService.addTaskToFinished(storagePos, null, cid + "-clear");
}else{
log.info(cid + "出仓位[" + posName + "]完成时任务不存在,清理库位失败,条码为空");
}
} else {
log.warn(cid + "出仓位[" + posName + "]完成时任务不存在"); log.warn(cid + "出仓位[" + posName + "]完成时任务不存在");
} }
} }
} }
}
/** /**
* 入库完成时,更新库位的最小入库时间 * 入库完成时,更新库位的最小入库时间
* @param posId * @param posId
......
package com.neotel.smfcore.core.device.handler.impl;
import com.neotel.smfcore.core.device.api.IOpAuthApi;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.po.Storage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Service
@Slf4j
public class LineBoxHandler extends BaseDeviceHandler {
public LineBoxHandler(List<IOpAuthApi> apiList) {
super(apiList);
}
@Override
public StatusBean handleClientRequest(StatusBean statusBean, HttpServletRequest request) {
String cid = statusBean.getCid();
Storage storage = dataCache.getStorage(cid);
if (storage == null) {
log.error("料仓cid: [" + cid + "]不存在");
return null;
}
handleMsg(statusBean);
statusBean = saveAlarmAndHumidity(statusBean);
statusBean = handleInOutFinished(statusBean);
StatusBean humidityResult = handleHumidity(statusBean);
if (humidityResult != null) {
return humidityResult;
}
if (statusBean.getOp() == OP.PUT_IN) {
log.debug("入库:" + statusBean.toString());
statusBean = putInLine(storage, statusBean);
} else {
//查看是否有要出库的操作
statusBean =taskService.checkOut(storage, statusBean);
}
return statusBean;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.LINE;
}
}
package com.neotel.smfcore.core.device.handler.impl; package com.neotel.smfcore.core.device.handler.impl;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
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.exception.ValidateException;
import com.neotel.smfcore.common.utils.SecurityUtils; import com.neotel.smfcore.common.utils.SecurityUtils;
...@@ -20,6 +22,7 @@ import com.neotel.smfcore.core.storage.enums.DeviceType; ...@@ -20,6 +22,7 @@ import com.neotel.smfcore.core.storage.enums.DeviceType;
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.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.websocket.MsgType; import com.neotel.smfcore.core.system.websocket.MsgType;
import com.neotel.smfcore.core.system.websocket.SocketMsg; import com.neotel.smfcore.core.system.websocket.SocketMsg;
import com.neotel.smfcore.core.system.websocket.WebSocketServer; import com.neotel.smfcore.core.system.websocket.WebSocketServer;
...@@ -175,6 +178,14 @@ public class SensorShelfHandler extends BaseDeviceHandler { ...@@ -175,6 +178,14 @@ public class SensorShelfHandler extends BaseDeviceHandler {
String[] hasReelPosList = request.getParameterValues("hasReelPosList"); String[] hasReelPosList = request.getParameterValues("hasReelPosList");
String[] noReelPosList = request.getParameterValues("noReelPosList"); String[] noReelPosList = request.getParameterValues("noReelPosList");
String[] hasReelPosErrorList = request.getParameterValues("hasReelPosErrorList");
String[] noReelPosErrorList = request.getParameterValues("noReelPosErrorList");
List<List<String>> data=new ArrayList<>();
data.add(Arrays.asList(hasReelPosErrorList) );
data.add(Arrays.asList(noReelPosErrorList));
DevicesStatusUtil.updateDeviceData(cid,data);
List<String> inOkList = new ArrayList<>(); List<String> inOkList = new ArrayList<>();
List<String> inNgList = new ArrayList<>(); List<String> inNgList = new ArrayList<>();
List<String> outOkList = new ArrayList<>(); List<String> outOkList = new ArrayList<>();
...@@ -198,7 +209,16 @@ public class SensorShelfHandler extends BaseDeviceHandler { ...@@ -198,7 +209,16 @@ public class SensorShelfHandler extends BaseDeviceHandler {
}else{ }else{
Collection<DataLog> queueTasks = taskService.getQueueTasks(); Collection<DataLog> queueTasks = taskService.getQueueTasks();
for (DataLog queueTask : queueTasks) { for (DataLog queueTask : queueTasks) {
if(queueTask.isPutInTask() && queueTask.getGroupId().equals(groupId)){ boolean isPutInTask=false;
if(ObjectUtil.isNotEmpty(queueTask.getStorageId()) ){
if(queueTask.isPutInTask()&&queueTask.getStorageId().equals(storage.getId())){
isPutInTask=true;
}
}
else if(queueTask.isPutInTask() && queueTask.getGroupId().equals(groupId)) {
isPutInTask = true;
}
if(isPutInTask) {
queueTask.setCid(cid); queueTask.setCid(cid);
queueTask.setPosId(pos.getId()); queueTask.setPosId(pos.getId());
queueTask.setPosName(pos.getPosName()); queueTask.setPosName(pos.getPosName());
...@@ -206,15 +226,15 @@ public class SensorShelfHandler extends BaseDeviceHandler { ...@@ -206,15 +226,15 @@ public class SensorShelfHandler extends BaseDeviceHandler {
queueTask.setStorageName(storage.getName()); queueTask.setStorageName(storage.getName());
try { try {
//入库完成,发送入库完成请求 //入库完成,发送入库完成请求
super.finishedPutIn(cid,pos.getPosName()); super.finishedPutIn(cid, pos.getPosName());
inOkList.add(hasReelPosList[0]); inOkList.add(hasReelPosList[0]);
String msg = queueTask.getBarcode()+ "入库到"+ pos.getPosName()+"成功"; String msg = queueTask.getBarcode() + "入库到" + pos.getPosName() + "成功";
log.error(msg); log.error(msg);
WebSocketServer.sendGroupMsg(groupId,new SocketMsg(msg, MsgType.INFO)); WebSocketServer.sendGroupMsg(groupId, new SocketMsg(msg, MsgType.INFO));
break; break;
} catch (Exception e) { } catch (Exception e) {
log.error("入库出错",e); log.error("入库出错", e);
return ResultBean.newErrorResult(-1,"smfcore.inputError","入库出错:{0}" ,new String[]{ e.getMessage()}); return ResultBean.newErrorResult(-1, "smfcore.inputError", "入库出错:{0}", new String[]{e.getMessage()});
} }
} }
} }
......
package com.neotel.smfcore.core.device.handler.impl;
import com.google.common.base.Strings;
import com.neotel.smfcore.common.utils.StorageConstants;
import com.neotel.smfcore.core.device.api.IOpAuthApi;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.enums.BOX_STATUS;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.po.DataLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Service
@Slf4j
public class XLCBoxHandler extends BaseDeviceHandler {
public XLCBoxHandler(List<IOpAuthApi> apiList) {
super(apiList);
}
/**
* 当前出入库操作的库位(key为cid, value为当前执行的任务)
*/
private Map<String,DataLog> operateTaskMap = new ConcurrentHashMap<>();
/**
* 获取当前正在执行的任务
*/
public DataLog getCurrentTask(String cid){
return operateTaskMap.get(cid);
}
/**
* 更新或清理(task为null)当前正在执行的任务
*/
public void updateCurrentTask(String cid, DataLog task){
if(task == null){
operateTaskMap.remove(cid);
}else{
operateTaskMap.put(cid, task);
}
}
@Override
public StatusBean handleClientRequest(StatusBean statusBean, HttpServletRequest request) {
handleMsg(statusBean);
statusBean = saveAlarmAndHumidity(statusBean);
statusBean = handleXLCStatusBean(statusBean);
statusBean = handleInOutFinished(statusBean);
StatusBean humidityResult = handleHumidity(statusBean);
if(humidityResult != null){
return humidityResult;
}
return statusBean;
}
private StatusBean handleXLCStatusBean(StatusBean statusBean){
String cid = statusBean.getCid();
Collection<DataLog> queueTasks = taskService.getQueueTasks(cid);
Map<String, BoxStatusBean> statusOfBoxes = statusBean.getBoxStatus();
if (statusOfBoxes != null) {
for (BoxStatusBean boxStatus : statusOfBoxes.values()) {
try {
//出库入库动作完成处理
int status = boxStatus.getStatus();
String posName = boxStatus.getPosId();
if(!Strings.isNullOrEmpty(posName)){//客户端发一次完成之后,会发空的 posName,不需要处理
if (BOX_STATUS.OUT_FINISHED == status) {//出仓完成,设置当前任务
DataLog currentTask = null;
for (DataLog queueTask : queueTasks) {
if(queueTask.isExecuting() && queueTask.getPosName().equals(posName)){
currentTask = queueTask;
String doorInfo = statusBean.getFromData("door");
if(doorInfo == null){
doorInfo = "1";
}
currentTask.setSubSourceId(doorInfo);
taskService.updateQueueTask(currentTask);
break;
}
}
DataLog cacheTask = operateTaskMap.get(cid);
if(currentTask != null){
if(cacheTask == null || !cacheTask.getId().equals(currentTask.getId())){
updateCurrentTask(currentTask.getCid(),currentTask);
}
}
}
}
} catch (Exception e) {
log.error("方仓到位时出错",e);
}
}
}
if(statusBean.getStatus() == StorageConstants.STATUS.READY){
DataLog currentTask = getCurrentTask(cid);
if(currentTask != null){
//当前有任务未完成,暂不执行其他任务
return statusBean;
}
for (DataLog task : queueTasks) {
if (cid.equals(task.getCid()) && task.isWait()) {
StoragePos pos = storagePosManager.getByPosName(task.getPosName());
if(pos.isExpandPos()){
continue;
}
if(task.isPutInTask()){
statusBean.setOp(OP.PUT_IN);
statusBean.addData("door",task.getSubSourceId());
}else if(task.isCheckOutTask()){
statusBean.setOp(OP.CHECKOUT);
}
statusBean.addPosInfo("",pos.getPosName(),pos.getW(),pos.getH(),false);
log.info("发送["+task.getType()+"]任务["+pos.getPosName()+"]到客户端door="+task.getSubSourceId());
task.setStatus(OP_STATUS.EXECUTING.name());
taskService.updateQueueTask(task);
return statusBean;
}
}
}
return statusBean;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.SMD_XLC;
}
}
...@@ -214,20 +214,21 @@ public class DeviceController { ...@@ -214,20 +214,21 @@ public class DeviceController {
resultMap.put("result","0"); resultMap.put("result","0");
resultMap.put("msg",""); resultMap.put("msg","");
okMsg = "["+rfid+"]["+barcode.getBarcode()+"]锁定库位["+pos.getPosName()+"]";
okMsg = "["+rfid+"]["+barcode.getBarcode()+"]锁定库位["+pos.getPosName()+"]优先级["+pos.getPriority()+"] 上个库位号["+lastPosId+"]";
ReelLockPosInfo oldLockInfo = ReelLockPosUtil.getLockPosInfoByCode(barcode.getBarcode()); ReelLockPosInfo oldLockInfo = ReelLockPosUtil.getLockPosInfoByCode(barcode.getBarcode());
if(oldLockInfo != null){ if(oldLockInfo != null) {
if(!oldLockInfo.getBarcode().equals(barcode.getBarcode())){ if (!oldLockInfo.getBarcode().equals(barcode.getBarcode())) {
String result = "-1"; String result = "-1";
okMsg = rfid+"["+ rfidLoc +"]["+barcode.getBarcode()+"]锁定库位["+pos.getPosName()+"],清理旧有锁定信息"; okMsg = rfid + "[" + rfidLoc + "][" + barcode.getBarcode() + "]锁定库位[" + pos.getPosName() + "],清理旧有锁定信息";
resultMap.put("result",result); resultMap.put("result", result);
resultMap.put("msg",okMsg); resultMap.put("msg", okMsg);
//已经锁定过库位,但不是同一个条码,需要把对应位置的锁定信息清理掉 //已经锁定过库位,但不是同一个条码,需要把对应位置的锁定信息清理掉
ReelLockPosUtil.removeReelLockPosInfo(oldLockInfo.getBarcode()); ReelLockPosUtil.removeReelLockPosInfo(oldLockInfo.getBarcode());
log.info("清理锁定库位:库位号["+oldLockInfo.getLockPosName()+"]上物料["+oldLockInfo.getBarcode()+"]锁定的库位"); log.info("清理锁定库位:库位号[" + oldLockInfo.getLockPosName() + "]上物料[" + oldLockInfo.getBarcode() + "]锁定的库位");
} }
} }
......
...@@ -527,4 +527,17 @@ public class DataCache { ...@@ -527,4 +527,17 @@ public class DataCache {
} }
return cidList; return cidList;
} }
public List<String> getAvailableStorageIds(){
List<String> availableStorageIds = new ArrayList<>();
for (Storage storage : getAllStorage().values()) {
//默认所有料仓可用
// StatusBean statusBean =dataCache. getStatus(storage.getCid());
// if (statusBean.isAvailable())
{
availableStorageIds.add(storage.getId());
}
}
return availableStorageIds;
}
} }
package com.neotel.smfcore.core.kanban.rest.bean.dto; package com.neotel.smfcore.core.kanban.rest.bean.dto;
import com.neotel.smfcore.core.device.enums.OP_STATUS; import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.storage.bean.UsageItem;
import com.neotel.smfcore.core.storage.enums.DeviceType; import com.neotel.smfcore.core.storage.enums.DeviceType;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
...@@ -24,13 +29,6 @@ public class BoxStatusDto { ...@@ -24,13 +29,6 @@ public class BoxStatusDto {
@ApiModelProperty("是否在线") @ApiModelProperty("是否在线")
private boolean onLine=false; private boolean onLine=false;
/// <summary>
/// 单台BOX状态
///1=正常运行中
/// 2=急停,3=故障,4=警告,5=调试中
/// 6入库执行中,7入仓位完成,8入库失败
/// 9出库执行中,10出仓位完成,11出库失败
/// </summary>
@ApiModelProperty("单台BOX状态,0=离线,1=正常运行中, 2=急停,3=故障,4=警告,5=调试中,6入库执行中,7入仓位完成,8入库失败, 9出库执行中,10出仓位完成,11出库失败") @ApiModelProperty("单台BOX状态,0=离线,1=正常运行中, 2=急停,3=故障,4=警告,5=调试中,6入库执行中,7入仓位完成,8入库失败, 9出库执行中,10出仓位完成,11出库失败")
private int status=0; private int status=0;
@ApiModelProperty("温度") @ApiModelProperty("温度")
...@@ -51,10 +49,6 @@ public class BoxStatusDto { ...@@ -51,10 +49,6 @@ public class BoxStatusDto {
@ApiModelProperty("当前执行任务的,0=无,1=入库,2=出库") @ApiModelProperty("当前执行任务的,0=无,1=入库,2=出库")
private int currTaskType=0; private int currTaskType=0;
/**
* 当前执行任务的 任务状态:OP_STATUS:NONE,WAIT=等待,EXECUTING=正在执行,PAUSE=已暂停,FINISHED=已完成,CANCEL=已取消,END=已结束
*/
@ApiModelProperty("当前执行任务的 任务状态:OP_STATUS:NONE,WAIT=等待,EXECUTING=正在执行,PAUSE=已暂停,FINISHED=已完成,CANCEL=已取消,END=已结束") @ApiModelProperty("当前执行任务的 任务状态:OP_STATUS:NONE,WAIT=等待,EXECUTING=正在执行,PAUSE=已暂停,FINISHED=已完成,CANCEL=已取消,END=已结束")
private String currTaskStatus; private String currTaskStatus;
...@@ -70,4 +64,10 @@ public class BoxStatusDto { ...@@ -70,4 +64,10 @@ public class BoxStatusDto {
@ApiModelProperty("料仓类型") @ApiModelProperty("料仓类型")
private String type = DeviceType.AUTO.name(); private String type = DeviceType.AUTO.name();
@ApiModelProperty("使用情况")
private Map<String, UsageItem> usageMap = new ConcurrentHashMap<>();
@ApiModelProperty("操作信息")
private Map<String, String> data = new HashMap<>();
} }
package com.neotel.smfcore.core.kanban.rest.bean.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ShelfPosErrorDto {
@ApiModelProperty("库位号ID")
private String posId;
@ApiModelProperty("库位号")
private String posName;
@ApiModelProperty("条码信息")
private String barcode;
@ApiModelProperty("物料编号")
private String partNumber;
@ApiModelProperty("信号状态")
private int signalState;
}
...@@ -17,6 +17,10 @@ import java.util.Locale; ...@@ -17,6 +17,10 @@ import java.util.Locale;
@Slf4j @Slf4j
public class MessageUtils { public class MessageUtils {
public static Locale getDefaultLocal(){
return new Locale("zh-CH");
}
private static MessageSource messageSource; private static MessageSource messageSource;
public MessageUtils(MessageSource messageSource) { public MessageUtils(MessageSource messageSource) {
......
...@@ -33,6 +33,11 @@ public class OrderDto implements Serializable { ...@@ -33,6 +33,11 @@ public class OrderDto implements Serializable {
@ApiModelProperty("当前任务已完成盘数") @ApiModelProperty("当前任务已完成盘数")
private int finishedReelCount = 0; private int finishedReelCount = 0;
@ApiModelProperty("累计任务盘数")
private int totalTaskReelCount = 0;
@ApiModelProperty("累计任务已完成盘数")
private int totalFinishedReelCount = 0;
/** /**
* 订单状态 * 订单状态
* 0=新建工单 * 0=新建工单
...@@ -52,28 +57,18 @@ public class OrderDto implements Serializable { ...@@ -52,28 +57,18 @@ public class OrderDto implements Serializable {
@ApiModelProperty("出库状态, 2表示已完成") @ApiModelProperty("出库状态, 2表示已完成")
private boolean closed = false; private boolean closed = false;
/**
* 工单来源
*/
@ApiModelProperty("工单来源") @ApiModelProperty("工单来源")
private String source = ""; private String source = "";
/**
* 任务完成时间(用于关闭页面显示)
*/
@ApiModelProperty("任务完成时间(用于关闭页面显示)") @ApiModelProperty("任务完成时间(用于关闭页面显示)")
@Transient @Transient
private long taskFinishedTime = -1; private long taskFinishedTime = -1;
/**
* 套(倍)数
*/
@ApiModelProperty("套(倍)数") @ApiModelProperty("套(倍)数")
private float orderTimes = 1f; private float orderTimes = 1f;
/**
* 订单的详细信息
*/
@Transient @Transient
@ApiModelProperty("订单的详细信息") @ApiModelProperty("订单的详细信息")
private List<OrderItemDto> orderItems; private List<OrderItemDto> orderItems;
...@@ -84,4 +79,8 @@ public class OrderDto implements Serializable { ...@@ -84,4 +79,8 @@ public class OrderDto implements Serializable {
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Date createDate = new Date(); private Date createDate = new Date();
@ApiModelProperty("工单线别")
private String line = "";
} }
...@@ -5,7 +5,11 @@ import com.neotel.smfcore.common.exception.ValidateException; ...@@ -5,7 +5,11 @@ import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.order.service.po.LiteOrder; import com.neotel.smfcore.core.order.service.po.LiteOrder;
import java.util.List;
public interface ILiteOrderManager extends IBaseManager<LiteOrder> { public interface ILiteOrderManager extends IBaseManager<LiteOrder> {
LiteOrder findByOrderNo(String orderNo); LiteOrder findByOrderNo(String orderNo);
LiteOrder createWithItems(LiteOrder liteOrder) throws ValidateException; LiteOrder createWithItems(LiteOrder liteOrder) throws ValidateException;
List<LiteOrder> findUnEndOrdersList();
} }
...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.exception.ValidateException; ...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.barcode.service.dao.IBarcodeDao; import com.neotel.smfcore.core.barcode.service.dao.IBarcodeDao;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager; import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.order.enums.LITEORDER_STATUS;
import com.neotel.smfcore.core.order.service.dao.ILiteOrderDao; import com.neotel.smfcore.core.order.service.dao.ILiteOrderDao;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager; 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;
...@@ -15,6 +16,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -15,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; 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.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -76,6 +78,22 @@ public class LiteOrderManagerImpl implements ILiteOrderManager { ...@@ -76,6 +78,22 @@ public class LiteOrderManagerImpl implements ILiteOrderManager {
} }
@Override @Override
public List<LiteOrder> findUnEndOrdersList() {
Criteria c = new Criteria();
c.and("status").nin(LITEORDER_STATUS.CLOSED);
Query query = new Query(c);
List<LiteOrder> orders = findByQuery(query);
for (LiteOrder order : orders
) {
if (order != null && order.getOrderItems() == null) {
List<LiteOrderItem> items = liteOrderItemManager.findOrderItems(order.getOrderNo());
order.setOrderItems(items);
}
}
return orders;
}
@Override
public PageData<LiteOrder> findByPage(Query query, Pageable pageable) { public PageData<LiteOrder> findByPage(Query query, Pageable pageable) {
int totalCount = liteOrderDao.countByQuery(query); int totalCount = liteOrderDao.countByQuery(query);
List<LiteOrder> list = liteOrderDao.findByQuery(query, pageable); List<LiteOrder> list = liteOrderDao.findByQuery(query, pageable);
......
...@@ -25,10 +25,14 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -25,10 +25,14 @@ public class LiteOrder extends BasePo implements Serializable {
} }
/** /**
* 单号 * 需求单号
*/ */
private String orderNo; private String orderNo;
/** /**
* 工单号
*/
private String so;
/**
* 当前任务盘数 * 当前任务盘数
*/ */
private int taskReelCount = 0; private int taskReelCount = 0;
...@@ -39,6 +43,16 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -39,6 +43,16 @@ public class LiteOrder extends BasePo implements Serializable {
private int finishedReelCount = 0; private int finishedReelCount = 0;
/** /**
* 累计任务盘数
*/
private int totalTaskReelCount = 0;
/**
* 累计任务已完成盘数
*/
private int totalFinishedReelCount = 0;
/**
* 订单状态 * 订单状态
*/ */
private int status = LITEORDER_STATUS.NEW; private int status = LITEORDER_STATUS.NEW;
...@@ -48,13 +62,6 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -48,13 +62,6 @@ public class LiteOrder extends BasePo implements Serializable {
*/ */
private boolean closed = false; private boolean closed = false;
public void setClosed(boolean value){
this.closed=value;
if(value){
setStatus(LITEORDER_STATUS.CLOSED);
}
}
/** /**
* 工单来源 * 工单来源
...@@ -62,6 +69,11 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -62,6 +69,11 @@ public class LiteOrder extends BasePo implements Serializable {
private String source = ""; private String source = "";
/** /**
* 线别,AGV运送时使用此值做为目的地
*/
private String line = "";
/**
* 任务完成时间(用于关闭页面显示) * 任务完成时间(用于关闭页面显示)
*/ */
@Transient @Transient
...@@ -88,16 +100,25 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -88,16 +100,25 @@ public class LiteOrder extends BasePo implements Serializable {
*/ */
private Date sdate=new Date(); private Date sdate=new Date();
public void setClosed(boolean value){
this.closed=value;
if(value){
setStatus(LITEORDER_STATUS.CLOSED);
}
}
/** /**
* 结束当前的任务 * 结束当前的任务
*/ */
public void finishedTasks(){ public void finishedTasks(){
if(isOutOne()){ if(isOutOne()){
setStatus(LITEORDER_STATUS.ONE_FINISHED); // setStatus(LITEORDER_STATUS.ONE_FINISHED);
setClosed(true);
}else if(isOutBom()){ }else if(isOutBom()){
setStatus(LITEORDER_STATUS.BOM_FINISHED); setStatus(LITEORDER_STATUS.BOM_FINISHED);
}else if(isOutTails()){ }else if(isOutTails()){
setStatus(LITEORDER_STATUS.TAILS_FINISHED); // setStatus(LITEORDER_STATUS.TAILS_FINISHED);
setClosed(true);
} }
setTaskFinishedTime(System.currentTimeMillis()); setTaskFinishedTime(System.currentTimeMillis());
...@@ -150,6 +171,13 @@ public class LiteOrder extends BasePo implements Serializable { ...@@ -150,6 +171,13 @@ public class LiteOrder extends BasePo implements Serializable {
this.taskReelCount = taskReelCount; this.taskReelCount = taskReelCount;
} }
public void setTotalTaskReelCount(int totalReelCount){
if(totalReelCount<0){
totalReelCount=0;
}
this.totalTaskReelCount=totalReelCount;
}
/** /**
* 是否需要展示(已完成的,过20 秒自动清除) * 是否需要展示(已完成的,过20 秒自动清除)
......
...@@ -20,24 +20,44 @@ public class LiteOrderItem extends BasePo implements Serializable { ...@@ -20,24 +20,44 @@ public class LiteOrderItem extends BasePo implements Serializable {
private String ri; private String ri;
//需求数量 /**
* 总需求数量
*/
private int needNum = 0; private int needNum = 0;
/** /**
* 需求料盘数 * 需求料盘数
*/ */
private int needReelCount = 0; private int needReelCount = 0;
//已出数量 /**
* 当前任务已出数量
*/
private int outNum = 0; private int outNum = 0;
//已出盘数 /**
* 当前任务已出盘数
*/
private int outReelCount = 0; private int outReelCount = 0;
/** /**
* 累计已出数量
*/
private int totalOutNum = 0;
/**
* 累计已出盘数
*/
private int totalOutReelCount = 0;
/**
* 订单信息 * 订单信息
*/ */
private String orderNo = ""; private String orderNo = "";
/**
* 站位编号
*/
private String slotNum="";
/** /**
* 站位信息 * 站位信息
......
...@@ -89,9 +89,18 @@ public enum DeviceType { ...@@ -89,9 +89,18 @@ public enum DeviceType {
* 13 SMD-DUO(DUO料仓) * 13 SMD-DUO(DUO料仓)
*/ */
SMD_DUO("storage.type.smdDuo"), SMD_DUO("storage.type.smdDuo"),
/**
* 14 放料箱的方仓
*/
SMD_XLC("storage.type.smdXlc"),
/**
* 15 放料盘的方仓
*/
SMD_XLR("storage.type.smdXlr"),
/** /**
* 14 (默认料仓) * 15 (默认料仓)
*/ */
DEFAULT("storage.type.default") DEFAULT("storage.type.default")
; ;
......
...@@ -7,8 +7,11 @@ import com.neotel.smfcore.common.bean.PageData; ...@@ -7,8 +7,11 @@ import com.neotel.smfcore.common.bean.PageData;
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.exception.ValidateException;
import com.neotel.smfcore.common.utils.QueryHelp; import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StorageConstants; import com.neotel.smfcore.common.utils.StorageConstants;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE; import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.bean.InventoryItem; import com.neotel.smfcore.core.storage.bean.InventoryItem;
import com.neotel.smfcore.core.storage.rest.dto.*; import com.neotel.smfcore.core.storage.rest.dto.*;
...@@ -21,6 +24,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager; ...@@ -21,6 +24,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.Label; import com.neotel.smfcore.core.storage.service.po.Label;
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.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -61,6 +65,9 @@ public class MaterialController { ...@@ -61,6 +65,9 @@ public class MaterialController {
@Autowired @Autowired
private final ILabelManager labelManager; private final ILabelManager labelManager;
@Autowired
private final IBarcodeManager barcodeManager;
@ApiOperation("策略出库获取库存列表") @ApiOperation("策略出库获取库存列表")
@GetMapping(value = "/inventory") @GetMapping(value = "/inventory")
@PreAuthorize("@el.check('tacticsOuput')") @PreAuthorize("@el.check('tacticsOuput')")
...@@ -153,24 +160,24 @@ public class MaterialController { ...@@ -153,24 +160,24 @@ public class MaterialController {
@PostMapping(value = "/labelOuput") @PostMapping(value = "/labelOuput")
@PreAuthorize("@el.check('labelOuput')") @PreAuthorize("@el.check('labelOuput')")
public ResultBean labelOuput(@RequestBody PosLabelDto params) { public ResultBean labelOuput(@RequestBody PosLabelDto params) {
List<String> posIds=params.getPosIds(); List<String> posIds = params.getPosIds();
if (posIds == null) { if (posIds == null) {
throw new ValidateException("smfcode.valueCanotNull", "{0}不能为空", new String[]{"PN"}); throw new ValidateException("smfcode.valueCanotNull", "{0}不能为空", new String[]{"PN"});
} }
for (String posId:posIds){ for (String posId : posIds) {
StoragePos pos = storagePosManager.get(posId); StoragePos pos = storagePosManager.get(posId);
if (pos == null) { if (pos == null) {
throw new ValidateException("smfcode.valueNotExist","{0}[{1}]不存在",new String[]{"posId",posId}); throw new ValidateException("smfcode.valueNotExist", "{0}[{1}]不存在", new String[]{"posId", posId});
} }
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage == null) { if (storage == null) {
throw new ValidateException("smfcode.valueNotExist","{0}[{1}]不存在",new String[]{"storageId",pos.getStorageId()}); throw new ValidateException("smfcode.valueNotExist", "{0}[{1}]不存在", new String[]{"storageId", pos.getStorageId()});
} }
log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】"); log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】");
String outResult = taskService.checkout(storage, pos, true); String outResult = taskService.checkout(storage, pos, true,SecurityUtils.getCurrentUsername());
if (!Strings.isNullOrEmpty(outResult)) { if (!Strings.isNullOrEmpty(outResult)) {
throw new ValidateException("smfcode.error", outResult); throw new ValidateException("smfcode.error", outResult);
} }
...@@ -187,17 +194,48 @@ public class MaterialController { ...@@ -187,17 +194,48 @@ public class MaterialController {
// List<String> posIds=(List<String>) params.get("posIds"); // List<String> posIds=(List<String>) params.get("posIds");
// String labelId = params.get("labelId").toString(); // String labelId = params.get("labelId").toString();
List<String> posIds=params.getPosIds(); List<String> posIds = params.getPosIds();
String labelId =params.getLabelId(); String labelId = params.getLabelId();
if(posIds==null||posIds.size()<=0){ if (posIds == null || posIds.size() <= 0) {
throw new ValidateException("smfcode.valueCanotNull", "{0}不能为空", new String[]{"ID"}); throw new ValidateException("smfcode.valueCanotNull", "{0}不能为空", new String[]{"ID"});
} }
if(ObjectUtil.isEmpty(labelId)){ if (ObjectUtil.isEmpty(labelId)) {
labelId=""; labelId = "";
} }
String[] array= posIds.toArray(new String[posIds.size()]) ; String[] array = posIds.toArray(new String[posIds.size()]);
storagePosManager.updatePosLabel(array,labelId); storagePosManager.updatePosLabel(array, labelId);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
@ApiOperation("手动出库")
@PostMapping(value = "/manualOut")
@PreAuthorize("@el.check('manualOut')")
public ResultBean manualOut(@RequestBody Map<String, String> paramMap) {
String code = paramMap.get("barcode");
Barcode barcode = barcodeManager.findByBarcode(code);
StoragePos storagePos = storagePosManager.getByBarcode(code);
if (storagePos != null) {
if (!ObjectUtil.isEmpty(storagePos.getBarcode().getLockId())) {
throw new ValidateException("smfcode.error.barcode.locked", "库位[{0}]已被锁定");
}
try {
if (barcode != null) {
String opUser = SecurityUtils.getCurrentUsername();
log.info(opUser + "清理库位[" + storagePos.getPosName() + "],条码[" + code + "]中的库存" + barcode.getBarcode());
taskService.addTaskToFinished(storagePos, null, opUser + "-manual");
} else {
log.info("清理库位[" + storagePos.getPosName() + "],条码[" + code + "],库位条码为空");
}
return ResultBean.newOkResult("smfcode.manualOut.ok", "手动出库成功", code);
} catch (Exception e) {
return ResultBean.newOkResult("smfcore.error", "出错{0}", new String[]{e.getMessage()}, code);
}
} else {
throw new ValidateException("smfcode.manualOut.notFound", "仓库中未找到料盘信息");
}
}
} }
...@@ -2,6 +2,7 @@ package com.neotel.smfcore.core.storage.rest.query; ...@@ -2,6 +2,7 @@ package com.neotel.smfcore.core.storage.rest.query;
import com.neotel.smfcore.common.annotation.QueryCondition; import com.neotel.smfcore.common.annotation.QueryCondition;
import com.neotel.smfcore.common.bean.BetweenData; import com.neotel.smfcore.common.bean.BetweenData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
...@@ -27,4 +28,8 @@ public class StoragePosQueryCriteria { ...@@ -27,4 +28,8 @@ public class StoragePosQueryCriteria {
@QueryCondition(type = QueryCondition.Type.IN, propName = "storageId") @QueryCondition(type = QueryCondition.Type.IN, propName = "storageId")
private List<String> storageIdList; private List<String> storageIdList;
@ApiModelProperty("是否启用")
@QueryCondition
private Boolean enabled;
} }
...@@ -17,8 +17,10 @@ import java.util.Set; ...@@ -17,8 +17,10 @@ import java.util.Set;
public interface IStoragePosManager extends IBaseManager<StoragePos> { public interface IStoragePosManager extends IBaseManager<StoragePos> {
List<PlateSizeBean> getStoragePosUsage(String storageId); List<PlateSizeBean> getStoragePosUsage(String storageId);
StoragePos getByPosName(String posName); StoragePos getByPosName(String posName);
Map<String,InventoryItem> getInventory(String id);
Map<String, InventoryItem> getInventory(String id);
StoragePos getByBarcode(String barcode); StoragePos getByBarcode(String barcode);
...@@ -32,7 +34,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> { ...@@ -32,7 +34,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
void deletePoss(Set<String> ids); void deletePoss(Set<String> ids);
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds) throws ValidateException ; StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds) throws ValidateException;
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId) throws ValidateException; StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId) throws ValidateException;
...@@ -48,5 +50,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> { ...@@ -48,5 +50,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
void clearStoragePosLabel(String id); void clearStoragePosLabel(String id);
void updatePosLabel( String[] posIds, String labelId); void updatePosLabel(String[] posIds, String labelId);
void clearLockPos(String lockId);
} }
package com.neotel.smfcore.core.storage.service.manager.impl; package com.neotel.smfcore.core.storage.service.manager.impl;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.neotel.smfcore.common.bean.PageData; import com.neotel.smfcore.common.bean.PageData;
...@@ -217,8 +218,13 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -217,8 +218,13 @@ public class StoragePosManagerImpl implements IStoragePosManager {
Query q = new Query(c); Query q = new Query(c);
Sort sort = getSortByCheckOutType(checkOutType); Sort sort = getSortByCheckOutType(checkOutType);
q.with(sort); q.with(sort);
log.info("使用"+checkOutType+"策略出库partNumber="+pn); StoragePos pos=storagePosDao.findOne(q);
return storagePosDao.findOne(q); if(pos==null){
log.info("使用"+checkOutType+" 策略出库 partNumber="+pn+",未找到可以出库的物料 ");
}else{
log.info("使用"+checkOutType+" 策略出库 partNumber="+pn+",找到出仓位置【"+ pos.getPosName()+"】,RI【"+pos.getBarcode().getBarcode()+"】 ");
}
return pos;
} }
...@@ -325,12 +331,12 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -325,12 +331,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
COMPATIBLE_TYPE compatibleType = storage.getCompatibleType(); COMPATIBLE_TYPE compatibleType = storage.getCompatibleType();
if(compatibleType == COMPATIBLE_TYPE.EXACT_MATCH){//完全匹配 if (compatibleType == COMPATIBLE_TYPE.EXACT_MATCH) {//完全匹配
c = c.and("w").is(barcode.getPlateSize()).and("h").is(barcode.getHeight()); c = c.and("w").is(barcode.getPlateSize()).and("h").is(barcode.getHeight());
}else if(compatibleType == COMPATIBLE_TYPE.FULLY_COMPATIBLE){//同厚度兼容 } else if (compatibleType == COMPATIBLE_TYPE.FULLY_COMPATIBLE) {//同厚度兼容
c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//除7寸外,完全兼容 c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//除7寸外,完全兼容
}else if(compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE){//同尺寸兼容 } else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度 c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
} }
...@@ -338,18 +344,25 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -338,18 +344,25 @@ public class StoragePosManagerImpl implements IStoragePosManager {
.and("used").is(false);//未使用 .and("used").is(false);//未使用
//去除的仓位 //去除的仓位
if(excludePosIds != null && !excludePosIds.isEmpty()){ if (excludePosIds != null && !excludePosIds.isEmpty()) {
c = c.and("id").nin(excludePosIds); c = c.and("id").nin(excludePosIds);
} }
Query query = new Query(c); Query query = new Query(c);
if(lastPosId==null||lastPosId.equals("")){ String msg = "";
// if (lastPosId == null || lastPosId.equals("")) {
//优先放入最合适的位置(根据尺寸),相同尺寸按优先级排序 //优先放入最合适的位置(根据尺寸),相同尺寸按优先级排序
query.with(Sort.by(Sort.Direction.ASC, "w").and(Sort.by(Sort.Direction.ASC, "h")).and(Sort.by(Sort.Direction.DESC, "priority"))); query.with(Sort.by(Sort.Direction.ASC, "w").and(Sort.by(Sort.Direction.ASC, "h")).and(Sort.by(Sort.Direction.DESC, "priority")));
}else{ // } else {
Point point= PointUtil.getPosPoint(lastPosId,false); // Point point = PointUtil.getPosPoint(lastPosId, false);
query.addCriteria(Criteria.where("coordinate").nearSphere(point)); // query.addCriteria(Criteria.where("coordinate").nearSphere(point));
} // msg += "getEmptyPosByStorage 根据就近坐标查询[" + lastPosId + "][" + point.getX() + "," + point.getY() + "]";
// }
StoragePos pos = storagePosDao.findOne(query); StoragePos pos = storagePosDao.findOne(query);
if ((!ObjectUtil.isNotEmpty(msg) )&& (pos != null)) {
Point targetP = PointUtil.getPosPoint(lastPosId, false);
log.info(msg + "结果:[" + pos.getPosName() + "][" + targetP.getX() + "," + targetP.getY() + "]");
}
return pos; return pos;
} }
@Override @Override
...@@ -388,4 +401,10 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -388,4 +401,10 @@ public class StoragePosManagerImpl implements IStoragePosManager {
storagePosDao.updateMulti(query, Update.update("labelId",labelId)); storagePosDao.updateMulti(query, Update.update("labelId",labelId));
} }
@Override
public void clearLockPos(String lockId) {
Query query = new Query( Criteria.where("barcode.lockId").is(lockId));
storagePosDao.updateMulti(query, Update.update("barcode.lockId",""));
}
} }
...@@ -36,6 +36,7 @@ public class DataLog extends BasePo implements Serializable { ...@@ -36,6 +36,7 @@ public class DataLog extends BasePo implements Serializable {
setPosId(pos.getId()); setPosId(pos.getId());
setPosName(pos.getPosName()); setPosName(pos.getPosName());
setStatus(OP_STATUS.WAIT.name());
} }
/** /**
...@@ -181,7 +182,7 @@ public class DataLog extends BasePo implements Serializable { ...@@ -181,7 +182,7 @@ public class DataLog extends BasePo implements Serializable {
/** /**
* 亮灯料架颜色 * 亮灯料架颜色
*/ */
private String lightColor = "FF0000"; private String lightColor = "";
/** /**
* 出入库执行时间,秒 * 出入库执行时间,秒
*/ */
...@@ -273,7 +274,7 @@ public class DataLog extends BasePo implements Serializable { ...@@ -273,7 +274,7 @@ public class DataLog extends BasePo implements Serializable {
*/ */
public boolean needRemoveFromCache(){ public boolean needRemoveFromCache(){
if(isFinished() || isCancel()){ if(isFinished() || isCancel()){
if(System.currentTimeMillis() - super.getUpdateDate().getTime() > 3 * 60 * 1000){ if(System.currentTimeMillis() - super.getUpdateDate().getTime() > 5 * 60 * 1000){
return true; return true;
} }
} }
......
package com.neotel.smfcore.core.system.util; package com.neotel.smfcore.core.system.util;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.neotel.smfcore.core.device.bean.StatusBean; import com.neotel.smfcore.core.device.bean.StatusBean;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -27,15 +29,15 @@ public class DevicesStatusUtil { ...@@ -27,15 +29,15 @@ public class DevicesStatusUtil {
/** /**
* 获取设备状态Bean * 获取设备状态Bean
*/ */
public static StatusBean getStatusBean(String cid){ public static StatusBean getStatusBean(String cid) {
return statusMap.get(cid); return statusMap.get(cid);
} }
/** /**
* 更新设备状态信息 * 更新设备状态信息
*/ */
public static void updateStatusBean(StatusBean statusBean){ public static void updateStatusBean(StatusBean statusBean) {
statusMap.put(statusBean.getCid(),statusBean); statusMap.put(statusBean.getCid(), statusBean);
} }
/** /**
...@@ -53,4 +55,15 @@ public class DevicesStatusUtil { ...@@ -53,4 +55,15 @@ public class DevicesStatusUtil {
return statusBean; return statusBean;
} }
private static Map<String, List<List<String>>> deviceDataMap = Maps.newConcurrentMap();
public static void updateDeviceData(String cid, List<List<String>> data) {
deviceDataMap.put(cid, data);
}
public static List<List<String>> getDeviceData(String cid) {
return deviceDataMap.get(cid);
}
} }
package com.neotel.smfcore.hella.handler; package com.neotel.smfcore.hella.handler;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
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.exception.ValidateException;
import com.neotel.smfcore.core.barcode.bean.CodeBean;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager; import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager; 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.device.enums.OP; import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS; import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
...@@ -76,6 +79,9 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -76,6 +79,9 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
@Autowired @Autowired
private IGroupManager groupManager; private IGroupManager groupManager;
@Autowired
private CodeResolve codeResolve;
protected final static Logger log = LogManager.getLogger(); protected final static Logger log = LogManager.getLogger();
private AtomicLong eventId = new AtomicLong(0); private AtomicLong eventId = new AtomicLong(0);
...@@ -91,21 +97,38 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -91,21 +97,38 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
HellaReqCommand command = HellaReqCommand.newCheckMaterialCmd(eventId.incrementAndGet(),scannedCode); HellaReqCommand command = HellaReqCommand.newCheckMaterialCmd(eventId.incrementAndGet(),scannedCode);
command.setGroupId(groupId); command.setGroupId(groupId);
boolean storageCheckMaterial=false;
if(ObjectUtil.isNotEmpty(storageId)){
Storage storage=dataCache.getStorageById(storageId);
if(storage!=null){
storageCheckMaterial=true;
command.setGroupId(storage.getGroupId());
command.setStorageId(storageId);
}
}
command.setLoginUser(loginUser); command.setLoginUser(loginUser);
for (HellaReqCommand hellaReqCommand : commandMap.values()) { for (HellaReqCommand hellaReqCommand : commandMap.values()) {
if(hellaReqCommand.getGroupId().equals(groupId) && hellaReqCommand.isCheckMaterialReq()){ if(storageCheckMaterial) {
if(ObjectUtil.isNotEmpty(hellaReqCommand.getStorageId())&&hellaReqCommand.getStorageId().equals(storageId)&&hellaReqCommand.isCheckMaterialReq()){
//有未完成的入库请求 //有未完成的入库请求
commandMap.remove(hellaReqCommand.getEventId()); commandMap.remove(hellaReqCommand.getEventId());
log.info("清理未完成的入库检查请求["+hellaReqCommand.getEventId()+"]:" + hellaReqCommand.getData()); log.info("清理未完成的入库检查请求[" + hellaReqCommand.getEventId() + "]:" + hellaReqCommand.getData());
}
}else {
if (hellaReqCommand.getGroupId().equals(groupId) && hellaReqCommand.isCheckMaterialReq()) {
//有未完成的入库请求
commandMap.remove(hellaReqCommand.getEventId());
log.info("清理未完成的入库检查请求[" + hellaReqCommand.getEventId() + "]:" + hellaReqCommand.getData());
//return ResultBean.newErrorResult(-1,"["+hellaReqCommand.getData()+"]入库任务未完成,无法入库"); //return ResultBean.newErrorResult(-1,"["+hellaReqCommand.getData()+"]入库任务未完成,无法入库");
} }
} }
}
commandMap.put(command.getEventId(),command); commandMap.put(command.getEventId(),command);
log.info("发送检查物料条码请求:" + command.toReqMsg()); log.info("发送检查物料条码请求:" + command.toReqMsg());
ResultBean resultBean = HellaTcpClient.sendMsg(command.toReqMsg()); ResultBean resultBean = HellaTcpClient.sendMsg(command.toReqMsg());
//testCheckOK(command); // ResultBean resultBean = testCheckOK(command);
resultBean.setMsg("Check Material result:"+resultBean.getMsg()); resultBean.setMsg("Check Material result:"+resultBean.getMsg());
return resultBean; return resultBean;
} }
...@@ -136,7 +159,8 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -136,7 +159,8 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
String msg = message.toString(); String msg = message.toString();
msg= msg.replace("\u0002",""); msg= msg.replace("\u0002","");
log.info("Received Tcp Server msg:" + msg); log.info("Received Tcp Server msg:" + msg);
String[] resposArr = msg.split(";"); //getInventory;21296;
String[] resposArr = msg.split(";",-1);
String cmd = resposArr[0]; String cmd = resposArr[0];
String eventId = resposArr[1]; String eventId = resposArr[1];
...@@ -186,7 +210,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -186,7 +210,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
}else{ }else{
Storage storage = dataCache.getStorageById(storagePos.getStorageId()); Storage storage = dataCache.getStorageById(storagePos.getStorageId());
try{ try{
taskService.checkout(storage,storagePos,false); taskService.checkout(storage,storagePos,false,"");
}catch(ValidateException ve){ }catch(ValidateException ve){
resultCode = "-3"; resultCode = "-3";
resultMsg = ve.getMessage(); resultMsg = ve.getMessage();
...@@ -203,23 +227,29 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -203,23 +227,29 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
//<STX>getInventory;eventId;shelfNumber<CR><LF> //<STX>getInventory;eventId;shelfNumber<CR><LF>
String shelfNumber = resposArr[2]; String shelfNumber = resposArr[2];
Storage shelf = null; Storage shelf = null;
if(ObjectUtil.isNotEmpty(shelfNumber)) {
Collection<Storage> allStorages = dataCache.getAllStorage().values(); Collection<Storage> allStorages = dataCache.getAllStorage().values();
for (Storage storage : allStorages) { for (Storage storage : allStorages) {
if(storage.getName().equals(shelfNumber)){ if (storage.getName().equals(shelfNumber)) {
shelf = storage; shelf = storage;
} }
} }
}
String resultCode = "0"; String resultCode = "0";
String resultMsg = "OK"; String resultMsg = "OK";
String dataStr = ""; String dataStr = "";
if(shelf == null){ if(ObjectUtil.isNotEmpty(shelfNumber)&&shelf == null){
//<STX>getInventoryResp;eventId;returnCode;messageText;numberofResults;partNumber1;containerNumber;remainQuantity;MSL;lightClass;SelfPosition;reserved;…;partNumberN;containerNumberN;remainQuantityN;MSLN;lightClassN;SelfPositionN;reservedN;<CR><LF> //<STX>getInventoryResp;eventId;returnCode;messageText;numberofResults;partNumber1;containerNumber;remainQuantity;MSL;lightClass;SelfPosition;reserved;…;partNumberN;containerNumberN;remainQuantityN;MSLN;lightClassN;SelfPositionN;reservedN;<CR><LF>
resultCode = "-1"; resultCode = "-1";
resultMsg = "Shelf is not found"; resultMsg = "Shelf is not found";
dataStr = "0"; dataStr = "0";
}else{ }else{
List<StoragePos> posList = storagePosManager.findNotEmptyByStorageId(shelf.getId()); String shelfId="";
if(!(shelf==null)){
shelfId=shelf.getId();
}
List<StoragePos> posList = storagePosManager.findNotEmptyByStorageId(shelfId);
int numberOfResult = posList.size(); int numberOfResult = posList.size();
dataStr = "" + numberOfResult; dataStr = "" + numberOfResult;
for (StoragePos storagePos : posList) { for (StoragePos storagePos : posList) {
...@@ -248,16 +278,28 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -248,16 +278,28 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
private void testCheckOK(HellaReqCommand command) { private ResultBean testCheckOK(HellaReqCommand command) {
HellaRespCommand respCommand = new HellaRespCommand(); HellaRespCommand respCommand = new HellaRespCommand();
respCommand.setCmd("TestCheckMaterial"); respCommand.setCmd("TestCheckMaterial");
respCommand.setEventId(command.getEventId()); respCommand.setEventId(command.getEventId());
String reelId = command.getData().toString(); String codeStr = command.getData().toString();
String[] resposArr = new String[]{"TestCheckMaterial",command.getEventId(),"0","OK","PN001",reelId,"1000","1","LC01"}; CodeBean codeBean = codeResolve.resolveSingleCode(codeStr);
if(codeBean==null||codeBean.getBarcode()==null){
return ResultBean.newErrorResult(1,"smfcode.error.barcode.invalid","条码无效");
}
if(ObjectUtil.isNotEmpty(codeBean.getErrorCode()) ){
return ResultBean.newErrorResult(1,codeBean.getErrorCode(),codeBean.getError(),codeBean.getParams());
}
String pn=codeBean.getBarcode().getPartNumber();
String reelId=codeBean.getBarcode().getBarcode();
String num=codeBean.getBarcode().getAmount()+"";
String[] resposArr = new String[]{"TestCheckMaterial",command.getEventId(),"0","OK",pn,reelId,num,"1","LC01"};
try { try {
handleCheckMaterialResp(respCommand,resposArr); handleCheckMaterialResp(respCommand,resposArr);
return ResultBean.newOkResult("");
} catch (ValidateException e) { } catch (ValidateException e) {
log.error(e); log.error(e);
return ResultBean.newErrorResult(1,e.getMsgKey(),e.getDefaultMsg());
} }
} }
...@@ -277,6 +319,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -277,6 +319,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
return; return;
} }
String groupId = requestCommand.getGroupId(); String groupId = requestCommand.getGroupId();
String storageId=requestCommand.getStorageId();
String loginUser = requestCommand.getLoginUser(); String loginUser = requestCommand.getLoginUser();
String fullCode = requestCommand.getData().toString(); String fullCode = requestCommand.getData().toString();
if(respCommand.isOkResp()){ if(respCommand.isOkResp()){
...@@ -326,8 +369,16 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -326,8 +369,16 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
dataLog.setNum(barcode.getAmount()); dataLog.setNum(barcode.getAmount());
dataLog.setStatus(OP_STATUS.WAIT.name()); dataLog.setStatus(OP_STATUS.WAIT.name());
dataLog.setGroupId(groupId); dataLog.setGroupId(groupId);
dataLog.setStorageId(storageId);
dataLog.setMemo(barcode.getMemo()); dataLog.setMemo(barcode.getMemo());
dataLog.setOperator(loginUser); dataLog.setOperator(loginUser);
if(ObjectUtil.isNotEmpty(storageId)){
Storage storage=dataCache.getStorageById(storageId);
if(storage!=null){
dataLog.setCid(storage.getCid());
dataLog.setStorageName(storage.getName());
}
}
try{ try{
taskService.addTaskToExecute(dataLog); taskService.addTaskToExecute(dataLog);
ResultBean okResult = ResultBean.newOkResult("checking material is ok: " + messageText); ResultBean okResult = ResultBean.newOkResult("checking material is ok: " + messageText);
...@@ -377,6 +428,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen ...@@ -377,6 +428,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
liteOrder.setSource(groupName); liteOrder.setSource(groupName);
log.info("新增加订单:" + liteOrder.getOrderNo()); log.info("新增加订单:" + liteOrder.getOrderNo());
liteOrder = liteOrderManager.createWithItems(liteOrder); liteOrder = liteOrderManager.createWithItems(liteOrder);
liteOrderCache.addOrderToMap(liteOrder);
//对工单进行锁定 //对工单进行锁定
List<String> storageIdList = new ArrayList<>(); List<String> storageIdList = new ArrayList<>();
......
package com.neotel.smfcore.hella.rest; package com.neotel.smfcore.hella.rest;
import cn.hutool.core.util.ObjectUtil;
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.exception.ValidateException;
import com.neotel.smfcore.common.utils.SecurityUtils; import com.neotel.smfcore.common.utils.SecurityUtils;
...@@ -91,7 +92,7 @@ public class HellaSensorShelfController { ...@@ -91,7 +92,7 @@ public class HellaSensorShelfController {
for (DataLog queueTask : queueTasks) { for (DataLog queueTask : queueTasks) {
if (queueTask.isPutInTask() && queueTask.isWait()) { if (queueTask.isPutInTask() && queueTask.isWait()) {
if (groupId != null && queueTask.getGroupId().equals(groupId)) { if (ObjectUtil.isEmpty(storageId)&& groupId != null && queueTask.getGroupId().equals(groupId)) {
log.info("codeIn [" + code + "][" + groupId + "]入库失败:条码[" + queueTask.getBarcode() + "]的任务还未结束 "); log.info("codeIn [" + code + "][" + groupId + "]入库失败:条码[" + queueTask.getBarcode() + "]的任务还未结束 ");
throw new ValidateException("smfcore.unfinished", "the task of [{0}] is unfinished", new String[]{queueTask.getBarcode()}); throw new ValidateException("smfcore.unfinished", "the task of [{0}] is unfinished", new String[]{queueTask.getBarcode()});
} }
......
package com.neotel.smfcore.hella.tcp; package com.neotel.smfcore.hella.tcp;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.StringUtils; import com.neotel.smfcore.common.utils.StringUtils;
...@@ -65,8 +66,12 @@ public class HellaTcpClient { ...@@ -65,8 +66,12 @@ public class HellaTcpClient {
host=dataCache.GetConfigCache("hella.host","hella.host",host); host=dataCache.GetConfigCache("hella.host","hella.host",host);
port=Integer.parseInt(dataCache.GetConfigCache("hella.port","hella.port",port+"")) ; port=Integer.parseInt(dataCache.GetConfigCache("hella.port","hella.port",port+"")) ;
updateServerInfo(host, port); updateServerInfo(host, port);
if(ObjectUtil.isEmpty(host)||ObjectUtil.isEmpty(port)){
log.info("配置不完整,不需要连接");
}else{
start(); start();
} }
}
public static void updateServerInfo(String serverHost, int serverPort){ public static void updateServerInfo(String serverHost, int serverPort){
host = serverHost; host = serverHost;
......
...@@ -11,9 +11,13 @@ public class HellaReqCommand extends HellaCommand { ...@@ -11,9 +11,13 @@ public class HellaReqCommand extends HellaCommand {
private String groupId; private String groupId;
/** /**
* 料仓Id; * 用户名;
*/ */
private String loginUser; private String loginUser;
/**
* 料仓ID
*/
private String storageId;
/** /**
* 检查物料条码 * 检查物料条码
...@@ -65,4 +69,12 @@ public class HellaReqCommand extends HellaCommand { ...@@ -65,4 +69,12 @@ public class HellaReqCommand extends HellaCommand {
public void setGroupId(String groupId) { public void setGroupId(String groupId) {
this.groupId = groupId; this.groupId = groupId;
} }
public String getStorageId() {
return storageId;
}
public void setStorageId(String storageId) {
this.storageId = storageId;
}
} }
...@@ -90,7 +90,6 @@ public class UserController { ...@@ -90,7 +90,6 @@ public class UserController {
@ApiOperation("查询用户") @ApiOperation("查询用户")
@GetMapping @GetMapping
@PreAuthorize("@el.check('user:list')") @PreAuthorize("@el.check('user:list')")
// public ResponseEntity<Object> query(UserQueryCriteria criteria, Pageable pageable){
public PageData<UserDto> query(UserQueryCriteria criteria, Pageable pageable) { public PageData<UserDto> query(UserQueryCriteria criteria, Pageable pageable) {
Query query = QueryHelp.getQuery(criteria); Query query = QueryHelp.getQuery(criteria);
PageData<User> userPageData = userManager.findByPage(query, pageable); PageData<User> userPageData = userManager.findByPage(query, pageable);
...@@ -127,7 +126,7 @@ public class UserController { ...@@ -127,7 +126,7 @@ public class UserController {
if(resources.getCheckCode()==null){ if(resources.getCheckCode()==null){
resources.setCheckCode(""); resources.setCheckCode("");
} }
resources.setPassword(passwordEncoder.encode("123456")); resources.setPassword(passwordEncoder.encode("Constants.USER_DEFAULTP_PWD"));
resources.setUpdateDate(new Date()); resources.setUpdateDate(new Date());
resources.setPwdResetTime(new Date()); resources.setPwdResetTime(new Date());
userManager.save(resources); userManager.save(resources);
...@@ -137,20 +136,16 @@ public class UserController { ...@@ -137,20 +136,16 @@ public class UserController {
@ApiOperation("修改用户") @ApiOperation("修改用户")
@PutMapping @PutMapping
@PreAuthorize("@el.check('user:edit')") @PreAuthorize("@el.check('user:edit')")
// public ResponseEntity<Object> update(@Validated(User.Update.class) @RequestBody User resources) throws Exception {
public ResponseEntity<Object> update(@Validated @RequestBody UserDto userDto) { public ResponseEntity<Object> update(@Validated @RequestBody UserDto userDto) {
User resources=userMapper.toEntity(userDto); User resources=userMapper.toEntity(userDto);
if (resources.getId() == null) { if (resources.getId() == null) {
throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"ID"} ); throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"ID"} );
// throw new ValidateException("修改用户:ID不能为空");
} }
if(resources.getUsername()==null){ if(resources.getUsername()==null){
throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"username"} ); throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"username"} );
// throw new ValidateException("修改用户:用户名不能为空");
} }
if(resources.getRoleId()==null){ if(resources.getRoleId()==null){
throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"roleId"} ); throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"roleId"} );
// throw new ValidateException("修改用户:角色ID不能为空");
} }
userManager.update(resources); userManager.update(resources);
...@@ -158,19 +153,54 @@ public class UserController { ...@@ -158,19 +153,54 @@ public class UserController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }
@ApiOperation("修改用户:个人中心") @ApiOperation("重置密码")
@PutMapping(value = "center") @PutMapping(value = "/resetPass")
// public ResponseEntity<Object> center(@Validated(User.Update.class) @RequestBody User resources){ @PreAuthorize("@el.check('user:edit')")
public ResponseEntity<Object> center(@Validated @RequestBody UserDto userDto) { public ResultBean resetPass( @RequestBody String id) {
if (id == null) {
throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"ID"} );
}
User resources=userManager.get(id);
resources.setPassword(passwordEncoder.encode(Constants.USER_DEFAULTP_PWD));
resources.setPwdResetTime(new Date());
userManager.update(resources);
return ResultBean.newOkResult("");
}
@ApiOperation("个人中心:获取个人资料")
@GetMapping(value = "/center")
public UserDto getCenter() {
User user = userManager.get(SecurityUtils.getCurrentUserId());
return userMapper.toDto(user);
}
@ApiOperation("个人中心:修改个人资料")
@PutMapping(value = "/center")
public ResultBean center(@Validated @RequestBody UserDto userDto) {
User resources=userMapper.toEntity(userDto); User resources=userMapper.toEntity(userDto);
if (!resources.getId().equals(SecurityUtils.getCurrentUserId())) { if (!resources.getId().equals(SecurityUtils.getCurrentUserId())) {
throw new ValidateException("smfcode.hasNoAccess","无权限修改此用户信息" ); throw new ValidateException("smfcode.hasNoAccess","无权限修改此用户信息" );
// throw new ValidateException("不能修改他人资料"); // throw new ValidateException("不能修改他人资料");
} }
userManager.updateCenter(resources); userManager.updateCenter(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return ResultBean.newOkResult("");
} }
@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("smfcode.oldPwdError","修改失败,旧密码错误");
}
if (passwordEncoder.matches(newPass, user.getPassword())) {
throw new ValidateException("smfcode.newPwdError","新密码不能与旧密码相同");
}
userManager.updatePass(user.getUsername(), passwordEncoder.encode(newPass));
return ResultBean.newOkResult("");
}
@ApiOperation("删除用户") @ApiOperation("删除用户")
@DeleteMapping @DeleteMapping
...@@ -194,35 +224,21 @@ public class UserController { ...@@ -194,35 +224,21 @@ public class UserController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@ApiOperation("修改密码")
@PostMapping(value = "/updatePass")
public ResponseEntity<Object> updatePass(@RequestBody UserPassVo passVo) throws Exception {
User user = userManager.get(SecurityUtils.getCurrentUserId());
if (!passwordEncoder.matches(passVo.getOldPass(), user.getPassword())) {
throw new ValidateException("smfcode.oldPwdError","修改失败,旧密码错误");
}
if (passwordEncoder.matches(passVo.getNewPass(), user.getPassword())) {
throw new ValidateException("smfcode.newPwdError","新密码不能与旧密码相同");
}
userManager.updatePass(user.getUsername(), passwordEncoder.encode(passVo.getNewPass()));
return new ResponseEntity<>(HttpStatus.OK);
}
// @ApiOperation("修改邮箱")
@ApiOperation("修改邮箱") // @PostMapping(value = "/updateEmail/{code}")
@PostMapping(value = "/updateEmail/{code}") // public ResponseEntity<Object> updateEmail(@PathVariable String code, @RequestBody UserDto userDto) throws Exception {
public ResponseEntity<Object> updateEmail(@PathVariable String code, @RequestBody UserDto userDto) throws Exception { // User user=userMapper.toEntity(userDto);
User user=userMapper.toEntity(userDto); // String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, user.getPassword());
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, user.getPassword()); // User myUser = userManager.findByUserName(SecurityUtils.getCurrentUsername());
User myUser = userManager.findByUserName(SecurityUtils.getCurrentUsername()); // if (!passwordEncoder.matches(password, myUser.getPassword())) {
if (!passwordEncoder.matches(password, myUser.getPassword())) { // throw new ValidateException("smfcode.pwdError","修改邮箱失败,密码错误");
throw new ValidateException("smfcode.pwdError","修改邮箱失败,密码错误"); // }
} //// verificationCodeService.validated(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey() + user.getEmail(), code);
// verificationCodeService.validated(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey() + user.getEmail(), code); // userManager.updateEmail(myUser.getUsername(), myUser.getEmail());
userManager.updateEmail(myUser.getUsername(), myUser.getEmail()); // return new ResponseEntity<>(HttpStatus.OK);
return new ResponseEntity<>(HttpStatus.OK); // }
}
@ApiOperation("修改用户组") @ApiOperation("修改用户组")
@PutMapping(value = "/updateGroup") @PutMapping(value = "/updateGroup")
@PreAuthorize("@el.check('user:edit')") @PreAuthorize("@el.check('user:edit')")
...@@ -236,6 +252,8 @@ public class UserController { ...@@ -236,6 +252,8 @@ public class UserController {
userManager.updateGroups(resources); userManager.updateGroups(resources);
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@ApiOperation("上传用户列表:激活用户") @ApiOperation("上传用户列表:激活用户")
@PostMapping(value = "/upload") @PostMapping(value = "/upload")
public ResultBean upload( @RequestParam MultipartFile uploadFile) throws Exception { public ResultBean upload( @RequestParam MultipartFile uploadFile) throws Exception {
......
...@@ -50,7 +50,7 @@ public class UserManagerImpl implements IUserManager { ...@@ -50,7 +50,7 @@ public class UserManagerImpl implements IUserManager {
public void updatePass(String username, String encryptPassword) { public void updatePass(String username, String encryptPassword) {
Criteria c = Criteria.where("username").is(username); Criteria c = Criteria.where("username").is(username);
Query query = Query.query(c); Query query = Query.query(c);
Update update = Update.update("password",encryptPassword); Update update = Update.update("password",encryptPassword).addToSet("pwdResetTime",new Date());
userDao.updateFirst(query,update); userDao.updateFirst(query,update);
} }
@Override @Override
...@@ -102,6 +102,7 @@ public class UserManagerImpl implements IUserManager { ...@@ -102,6 +102,7 @@ public class UserManagerImpl implements IUserManager {
dataUser.setRoleId(user.getRoleId()); dataUser.setRoleId(user.getRoleId());
dataUser.setGroups(user.getGroups()); dataUser.setGroups(user.getGroups());
dataUser.setLanguage(user.getLanguage()); dataUser.setLanguage(user.getLanguage());
dataUser.setPwdResetTime(user.getPwdResetTime());
userDao.save(dataUser); userDao.save(dataUser);
} }
} }
...@@ -109,10 +110,11 @@ public class UserManagerImpl implements IUserManager { ...@@ -109,10 +110,11 @@ public class UserManagerImpl implements IUserManager {
public void updateCenter(User resources) { public void updateCenter(User resources) {
User dataUser=this.get(resources.getId()); User dataUser=this.get(resources.getId());
if(dataUser!=null){ if(dataUser!=null){
//用户名admin不能修改 // //用户名admin不能修改
if(!dataUser.equals(Constants.SUPER_USERNAME)){ // if(!dataUser.equals(Constants.SUPER_USERNAME)){
dataUser.setUsername(resources.getUsername()); // dataUser.setUsername(resources.getUsername());
} // }
//只能修改邮箱和语言
dataUser.setEmail(resources.getEmail()); dataUser.setEmail(resources.getEmail());
dataUser.setLanguage(resources.getLanguage()); dataUser.setLanguage(resources.getLanguage());
......
...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u672A\u627E\u5230\u9501\u5B9A\u5E93\u4F4D ...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u672A\u627E\u5230\u9501\u5B9A\u5E93\u4F4D
smfcore.error.barcode.empty=\u672A\u626B\u5230\u6761\u7801 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.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.error.barcode.expired=\u7269\u6599\u5DF2\u8FC7\u671F,\u65E0\u6CD5\u5165\u5E93.
smfcore.allBoxView.noReel=\u5E93\u4F4D\u4E2D\u65E0\u7269\u6599 smfcore.allBoxView.noReel=\u5E93\u4F4D{0}\u4E2D\u65E0\u7269\u6599
smfcode.error.barcode.many=\u627E\u5230\u591A\u4E2A\u6709\u6548\u7684\u6761\u7801 smfcode.error.barcode.many=\u627E\u5230\u591A\u4E2A\u6709\u6548\u7684\u6761\u7801
smfcode.error.barcode.noValidCode=\u65E0\u6548\u7684\u6761\u7801 smfcode.error.barcode.noValidCode=\u65E0\u6548\u7684\u6761\u7801
smfcore.error.barcode.noValidCode={0}\u4E0D\u662F\u6709\u6548\u7684\u6761\u7801 smfcore.error.barcode.noValidCode={0}\u4E0D\u662F\u6709\u6548\u7684\u6761\u7801
...@@ -93,7 +93,35 @@ smfcore.instruction=\u8BF4\u660E\u4E66 ...@@ -93,7 +93,35 @@ smfcore.instruction=\u8BF4\u660E\u4E66
smfcore.about=\u5173\u4E8E smfcore.about=\u5173\u4E8E
smfcore.tacticsOuput=\u7B56\u7565\u51FA\u5E93 smfcore.tacticsOuput=\u7B56\u7565\u51FA\u5E93
smfcore.labelOuput=\u7269\u6599\u5206\u7EC4 smfcore.labelOuput=\u7269\u6599\u5206\u7EC4
smfcode.order.out.executing=\u5DE5\u5355\u6B63\u5728\u6267\u884C
smfcode.order.out.notFound=\u5DE5\u5355\u672A\u627E\u5230
smfcode.order.out.maxOrder=\u5DF2\u8FBE\u5230\u6700\u5927\u53EF\u6267\u884C\u5DE5\u5355\u6570
smfcode.order.out.noTask=\u5DE5\u5355\u65E0\u53EF\u6267\u884C\u7684\u4EFB\u52A1
smfcode.cannotUpdateOrderNum=\u5DE5\u5355\u5DF2\u51FA\u5E93\uFF0C\u4E0D\u80FD\u4FEE\u6539\u6570\u91CF
smfcode.order.close.success=\u5DE5\u5355\u5173\u95ED\u6210\u529F
smfcode.order.close.taskNotEnd=\u5DE5\u5355\u8FD8\u6709\u672A\u5B8C\u6210\u7684\u4EFB\u52A1
smfcore.manualOut=\u624B\u52A8\u51FA\u5E93
smfcode.error.barcode.noRules=\u89E3\u6790\u89C4\u5219\u672A\u5B9A\u4E49
smfcode.error.barcode.wrongLength=\u6761\u7801[{0}]\u957F\u5EA6\u9519\u8BEF
smfcode.error.barcode.noField=\u6761\u7801\u89E3\u6790\u5931\u8D25,\u672A\u627E\u5230{0}\u5B57\u6BB5
smfcode.error.barcode.pnNotExist=x\u6863\u6848 {0} \u4E0D\u5B58\u5728
smfcode.error.barcode.invalid={0}\u4E0D\u662F\u6709\u6548\u7684\u6761\u7801
smfcode.error.barcode.locked=\u5E93\u4F4D[{0}]\u5DF2\u88AB\u9501\u5B9A
smfcode.manualOut.ok=\u624B\u52A8\u51FA\u5E93\u6210\u529F
smfcode.manualOut.notFound=\u4ED3\u5E93\u4E2D\u672A\u627E\u5230\u6599\u76D8\u4FE1\u606F
smfcode.order.lineCanotNull=\u7EBF\u522B\u4E0D\u80FD\u4E3A\u7A7A
smfcode.order.cannotUpdateLine=\u5DE5\u5355\u5DF2\u51FA\u5E93\uFF0C\u4E0D\u80FD\u4FEE\u6539\u7EBF\u522B
smfcode.order.uploadOK=\u5DE5\u5355\u4E0A\u4F20\u6210\u529F
smfcode.order.ameExists=\u5DE5\u5355\u540D\u79F0[{0}]\u5DF2\u5B58\u5728
smfcode.order.hasClose=\u5DE5\u5355\u5DF2\u5173\u95ED
smfcode.order.supplementOutFail=\u672A\u627E\u5230\u53EF\u4EE5\u51FA\u5E93\u7684\u8865\u6599
smfcode.materialBox.quantityshort=\u7269\u6599\u6570\u91CF\u4E0D\u8DB3
smfcode.materialBox.invalid=\u672A\u627E\u5230\u6599\u76D2\u4FE1\u606F{0}
smfcode.materialBox.noReel=\u6599\u76D2\u4E2D\u672A\u627E\u5230\u5BF9\u5E94\u7269\u6599
smfcode.materialBox.boxNoReel=\u6599\u76D2\u4E2D\u65E0\u7269\u6599
smfcode.materialBox.inPos=\u7269\u6599\u5DF2\u5728\u5E93\u4F4D{0}\u4E2D
smfcode.materialBox.inOtherBox=\u7269\u6599\u5DF2\u5728\u6599\u76D2{0}\u4E2D
smfcore.materialBox=\u6599\u76D2\u64CD\u4F5C
......
...@@ -29,7 +29,7 @@ smfcore.notFindPos=Locked position not found ...@@ -29,7 +29,7 @@ smfcore.notFindPos=Locked position not found
smfcore.error.barcode.empty=Barcode empty smfcore.error.barcode.empty=Barcode empty
smfcore.error.barcode.many=Found several barcodes, storage failed smfcore.error.barcode.many=Found several barcodes, storage failed
smfcore.error.barcode.expired=Reel expired, storage failed smfcore.error.barcode.expired=Reel expired, storage failed
smfcore.allBoxView.noReel=No reel in position smfcore.allBoxView.noReel=No reel in position {0}
smfcode.error.barcode.many=Found several barcodes smfcode.error.barcode.many=Found several barcodes
smfcode.error.barcode.noValidCode=Invalid barcode smfcode.error.barcode.noValidCode=Invalid barcode
smfcore.error.barcode.noValidCode=Invalid barcode {0} smfcore.error.barcode.noValidCode=Invalid barcode {0}
...@@ -93,3 +93,32 @@ smfcore.instruction=Instruction manual ...@@ -93,3 +93,32 @@ smfcore.instruction=Instruction manual
smfcore.about=About smfcore.about=About
smfcore.tacticsOuput=Strategies Retrival smfcore.tacticsOuput=Strategies Retrival
smfcore.labelOuput=Material grouping smfcore.labelOuput=Material grouping
smfcode.order.out.executing=Work orders are being executed
smfcode.order.out.notFound=Work order not found
smfcode.order.out.maxOrder=The maximum number of executable work orders has been reached
smfcode.order.out.noTask=Work order No executable tasks
smfcode.cannotUpdateOrderNum=The work order has been issued and the quantity cannot be modified
smfcode.order.close.success=Work order closed successfully
smfcode.order.close.taskNotEnd=Work orders with outstanding tasks
smfcore.manualOut=Manual outbound
smfcode.error.barcode.noRules=Parsing rules not defined
smfcode.error.barcode.wrongLength=The barcode [{0}] is of wrong length
smfcode.error.barcode.noField=Bar code parsing failed, {0} field not found
smfcode.error.barcode.pnNotExist=Material file {0} does not exist
smfcode.error.barcode.invalid={0} is not a valid barcode
smfcode.error.barcode.locked=Library bit [{0}] is locked
smfcode.manualOut.ok=Manual exit successful
smfcode.manualOut.notFound=No tray information found
smfcode.order.lineCanotNull=Line cannot be empty
smfcode.order.cannotUpdateLine=Work order has been issued, can not modify the line
smfcode.order.uploadOK=Work order uploaded successfully
smfcode.order.ameExists=Work order name [{0}] already exists
smfcode.order.hasClose=The work order is closed
smfcode.order.supplementOutFail=No replenishment material found that can be discharged
smfcode.materialBox.quantityshort=Insufficient quantity of materials
smfcode.materialBox.invalid=No information found for cartridge {0}
smfcode.materialBox.noReel=The corresponding material is not found in the material box
smfcode.materialBox.boxNoReel=No material in the cassette
smfcode.materialBox.inPos=The material is already in the storage space {0}
smfcode.materialBox.inOtherBox=The material is already in the cassette {0}
smfcore.materialBox=Cassette operation
...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u30ED\u30C3\u30AF\u3055\u308C\u305F\u30B9\u30C8\u30EC\u30FC\ ...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u30ED\u30C3\u30AF\u3055\u308C\u305F\u30B9\u30C8\u30EC\u30FC\
smfcore.error.barcode.empty=\u30D0\u30FC\u30B3\u30FC\u30C9\u304C\u30B9\u30AD\u30E3\u30F3\u3055\u308C\u306A\u3044 smfcore.error.barcode.empty=\u30D0\u30FC\u30B3\u30FC\u30C9\u304C\u30B9\u30AD\u30E3\u30F3\u3055\u308C\u306A\u3044
smfcore.error.barcode.many=\u8907\u6570\u306E\u6709\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u304C\u3001\u5728\u5EAB\u306F\u3042\u308A\u307E\u305B\u3093 smfcore.error.barcode.many=\u8907\u6570\u306E\u6709\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u304C\u3001\u5728\u5EAB\u306F\u3042\u308A\u307E\u305B\u3093
smfcore.error.barcode.expired=\u6750\u6599\u304C\u53E4\u304F\u3066\u5728\u5EAB\u304C\u306A\u3044 smfcore.error.barcode.expired=\u6750\u6599\u304C\u53E4\u304F\u3066\u5728\u5EAB\u304C\u306A\u3044
smfcore.allBoxView.noReel=\u4FDD\u7BA1\u4E2D\u306E\u7D20\u6750\u304C\u306A\u3044 smfcore.allBoxView.noReel=\u4FDD\u7BA1\u4E2D\u306E\u7D20\u6750\u304C\u306A\u3044{0}
smfcode.error.barcode.many=\u8907\u6570\u306E\u6709\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9\u306E\u691C\u7D22 smfcode.error.barcode.many=\u8907\u6570\u306E\u6709\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9\u306E\u691C\u7D22
smfcode.error.barcode.noValidCode=\u7121\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9 smfcode.error.barcode.noValidCode=\u7121\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9
smfcore.error.barcode.noValidCode={0}\u306F\u6709\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093 smfcore.error.barcode.noValidCode={0}\u306F\u6709\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
...@@ -93,3 +93,32 @@ smfcore.instruction=\u53D6\u6271\u8AAC\u660E\u66F8 ...@@ -93,3 +93,32 @@ smfcore.instruction=\u53D6\u6271\u8AAC\u660E\u66F8
smfcore.about=\u306B\u3064\u3044\u3066 smfcore.about=\u306B\u3064\u3044\u3066
smfcore.tacticsOuput=\u30B9\u30C8\u30E9\u30C6\u30B8\u30FC\u306F\u5728\u5EAB\u5207\u308C\u3067\u3059 smfcore.tacticsOuput=\u30B9\u30C8\u30E9\u30C6\u30B8\u30FC\u306F\u5728\u5EAB\u5207\u308C\u3067\u3059
smfcore.labelOuput=\u6750\u6599\u306E\u30B0\u30EB\u30FC\u30D7\u5316 smfcore.labelOuput=\u6750\u6599\u306E\u30B0\u30EB\u30FC\u30D7\u5316
smfcode.order.out.executing=\u4F5C\u696D\u6307\u793A\u304C\u5B9F\u884C\u3055\u308C\u3066\u3044\u308B
smfcode.order.out.notFound=\u4F5C\u696D\u6307\u793A\u66F8\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcode.order.out.maxOrder=\u5B9F\u884C\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC\u306E\u6700\u5927\u6570\u306B\u9054\u3057\u3066\u3044\u308B
smfcode.order.out.noTask=\u4F5C\u696D\u6307\u793A\u304C\u5B9F\u884C\u3067\u304D\u306A\u3044\u30BF\u30B9\u30AF
smfcode.cannotUpdateOrderNum=\u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC\u304C\u5728\u5EAB\u5207\u308C\u3067\u6570\u91CF\u304C\u5909\u66F4\u3067\u304D\u306A\u3044
smfcode.order.close.success=\u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC\u304C\u6B63\u5E38\u306B\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002
smfcode.order.close.taskNotEnd=\u672A\u51E6\u7406\u306E\u30BF\u30B9\u30AF\u304C\u3042\u308B\u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC
smfcore.manualOut=\u30DE\u30CB\u30E5\u30A2\u30EB\u30A2\u30A6\u30C8\u30D0\u30A6\u30F3\u30C9
smfcode.error.barcode.noRules=\u69CB\u6587\u89E3\u6790\u30EB\u30FC\u30EB\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u306A\u3044f
smfcode.error.barcode.wrongLength=\u30D0\u30FC\u30B3\u30FC\u30C9[{0}]\u306E\u9577\u3055\u304C\u4E0D\u6B63\u3067\u3059
smfcode.error.barcode.noField=\u30D0\u30FC\u30B3\u30FC\u30C9\u306E\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u30D5\u30A3\u30FC\u30EB\u30C9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
smfcode.error.barcode.pnNotExist=\u30D5\u30A1\u30A4\u30EB{0}\u304C\u5B58\u5728\u3057\u306A\u3044
smfcode.error.barcode.invalid={0}\u306F\u6709\u52B9\u306A\u30D0\u30FC\u30B3\u30FC\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
smfcode.error.barcode.locked=\u30E9\u30A4\u30D6\u30E9\u30EA\u30DD\u30B8\u30B7\u30E7\u30F3 [{0}] \u304C\u30ED\u30C3\u30AF\u3055\u308C\u3066\u3044\u308B
smfcode.manualOut.ok=\u624B\u52D5\u7D42\u4E86\u6210\u529F
smfcode.manualOut.notFound=\u5009\u5EAB\u3067\u30D1\u30EC\u30C3\u30C8\u60C5\u5831\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcode.order.lineCanotNull=\u30E9\u30A4\u30F3\u304C\u7A7A\u304F\u3053\u3068\u306F\u306A\u3044
smfcode.order.cannotUpdateLine=\u4F5C\u696D\u6307\u793A\u66F8\u304C\u767A\u884C\u3055\u308C\u3001\u30E9\u30A4\u30F3\u306E\u5909\u66F4\u304C\u3067\u304D\u306A\u3044\u72B6\u614B\u306B\u306A\u3063\u3066\u3044\u308B
smfcode.order.uploadOK=\u4F5C\u696D\u6307\u793A\u66F8\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u6210\u529F
smfcode.order.ameExists=\u4F5C\u696D\u30AA\u30FC\u30C0\u30FC\u540D\u300C{0}\u300D\u306F\u65E2\u306B\u5B58\u5728\u3057\u3066\u3044\u307E\u3059
smfcode.order.hasClose=\u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC\u306E\u7D42\u4E86
smfcode.order.supplementOutFail=\u6392\u51FA\u53EF\u80FD\u306A\u88DC\u5145\u54C1\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcode.materialBox.quantityshort=\u7269\u6599\u6570\u91CF\u4E0D\u8DB3
smfcode.materialBox.invalid=\u96D1\u8A8C\u306E\u60C5\u5831\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F{0}
smfcode.materialBox.noReel=\u30AB\u30BB\u30C3\u30C8\u5185\u306B\u8A72\u5F53\u3059\u308B\u7D20\u6750\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcode.materialBox.boxNoReel=\u30AB\u30BB\u30C3\u30C8\u306B\u7D20\u6750\u304C\u306A\u3044
smfcode.materialBox.inPos=\u3059\u3067\u306B\u5728\u5EAB\u306E\u3042\u308B\u7D20\u6750 {0}
smfcode.materialBox.inOtherBox=\u30AB\u30BB\u30C3\u30C8\u306B\u65E2\u306B\u5165\u3063\u3066\u3044\u308B\u7D20\u6750 {0}
smfcore.materialBox=\u30AB\u30BB\u30C3\u30C8\u64CD\u4F5C
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u672A\u627E\u5230\u9501\u5B9A\u5E93\u4F4D ...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u672A\u627E\u5230\u9501\u5B9A\u5E93\u4F4D
smfcore.error.barcode.empty=\u672A\u626B\u5230\u6761\u7801 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.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.error.barcode.expired=\u7269\u6599\u5DF2\u8FC7\u671F,\u65E0\u6CD5\u5165\u5E93.
smfcore.allBoxView.noReel=\u5E93\u4F4D\u4E2D\u65E0\u7269\u6599 smfcore.allBoxView.noReel=\u5E93\u4F4D{0}\u4E2D\u65E0\u7269\u6599
smfcode.error.barcode.many=\u627E\u5230\u591A\u4E2A\u6709\u6548\u7684\u6761\u7801 smfcode.error.barcode.many=\u627E\u5230\u591A\u4E2A\u6709\u6548\u7684\u6761\u7801
smfcode.error.barcode.noValidCode=\u65E0\u6548\u7684\u6761\u7801 smfcode.error.barcode.noValidCode=\u65E0\u6548\u7684\u6761\u7801
smfcore.error.barcode.noValidCode={0}\u4E0D\u662F\u6709\u6548\u7684\u6761\u7801 smfcore.error.barcode.noValidCode={0}\u4E0D\u662F\u6709\u6548\u7684\u6761\u7801
...@@ -93,3 +93,32 @@ smfcore.instruction=\u8BF4\u660E\u4E66 ...@@ -93,3 +93,32 @@ smfcore.instruction=\u8BF4\u660E\u4E66
smfcore.about=\u5173\u4E8E smfcore.about=\u5173\u4E8E
smfcore.tacticsOuput=\u7B56\u7565\u51FA\u5E93 smfcore.tacticsOuput=\u7B56\u7565\u51FA\u5E93
smfcore.labelOuput=\u7269\u6599\u5206\u7EC4 smfcore.labelOuput=\u7269\u6599\u5206\u7EC4
smfcode.order.out.executing=\u5DE5\u5355\u6B63\u5728\u6267\u884C
smfcode.order.out.notFound=\u5DE5\u5355\u672A\u627E\u5230
smfcode.order.out.maxOrder=\u5DF2\u8FBE\u6700\u5927\u53EF\u6267\u884C\u5DE5\u5355\u6570
smfcode.order.out.noTask=\u5DE5\u5355\u65E0\u53EF\u6267\u884C\u7684\u4EFB\u52A1
smfcode.cannotUpdateOrderNum=\u5DE5\u5355\u5DF2\u51FA\u5E93\uFF0C\u4E0D\u80FD\u4FEE\u6539\u6570\u91CF
smfcode.order.close.success=\u5DE5\u5355\u5173\u95ED\u6210\u529F
smfcode.order.close.taskNotEnd=\u5DE5\u5355\u8FD8\u6709\u672A\u5B8C\u6210\u7684\u4EFB\u52A1
smfcore.manualOut=\u624B\u52A8\u51FA\u5E93
smfcode.error.barcode.noRules=\u89E3\u6790\u89C4\u5219\u672A\u5B9A\u4E49
smfcode.error.barcode.wrongLength=\u6761\u7801[{0}]\u957F\u5EA6\u9519\u8BEF
smfcode.error.barcode.noField=\u6761\u7801\u89E3\u6790\u5931\u8D25,\u672A\u627E\u5230{0}\u5B57\u6BB5
smfcode.error.barcode.pnNotExist=x\u6863\u6848 {0} \u4E0D\u5B58\u5728
smfcode.error.barcode.invalid={0}\u4E0D\u662F\u6709\u6548\u7684\u6761\u7801
smfcode.error.barcode.locked=\u5E93\u4F4D[{0}]\u5DF2\u88AB\u9501\u5B9A
smfcode.manualOut.ok=\u624B\u52A8\u51FA\u5E93\u6210\u529F
smfcode.manualOut.notFound=\u4ED3\u5E93\u4E2D\u672A\u627E\u5230\u6599\u76D8\u4FE1\u606F
smfcode.order.lineCanotNull=\u7EBF\u522B\u4E0D\u80FD\u4E3A\u7A7A
smfcode.order.cannotUpdateLine=\u5DE5\u5355\u5DF2\u51FA\u5E93\uFF0C\u4E0D\u80FD\u4FEE\u6539\u7EBF\u522B
smfcode.order.uploadOK=\u5DE5\u5355\u4E0A\u4F20\u6210\u529F
smfcode.order.ameExists=\u5DE5\u5355\u540D\u79F0[{0}]\u5DF2\u5B58\u5728
smfcode.order.hasClose=\u5DE5\u5355\u5DF2\u5173\u95ED
smfcode.order.supplementOutFail=\u672A\u627E\u5230\u53EF\u4EE5\u51FA\u5E93\u7684\u8865\u6599
smfcode.materialBox.quantityshort=\u7269\u6599\u6570\u91CF\u4E0D\u8DB3
smfcode.materialBox.invalid=\u672A\u627E\u5230\u6599\u76D2\u4FE1\u606F{0}
smfcode.materialBox.noReel=\u6599\u76D2\u4E2D\u672A\u627E\u5230\u5BF9\u5E94\u7269\u6599
smfcode.materialBox.boxNoReel=\u6599\u76D2\u4E2D\u65E0\u7269\u6599
smfcode.materialBox.inPos=\u7269\u6599\u5DF2\u5728\u5E93\u4F4D{0}\u4E2D
smfcode.materialBox.inOtherBox=\u7269\u6599\u5DF2\u5728\u6599\u76D2{0}\u4E2D
smfcore.materialBox=\u6599\u76D2\u64CD\u4F5C
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u672A\u627E\u5230\u9396\u5B9A\u5EAB\u4F4D ...@@ -29,7 +29,7 @@ smfcore.notFindPos=\u672A\u627E\u5230\u9396\u5B9A\u5EAB\u4F4D
smfcore.error.barcode.empty=\u672A\u6383\u5230\u689D\u78BC smfcore.error.barcode.empty=\u672A\u6383\u5230\u689D\u78BC
smfcore.error.barcode.many=\u627E\u5230\u591A\u500B\u6709\u6548\u689D\u78BC,\u7121\u6CD5\u5165\u5EAB smfcore.error.barcode.many=\u627E\u5230\u591A\u500B\u6709\u6548\u689D\u78BC,\u7121\u6CD5\u5165\u5EAB
smfcore.error.barcode.expired=\u7269\u6599\u5DF2\u904E\u671F,\u7121\u6CD5\u5165\u5EAB. smfcore.error.barcode.expired=\u7269\u6599\u5DF2\u904E\u671F,\u7121\u6CD5\u5165\u5EAB.
smfcore.allBoxView.noReel=\u5EAB\u4F4D\u4E2D\u7121\u7269\u6599 smfcore.allBoxView.noReel=\u5EAB\u4F4D{0}\u4E2D\u7121\u7269\u6599
smfcode.error.barcode.many=\u627E\u5230\u591A\u500B\u6709\u6548\u7684\u689D\u78BC smfcode.error.barcode.many=\u627E\u5230\u591A\u500B\u6709\u6548\u7684\u689D\u78BC
smfcode.error.barcode.noValidCode=\u7121\u6548\u7684\u689D\u78BC smfcode.error.barcode.noValidCode=\u7121\u6548\u7684\u689D\u78BC
smfcore.error.barcode.noValidCode={0}\u4E0D\u662F\u6709\u6548\u7684\u689D\u78BC smfcore.error.barcode.noValidCode={0}\u4E0D\u662F\u6709\u6548\u7684\u689D\u78BC
...@@ -93,3 +93,32 @@ smfcore.instruction=\u8AAA\u660E\u66F8 ...@@ -93,3 +93,32 @@ smfcore.instruction=\u8AAA\u660E\u66F8
smfcore.about=\u95DC\u65BC smfcore.about=\u95DC\u65BC
smfcore.tacticsOuput=\u7B56\u7565\u51FA\u5EAB smfcore.tacticsOuput=\u7B56\u7565\u51FA\u5EAB
smfcore.labelOuput=\u7269\u6599\u5206\u7D44 smfcore.labelOuput=\u7269\u6599\u5206\u7D44
smfcode.order.out.executing=\u5DE5\u55AE\u6B63\u5728\u57F7\u884C
smfcode.order.out.notFound=\u5DE5\u55AE\u672A\u627E\u5230
smfcode.order.out.maxOrder=\u5DF2\u9054\u5230\u6700\u5927\u53EF\u57F7\u884C\u5DE5\u55AE\u6578
smfcode.order.out.noTask=\u5DE5\u55AE\u7121\u53EF\u57F7\u884C\u7684\u4EFB\u52D9
smfcode.cannotUpdateOrderNum=\u5DE5\u55AE\u5DF2\u51FA\u5EAB\uFF0C\u4E0D\u80FD\u4FEE\u6539\u6578\u91CF
smfcode.order.close.success=\u5DE5\u55AE\u95DC\u9589\u6210\u529F
smfcode.order.close.taskNotEnd=\u5DE5\u55AE\u9084\u6709\u672A\u5B8C\u6210\u7684\u4EFB\u52D9
smfcore.manualOut=\u624B\u52D5\u51FA\u5EAB
smfcode.error.barcode.noRules=\u89E3\u6790\u898F\u5247\u672A\u5B9A\u7FA9
smfcode.error.barcode.wrongLength=\u689D\u78BC[{0}]\u9577\u5EA6\u932F\u8AA4
smfcode.error.barcode.noField=\u689D\u78BC\u89E3\u6790\u5931\u6557\uFF0C\u672A\u627E\u5230{0}\u5B57\u6BB5
smfcode.error.barcode.pnNotExist=\u6A94\u6848 {0} \u4E0D\u5B58\u5728
smfcode.error.barcode.invalid={0}\u4E0D\u662F\u6709\u6548\u7684\u689D\u78BC
smfcode.error.barcode.locked=\u5EAB\u4F4D[{0}]\u5DF2\u88AB\u9396\u5B9A
smfcode.manualOut.ok=\u624B\u52D5\u51FA\u5EAB\u6210\u529F
smfcode.manualOut.notFound=\u5009\u5EAB\u4E2D\u672A\u627E\u5230\u6599\u76E4\u4FE1\u606F
smfcode.order.lineCanotNull=\u7DDA\u5225\u4E0D\u80FD\u70BA\u7A7A
smfcode.order.cannotUpdateLine=\u5DE5\u55AE\u5DF2\u51FA\u5EAB\uFF0C\u4E0D\u80FD\u4FEE\u6539\u7DDA\u5225
smfcode.order.uploadOK=\u5DE5\u55AE\u4E0A\u50B3\u6210\u529F
smfcode.order.ameExists=\u5DE5\u55AE\u540D\u7A31[{0}]\u5DF2\u5B58\u5728
smfcode.order.hasClose=\u5DE5\u55AE\u5DF2\u95DC\u9589
smfcode.order.supplementOutFail=\u672A\u627E\u5230\u53EF\u4EE5\u51FA\u5EAB\u7684\u88DC\u6599
smfcode.materialBox.quantityshort=\u7269\u6599\u6570\u91CF\u4E0D\u8DB3
smfcode.materialBox.invalid=\u672A\u627E\u5230\u6599\u76D2\u4FE1\u606F{0}
smfcode.materialBox.noReel=\u6599\u76D2\u4E2D\u672A\u627E\u5230\u5C0D\u61C9\u7269\u6599
smfcode.materialBox.boxNoReel=\u6599\u76D2\u4E2D\u7121\u7269\u6599
smfcode.materialBox.inPos=\u7269\u6599\u5DF2\u5728\u5EAB\u4F4D{0}\u4E2D
smfcode.materialBox.inOtherBox=\u7269\u6599\u5DF2\u5728\u6599\u76D2{0}\u4E2D
smfcore.materialBox=\u6599\u76D2\u64CD\u4F5C
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!