Commit 69e2c14e sunke

料架与PanaCIM对接

1 个父辈 a6cd8774
...@@ -5,6 +5,7 @@ import com.myproject.bean.search.PageList; ...@@ -5,6 +5,7 @@ import com.myproject.bean.search.PageList;
import com.myproject.dao.mongo.IAlarmInfoDao; import com.myproject.dao.mongo.IAlarmInfoDao;
import com.myproject.util.DateUtil; import com.myproject.util.DateUtil;
import com.myproject.webapp.controller.storage.BaseSearchController; import com.myproject.webapp.controller.storage.BaseSearchController;
import org.displaytag.tags.TableTagParameters;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.Query;
...@@ -51,6 +52,14 @@ public class AlarmInfoSearchController extends BaseSearchController { ...@@ -51,6 +52,14 @@ public class AlarmInfoSearchController extends BaseSearchController {
} }
query.addCriteria(baseCriteria); query.addCriteria(baseCriteria);
//导出
if (request.getParameter(TableTagParameters.PARAMETER_EXPORTING) != null){
PageList pl = searchCriteria.getPageList();
pl.setPageNumber(-1);
searchCriteria.setPageList(pl);
}
PageList pageList = alarmInfoDao.findByQuery(query, searchCriteria.getPageList()); PageList pageList = alarmInfoDao.findByQuery(query, searchCriteria.getPageList());
searchCriteria.setPageList(pageList); searchCriteria.setPageList(pageList);
......
...@@ -234,6 +234,9 @@ public class CodeShelfController extends BaseController { ...@@ -234,6 +234,9 @@ public class CodeShelfController extends BaseController {
if(opPos != null){ if(opPos != null){
Storage storage = dataCache.getStorageById(opPos.getStorageId());
ArrayList<Storage> storageList = Lists.newArrayList(storage);
taskService.verifyBarcodePutIn(storageList,barcode);
log.info(barcode.getPartNumber()+" [ "+barcode.getBarcode()+" ] " + "入库到:" + opPos.getPosName()); log.info(barcode.getPartNumber()+" [ "+barcode.getBarcode()+" ] " + "入库到:" + opPos.getPosName());
opPos.setCanCheckOutTime(System.currentTimeMillis() + delayCloseTime); opPos.setCanCheckOutTime(System.currentTimeMillis() + delayCloseTime);
taskService.addTaskToFinished(opPos,barcode,null); taskService.addTaskToFinished(opPos,barcode,null);
......
...@@ -134,6 +134,8 @@ public class StoragePosFindController extends BaseSearchController { ...@@ -134,6 +134,8 @@ public class StoragePosFindController extends BaseSearchController {
addLikeParam(baseCriteria, request, "otherField4"); addLikeParam(baseCriteria, request, "otherField4");
addLikeParam(baseCriteria, request, "otherField5"); addLikeParam(baseCriteria, request, "otherField5");
addLikeParam(baseCriteria,request,"provider");
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(barcode, Pattern.CASE_INSENSITIVE);
......
...@@ -66,6 +66,8 @@ public interface ITaskService { ...@@ -66,6 +66,8 @@ public interface ITaskService {
*/ */
String checkout(StoragePos pos, boolean forceOut, String subSourceId, boolean isSingleOut); String checkout(StoragePos pos, boolean forceOut, String subSourceId, boolean isSingleOut);
Barcode verifyBarcodePutIn(List<Storage> storageList, Barcode barcodeSave) throws ValidateException;
StoragePos findEmptyPosForPutIn(List<Storage> storageList, Barcode barcode) throws ValidateException; StoragePos findEmptyPosForPutIn(List<Storage> storageList, Barcode barcode) throws ValidateException;
//void checkOutInaction(String areaId, int day) throws ValidateException; //void checkOutInaction(String areaId, int day) throws ValidateException;
......
...@@ -174,7 +174,7 @@ public class MesApiController extends BaseController { ...@@ -174,7 +174,7 @@ public class MesApiController extends BaseController {
} }
for (StoragePos pos : poses) { for (StoragePos pos : poses) {
log.info("出库位置仓位【"+pos.getPosName()+"】"); log.info("出库位置仓位【"+pos.getPosName()+"】");
taskService.checkout(pos,null,false); taskService.checkout(pos,false,null,false);
} }
}catch (Exception e){ }catch (Exception e){
......
...@@ -16,6 +16,9 @@ import com.myproject.bean.update.Component; ...@@ -16,6 +16,9 @@ import com.myproject.bean.update.Component;
import com.myproject.bean.update.Settings; import com.myproject.bean.update.Settings;
import com.myproject.manager.IBarcodeManager; import com.myproject.manager.IBarcodeManager;
import com.myproject.manager.IComponentManager; import com.myproject.manager.IComponentManager;
import com.myproject.util.DateUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -27,10 +30,8 @@ import javax.servlet.http.HttpServletResponse; ...@@ -27,10 +30,8 @@ import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 生成二维码并输出到html * 生成二维码并输出到html
...@@ -41,6 +42,7 @@ import java.util.Map; ...@@ -41,6 +42,7 @@ import java.util.Map;
@Controller @Controller
public class QrcodeController { public class QrcodeController {
protected final transient Logger log = LogManager.getLogger(getClass());
/*maven 依赖 /*maven 依赖
<dependency> <dependency>
...@@ -191,7 +193,7 @@ public class QrcodeController { ...@@ -191,7 +193,7 @@ public class QrcodeController {
BaseFont baseFont = BaseFont.createFont("C:/WINDOWS/Fonts/simsun.ttc,1", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED); BaseFont baseFont = BaseFont.createFont("C:/WINDOWS/Fonts/simsun.ttc,1", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
boldFont = new Font(baseFont,fontSize); boldFont = new Font(baseFont,fontSize);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); log.error("未找到字体simsun.ttc");
} }
PdfPTable table = new PdfPTable(2); PdfPTable table = new PdfPTable(2);
......
...@@ -345,7 +345,9 @@ public class TaskService implements ITaskService { ...@@ -345,7 +345,9 @@ public class TaskService implements ITaskService {
/** /**
* 检查二维码是否合法并且可以入库,没问题的话存入到数据库 * 检查二维码是否合法并且可以入库,没问题的话存入到数据库
*/ */
private Barcode verifyBarcodePutIn(List<Storage> storageList, Barcode barcodeSave) throws ValidateException {
@Override
public Barcode verifyBarcodePutIn(List<Storage> storageList, Barcode barcodeSave) throws ValidateException {
if(barcodeSave == null){ if(barcodeSave == null){
throw new ValidateException("error.barcode.invalid",new String[]{""},"条码无效"); throw new ValidateException("error.barcode.invalid",new String[]{""},"条码无效");
...@@ -358,6 +360,14 @@ public class TaskService implements ITaskService { ...@@ -358,6 +360,14 @@ public class TaskService implements ITaskService {
} }
} }
if(dataCache.isProductionFor(DataCache.CUSTOMER.PANACIM)){
//松下PanaCIM需要进行验证
boolean checkResult = PanaApiController.requestReel(barcodeSave.getBarcode());
if(!checkResult){
throw new ValidateException("PanaCIM验证条码["+barcodeSave.getBarcode()+"]失败","PanaCIM验证失败");
}
}
// if(barcodeSave.getPlateSize() <=0 || barcodeSave.getHeight() <= 0){ // if(barcodeSave.getPlateSize() <=0 || barcodeSave.getHeight() <= 0){
// throw new ValidateException("无法入库,请先设置料盘尺寸"); // throw new ValidateException("无法入库,请先设置料盘尺寸");
// } // }
...@@ -1138,7 +1148,7 @@ public class TaskService implements ITaskService { ...@@ -1138,7 +1148,7 @@ public class TaskService implements ITaskService {
if(!Strings.isNullOrEmpty(posName)){//客户端发一次完成之后,会发空的 posName,不需要处理 if(!Strings.isNullOrEmpty(posName)){//客户端发一次完成之后,会发空的 posName,不需要处理
if (StorageConstants.BOX_STATUS.IN_FINISHED == status) {//入仓完成 if (StorageConstants.BOX_STATUS.IN_FINISHED == status) {//入仓完成
DataLog task = findExecutingTask(statusBean.getCid(), boxStatus.getPosId()); DataLog task = findExecutingTask(statusBean.getCid(), boxStatus.getPosId());
if (task != null) { if (task != null && task.isPutInTask()) {
log.info(task.getBarcode() + "入仓位[" + task.getPosName() + "]完成"); log.info(task.getBarcode() + "入仓位[" + task.getPosName() + "]完成");
DataLog cancelTask = findFinishedTask(statusBean.getCid(), boxStatus.getPosId()); DataLog cancelTask = findFinishedTask(statusBean.getCid(), boxStatus.getPosId());
if(cancelTask != null && cancelTask.isCancel()){ if(cancelTask != null && cancelTask.isCancel()){
...@@ -1150,7 +1160,7 @@ public class TaskService implements ITaskService { ...@@ -1150,7 +1160,7 @@ public class TaskService implements ITaskService {
} else { } else {
//从已完成列表中找,如果还找不到就忽略 //从已完成列表中找,如果还找不到就忽略
task = findFinishedTask(statusBean.getCid(), boxStatus.getPosId()); task = findFinishedTask(statusBean.getCid(), boxStatus.getPosId());
if (task != null) { if (task != null && task.isPutInTask()) {
if(task.isCancel()){//被取消的任务,客户端发完成信号过来,修改取消状态为已完成 if(task.isCancel()){//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
log.info(task.getBarcode() + "入仓位[" + task.getPosName() + "]完成,但任务已被取消,修改为完成"); log.info(task.getBarcode() + "入仓位[" + task.getPosName() + "]完成,但任务已被取消,修改为完成");
putInFinished(task); putInFinished(task);
...@@ -1624,6 +1634,15 @@ public class TaskService implements ITaskService { ...@@ -1624,6 +1634,15 @@ public class TaskService implements ITaskService {
task.setMemo(barcode.getMemo()); task.setMemo(barcode.getMemo());
dataCache.updateInventory(pos,barcode); dataCache.updateInventory(pos,barcode);
Storage storage = dataCache.getStorage(task.getCid());
if(storage != null){
if(dataCache.isProductionFor(DataCache.CUSTOMER.PANACIM)){
PanaApiController.checkInNotification(barcode);
}else{
postInNotification(dataCache.getSettings().getInNotifyApi(), task.getBarcode(), task.getStorageId());
}
}
//dataCache.updateStorage(task.getCid()); //dataCache.updateStorage(task.getCid());
}else{ }else{
...@@ -1762,7 +1781,11 @@ public class TaskService implements ITaskService { ...@@ -1762,7 +1781,11 @@ public class TaskService implements ITaskService {
Storage storage = dataCache.getStorage(task.getCid()); Storage storage = dataCache.getStorage(task.getCid());
if(storage != null){ if(storage != null){
postInNotification(dataCache.getSettings().getInNotifyApi(), task.getBarcode(), task.getStorageId()); if(dataCache.isProductionFor(DataCache.CUSTOMER.PANACIM)){
PanaApiController.checkInNotification(barcode);
}else{
postInNotification(dataCache.getSettings().getInNotifyApi(), task.getBarcode(), task.getStorageId());
}
} }
...@@ -1874,7 +1897,12 @@ public class TaskService implements ITaskService { ...@@ -1874,7 +1897,12 @@ public class TaskService implements ITaskService {
//通知消息 //通知消息
Storage storage = dataCache.getStorage(task.getCid()); Storage storage = dataCache.getStorage(task.getCid());
if(storage != null){ if(storage != null){
postOutNotification(dataCache.getSettings().getOutNotifyApi(), task.getBarcode(), task.getCid()); if(dataCache.isProductionFor(DataCache.CUSTOMER.PANACIM)){
PanaApiController.deliverNotification(barcode);
}else{
postOutNotification(dataCache.getSettings().getOutNotifyApi(), task.getBarcode(), task.getCid());
}
} }
......
...@@ -86,10 +86,27 @@ ...@@ -86,10 +86,27 @@
</div> </div>
</div> </div>
<label class="control-label col-md-2"><fmt:message key="barcode.expireDate"/></label> <label class="control-label col-md-2"><fmt:message key="barcode.batch"/></label>
<div class="col-md-4">
<div style="text-align:left" class="input-group">
<form:input type="text" id="batch" path="batch" class="form-control"/>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2"><fmt:message key="barcode.produceDate"/></label>
<div class="col-md-4"> <div class="col-md-4">
<div style="text-align:left" class="input-group"> <div style="text-align:left" class="input-group">
<form:input type="text" path="expireDate" class="form-control form-control-inline input-medium date-picker" /> <form:input type="text" path="produceDate" class="form-control form-control-inline input-medium date-picker" data-date-format="yyyy-mm-dd"/>
</div>
</div>
<label class="control-label col-md-2"><fmt:message key="barcode.expireDate"/></label>
<div class="col-md-4">
<div style="text-align:left" class="input-group" >
<form:input type="text" path="expireDate" class="form-control form-control-inline input-medium date-picker" data-date="2020-01-01" data-date-format="yyyy-mm-dd"/>
</div> </div>
</div> </div>
</div> </div>
...@@ -284,5 +301,13 @@ ...@@ -284,5 +301,13 @@
$("#otherField3").autocomplete(fetchBarcode("otherField3")); $("#otherField3").autocomplete(fetchBarcode("otherField3"));
$("#otherField4").autocomplete(fetchBarcode("otherField4")); $("#otherField4").autocomplete(fetchBarcode("otherField4"));
$("#otherField5").autocomplete(fetchBarcode("otherField5")); $("#otherField5").autocomplete(fetchBarcode("otherField5"));
$('.date-picker').datepicker({
rtl: Metronic.isRTL(),
orientation: "left",
autoclose: true,
language:'en'
});
</script> </script>
</c:set> </c:set>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<display:column titleKey="component.plate.size"> <display:column titleKey="component.plate.size">
${component.plateSize} x ${component.height} ${component.plateSize} x ${component.height}
</display:column> </display:column>
<display:column property="validDay" titleKey="component.validDay"/> <%--<display:column property="validDay" titleKey="component.validDay"/>--%>
<%--<display:column property="type" titleKey="类型"/>--%> <%--<display:column property="type" titleKey="类型"/>--%>
<display:column property="amount" titleKey="component.amount"/> <display:column property="amount" titleKey="component.amount"/>
......
...@@ -379,14 +379,14 @@ ...@@ -379,14 +379,14 @@
<div class="form-group"> <div class="form-group">
<%--有效期--%> <%--有效期--%>
<label class="control-label col-md-2"><fmt:message key="component.validDay"/> </label> <%--<label class="control-label col-md-2"><fmt:message key="component.validDay"/> </label>--%>
<div class="col-md-3"> <%--<div class="col-md-3">--%>
<div style="text-align:left" class="input-group"> <%--<div style="text-align:left" class="input-group">--%>
<form:input type="text" path="validDay" <%--<form:input type="text" path="validDay"--%>
class="form-control"/> <%--class="form-control"/>--%>
</div> <%--</div>--%>
</div> <%--</div>--%>
<label class="control-label col-md-2"><fmt:message key="component.plate.size"/> </label> <label class="control-label col-md-2"><fmt:message key="component.plate.size"/> </label>
......
...@@ -57,10 +57,10 @@ ...@@ -57,10 +57,10 @@
</form:select> </form:select>
</div> </div>
<label class="control-label col-md-1"><fmt:message key="barcode.memo"/></label> <label class="control-label col-md-1"><fmt:message key="barcode.provider"/></label>
<div class="col-md-2"> <div class="col-md-2">
<div style="text-align:left"> <div style="text-align:left">
<input id="memo" name="memo" class="form-control" value="${memo}"/> <input id="provider" name="provider" class="form-control" value="${provider}"/>
</div> </div>
</div> </div>
...@@ -112,10 +112,19 @@ ...@@ -112,10 +112,19 @@
</div> </div>
</div> </div>
<label class="control-label col-md-1"><fmt:message key="barcode.batch"/></label> <%--<label class="control-label col-md-1"><fmt:message key="barcode.batch"/></label>--%>
<div class="col-md-2"> <%--<div class="col-md-2">--%>
<%--<div style="text-align:left">--%>
<%--<input id="batch" name="batch" class="form-control" value="${batch}"/>--%>
<%--</div>--%>
<%--</div>--%>
<label class="control-label col-md-1"><fmt:message key="barcode.memo"/></label>
<div class="col-md-2">
<div style="text-align:left"> <div style="text-align:left">
<input id="batch" name="batch" class="form-control" value="${batch}"/> <input id="memo" name="memo" class="form-control" value="${memo}"/>
</div> </div>
</div> </div>
...@@ -211,9 +220,9 @@ ...@@ -211,9 +220,9 @@
<display:column titleKey="barcode.produceDate" sortProperty="barcode.produceDate" sortable="true"> <display:column titleKey="barcode.produceDate" sortProperty="barcode.produceDate" sortable="true">
<fmt:formatDate value="${pos.barcode.produceDate}" pattern="yyyy-MM-dd"/> <fmt:formatDate value="${pos.barcode.produceDate}" pattern="yyyy-MM-dd"/>
</display:column> </display:column>
<display:column titleKey="barcode.expireDate" sortProperty="barcode.expireDate" sortable="true" class="${expireClass}"> <%--<display:column titleKey="barcode.expireDate" sortProperty="barcode.expireDate" sortable="true" class="${expireClass}">--%>
<fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/> <%--<fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/>--%>
</display:column> <%--</display:column>--%>
<display:column property="barcode.memo" titleKey="barcode.memo"/> <display:column property="barcode.memo" titleKey="barcode.memo"/>
<display:column titleKey="checkOut.operate" media="html"> <display:column titleKey="checkOut.operate" media="html">
<c:if test="${!limitCheckOut}"> <c:if test="${!limitCheckOut}">
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,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: 2020.09.27</span> <span class="right" style="color: #a3a3a3;">Version: 2020.10.27</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!