Commit 88cfe62f LN

Merge remote-tracking branch 'origin/master'

2 个父辈 9d6a689a 30a75ffa
正在显示 27 个修改的文件 包含 785 行增加339 行删除
...@@ -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);
......
...@@ -319,93 +319,103 @@ public class QisdaApi { ...@@ -319,93 +319,103 @@ public class QisdaApi {
* 3. CIS入库判定接口 (没绑过料串的条码调用此接口) * 3. CIS入库判定接口 (没绑过料串的条码调用此接口)
*/ */
public static Barcode VMILocationInCheck(Barcode barcode) throws ValidateException{ public static Barcode VMILocationInCheck(Barcode barcode) throws ValidateException{
if(DataCache.isProductionFor(DataCache.CUSTOMER.DEBUG)){ // if(DataCache.isProductionFor(DataCache.CUSTOMER.DEBUG)){
log.info("程序调试阶段,暂不处理,调试完成后更改PRO"); // log.info("程序调试阶段,暂不处理,调试完成后更改PRO");
return barcode; // return barcode;
} // }
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationInCheck"; String url = "http://172.74.1.175:1235/api/SMDBOXAPI";
String reelid = barcode.getBarcode(); String reelid = barcode.getBarcode();
String partNum = barcode.getPartNumber(); String partNum = barcode.getPartNumber();
Map<String,Object> paramMap = new HashMap<String,Object>(); Map<String,String> paramMap = new HashMap<String,String>();
paramMap.put("reelid",reelid); paramMap.put("reelid",reelid);
paramMap.put("partNum",partNum); paramMap.put("partNum",partNum);
log.info("纯入库判断参数:reelid=" + reelid + " partNum=" + partNum); log.info("纯入库判断参数:reelid=" + reelid + " partNum=" + partNum);
try { try {
//0+提示信息/1+工单 0:为NG ;1:为OK 工单号码则表示该料卷被绑定在此工单上;-1为内部异常 //0+提示信息/1+工单 0:为NG ;1:为OK 工单号码则表示该料卷被绑定在此工单上;-1为内部异常
String result = HttpHelper.postParam(url,paramMap); String result = HttpHelper.get(url,paramMap);
//String result = "<?xml version=\"1.0\" encoding=\"utf-8\"?><string xmlns=\"http://tempuri.org/\">{\"state\":\"1\",\"msg\":\"入库判定OK\",\"info\":{\"so\":\"2388518\",\"facility\":\"ST\",\"company\":\"BACHS\",\"qty\":\"1\",\"soseq\":\"2092475\",\"slot\":\"5-4\"}}</string>"; //String result = "<?xml version=\"1.0\" encoding=\"utf-8\"?><string xmlns=\"http://tempuri.org/\">{\"state\":\"1\",\"msg\":\"入库判定OK\",\"info\":{\"so\":\"2388518\",\"facility\":\"ST\",\"company\":\"BACHS\",\"qty\":\"1\",\"soseq\":\"2092475\",\"slot\":\"5-4\"}}</string>";
log.info("收到("+reelid+")纯入库判定接口返回:" + result); log.info("收到("+reelid+")纯入库判定接口返回:" + result);
String resultStr = XmlUtil.getNodeBody("string", result); //String resultStr = XmlUtil.getNodeBody("string", result);
//0+提示信息/1/-1 0为NG,1为OK,-1为系统内部异常 //0+提示信息/1/-1 0为NG,1为OK,-1为系统内部异常
Map<String, Object> resultMap = JsonUtil.toMap(resultStr); Map<String, Object> resultMap = JsonUtil.toMap(result);
String state = resultMap.get("state").toString(); String state = resultMap.get("state").toString();
if(state.equals("1")){ if(state.equals("1")){
log.info(reelid + " CIS入库判定: OK"); log.info(reelid + " CIS入库判定: OK");
AppendInfo appendInfo = barcode.getAppendInfo(); AppendInfo appendInfo = barcode.getAppendInfo();
Object infoObj = resultMap.get("info"); Object qty = resultMap.get("qty");
if(infoObj != null){ if(qty != null){
log.info("写入条码["+reelid+"]工单数量信息,并清空分盘数据"); int amount = Integer.valueOf(qty.toString());
Map infoMap = (Map)infoObj; if(amount > 0){
String so = infoMap.get("so").toString();
//有工单信息,需要绑定工单
String soseq = infoMap.get("soseq").toString();
String facility = infoMap.get("facility").toString();
String company = infoMap.get("company").toString();
String qty = infoMap.get("qty").toString();
String slot = infoMap.get("slot").toString();
Object slotlocation = infoMap.get("slotserial");
if(so.equals("0")){
so = null;
soseq = null;
slot = null;
}
appendInfo.setCutMap(null);
appendInfo.setSo(so);
appendInfo.setSoseq(soseq);
appendInfo.setSlotStr(slot);
if(slotlocation == null || slotlocation.equals("0")){
appendInfo.setBindSlot(null);
appendInfo.setPreBindSlot(null);
appendInfo.setSlotIndex(-1);
}else{
String location = slotlocation.toString();
log.info(reelid + "数量:"+ qty + "绑定工单"+ so + "["+location+"]");
appendInfo.setBindSlot(location);
appendInfo.setPreBindSlot(location);
try{
int slotIndex = Integer.valueOf(location);
appendInfo.setSlotIndex(slotIndex);
//TODO:需要重新绑定
}catch (Exception e){
log.error("纯入库判定出错",e);
}
}
appendInfo.setFacility(facility);
appendInfo.setCompany(company);
int amount = Integer.valueOf(qty);
barcode.setAmount(amount); barcode.setAmount(amount);
barcode.setInitialAmount(amount); barcode.setInitialAmount(amount);
log.info("更新条码["+reelid+"]数量为:" + amount);
//绑定工单 }
// appendInfo.sethSerial(outItem.gethSerial());
// appendInfo.setRefno(outItem.getRefno()); }
// appendInfo.setSlotIndex(outItem.getSlotlocation()); // Object infoObj = resultMap.get("info");
// if(infoObj != null){
// log.info("写入条码["+reelid+"]工单数量信息,并清空分盘数据");
// Map infoMap = (Map)infoObj;
// String so = infoMap.get("so").toString();
// //有工单信息,需要绑定工单
// String soseq = infoMap.get("soseq").toString();
// String facility = infoMap.get("facility").toString();
// String company = infoMap.get("company").toString();
// String qty = infoMap.get("qty").toString();
// String slot = infoMap.get("slot").toString();
// Object slotlocation = infoMap.get("slotserial");
//
// if(so.equals("0")){
// so = null;
// soseq = null;
// slot = null;
// }
//
// appendInfo.setCutMap(null);
// appendInfo.setSo(so);
// appendInfo.setSoseq(soseq);
// appendInfo.setSlotStr(slot);
// if(slotlocation == null || slotlocation.equals("0")){
// appendInfo.setBindSlot(null);
// appendInfo.setPreBindSlot(null);
// appendInfo.setSlotIndex(-1);
// }else{
// String location = slotlocation.toString();
// log.info(reelid + "数量:"+ qty + "绑定工单"+ so + "["+location+"]");
// appendInfo.setBindSlot(location);
// appendInfo.setPreBindSlot(location);
// try{
// int slotIndex = Integer.valueOf(location);
// appendInfo.setSlotIndex(slotIndex);
// //TODO:需要重新绑定
//
// }catch (Exception e){
// log.error("纯入库判定出错",e);
// }
// }
//
//
// appendInfo.setFacility(facility);
// appendInfo.setCompany(company);
// int amount = Integer.valueOf(qty);
// barcode.setAmount(amount);
// barcode.setInitialAmount(amount);
//
// //绑定工单
//// appendInfo.sethSerial(outItem.gethSerial());
//// appendInfo.setRefno(outItem.getRefno());
//// appendInfo.setSlotIndex(outItem.getSlotlocation());
//// barcode.setAppendInfo(appendInfo);
//// int realLockQty = outItem.getRealLockQty() + barcode.getAmount();
//// outItem.setRealLockQty(realLockQty);
//
// barcode.setAppendInfo(appendInfo); // barcode.setAppendInfo(appendInfo);
// int realLockQty = outItem.getRealLockQty() + barcode.getAmount(); // }
// outItem.setRealLockQty(realLockQty);
barcode.setAppendInfo(appendInfo);
}
}else{ }else{
log.info(reelid + " 纯入库判定: NG" + resultStr); log.info(reelid + " 纯入库判定: NG" + result);
String ngMsg = resultMap.get("msg").toString(); String ngMsg = resultMap.get("msg").toString();
throw new ValidateException("纯入库判定NG:["+state+"]" + ngMsg); throw new ValidateException("纯入库判定NG:["+state+"]" + ngMsg);
} }
...@@ -645,31 +655,31 @@ public class QisdaApi { ...@@ -645,31 +655,31 @@ public class QisdaApi {
* @return * @return
*/ */
public static PLATE_SIZE PartNoRule(String partNum, String vendorCode){ public static PLATE_SIZE PartNoRule(String partNum, String vendorCode){
if(DataCache.isProductionFor(DataCache.CUSTOMER.DEBUG)){ // if(DataCache.isProductionFor(DataCache.CUSTOMER.DEBUG)){
log.info("程序调试阶段,暂不处理,调试完成后更改PRO"); // log.info("程序调试阶段,暂不处理,调试完成后更改PRO");
return null; // return null;
} // }
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/PartNoRule"; // String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/PartNoRule";
Map<String,Object> paramMap = new HashMap<String,Object>(); // Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("partNum",partNum); // paramMap.put("partNum",partNum);
paramMap.put("vendorCode",vendorCode); // paramMap.put("vendorCode",vendorCode);
//
try { // try {
String result = HttpHelper.postParam(url,paramMap); // String result = HttpHelper.postParam(url,paramMap);
log.info("从Qisda获取料号"+partNum+"["+vendorCode+"]尺寸(PartNoRule)返回:" + result); // log.info("从Qisda获取料号"+partNum+"["+vendorCode+"]尺寸(PartNoRule)返回:" + result);
Map<String, Object> resultMap = JsonUtil.toMap(result); // Map<String, Object> resultMap = JsonUtil.toMap(result);
String code = resultMap.get("code").toString(); // String code = resultMap.get("code").toString();
if(code.equals("200")){ // if(code.equals("200")){
List<Map<String,Object>> data = (List<Map<String, Object>>) resultMap.get("data"); // List<Map<String,Object>> data = (List<Map<String, Object>>) resultMap.get("data");
for (Map<String, Object> itemMap : data) { // for (Map<String, Object> itemMap : data) {
String w = itemMap.get("specifications").toString(); // String w = itemMap.get("specifications").toString();
String h = itemMap.get("widthSize").toString(); // String h = itemMap.get("widthSize").toString();
return new PLATE_SIZE(Integer.valueOf(w),Integer.valueOf(h)); // return new PLATE_SIZE(Integer.valueOf(w),Integer.valueOf(h));
} // }
} // }
} catch (ApiException e) { // } catch (ApiException e) {
log.error("从Qisda获取料号["+partNum+"["+vendorCode+"]尺寸(PartNoRule)接口出错",e); // log.error("从Qisda获取料号["+partNum+"["+vendorCode+"]尺寸(PartNoRule)接口出错",e);
} // }
return null; return null;
} }
......
...@@ -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)) {
......
package com.myproject.webapp.controller.webService; package com.myproject.webapp.controller.webService;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.myproject.bean.json.ChartItem; import com.myproject.bean.json.ChartItem;
import com.myproject.bean.qisda.*; import com.myproject.bean.qisda.*;
...@@ -120,7 +119,26 @@ public class QisdaApiController extends BaseController { ...@@ -120,7 +119,26 @@ public class QisdaApiController extends BaseController {
} }
@RequestMapping("/updateLine")
@ResponseBody
public ResultBean updateLine(HttpServletRequest request){
String hSerial = request.getParameter("hSerial");
String line = request.getParameter("line");
//OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
//qisdaBindService.realBindOutInfo(outInfo);
log.info("手动修改需求单["+hSerial+"]目的地:" + line);
OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
if(!Strings.isNullOrEmpty(line) && outInfo != null){
outInfo.setLine(line);
outInfo.setSdate(new Date());
outInfo.setMdate(new Date());
outInfoCache.updateOutInfo(outInfo);
return ResultBean.newOkResult(outInfo);
}else{
return ResultBean.newErrorResult(2001,"线别为空");
}
}
@RequestMapping("/executeOut") @RequestMapping("/executeOut")
@ResponseBody @ResponseBody
...@@ -128,8 +146,14 @@ public class QisdaApiController extends BaseController { ...@@ -128,8 +146,14 @@ public class QisdaApiController extends BaseController {
String hSerial = request.getParameter("hSerial"); String hSerial = request.getParameter("hSerial");
//OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial); //OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
//qisdaBindService.realBindOutInfo(outInfo); //qisdaBindService.realBindOutInfo(outInfo);
ResultBean resultBean = null;
if(!dataCache.getSettings().isStopJob()){
resultBean = ResultBean.newErrorResult(1001, "自动任务开启时,不允许手动出库",false);
}else{
log.info("手动执行需求单["+hSerial+"]出库"); log.info("手动执行需求单["+hSerial+"]出库");
ResultBean resultBean = outInfoCache.checkOutOutItems(hSerial); resultBean = outInfoCache.checkOutOutItems(hSerial);
}
return resultBean.getMsg(); return resultBean.getMsg();
} }
...@@ -161,6 +185,31 @@ public class QisdaApiController extends BaseController { ...@@ -161,6 +185,31 @@ public class QisdaApiController extends BaseController {
QisdaApi.VMIMateriaReceive(barcode, task); QisdaApi.VMIMateriaReceive(barcode, task);
} }
} }
/**
* 获取需求单的绑定信息
*/
@RequestMapping(value = "/hSerialLockInfo")
@ResponseBody
public ResultBean hSerialLockInfo(HttpServletRequest request){
String hSerialListStr = receiveParamInfo(request,"hSerialList");
log.info("收到工单绑定查询请求hSerialListStr="+ hSerialListStr);
Set<String> hSerialSet = Sets.newHashSet();
if(!Strings.isNullOrEmpty(hSerialListStr)){
String[] hSerialArr = hSerialListStr.split(",");
for (String hSerial : hSerialArr) {
hSerialSet.add(hSerial);
}
}
List<LockInfo> lockInfos = new ArrayList<>();
for (String soseq : hSerialSet) {
LockInfo lockInfo = getHSerialLockInfo(soseq);
lockInfos.add(lockInfo);
}
return ResultBean.newOkResult(lockInfos);
}
/** /**
* 获取工单的绑定信息 * 获取工单的绑定信息
*/ */
...@@ -188,20 +237,43 @@ public class QisdaApiController extends BaseController { ...@@ -188,20 +237,43 @@ public class QisdaApiController extends BaseController {
} }
} }
List<SoseqLockInfo> lockInfos = new ArrayList<>(); List<LockInfo> lockInfos = new ArrayList<>();
for (String soseq : soseqSet) { for (String soseq : soseqSet) {
SoseqLockInfo lockInfo = getLockInfo(soseq); LockInfo lockInfo = getSoSeqLockInfo(soseq);
lockInfos.add(lockInfo); lockInfos.add(lockInfo);
} }
return ResultBean.newOkResult(lockInfos); return ResultBean.newOkResult(lockInfos);
} }
private SoseqLockInfo getLockInfo(String soseq){ private LockInfo getHSerialLockInfo(String hSerial){
SoseqLockInfo soseqLockInfo = new SoseqLockInfo(); LockInfo lockInfo = new LockInfo();
soseqLockInfo.setSoseq(soseq); lockInfo.sethSerial(hSerial);
OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
if(outInfo != null){
lockInfo.setSo(outInfo.getSo());
lockInfo.setSoseq(outInfo.getSoseq());
for (OutItem outItem : outInfo.getOutItems()) {
LockItemInfo lockItemInfo = new LockItemInfo();
lockItemInfo.setSoseq(outItem.getSoseq());
lockItemInfo.setSlotlocation(outItem.getSlotlocation());
lockItemInfo.setPartNum(outItem.getPn());
lockItemInfo.setQty(outItem.getQty());
lockItemInfo.setPreLockQty(outItem.getLockQty());
lockItemInfo.setRealLockQty(outItem.getRealLockQty());
lockItemInfo.setTotalSendQty(outItem.getSendQty());
lockItemInfo.setFirstSendQty(outItem.getOutQty());
lockInfo.addLockItem(lockItemInfo);
}
}
return lockInfo;
}
private LockInfo getSoSeqLockInfo(String soseq){
LockInfo lockInfo = new LockInfo();
lockInfo.setSoseq(soseq);
OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(soseq); OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(soseq);
if(cutOutInfo != null){ if(cutOutInfo != null){
soseqLockInfo.setSo(cutOutInfo.getSo()); lockInfo.setSo(cutOutInfo.getSo());
for (OutItem outItem : cutOutInfo.getOutItems()) { for (OutItem outItem : cutOutInfo.getOutItems()) {
LockItemInfo lockItemInfo = new LockItemInfo(); LockItemInfo lockItemInfo = new LockItemInfo();
lockItemInfo.setSoseq(outItem.getSoseq()); lockItemInfo.setSoseq(outItem.getSoseq());
...@@ -212,10 +284,10 @@ public class QisdaApiController extends BaseController { ...@@ -212,10 +284,10 @@ public class QisdaApiController extends BaseController {
lockItemInfo.setRealLockQty(outItem.getRealLockQty()); lockItemInfo.setRealLockQty(outItem.getRealLockQty());
lockItemInfo.setTotalSendQty(outItem.getSendQty()); lockItemInfo.setTotalSendQty(outItem.getSendQty());
lockItemInfo.setFirstSendQty(outItem.getOutQty()); lockItemInfo.setFirstSendQty(outItem.getOutQty());
soseqLockInfo.addLockItem(lockItemInfo); lockInfo.addLockItem(lockItemInfo);
} }
} }
return soseqLockInfo; return lockInfo;
} }
/** /**
...@@ -297,19 +369,28 @@ public class QisdaApiController extends BaseController { ...@@ -297,19 +369,28 @@ public class QisdaApiController extends BaseController {
} }
/** /**
* 关闭工单 * 关闭工单或需求单
*/ */
@RequestMapping(value = "/closeSoSeq",method = RequestMethod.POST) @RequestMapping(value = "/closeOutInfo",method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ResultBean closeSoSeq(HttpServletRequest request) { public ResultBean closeOutInfo(HttpServletRequest request) {
try { try {
String soseq = receiveParamInfo(request,"soseq"); String soseq = receiveParamInfo(request,"soseq");
log.info("收到关闭工单请求soseq="+soseq); String hSerial = receiveParamInfo(request,"hSerial");
if(soseq == null){ log.info("收到关闭工单请求soseq="+soseq+"&hSerial="+hSerial);
return ResultBean.newErrorResult(-1,"未找到soseq参数"); if(soseq == null && hSerial == null){
return ResultBean.newErrorResult(-1,"未找到soseq或hSerial参数");
} }
String msg = "";
if(soseq != null){
ResultBean resultBean = outInfoCache.closeSoSeq(soseq); ResultBean resultBean = outInfoCache.closeSoSeq(soseq);
return resultBean; msg = resultBean.getMsg();
}
if(hSerial != null){
ResultBean resultBean = outInfoCache.closeHSerial(hSerial);
msg = msg + resultBean.getMsg();
}
return ResultBean.newOkResult(msg);
} catch (Exception e) { } catch (Exception e) {
log.error("需求单请求处理出错", e); log.error("需求单请求处理出错", e);
return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage()); return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage());
...@@ -457,46 +538,6 @@ public class QisdaApiController extends BaseController { ...@@ -457,46 +538,6 @@ public class QisdaApiController extends BaseController {
outItem = outItemDao.save(outItem); outItem = outItemDao.save(outItem);
if(outItem.isPnAction()){ if(outItem.isPnAction()){
int needNum = outItem.getQty() - outItem.getSendQty() - outItem.getRealLockQty();
log.info("将预绑定转为真实绑定结束,所需数量("+needNum+")=需求单数量("+outItem.getQty()+")-已发料数量("+ outItem.getSendQty()+")-真实绑定数量"+ outItem.getRealLockQty() +")");
if(needNum >= 0){
log.info("预绑定数量不足,查找未绑定料盘进行真实绑定结束,当前数量:"+outItem.getSendQty()+"+"+ outItem.getRealLockQty() +"/" + outItem.getQty());
while(needNum >= 0){
StoragePos pos = storagePosDao.findNoBindMinQty(outItem.getPn(), outItem.getFacility());
if(pos != null){
Barcode barcode = pos.getBarcode();
AppendInfo appendInfo = barcode.getAppendInfo();
//未真实绑定过,可以出库,绑定
appendInfo.sethSerial(outItem.gethSerial());
appendInfo.setRefno(outItem.getRefno());
appendInfo.setSo("HSerial-" + outItem.gethSerial());
appendInfo.setSoseq("HSerial-" + outItem.gethSerial());
appendInfo.setSlotStr(outItem.getSlotStr());
appendInfo.setOutItemId(outItem.getId());
appendInfo.setBindSlot("1");
appendInfo.setSlotIndex(1);
barcode.setAppendInfo(appendInfo);
pos.setBarcode(barcode);
storagePosDao.save(pos);
int totalLockQty = outItem.getLockQty() + barcode.getAmount();
outItem.setLockQty(totalLockQty);
outItem.setRealLockQty(totalLockQty);
}else{
break;
}
if(outItem.getRealLockQty() > outItem.getQty()){
//已经满足需求了,直接跳出
break;
}
}
}
outItem = outItemDao.save(outItem);
outInfo.updateItem(outItem); outInfo.updateItem(outItem);
outInfoMap.put(hSerial, outInfo); outInfoMap.put(hSerial, outInfo);
}else if(outItem.isUrgentAction()){ }else if(outItem.isUrgentAction()){
...@@ -627,6 +668,73 @@ public class QisdaApiController extends BaseController { ...@@ -627,6 +668,73 @@ public class QisdaApiController extends BaseController {
} }
/**
* 更新需求单时间
*/
@RequestMapping(value = "/updateOutInfo",method = RequestMethod.POST)
@ResponseBody
public Object updateOutInfo(HttpServletRequest request) {
try {
String paramInfo = receiveParamInfo(request,"paramInfo");
log.info("收到需求单修改时间请求:"+paramInfo);
if(paramInfo == null){
return ResultBean.newErrorResult(-1,"参数为空");
}
List<RequestOutItemBean> items = JsonUtil.toList(paramInfo, RequestOutItemBean.class);
Map<String,String> resultMap = new HashMap<>();
log.info("需求单修改时间请求解析成功,开始处理");
for (RequestOutItemBean itemBean : items) {
OutItem outItem = new OutItem(itemBean);
String hSerial = outItem.gethSerial();
OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
String resultMsg = "";
if(outInfo == null){
resultMsg = "需求单号不存在";
}else{
boolean outInfoExecuted = outInfo.getFirstExecuteTime() > 0;
if(outInfoExecuted){
resultMsg = "需求单已执行过,不允许修改";
}else{
Date now = new Date();
Date oldMustDate = outInfo.getMdate();
Date newSuggestDate = outItem.getSdate();
Date newMustDate = outItem.getMdate();
if(oldMustDate.before(now)){
resultMsg = "需求单已到达必须时间,不允许修改";
}else if(newSuggestDate.before(now)){
resultMsg = "新的建议时间不能早于当前时间";
}else if(newMustDate.before(now)){
resultMsg = "新的必须时间不能早于当前时间";
}else{
if(newMustDate != null){
outInfo.setMdate(newMustDate);
}
if(newSuggestDate != null){
outInfo.setSdate(newSuggestDate);
}
String newLine = outItem.getLine();
if(Strings.isNullOrEmpty(newLine)){
outInfo.setLine(outItem.getLine());
}
outInfoCache.updateOutInfo(outInfo);
resultMsg = "ok";
}
}
}
resultMap.put(hSerial, resultMsg);
log.info("需求单["+hSerial+"]修改时间结果:"+resultMsg);
}
return ResultBean.newOkResult(resultMap);
} catch (Exception e) {
log.error("需求单修改时间请求处理出错", e);
return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage());
}
}
//-------------------------Private Method---------------------------------------- //-------------------------Private Method----------------------------------------
......
...@@ -90,6 +90,55 @@ public class QisdaBindService { ...@@ -90,6 +90,55 @@ public class QisdaBindService {
} }
} }
/**
* 绑定PN需求单
*/
public void bindPnOutInfo(OutInfo pnOutInfo){
log.info("Pn需求单["+pnOutInfo.gethSerial()+"]线别["+pnOutInfo.getLine()+"]开始进行绑定");
for (OutItem outItem : pnOutInfo.getOutItems()) {
int needNum = outItem.getQty() - outItem.getSendQty() - outItem.getRealLockQty();
//log.info("开始绑定,所需数量("+needNum+")=需求单数量("+outItem.getQty()+")-已发料数量("+ outItem.getSendQty()+")-真实绑定数量"+ outItem.getRealLockQty() +")");
if(needNum >= 0){
log.info("查找未绑定料盘进行真实绑定结束,当前数量:"+outItem.getSendQty()+"+"+ outItem.getRealLockQty() +"/" + outItem.getQty());
while(needNum >= 0){
StoragePos pos = storagePosDao.findNoBindMinQty(outItem.getPn(), outItem.getFacility());
if(pos != null){
Barcode barcode = pos.getBarcode();
AppendInfo appendInfo = barcode.getAppendInfo();
//未真实绑定过,可以出库,绑定
appendInfo.sethSerial(outItem.gethSerial());
appendInfo.setRefno(outItem.getRefno());
appendInfo.setSo("HSerial-" + outItem.gethSerial());
appendInfo.setSoseq("HSerial-" + outItem.gethSerial());
appendInfo.setSlotStr(outItem.getSlotStr());
appendInfo.setOutItemId(outItem.getId());
appendInfo.setBindSlot("1");
appendInfo.setSlotIndex(1);
barcode.setAppendInfo(appendInfo);
pos.setBarcode(barcode);
storagePosDao.save(pos);
int totalLockQty = outItem.getLockQty() + barcode.getAmount();
outItem.setLockQty(totalLockQty);
outItem.setRealLockQty(totalLockQty);
log.info("绑定料盘"+barcode.getBarcode()+"["+barcode.getPartNumber()+"]到PN需求单["+outItem.gethSerial()+"]");
}else{
break;
}
if(outItem.getRealLockQty() > outItem.getQty()){
//已经满足需求了,直接跳出
break;
}
}
}
outItem = outItemDao.save(outItem);
pnOutInfo.updateItem(outItem);
}
}
/******************************** 以下是 Private 方法*******************************************/ /******************************** 以下是 Private 方法*******************************************/
...@@ -323,102 +372,106 @@ public class QisdaBindService { ...@@ -323,102 +372,106 @@ public class QisdaBindService {
* 绑定入库料盘 * 绑定入库料盘
*/ */
public Barcode bindPutInReel(Barcode barcode){ public Barcode bindPutInReel(Barcode barcode){
boolean isCutReelIn = false; // boolean isCutReelIn = false;
String bindSoseq = barcode.getAppendInfo().getSoseq(); // String bindSoseq = barcode.getAppendInfo().getSoseq();
String bindSlot = barcode.getAppendInfo().getBindSlot(); // String bindSlot = barcode.getAppendInfo().getBindSlot();
OutItem bindItem = null; // OutItem bindItem = null;
if(Strings.isBlank(bindSoseq)){ // if(Strings.isBlank(bindSoseq)){
//未绑定 // //未绑定
bindItem = findNeedBindItem(barcode); // bindItem = findNeedBindItem(barcode);
}else{ // barcode = barcode.removeBindInfo();
//料盘分盘过后入库(已经预绑定过) // }else{
isCutReelIn = true; // //料盘分盘过后入库(已经预绑定过)
bindItem = soseqCache.getCutOutItem(bindSoseq, Integer.valueOf(bindSlot)); // isCutReelIn = true;
} // bindItem = soseqCache.getCutOutItem(bindSoseq, Integer.valueOf(bindSlot));
if(bindItem != null){ // }
log.info("找到未绑定需求单["+bindItem.gethSerial()+"],准备进行绑定"); // if(bindItem != null){
if(bindItem.isPnAction()){ // log.info("找到未绑定需求单["+bindItem.gethSerial()+"],准备进行绑定");
OutInfo outInfo = outInfoCache.getOutInfoFromCache(bindItem.gethSerial()); // if(bindItem.isPnAction()){
if(outInfo != null && outInfo.isClosed()){ // OutInfo outInfo = outInfoCache.getOutInfoFromCache(bindItem.gethSerial());
log.info("需求单["+outInfo.gethSerial()+"]已关闭,不再绑定料盘["+barcode.getBarcode()+"]"); // if(outInfo != null && outInfo.isClosed()){
barcode = barcode.removeBindInfo(); // log.info("需求单["+outInfo.gethSerial()+"]已关闭,不再绑定料盘["+barcode.getBarcode()+"]");
}else{ // barcode = barcode.removeBindInfo();
AppendInfo appendInfo = barcode.getAppendInfo(); // }else{
//未真实绑定过,可以出库,绑定 // AppendInfo appendInfo = barcode.getAppendInfo();
appendInfo.sethSerial(bindItem.gethSerial()); // //未真实绑定过,可以出库,绑定
appendInfo.setRefno(bindItem.getRefno()); // appendInfo.sethSerial(bindItem.gethSerial());
appendInfo.setSo("HSerial-" + bindItem.gethSerial()); // appendInfo.setRefno(bindItem.getRefno());
appendInfo.setSoseq("HSerial-" + bindItem.gethSerial()); // appendInfo.setSo("HSerial-" + bindItem.gethSerial());
appendInfo.setSlotStr(bindItem.getSlotStr()); // appendInfo.setSoseq("HSerial-" + bindItem.gethSerial());
appendInfo.setOutItemId(bindItem.getId()); // appendInfo.setSlotStr(bindItem.getSlotStr());
// appendInfo.setOutItemId(bindItem.getId());
appendInfo.setBindSlot("1"); //
appendInfo.setSlotIndex(1); // appendInfo.setBindSlot("1");
barcode.setAppendInfo(appendInfo); // appendInfo.setSlotIndex(1);
int totalLockQty = bindItem.getLockQty() + barcode.getAmount(); // barcode.setAppendInfo(appendInfo);
bindItem.setLockQty(totalLockQty); // int totalLockQty = bindItem.getLockQty() + barcode.getAmount();
bindItem.setRealLockQty(totalLockQty); // bindItem.setLockQty(totalLockQty);
outItemDao.updateLockQty(bindItem.getId(), totalLockQty, totalLockQty); // bindItem.setRealLockQty(totalLockQty);
outInfoCache.updateOutItem(bindItem.getId()); // outItemDao.updateLockQty(bindItem.getId(), totalLockQty, totalLockQty);
log.info("绑定料盘["+barcode.getBarcode()+"]到需求单["+bindItem.gethSerial()+"]完成"); //
} // int bindCount = storagePosDao.countBind(bindItem.gethSerial());
}else if(bindItem.isReelCutAction()){ // outInfoCache.updateBindNum(bindItem.gethSerial(),bindCount);
OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(bindItem.getSoseq()); // outInfoCache.updateOutItem(bindItem.getId());
if(cutOutInfo != null && cutOutInfo.isClosed()){ // log.info("绑定料盘["+barcode.getBarcode()+"]到需求单["+bindItem.gethSerial()+"]完成");
log.info("工单["+cutOutInfo.getSo()+"]已关闭,不再绑定料盘["+barcode.getBarcode()+"]"); // }
barcode = barcode.removeBindInfo(); // }else if(bindItem.isReelCutAction()){
}else{ // OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(bindItem.getSoseq());
//分盘料 // if(cutOutInfo != null && cutOutInfo.isClosed()){
if(bindItem.isCutMaterial()){ // log.info("工单["+cutOutInfo.getSo()+"]已关闭,不再绑定料盘["+barcode.getBarcode()+"]");
if(!isCutReelIn){ // barcode = barcode.removeBindInfo();
//不是分完盘入库的,需要先进行预绑定 // }else{
int preBindQty = bindItem.getLockQty() + barcode.getAmount(); // //分盘料
if(preBindQty > bindItem.getQty()){ // if(bindItem.isCutMaterial()){
int reelRemainNum = barcode.cutCount(bindItem); // if(!isCutReelIn){
if(reelRemainNum > 0){ // //不是分完盘入库的,需要先进行预绑定
//母盘还有剩余,说明该需求slot已经满足 // int preBindQty = bindItem.getLockQty() + barcode.getAmount();
preBindQty = bindItem.getQty(); // if(preBindQty > bindItem.getQty()){
}else { // int reelRemainNum = barcode.cutCount(bindItem);
//母盘正好用完或全部用完也达不到需求量,此母盘绑定slot后,需要继续寻找其他盘进行绑定 // if(reelRemainNum > 0){
preBindQty = preBindQty + barcode.getAmount(); // //母盘还有剩余,说明该需求slot已经满足
} // preBindQty = bindItem.getQty();
} // }else {
bindItem.setLockQty(preBindQty); // //母盘正好用完或全部用完也达不到需求量,此母盘绑定slot后,需要继续寻找其他盘进行绑定
soseqCache.udpateTotalPreLockQty(bindItem,preBindQty); // preBindQty = preBindQty + barcode.getAmount();
// }
// }
log.info("\t分盘料"+barcode.getBarcode()+"["+barcode.getPartNumber()+"]绑定到soseq=["+bindItem.getSoseq()+"]so=["+bindItem.getSo()+"]的["+bindItem.getSlotlocation()+"] 数量:" + preBindQty +"/" + bindItem.getQty()); // bindItem.setLockQty(preBindQty);
} // soseqCache.udpateTotalPreLockQty(bindItem,preBindQty);
//
if(!barcode.hasCutInfo()){ //
//没有分盘信息,可以直接绑定 // log.info("\t分盘料"+barcode.getBarcode()+"["+barcode.getPartNumber()+"]绑定到soseq=["+bindItem.getSoseq()+"]so=["+bindItem.getSo()+"]的["+bindItem.getSlotlocation()+"] 数量:" + preBindQty +"/" + bindItem.getQty());
barcode.realBindItem(bindItem); // }
int realBindQty = bindItem.getRealLockQty() + barcode.getAmount(); //
bindItem.setRealLockQty(realBindQty); // if(!barcode.hasCutInfo()){
soseqCache.updateTotalRealLockQty(bindItem,realBindQty); // //没有分盘信息,可以直接绑定
}else{ // barcode.realBindItem(bindItem);
AppendInfo appendInfo = barcode.getAppendInfo(); // int realBindQty = bindItem.getRealLockQty() + barcode.getAmount();
appendInfo.setSlotIndex(bindItem.getSlotlocation()); // bindItem.setRealLockQty(realBindQty);
appendInfo.setSo(bindItem.getSo()); // soseqCache.updateTotalRealLockQty(bindItem,realBindQty);
appendInfo.setSoseq(bindItem.getSoseq()); // }else{
barcode.setAppendInfo(appendInfo); // AppendInfo appendInfo = barcode.getAppendInfo();
log.info("分盘料["+barcode.getBarcode()+"]分盘信息:" + barcode.getAppendInfo().getCutMap()); // appendInfo.setSlotIndex(bindItem.getSlotlocation());
} // appendInfo.setSo(bindItem.getSo());
}else{ // appendInfo.setSoseq(bindItem.getSoseq());
//绑定 // barcode.setAppendInfo(appendInfo);
barcode.realBindItem(bindItem); // log.info("分盘料["+barcode.getBarcode()+"]分盘信息:" + barcode.getAppendInfo().getCutMap());
int realBindQty = bindItem.getRealLockQty() + barcode.getAmount(); // }
bindItem.setRealLockQty(realBindQty); // }else{
soseqCache.updateTotalRealLockQty(bindItem,realBindQty); // //绑定
log.info(barcode.getBarcode() + "["+barcode.getPartNumber()+"]入库完成,工单so=["+bindItem.getSo()+"] soseq=["+bindItem.getSoseq()+"]slotSeq=["+bindItem.getSlotlocation()+"]绑定数量增加"+barcode.getAmount()+"="+ realBindQty); // barcode.realBindItem(bindItem);
} // int realBindQty = bindItem.getRealLockQty() + barcode.getAmount();
// bindItem.setRealLockQty(realBindQty);
unbindSurplusReel(bindItem); // soseqCache.updateTotalRealLockQty(bindItem,realBindQty);
} // log.info(barcode.getBarcode() + "["+barcode.getPartNumber()+"]入库完成,工单so=["+bindItem.getSo()+"] soseq=["+bindItem.getSoseq()+"]slotSeq=["+bindItem.getSlotlocation()+"]绑定数量增加"+barcode.getAmount()+"="+ realBindQty);
} // }
} //
// unbindSurplusReel(bindItem);
barcode = barcodeDao.save(barcode); // }
// }
// }
//
// barcode = barcodeDao.save(barcode);
return barcode; return barcode;
} }
...@@ -466,6 +519,7 @@ public class QisdaBindService { ...@@ -466,6 +519,7 @@ public class QisdaBindService {
List<OutInfo> cacheOutInfoList = outInfoCache.getCachedOutInfos(); List<OutInfo> cacheOutInfoList = outInfoCache.getCachedOutInfos();
List<String> lessHSerialList = new ArrayList<>(); List<String> lessHSerialList = new ArrayList<>();
for (OutInfo unEndOutInfo : cacheOutInfoList) { for (OutInfo unEndOutInfo : cacheOutInfoList) {
if(Strings.isNotBlank(unEndOutInfo.getLine())){
if(!unEndOutInfo.isClosed() && !unEndOutInfo.isRealBindOk()){ if(!unEndOutInfo.isClosed() && !unEndOutInfo.isRealBindOk()){
if(unEndOutInfo.isPnAction()){ if(unEndOutInfo.isPnAction()){
lessHSerialList.add(unEndOutInfo.gethSerial()); lessHSerialList.add(unEndOutInfo.gethSerial());
...@@ -473,7 +527,7 @@ public class QisdaBindService { ...@@ -473,7 +527,7 @@ public class QisdaBindService {
lessHSerialList.add(unEndOutInfo.gethSerial()); lessHSerialList.add(unEndOutInfo.gethSerial());
} }
} }
}
} }
String pn = barcode.getPartNumber(); String pn = barcode.getPartNumber();
...@@ -481,6 +535,7 @@ public class QisdaBindService { ...@@ -481,6 +535,7 @@ public class QisdaBindService {
//List<OutItem> cutItemList = outItemDao.findCutItemList(lessSoseqList, pn, facility); //List<OutItem> cutItemList = outItemDao.findCutItemList(lessSoseqList, pn, facility);
log.info("查找["+String.join(",",lessHSerialList)+"]未完成pn=["+pn+"]facility=["+facility+"]的需求单详情");
List<OutItem> outItemList = outItemDao.findUnFinishedItemList(lessHSerialList,pn, facility); List<OutItem> outItemList = outItemDao.findUnFinishedItemList(lessHSerialList,pn, facility);
//优先绑定执行过的工单,如果没有,则绑定优先执行的工单 //优先绑定执行过的工单,如果没有,则绑定优先执行的工单
...@@ -489,8 +544,11 @@ public class QisdaBindService { ...@@ -489,8 +544,11 @@ public class QisdaBindService {
for (OutItem outItem : outItemList) { for (OutItem outItem : outItemList) {
if(!outItem.isBindOk()){ if(!outItem.isBindOk()){
OutInfo outInfo = soseqCache.getCutActionInfoFromCache(outItem.getSoseq());
OutInfo outInfo = outInfoCache.getOutInfoFromCache(outItem.gethSerial());
if(outInfo != null){ if(outInfo != null){
//只对有目的地并且缺料的进行绑定
if(outInfo.isPnAction() || outInfo.isReelCutAction()){
//真实绑定缺料 //真实绑定缺料
if(outItem.realBindLessQty() > 0){ if(outItem.realBindLessQty() > 0){
int orderIndex = lessHSerialList.indexOf(outItem.gethSerial()); int orderIndex = lessHSerialList.indexOf(outItem.gethSerial());
...@@ -500,6 +558,8 @@ public class QisdaBindService { ...@@ -500,6 +558,8 @@ public class QisdaBindService {
} }
} }
} }
}
} }
} }
......
...@@ -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;
......
...@@ -17,12 +17,6 @@ ...@@ -17,12 +17,6 @@
</style> </style>
<c:if test="${stopOut}">
系统更新中,暂停出库,请稍后再试
</c:if>
<c:if test="${!stopOut}">
<!-- BEGIN PAGE HEADER--> <!-- BEGIN PAGE HEADER-->
<h3 class="page-title"> <h3 class="page-title">
<fmt:message key="需求单"/> <fmt:message key="需求单"/>
...@@ -59,15 +53,27 @@ ...@@ -59,15 +53,27 @@
</div> </div>
</div> </div>
<label class="control-label col-md-1"><fmt:message key="ReelId"/></label> <label class="control-label col-md-1"><fmt:message key="线别"/></label>
<div class="col-md-1">
<select class="form-control" name="line">
<option value="">所有</option>
<option value="NONE" <c:if test='${line=="NONE"}'>selected</c:if>>未定义</option>
<c:forEach begin="1" end="20" var="lineStr">
<c:set var="lineValue" value="SMT${lineStr}"/>
<option value="${lineValue}" <c:if test='${line == lineValue}'>selected</c:if>>${lineValue}</option>
</c:forEach>
</select>
</div>
<label class="control-label col-md-1"><fmt:message key="PN"/></label>
<div class="col-md-2"> <div class="col-md-2">
<div style="text-align:left" class="input-group"> <div style="text-align:left" class="input-group">
<input type="text" name="reelId" class="form-control" value="${reelId}"/> <input type="text" name="reelId" class="form-control" value="${pn}"/>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="col-md-1">
<button class="btn purple" type="submit"><i class="fa fa-search"></i> <button class="btn purple" type="submit"><i class="fa fa-search"></i>
<fmt:message key="button.search"/> <fmt:message key="button.search"/>
</button> </button>
...@@ -83,6 +89,10 @@ ...@@ -83,6 +89,10 @@
<c:if test="${outInfo.endOutInfo}"> <c:if test="${outInfo.endOutInfo}">
<c:set var="endOutInfoClass" value="bg-yellow"/> <c:set var="endOutInfoClass" value="bg-yellow"/>
</c:if> </c:if>
<c:set var="closedClass" value=""/>
<c:if test="${outInfo.closed}">
<c:set var="closedClass" value="closed"/>
</c:if>
<display:column titleKey="需求单号" sortable="true" sortProperty="hSerial" media="html"> <display:column titleKey="需求单号" sortable="true" sortProperty="hSerial" media="html">
<a href="#" onclick="showDetail('${outInfo.hSerial}')">${outInfo.hSerial}</a> <a href="#" onclick="showDetail('${outInfo.hSerial}')">${outInfo.hSerial}</a>
</display:column> </display:column>
...@@ -91,8 +101,14 @@ ...@@ -91,8 +101,14 @@
<display:column titleKey="工单" sortable="true" sortProperty="so"> <display:column titleKey="工单" sortable="true" sortProperty="so">
${outInfo.so}<c:if test="${outInfo.soseq != null}">(${outInfo.soseq})</c:if> ${outInfo.so}<c:if test="${outInfo.soseq != null}">(${outInfo.soseq})</c:if>
</display:column> </display:column>
<display:column titleKey="线别" property="line" sortable="true" sortProperty="line"/> <display:column titleKey="线别" sortable="true" sortProperty="line" media="html">
<display:column titleKey="备料单号" property="refno" sortable="true" sortProperty="refno"/> <span id="${outInfo.hSerial}Line">${outInfo.line}</span>
<c:if test="${outInfo.firstExecuteTime <=0}">
<a href="#" onclick="changeLine('${outInfo.hSerial}')">[编辑]</a>
</c:if>
</display:column>
<%--<display:column titleKey="备料单号" property="refno" sortable="true" sortProperty="refno"/>--%>
<display:column titleKey="建议出仓时间" sortable="true" sortProperty="sdate"> <display:column titleKey="建议出仓时间" sortable="true" sortProperty="sdate">
<fmt:formatDate value="${outInfo.sdate}" pattern="yyyy-MM-dd HH:mm"/> <fmt:formatDate value="${outInfo.sdate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column> </display:column>
...@@ -100,27 +116,32 @@ ...@@ -100,27 +116,32 @@
<fmt:formatDate value="${outInfo.mdate}" pattern="yyyy-MM-dd HH:mm"/> <fmt:formatDate value="${outInfo.mdate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column> </display:column>
<display:column titleKey="任务" sortable="true" sortProperty="mdate"> <display:column titleKey="任务" sortable="true" sortProperty="taskNum">
${outInfo.taskFinishNum}/${outInfo.taskNum} ${outInfo.taskFinishNum}/${outInfo.taskNum}
</display:column> </display:column>
<display:column titleKey="累计任务" sortable="true" sortProperty="totalTaskNum"> <display:column titleKey="绑定数量" sortable="true" sortProperty="totalBindNum" class="${closedClass}">
${outInfo.totalTaskNum}/${outInfo.totalBindNum} ${outInfo.totalBindNum}
<%--<c:if test="${!outInfo.closed}">--%>
<%--<a href="#" class="right" onclick="closeOut('${outInfo.hSerial}')" id="${outInfo.hSerial}Btn">--%>
<%--[<fmt:message key="关闭"/>]--%>
<%--</a>--%>
<%--</c:if>--%>
</display:column> </display:column>
<display:column titleKey="创建时间" sortable="true" sortProperty="createDate"> <display:column titleKey="创建时间" sortable="true" sortProperty="createDate" >
<fmt:formatDate value="${outInfo.createDate}" pattern="yyyy-MM-dd HH:mm"/> <fmt:formatDate value="${outInfo.createDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column> </display:column>
<display:column titleKey="更新时间" sortable="true" sortProperty="updateDate"> <%--<display:column titleKey="更新时间" sortable="true" sortProperty="updateDate">--%>
<fmt:formatDate value="${outInfo.updateDate}" pattern="yyyy-MM-dd HH:mm"/> <%--<fmt:formatDate value="${outInfo.updateDate}" pattern="yyyy-MM-dd HH:mm"/>--%>
</display:column> <%--</display:column>--%>
<display:column titleKey="需求时间" sortable="true" sortProperty="taskNeedOutDate"> <display:column titleKey="需求时间" sortable="true" sortProperty="taskNeedOutDate">
<fmt:formatDate value="${outInfo.taskNeedOutDate}" pattern="yyyy-MM-dd HH:mm"/> <fmt:formatDate value="${outInfo.taskNeedOutDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column> </display:column>
<display:column titleKey="checkOut.operate" media="html" sortProperty="sendStatus" sortable="true"> <display:column titleKey="checkOut.operate" media="html" sortProperty="sendStatus" sortable="true">
<c:if test="${!outInfo.executing}"> <c:if test="${!outInfo.executing && stopJob}">
<c:if test="${(outInfo.urgentAction && outInfo.taskFinishNum != outInfo.taskNum) || (!outInfo.sendEnd && !outInfo.closed)}"> <c:if test="${(outInfo.urgentAction && outInfo.taskFinishNum != outInfo.taskNum) || (!outInfo.sendEnd && !outInfo.closed)}">
<button class="btn yellow" id="btn${outInfo.hSerial}" onclick="executeOut('${outInfo.hSerial}')"> <button class="btn yellow" id="btn${outInfo.hSerial}" onclick="executeOut('${outInfo.hSerial}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/> <i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/>
...@@ -141,7 +162,6 @@ ...@@ -141,7 +162,6 @@
<!-- END EXAMPLE TABLE PORTLET--> <!-- END EXAMPLE TABLE PORTLET-->
</div> </div>
</div> </div>
</c:if>
<div id="detail" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false"> <div id="detail" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="margin-top: 10%;width:80%;margin-left:10%;"> <div class="modal-dialog" style="margin-top: 10%;width:80%;margin-left:10%;">
...@@ -202,6 +222,45 @@ ...@@ -202,6 +222,45 @@
</div> </div>
</div> </div>
<div id="lineModifyWindow" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="margin-top: 10%;width:50%;margin-left:25%;">
<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;">线别修改</h4>
</div>
<div class="modal-body" style="height:80px;overflow-y:hidden;">
<div class="row">
<label class="control-label col-md-2"><fmt:message key="线别:"/></label>
<div class="input-group">
<input type="hidden" id="hSerialToModify" value=""/>
<select class="form-control" id="lineToModify">
<option value="">--</option>
<c:forEach begin="1" end="20" var="line">
<option value="SMT${line}">SMT${line}</option>
</c:forEach>
</select>
</div>
<h4>
<span id="lineErrorMsg" style="font-weight: 500;color:red;"></span>
</h4>
</div>
</div>
<div class="modal-footer">
<div>
<%--<a href="" class="btn yellow left" id="findAndOut"><i class="fa fa-sign-out"></i><fmt:message key="allBoxView.findAndOut"/></a>--%>
<button type="button" class="btn green" onclick="lineModifyOkClick();" >
<fmt:message key="button.save"/></button>
<button type="button" data-dismiss="modal" class="btn default" id="cancelAuthBtn"><fmt:message key="button.cancel"/></button>
</div>
</div>
</div>
</div>
</div>
<c:set var="scripts" scope="request"> <c:set var="scripts" scope="request">
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
...@@ -265,6 +324,44 @@ ...@@ -265,6 +324,44 @@
}); });
} }
closeOut = function(hSerial){
Lobibox.confirm({
title: "确认",
msg: "确定要关闭并解绑需求单["+hSerial+"]吗?",
callback: function ($this, type, ev) {
if(type == 'yes'){
$.post("${ctx}/service/store/qisda/closeHSerial", {hSerial: hSerial}, function (data) {
if(data){
Lobibox.alert("success",
{
msg: data
});
var btnId = "#" +hSerial + "Btn";
$(btnId).hide();
}
});
}
}
});
}
changeLine = function (hSerial){
$("#hSerialToModify").val(hSerial);
var oldLine = $("#lineToModify").text();
$("#lineToModify").val(oldLine);
$("#lineModifyWindow").modal("show");
}
lineModifyOkClick = function(){
var line = $("#lineToModify").val();
var hSerial = $("#hSerialToModify").val();
$.post("${ctx}/rest/api/dcs/updateLine", {hSerial: hSerial, line: line}, function (data) {
$("#"+hSerial+"Line").html(line);
$("#lineModifyWindow").modal("hide");
});
}
$(".filterInput").on('input propertychange',function(){ $(".filterInput").on('input propertychange',function(){
var searchStr = $(this).val(); var searchStr = $(this).val();
$(".theItems").children().each(function(){ $(".theItems").children().each(function(){
...@@ -276,6 +373,11 @@ ...@@ -276,6 +373,11 @@
}); });
}); });
$(".closed").each(function(){
var oldClass = $(this).parent().attr("class");
$(this).parents("tr").attr("class",oldClass + " font-grey");
});
}); });
</script> </script>
</c:set> </c:set>
\ No newline at end of file \ No newline at end of file
...@@ -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!