Commit 88cfe62f LN

Merge remote-tracking branch 'origin/master'

2 个父辈 9d6a689a 30a75ffa
正在显示 27 个修改的文件 包含 239 行增加73 行删除
...@@ -309,6 +309,13 @@ public class AppendInfo { ...@@ -309,6 +309,13 @@ public class AppendInfo {
return getAction().contains("急料") || getAction().contains("指定") || getAction().contains("单独出库") || isCheckAction(); return getAction().contains("急料") || getAction().contains("指定") || getAction().contains("单独出库") || isCheckAction();
} }
public boolean isPnAction(){
if(action == null){
return false;
}
return getAction().contains("PN");
}
/** /**
* 盘点出库需求单 * 盘点出库需求单
*/ */
......
...@@ -264,9 +264,17 @@ public class InquiryShelfBean { ...@@ -264,9 +264,17 @@ public class InquiryShelfBean {
if(hSerial != null){ if(hSerial != null){
Map<String, ShelfInfo> shelfMap = hSerialShelfMap.get(hSerial); Map<String, ShelfInfo> shelfMap = hSerialShelfMap.get(hSerial);
if(shelfMap != null){ if(shelfMap != null){
List<ShelfInfo> shelfList = new ArrayList<>(shelfMap.values());
shelfList.sort(new Comparator<ShelfInfo>() {
@Override
public int compare(ShelfInfo o1, ShelfInfo o2) {
Integer index1 = o1.getRfidIndex();
Integer index2 = o2.getRfidIndex();
return index1.compareTo(index2);
}
});
ShelfInfo minIndexShelf = null; ShelfInfo minIndexShelf = null;
for (ShelfInfo shelf : shelfList) {
for (ShelfInfo shelf : shelfMap.values()) {
if(shelf.isFull()){ if(shelf.isFull()){
//已经放满,查找下一个 //已经放满,查找下一个
continue; continue;
...@@ -290,12 +298,24 @@ public class InquiryShelfBean { ...@@ -290,12 +298,24 @@ public class InquiryShelfBean {
log.error("任务条码["+task.getBarcode()+"]已无料架可放"); log.error("任务条码["+task.getBarcode()+"]已无料架可放");
return null; return null;
}else{ }else{
//这里判断是否有未绑定过的料架
boolean hasEmptyShelf = false;
for (String rfid : rfidList) {
ShelfInfo shelf = findShelfByRealRfid(rfid);
if(shelf == null){
hasEmptyShelf = true;
break;
}
}
if(hasEmptyShelf){
lockLoc = minIndexShelf.lockOneEmptyLoc(task); lockLoc = minIndexShelf.lockOneEmptyLoc(task);
if (lockLoc != null){ if (lockLoc != null){
shelfInfo = minIndexShelf; shelfInfo = minIndexShelf;
} }
} }
} }
}
} }
} }
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
/** /**
* Created by sunke on 2020/6/12. * Created by sunke on 2020/6/12.
*/ */
public class SoseqLockInfo { public class LockInfo {
/** /**
* 工单序号 * 工单序号
*/ */
...@@ -15,6 +15,11 @@ public class SoseqLockInfo { ...@@ -15,6 +15,11 @@ public class SoseqLockInfo {
private String so; private String so;
/** /**
* 需求序号
*/
private String hSerial;
/**
* 站位序号 * 站位序号
*/ */
private List<LockItemInfo> lockItems = new ArrayList<>(); private List<LockItemInfo> lockItems = new ArrayList<>();
...@@ -46,4 +51,12 @@ public class SoseqLockInfo { ...@@ -46,4 +51,12 @@ public class SoseqLockInfo {
public void addLockItem(LockItemInfo lockItem){ public void addLockItem(LockItemInfo lockItem){
lockItems.add(lockItem); lockItems.add(lockItem);
} }
public String gethSerial() {
return hSerial;
}
public void sethSerial(String hSerial) {
this.hSerial = hSerial;
}
} }
...@@ -618,10 +618,10 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ { ...@@ -618,10 +618,10 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
} }
/** /**
* 是否是在皮带线上 * 是否是在流水线上
*/ */
public boolean isInBelt(){ public boolean isInBelt(){
return status.toLowerCase().equals("inbelt"); return status.toLowerCase().equals("inbelt") || status.toLowerCase().equals("inline") || status.toLowerCase().equals("inrobot");
} }
/** /**
......
...@@ -72,6 +72,8 @@ public interface IStoragePosDao extends IMongoDao { ...@@ -72,6 +72,8 @@ public interface IStoragePosDao extends IMongoDao {
List<StoragePos> findBindList(String hSerial); List<StoragePos> findBindList(String hSerial);
int countBind(String hSerial);
List<StoragePos> findBindList(String hSerial, String outItemId); List<StoragePos> findBindList(String hSerial, String outItemId);
/** /**
......
...@@ -395,6 +395,13 @@ public class StoragePosDaoImpl extends AbstractMongoDao implements IStoragePosDa ...@@ -395,6 +395,13 @@ public class StoragePosDaoImpl extends AbstractMongoDao implements IStoragePosDa
return findByQuery(q); return findByQuery(q);
} }
@Override
public int countBind(String hSerial){
Criteria c = Criteria.where("barcode.appendInfo.hSerial").is(hSerial);
Query q = new Query(c);
return countByQuery(q);
}
/** /**
* 获取工单的所有绑定料盘 * 获取工单的所有绑定料盘
*/ */
......
...@@ -26,7 +26,11 @@ public interface IOutInfoDao extends IMongoDao { ...@@ -26,7 +26,11 @@ public interface IOutInfoDao extends IMongoDao {
void updateTaskFinishNum(String hSerail, int taskFinishNum); void updateTaskFinishNum(String hSerail, int taskFinishNum);
void updateBindNum(String hSerail, int taskFinishNum);
void updateOutReelNum(String hSerial, int outReelNum); void updateOutReelNum(String hSerial, int outReelNum);
void updateExecuteTime(String hSerial, long firstExecuteTime); void updateExecuteTime(String hSerial, long firstExecuteTime);
void updateOutInfo(OutInfo outInfo);
} }
...@@ -90,6 +90,17 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao { ...@@ -90,6 +90,17 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao {
updateFirst(query,update); updateFirst(query,update);
} }
/**
* 更新建议和必须出仓时间及线别目的地
*/
@Override
public void updateOutInfo(OutInfo outInfo){
Criteria c = Criteria.where("hSerial").is(outInfo.gethSerial());
Query query = Query.query(c);
Update update = Update.update("sdate",outInfo.getSdate()).set("mdate",outInfo.getMdate()).set("line",outInfo.getLine());
updateFirst(query,update);
}
@Override @Override
public void updateTaskEndTime(String hSerial, long taskEndTime){ public void updateTaskEndTime(String hSerial, long taskEndTime){
update(hSerial, "taskEndTime", taskEndTime); update(hSerial, "taskEndTime", taskEndTime);
...@@ -101,6 +112,11 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao { ...@@ -101,6 +112,11 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao {
} }
@Override @Override
public void updateBindNum(String hSerail, int taskFinishNum) {
update(hSerail, "totalBindNum", taskFinishNum);
}
@Override
public void updateOutReelNum(String hSerial, int outReelNum){ public void updateOutReelNum(String hSerial, int outReelNum){
update(hSerial, "outReelNum", outReelNum); update(hSerial, "outReelNum", outReelNum);
} }
......
...@@ -155,12 +155,12 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -155,12 +155,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c = c.and("w").is(barcode.getPlateSize()).and("h").is(barcode.getHeight()); c = c.and("w").is(barcode.getPlateSize()).and("h").is(barcode.getHeight());
}else if(compatibleType == StorageConstants.COMPATIBLE_TYPE.FULLY_COMPATIBLE){//同厚度兼容 }else if(compatibleType == StorageConstants.COMPATIBLE_TYPE.FULLY_COMPATIBLE){//同厚度兼容
//c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度大于等于料盘宽度,高度大于等于料盘高度 //c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度大于等于料盘宽度,高度大于等于料盘高度
if(barcode.getPlateSize() != 7){ // if(barcode.getPlateSize() != 7){
c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//除7寸外,完全兼容 c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//除7寸外,完全兼容
}else{ // }else{
//=7寸使用同尺寸兼容 // //=7寸使用同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight()); // c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());
} // }
}else if(compatibleType == StorageConstants.COMPATIBLE_TYPE.SIZE_COMPATIBLE){//同尺寸兼容 }else if(compatibleType == StorageConstants.COMPATIBLE_TYPE.SIZE_COMPATIBLE){//同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度 c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
......
...@@ -18,6 +18,7 @@ import org.apache.logging.log4j.util.Strings; ...@@ -18,6 +18,7 @@ import org.apache.logging.log4j.util.Strings;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.*; import java.util.*;
import java.util.Map.Entry; import java.util.Map.Entry;
...@@ -41,7 +42,7 @@ public class HttpHelper { ...@@ -41,7 +42,7 @@ public class HttpHelper {
// return postJson(url,params,null, "http"); // return postJson(url,params,null, "http");
// } // }
public static String get(String url,HashMap<String, String> params) throws ApiException { public static String get(String url,Map<String, String> params) throws ApiException {
return get(url,params,null, "http"); return get(url,params,null, "http");
} }
...@@ -233,7 +234,7 @@ public class HttpHelper { ...@@ -233,7 +234,7 @@ public class HttpHelper {
* 请求协议 "http" / "https" * 请求协议 "http" / "https"
* @return 服务器响应的请求结果 * @return 服务器响应的请求结果
*/ */
public static String get(String url, HashMap<String, String> params, public static String get(String url, Map<String, String> params,
HashMap<String, String> cookies, String protocol) throws ApiException { HashMap<String, String> cookies, String protocol) throws ApiException {
// if (protocol.equalsIgnoreCase("https")) { // if (protocol.equalsIgnoreCase("https")) {
// Protocol httpsProtocol = new Protocol("https", new SecureProtocolSocketFactoryImpl(), 443); // Protocol httpsProtocol = new Protocol("https", new SecureProtocolSocketFactoryImpl(), 443);
...@@ -251,7 +252,9 @@ public class HttpHelper { ...@@ -251,7 +252,9 @@ public class HttpHelper {
int i = 0; int i = 0;
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entry<String, String> entry = iterator.next(); Entry<String, String> entry = iterator.next();
data[i] = new NameValuePair(entry.getKey(), entry.getValue()); String paramValue = entry.getValue();
paramValue = URLEncoder.encode(paramValue);
data[i] = new NameValuePair(entry.getKey(), paramValue);
++i; ++i;
} }
getMethod.setQueryString(data); getMethod.setQueryString(data);
......
...@@ -531,7 +531,7 @@ public class StorageConstants { ...@@ -531,7 +531,7 @@ public class StorageConstants {
/** /**
* 完全兼容 * 完全兼容
*/ */
FULLY_COMPATIBLE("11,13,15完全兼容"), FULLY_COMPATIBLE("完全兼容"),
/** /**
* 同尺寸兼容 * 同尺寸兼容
*/ */
......
...@@ -43,26 +43,38 @@ public class OutInfoSearchController extends BaseSearchController { ...@@ -43,26 +43,38 @@ public class OutInfoSearchController extends BaseSearchController {
@RequestMapping("/outInfoSearch*") @RequestMapping("/outInfoSearch*")
public String onSubmit(@ModelAttribute("searchCriteria") BaseSearchCriteria searchCriteria, HttpServletRequest request) { public String onSubmit(@ModelAttribute("searchCriteria") BaseSearchCriteria searchCriteria, HttpServletRequest request) {
boolean stopOut = dataCache.getSettings().isStopOut(); boolean stopJob = dataCache.getSettings().isStopJob();
request.setAttribute("stopOut",stopOut); request.setAttribute("stopJob",stopJob);
Query query = new Query(); Query query = new Query();
Criteria criteria = new Criteria(); Criteria criteria = new Criteria();
addLikeParam(request,criteria,"so"); addLikeParam(request,criteria,"so");
String reelId = request.getParameter("reelId"); String lineStr = request.getParameter("line");
if(Strings.isNotBlank(reelId)){ if(lineStr == null){
Pattern pattern = Pattern.compile(reelId, Pattern.CASE_INSENSITIVE); lineStr = "NONE";
Criteria c = Criteria.where("reelID").regex(pattern); }
request.setAttribute("line",lineStr);
if(Strings.isNotBlank(lineStr)){
String line = lineStr;
if(lineStr.equals("NONE")){
line = null;
}
criteria.and("line").is(line);
}
String pn = request.getParameter("pn");
if(Strings.isNotBlank(pn)){
Pattern pattern = Pattern.compile(pn, Pattern.CASE_INSENSITIVE);
Criteria c = Criteria.where("pn").regex(pattern);
List<OutItem> itemList = outItemDao.findByQuery(new Query(c)); List<OutItem> itemList = outItemDao.findByQuery(new Query(c));
List<String> hSerialList = new ArrayList<>(); List<String> hSerialList = new ArrayList<>();
for (OutItem outItem : itemList) { for (OutItem outItem : itemList) {
hSerialList.add(outItem.gethSerial()); hSerialList.add(outItem.gethSerial());
} }
criteria.and("hSerial").in(hSerialList); criteria.and("hSerial").in(hSerialList);
request.setAttribute("reelId",reelId); request.setAttribute("pn",pn);
}else{ }else{
addLikeParam(request,criteria,"hSerial"); addLikeParam(request,criteria,"hSerial");
} }
......
...@@ -77,6 +77,7 @@ public class OutInfoCache { ...@@ -77,6 +77,7 @@ public class OutInfoCache {
if(!isProcessTimer){ if(!isProcessTimer){
isProcessTimer = true; isProcessTimer = true;
try { try {
closeOutInfos();
if(!dataCache.getSettings().isStopJob()){ if(!dataCache.getSettings().isStopJob()){
updateMustExeOutInfo(); updateMustExeOutInfo();
executeBindTask(); executeBindTask();
...@@ -90,15 +91,16 @@ public class OutInfoCache { ...@@ -90,15 +91,16 @@ public class OutInfoCache {
} }
} }
public void executeOutTask(){ /**
* 关闭已完成的需求单
*/
public void closeOutInfos(){
Date now = new Date(); Date now = new Date();
List<OutInfo> cachedOutInfos = getCachedOutInfos(); List<OutInfo> cachedOutInfos = getCachedOutInfos();
for (OutInfo unEndOutInfo : cachedOutInfos) { for (OutInfo unEndOutInfo : cachedOutInfos) {
if(!unEndOutInfo.isClosed() && unEndOutInfo.isTaskEnd() && !unEndOutInfo.isReelCutAction()){ if(!unEndOutInfo.isClosed() && unEndOutInfo.isTaskEnd() && !unEndOutInfo.isReelCutAction()){
long lastEndTime = unEndOutInfo.getTaskEndTime(); long taskEndTime = unEndOutInfo.getTaskEndTime();
if(now.getTime() - lastEndTime >= 5 * 60 * 1000){ if(taskEndTime>0 && now.getTime() - taskEndTime >= 5 * 60 * 1000){
//任务已结束5分钟 //任务已结束5分钟
if(unEndOutInfo.isEndOutInfo()){ if(unEndOutInfo.isEndOutInfo()){
log.info("需求单["+unEndOutInfo.gethSerial()+"]已执行过,且是工单的最后一个需求单,关闭工单"+unEndOutInfo.getSo()+"["+unEndOutInfo.getSoseq()+"]"); log.info("需求单["+unEndOutInfo.gethSerial()+"]已执行过,且是工单的最后一个需求单,关闭工单"+unEndOutInfo.getSo()+"["+unEndOutInfo.getSoseq()+"]");
...@@ -110,6 +112,19 @@ public class OutInfoCache { ...@@ -110,6 +112,19 @@ public class OutInfoCache {
} }
} }
if(unEndOutInfo.getFirstExecuteTime()<=0 && unEndOutInfo.getTotalBindNum() <=0 ){
//未执行过,且未绑定的,更新绑定数量
int bindCount = storagePosDao.countBind(unEndOutInfo.gethSerial());
updateBindNum(unEndOutInfo.gethSerial(),bindCount);
}
}
}
public void executeOutTask(){
Date now = new Date();
List<OutInfo> cachedOutInfos = getCachedOutInfos();
for (OutInfo unEndOutInfo : cachedOutInfos) {
if(unEndOutInfo.isReelCutAction() || unEndOutInfo.isUrgentAction() || unEndOutInfo.isCheckAction()){ if(unEndOutInfo.isReelCutAction() || unEndOutInfo.isUrgentAction() || unEndOutInfo.isCheckAction()){
//单独出库,分盘料或盘点料,不按时间可直接执行,距离上次任务完成5分钟后才可再次执行 //单独出库,分盘料或盘点料,不按时间可直接执行,距离上次任务完成5分钟后才可再次执行
if(unEndOutInfo.isTaskEnd() || unEndOutInfo.isNew()){ if(unEndOutInfo.isTaskEnd() || unEndOutInfo.isNew()){
...@@ -277,7 +292,11 @@ public class OutInfoCache { ...@@ -277,7 +292,11 @@ public class OutInfoCache {
continue; continue;
} }
//寻找未执行过的到达建议时间和必须出库时间的工单料(首盘或补料) //寻找未执行过的到达建议时间和必须出库时间的工单料(首盘或补料)
if(unEndOutInfo.isTailAction() || unEndOutInfo.isFirstReelAction()){ if(unEndOutInfo.isTailAction() || unEndOutInfo.isFirstReelAction() || unEndOutInfo.isPnAction()){
if(Strings.isBlank(unEndOutInfo.getLine())){
//无目的地
continue;
}
long firstExecuteTime = unEndOutInfo.getFirstExecuteTime(); long firstExecuteTime = unEndOutInfo.getFirstExecuteTime();
if(firstExecuteTime < 0){ if(firstExecuteTime < 0){
if(mustOutInfo == null || firstExecuteTime > mustOutInfo.getFirstExecuteTime()){ if(mustOutInfo == null || firstExecuteTime > mustOutInfo.getFirstExecuteTime()){
...@@ -626,6 +645,16 @@ public class OutInfoCache { ...@@ -626,6 +645,16 @@ public class OutInfoCache {
return outInfoList; return outInfoList;
} }
public void updateBindNum(String hSerial, int bindNum){
OutInfo outInfo = getOutInfoFromCache(hSerial);
if(outInfo != null && outInfo.getFirstExecuteTime() <=0) {
//未执行过,更新
outInfo.setTotalBindNum(bindNum);
outInfoDao.updateBindNum(hSerial, bindNum);
outInfoMap.put(hSerial, outInfo);
}
}
/** /**
* 任务开始时,初始化出库任务数 * 任务开始时,初始化出库任务数
* @param hSerial * @param hSerial
...@@ -811,6 +840,25 @@ public class OutInfoCache { ...@@ -811,6 +840,25 @@ public class OutInfoCache {
} }
} }
/**
* 更新需求单的建议和必须出仓时间及线别
*/
public void updateOutInfo(OutInfo outInfo){
//已经执行过的不能更新
outInfoDao.updateOutInfo(outInfo);
if(outInfo.isPnAction() && Strings.isNotBlank(outInfo.getLine())){
qisdaBindService.bindPnOutInfo(outInfo);
List<StoragePos> bindPosList = storagePosDao.findBindList(outInfo.gethSerial());
int bindReelNum = bindPosList.size();
outInfo.setTotalBindNum(bindReelNum);
log.info("PN需求单["+outInfo.gethSerial()+"]绑定料盘数量为:" + bindReelNum);
outInfoDao.save(outInfo);
}
outInfoMap.put(outInfo.gethSerial(),outInfo);
log.info("更新需求单["+outInfo.gethSerial()+"]的建议时间为:"+outInfo.getSdate() + " 必须时间为:" + outInfo.getMdate() +" 目的地为:"+ outInfo.getLine());
}
private void removeFromCache(String hSerial){ private void removeFromCache(String hSerial){
outInfoMap.remove(hSerial); outInfoMap.remove(hSerial);
...@@ -867,14 +915,15 @@ public class OutInfoCache { ...@@ -867,14 +915,15 @@ public class OutInfoCache {
* @return * @return
*/ */
private ResultBean checkOutInfoCanOut(OutInfo outInfo){ private ResultBean checkOutInfoCanOut(OutInfo outInfo){
if(dataCache.getSettings().isStopOut()){
return ResultBean.newErrorResult(100, "系统更新中,暂停出库,请稍后再试",false);
}
if(outInfo == null){ if(outInfo == null){
return ResultBean.newErrorResult(1001,"未找到需求单",false); return ResultBean.newErrorResult(1001,"未找到需求单",false);
} }
if(Strings.isBlank(outInfo.getLine())){
return ResultBean.newErrorResult(1007,"未设置线别",false);
}
String hSerial = outInfo.gethSerial(); String hSerial = outInfo.gethSerial();
String executingHSerial = QisdaCache.getCurrentOrderHSerial(); String executingHSerial = QisdaCache.getCurrentOrderHSerial();
if(hSerial.equals(executingHSerial)){ if(hSerial.equals(executingHSerial)){
...@@ -894,20 +943,22 @@ public class OutInfoCache { ...@@ -894,20 +943,22 @@ public class OutInfoCache {
//是否有工单料任务 //是否有工单料任务
boolean hasOrderTask = false; boolean hasOrderTask = false;
boolean hasUrgenReel = false;
for (DataLog dataLog : allTasks) { for (DataLog dataLog : allTasks) {
if(dataLog.isCheckOutTask()){ if(dataLog.isCheckOutTask() && !dataLog.isFinished() && !dataLog.isCancel()){
//if(!dataLog.isUrgentReel() && !dataLog.isCutReel() && !dataLog.isLessSendReel()){ //if(!dataLog.isUrgentReel() && !dataLog.isCutReel() && !dataLog.isLessSendReel()){
if(dataLog.getAppendInfo().isTailAction() || dataLog.getAppendInfo().isFirstReelAction()){ if(dataLog.getAppendInfo().isTailAction() || dataLog.getAppendInfo().isFirstReelAction()){
//工单料(不是指定料也不是分盘料即首盘或补料) //工单料(不是指定料也不是分盘料即首盘或补料)
hasOrderTask = true; hasOrderTask = true;
}else if(dataLog.getAppendInfo().isPnAction()){
if(!dataLog.isInBelt()){
return ResultBean.newErrorResult(1006,"上一需求单全部任务出库完成后才可执行",false);
}
}else{ }else{
//分盘和紧急料或缺料补发的料 //分盘和紧急料或缺料补发的料
String taskHSerial = dataLog.getAppendInfo().gethSerial(); String taskHSerial = dataLog.getAppendInfo().gethSerial();
if(taskHSerial.equals(outInfo.gethSerial())){ if(taskHSerial.equals(outInfo.gethSerial())){
return ResultBean.newErrorResult(1002,"当前需求单还有未完成的任务",false); return ResultBean.newErrorResult(1002,"当前需求单还有未完成的任务",false);
} }
hasUrgenReel = true;
} }
} }
} }
...@@ -954,6 +1005,11 @@ public class OutInfoCache { ...@@ -954,6 +1005,11 @@ public class OutInfoCache {
private static AtomicBoolean outProcessing = new AtomicBoolean(false); private static AtomicBoolean outProcessing = new AtomicBoolean(false);
public synchronized ResultBean checkOutOutItems(String hSerial){ public synchronized ResultBean checkOutOutItems(String hSerial){
if(dataCache.getSettings().isStopOut()){
return ResultBean.newErrorResult(1001, "系统更新中,暂停出入库,请稍后再试",false);
}
boolean canProcess = outProcessing.compareAndSet(false, true); boolean canProcess = outProcessing.compareAndSet(false, true);
try{ try{
if(canProcess){ if(canProcess){
...@@ -970,7 +1026,7 @@ public class OutInfoCache { ...@@ -970,7 +1026,7 @@ public class OutInfoCache {
} }
} }
public synchronized ResultBean executeOutItems(String hSerial){ private synchronized ResultBean executeOutItems(String hSerial){
//OutInfo outInfo = outInfoDao.findByHSerial(hSerial); //OutInfo outInfo = outInfoDao.findByHSerial(hSerial);
OutInfo outInfoToExecute = getOutInfoFromCache(hSerial); OutInfo outInfoToExecute = getOutInfoFromCache(hSerial);
...@@ -1103,12 +1159,6 @@ public class OutInfoCache { ...@@ -1103,12 +1159,6 @@ public class OutInfoCache {
msg = "需求单"+hSerial+"任务分配完成,共["+outReelNum+"]盘任务"; msg = "需求单"+hSerial+"任务分配完成,共["+outReelNum+"]盘任务";
log.info(msg); log.info(msg);
}else{
msg = "需求单"+outInfo.gethSerial()+"本次出库料盘数量为0";
if(outInfo.isEndOutInfo()){
log.info("需求单["+outInfo.gethSerial()+"]是工单的最后一个需求单,关闭工单"+outInfo.getSo()+"["+outInfo.getSoseq()+"]");
closeSoSeq(outInfo.getSoseq());
}
} }
if(outInfo.isReelCutAction() || outInfo.isFirstReelAction()){ if(outInfo.isReelCutAction() || outInfo.isFirstReelAction()){
...@@ -1118,6 +1168,15 @@ public class OutInfoCache { ...@@ -1118,6 +1168,15 @@ public class OutInfoCache {
QisdaApi.VMILocationOutFeedback(outItemList, lessBind); QisdaApi.VMILocationOutFeedback(outItemList, lessBind);
} }
} }
if(outReelNum == 0){
msg = "需求单"+outInfo.gethSerial()+"本次出库料盘数量为0";
if(outInfo.isEndOutInfo()){
log.info("需求单["+outInfo.gethSerial()+"]是工单的最后一个需求单,关闭工单"+outInfo.getSo()+"["+outInfo.getSoseq()+"]");
closeSoSeq(outInfo.getSoseq());
}else{
closeHSerial(outInfo.gethSerial());
}
}
return ResultBean.newOkResult(msg,"ok"); return ResultBean.newOkResult(msg,"ok");
} }
......
...@@ -82,13 +82,13 @@ public class DataLogSearchController extends BaseSearchController { ...@@ -82,13 +82,13 @@ public class DataLogSearchController extends BaseSearchController {
String barcode = searchCriteria.getBarcode(); String barcode = searchCriteria.getBarcode();
if(!Strings.isNullOrEmpty(barcode)){ if(!Strings.isNullOrEmpty(barcode)){
Pattern pattern = Pattern.compile(barcode, Pattern.CASE_INSENSITIVE); Pattern pattern = Pattern.compile(escapeExprSpecialWord(barcode), Pattern.CASE_INSENSITIVE);
criteria.and("barcode").regex(pattern); criteria.and("barcode").regex(pattern);
} }
String partNumber = searchCriteria.getPartNumber(); String partNumber = searchCriteria.getPartNumber();
if (!Strings.isNullOrEmpty(partNumber)) { if (!Strings.isNullOrEmpty(partNumber)) {
Pattern pattern = Pattern.compile(partNumber, Pattern.CASE_INSENSITIVE); Pattern pattern = Pattern.compile(escapeExprSpecialWord(partNumber), Pattern.CASE_INSENSITIVE);
criteria.and("partNumber").regex(pattern); criteria.and("partNumber").regex(pattern);
} }
...@@ -129,6 +129,18 @@ public class DataLogSearchController extends BaseSearchController { ...@@ -129,6 +129,18 @@ public class DataLogSearchController extends BaseSearchController {
return SUCCESS_VIEW; return SUCCESS_VIEW;
} }
private String escapeExprSpecialWord(String keyword) {
if (!Strings.isNullOrEmpty(keyword)) {
String[] fbsArr = { "\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|" };
for (String key : fbsArr) {
if (keyword.contains(key)) {
keyword = keyword.replace(key, "\\" + key);
}
}
}
return keyword;
}
@Override @Override
protected BaseSearchCriteria getNewSearchCriteria() { protected BaseSearchCriteria getNewSearchCriteria() {
......
...@@ -65,7 +65,6 @@ public class GreeDeviceController { ...@@ -65,7 +65,6 @@ public class GreeDeviceController {
} }
} }
String hSerial = QisdaCache.getCurrentOrderHSerial(); String hSerial = QisdaCache.getCurrentOrderHSerial();
List<String> usedRfidList = InquiryShelfBean.getUsedRfidList(hSerial);
Map<String,Integer> rfidMap = new HashMap<>(); Map<String,Integer> rfidMap = new HashMap<>();
if (!Strings.isBlank(rfids)) { if (!Strings.isBlank(rfids)) {
......
...@@ -171,6 +171,8 @@ public class QisdaDeviceController extends BaseController { ...@@ -171,6 +171,8 @@ public class QisdaDeviceController extends BaseController {
try{ try{
String rfid = request.getParameter("rfid"); String rfid = request.getParameter("rfid");
//是否是在横移上判断
String onMoving = request.getParameter("onMoving");
String codeStr = request.getParameter("barcode"); String codeStr = request.getParameter("barcode");
Barcode barcode = dataCache.resolveOneValideBarcode(codeStr); Barcode barcode = dataCache.resolveOneValideBarcode(codeStr);
DataLog task = taskService.getFinishedTask(barcode.getBarcode()); DataLog task = taskService.getFinishedTask(barcode.getBarcode());
...@@ -199,9 +201,9 @@ public class QisdaDeviceController extends BaseController { ...@@ -199,9 +201,9 @@ public class QisdaDeviceController extends BaseController {
AppendInfo appendInfo = task.getAppendInfo(); AppendInfo appendInfo = task.getAppendInfo();
ShelfLoc shelfLoc = InquiryShelfBean.lockShelfLoc(task, rfid); ShelfLoc shelfLoc = InquiryShelfBean.lockShelfLoc(task, rfid);
if(shelfLoc == null){ if(shelfLoc == null){
String msg = "获取料架["+rfid+"]位置信息失败"; String msg = task.getBarcode() + "获取料架["+rfid+"]位置信息失败";
log.info(msg); //log.info(msg);
return ResultBean.newErrorResult(202, msg); return ResultBean.newErrorResult(99, msg);
} }
String rfidToSave = shelfLoc.getRealRfid(); String rfidToSave = shelfLoc.getRealRfid();
...@@ -214,8 +216,10 @@ public class QisdaDeviceController extends BaseController { ...@@ -214,8 +216,10 @@ public class QisdaDeviceController extends BaseController {
appendInfo.setRfidLoc(shelfLoc.getLoc()); appendInfo.setRfidLoc(shelfLoc.getLoc());
task.setAppendInfo(appendInfo); task.setAppendInfo(appendInfo);
if(!Boolean.valueOf(onMoving)){
task.setStatus(StorageConstants.OP_STATUS.INROBOT.name()); task.setStatus(StorageConstants.OP_STATUS.INROBOT.name());
task.setLocInfo(""); task.setLocInfo("");
}
task = dataLogDao.save(task); task = dataLogDao.save(task);
taskService.updateFinishedTask(task); taskService.updateFinishedTask(task);
......
...@@ -8,6 +8,7 @@ import com.google.common.collect.Sets; ...@@ -8,6 +8,7 @@ import com.google.common.collect.Sets;
import com.myproject.bean.CodeBean; import com.myproject.bean.CodeBean;
import com.myproject.bean.json.*; import com.myproject.bean.json.*;
import com.myproject.bean.qisda.ReelLockPosInfo; import com.myproject.bean.qisda.ReelLockPosInfo;
import com.myproject.bean.qisda.ResultBean;
import com.myproject.bean.search.PageList; import com.myproject.bean.search.PageList;
import com.myproject.bean.update.*; import com.myproject.bean.update.*;
import com.myproject.bean.utils.BoxStatusBean; import com.myproject.bean.utils.BoxStatusBean;
...@@ -251,6 +252,10 @@ public class StorageDataController extends BaseController { ...@@ -251,6 +252,10 @@ public class StorageDataController extends BaseController {
@ResponseBody @ResponseBody
public String checkPos(HttpServletRequest request) { public String checkPos(HttpServletRequest request) {
if(dataCache.getSettings().isStopOut()){
return "系统更新中,暂停出入库,请稍后再试";
}
String cid = request.getParameter("cid"); String cid = request.getParameter("cid");
String partnumber = request.getParameter("pn"); String partnumber = request.getParameter("pn");
if(partnumber != null){ if(partnumber != null){
......
...@@ -843,7 +843,7 @@ public class TaskService implements ITaskService { ...@@ -843,7 +843,7 @@ public class TaskService implements ITaskService {
QisdaApi.VMIMateriaRecAss(task, barcode, latest); QisdaApi.VMIMateriaRecAss(task, barcode, latest);
} }
} }
}else if(taskAppendInfo.isUrgentAction() || taskAppendInfo.isReelCutAction()){ }else if(taskAppendInfo.isUrgentAction() || taskAppendInfo.isReelCutAction() || taskAppendInfo.isPnAction()){
//紧急料或分盘料,增加任务完成数量 //紧急料或分盘料,增加任务完成数量
log.info("紧急料或分盘料["+task.getBarcode()+"]任务已出库完成,发料任务完成数量+1"); log.info("紧急料或分盘料["+task.getBarcode()+"]任务已出库完成,发料任务完成数量+1");
outInfoCache.incTaskFinishNum(taskAppendInfo.gethSerial(), 0, 0); outInfoCache.incTaskFinishNum(taskAppendInfo.gethSerial(), 0, 0);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
socket-timeout="${mongo.socketTimeout}" slave-ok="${mongo.slaveOk}" socket-timeout="${mongo.socketTimeout}" slave-ok="${mongo.slaveOk}"
write-number="1" write-timeout="0" write-fsync="true" /> write-number="1" write-timeout="0" write-fsync="true" />
</mongo:mongo> </mongo:mongo>
<mongo:db-factory dbname="qisda" username="${mongo.username}" <mongo:db-factory dbname="gree" username="${mongo.username}"
password="${mongo.password}" mongo-ref="mongo" /> password="${mongo.password}" mongo-ref="mongo" />
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
......
...@@ -223,15 +223,15 @@ ...@@ -223,15 +223,15 @@
<%--<display:column titleKey="barcode.expireDate" sortProperty="barcode.expireDate" sortable="true">--%> <%--<display:column titleKey="barcode.expireDate" sortProperty="barcode.expireDate" sortable="true">--%>
<%--<fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/>--%> <%--<fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/>--%>
<%--</display:column>--%> <%--</display:column>--%>
<%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">--%> <security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">
<%--<display:column titleKey="checkOut.operate" media="html">--%> <display:column titleKey="checkOut.operate" media="html">
<%--<c:if test="${!limitCheckOut}">--%> <c:if test="${!limitCheckOut}">
<%--<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"--%> <button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"
<%--onclick="checkoutStorage('${pos.id}')">--%> onclick="checkoutStorage('${pos.id}')">
<%--<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>--%> <i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
<%--</c:if>--%> </c:if>
<%--</display:column>--%> </display:column>
<%--</security:authorize>--%> </security:authorize>
<c:if test="${limitCheckOut}"> <c:if test="${limitCheckOut}">
<c:set var="limitCodes" value="${pos.barcode.inFixture},${limitCodes}"/> <c:set var="limitCodes" value="${pos.barcode.inFixture},${limitCodes}"/>
</c:if> </c:if>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<h4 class="panel-title"> <h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#executing" href="#priorityOrder"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#executing" href="#priorityOrder">
<i class="icon-cursor-move"></i> <i class="icon-cursor-move"></i>
[首盘] 需求单: 808 工单: 879235 备料单: F001_879235N_1 <span class="right">建议时间: 2019-11-18 08:59</span> [首盘] 需求单: 808 工单: 879235 <span class="right">建议时间: 2019-11-18 08:59</span>
</a> </a>
</h4> </h4>
</div> </div>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<h4 class="panel-title"> <h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#executing" href="#priorityOrder"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#executing" href="#priorityOrder">
<i class="icon-cursor-move"></i> <i class="icon-cursor-move"></i>
[首盘] 需求单: 808 工单: 879235 备料单: F001_879235N_1 <span class="right">建议时间: 2019-11-18 08:59</span> [首盘] 需求单: 808 工单: 879235 <span class="right">建议时间: 2019-11-18 08:59</span>
</a> </a>
</h4> </h4>
</div> </div>
...@@ -144,24 +144,24 @@ ...@@ -144,24 +144,24 @@
'<h4 class="panel-title">' + '<h4 class="panel-title">' +
'<a class="accordion-toggle" data-toggle="collapse" href="#'+outInfo.hSerial+'">' + '<a class="accordion-toggle" data-toggle="collapse" href="#'+outInfo.hSerial+'">' +
moveHandle + //outInfo.firstExecuteTime + moveHandle + //outInfo.firstExecuteTime +
'需求单:'+ outInfo.hSerial+' ['+outInfo.action+'] 工单: ' + outInfo.so +' 备料单: ' + outInfo.refno + '[' + outInfo.sendStatus +'] 工单序号:' + outInfo.soseq + '需求单:'+ outInfo.hSerial+' ['+outInfo.action+'] 工单: ' + outInfo.so +' 线别: ' + outInfo.line + ' 绑定:' + outInfo.totalBindNum +
'<span class="right">创建时间: '+createDate+'</span>' + '<span class="right">创建时间: '+createDate+'</span>' +
'<span class="right">建议时间: '+sdate+'</span>' + '<span class="right">建议时间: '+sdate+'</span>' +
'<span class="right">必须时间: '+mdate+'</span>' + //'<span class="right">必须时间: '+mdate+'</span>' +
//'<span class="right">['+outInfo.firstExecuteTime+']</span>' + //'<span class="right">['+outInfo.firstExecuteTime+']</span>' +
'</a></h4></div>' + '</a></h4></div>' +
'<div id="'+outInfo.hSerial+'" class="panel-collapse collapse">' + '<div id="'+outInfo.hSerial+'" class="panel-collapse collapse">' +
'<div class="panel-body bg-grey">' + '<div class="panel-body bg-grey">' +
'<ul class="list-inline">' + '<ul class="list-inline">' +
'<li><i class="fa fa-tasks"></i>工单: '+outInfo.so+'</li>' + '<li><i class="fa fa-tasks"></i>工单: '+outInfo.so+'</li>' +
'<li><i class="fa fa-briefcase"></i>备料单: '+outInfo.refno+'</li>' + // '<li><i class="fa fa-briefcase"></i>备料单: '+outInfo.refno+'</li>' +
'<li><i class="fa fa-calendar"></i>建议时间:'+sdate+'</li>' + '<li><i class="fa fa-calendar"></i>建议时间:'+sdate+'</li>' +
'<li><i class="fa fa-star"></i>必须出仓日期:'+mdate+'</li>' + '<li><i class="fa fa-star"></i>必须出仓日期:'+mdate+'</li>' +
'<li><i class="fa fa-star"></i>创建时间:'+createDate+'</li>' + '<li><i class="fa fa-star"></i>创建时间:'+createDate+'</li>' +
'</ul>' + '</ul>' +
'<h4 class="list-inline '+bgClass+'">' + // '<h4 class="list-inline '+bgClass+'">' +
'线体['+outInfo.line+']未解绑料架信息: '+outInfo.lineBindShelfInfo+'' + // '线体['+outInfo.line+']未解绑料架信息: '+outInfo.lineBindShelfInfo+'' +
'</h4>' + // '</h4>' +
'</div></div></div></div>'; '</div></div></div></div>';
return infoHtml; return infoHtml;
} }
...@@ -174,6 +174,9 @@ ...@@ -174,6 +174,9 @@
for(var i in data){ for(var i in data){
var outInfo = data[i]; var outInfo = data[i];
if(outInfo.line == '' || outInfo.line == null){
continue;
}
var infoHtml = getOutInfoHtml(outInfo); var infoHtml = getOutInfoHtml(outInfo);
if(outInfo.executing || outInfo.sendLess || outInfo.firstExecuteTime > 0){ if(outInfo.executing || outInfo.sendLess || outInfo.firstExecuteTime > 0){
executingHtml = executingHtml + infoHtml; executingHtml = executingHtml + infoHtml;
......
...@@ -85,11 +85,11 @@ ...@@ -85,11 +85,11 @@
</a> </a>
</li> </li>
<%--<li class="classic-menu-dropdown">--%> <li class="classic-menu-dropdown">
<%--<a href="${ctx}/workOrder/checkOutSettings.html" name="workOrder">--%> <a href="${ctx}/workOrder/checkOutSettings.html" name="workOrder">
<%--<fmt:message key="menu.outRule"/><span class="selected"></span>--%> <fmt:message key="menu.outRule"/><span class="selected"></span>
<%--</a>--%> </a>
<%--</li>--%> </li>
</security:authorize> </security:authorize>
</ul> </ul>
</security:authorize> </security:authorize>
......
...@@ -237,9 +237,9 @@ ...@@ -237,9 +237,9 @@
<!-- BEGIN FOOTER --> <!-- BEGIN FOOTER -->
<div class="page-footer"> <div class="page-footer">
<div class="page-footer-inner"> <div class="page-footer-inner">
2016&copy; <a href="${ctx}/updateHistory.html">SMD BOX</a> 2016&copy; <a href="">SMD BOX</a>
</div> </div>
<span class="right" style="color: #a3a3a3;">Version: 2021.03.25</span> <span class="right" style="color: #a3a3a3;">Version: 1.6.2910</span>
<div class="scroll-to-top"> <div class="scroll-to-top">
<i class="icon-arrow-up"></i> <i class="icon-arrow-up"></i>
</div> </div>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!