Commit 6cad4e79 sunke

锡膏料仓

工单修改数量
1 个父辈 b838457c
正在显示 42 个修改的文件 包含 2216 行增加387 行删除
......@@ -50,3 +50,21 @@ mongorestore -h <hostname><:port> -d dbname <path>
C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\myproject\WEB-INF\classes\com\myproject\webapp\controller\storage
搅拌时获取与第一罐重量匹配的锡膏
>地址:
>>/service/store/solder/matchMixSolder
>
>参数:
>>barcode: 第一罐的条码
>
> 返回:
>>` {"code":0,"msg":"ok","data":{"posId":"3D03B02","barcode":"xxxx","weight":"100","mixTime":"300"}}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
>> - posId: 匹配的锡膏所在库位
>> - barcode: 匹配的锡膏条码
>> - weight: 匹配的锡膏的重量
>> - mixTime: 匹配的锡膏的搅拌时间(单位:秒)
位置,库位类型,优先级,高度,宽度,料仓ID,旋转轴位置P2,升降轴库位出料前点P5,升降轴库位出料缓冲点P6,升降轴库位入料前点P3,升降轴库位入料缓冲点P4,进出轴库位点取料点P3,回温区旋转轴库位点P2,冷藏区旋转轴库位点P2,,
1#AC1_0_1_1,1,115,50,140,1,617571,25453,13538,13538,25453,61597,20000,578355,,
1#AC1_0_1_2,1,114,60,230,1,617571,104372,111780,111780,104372,61597,20000,578355,,
1#AC1_0_1_3,1,113,60,230,1,617571,198951,206359,206359,198951,61597,20000,578355,,
1#AC1_0_1_4,1,112,60,230,1,617571,291933,299341,299341,291933,61597,20000,578355,,
1#AC1_0_1_5,1,111,60,230,1,617571,384118,391526,391526,384118,61597,20000,578355,,
1#AC1_0_1_6,1,110,60,230,1,617571,476584,484561,484561,476584,61597,20000,578355,,
1#AC1_1_1_1,1,109,75,60,1,617071,25441,38741,38741,25441,56791,20000,726998,,
1#AC1_1_1_2,1,108,75,60,1,617071,95218,108920,108920,95218,56791,20000,726998,,
1#AC1_1_1_3,1,107,75,60,1,617071,166195,179897,179897,166195,56791,20000,726998,,
1#AC1_1_1_4,1,106,75,60,1,617071,235576,249278,249278,235576,56791,20000,726998,,
1#AC1_1_1_5,1,105,75,60,1,617071,305755,319457,319457,305755,56791,20000,726998,,
1#AC1_1_1_6,1,104,75,60,1,617071,375934,389636,389636,375934,56791,20000,726998,,
1#AC1_1_1_7,1,103,75,60,1,617071,446366,460068,460068,446366,56791,20000,726998,,
1#AC1_1_1_8,1,102,75,60,1,617071,516292,529994,529994,516292,56791,20000,726998,,
1#AC1_2_1_1,1,101,75,60,1,617071,25441,38741,38741,25441,56791,20000,827023,,
1#AC1_2_1_2,1,100,75,60,1,617071,95218,108920,108920,95218,56791,20000,827023,,
1#AC1_2_1_3,1,99,75,60,1,617071,166195,179897,179897,166195,56791,20000,827023,,
1#AC1_2_1_4,1,98,75,60,1,617071,235576,249278,249278,235576,56791,20000,827023,,
1#AC1_2_1_5,1,97,75,60,1,617071,305755,319457,319457,305755,56791,20000,827023,,
1#AC1_2_1_6,1,96,75,60,1,617071,375934,389636,389636,375934,56791,20000,827023,,
1#AC1_2_1_7,1,95,75,60,1,617071,446366,460068,460068,446366,56791,20000,827023,,
1#AC1_2_1_8,1,94,75,60,1,617071,516292,529994,529994,516292,56791,20000,827023,,
1#AC1_3_1_1,1,93,75,60,1,617071,25441,38741,38741,25441,56791,20000,927215,,
1#AC1_3_1_2,1,92,75,60,1,617071,95218,108920,108920,95218,56791,20000,927215,,
1#AC1_3_1_3,1,91,75,60,1,617071,166195,179897,179897,166195,56791,20000,927215,,
1#AC1_3_1_4,1,90,75,60,1,617071,235576,249278,249278,235576,56791,20000,927215,,
1#AC1_3_1_5,1,89,75,60,1,617071,305755,319457,319457,305755,56791,20000,927215,,
1#AC1_3_1_6,1,88,75,60,1,617071,375934,389636,389636,375934,56791,20000,927215,,
1#AC1_3_1_7,1,87,75,60,1,617071,446366,460068,460068,446366,56791,20000,927215,,
1#AC1_3_1_8,1,86,75,60,1,617071,516292,529994,529994,516292,56791,20000,927215,,
1#AC1_4_1_1,1,85,50,140,1,617571,11350,20513,20513,11350,61597,20000,1079690,,
1#AC1_4_1_2,1,84,50,140,1,617571,72523,81686,81686,72523,61597,20000,1079690,,
1#AC1_4_1_3,1,83,50,140,1,617571,135759,144922,144922,135759,61597,20000,1079690,,
1#AC1_4_1_4,1,82,50,140,1,617571,198278,207441,207441,198278,61597,20000,1079690,,
1#AC1_4_1_5,1,81,50,140,1,617571,260828,269991,269991,260828,61597,20000,1079690,,
1#AC1_4_1_6,1,80,50,140,1,617571,323084,332247,332247,323084,61597,20000,1079690,,
1#AC1_4_1_7,1,79,50,140,1,617571,384378,393541,393541,384378,61597,20000,1079690,,
1#AC1_4_1_8,1,78,50,140,1,617571,447978,454799,454799,447978,61597,20000,1079690,,
1#AC1_4_1_9,1,77,50,140,1,617571,509434,517650,517650,509434,61597,20000,1079690,,
1#AC1_5_1_1,1,76,75,60,1,617071,25441,38741,38741,25441,56791,20000,1227197,,
1#AC1_5_1_2,1,75,75,60,1,617071,95218,108920,108920,95218,56791,20000,1227197,,
1#AC1_5_1_3,1,74,75,60,1,617071,166195,179897,179897,166195,56791,20000,1227197,,
1#AC1_5_1_4,1,73,75,60,1,617071,235576,249278,249278,235576,56791,20000,1227197,,
1#AC1_5_1_5,1,72,75,60,1,617071,305755,319457,319457,305755,56791,20000,1227197,,
1#AC1_5_1_6,1,71,75,60,1,617071,375934,389636,389636,375934,56791,20000,1227197,,
1#AC1_5_1_7,1,70,75,60,1,617071,446366,460068,460068,446366,56791,20000,1227197,,
1#AC1_5_1_8,1,69,75,60,1,617071,516292,529994,529994,516292,56791,20000,1227197,,
1#AC1_6_1_1,1,68,75,60,1,617071,25441,38741,38741,25441,56791,20000,1326577,,
1#AC1_6_1_2,1,67,75,60,1,617071,95218,108920,108920,95218,56791,20000,1326577,,
1#AC1_6_1_3,1,66,75,60,1,617071,166195,179897,179897,166195,56791,20000,1326577,,
1#AC1_6_1_4,1,65,75,60,1,617071,235576,249278,249278,235576,56791,20000,1326577,,
1#AC1_6_1_5,1,64,75,60,1,617071,305755,319457,319457,305755,56791,20000,1326577,,
1#AC1_6_1_6,1,63,75,60,1,617071,375934,389636,389636,375934,56791,20000,1326577,,
1#AC1_6_1_7,1,62,75,60,1,617071,446366,460068,460068,446366,56791,20000,1326577,,
1#AC1_6_1_8,1,61,75,60,1,617071,516292,529994,529994,516292,56791,20000,1326577,,
1#AC1_7_1_1,1,60,75,60,1,617071,25441,38741,38741,25441,56791,20000,1426581,,
1#AC1_7_1_2,1,59,75,60,1,617071,95218,108920,108920,95218,56791,20000,1426581,,
1#AC1_7_1_3,1,58,75,60,1,617071,166195,179897,179897,166195,56791,20000,1426581,,
1#AC1_7_1_4,1,57,75,60,1,617071,235576,249278,249278,235576,56791,20000,1426581,,
1#AC1_7_1_5,1,56,75,60,1,617071,305755,319457,319457,305755,56791,20000,1426581,,
1#AC1_7_1_6,1,55,75,60,1,617071,375934,389636,389636,375934,56791,20000,1426581,,
1#AC1_7_1_7,1,54,75,60,1,617071,446366,460068,460068,446366,56791,20000,1426581,,
1#AC1_7_1_8,1,53,75,60,1,617071,516292,529994,529994,516292,56791,20000,1426581,,
1#AC2_0_1_2,2,51,50,140,1,617571,800922,807327,807327,800922,61597,243886,10000,,
1#AC2_0_1_3,2,50,50,140,1,617571,895963,901768,901768,895963,61597,245492,10000,,
1#AC2_0_1_4,2,49,60,230,1,617571,988401,994906,994906,988401,61597,245492,10000,,6705
1#AC2_1_1_1,2,48,75,60,1,619071,723205,736203,736203,723205,55996,394244,10000,,
1#AC2_1_1_2,2,47,75,60,1,619071,793676,806781,806781,793676,55996,394244,10000,,
1#AC2_1_1_3,2,46,75,60,1,619071,863486,875259,875259,863486,55996,394244,10000,,
1#AC2_1_1_4,2,45,75,60,1,619071,933543,945185,945185,933543,55996,394244,10000,,
1#AC2_1_1_5,2,44,75,60,1,619071,1003262,1015111,1015111,1003262,55996,394244,10000,,
1#AC2_1_1_6,2,43,75,60,1,619071,1072723,1085037,1085037,1072723,55996,394244,10000,,
1#AC2_2_1_1,2,42,75,60,1,619071,723205,736203,736203,723205,55996,493536,10000,,
1#AC2_2_1_2,2,41,75,60,1,619071,793676,806781,806781,793676,55996,493536,10000,,
1#AC2_2_1_3,2,40,75,60,1,619071,863486,875259,875259,863486,55996,493536,10000,,
1#AC2_2_1_4,2,39,75,60,1,619071,933543,945185,945185,933543,55996,493536,10000,,
1#AC2_2_1_5,2,38,75,60,1,619071,1003262,1015111,1015111,1003262,55996,493536,10000,,
1#AC2_2_1_6,2,37,75,60,1,619071,1072723,1085037,1085037,1072723,55996,493536,10000,,
1#AC2_3_1_1,2,36,75,60,1,619071,723205,736203,736203,723205,55996,589109,10000,,
1#AC2_3_1_2,2,35,75,60,1,619071,793676,806781,806781,793676,55996,589109,10000,,
1#AC2_3_1_3,2,34,75,60,1,619071,863486,875259,875259,863486,55996,589109,10000,,
1#AC2_3_1_4,2,33,75,60,1,619071,933543,945185,945185,933543,55996,589109,10000,,
1#AC2_3_1_5,2,32,75,60,1,619071,1003262,1015111,1015111,1003262,55996,589109,10000,,
1#AC2_3_1_6,2,31,75,60,1,619071,1072723,1085037,1085037,1072723,55996,589109,10000,,
1#AC2_4_1_1,2,30,75,60,1,619071,723205,736203,736203,723205,56393,688666,10000,,
1#AC2_4_1_2,2,29,75,60,1,619071,793676,806781,806781,793676,56393,688666,10000,,
1#AC2_4_1_3,2,28,75,60,1,619071,863486,875259,875259,863486,56393,688666,10000,,
1#AC2_4_1_4,2,27,75,60,1,619071,933543,945185,945185,933543,56393,688666,10000,,
1#AC2_4_1_5,2,26,75,60,1,619071,1003262,1015111,1015111,1003262,56393,688666,10000,,
1#AC2_4_1_6,2,25,75,60,1,619071,1072723,1085037,1085037,1072723,56393,688666,10000,,
1#AC2_5_1_1,2,24,75,60,1,619071,723205,736203,736203,723205,56393,789294,10000,,
1#AC2_5_1_2,2,23,75,60,1,619071,793676,806781,806781,793676,56393,789294,10000,,
1#AC2_5_1_3,2,22,75,60,1,619071,863486,875259,875259,863486,56393,789294,10000,,
1#AC2_5_1_4,2,21,75,60,1,619071,933543,945185,945185,933543,56393,789294,10000,,
1#AC2_5_1_5,2,20,75,60,1,619071,1003262,1015111,1015111,1003262,56393,789294,10000,,
1#AC2_5_1_6,2,19,75,60,1,619071,1072723,1085037,1085037,1072723,56393,789294,10000,,
1#AC2_6_1_1,2,18,75,60,1,619071,723205,736203,736203,723205,56393,889634,10000,,
1#AC2_6_1_2,2,17,75,60,1,619071,793676,806781,806781,793676,56393,889634,10000,,
1#AC2_6_1_3,2,16,75,60,1,619071,863486,875259,875259,863486,56393,889634,10000,,
1#AC2_6_1_4,2,15,75,60,1,619071,933543,945185,945185,933543,56393,889634,10000,,
1#AC2_6_1_5,2,14,75,60,1,619071,1003262,1015111,1015111,1003262,56393,889634,10000,,
1#AC2_6_1_6,2,13,75,60,1,619071,1072723,1085037,1085037,1072723,56393,889634,10000,,
1#AC2_7_1_1,2,12,75,60,1,619071,723205,736203,736203,723205,56393,989366,10000,,
1#AC2_7_1_2,2,11,75,60,1,619071,793676,806781,806781,793676,56393,989366,10000,,
1#AC2_7_1_3,2,10,75,60,1,619071,863486,875259,875259,863486,56393,989366,10000,,
1#AC2_7_1_4,2,9,75,60,1,619071,933543,945185,945185,933543,56393,989366,10000,,
1#AC2_7_1_5,2,8,75,60,1,619071,1003262,1015111,1015111,1003262,56393,989366,10000,,
1#AC2_7_1_6,2,7,75,60,1,619071,1072723,1085037,1085037,1072723,56393,989366,10000,,
1#AC2_8_1_1,2,6,75,60,1,619071,723205,736203,736203,723205,56797,1091170,10000,,
1#AC2_8_1_2,2,5,75,60,1,619071,793676,806781,806781,793676,56797,1091170,10000,,
1#AC2_8_1_3,500,4,75,60,1,619071,863486,875259,875259,863486,56797,1091170,10000,,
1#AC2_8_1_4,300,3,75,60,1,619071,933543,945185,945185,933543,56797,1091170,10000,,
1#AC2_8_1_5,200,2,75,60,1,619071,1003262,1015111,1015111,1003262,56797,1091170,10000,,
1#AC2_8_1_6,100,1,75,60,1,619071,1072723,1085037,1085037,1072723,56797,1091170,10000,,
......@@ -13,6 +13,11 @@ public class StoragePosExcel {
//宽度(料盘尺寸)
private int w;
/**
* 是否是回温库位
*/
private boolean isWarmPos = false;
public String getPosName() {
return posName;
}
......@@ -44,4 +49,12 @@ public class StoragePosExcel {
public void setPriority(double priority) {
this.priority = priority;
}
public boolean isWarmPos() {
return isWarmPos;
}
public void setWarmPos(boolean warmPos) {
isWarmPos = warmPos;
}
}
package com.myproject.bean.json;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* Created by sunke on 2019/12/12.
*/
public class ResultBean {
protected final static Logger log = LogManager.getLogger(ResultBean.class);
public static ResultBean newErrorResult(int code, String msg){
return newErrorResult(code, msg, true);
}
public static ResultBean newErrorResult(int code, String msg, boolean writeLog){
ResultBean result = new ResultBean();
result.setCode(code);
result.setMsg(msg);
if(writeLog){
log.info(msg);
}
return result;
}
public static ResultBean newOkResult(String msg, Object data){
ResultBean result = new ResultBean();
result.setCode(0);
result.setMsg(msg);
result.setData(data);
return result;
}
public static ResultBean newOkResult(Object data){
return newOkResult("ok", data);
}
/**
* 结果码,0为正常,其他值表示异常
*/
private int code;
/**
* 提示信息
*/
private String msg;
/**
* 数据结果
*/
private Object data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
......@@ -25,13 +25,30 @@ public class Barcode extends BaseMongoBean {
private int type = StorageConstants.COMPONENT_TYPE.COMPONENT;
//锡膏回温时间,小于回温时间不可出库
private int warmTime = 0;
/**
* 搅拌时间(分钟)
*/
private int mixTime = 0;
private float maxStorageTime = 0;
/**
* 过期时间(入库时间+最大存储时间)
*/
private Date expTime;
//过期状态,-1未入库0在库,1已出库正常,2已出库且已过期
private int status = StorageConstants.BARCODE_STATUS.NEW;
/**
* 锡膏状态
*/
private int solderStatus = StorageConstants.SOLDER_STATUS.NONE;
/**
* 锡膏指定时间出库
*/
private Date needOutDate;
//private int componentType = 0;
private String partNumber;
//"供应商编号"
......@@ -90,6 +107,11 @@ public class Barcode extends BaseMongoBean {
private long putInTime = -1;
/**
* 开始回温时间
*/
private long startWarmTime = -1;
/**
* 入库时间
*/
private Date putInDate;
......@@ -278,6 +300,13 @@ public class Barcode extends BaseMongoBean {
this.type = type;
}
/**
* 是否是锡膏
*/
public boolean isSolder(){
return type == StorageConstants.COMPONENT_TYPE.SOLDERPASTE;
}
public int getWarmTime() {
return warmTime;
}
......@@ -336,6 +365,9 @@ public class Barcode extends BaseMongoBean {
}
public String getPutInDateStr(){
if(putInDate == null){
return "";
}
return DateUtil.toDateTimeString(putInDate);
}
......@@ -550,6 +582,52 @@ public class Barcode extends BaseMongoBean {
this.msl = msl;
}
public int getMixTime() {
return mixTime;
}
public void setMixTime(int mixTime) {
this.mixTime = mixTime;
}
public long getStartWarmTime() {
return startWarmTime;
}
public void setStartWarmTime(long startWarmTime) {
this.startWarmTime = startWarmTime;
}
public int getSolderStatus() {
if(solderStatus == StorageConstants.SOLDER_STATUS.REWARMING){
//如果状态是回温中,且回温时间已经大于warmTime,修改状态为待搅拌
long now = System.currentTimeMillis();
if(startWarmTime - now > warmTime * 60 * 60 * 1000){
solderStatus = StorageConstants.SOLDER_STATUS.TO_BE_MIXED;
}
}
return solderStatus;
}
public void setSolderStatus(int solderStatus) {
this.solderStatus = solderStatus;
}
public Date getNeedOutDate() {
return needOutDate;
}
public void setNeedOutDate(Date needOutDate) {
this.needOutDate = needOutDate;
}
public String getNeedOutDateStr(){
if(needOutDate == null){
return "";
}
return DateUtil.toDateTimeString(needOutDate);
}
// public void setNoChangeField(Barcode oldBarcode){
// if(oldBarcode != null){
// this.expireDate = oldBarcode.getExpireDate();
......
......@@ -41,6 +41,11 @@ public class Component extends BaseMongoBean {
private int warmTime;
/**
* 搅拌时间(分钟)
*/
private int mixTime;
/**
* 夹具编号
*/
private String fixtureNumber;
......@@ -373,4 +378,19 @@ public class Component extends BaseMongoBean {
public void setValidDay(int validDay) {
this.validDay = validDay;
}
public int getMixTime() {
return mixTime;
}
public void setMixTime(int mixTime) {
this.mixTime = mixTime;
}
/**
* 是否是锡膏
*/
public boolean isSolder(){
return type == StorageConstants.COMPONENT_TYPE.SOLDERPASTE;
}
}
......@@ -113,6 +113,11 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
private String memo;
/**
* 搅拌时间(锡膏搅拌任务使用)
*/
private int mixTime;
public String getStorageName() {
return storageName;
}
......@@ -295,6 +300,26 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
}
/**
* 是否是回温取料任务
*/
public boolean isRewarmTakingTask(){
return StorageConstants.OP.REWARM_TAKING == type;
}
/**
* 是否是搅拌任务
*/
public boolean isMixTask(){
return StorageConstants.OP.MIX == type;
}
/**
* 是否是回温放料任务
*/
public boolean isRewarmPuttingTask(){
return StorageConstants.OP.REWARM_PUTTING == type;
}
/**
* 是否是出库任务
*/
public boolean isCheckOutTask(){
......@@ -331,7 +356,7 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
*/
public boolean needReSendToClient(){
if(isCheckOutTask() && isExecuting()){
return System.currentTimeMillis() - super.getUpdateDate().getTime() >= 30 * 1000;
return System.currentTimeMillis() - super.getUpdateDate().getTime() >= 60 * 1000;
}
return false;
}
......@@ -452,4 +477,12 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
public void setMemo(String memo) {
this.memo = memo;
}
public int getMixTime() {
return mixTime;
}
public void setMixTime(int mixTime) {
this.mixTime = mixTime;
}
}
......@@ -186,6 +186,13 @@ public class Storage extends BaseMongoBean {
return StorageConstants.TYPE.CODESHELF.name().equals(type);
}
/**
* 是否是锡膏料仓
*/
public boolean isSolderPaste(){
return StorageConstants.TYPE.SOLDERPASTE.name().equals(type);
}
/**
* 是否是料柜
......
......@@ -29,6 +29,11 @@ public class StoragePos extends BaseMongoBean {
private boolean enabled = true;
//是否使用了
private boolean used = false;
/**
* 是否是回温库位,条码第一次入库是入库到冷藏库位,回温或二次入库时才入到回温库位
*/
private boolean warmPos = false;
//Width
private int w;
......@@ -204,4 +209,12 @@ public class StoragePos extends BaseMongoBean {
public String getSizeStr(){
return w + "x" + h;
}
public boolean isWarmPos() {
return warmPos;
}
public void setWarmPos(boolean warmPos) {
this.warmPos = warmPos;
}
}
......@@ -148,6 +148,16 @@ public class StatusBean {
return data.get("code");
}
public int getWeight(){
String weightStr = data.get("weight");
try{
return Integer.valueOf(weightStr);
}catch (Exception e){
}
return 0;
}
/**
* 获取库位信息
*/
......@@ -221,14 +231,16 @@ public class StatusBean {
/**
* 入库时添加仓位及料盘大小信息(posId库位编号,plateW:料盘宽度,plateH:料盘高度,singleOut:是否出库到料仓门口)
*/
public void addPosInfo(String posId, int plateW, int plateH, boolean isSingleOut){
public void addPosInfo(String barcode, String posId, int plateW, int plateH, boolean isSingleOut){
String originalPosId = data.get("posId");
String originalPlateW = data.get("plateW");
String originalPlateH = data.get("plateH");
String originalBarcode = data.get("barcode");
String posIdStr = posId;
String plateWStr = plateW + "";
String plateHStr = plateH + "";
String barcodeStr = barcode + "";
if(!Strings.isNullOrEmpty(originalPosId)){
posIdStr = originalPosId + "|" + posId;
}
......@@ -240,9 +252,14 @@ public class StatusBean {
if(!Strings.isNullOrEmpty(originalPlateH)){
plateHStr = originalPlateH + "|" + plateH;
}
if(!Strings.isNullOrEmpty(originalBarcode)){
barcodeStr = originalBarcode + "|" + barcodeStr;
}
data.put("posId",posIdStr);
data.put("plateW",plateWStr);
data.put("plateH",plateHStr);
data.put("barcode",barcodeStr);
data.put("singleOut", isSingleOut+"");
}
......
......@@ -50,5 +50,7 @@ public interface IDataLogDao extends IMongoDao {
*/
List<DataLog> findByFeedPosId(String feederPosId);
List<DataLog> findUnFinishedTasks();
List<DataLog> findHistory(String barcode, int num);
}
......@@ -17,6 +17,7 @@ import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
......@@ -169,6 +170,21 @@ public class DataLogDaoImpl extends AbstractMongoDao implements IDataLogDao {
}
@Override
public List<DataLog> findUnFinishedTasks(){
Criteria c = Criteria.where("status").nin(StorageConstants.OP_STATUS.FINISHED.name(),StorageConstants.OP_STATUS.CANCEL.name());
//只查找近12个小时未完成的任务
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR_OF_DAY,-12);
c.and("createDate").gte(calendar.getTime());
Query query = Query.query(c);
List<DataLog> unFinishedTasks = findByQuery(query);
if(unFinishedTasks == null){
unFinishedTasks = new ArrayList<>();
}
return unFinishedTasks;
}
@Override
public List<DataLog> findHistory(String barcode, int num) {
Criteria c = new Criteria();
if(barcode != null && !barcode.isEmpty()){
......
......@@ -44,7 +44,9 @@ public interface IStoragePosManager extends IManager<StoragePos> {
List<StoragePos> getEmptyPosByLimitPn(String storageId, String limitPn);
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, List<Integer> inBoxIds, Collection<String> excludePosIds) throws ValidateException;
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds) throws ValidateException;
StoragePos getEmptyWarmPos(Storage storage, Barcode barcode, Collection<String> excludePosIds) throws ValidateException;
int countTotalStorageSize(String storageId);
......
......@@ -67,6 +67,7 @@ public class BarcodeManagerImpl implements IBarcodeManager {
}
barcode.setType(component.getType());
barcode.setWarmTime(component.getWarmTime());
barcode.setMixTime(component.getMixTime());
barcode.setOtherField1(component.getProductionType());
barcode.setFixtureNumber(component.getFixtureNumber());
if(barcode.getPlateSize() <= 0){
......
......@@ -92,8 +92,23 @@ public class StoragePosManagerImpl implements IStoragePosManager {
return storagePosList;
}
@Override
public StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds) throws ValidateException {
if(barcode.getUsedCount() > 0){
//二次入库获取可用的回温库位
return getEmptyPos(storage,barcode, excludePosIds,true);
}else{
return getEmptyPos(storage,barcode, excludePosIds,false);
}
}
@Override
public StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, List<Integer> inBoxIds, Collection<String> excludePosIds) throws ValidateException {
public StoragePos getEmptyWarmPos(Storage storage, Barcode barcode, Collection<String> excludePosIds) throws ValidateException{
return getEmptyPos(storage,barcode, excludePosIds,true);
}
private StoragePos getEmptyPos(Storage storage, Barcode barcode, Collection<String> excludePosIds, boolean warmPos) throws ValidateException {
if(storage == null){
throw new ValidateException("storage.error.notExist");
......@@ -113,11 +128,19 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c = c.and("enabled").is(true)//可用
.and("used").is(false);//未使用
if(inBoxIds != null && !inBoxIds.isEmpty()){
String inBoxIdStr = StringUtils.join(inBoxIds,"|");
//匹配仓位名称以数字#开头的(inBoxIds 要用正则的|线隔开)
//c = c.and("posName").regex("^("+inBoxIdStr+")#.*");
if(storage.isSolderPaste()){
if(warmPos){
c = c.and("warmPos").is(true);//回温库位
}else{
c = c.and("warmPos").ne(true);//不是回温库位
}
}
// if(inBoxIds != null && !inBoxIds.isEmpty()){
// String inBoxIdStr = StringUtils.join(inBoxIds,"|");
// //匹配仓位名称以数字#开头的(inBoxIds 要用正则的|线隔开)
// //c = c.and("posName").regex("^("+inBoxIdStr+")#.*");
// }
//去除的仓位
if(excludePosIds != null && !excludePosIds.isEmpty()){
c = c.and("id").nin(excludePosIds);
......
......@@ -579,6 +579,12 @@ public class BarcodeRule {
// //佳世达
// rule ="BATCH;PRODATEyyyyMMdd[1:8:-1]EXPD[-1:-4:-1];PN[1:12:-1]SP[13:5:-1]QTY[-1:-5:-1];RI";
// codeStr = "L00002019090199951797;E20190901 0365;B8C.R2003.V81506072019090103000;R506072019102200356";
rule = "1;PN;BATCH;PRODATEyyyyMMdd;EXPDATEyyyyMMdd;QTY;RI";
codeStr = ";RMK1608-K-B-10300;7B16081217B0;20200506;20250203;5000;000";
rule = "1;2;PN;BATCH[2:0:-1];5;6;EXPDATEyyyy/MM/dd[2:0:8];QTY[2:0:-1];8;9;10;RI[2:0:-1]";
codeStr = "锘緿M;IN13浠跺\uE69C缁勮灪涓濇壒09913涓栬揪;BM;PH11A-ZZG02;DDDDMO180525;GG624-71;SX2019/8/25 0:00:00;SL2;HG;DL;ZP;QT90CECB112D1448DA91F485D0AA984B08";
BarcodeRule br = BarcodeRule.newRule(rule);
Barcode b = br.toCodeBean(codeStr).getBarcode();
if(b != null){
......@@ -587,6 +593,7 @@ public class BarcodeRule {
System.out.println("Amount:"+b.getAmount());
System.out.println("BATCH:"+b.getBatch());
System.out.println("MSL:"+b.getMsl());
System.out.println("PRODATE:"+b.getProduceDate());
System.out.println("EXPDATE:"+b.getExpireDate());
System.out.println("Supllier:"+b.getProvider());
}else{
......
......@@ -66,6 +66,21 @@ public class StorageConstants {
*/
public final static int ALARM_DATA = 5;
/**
* 6 锡膏回温取料
*/
public final static int REWARM_TAKING = 6;
/**
* 7 锡膏回温放料
*/
public final static int REWARM_PUTTING = 7;
/**
* 8 锡膏搅拌
*/
public final static int MIX = 8;
}
......@@ -161,6 +176,51 @@ public class StorageConstants {
* 13原点返回中
*/
public final static int RESET = 13;
/**
* 14 回温取料中
*/
public final static int REWARM_TAKING = 14;
/**
* 15 回温取料完成
*/
public final static int REWARM_TAKING_END = 15;
/**
* 16 回温放料中
*/
public final static int REWARM_PUTTING = 16;
/**
* 17 回温放料完成
*/
public final static int REWARM_PUTTING_END = 17;
/**
* 18 搅拌取料中
*/
public final static int MIX_TAKING = 18;
/**
* 19 等待搅拌
*/
public final static int WAIT_MIX = 19;
/**
* 20 搅拌执行中
*/
public final static int MIXING = 20;
/**
* 21 搅拌完成回仓
*/
public final static int MIX_PUTTING = 21;
/**
* 22 搅拌完成放回原来的仓中
*/
public final static int MIX_END = 22;
}
......@@ -223,6 +283,11 @@ public class StorageConstants {
*/
CODESHELF("storage.type.codeShelf"),
/**
* 10 锡膏料仓
*/
SOLDERPASTE("storage.type.solderPaste"),
;
private String key;
......@@ -495,6 +560,7 @@ public class StorageConstants {
* 2已出库且已过期
*/
public static int OUT_EXPIRED = 2;
}
/**
......@@ -572,4 +638,51 @@ public class StorageConstants {
/**补料已完成*/
public static int ONE_FINISHED=6;
}
/**
*
锡膏状态:
冷藏中
回温中 (从冷藏中取出,未达到回温时间)
待搅拌 (回温完成或二次入库重新搅拌,等待搅拌)
搅拌中 (搅拌动作执行中)
待出库 (已回温完成,搅拌完成或不需要搅拌,等待出库)
出库中 (出库动作执行中)
退库存储 (二次入库存储在暂存区,使用时可直接出库,与待出库状态一样)
*/
public static class SOLDER_STATUS{
public static int NONE = 0;
/**
* 冷藏中
*/
public static int UNDER_REFRIGERATION = 1;
/**
* 回温中 (从冷藏中取出,未达到回温时间)
*/
public static int REWARMING = 2;
/**
* 待搅拌 (回温完成或二次入库重新搅拌,等待搅拌)
*/
public static int TO_BE_MIXED = 3;
/**
* 搅拌中 (搅拌动作执行中)
*/
public static int MIXING = 4;
/**
* 待出库 (已回温完成,搅拌完成或不需要搅拌,等待出库)
*/
public static int TO_BE_OUT = 5;
/**
* 出库中 (出库动作执行中)
*/
public static int OUTING = 6;
/**
* 退库存储 (二次入库存储在暂存区,使用时可直接出库,与待出库状态一样)
*/
public static int RETREAT_STORAGE = 7;
}
}
......@@ -17,6 +17,7 @@ import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.webService.DataCache;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
......@@ -301,6 +302,19 @@ public class FileUploadController extends BaseFormController {
return msg;
}
private int getIndex(CsvReader csvRead, String headerStr, String headerAlias) throws ValidateException, IOException {
int index = csvRead.getIndex(headerStr);
if(index == -1){
index = csvRead.getIndex(headerAlias);
if(index == -1){
log.info("未包含["+headerStr+"]或 ["+headerAlias+"]列");
throw new ValidateException("未包含["+headerStr+"]或 ["+headerAlias+"]列");
}
}
return index;
}
/**
*
* @param fileURL
......@@ -323,38 +337,19 @@ public class FileUploadController extends BaseFormController {
csvRead.setSkipEmptyRecords(true);//忽略空行
csvRead.setTrimWhitespace(true);//去除空格
csvRead.readHeaders();
int posIndex = csvRead.getIndex("位置");
if(posIndex == -1){
posIndex = csvRead.getIndex("pos");
if(posIndex == -1){
log.info("未包含【位置】或【pos】列");
return "必须包含[位置]列";
}
}
int priIndex = csvRead.getIndex("优先级");
if (priIndex == -1){
priIndex = csvRead.getIndex("pri");
if(priIndex == -1){
log.info("未包含【优先级】或【pri】列");
return "必须包含[优先级]列";
}
}
int hIndex = csvRead.getIndex("高度");
if (hIndex == -1){
hIndex = csvRead.getIndex("h");
if(hIndex == -1){
log.info("未包含【高度】或【h】列");
return "必须包含【高度】列";
}
}
int wIndex = csvRead.getIndex("宽度");
if (wIndex == -1){
wIndex = csvRead.getIndex("w");
if(wIndex == -1){
log.info("未包含【宽度】或【w】列");
return "必须包含【宽度】列";
}
int posIndex = getIndex(csvRead, "位置","pos");
int priIndex = getIndex(csvRead, "优先级","pri");
int hIndex = getIndex(csvRead, "高度","h");
int wIndex = getIndex(csvRead, "宽度","w");
int typeIndex = -1;
try{
typeIndex = getIndex(csvRead,"库位类型","posType");
}catch (Exception e){
//库位类型这一列,没有也可以正常导入
}
List<StoragePosExcel> list = new ArrayList<StoragePosExcel>();
while(csvRead.readRecord()){
String[] lineValues = csvRead.getValues();
......@@ -362,6 +357,21 @@ public class FileUploadController extends BaseFormController {
String priorityStr = lineValues[priIndex];
String hStr = lineValues[hIndex];
String wStr = lineValues[wIndex];
String typeStr = "";
boolean isWarmPos = false;
if(typeIndex != -1){
typeStr = lineValues[typeIndex];
if(Strings.isNotBlank(typeStr)){
//只导入库为类型为1或2的
if(typeStr.equals("1")){//1=冷藏
isWarmPos = false;
}else if(typeStr.equals("2")){//2=回温
isWarmPos = true;
}else{
continue;
}
}
}
if(posName.isEmpty() || priorityStr.isEmpty() || hStr.isEmpty() || wStr.isEmpty()){
log.warn("行[posName="+posName + ","+"priority="+priorityStr+",h="+hStr+",w="+wStr+"]中有空白内容,此行忽略");
}else{
......@@ -370,6 +380,7 @@ public class FileUploadController extends BaseFormController {
posInfo.setPriority(Double.valueOf(priorityStr));
posInfo.setH(Integer.valueOf(hStr));
posInfo.setW(Integer.valueOf(wStr));
posInfo.setWarmPos(isWarmPos);
list.add(posInfo);
}
}
......@@ -389,6 +400,7 @@ public class FileUploadController extends BaseFormController {
storagePos.setW(storagePosExcel.getW());
storagePos.setH(storagePosExcel.getH());
storagePos.setStorageId(storage.getId());
storagePos.setWarmPos(storagePosExcel.isWarmPos());
storagePosManager.save(storagePos);
}
}
......
......@@ -82,6 +82,7 @@ public class BarcodeGenerateController extends BaseUpdateController {
barcode.setPlateSize(component.getPlateSize());
barcode.setType(component.getType());
barcode.setWarmTime(component.getWarmTime());
barcode.setMixTime(component.getMixTime());
barcode.setMaxStorageTime(component.getMaxStorageTime());
if (barcode.getAmount() == 0) {
barcode.setAmount(component.getAmount());
......
......@@ -116,8 +116,9 @@ public class BarcodeUpdateController extends BaseUpdateController {
if(barcode == null){
throw new ValidateException("barcode.error.notFound","未找到相关条码");
}
if(barcode.getUsedCount()>0){
//throw new ValidateException("已被使用的条码无法删除");
StoragePos pos = storagePosManager.getByBarcode(barcode.getBarcode());
if(pos != null) {//已经在库中,更新数量备注等相关信息
throw new ValidateException("barcode.error.used","已被使用的条码无法删除");
}
barcodeManager.delete(barcode);
saveMessage(request, getText("barcode.deleteSuccess", request.getLocale()));
......
......@@ -3,6 +3,7 @@ package com.myproject.webapp.controller.component;
import com.google.common.base.Strings;
import com.myproject.bean.CodeBean;
import com.myproject.bean.update.Barcode;
import com.myproject.bean.update.Storage;
import com.myproject.bean.update.StoragePos;
import com.myproject.exception.ValidateException;
import com.myproject.manager.IBarcodeManager;
......@@ -48,19 +49,28 @@ public class ReelNumModifyController extends BaseController {
return "数量不能为空";
}
try{
int amount = Integer.valueOf(num);
int newAmount = Integer.valueOf(num);
CodeBean codeBean = dataCache.resolveSingleCode(barcode);
Barcode br = codeBean.getBarcode();
if(br != null){
log.info("更新条码["+br.getBarcode()+"]的数量["+br.getAmount()+"]为:"+amount);
br.setAmount(amount);
log.info("更新条码["+br.getBarcode()+"]的数量["+br.getAmount()+"]为:"+newAmount);
br.setAmount(newAmount);
barcodeManager.save(br);
StoragePos pos = storagePosManager.getByBarcode(br.getBarcode());
if(pos != null){
Barcode barcodeInPos = pos.getBarcode();
barcodeInPos.setAmount(amount);
barcodeInPos.setAmount(newAmount);
storagePosManager.save(pos);
log.info("更新库位["+pos.getPosName()+"]中条码数量为:" + amount);
log.info("更新库位["+pos.getPosName()+"]中条码数量为:" + newAmount);
int oldAmount = barcodeInPos.getAmount();
int diffAount = newAmount - oldAmount;
if(diffAount != 0){
//更新库存
Storage storage = dataCache.getStorageById(pos.getStorageId());
dataCache.updateInventoryAmount(storage.getCid(), barcodeInPos.getPartNumber(), diffAount);
}
}
}else{
throw new ValidateException(codeBean.getErrorCode(), codeBean.getParams(),codeBean.getError());
......
......@@ -80,7 +80,7 @@ public class ComponentUpdateController extends BaseUpdateController{
} else{
component = new Component();
if(componentType == StorageConstants.COMPONENT_TYPE.SOLDERPASTE){
component.setFixtureNumber(StorageConstants.PACKAGE_TYPE.SOLDER_FIXTURE.getCode());
//component.setFixtureNumber(StorageConstants.PACKAGE_TYPE.SOLDER_FIXTURE.getCode());
}else if(componentType == StorageConstants.COMPONENT_TYPE.PCB){
component.setFixtureNumber(StorageConstants.PACKAGE_TYPE.PCB_FIXTURE.getCode());
}
......@@ -102,21 +102,21 @@ public class ComponentUpdateController extends BaseUpdateController{
case StorageConstants.SAVE:
//锡膏和 PCB必须要有夹具
if(component.getType() == StorageConstants.COMPONENT_TYPE.SOLDERPASTE){
if(Strings.isNullOrEmpty(component.getFixtureNumber())){
log.info("夹具编号不能为空");
throw new ValidateException("component.error.notFound","夹具编号不能为空");
}else {
Component fixture = componentmanager.findByPartNumber(component.getFixtureNumber());
if(fixture == null){
log.info("不存在编号为【"+component.getFixtureNumber()+"】的夹具");
throw new ValidateException("component.error.notExist",new String[]{component.getFixtureNumber()},"不存在编号为【"+component.getFixtureNumber()+"】的夹具");
}else{
component.setPlateSize(fixture.getPlateSize());
component.setHeight(fixture.getHeight());
}
}
}
// if(component.getType() == StorageConstants.COMPONENT_TYPE.SOLDERPASTE){
// if(Strings.isNullOrEmpty(component.getFixtureNumber())){
// log.info("夹具编号不能为空");
// throw new ValidateException("component.error.notFound","夹具编号不能为空");
// }else {
// Component fixture = componentmanager.findByPartNumber(component.getFixtureNumber());
// if(fixture == null){
// log.info("不存在编号为【"+component.getFixtureNumber()+"】的夹具");
// throw new ValidateException("component.error.notExist",new String[]{component.getFixtureNumber()},"不存在编号为【"+component.getFixtureNumber()+"】的夹具");
// }else{
// component.setPlateSize(fixture.getPlateSize());
// component.setHeight(fixture.getHeight());
// }
// }
// }
//PCB由于夹具和 PCB码不能同时扫到,这里去掉夹具绑定,
if(component.getType() == StorageConstants.COMPONENT_TYPE.PCB){
component.setFixtureNumber("");
......@@ -134,6 +134,7 @@ public class ComponentUpdateController extends BaseUpdateController{
List<Barcode> barcodes = barcodeDao.findByQuery(barcodeQuery);
for (Barcode barcode : barcodes) {
barcode.setWarmTime(component.getWarmTime());
barcode.setMixTime(component.getMixTime());
barcode.setMaxStorageTime(component.getMaxStorageTime());
barcodeDao.save(barcode);
}
......@@ -144,6 +145,7 @@ public class ComponentUpdateController extends BaseUpdateController{
for (StoragePos pos : poses){
pos.getBarcode().setType(component.getType());
pos.getBarcode().setWarmTime(component.getWarmTime());
pos.getBarcode().setMixTime(component.getMixTime());
pos.getBarcode().setMaxStorageTime(component.getMaxStorageTime());
//pos.setCreateDate(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));
pos.setCanCheckOutTime(pos.getBarcode().getReachWarmTime());
......
......@@ -70,7 +70,7 @@ public class ShelfController extends BaseController {
Barcode barcode = barcodeManager.findByBarcode(code);
if(barcode != null){
try {
StoragePos pos = storagePosManager.getEmptyPosByStorage(storage, barcode, new ArrayList<Integer>(),new ArrayList<String>());
StoragePos pos = storagePosManager.getEmptyPosByStorage(storage, barcode, new ArrayList<String>());
if(pos != null){
log.info("查找到空位"+pos.getPosName()+",点亮对应的库位");
StorageDataController.addOp(cid,"open", pos.getPosName());
......
package com.myproject.webapp.controller.storage;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.myproject.bean.CodeBean;
import com.myproject.bean.json.ResultBean;
import com.myproject.bean.update.Barcode;
import com.myproject.bean.update.DataLog;
import com.myproject.bean.update.Storage;
import com.myproject.bean.update.StoragePos;
import com.myproject.dao.mongo.IDataLogDao;
import com.myproject.exception.ValidateException;
import com.myproject.manager.IBarcodeManager;
import com.myproject.manager.IStoragePosManager;
import com.myproject.util.DateUtil;
import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.webService.DataCache;
import com.myproject.webapp.controller.webService.ITaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* 锡膏料仓
*/
@Controller
public class SolderBoxController extends BaseController{
@Autowired
private DataCache dataCache;
@Autowired
private ITaskService taskService;
@Autowired
private IStoragePosManager storagePosManager;
@Autowired
private IBarcodeManager barcodeManager;
@RequestMapping("/storage/solder/{cid}")
public String solderView(@PathVariable String cid, HttpServletRequest request){
request.getSession().setAttribute("show",cid);
Storage storage = dataCache.getStorage(cid);
request.setAttribute("storage",storage);
return "storage/solderBox";
}
/**
* 查找下一个空位,并且点亮灯
*/
@RequestMapping("/service/store/solder/listNotEmpty")
@ResponseBody
public List<StoragePos> checkAll(HttpServletRequest request){
String cid = request.getParameter("cid");
Storage storage = dataCache.getStorage(cid);
List<StoragePos> notEmptyPosList = storagePosManager.findNotEmptyByStorageId(storage.getId());
return notEmptyPosList;
}
@RequestMapping("/service/store/solder/outSolder")
@ResponseBody
public String outSolder(HttpServletRequest request){
String pids = request.getParameter("pids");
String dateStr = request.getParameter("outDate");
Date outDate = null;
if(!Strings.isNullOrEmpty(dateStr)){
try {
outDate = DateUtil.toDate(dateStr,"yyyy-MM-dd HH:mm");
} catch (ParseException e) {
}
}
if(outDate == null){
outDate = new Date();
}
for(String pid : pids.split(";")){
StoragePos pos = storagePosManager.get(pid);
if(pos == null){
return "位置["+pid+"]不存在";
}
log.info("出库位置仓位【"+pos.getPosName()+"】" + dateStr);
try {
Barcode barcode = pos.getBarcode();
barcode.setNeedOutDate(outDate);
barcodeManager.save(barcode);
pos.setBarcode(barcode);
storagePosManager.save(pos);
} catch (ValidateException e) {
}
}
return "1操作成功";
}
@RequestMapping(value = "/service/store/solder/matchMixSolder")
@ResponseBody
public ResultBean matchMixSolder(HttpServletRequest request) {
String barcode = request.getParameter("barcode");
if(Strings.isNullOrEmpty(barcode)){
return ResultBean.newErrorResult(2001,"参数[barcode]不能为空");
}
DataLog firstMixTask = null;
Collection<DataLog> queueTasks = taskService.getQueueTasks();
for (DataLog queueTask : queueTasks) {
if(queueTask.isMixTask() && queueTask.isExecuting() && queueTask.getBarcode().equals(barcode)){
firstMixTask = queueTask;
break;
}
}
if(firstMixTask != null){
String cid = firstMixTask.getCid();
int weight = firstMixTask.getNum();
int mixTime = firstMixTask.getMixTime();
for (DataLog queueTask : queueTasks) {
if(queueTask.getBarcode().equals(barcode)){
continue;
}
if(queueTask.getCid().equals(cid) && queueTask.isMixTask() && mixTime == queueTask.getMixTime()){
//搅拌时间相同, 重量相差在10%以内
float diffWeight = Math.abs(queueTask.getNum() - weight);
float diffRate = diffWeight/ weight;
if(diffRate <= 0.1){
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("posId",queueTask.getPosName());
resultMap.put("barcode",queueTask.getBarcode());
resultMap.put("weight", queueTask.getNum()+"");
resultMap.put("mixTime",queueTask.getMixTime());
return ResultBean.newOkResult(resultMap);
}
}
}
return ResultBean.newErrorResult(2002, "未找到与["+barcode+"]重量匹配的搅拌任务");
}
return ResultBean.newErrorResult(2003, "未找到条码["+barcode+"]正在执行的搅拌任务");
}
}
......@@ -67,4 +67,6 @@ public interface ITaskService {
Collection<String> excludePosIds();
void addTaskToFinished(StoragePos pos, Barcode barcode, String opUser);
void addTaskToExecute(DataLog task);
}
package com.myproject.webapp.controller.webService;
import com.myproject.bean.update.DataLog;
import com.myproject.dao.mongo.IDataLogDao;
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;
/**
* Created by sunke on 2020/3/5.
* 主定时器
*/
@Service
public class MainTimer {
protected final transient Logger log = LogManager.getLogger(getClass());
ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(1);
@Autowired
private IDataLogDao dataLogDao;
@Autowired
private ITaskService taskService;
@Autowired
private SolderBoxCache solderBoxCache;
public void init(){
log.info("加载未完成的任务");
List<DataLog> unExecuteTasks = dataLogDao.findUnFinishedTasks();
for (DataLog unExecuteTask : unExecuteTasks) {
if(unExecuteTask.isExecuting() || unExecuteTask.isWait()){
taskService.addTaskToExecute(unExecuteTask);
}
}
log.info("主定时器开启,60秒后开始执行, 每5s执行一次");
//1 分钟之后执行,每秒钟执行一次
scheduledThreadPool.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
timerTask();
}
}, 60, 5, TimeUnit.SECONDS);
}
private void timerTask(){
try{
solderBoxCache.runTimer();
}catch (Exception e){
log.error("定时器执行出错",e);
}finally {
}
}
}
package com.myproject.webapp.controller.webService;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.myproject.bean.update.*;
import com.myproject.dao.mongo.IDataLogDao;
import com.myproject.exception.ApiException;
import com.myproject.exception.ValidateException;
import com.myproject.manager.IBarcodeManager;
import com.myproject.manager.IComponentManager;
import com.myproject.manager.IStoragePosManager;
import com.myproject.util.DateUtil;
import com.myproject.util.HttpHelper;
import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.storage.BaseController;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.util.Integers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@Controller
@RequestMapping("/rest/api/qisda")
public class QisdaApiController extends BaseController {
@Autowired
protected ITaskService taskService;
@Autowired
protected IComponentManager componentManager;
@Autowired
private IBarcodeManager barcodeManager;
@Autowired
private IStoragePosManager storagePosManager;
@Autowired
private DataCache dataCache;
@Autowired
private IDataLogDao dataLogDao;
protected final static Logger log = LogManager.getLogger(QisdaApiController.class);
public static class AvailableInventoryBean{
public String facility = "S9";
public String partNum = "6H.15010.204";
public String company = "AAA";
public int qty = 10000;
}
/**
* 基础数据同步
*/
@RequestMapping(value = "/availableInventory")
@ResponseBody
public List<AvailableInventoryBean> availableInventory(HttpServletRequest request) {
log.info("收到获取库存数量接口");
Map<String, String[]> paramMap = request.getParameterMap();
for (Map.Entry<String, String[]> stringEntry : paramMap.entrySet()) {
log.info(stringEntry.getKey());
}
List<AvailableInventoryBean> results = new ArrayList<>();
AvailableInventoryBean bean1 = new AvailableInventoryBean();
AvailableInventoryBean bean2 = new AvailableInventoryBean();
bean2.partNum = "6H.15010.200";
bean2.qty = 800;
results.add(bean1);
results.add(bean2);
return results;
}
/**
* 基础数据同步
*/
@RequestMapping(value = "/out")
@ResponseBody
public String out(HttpServletRequest request) {
try {
log.info("收到出库请求");
//String body = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
Map<String, String[]> paramMap = request.getParameterMap();
for (Map.Entry<String, String[]> stringEntry : paramMap.entrySet()) {
log.info(stringEntry.getKey());
}
} catch (Exception e) {
e.printStackTrace();
}
return "0";
}
/**
* 入库判定接口
*/
public static void VMILocationInCheck(String reelid, String so){
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx?op=VMIMateriaRecAss";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("reelid",reelid);
paramMap.put("so",so);
try {
String result = HttpHelper.postJson(url,paramMap);
log.info("收到入库判定接口返回:" + result);
} catch (ApiException e) {
log.error("入库判定接口出错",e);
}
}
/**
* 入库判定接口
*/
public static void VMILocationIn(String reelID, String location, String userName){
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx?op=VMIMateriaRecAss";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("reelID",reelID);
paramMap.put("location",location);
paramMap.put("userName",userName);
try {
String result = HttpHelper.postJson(url,paramMap);
log.info("收到入库判定接口返回:" + result);
} catch (ApiException e) {
log.error("入库判定接口出错",e);
}
}
/**
* CIS收料入库接口
*/
public static void VMIMateriaReceive(String materialInfo, String userName){
materialInfo = "{\"dnOrFacility\":\"DNMIST1901002587\",\"reelID\":\"R000002014042300013\",\"reelType\":\"0\",\"partNum\":\"6H.15010.204\",\"qty\":\"3\",\"lifeCycle\":\"240\",\"productCode\":\"20191102\",\"lot\":\"L00000000IA9617JL1D81\",\"vendor\":\"82012\",\"location\":\"1-1\",\"qrCodeInfo\":\"L00000000IA9617JL1D81;E20190101 0730;B8C.00501.010503562019010103000;R000002014042300013\"}";
userName = "SMDBOX";
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx?op=VMIMateriaReceive";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("materialInfo",materialInfo);
paramMap.put("userName",userName);
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("收到CIS收料入库接口返回:" + result);
} catch (ApiException e) {
log.error("CIS收料入库接口出错",e);
}
}
public static void GetDNDetailsJson(){
String url = "http://10.85.17.43:8080/WMSWeb.asmx/GetDNDetailsJson";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("DHNO","DNMISW1911197845");
paramMap.put("ISCheck","N");
paramMap.put("isBack","Y");
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("获取DN单详情接口出错:" + result);
} catch (ApiException e) {
log.error("获取DN单详情接口出错",e);
}
}
public static void main(String args[]) throws Exception{
// VMILocationInCheck("12345","ABC");
// VMILocationIn("111111","1#2-1","SMD-box");
// VMIMateriaReceive("","");
GetDNDetailsJson();
}
}
//package com.myproject.webapp.controller.webService;
//
//import com.google.common.base.Strings;
//import com.google.common.collect.Lists;
//import com.google.common.collect.Maps;
//import com.google.common.collect.Sets;
//import com.myproject.bean.update.*;
//import com.myproject.dao.mongo.IDataLogDao;
//import com.myproject.exception.ApiException;
//import com.myproject.exception.ValidateException;
//import com.myproject.manager.IBarcodeManager;
//import com.myproject.manager.IComponentManager;
//import com.myproject.manager.IStoragePosManager;
//import com.myproject.util.DateUtil;
//import com.myproject.util.HttpHelper;
//import com.myproject.util.StorageConstants;
//import com.myproject.webapp.controller.storage.BaseController;
//import org.apache.logging.log4j.LogManager;
//import org.apache.logging.log4j.Logger;
//import org.apache.logging.log4j.core.util.Integers;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//import java.util.*;
//import java.util.stream.Collectors;
//
//
//@Controller
//@RequestMapping("/rest/api/qisda")
//public class QisdaApiController extends BaseController {
//
// @Autowired
// protected ITaskService taskService;
//
// @Autowired
// protected IComponentManager componentManager;
//
// @Autowired
// private IBarcodeManager barcodeManager;
//
// @Autowired
// private IStoragePosManager storagePosManager;
//
// @Autowired
// private DataCache dataCache;
//
// @Autowired
// private IDataLogDao dataLogDao;
//
// protected final static Logger log = LogManager.getLogger(QisdaApiController.class);
//
// public static class AvailableInventoryBean{
// public String facility = "S9";
// public String partNum = "6H.15010.204";
// public String company = "AAA";
// public int qty = 10000;
// }
//
// /**
// * 基础数据同步
// */
// @RequestMapping(value = "/availableInventory")
// @ResponseBody
// public List<AvailableInventoryBean> availableInventory(HttpServletRequest request) {
// log.info("收到获取库存数量接口");
//
// Map<String, String[]> paramMap = request.getParameterMap();
// for (Map.Entry<String, String[]> stringEntry : paramMap.entrySet()) {
// log.info(stringEntry.getKey());
// }
//
// List<AvailableInventoryBean> results = new ArrayList<>();
// AvailableInventoryBean bean1 = new AvailableInventoryBean();
// AvailableInventoryBean bean2 = new AvailableInventoryBean();
// bean2.partNum = "6H.15010.200";
// bean2.qty = 800;
// results.add(bean1);
// results.add(bean2);
// return results;
// }
//
//
//
// /**
// * 基础数据同步
// */
// @RequestMapping(value = "/out")
// @ResponseBody
// public String out(HttpServletRequest request) {
// try {
// log.info("收到出库请求");
// //String body = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
// Map<String, String[]> paramMap = request.getParameterMap();
// for (Map.Entry<String, String[]> stringEntry : paramMap.entrySet()) {
// log.info(stringEntry.getKey());
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// return "0";
// }
//
//
// /**
// * 入库判定接口
// */
// public static void VMILocationInCheck(String reelid, String so){
// String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx?op=VMIMateriaRecAss";
// Map<String,Object> paramMap = new HashMap<String,Object>();
// paramMap.put("reelid",reelid);
// paramMap.put("so",so);
// try {
// String result = HttpHelper.postJson(url,paramMap);
// log.info("收到入库判定接口返回:" + result);
// } catch (ApiException e) {
// log.error("入库判定接口出错",e);
// }
// }
//
// /**
// * 入库判定接口
// */
// public static void VMILocationIn(String reelID, String location, String userName){
// String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx?op=VMIMateriaRecAss";
// Map<String,Object> paramMap = new HashMap<String,Object>();
// paramMap.put("reelID",reelID);
// paramMap.put("location",location);
// paramMap.put("userName",userName);
// try {
// String result = HttpHelper.postJson(url,paramMap);
// log.info("收到入库判定接口返回:" + result);
// } catch (ApiException e) {
// log.error("入库判定接口出错",e);
// }
// }
//
// /**
// * CIS收料入库接口
// */
// public static void VMIMateriaReceive(String materialInfo, String userName){
// materialInfo = "{\"dnOrFacility\":\"DNMIST1901002587\",\"reelID\":\"R000002014042300013\",\"reelType\":\"0\",\"partNum\":\"6H.15010.204\",\"qty\":\"3\",\"lifeCycle\":\"240\",\"productCode\":\"20191102\",\"lot\":\"L00000000IA9617JL1D81\",\"vendor\":\"82012\",\"location\":\"1-1\",\"qrCodeInfo\":\"L00000000IA9617JL1D81;E20190101 0730;B8C.00501.010503562019010103000;R000002014042300013\"}";
// userName = "SMDBOX";
// String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx?op=VMIMateriaReceive";
// Map<String,Object> paramMap = new HashMap<String,Object>();
// paramMap.put("materialInfo",materialInfo);
// paramMap.put("userName",userName);
// try {
// String result = HttpHelper.postParam(url,paramMap);
// log.info("收到CIS收料入库接口返回:" + result);
// } catch (ApiException e) {
// log.error("CIS收料入库接口出错",e);
// }
// }
//
// public static void GetDNDetailsJson(){
// String url = "http://10.85.17.43:8080/WMSWeb.asmx/GetDNDetailsJson";
// Map<String,Object> paramMap = new HashMap<String,Object>();
// paramMap.put("DHNO","DNMISW1911197845");
// paramMap.put("ISCheck","N");
// paramMap.put("isBack","Y");
// try {
// String result = HttpHelper.postParam(url,paramMap);
// log.info("获取DN单详情接口出错:" + result);
// } catch (ApiException e) {
// log.error("获取DN单详情接口出错",e);
// }
// }
//
// public static void main(String args[]) throws Exception{
//// VMILocationInCheck("12345","ABC");
//// VMILocationIn("111111","1#2-1","SMD-box");
//// VMIMateriaReceive("","");
// GetDNDetailsJson();
// }
//
//
//}
package com.myproject.webapp.controller.webService;
import com.google.common.base.Strings;
import com.myproject.bean.json.ResultBean;
import com.myproject.bean.update.Barcode;
import com.myproject.bean.update.DataLog;
import com.myproject.bean.update.Storage;
import com.myproject.bean.update.StoragePos;
import com.myproject.dao.mongo.IDataLogDao;
import com.myproject.exception.ValidateException;
import com.myproject.manager.IBarcodeManager;
import com.myproject.manager.IStoragePosManager;
import com.myproject.util.StorageConstants;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by sunke on 2020/7/17.
*/
@Repository
public class SolderBoxCache {
protected static final transient Logger log = LogManager.getLogger(SolderBoxCache.class);
@Autowired
private DataCache dataCache;
@Autowired
private ITaskService taskService;
@Autowired
private IDataLogDao dataLogDao;
@Autowired
private IBarcodeManager barcodeManager;
@Autowired
private IStoragePosManager storagePosManager;
/**
* 库位信息缓存
*/
// private static Map<String, StoragePos> posCacheMap = new ConcurrentHashMap<>();
public void runTimer(){
Collection<Storage> allStorage = dataCache.getAllStorage().values();
for (Storage storage : allStorage) {
if(!storage.isSolderPaste()){
continue;
}
List<StoragePos> allPos = storagePosManager.findNotEmptyByStorageId(storage.getId());
for (StoragePos storagePos : allPos) {
try{
Barcode barcode = storagePos.getBarcode();
if(barcode != null){
Date needOutDate = barcode.getNeedOutDate();
if(needOutDate != null){
long now = System.currentTimeMillis();
int status = barcode.getSolderStatus();
//冷藏中,看是否需要进行回温
if(StorageConstants.SOLDER_STATUS.UNDER_REFRIGERATION == status){
long needWarmStartTime = needOutDate.getTime() - barcode.getWarmTime() * 60 * 60 * 1000 - barcode.getMixTime() * 1000 - 10 * 60 * 1000;
if(now > needWarmStartTime){
//需要进行回温
createRewarmTask(storagePos);
}
}else if(StorageConstants.SOLDER_STATUS.REWARMING == status){
//回温中,看回温是否完成
if(now - barcode.getStartWarmTime() >= barcode.getWarmTime() * 60 * 60 *1000){
//回温完成,更改状态为待搅拌
if(barcode.getMixTime() <= 0){
log.info(barcode.getBarcode() + "到达回温时间,搅拌时间为0,修改状态为待出库");
barcode.setSolderStatus(StorageConstants.SOLDER_STATUS.TO_BE_OUT);
}else{
log.info(barcode.getBarcode() + "到达回温时间,修改状态为待搅拌");
barcode.setSolderStatus(StorageConstants.SOLDER_STATUS.TO_BE_MIXED);
}
barcode = barcodeManager.save(barcode);
storagePos.setBarcode(barcode);
storagePosManager.save(storagePos);
}
}else if(StorageConstants.SOLDER_STATUS.TO_BE_MIXED == status){
//待搅拌,生成搅拌任务
long needMixStartTime = needOutDate.getTime() - barcode.getMixTime() * 1000 - 5 * 60 * 1000;
if(now >= needMixStartTime){
createMixTask(storagePos);
}
}else if(StorageConstants.SOLDER_STATUS.TO_BE_OUT == status || StorageConstants.SOLDER_STATUS.RETREAT_STORAGE == status){
//待出库,生成出库任务
long needOutStartTime = needOutDate.getTime();
if(now >= needOutStartTime){
createOutTask(storagePos);
}
}
}
}
}catch (Exception e){
log.info(storagePos.getBarcode().getBarcode() + "["+storagePos.getPosName()+"]" + "定时任务出错:" + e.getMessage());
}
}
}
}
/**
* 创建出库任务
* @param storagePos
*/
private void createOutTask(StoragePos storagePos) throws ValidateException {
Barcode barcode = storagePos.getBarcode();
Collection<DataLog> queueTasks = taskService.getQueueTasks();
for (DataLog queueTask : queueTasks) {
if(queueTask.getBarcode().equals(barcode.getBarcode())){
//已经有任务,返回
return;
}
}
log.info(barcode.getBarcode() + "创建出库任务");
Storage storage = dataCache.getStorageById(storagePos.getStorageId());
DataLog outTask = newTask(storage, storagePos,barcode);
outTask.setType(StorageConstants.OP.CHECKOUT);
outTask.setMixTime(barcode.getMixTime());
outTask = dataLogDao.save(outTask);
taskService.addTaskToExecute(outTask);
//更改状态
// barcode.setSolderStatus(StorageConstants.SOLDER_STATUS.OUTING);
// barcode = barcodeManager.save(barcode);
// storagePos.setBarcode(barcode);
// storagePosManager.save(storagePos);
}
/**
* 创建搅拌任务
*/
private void createMixTask(StoragePos storagePos) throws ValidateException {
Barcode barcode = storagePos.getBarcode();
Collection<DataLog> queueTasks = taskService.getQueueTasks();
for (DataLog queueTask : queueTasks) {
if(queueTask.getBarcode().equals(barcode.getBarcode())){
//已经有任务,返回
return;
}
}
log.info(barcode.getBarcode() + "创建搅拌任务");
Storage storage = dataCache.getStorageById(storagePos.getStorageId());
DataLog mixTask = newTask(storage, storagePos,barcode);
mixTask.setType(StorageConstants.OP.MIX);
mixTask.setMixTime(barcode.getMixTime());
mixTask = dataLogDao.save(mixTask);
taskService.addTaskToExecute(mixTask);
//更改状态
// barcode.setSolderStatus(StorageConstants.SOLDER_STATUS.MIXING);
// barcode = barcodeManager.save(barcode);
// storagePos.setBarcode(barcode);
// storagePosManager.save(storagePos);
}
/**
* 创建回温任务
*/
private void createRewarmTask(StoragePos storagePos){
Barcode barcode = storagePos.getBarcode();
Collection<DataLog> queueTasks = taskService.getQueueTasks();
for (DataLog queueTask : queueTasks) {
if(queueTask.getBarcode().equals(barcode.getBarcode())){
//已经有任务,返回
return;
}
}
Storage storage = dataCache.getStorageById(storagePos.getStorageId());
try {
Collection<String> excludePosIds = taskService.excludePosIds();
StoragePos warmPos = storagePosManager.getEmptyWarmPos(storage, barcode, excludePosIds);
if(warmPos != null){
log.info(barcode.getBarcode() + "创建回温移库任务["+storagePos.getPosName()+"]=>" + warmPos.getPosName());
DataLog puttingTask = newTask(storage, warmPos,barcode);
puttingTask.setType(StorageConstants.OP.REWARM_PUTTING);
puttingTask = dataLogDao.save(puttingTask);
taskService.addTaskToExecute(puttingTask);
DataLog takingTask = newTask(storage, storagePos,barcode);
takingTask.setType(StorageConstants.OP.REWARM_TAKING);
takingTask = dataLogDao.save(takingTask);
taskService.addTaskToExecute(takingTask);
}
} catch (ValidateException e) {
log.info(barcode.getBarcode() + "查找回温库位失败");
}
}
public DataLog newTask(Storage storage, StoragePos pos, Barcode barcode){
DataLog task = new DataLog();
task.setPartNumber(barcode.getPartNumber());
task.setBarcode(barcode.getBarcode());
task.setNum(barcode.getAmount());
task.setMemo(barcode.getMemo());
task.setStatus(StorageConstants.OP_STATUS.WAIT.name());
task.setCid(storage.getCid());
task.setStorageId(storage.getId());
task.setStorageName(storage.getName());
task.setPosId(pos.getId());
task.setPosName(pos.getPosName());
return task;
}
}
......@@ -310,6 +310,7 @@ public class StorageDataController extends BaseController {
return "位置["+pid+"]不存在";
}
log.info("出库位置仓位【"+pos.getPosName()+"】");
String outResult = taskService.checkout(pos, subSourceId, isSingleOut);
if(!Strings.isNullOrEmpty(outResult)){
return "1"+outResult;
......@@ -468,14 +469,43 @@ public class StorageDataController extends BaseController {
*/
@RequestMapping(value = "/saveOp", method = RequestMethod.POST)
@ResponseBody
public void saveOp(HttpServletRequest request) {
public String saveOp(HttpServletRequest request) {
String cid = request.getParameter("cid");
if(!Strings.isNullOrEmpty(cid)){
String opKey = request.getParameter("opKey");
String opValue = request.getParameter("opValue");
log.info("界面执行操作:" + opKey +"=" + opValue);
addOp(cid,opKey,opValue);
return "OK"+getText("shelf.msg.opSucess",request.getLocale(),"操作成功");
}
return "";
}
/**
* 保存界面的一些操作
*/
@RequestMapping(value = "/modifyOrderNum", method = RequestMethod.POST)
@ResponseBody
public String modifyOrderNum(HttpServletRequest request) {
String orderNo = request.getParameter("orderNo");
String numStr = request.getParameter("num");
log.info("客户端执行修改工单["+orderNo+"]的数量:" + numStr );
try{
if(!Strings.isNullOrEmpty(orderNo) && !Strings.isNullOrEmpty(numStr)){
float numRate = Float.valueOf(numStr);
List<LiteOrderItem> items = liteOrderItemDao.findOrderItems(orderNo);
for (LiteOrderItem item : items) {
int needNum = item.getNeedNum();
Float newNeedNum = needNum * numRate;
item.setNeedNum(newNeedNum.intValue());
liteOrderItemDao.save(item);
}
return "0"+getText("shelf.msg.opSucess",request.getLocale(),"操作成功");
}
}catch (Exception e){
log.error("修改工单数量出错",e);
}
return "1"+getText("errors.float",new String[]{""},request.getLocale(),"必须为float类型");
}
/**
......
......@@ -81,7 +81,7 @@ public class TaskService implements ITaskService {
//private static Map<String, DataLog> executingTaskMap = Maps.newConcurrentMap();
/**
* 完成的任务列表Key 为 ReelId 即 barcode, Value 为 Datalog
* 完成的任务列表Key 为 ReelId 即 barcode, Value 为 Datalog
*/
private static Map<String,DataLog> finishedTaskMap = Maps.newConcurrentMap();
......@@ -146,6 +146,29 @@ public class TaskService implements ITaskService {
return resultTasks;
}
/**
* 更新条码为锡膏条码
* @param barcode
* @return
*/
private Barcode updateToSolderBarcode(Barcode barcode, int weight) throws ValidateException {
Component component = componentManager.findByPartNumber(barcode.getPartNumber());
if(!component.isSolder()){
component.setType(StorageConstants.COMPONENT_TYPE.SOLDERPASTE);
//搅拌时间默认为3分钟即180秒
component.setMixTime(0);
//回温时间默认为8小时
component.setWarmTime(8);
component.setAmount(1);
component = componentManager.save(component);
}
barcode.setAmount(weight);
barcode.setType(component.getType());
barcode.setWarmTime(component.getWarmTime());
barcode.setMixTime(component.getMixTime());
barcode = barcodeManager.save(barcode);
return barcode;
}
/**
* 流水线入库:优先查找空闲BOX中同尺寸的,如果找不到,再查找可入库 BOX(可用且不是出库状态) 同尺寸或比盘尺寸大的仓位
......@@ -154,6 +177,13 @@ public class TaskService implements ITaskService {
try {
String barcode = statusBean.getCode();
Barcode barcodeSave = resolveBarcode(barcode);
if(storage.isSolderPaste()){
int weight = statusBean.getWeight();
//锡膏料仓,修改类型
barcodeSave = updateToSolderBarcode(barcodeSave,weight);
}
verifyBarcodePutIn(Lists.<Storage>newArrayList(storage),barcodeSave);
int w = barcodeSave.getPlateSize();
......@@ -230,7 +260,7 @@ public class TaskService implements ITaskService {
String posId = storagePos.getPosName();
int plateW = barcodeSave.getPlateSize();
int plateH = barcodeSave.getHeight();
statusBean.addPosInfo(posId,plateW,plateH,false);
statusBean.addPosInfo(barcode, posId,plateW,plateH,false);
log.info(barcode+"["+plateW+"x"+plateH + "]开始入库到"+storage.getCid()+"["+posId+"]");
//清空展示的消息
......@@ -466,7 +496,7 @@ public class TaskService implements ITaskService {
if(statusBean.isBoxCanPutIn(inBoxId)){
ArrayList<Integer> boxIds = Lists.newArrayList();
boxIds.add(inBoxId);
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, boxIds , operatingPosIds);
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode , operatingPosIds);
}else{
//throw new ValidateException(storage.getName() + "的 BOX-"+codeBoxId+" 不可用");
throw new ValidateException("error.storage.unavailable",new String[]{storageCid+"-"+codeBoxId},storage.getName() + "的 BOX-"+codeBoxId+" 不可用");
......@@ -483,7 +513,7 @@ public class TaskService implements ITaskService {
if (!idleBoxIds.isEmpty()) {
log.info("从"+storage.getName()+" 中为"+barcode.getBarcode()+"寻找空的仓位");
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, idleBoxIds, operatingPosIds);
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds);
}
//没有空闲的 BOX或者查找到的仓位与料盘的尺寸不是最匹配的,查找所有可以入库的 BOX,
......@@ -505,12 +535,12 @@ public class TaskService implements ITaskService {
int randomIndex = RandomUtils.nextInt(availbleBoxCount);
Integer boxId = canPutInBoxIds.get(randomIndex);
log.info("从"+storage.getName()+"随机到BOX["+boxId+"]为"+barcode.getBarcode()+"寻找空的仓位");
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, Lists.newArrayList(boxId), operatingPosIds);
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds);
}
if(storagePos == null){
log.info("从"+storage.getName()+"中为"+barcode.getBarcode()+"寻找空的仓位");
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, canPutInBoxIds, operatingPosIds);
storagePos = storagePosManager.getEmptyPosByStorage(storage, barcode, operatingPosIds);
}
}
......@@ -565,7 +595,7 @@ public class TaskService implements ITaskService {
}else{
log.warn("出库无料仓位"+storage.getName()+"["+posName+"]");
}
statusBean.addPosInfo(posName,plateW,plateH, isSingleOut);
statusBean.addPosInfo(task.getBarcode(), posName,plateW,plateH, isSingleOut);
log.info("出库"+storage.getName()+"["+posName+"]物料["+task.getBarcode()+"]"+isSingleOut+"发送到客户端" + cid);
}
}
......@@ -710,13 +740,16 @@ public class TaskService implements ITaskService {
}
int checkoutSize = 0;
for(DataLog task : taskMap.values()){
if(!task.isCheckOutTask()){
continue;
}
//如果该BOX在已执行任务中已经有入库任务,不再分配直接返回
if(cid.equals(task.getCid()) && task.isExecuting()){
if(task.isPutInTask()){
log.error("cid["+cid + "]box["+boxId+"]已有入库任务,不可再分配出库任务");
return null;
}else if(task.needReSendToClient()){//超过30秒仍未完成的出库再次发送到客户端
log.error("cid["+cid + "]的出库任务["+ task.getPosName()+"]超过30秒仍未完成,重新发送到客户端!");
}else if(task.needReSendToClient() && task.isCheckOutTask()){//超过30秒仍未完成的出库再次发送到客户端
log.error("cid["+cid + "]的出库任务["+ task.getPosName()+"]超过60秒仍未完成,重新发送到客户端!");
task.setUpdateDate(new Date());
return task;
}
......@@ -759,7 +792,8 @@ public class TaskService implements ITaskService {
//优先查找有库位信息的
Map<String,DataLog> partNumberTaskMap = new HashMap<>();
for (DataLog task : allTasks) {//分配任务
//只有等待或执行中的任务
//只有等待或执行中的出库任务
if(task.isCheckOutTask()){
if(task.isWait() || task.isExecuting()){
String posName = task.getPosName();
if(!Strings.isNullOrEmpty(posName)){//已经有位置信息的,分配到执行列表
......@@ -783,6 +817,8 @@ public class TaskService implements ITaskService {
}
}
}
if(!partNumberTaskMap.isEmpty()){
//排除掉正在执行的仓位
......@@ -914,6 +950,22 @@ public class TaskService implements ITaskService {
/**
* 根据回温取料任务查找回温放料任务
* @param rewarmTakingTask
* @return
*/
private DataLog findRewarmPuttingTask(DataLog rewarmTakingTask){
for (DataLog dataLog : taskMap.values()) {
if(dataLog.isRewarmPuttingTask()){
if(dataLog.getBarcode().equals(rewarmTakingTask.getBarcode())){
return dataLog;
}
}
}
return null;
}
/**
* 处理客户端发送上来的请求
*/
@Override
......@@ -935,6 +987,50 @@ public class TaskService implements ITaskService {
//清空 msg 的内容,因为客户端会据此决定命令是否执行
statusBean.setMsg("");
if(storage.isSolderPaste()){
if(statusBean.getStatus() == StorageConstants.STATUS.READY){
//锡膏料仓空闲
Collection<DataLog> areaWaitTasks = taskMap.values();
for (DataLog task : areaWaitTasks) {
if(cid.equals(task.getCid())&& task.isWait()){
if(task.isRewarmTakingTask()){
//回温取料任务
statusBean.setOp(StorageConstants.OP.REWARM_TAKING);
statusBean.addData("posId",task.getPosName());
DataLog rewarmPuttingTask = findRewarmPuttingTask(task);
statusBean.addData("secondPosId",rewarmPuttingTask.getPosName());
log.info(task.getBarcode() + "回温移库信息发送到客户端["+task.getPosName()+"]=>" + rewarmPuttingTask.getPosName());
rewarmPuttingTask.setStatus(StorageConstants.OP_STATUS.EXECUTING.name());
taskMap.put(rewarmPuttingTask.getId(), rewarmPuttingTask);
dataLogDao.save(rewarmPuttingTask);
task.setStatus(StorageConstants.OP_STATUS.EXECUTING.name());
taskMap.put(task.getId(), task);
dataLogDao.save(task);
return statusBean;
}else if(task.isMixTask()){
//搅拌任务
statusBean.setOp(StorageConstants.OP.MIX);
statusBean.addData("posId",task.getPosName());
statusBean.addData("barcode",task.getBarcode());
statusBean.addData("weight", task.getNum()+"");
statusBean.addData("mixTime", task.getMixTime() + "");
task.setStatus(StorageConstants.OP_STATUS.EXECUTING.name());
taskMap.put(task.getId(), task);
dataLogDao.save(task);
return statusBean;
}
}
}
}
}
//料柜
if(storage.isCabinet() || storage.isShelf() || storage.isAccShelf() || storage.isCodeShelf()){
String cardResult = statusBean.getFromData("cardResult");
......@@ -966,7 +1062,6 @@ public class TaskService implements ITaskService {
}
}
return statusBean;
}
......@@ -1132,20 +1227,168 @@ public class TaskService implements ITaskService {
}
} else if (StorageConstants.BOX_STATUS.OUT_END == status) {//出库完成(放到仓门口
//暂不处理
}else if(StorageConstants.BOX_STATUS.REWARM_TAKING_END == status){
//回温取料完成, 将库位清空
DataLog takingTask = findExecutingTask(statusBeanToSave.getCid(), boxStatus.getPosId());
if(takingTask == null){
//从已完成列表中找,如果还找不到就忽略
takingTask = findFinishedTask(statusBeanToSave.getCid(), boxStatus.getPosId());
}
if(takingTask != null){
if(takingTask.isCancel()){//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
log.warn(statusBeanToSave.getCid() + "回温取料[" + boxStatus.getPosId() + "]完成时任务不存在");
}
DataLog puttingTask = null;
for (DataLog dataLog : taskMap.values()) {
if (dataLog.getCid().equals(cid)) {
if(dataLog.getBarcode().equals(takingTask.getBarcode())){
if(dataLog.isRewarmPuttingTask()){
puttingTask = dataLog;
}
} catch (ValidateException e) {
log.error("更新状态时出错" + e.getMessage());
}
}
}
rewarmTakingEnd(takingTask);
if(puttingTask != null){
puttingTask.setStatus(StorageConstants.OP_STATUS.EXECUTING.name());
//dataLog.setSourceType();
dataLogDao.save(puttingTask);
taskMap.put(puttingTask.getId(), puttingTask);
statusBean.addData("secondPosId",puttingTask.getPosName());
}
}else{
log.warn(statusBeanToSave.getCid() + "出仓位[" + boxStatus.getPosId() + "]完成时任务不存在");
}
}else if(StorageConstants.BOX_STATUS.REWARM_PUTTING_END == status){
//回温放料结束
DataLog puttingTask = findExecutingTask(statusBeanToSave.getCid(), boxStatus.getPosId());
if(puttingTask == null){
//从已完成列表中找,如果还找不到就忽略
puttingTask = findFinishedTask(statusBeanToSave.getCid(), boxStatus.getPosId());
}
if(puttingTask != null) {
if (puttingTask.isCancel()) {//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
log.warn(statusBeanToSave.getCid() + "回温取料[" + boxStatus.getPosId() + "]完成时任务不存在");
}
}
rewarmPuttingEnd(puttingTask);
}else if(StorageConstants.BOX_STATUS.MIX_TAKING == status){
//搅拌取料
}else if(StorageConstants.BOX_STATUS.WAIT_MIX == status){
//搅拌取料结束,等待搅拌
}else if(StorageConstants.BOX_STATUS.MIXING == status){
//搅拌中
changeSolderStatus(boxStatus.getPosId(),StorageConstants.SOLDER_STATUS.MIXING);
}else if(StorageConstants.BOX_STATUS.MIX_PUTTING == status){
//搅拌完成
}else if(StorageConstants.BOX_STATUS.MIX_END == status){
//搅拌放回原位完成
DataLog mixTask = findExecutingTask(statusBeanToSave.getCid(), boxStatus.getPosId());
mixEnd(mixTask);
}
}
} catch (ValidateException e) {
log.error("更新状态时出错" + e.getMessage());
}
}
}
statusMap.put(cid, statusBean);
return statusBean;
}
private void changeSolderStatus(String posId, int solderStatus) throws ValidateException {
StoragePos storagePos = storagePosManager.get(posId);
Barcode barcode = storagePos.getBarcode();
if(barcode != null && barcode.getSolderStatus() != solderStatus){
barcode.setSolderStatus(solderStatus);
barcode = barcodeManager.save(barcode);
storagePos.setBarcode(barcode);
storagePosManager.save(storagePos);
}
}
private void mixEnd(DataLog mixTask) throws ValidateException {
if(mixTask != null){
log.info(mixTask.getBarcode() + "搅拌完成,送回原库位,更改状态为待出库");
taskMap.remove(mixTask.getId());
mixTask.setStatus(StorageConstants.OP_STATUS.FINISHED.name());
dataLogDao.save(mixTask);
finishedTaskMap.put(mixTask.getBarcode(),mixTask);
changeSolderStatus(mixTask.getPosId(),StorageConstants.SOLDER_STATUS.TO_BE_OUT);
}else{
log.error("搅拌完成时,未找到任务");
}
}
private void rewarmPuttingEnd(DataLog puttingTask) throws ValidateException {
//从队列里面移除操作
taskMap.remove(puttingTask.getId());
StoragePos storagePos = storagePosManager.get(puttingTask.getPosId());
if(storagePos.getBarcode() != null){
log.warn("任务:"+puttingTask.getId() +" 仓位:"+puttingTask.getPosId()+" 已有物料["+storagePos.getBarcode().getBarcode()+"], 之前可能处理过直接返回");
return;
}
//二维码状态
Barcode barcode = barcodeManager.findByBarcode(puttingTask.getBarcode());
barcode.setPosName(puttingTask.getPosName());
barcode.setStartWarmTime(System.currentTimeMillis());
barcode.setSolderStatus(StorageConstants.SOLDER_STATUS.REWARMING);
barcodeManager.save(barcode);
/**
* 仓位状态
*/
storagePos.setBarcode(barcode);
storagePos.setUsed(true);
storagePosManager.save(storagePos);
//更新缓存中的库存信息
dataCache.updateInventory(storagePos,barcode);
//记录日志,完成 task
puttingTask.setStatus(StorageConstants.OP_STATUS.FINISHED.name());
dataLogDao.save(puttingTask);
finishedTaskMap.put(puttingTask.getBarcode(),puttingTask);
}
/**
* 锡膏回温完成处理
*/
private void rewarmTakingEnd(DataLog task) throws ValidateException{
//从队列里面移除操作
taskMap.remove(task.getId());
StoragePos storagePos = storagePosManager.get(task.getPosId());
Barcode barcode = storagePos.getBarcode();
if(barcode == null){
log.warn("任务:"+task.getId() +" 仓位:"+task.getPosId()+" 的 Barcode 为null, 之前可能处理过直接返回");
return;
}
storagePos.setBarcode(null);
storagePos.setUsed(false);
storagePosManager.save(storagePos);
log.info("回温取料完成,清空仓位: " + storagePos.getId() + "[" + storagePos.getPosName() + "]");
//更新缓存中的库存信息
dataCache.updateInventory(storagePos,barcode);
//记录日志
task.setStatus(StorageConstants.OP_STATUS.FINISHED.name());
dataLogDao.save(task);
finishedTaskMap.put(task.getBarcode(),task);
}
private DataLog findFinishedTask(String cid, String posName){
Collection<DataLog> areaFinishedTasks = getFinishedTasks();
for (DataLog task : areaFinishedTasks) {
......@@ -1204,6 +1447,23 @@ public class TaskService implements ITaskService {
@Override
public synchronized String checkout(StoragePos pos, String subSourceId, boolean isSingleOut){
Barcode barcode = pos.getBarcode();
if(barcode != null){
if(barcode.isSolder()){
//锡膏出库
log.info("设置库位["+pos.getPosName()+"]中的锡膏["+barcode.getBarcode()+"]的出库时间为立即出库");
try {
barcode.setNeedOutDate(new Date());
barcode = barcodeManager.save(barcode);
pos.setBarcode(barcode);
storagePosManager.save(pos);
return "";
} catch (ValidateException e) {
e.printStackTrace();
}
}
}
Collection<DataLog> allTasks = taskMap.values();
for(DataLog taskInList : allTasks){
if(taskInList.getPosId() == null) continue;
......@@ -1355,7 +1615,8 @@ public class TaskService implements ITaskService {
}
}
private void addTaskToExecute(DataLog task) {
@Override
public void addTaskToExecute(DataLog task) {
String loginUser = StorageDataController.getLoginUsername();
task.setOperator(loginUser);
task = dataLogDao.save(task);
......@@ -1418,82 +1679,21 @@ public class TaskService implements ITaskService {
StoragePos storagePos = storagePosManager.get(task.getPosId());
//二维码状态
Barcode barcode = barcodeManager.findByBarcode(task.getBarcode());
if(StorageConstants.COMPONENT_TYPE.FIXTURE == barcode.getType()){//条码是夹具
//夹具编码,需要将相应的位置全部填上
String posLabel = storagePos.getLabelStr();
List<StoragePos> allPos = storagePosManager.findByLabel(storagePos.getStorageId(), posLabel);
List<String> relationCodeStrs = task.getRelationCodes();
log.info("夹具【"+task.getBarcode()+"】入库到["+posLabel+"]完成,夹具上物料条码:"+StringUtils.join(relationCodeStrs," , "));
//此夹具的可出库时间
long canCheckOutTime = 0;
List<Barcode> relationBarcodes = Lists.newArrayList();
long now = System.currentTimeMillis();
for (String relationCodeStr : relationCodeStrs) {
Barcode relationBarcode = barcodeManager.findByBarcode(relationCodeStr);
//入库时间,如果之前已入过库是不会更改的
relationBarcode.setPutInTime(now);
relationBarcode.setInOpor(task.getOperator());
long reachWarmTime = relationBarcode.getReachWarmTime();
if(reachWarmTime > canCheckOutTime){
canCheckOutTime = reachWarmTime;
}
relationBarcodes.add(relationBarcode);
}
int relationCount = relationBarcodes.size();
for (int i = 0; i < allPos.size(); i++) {
StoragePos componentPos = allPos.get(i);
Barcode componentBarcode = new Barcode();
if(i < relationCount){//夹具上有料
componentBarcode = relationBarcodes.get(i);
componentBarcode.setInFixture(barcode.getBarcode());
componentBarcode.setUsedCount(barcode.getUsedCount() + 1);
componentBarcode.setPutInTime(now);
componentBarcode.setInOpor(task.getOperator());
componentBarcode.setPosName(task.getPosName());
//入库后设置出库时间为-1
componentBarcode.setCheckOutDate(null,"");
barcodeManager.save(componentBarcode);
}else{
componentBarcode.setFixtureNumber(barcode.getPartNumber());
componentBarcode.setInFixture(barcode.getBarcode());
componentBarcode.setType(barcode.getType());
componentBarcode.setBarcode(barcode.getBarcode());
componentBarcode.setPutInTime(now);
componentBarcode.setInOpor(task.getOperator());
componentBarcode.setPartNumber(barcode.getPartNumber());
componentBarcode.setInitialAmount(1);
componentBarcode.setAmount(1);
}
/**
* 仓位状态
*/
//更新缓存中的库存信息
int stockReel = dataCache.updateInventory(storagePos,componentBarcode);
//dataCache.updateStorage(task.getCid());
log.info("入库"+componentBarcode.getPartNumber()+"["+componentBarcode.getBarcode()+"]当前库存:"+stockReel+"到"+componentPos.getPosName()+"可出库时间:"+new Date(canCheckOutTime));
componentPos.setBarcode(componentBarcode);
componentPos.setUsed(true);
componentPos.setCanCheckOutTime(canCheckOutTime);
storagePosManager.save(componentPos);
}
}else{//条码不是夹具
barcode.setUsedCount(barcode.getUsedCount() + 1);
barcode.setUsedDate(new Date());
barcode.setPutInTime(System.currentTimeMillis());
barcode.setInOpor(task.getOperator());
barcode.setCheckOutDate(null,"");
barcode.setPosName(task.getPosName());
if(barcode.isSolder()){
if(storagePos.isWarmPos()){
//回温仓位
barcode.setSolderStatus(StorageConstants.SOLDER_STATUS.RETREAT_STORAGE);
}else{
barcode.setSolderStatus(StorageConstants.SOLDER_STATUS.UNDER_REFRIGERATION);
}
barcode.setNeedOutDate(null);
}
if(Strings.isNullOrEmpty(barcode.getProviderNumber())){//补上供应商编号
Component component = componentManager.findByPartNumber(barcode.getPartNumber());
barcode.setProviderNumber(component.getProviderNumber());
......@@ -1518,7 +1718,6 @@ public class TaskService implements ITaskService {
if(storage != null){
postInNotification(dataCache.getSettings().getInNotifyApi(), task.getBarcode(), task.getStorageId());
}
}
//记录日志,完成 task
......
......@@ -3,6 +3,7 @@ package com.myproject.webapp.listener;
import com.myproject.api.OrderFileWatch;
import com.myproject.mina.TcpServer;
import com.myproject.webapp.controller.webService.ExpireMailUtil;
import com.myproject.webapp.controller.webService.MainTimer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.myproject.Constants;
......@@ -144,6 +145,9 @@ public class StartupListener implements ServletContextListener {
ExpireMailUtil mailUtil = (ExpireMailUtil) ctx.getBean("expireMailUtil");
mailUtil.init();
MainTimer mainTimer = (MainTimer) ctx.getBean("mainTimer");
mainTimer.init();
TcpServer tcpServer = (TcpServer) ctx.getBean("tcpServer");
tcpServer.init();
......
......@@ -359,6 +359,8 @@ shelf.nextPos.wrongSize=Next Position [{0}] size [{1}] is different from materia
order.out.set=set of materials
order.out.surplus=surplus material
order.inventory=inventory
order.num.modify=Order Qty Modify
order.modify.tip=Modify Qty to\: current quantity times
export.csv=Export to CSV
......@@ -406,3 +408,4 @@ error.barcode.errorSize=x The reel has no size.
error.storage.noPosFind=No availble position is found.
msg.line.putIn=Put [{0}] into [{1}]
delete.confirm=Are you sure to delete?
barcode.error.used=Barcode is used.
\ No newline at end of file
......@@ -367,6 +367,7 @@ delete.confirm=Are you sure to delete?
stroage.error.merge=Shelf location can not merge.
barcode.error.noRi=Barcode rule must has RI and PN fields.
barcode.error.notFound=Barcode is not found.
barcode.error.used=Barcode is used.
error.pos.inQueue=Failed\: The location [{0}] is in queue.
error.barcode.inQueue=Failed\: The barcode [{0}] is in queue.
error.barcode.empty=No barcode is scanned.
......@@ -401,3 +402,5 @@ shelf.nextPos.wrongSize=Next Position [{0}] size [{1}] is different from materia
shelf.nextPos.hasReel=Next Position [{0}] already has material, please scan a new position code.
settings.remind.title=Remind Setting
settings.remind.deadday=days dead metiral remind
order.num.modify=Order Qty Modify
order.modify.tip=Modify Qty to\: current quantity times
......@@ -397,3 +397,6 @@ shelf.nextPos.wrongSize=\u4E0B\u4E00\u5E93\u4F4D[{0}]\u5C3A\u5BF8[{1}]\u4E0E\u65
shelf.nextPos.hasReel=\u4E0B\u4E00\u5E93\u4F4D[{0}]\u5DF2\u6709\u7269\u6599,\u8BF7\u91CD\u65B0\u626B\u63CF\u5E93\u4F4D\u7801
settings.remind.title=\u63D0\u9192\u8BBE\u7F6E
settings.remind.deadday=\u5929\u524D\u5446\u6EDE\u7269\u6599\u63D0\u9192
barcode.error.used=\u5DF2\u88AB\u4F7F\u7528\u7684\u6761\u7801\u65E0\u6CD5\u5220\u9664
order.num.modify=\u5DE5\u5355\u6570\u91CF\u4FEE\u6539
order.modify.tip=\u4FEE\u6539\u5DE5\u5355\u6570\u91CF\u4E3A\: \u5F53\u524D\u6570\u91CF x
\ No newline at end of file
......@@ -397,3 +397,6 @@ shelf.nextPos.wrongSize=\u4E0B\u4E00\u5E93\u4F4D[{0}]\u5C3A\u5BF8[{1}]\u4E0E\u65
shelf.nextPos.hasReel=\u4E0B\u4E00\u5E93\u4F4D[{0}]\u5DF2\u6709\u7269\u6599,\u8BF7\u91CD\u65B0\u626B\u63CF\u5E93\u4F4D\u7801
settings.remind.title=\u63D0\u9192\u8BBE\u7F6E
settings.remind.deadday=\u5929\u524D\u5446\u6EDE\u7269\u6599\u63D0\u9192
barcode.error.used=\u5DF2\u88AB\u4F7F\u7528\u7684\u6761\u7801\u65E0\u6CD5\u5220\u9664
order.num.modify=\u5DE5\u5355\u6570\u91CF\u4FEE\u6539
order.modify.tip=\u4FEE\u6539\u5DE5\u5355\u6570\u91CF\u4E3A\: \u5F53\u524D\u6570\u91CF x
\ No newline at end of file
......@@ -156,13 +156,20 @@
<div class="form-group">
<label class="control-label col-md-2"><fmt:message key="solder.maxStorageTime"/> </label>
<%--<label class="control-label col-md-2"><fmt:message key="solder.maxStorageTime"/> </label>--%>
<%--<div class="col-md-3">--%>
<%--<div style="text-align:left" class="input-group">--%>
<%--<form:input type="text" id="maxStorageTime" path="maxStorageTime" class="form-control"/>--%>
<%--<span class="input-group-addon"><fmt:message key="solder.hour"/></span>--%>
<%--</div>--%>
<%--</div>--%>
<label class="control-label col-md-2"><fmt:message key="搅拌时间"/> </label>
<div class="col-md-3">
<div style="text-align:left" class="input-group">
<form:input type="text" id="maxStorageTime" path="maxStorageTime" class="form-control"/>
<span class="input-group-addon"><fmt:message key="solder.hour"/></span>
<form:input type="text" id="mixTime" path="mixTime" class="form-control"/>
<span class="input-group-addon"><fmt:message key=""/></span>
</div>
</div>
<label class="control-label col-md-2"><fmt:message key="solder.warmTime"/></label>
......
......@@ -178,13 +178,13 @@
<display:column property="barcode.provider" titleKey="barcode.provider"/>
<display:column titleKey="inOutList.type">
<c:if test="${pos.barcode.type == 0 || empty pos.barcode.type}"><fmt:message key="inOutList.type.component"/></c:if>
<c:if test="${pos.barcode.type == 1}"><fmt:message key="inOutList.type.solder"/></c:if>
<c:if test="${pos.barcode.type == 2}"><fmt:message key="inOutList.type.pcb"/></c:if>
<c:if test="${pos.barcode.type == 3}"><fmt:message key="inOutList.type.others"/></c:if>
<c:if test="${pos.barcode.type == 4}"><fmt:message key="inOutList.type.fixture"/></c:if>
</display:column>
<%--<display:column titleKey="inOutList.type">--%>
<%--<c:if test="${pos.barcode.type == 0 || empty pos.barcode.type}"><fmt:message key="inOutList.type.component"/></c:if>--%>
<%--<c:if test="${pos.barcode.type == 1}"><fmt:message key="inOutList.type.solder"/></c:if>--%>
<%--<c:if test="${pos.barcode.type == 2}"><fmt:message key="inOutList.type.pcb"/></c:if>--%>
<%--<c:if test="${pos.barcode.type == 3}"><fmt:message key="inOutList.type.others"/></c:if>--%>
<%--<c:if test="${pos.barcode.type == 4}"><fmt:message key="inOutList.type.fixture"/></c:if>--%>
<%--</display:column>--%>
<display:column property="barcode.barcode" titleKey="barcode.barcode" sortable="true" sortProperty="barcode.barcode"/>
<display:column property="barcode.msl" titleKey="component.msl" sortable="true" sortProperty="barcode.msl"/>
<%--<display:column property="barcode.inFixture" titleKey="storagePosFind.inFixture"/>--%>
......@@ -295,7 +295,7 @@
<c:if test="${pos.barcode.type == 1 && pos.barcode.maxStorageTime != 0 && pos.inStoreHour >= pos.barcode.maxStorageTime}">
<c:set var="alarmClass" value="alarmItem"/>
</c:if>
<c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.maxStorageTime != 0 && pos.inStoreHour * 60 + pos.inStoreMiniute <= pos.barcode.warmTime * 60)}"/>
<c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.solder && pos.barcode.solderStatus >= 5)}"/>
<display:column title="<input type='checkbox' id='allCheck'/>">
<c:if test="${!limitCheckOut}">
<input type="checkbox" name="posIds" value="${pos.id}" id="check${pos.id}" class="limit${pos.barcode.inFixture}"/>
......
......@@ -151,8 +151,8 @@
<%--<span><fmt:message key="allBoxView.kanban"/></span>--%>
<%--<span style="margin-left: 40px;" id="storageTotalPos">总容量:1000</span>--%>
<div class="col-md-6">
<button class="btn yellow outBtn" id="outPn"><i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
<button class="btn yellow outBtn" id="outOrder"><i class="fa fa-sign-out"></i><fmt:message key="menu.order"/></button>
<button class="btn yellow outBtn" id="outPn"><i class="fa fa-upload"></i><fmt:message key="button.checkout"/></button>
<button class="btn yellow outBtn" id="outOrder"><i class="fa fa-folder"></i><fmt:message key="menu.order"/></button>
</div>
<div class="col-md-6">
<div id="lineMsg"></div>
......@@ -181,6 +181,10 @@
<c:if test="${storage.virtual}">
<c:set var="detailUrl" value="${ctx}/storage/virtual/${storage.cid}"/>
</c:if>
<c:if test="${storage.solderPaste}">
<c:set var="detailUrl" value="${ctx}/storage/solder/${storage.cid}"/>
</c:if>
<div class="portlet box green-haze tasks-widget">
<c:choose>
<c:when test="${storage.shelf || storage.cabinet || storage.accShelf || storage.virtual || storage.codeShelf}">
......@@ -257,7 +261,7 @@
</div>
<div class="modal-footer">
<div id="footerBtn">
<a href="" class="btn yellow left" id="findAndOut"><i class="fa fa-sign-out"></i><fmt:message key="allBoxView.findAndOut"/></a>
<a href="" class="btn yellow left" id="findAndOut"><i class="fa fa-upload"></i><fmt:message key="allBoxView.findAndOut"/></a>
</div>
<%--<button type="button" data-dismiss="modal" class="btn default" id="cancelAuthBtn">取消</button>--%>
</div>
......@@ -296,8 +300,9 @@
<h4 class="modal-title" style="margin:10px;">
<span id="orderDetailTitle">&nbsp</span>
<span class="right" style="margin-right: 40px;">
<button class="btn yellow" onclick="outLiteOrder(true)"><i class="fa fa-sign-out"></i><fmt:message key="order.out.set"/></button>
<button class="btn yellow" onclick="outLiteOrder(false)"><i class="fa fa-sign-out"></i><fmt:message key="order.out.surplus"/></button>
<button class="btn yellow" id="showModifyOrder"><i class="fa fa-pencil"></i><fmt:message key="order.num.modify"/></button>
<button class="btn yellow" onclick="outLiteOrder(true)"><i class="fa fa-suitcase"></i><fmt:message key="order.out.set"/></button>
<button class="btn yellow" onclick="outLiteOrder(false)"><i class="fa fa-folder-open"></i><fmt:message key="order.out.surplus"/></button>
</span>
</h4>
<input type="text" class="form-control filterInput" id="searchOrderItemPn"/>
......@@ -337,6 +342,31 @@
</div>
</div>
<div id="modifyOrderNum" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 800px; margin-top: 10%;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" style="font-weight: 500;"><span id="reelCode"></span><fmt:message key="order.num.modify"/></h4>
</div>
<div class="modal-body" style="height: 90px;">
<div class="row">
<div class="form-group form-inline">
<div class="input-group margin-top-10">
<span class="input-group-addon"><fmt:message key="order.modify.tip"/></span>
<input class="input-small form-control" autocomplete="off" type="text" id="orderNumRate">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn default"><fmt:message key="button.cancel"/></button>
<button type="button" class="btn green" id="confirmOrderNumBtn"><fmt:message key="button.save"/></button>
</div>
</div>
</div>
</div>
<div id="modifyNum" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 800px; margin-top: 10%;">
<div class="modal-content">
......@@ -459,12 +489,19 @@
$.post("${ctx}/service/store/orderDetail", {orderNo: orderNo}, function (order) {
var itemHtml = "";
var data = order.orderItems;
if(order.new){
//可以修改数量
$("#showModifyOrder").show();
}else{
$("#showModifyOrder").hide();
}
var table = $('#orderItemsTable').DataTable();
table.clear();
for(var i in data){
var opStr = '<button class="btn yellow" onclick="checkoutByPartNumber(\''+data[i].pn+'\',\''+data[i].id+'\');"><i class="fa fa-sign-out"></i>补料</button>';
var opStr = '<button class="btn yellow" onclick="checkoutByPartNumber(\''+data[i].pn+'\',\''+data[i].id+'\');"><i class="fa fa-upload"></i>补料</button>';
if(data[i].inventoryNum <= 0 || data[i].outFinished ){
//已出完或库存不足
opStr = "";
......@@ -543,16 +580,6 @@
});
}
outLiteOrder = function(outBom){
var orderNo = $("#orderDetailTitle").text();
$.post("${ctx}/service/store/outLiteOrder.html", {orderNo: orderNo, outBom: outBom}, function (data) {
showMsg(data);
waitting();
});
}
waitting = function(){
Metronic.blockUI({
iconOnly: true,
......@@ -664,9 +691,9 @@
options['barcode'] = barcode;
options['num'] = data[item].num;
options['icon']='fa fa-database';
options['icon']='fa fa-download';
if(data[item].type == 2){//出库
options['icon']='fa fa-sign-out';
options['icon']='fa fa-upload';
showStr = partNumber + "["+barcode+"]${out_label}" + posStr;
}else{
options['onClick']= modifyClick;
......@@ -745,7 +772,6 @@
}
function getItemBar(w,h,usedCount,idleCount){
var totalCount = usedCount + idleCount;
var usedPercent = 0;
......@@ -992,6 +1018,36 @@
}
//工单信息
$("#showModifyOrder").click(function(){
window.setTimeout(function() {
$("#orderNumRate")[0].focus();
$("#orderNumRate").select();
}, 500);
$("#modifyOrderNum").modal("show");
});
$("#confirmOrderNumBtn").click(function(){
var orderNo = $("#orderDetailTitle").text();
var num = $("#orderNumRate").val();
$.post("${ctx}/service/store/modifyOrderNum", {orderNo: orderNo, num: num}, function (data) {
showMsg(data);
if (data.indexOf("OK") == 0) {
$("#orderNumRate").val("");
$("#modifyOrderNum").modal("hide");
showOrderDetail(orderNo);
}
});
});
outLiteOrder = function(outBom){
var orderNo = $("#orderDetailTitle").text();
$.post("${ctx}/service/store/outLiteOrder.html", {orderNo: orderNo, outBom: outBom}, function (data) {
showMsg(data);
waitting();
});
}
var orderWindows = {};
flushLiteOrders = function(){
$.post("${ctx}/service/store/liteOrderTask", {}, function (data) {
......
<%@ page import="com.myproject.util.StorageConstants" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<style type="text/css">
.box{
margin-top: 10px;
}
.alert{
padding:8px;
}
.sm-btn-box{
margin-left:10px;
}
.partnumber-box{
height: 100px;text-align: center;
padding-top:35px;
margin-bottom:10px;
font-size: 16px;
vertical-align: middle;
word-wrap:break-word ;
cursor: pointer;
}
.table-scrollable{
overflow-y: auto;
}
.statusMsg{
background-color: #FFFFFF;
margin: 0px 10px;
padding: 10px;
text-align: center;
}
#clientMsg{
margin-left: 30px;
font-size: 18px;
color: #ff5500;
text-align: center;
}
#smdstatus{
line-height: 80px;
font-size: 30px;
}
.red{
color:red;
}
.green{
color:green;
}
</style>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<%--<div class="row" id="codeBox">--%>
<%--<div class="col-md-6 col-sm-6">--%>
<%--<input type="text" class="form-control" id="scan-code"/>--%>
<%--</div>--%>
<%--<div class="col-md-6 col-sm-6">--%>
<%--<div class="alert alert-success" id="msg">&nbsp;--%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
<div class="statusMsg">
<div id="smdstatus"></div>
<div id="clientMsg"></div>
</div>
<div class="row">
<div class="col-md-4">
<div class="input-group date form_datetime" data-date="">
<input type="text" size="16" readonly class="form-control" id="outDate">
<span class="input-group-btn">
<button class="btn default date-reset" type="button"><i class="fa fa-times"></i></button>
</span>
<span class="input-group-btn">
<button class="btn default date-set" type="button"><i class="fa fa-calendar"></i></button>
</span>
<span class="input-group-btn">
<button class="btn yellow" id="checkoutBtn">
<i class="fa fa-sign-out"></i><fmt:message key="storagePosFind.outSelect"/></button>
</span>
</div>
<!-- /input-group -->
</div>
<div class="col-md-8">
<button class="btn yellow right sm-btn-box" id="openDoor" ><fmt:message key="开门"/></button>
<button class="btn yellow right sm-btn-box" id="closeDoor"><fmt:message key="关门"/></button>
</div>
<div class="col-md-12 col-sm-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
${storage.name}
</div>
<div class="actions">
<%--<button type="button" class="btn btn-fit-height yellow" onclick="showPartNumbers();">--%>
<%--<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/>--%>
<%--</button>--%>
</div>
</div>
<div class="portlet-body">
<div class="table-scrollable" style="height:400px;">
<table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info">
<thead>
<tr role="row">
<th></th>
<th><fmt:message key="barcode.barcode"/></th>
<th><fmt:message key="barcode.partNumber"/></th>
<th><fmt:message key="重量(克)"/></th>
<th><fmt:message key="checkOut.pos"/></th>
<th><fmt:message key="dataLog.status"/></th>
<th><fmt:message key="预计出库时间"/></th>
<%--<th><fmt:message key="状态"/></th>--%>
<%--<th><fmt:message key="dataLog.date"/></th>--%>
</tr>
</thead>
<tbody class="dataTable">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tbody>
</table>
</div>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<div class="row">
<div class="form-group">
</div>
</div>
<fmt:message key="storage.status" var="currentStatus"/>
<fmt:message key="storage.status.1" var="status_1"/>
<fmt:message key="storage.status.2" var="status_2"/>
<fmt:message key="storage.status.3" var="status_3"/>
<fmt:message key="storage.status.4" var="status_4"/>
<fmt:message key="storage.status.5" var="status_5"/>
<fmt:message key="storage.status.6" var="status_6"/>
<fmt:message key="storage.status.7" var="status_7"/>
<fmt:message key="storage.status.8" var="status_8"/>
<fmt:message key="storage.status.9" var="status_9"/>
<fmt:message key="storage.status.10" var="status_10"/>
<fmt:message key="storage.status.11" var="status_11"/>
<fmt:message key="storage.status.12" var="status_12"/>
<fmt:message key="storage.status.13" var="status_13"/>
<fmt:message key="回温取料中" var="status_14"/>
<fmt:message key="回温取料完成" var="status_15"/>
<fmt:message key="回温放料中" var="status_16"/>
<fmt:message key="回温放料完成" var="status_17"/>
<fmt:message key="搅拌取料中" var="status_18"/>
<fmt:message key="等待搅拌" var="status_19"/>
<fmt:message key="搅拌执行中" var="status_20"/>
<fmt:message key="搅拌完成回仓" var="status_21"/>
<fmt:message key="搅拌完成" var="status_22"/>
<fmt:message key="sotrage.status.999" var="status_999"/>
<fmt:message key="allBoxView.boxStatus" var="boxStatus_label"/>
<fmt:message key="inOutList.in" var="in_label"/>
<fmt:message key="inOutList.out" var="out_label"/>
<fmt:message key="dataLog.orderSource" var="source_label"/>
<fmt:message key="boxView.taskCancel" var="taskCancel_label"/>
<fmt:message key="boxView.taskExcuting" var="taskExcuting_label"/>
<fmt:message key="boxView.taskFinished" var="taskFinished_label"/>
<fmt:message key="boxView.taskWaiting" var="taskWaiting_label"/>
<fmt:message key="boxView.cancelTask" var="cancelTask_label"/>
<fmt:message key="冷藏中" var="solder_status_1"/>
<fmt:message key="回温中" var="solder_status_2"/>
<fmt:message key="待搅拌" var="solder_status_3"/>
<fmt:message key="搅拌中" var="solder_status_4"/>
<fmt:message key="待出库" var="solder_status_5"/>
<fmt:message key="出库中" var="solder_status_6"/>
<fmt:message key="退库存储" var="solder_status_7"/>
<c:set var="scripts" scope="request">
<script type="text/javascript">
Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, {
size: 'mini',
closeOnClick: false,
sound: false,
delay: false,
position: 'bottom right',
});
function showMsg(msg){
if(msg == ""){
$("#msg").attr("class","");
$("#msg").html("&nbsp;");
}else{
var error = true;
if(msg.indexOf("OK") == 0){
error = false;
msg = msg.substr(2);
}
if(msg.indexOf("0") == 0){
error = false;
msg = msg.substr(1);
}
if(msg.indexOf("x") == 0){
msg = msg.substr(1);
}
if(msg.indexOf("putIn") == 0){
error = false;
msg = "&nbsp;";
}
if(error){
$("#msg").attr("class","alert alert-danger");
}else{
$("#msg").attr("class","alert alert-success");
}
$("#msg").html(msg);
}
}
var solderStatusMsg={
"1":"${solder_status_1}",
"2":"${solder_status_2}",
"3":"${solder_status_3}",
"4":"${solder_status_4}",
"5":"${solder_status_5}",
"6":"${solder_status_6}",
"7":"${solder_status_7}"
};
listNotEmpty = function(){
var str= "";
$("[name=posIds]").each(function(){
if($(this).attr("checked")){
str+=$(this).val()+";";
}
});
if(str != "") {
//有选择的暂时不刷新
return;
}
$.post("${ctx}/service/store/solder/listNotEmpty", {cid: '${show}'}, function (data) {
$(".dataTable").html("");
for(var item in data){
var checkBox = "<input type='checkbox' value='"+data[item].id+"' name='posIds' />";
var barcodeObj = data[item].barcode;
var needOutDateStr = barcodeObj.needOutDateStr;
if(needOutDateStr != ''){
checkBox = "";
}
var partNumber = data[item].barcode.partNumber;
var weight = data[item].barcode.amount;
var posStr = data[item].posName;
var statusStr = solderStatusMsg[barcodeObj.solderStatus];
var tdStr =
"<td>"+checkBox+"</td>" +
"<td>"+barcodeObj.barcode+"</td>"+
"<td>"+partNumber+"</td>"+
"<td>"+weight+"</td>" +
"<td>"+posStr+"</td>" +
"<td>"+statusStr+"</td>" +
"<td>"+needOutDateStr+"</td>";
var trStr = "<tr>" + tdStr+ "</tr>";
$(".dataTable").append(trStr);
}
});
}
$("#checkoutBtn").click(function(){
var str= "";
$("[name=posIds]").each(function(){
if($(this).attr("checked")){
str+=$(this).val()+";";
$(this).removeAttr("checked");
}
});
if(str != "") {
checkout(str);
}else{
alert("请勾选");
}
});
function checkout(posId) {
var ids = posId.split(";");
var dateStr = $("#outDate").val();
$.post("${ctx}/service/store/solder/outSolder", {pids: posId, outDate:dateStr}, function (data) {
alert(data);
});
}
cancelTask = function(taskToClose){
Lobibox.confirm({
title: "${msg_title}",
msg: "${cancel_msg}",
callback: function ($this, type, ev) {
if(type == 'yes'){
$.post("${ctx}/service/store/cancelTask", {tid: taskToClose.$options["taskId"]}, function (data) {
if(data){
Lobibox.alert(success, //AVAILABLE TYPES: "error", "info", "success", "warning"
{
msg: "${cancelFinished_msg}"
});
}
});
}
}
});
};
$(".sm-btn-box").click(function(){
if($(this).css("cursor") == "pointer"){
var opKey = $(this).attr("id");
$.post("${ctx}/service/store/saveOp", {opKey: opKey, cid: '${show}', opValue:'doit'}, function (data) {
waitting();
});
}
});
var allTasks = {};
function updateTasks(){
//任务列表
$.post("${ctx}/service/store/tasks", {cid: '${show}'}, function (data) {
var newTasks = [];
var cidTasks = allTasks["all"];
if(!cidTasks){
cidTasks={};
}
for(var item in data){
var taskId = data[item].id;
var partNumber = data[item].partNumber;
var posStr = data[item].posStr;
var barcode = data[item].barcode
newTasks.push(taskId);
var options = {};
//入库
var showStr = posStr+"${in_label}"+ partNumber + "["+barcode+"]";
var status = data[item].status.toLowerCase();
options['status'] = status;
options['showClass'] = 'label-'+status;
options['taskId'] = taskId;
options['barcode'] = barcode;
options['num'] = data[item].num;
options['icon']='fa fa-database';
if(data[item].type == 2){//出库
options['icon']='fa fa-sign-out';
showStr = posStr+"${out_label}"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 6){//回温取料
options['icon']='fa fa-sign-out';
showStr = posStr+"回温取料"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 7){//出库
showStr = posStr+"回温放料"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 8){//出库
showStr = posStr+"搅拌"+ partNumber + "["+barcode+"]";
}else{
//options['onClick']= modifyClick;
}
//options['onClick']= modifyClick;
var statusMsg ="["+status+"]";
var operate = '';
if(data[item].cancel){
statusMsg ="[${taskCancel_label}]";
} else if(data[item].executing){
statusMsg ="[${taskExcuting_label}]";
options['onClose']= cancelTask;
operate = '<a class="btn btn-xs default" href="#" onclick=cancelTask('+data[item].id+');><i class="fa fa-trash-o"></i> ${cancelTask_label} </a>';
}else if(data[item].finished){
statusMsg ="[${taskFinished_label}]";
}else if(data[item].wait){
statusMsg ="[${taskWaiting_label}]";
options['onClose']=cancelTask;
operate = '<a class="btn btn-xs default" href="#" onclick=cancelTask('+data[item].id+');><i class="fa fa-trash-o"></i> ${cancelTask_label} </a>';
}else{
options['onClose']=hideTask;
}
var sourceStr = "";
if(data[item].sourceName){
sourceStr = "<br/>${source_label} " + data[item].sourceStr;
}
options['msg']= showStr + statusMsg + sourceStr;
var task = cidTasks[taskId];
if(!task){
cidTasks[taskId] = Lobibox.notify('success', options);
}else{
if(status != task.$options["status"]){
task.remove();
delete cidTasks[taskId];
cidTasks[taskId] = Lobibox.notify('success', options);
}
}
}
for(var taskKey in cidTasks){
if(newTasks.indexOf(taskKey) < 0){
var task = cidTasks[taskKey];
task.remove();
delete cidTasks[taskKey];
}
}
allTasks["all"] = cidTasks;
});
}
var statusMsg={
"1":"${status_1}",
"2":"${status_2}",
"3":"${status_3}",
"4":"${status_4}",
"5":"${status_5}",
"6":"${status_6}",
"7":"${status_7}",
"8":"${status_8}",
"9":"${status_9}",
"10":"${status_10}",
"11":"${status_11}",
"12":"${status_12}",
"13":"${status_13}",
"14":"${status_14}",
"15":"${status_15}",
"16":"${status_16}",
"17":"${status_17}",
"18":"${status_18}",
"19":"${status_19}",
"20":"${status_20}",
"21":"${status_21}",
"22":"${status_22}",
"999":"${status_999}"
};
function flushStatus(){
$.get('${ctx}/service/store/status?cid=${show}', function (statusBean) {
if(statusBean && statusBean.boxStatus["1"]){
var statusTxt = statusMsg[statusBean.boxStatus["1"].status];
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
var color = "green";
if(statusBean.status == 2 || statusBean.status == 3 || statusBean.status == 4 || statusBean.status == 5){
color = "red";
}
$("#smdstatus").attr("class","smdstatus " + color);
$("#clientMsg").html(statusBean.msg);
}else{
var statusTxt = statusMsg["999"];
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
$("#smdstatus").attr("class","smdstatus red");
$("#clientMsg").html("");
}
});
}
//updateTasks('${show}',-10*60);
updateTasks();
listNotEmpty();
setInterval(function(){
flushStatus();
updateTasks();
listNotEmpty();
}, 2000);
waitting = function(){
Metronic.blockUI({
iconOnly: true,
overlayColor: '#4b8df8'
});
window.setTimeout(function() {
Metronic.unblockUI();
}, 1500);
}
</script>
</c:set>
\ No newline at end of file
......@@ -278,6 +278,7 @@
<thead>
<tr role="row">
<th><fmt:message key="storagePos.name"/></th>
<th><fmt:message key="是否是回温库位"/></th>
<th><fmt:message key="storage.enable"/></th>
<th><fmt:message key="storagePos.priority"/></th>
<th><fmt:message key="storage.posSize"/></th>
......@@ -301,6 +302,11 @@
<c:out value="${slot.posName}"/>
</a>
</td>
<td>
<c:out value="${slot.warmPos}"/>
</td>
<td id="td${slot.id}">
<c:if test="${!slot.enabled}">
<fmt:message key="storage.enable.yes"/>[
......
......@@ -9,7 +9,13 @@
<fmt:message key="checkoutSettings.title"/>
</h3>
<style type="text/css">
.radioLabel{
margin-bottom: 12px !important;
font-size: 20px;
}
</style>
<div class="row">
<div class="col-md-12">
......@@ -30,11 +36,11 @@
<div class="form-group">
<div class="input-group">
<div class="icheck-list">
<label><form:radiobutton path="outType" class="icheck" value="EXPIRE_FIRST"/> <fmt:message key="checkoutSettings.mode.expireFirst"/></label>
<label><form:radiobutton path="outType" class="icheck" value="EFFICIENCY"/> <fmt:message key="checkoutSettings.mode.efficiency"/></label>
<label><form:radiobutton path="outType" class="icheck" value="FIFO"/> <fmt:message key="checkoutSettings.mode.fifo"/></label>
<label><form:radiobutton path="outType" class="icheck" value="USED_FIRST"/> <fmt:message key="checkoutSettings.mode.usedFirst"/></label>
<label><form:radiobutton path="outType" class="icheck" value="PRODUCE_DATE"/> <fmt:message key="checkoutSettings.mode.produceDate"/></label>
<label class="radioLabel"><form:radiobutton path="outType" class="icheck" value="EXPIRE_FIRST"/> <fmt:message key="checkoutSettings.mode.expireFirst"/></label>
<label class="radioLabel"><form:radiobutton path="outType" class="icheck" value="EFFICIENCY"/> <fmt:message key="checkoutSettings.mode.efficiency"/></label>
<label class="radioLabel"><form:radiobutton path="outType" class="icheck" value="FIFO"/> <fmt:message key="checkoutSettings.mode.fifo"/></label>
<label class="radioLabel"><form:radiobutton path="outType" class="icheck" value="USED_FIRST"/> <fmt:message key="checkoutSettings.mode.usedFirst"/></label>
<label class="radioLabel"><form:radiobutton path="outType" class="icheck" value="PRODUCE_DATE"/> <fmt:message key="checkoutSettings.mode.produceDate"/></label>
</div>
</div>
</div>
......
......@@ -29,28 +29,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxrs:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.2.1" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.1.0" level="project" />
<orderEntry type="library" name="Maven: javax.ws.rs:javax.ws.rs-api:2.0" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.0.1" level="project" />
<orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
<orderEntry type="library" name="Maven: asm:asm:3.3.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.0.1" level="project" />
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.0.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.10-b140310.1920" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.10-b140310.1920" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:4.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.1.6.RELEASE" level="project" />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!