Commit 5e46f9f7 sunke

DN单入库时增加扫描数量

1 个父辈 5aa21a07
C:\Windows\system32>mongod --storageEngine=mmapv1 --logappend --directoryperdb --serviceName MongoDB --install
打印机静默打印: Chrome快捷方式增加:--kiosk-printing
--disable-print-preview
#添加索引
db.barcode.ensureIndex({"barcode":1},{"unique":true})
db.outItem.ensureIndex({"soseq":1})
db.outItem.createIndex({hSerial:-1,slotlocation:1})
###安装Mongodb服务
1、创建 D:\MongoDB 及 D:\MongoDB\data 和 D:\MongoDB\logs 目录
2、执行 mongod --storageEngine=mmapv1 --journal --logpath D:\MongoDB\logs\MongoDB.log --logappend --dbpath D:\MongoDB\data --directoryperdb --serviceName MongoDB --install
移除MongoDB:
sc delete MongoDB
mongod --auth -dbpath D:\MongoDB\data --repair
mac mongo 启动:
sudo mongod -config /usr/local/etc/mongod.conf
Tomcat 8 启动时会出现 webresources.Cache.getResource Unable to add the resource at 的错误,需要在Tomcat的在 /conf/context.xml 的 </Context>前添加以下内容:
<Resources cachingAllowed="true" cacheMaxSize="100000" />
//备份
mongodump -h dbhost -d dbname -o dbdirectory
"C:\Program Files\MongoDB\Server\3.2\bin\mongodump" -d storage -o D:\storage
mongodump -h192.168.3.124 -d storage -o D:\MongoDB\
//还原
mongorestore -h <hostname><:port> -d dbname <path>
##网络
双层线路由(192.168.103.1):
WAN 1 IP: 10.85.160.20
网关: 10.85.160.254
DNS: 10.85.71.1 , 10.85.71.2
包装料2(box21和22)
IP: 10.85.160.181
服务器IP: 10.85.160.25 内网IP: 192.168.101.11
##佳世达接口说明: ##佳世达接口说明:
1. 皮带线扫码后调用,用于获取尺寸后升起气缸 1. 皮带线扫码后调用,用于获取尺寸后升起气缸
...@@ -78,7 +15,7 @@ IP: 10.85.160.181 ...@@ -78,7 +15,7 @@ IP: 10.85.160.181
>> - msg: 消息 >> - msg: 消息
>> - data: 料盘直径,=7时升起气缸 >> - data: 料盘直径,=7时升起气缸
2. 皮带线获取尺寸后,料盘到达机器人取料位置进调用,如果未扫到码,或者没等到取料位置信号亮,可以不用调用 2. 皮带线获取尺寸后,料盘到达机器人取料位置进调用,如果未扫到码,或者没等到取料位置信号亮,可以不用调用(4楼)
> 地址: > 地址:
>>/rest/api/qisda/device/arriveRobotLocation >>/rest/api/qisda/device/arriveRobotLocation
...@@ -347,8 +284,8 @@ IP: 10.85.160.181 ...@@ -347,8 +284,8 @@ IP: 10.85.160.181
>>` {"code":0,"msg":"ok","data":""}` >>` {"code":0,"msg":"ok","data":""}`
>> >>
>> - code: 0为正常,其他为异常, >> - code: 0为正常,其他为异常,
>> - msg:消息, >> - msg:消息,
>> - data: >> - data:
14. 异常看板 14. 异常看板
...@@ -365,6 +302,101 @@ IP: 10.85.160.181 ...@@ -365,6 +302,101 @@ IP: 10.85.160.181
>>` {"code":0,"msg":"ok","data":""}` >>` {"code":0,"msg":"ok","data":""}`
>> >>
>> - code: 0为正常,其他为异常, >> - code: 0为正常,其他为异常,
>> - msg:消息, >> - msg:消息,
>> - data: >> - data:
15. 取消入库任务
>地址:
>>/rest/api/qisda/device/cancelPutInTask
>
>参数:
>>barcode : 需要取消的唯一码信息
>
> 返回:
>>` {"code":0,"msg":"ok","data":""}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
16. 3楼料盘到达机器人取料位置
>地址:
>>/rest/api/qisda/device/arrive3fRobotLocation
>
>参数:
>>barcode : 需要取消的唯一码信息
>>robotIndex:机器人编号
>
> 返回:
>>` {"code":0,"msg":"ok","data":""}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
17. 根据虚拟RFID查找料架的真实的Rfid,用于AGV包装仓判断多个任务是否属于同一料架
>地址:
>>/rest/api/qisda/device/findRealRfid
>
>参数:
>>tempRfid : 虚拟RFID
>
> 返回:
>>` {"code":0,"msg":"ok","data":{"tempRfid":"23819-2A","realRfid:"A20"}}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
>> - tempRfid: 虚拟RFID
>> - realRfid: 真实RFID,如果没绑定真实RFID,返回空字符串
18. 取消出库任务
>地址:
>>/rest/api/qisda/device/cancelPutInTask
>
>参数:
>>barcode : 需要取消的唯一码信息
>
> 返回:
>>` {"code":0,"msg":"ok","data":""}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
19. 查询当前正在出的工单的线别信息
>地址:
>>/rest/api/qisda/device/currentOutLine
>
>参数:
>
> 返回:
>>` {"code":0,"msg":"ok","data":{"hSerial":"23819","so":"23679","line":"C6"}}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
>> - hSerial: 需求单号
>> - so: 工单号
>> - line: 工单的线别信息
20. 料架放上AGV时,根据RFID清理料架的缓存信息,使料架可以重复使用
>地址:
>>/rest/api/qisda/device/agvRemoveRfid
>
>参数:
>>rfid : 料架RFID编号
>
> 返回:
>>` {"code":0,"msg":"ok","data":""}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
...@@ -142,6 +142,9 @@ public class AppendInfo { ...@@ -142,6 +142,9 @@ public class AppendInfo {
} }
public String getRefno() { public String getRefno() {
if(refno == null){
return "";
}
return refno; return refno;
} }
......
...@@ -375,7 +375,7 @@ public class InquiryShelfBean { ...@@ -375,7 +375,7 @@ public class InquiryShelfBean {
/** /**
* 双层线上AGV拉走料架时调用清理料架,使料架可以重复使用 * 双层线上AGV拉走料架时调用清理料架,使料架可以重复使用
*/ */
public static void agvRemoveRfid(String realRfid){ public static boolean agvRemoveRfid(String realRfid){
ShelfInfo shelfToRemove = null; ShelfInfo shelfToRemove = null;
for (Map<String, ShelfInfo> shelfInfoMap : hSerialShelfMap.values()) { for (Map<String, ShelfInfo> shelfInfoMap : hSerialShelfMap.values()) {
for (ShelfInfo shelfInfo : shelfInfoMap.values()) { for (ShelfInfo shelfInfo : shelfInfoMap.values()) {
...@@ -395,8 +395,10 @@ public class InquiryShelfBean { ...@@ -395,8 +395,10 @@ public class InquiryShelfBean {
shelfMap.remove(shelfToRemove.tempRfid()); shelfMap.remove(shelfToRemove.tempRfid());
hSerialShelfMap.put(hSerial, shelfMap); hSerialShelfMap.put(hSerial, shelfMap);
QisdaCache.saveShelfMap(hSerialShelfMap); QisdaCache.saveShelfMap(hSerialShelfMap);
return true;
} }
} }
return false;
} }
/** /**
......
...@@ -45,6 +45,11 @@ public class DNItem extends BaseMongoBean { ...@@ -45,6 +45,11 @@ public class DNItem extends BaseMongoBean {
private int inNum; private int inNum;
/** /**
* 扫描盘数
*/
private int scanNum;
/**
* DN单日期 * DN单日期
*/ */
private String dnDateStr; private String dnDateStr;
...@@ -134,4 +139,12 @@ public class DNItem extends BaseMongoBean { ...@@ -134,4 +139,12 @@ public class DNItem extends BaseMongoBean {
public void setCompany(String company) { public void setCompany(String company) {
this.company = company; this.company = company;
} }
public int getScanNum() {
return scanNum;
}
public void setScanNum(int scanNum) {
this.scanNum = scanNum;
}
} }
...@@ -12,4 +12,6 @@ public interface IDNItemDao extends IMongoDao { ...@@ -12,4 +12,6 @@ public interface IDNItemDao extends IMongoDao {
List<DNItem> findDnItems(String dnNo); List<DNItem> findDnItems(String dnNo);
DNItem findDnItem(String dnNo, String pn, String facility, String company); DNItem findDnItem(String dnNo, String pn, String facility, String company);
void updateScanNum(String dnItemId, int scanNum);
} }
...@@ -11,6 +11,8 @@ import com.myproject.util.StorageConstants; ...@@ -11,6 +11,8 @@ import com.myproject.util.StorageConstants;
import org.springframework.data.mongodb.core.aggregation.Aggregation; import org.springframework.data.mongodb.core.aggregation.Aggregation;
import org.springframework.data.mongodb.core.aggregation.AggregationResults; import org.springframework.data.mongodb.core.aggregation.AggregationResults;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Date; import java.util.Date;
...@@ -30,6 +32,15 @@ public class DNItemDaoImpl extends AbstractMongoDao implements IDNItemDao { ...@@ -30,6 +32,15 @@ public class DNItemDaoImpl extends AbstractMongoDao implements IDNItemDao {
} }
@Override @Override
public void updateScanNum(String dnItemId, int scanNum){
Update update = new Update();
update.set("scanNum",scanNum);
Criteria c = Criteria.where("id").is(dnItemId);
Query query = Query.query(c);
updateFirst(query,update);
}
@Override
public Class getEntityClass() { public Class getEntityClass() {
return DNItem.class; return DNItem.class;
} }
......
...@@ -230,24 +230,11 @@ public class QisdaController extends BaseController { ...@@ -230,24 +230,11 @@ public class QisdaController extends BaseController {
String stopCurrent = request.getParameter("stopCurrent"); String stopCurrent = request.getParameter("stopCurrent");
if(stopCurrent != null && stopCurrent.equals("true") || currentDnInfo == null){ if(stopCurrent != null && stopCurrent.equals("true") || currentDnInfo == null){
log.info("DN单["+dnNo+"]facility["+facility+"]切换操作"); log.info("DN单["+dnNo+"]facility["+facility+"]切换操作");
DNInfo dbDN = dNInfoDao.findDNInfo(newDnInfo.getDnNo());
if(dbDN == null){
if(newDnInfo.isDNIn()){
log.info("未找到DN单["+dnNo+"],从佳世达获取");
boolean isCheck = false;
try { try {
List<DNItem> dnItems = QisdaApi.GetDNDetails(dnNo, isCheck); newDnInfo = getDnInfo(newDnInfo);
dNItemDao.insertAll(dnItems);
newDnInfo = dNInfoDao.save(newDnInfo);
newDnInfo.addItems(dnItems);
} catch (ApiException e) { } catch (ApiException e) {
return e.getMessage(); return e.getMessage();
} }
}else if(newDnInfo.isFacilityIn()){
log.info("新建Facility["+newDnInfo.getDnNo()+"]收料");
newDnInfo = dNInfoDao.save(newDnInfo);
}
}
currentDnInfo = newDnInfo; currentDnInfo = newDnInfo;
QisdaCache.bindRfidDnInfo(rfid, currentDnInfo); QisdaCache.bindRfidDnInfo(rfid, currentDnInfo);
...@@ -271,6 +258,25 @@ public class QisdaController extends BaseController { ...@@ -271,6 +258,25 @@ public class QisdaController extends BaseController {
} }
} }
private synchronized DNInfo getDnInfo(DNInfo newDnInfo) throws ApiException {
String dnNo = newDnInfo.getDnNo();
DNInfo dbDN = dNInfoDao.findDNInfo(dnNo);
if(dbDN == null) {
if (newDnInfo.isDNIn()) {
log.info("未找到DN单[" + dnNo + "],从佳世达获取");
boolean isCheck = false;
List<DNItem> dnItems = QisdaApi.GetDNDetails(dnNo, isCheck);
dNItemDao.insertAll(dnItems);
newDnInfo = dNInfoDao.save(newDnInfo);
newDnInfo.addItems(dnItems);
} else if (newDnInfo.isFacilityIn()) {
log.info("新建Facility[" + newDnInfo.getDnNo() + "]收料");
newDnInfo = dNInfoDao.save(newDnInfo);
}
}
return newDnInfo;
}
/** /**
* 需求单顺序调整页面 * 需求单顺序调整页面
*/ */
......
...@@ -878,10 +878,12 @@ public class OutInfoCache { ...@@ -878,10 +878,12 @@ public class OutInfoCache {
} }
List<StoragePos> bindList = storagePosDao.listSoSeqBindPos(outInfo.getSoseq()); List<StoragePos> bindList = storagePosDao.listSoSeqBindPos(outInfo.getSoseq());
if(!outInfo.isUrgentAction()){
if(outInfoExecuted && bindList.isEmpty()){ if(outInfoExecuted && bindList.isEmpty()){
//已经执行过 //已经执行过
return ResultBean.newErrorResult(1004,"无可出的料盘",false); return ResultBean.newErrorResult(1004,"无可出的料盘",false);
} }
}
if(outInfo.isReelCutAction()){ if(outInfo.isReelCutAction()){
boolean hasCutReel = false; boolean hasCutReel = false;
......
...@@ -358,7 +358,7 @@ public class QisdaApiController extends BaseController { ...@@ -358,7 +358,7 @@ public class QisdaApiController extends BaseController {
/** /**
* 替代料接口 * 替代料接口
*/ */
@RequestMapping(value = "/replaceSlot",method = RequestMethod.POST) @RequestMapping(value = "/replaceSlot")
@ResponseBody @ResponseBody
public Object replaceSlot(HttpServletRequest request) { public Object replaceSlot(HttpServletRequest request) {
try { try {
......
...@@ -604,7 +604,7 @@ public class QisdaDeviceController extends BaseController { ...@@ -604,7 +604,7 @@ public class QisdaDeviceController extends BaseController {
} }
/** /**
* 查找料架的TempRfid,用于流水线重启时决定当前料串是否可用 * 根据虚拟RFID查找料架的真实的Rfid
*/ */
@RequestMapping(value = "/findRealRfid") @RequestMapping(value = "/findRealRfid")
@ResponseBody @ResponseBody
......
...@@ -127,32 +127,6 @@ public class TaskService implements ITaskService { ...@@ -127,32 +127,6 @@ public class TaskService implements ITaskService {
*/ */
public static Map<String, LiteOrder> liteOrderMap = new ConcurrentHashMap<>(); public static Map<String, LiteOrder> liteOrderMap = new ConcurrentHashMap<>();
/**
* 当前正在执行的DN单信息(默认是纯入库)
*/
// private static DNInfo currentDnInfo = new DNInfo();
/**
* 获取当前正在执行的DN单信息
*/
// @Override
// public DNInfo getCurrentDnInfo(){
// return currentDnInfo;
// }
//
// /**
// * 切换收料的DN单
// * @param dnInfo
// */
// @Override
// public void changeCurrentDnInfo(DNInfo dnInfo){
// String currentDnNo = currentDnInfo.getDnNo();
// String newDnNo = dnInfo.getDnNo();
// log.info("切换当前DN单["+currentDnNo+"]为:" + newDnNo);
// currentDnInfo = dnInfo;
// }
/** /**
* 更新客户端发上来的消息(设备故障等消息) * 更新客户端发上来的消息(设备故障等消息)
...@@ -1853,7 +1827,7 @@ public class TaskService implements ITaskService { ...@@ -1853,7 +1827,7 @@ public class TaskService implements ITaskService {
//dataLog.setRelationCodes(barcode.getRelationCodes()); //dataLog.setRelationCodes(barcode.getRelationCodes());
dataLog.setType(StorageConstants.OP.PUT_IN); dataLog.setType(StorageConstants.OP.PUT_IN);
dataLog.setNum(barcode.getInitialAmount()); dataLog.setNum(barcode.getInitialAmount());
dataLog.setLocInfo(trayRfid); //dataLog.setLocInfo(trayRfid);
dataLog.setCid(storage.getCid()); dataLog.setCid(storage.getCid());
...@@ -1873,9 +1847,38 @@ public class TaskService implements ITaskService { ...@@ -1873,9 +1847,38 @@ public class TaskService implements ITaskService {
log.info("cid:[" + storage.getCid() + "] barcode:[" + barcode.getBarcode() + "] partNumber:[" + dataLog.getPartNumber() + "]位置[" + storagePos.getPosName() + "]的入库操作成功加入队列"); log.info("cid:[" + storage.getCid() + "] barcode:[" + barcode.getBarcode() + "] partNumber:[" + dataLog.getPartNumber() + "]位置[" + storagePos.getPosName() + "]的入库操作成功加入队列");
} }
try{
String dnItemId = updateDnItemScanNum(barcode);
if(dnItemId.isEmpty()){
AppendInfo appendInfo = barcode.getAppendInfo();
appendInfo.setRefno(dnItemId);
barcode.setAppendInfo(appendInfo);
barcodeManager.save(barcode);
}
}catch (Exception e){
log.info("入库处理DN单扫描料盘数出错",e);
}
return dataLog; return dataLog;
} }
private synchronized String updateDnItemScanNum(Barcode barcode){
AppendInfo appendInfo = barcode.getAppendInfo();
if(!appendInfo.isCISIn()){
String dnItemId = appendInfo.getRefno();
if(dnItemId.isEmpty()){
DNItem dnItem = dNItemDao.findDnItem(appendInfo.getDnNo(), barcode.getPartNumber(), appendInfo.getFacility(), appendInfo.getCompany());
if(dnItem != null){
log.info("["+barcode.getBarcode()+"]入库时DN单对应扫码数量+1");
dNItemDao.updateScanNum(dnItem.getId(), dnItem.getScanNum() + 1);
return dnItem.getId();
}
}
}
return "";
}
//入仓位完成 //入仓位完成
public void putInFinished(DataLog task) throws ValidateException { public void putInFinished(DataLog task) throws ValidateException {
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<%--<display:column property="type" titleKey="类型"/>--%> <%--<display:column property="type" titleKey="类型"/>--%>
<display:column property="amount" titleKey="component.amount"/> <display:column property="amount" titleKey="component.amount"/>
<display:column titleKey=""> <display:column titleKey="" media="html">
<button class="btn default" type="button" <button class="btn default" type="button"
onclick="flushSize('${component.id}')">刷新尺寸</button> onclick="flushSize('${component.id}')">刷新尺寸</button>
</display:column> </display:column>
......
...@@ -97,6 +97,9 @@ ...@@ -97,6 +97,9 @@
<fmt:message key="Company"/> <fmt:message key="Company"/>
</th> </th>
<th> <th>
<fmt:message key="已收/扫描"/>
</th>
<th>
<fmt:message key="已收/DN单数量"/> <fmt:message key="已收/DN单数量"/>
</th> </th>
...@@ -145,7 +148,10 @@ ...@@ -145,7 +148,10 @@
} }
var diffInfoStr = "<span class='"+diffColor+" td-item'>"+diff+"</span>"; var diffInfoStr = "<span class='"+diffColor+" td-item'>"+diff+"</span>";
table.row.add( [ index, data[i].pn, data[i].facility, data[i].company, inQty+"/"+dnQty,diffInfoStr,data[i].dnDateStr] ); var scanNum = data[i].scanNum;
var inNum = data[i].inNum;
table.row.add( [ index, data[i].pn, data[i].facility, data[i].company, inNum+"/"+scanNum,inQty+"/"+dnQty,diffInfoStr,data[i].dnDateStr] );
} }
table.order( [ 0, 'asc' ] ).draw(); table.order( [ 0, 'asc' ] ).draw();
......
...@@ -120,11 +120,18 @@ ...@@ -120,11 +120,18 @@
</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.sendEnd && !outInfo.closed && !outInfo.executing}"> <c:if test="${!outInfo.executing}">
<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"/>
</button> </button>
</c:if> </c:if>
</c:if>
<%--<c:if test="${!outInfo.sendEnd && !outInfo.closed && !outInfo.executing}">--%>
<%--<button class="btn yellow" id="btn${outInfo.hSerial}" onclick="executeOut('${outInfo.hSerial}')">--%>
<%--<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/>--%>
<%--</button>--%>
<%--</c:if>--%>
</display:column> </display:column>
</display:table> </display:table>
......
...@@ -12,6 +12,57 @@ ...@@ -12,6 +12,57 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<ul class="timeline"> <ul class="timeline">
<li class="timeline-purple">
<div class="timeline-time">
<span class="date">2021</span>
<span class="time">02-04</span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021020414</h2>
<div class="timeline-content">
<ul>
<li>修正DN单收料数量</li>
</ul>
</div>
</div>
</li>
<li class="timeline-purple">
<div class="timeline-time">
<span class="date">2021</span>
<span class="time">01-26</span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021012614</h2>
<div class="timeline-content">
<ul>
<li>优化替代料接口为POST和GET都可访问</li>
</ul>
</div>
</div>
</li>
<li class="timeline-green">
<div class="timeline-time">
<span class="date">2021</span>
<span class="time">01-25</span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2021012514</h2>
<div class="timeline-content">
<ul>
<li>优化未出完的指定料需求单再次出库功能</li>
</ul>
</div>
</div>
</li>
<li class="timeline-blue"> <li class="timeline-blue">
<div class="timeline-time"> <div class="timeline-time">
<span class="date">2021 </span> <span class="date">2021 </span>
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
<div class="page-footer-inner"> <div class="page-footer-inner">
2016&copy; <a href="${ctx}/updateHistory.html">SMD BOX</a> 2016&copy; <a href="${ctx}/updateHistory.html">SMD BOX</a>
</div> </div>
<span class="right" style="color: #a3a3a3;">Version: 2021.01.15</span> <span class="right" style="color: #a3a3a3;">Version: 2021.02.04</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!