Commit 95065b61 sunke

Pn类型需求单修改

1 个父辈 aa23f2d3
...@@ -278,10 +278,16 @@ public class BarcodeRule { ...@@ -278,10 +278,16 @@ public class BarcodeRule {
codeValue = codeValue.trim(); codeValue = codeValue.trim();
//如果有前缀和后缀 //如果有前缀和后缀
if(prefix > 0){ if(prefix > 0){
if(prefix >= codeValue.length()){
return null;
}
codeValue = codeValue.substring(prefix); codeValue = codeValue.substring(prefix);
} }
if(suffix > 0){ if(suffix > 0){
if(suffix >= codeValue.length()){
return null;
}
codeValue = codeValue.substring(0, codeValue.length() - suffix); codeValue = codeValue.substring(0, codeValue.length() - suffix);
} }
......
...@@ -451,10 +451,34 @@ public class OutInfoCache { ...@@ -451,10 +451,34 @@ public class OutInfoCache {
return ResultBean.newErrorResult(2201,"无需求单号参数hSerial,无法关闭"); return ResultBean.newErrorResult(2201,"无需求单号参数hSerial,无法关闭");
} }
log.info("开始关闭需求单hSerial=["+hSerial+"]"); log.info("开始关闭需求单hSerial=["+hSerial+"]");
OutInfo outInfoFromCache = getOutInfoFromCache(hSerial);
String unbindMsg = "";
if(outInfoFromCache != null){
if(outInfoFromCache.isPnAction() || outInfoFromCache.isUrgentAction()){
int count = 0;
List<StoragePos> bindPosList = storagePosDao.findBindList(hSerial);
for (StoragePos storagePos : bindPosList) {
Barcode barcode = storagePos.getBarcode();
count = count + 1;
log.info("解除["+barcode.getBarcode()+"]的需求单so=["+hSerial+"]绑定,累计解除"+count);
storagePos = storagePosDao.unbindReel(storagePos);
barcode = storagePos.getBarcode();
barcode = qisdaBindService.bindPutInReel(barcode);
String bindSoseq = barcode.getAppendInfo().getSoseq();
if(!Strings.isEmpty(bindSoseq)){
log.info("料盘["+barcode.getBarcode()+"]绑定到新工单soseq="+bindSoseq);
storagePos.setBarcode(barcode);
storagePosDao.save(storagePos);
}
}
unbindMsg = ",共解绑"+ count+"盘物料";
}
}
int sendStatus = StorageConstants.SEND_STATUS.CLOSED; int sendStatus = StorageConstants.SEND_STATUS.CLOSED;
outInfoDao.updateStatus(hSerial, -1 ,sendStatus); outInfoDao.updateStatus(hSerial, -1 ,sendStatus);
removeFromCache(hSerial); removeFromCache(hSerial);
return ResultBean.newOkResult("需求单hSerial=["+hSerial+"]关闭成功",""); return ResultBean.newOkResult("需求单hSerial=["+hSerial+"]关闭成功"+unbindMsg,"");
} }
public ResultBean closeSoSeq(String soseq){ public ResultBean closeSoSeq(String soseq){
...@@ -773,7 +797,7 @@ public class OutInfoCache { ...@@ -773,7 +797,7 @@ public class OutInfoCache {
} }
} }
InquiryShelfBean.clearShelf(outInfo.gethSerial()); //InquiryShelfBean.clearShelf(outInfo.gethSerial());
outInfo.setTaskEndTime(System.currentTimeMillis()); outInfo.setTaskEndTime(System.currentTimeMillis());
outInfoDao.updateTaskEndTime(outInfo.gethSerial(), outInfo.getTaskEndTime()); outInfoDao.updateTaskEndTime(outInfo.gethSerial(), outInfo.getTaskEndTime());
......
...@@ -8,6 +8,7 @@ import com.myproject.bean.qisda.ShelfLoc; ...@@ -8,6 +8,7 @@ import com.myproject.bean.qisda.ShelfLoc;
import com.myproject.bean.update.DataLog; import com.myproject.bean.update.DataLog;
import com.myproject.bean.update.Storage; import com.myproject.bean.update.Storage;
import com.myproject.bean.update.qisda.OutInfo; import com.myproject.bean.update.qisda.OutInfo;
import com.myproject.dao.mongo.qisda.IOutInfoDao;
import com.myproject.util.StorageConstants; import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.qisda.util.OutInfoCache; import com.myproject.webapp.controller.qisda.util.OutInfoCache;
import org.apache.cxf.jaxws.handler.types.CString; import org.apache.cxf.jaxws.handler.types.CString;
...@@ -33,6 +34,9 @@ public class GreeDeviceController { ...@@ -33,6 +34,9 @@ public class GreeDeviceController {
protected ITaskService taskService; protected ITaskService taskService;
@Autowired @Autowired
private IOutInfoDao outInfoDao;
@Autowired
private OutInfoCache outInfoCache; private OutInfoCache outInfoCache;
protected final static Logger log = LogManager.getLogger(QisdaDeviceController.class); protected final static Logger log = LogManager.getLogger(QisdaDeviceController.class);
...@@ -104,35 +108,20 @@ public class GreeDeviceController { ...@@ -104,35 +108,20 @@ public class GreeDeviceController {
* msg:提示信息 ok为成功,其他表示异常 * msg:提示信息 ok为成功,其他表示异常
* data:表示目标位置 * data:表示目标位置
*/ */
@RequestMapping(value = "/getRfidTargetP") @RequestMapping(value = "/shelfDestination")
@ResponseBody @ResponseBody
public Object getRfidTargetP(HttpServletRequest request) { public Object getRfidTargetP(HttpServletRequest request) {
String rfid = request.getParameter("rfid"); String realRfid = request.getParameter("rfid");
try { String hSerial = QisdaCache.getShelfHSerial(realRfid);
if (!Strings.isBlank(rfid)) { String destination = "NONE";
ShelfInfo shelf = InquiryShelfBean.findShelfByRealRfid(rfid);
if (shelf != null) {
String hSerial = shelf.gethSerial();
OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial); if(hSerial != null){
if (outInfo != null) { OutInfo outInfo = outInfoDao.findByHSerial(hSerial);
String line= outInfo.getLine(); if(outInfo != null){
log.error("获取rfid目的地成功:rfid=" + rfid + ",line=" + line + ""); destination = outInfo.getLine();
return ResultBean.newOkResult(line);
} else {
log.error("获取rfid目的地失败:rfid=" + rfid + ",hSerial=" + hSerial + ",未找到工单信息");
return ResultBean.newErrorResult(3001,"未找到工单信息");
}
} else {
log.error("获取rfid目的地失败:rfid=" + rfid + ",未找到料架信息");
return ResultBean.newErrorResult(3002,"未找到料架信息");
}
} }
} catch (Exception e) {
log.error("获取rfid目的地出错:rfid=" + rfid, e);
return ResultBean.newErrorResult(500,e.getMessage());
} }
return ResultBean.newErrorResult(3003,"位置获取失败"); return ResultBean.newOkResult(destination);
} }
/** /**
...@@ -151,6 +140,7 @@ public class GreeDeviceController { ...@@ -151,6 +140,7 @@ public class GreeDeviceController {
log.info("料架放上AGV时,清理["+realRfid+"]的缓存信息"); log.info("料架放上AGV时,清理["+realRfid+"]的缓存信息");
if(Strings.isNotBlank(realRfid)){ if(Strings.isNotBlank(realRfid)){
InquiryShelfBean.agvRemoveRfid(realRfid); InquiryShelfBean.agvRemoveRfid(realRfid);
QisdaCache.removeShelfHSerial(realRfid);
} }
return ResultBean.newOkResult("料架放上AGV时,清理["+realRfid+"]的缓存信息成功"); return ResultBean.newOkResult("料架放上AGV时,清理["+realRfid+"]的缓存信息成功");
} }
......
...@@ -454,6 +454,7 @@ public class QisdaApiController extends BaseController { ...@@ -454,6 +454,7 @@ public class QisdaApiController extends BaseController {
outInfo = new OutInfo(outItem); outInfo = new OutInfo(outItem);
} }
} }
outItem = outItemDao.save(outItem);
if(outItem.isPnAction()){ if(outItem.isPnAction()){
int needNum = outItem.getQty() - outItem.getSendQty() - outItem.getRealLockQty(); int needNum = outItem.getQty() - outItem.getSendQty() - outItem.getRealLockQty();
...@@ -471,6 +472,7 @@ public class QisdaApiController extends BaseController { ...@@ -471,6 +472,7 @@ public class QisdaApiController extends BaseController {
appendInfo.setSo("HSerial-" + outItem.gethSerial()); appendInfo.setSo("HSerial-" + outItem.gethSerial());
appendInfo.setSoseq("HSerial-" + outItem.gethSerial()); appendInfo.setSoseq("HSerial-" + outItem.gethSerial());
appendInfo.setSlotStr(outItem.getSlotStr()); appendInfo.setSlotStr(outItem.getSlotStr());
appendInfo.setOutItemId(outItem.getId()); appendInfo.setOutItemId(outItem.getId());
appendInfo.setBindSlot("1"); appendInfo.setBindSlot("1");
......
...@@ -336,7 +336,7 @@ public class QisdaBindService { ...@@ -336,7 +336,7 @@ public class QisdaBindService {
bindItem = soseqCache.getCutOutItem(bindSoseq, Integer.valueOf(bindSlot)); bindItem = soseqCache.getCutOutItem(bindSoseq, Integer.valueOf(bindSlot));
} }
if(bindItem != null){ if(bindItem != null){
log.info("找到未绑定需求单["+bindItem.gethSerial()+"],准备进行绑定");
if(bindItem.isPnAction()){ if(bindItem.isPnAction()){
OutInfo outInfo = outInfoCache.getOutInfoFromCache(bindItem.gethSerial()); OutInfo outInfo = outInfoCache.getOutInfoFromCache(bindItem.gethSerial());
if(outInfo != null && outInfo.isClosed()){ if(outInfo != null && outInfo.isClosed()){
...@@ -360,6 +360,7 @@ public class QisdaBindService { ...@@ -360,6 +360,7 @@ public class QisdaBindService {
bindItem.setRealLockQty(totalLockQty); bindItem.setRealLockQty(totalLockQty);
outItemDao.updateLockQty(bindItem.getId(), totalLockQty, totalLockQty); outItemDao.updateLockQty(bindItem.getId(), totalLockQty, totalLockQty);
outInfoCache.updateOutItem(bindItem.getId()); outInfoCache.updateOutItem(bindItem.getId());
log.info("绑定料盘["+barcode.getBarcode()+"]到需求单["+bindItem.gethSerial()+"]完成");
} }
}else if(bindItem.isReelCutAction()){ }else if(bindItem.isReelCutAction()){
OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(bindItem.getSoseq()); OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(bindItem.getSoseq());
...@@ -465,7 +466,7 @@ public class QisdaBindService { ...@@ -465,7 +466,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(!unEndOutInfo.isClosed() && unEndOutInfo.isRealBindLess()){ if(!unEndOutInfo.isClosed() && !unEndOutInfo.isRealBindOk()){
if(unEndOutInfo.isPnAction()){ if(unEndOutInfo.isPnAction()){
lessHSerialList.add(unEndOutInfo.gethSerial()); lessHSerialList.add(unEndOutInfo.gethSerial());
}else if(unEndOutInfo.isReelCutAction()){ }else if(unEndOutInfo.isReelCutAction()){
......
...@@ -56,6 +56,11 @@ public class QisdaCache { ...@@ -56,6 +56,11 @@ public class QisdaCache {
private static String REEL_LOCK_POS_MAP_KEY = "reelLocKPosMap"; private static String REEL_LOCK_POS_MAP_KEY = "reelLocKPosMap";
/** /**
* 料串/料架目的地Map
*/
private static String SHELF_HSERIAL_MAP = "shelfHSerialMap";
/**
* 当前正在执行的工单需求单(首盘,补料),未完成时,其他工单需求单不可执行 * 当前正在执行的工单需求单(首盘,补料),未完成时,其他工单需求单不可执行
*/ */
private static String currentOrderHSerial; private static String currentOrderHSerial;
...@@ -80,6 +85,12 @@ public class QisdaCache { ...@@ -80,6 +85,12 @@ public class QisdaCache {
*/ */
private static Map<String, ReelLockPosInfo> reelLocKPosMap; private static Map<String, ReelLockPosInfo> reelLocKPosMap;
/**
* 料串/料架目的地Map
*/
private static Map<String,String> shelfHSerialMap;
private static boolean isProcessTimer = false; private static boolean isProcessTimer = false;
/** /**
* 定时器,每10秒执行一次 * 定时器,每10秒执行一次
...@@ -103,6 +114,52 @@ public class QisdaCache { ...@@ -103,6 +114,52 @@ public class QisdaCache {
public static void initFromDb(){ public static void initFromDb(){
initApiRequestMap(); initApiRequestMap();
initReelLockPosMap(); initReelLockPosMap();
initShelfDestinationMap();
}
private static void initShelfDestinationMap(){
if(shelfHSerialMap == null){
shelfHSerialMap = new ConcurrentHashMap<>();
CacheInfo cacheInfo = cacheInfoDao.getCacheInfo(SHELF_HSERIAL_MAP);
if(cacheInfo != null){
Map<String, String> shelfMap = (Map<String, String>) cacheInfo.getCacheValue();
shelfHSerialMap.putAll(shelfMap);
log.info("当前料架目的地信息:" + shelfMap);
}
}
}
/**
* 添加料架对应的需求单号
*/
public static void addShelfHSerial(String rfid, String hSerial){
String oldHSerial = shelfHSerialMap.get(rfid);
log.info("添加料架["+rfid+"]的需求单号:" + hSerial);
shelfHSerialMap.put(rfid, hSerial);
cacheInfoDao.updateCacheItem(SHELF_HSERIAL_MAP, shelfHSerialMap);
if(oldHSerial != null){
if(!oldHSerial.equals(hSerial)){
log.error("添加料架["+rfid+"]需求单号["+hSerial+"]失败,料架已有需求单号:" + oldHSerial);
}
}
}
/**
* 清除料架的目的地信息
*/
public static void removeShelfHSerial(String rfid){
String oldHSerial = shelfHSerialMap.get(rfid);
log.info("清除料架["+rfid+"]的需求单号["+oldHSerial+"]信息");
shelfHSerialMap.remove(rfid);
cacheInfoDao.updateCacheItem(SHELF_HSERIAL_MAP, shelfHSerialMap);
}
/**
* 获取料架的目的地
*/
public static String getShelfHSerial(String rfid){
String hSerial = shelfHSerialMap.get(rfid);
return hSerial;
} }
......
...@@ -580,6 +580,7 @@ public class QisdaDeviceController extends BaseController { ...@@ -580,6 +580,7 @@ public class QisdaDeviceController extends BaseController {
private synchronized boolean reelPutInFinished(DataLog cacheTask, String rfid, String rfidLoc){ private synchronized boolean reelPutInFinished(DataLog cacheTask, String rfid, String rfidLoc){
if(cacheTask != null){ if(cacheTask != null){
AppendInfo appendInfo = cacheTask.getAppendInfo(); AppendInfo appendInfo = cacheTask.getAppendInfo();
QisdaCache.addShelfHSerial(rfid,appendInfo.gethSerial());
boolean putResult = InquiryShelfBean.putInShelf(cacheTask,rfid, Integer.valueOf(rfidLoc)); boolean putResult = InquiryShelfBean.putInShelf(cacheTask,rfid, Integer.valueOf(rfidLoc));
//紧急料和分盘料放入失败不影响 //紧急料和分盘料放入失败不影响
boolean isCutTask = cacheTask.isUrgentReel() || cacheTask.isCutReel() || cacheTask.isLessSendReel(); boolean isCutTask = cacheTask.isUrgentReel() || cacheTask.isCutReel() || cacheTask.isLessSendReel();
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT">--%> <%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT">--%>
<div class="col-md-2 col-xs-2 menuItem"> <div class="col-md-2 col-xs-2 menuItem">
<a href="${ctx}/qisda/dnInfoSearch.html"> <a href="${ctx}/qisda/outInfoSearch.html">
<img src="${ctx}/images/menu/11.png" class="menuImg"/> <img src="${ctx}/images/menu/11.png" class="menuImg"/>
<div><fmt:message key="出入库"/></div> <div><fmt:message key="出入库"/></div>
</a> </a>
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
executeOut = function (hSerial){ executeOut = function (hSerial){
$("#btn"+hSerial).attr("disabled","true"); $("#btn"+hSerial).attr("disabled","true");
$.post("${ctx}/rest/api/qisda/executeOut", {hSerial: hSerial}, function (data) { $.post("${ctx}/rest/api/dcs/executeOut", {hSerial: hSerial}, function (data) {
alert(data); alert(data);
}); });
} }
......
...@@ -54,16 +54,16 @@ ...@@ -54,16 +54,16 @@
<fmt:message key="出库"/><span class="selected"></span> <fmt:message key="出库"/><span class="selected"></span>
</a> </a>
</li> </li>
<li class="classic-menu-dropdown"> <%--<li class="classic-menu-dropdown">--%>
<a href="${ctx}/qisda/stockCheck.html" name="qisda"> <%--<a href="${ctx}/qisda/stockCheck.html" name="qisda">--%>
<fmt:message key="盘点"/><span class="selected"></span> <%--<fmt:message key="盘点"/><span class="selected"></span>--%>
</a> <%--</a>--%>
</li> <%--</li>--%>
<li class="classic-menu-dropdown"> <%--<li class="classic-menu-dropdown">--%>
<a href="${ctx}/qisda/diffInventory.html" name="qisda"> <%--<a href="${ctx}/qisda/diffInventory.html" name="qisda">--%>
<fmt:message key="库存比对"/><span class="selected"></span> <%--<fmt:message key="库存比对"/><span class="selected"></span>--%>
</a> <%--</a>--%>
</li> <%--</li>--%>
</ul> </ul>
</security:authorize> </security:authorize>
<%--Work Order--%> <%--Work Order--%>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
<datasource-mapping> <datasource-mapping>
<factory-entry name="ApplicationEntityManager" /> <factory-entry name="ApplicationEntityManager" />
</datasource-mapping> </datasource-mapping>
<naming-strategy-map />
<deploymentDescriptor name="persistence.xml" url="file://$MODULE_DIR$/src/main/resources/META-INF/persistence.xml" /> <deploymentDescriptor name="persistence.xml" url="file://$MODULE_DIR$/src/main/resources/META-INF/persistence.xml" />
</configuration> </configuration>
</facet> </facet>
...@@ -32,7 +31,7 @@ ...@@ -32,7 +31,7 @@
<configuration /> <configuration />
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" /> <output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!