Commit 7c15fb15 sunke

更新紧急料出库不会更新需求单发料数量问题

报警允许按条码查询
1 个父辈 29f2a776
......@@ -41,6 +41,24 @@ public class InquiryShelfBean {
}
}
public static boolean clearShelf(String hSerial, String rfid){
boolean clearResult = false;
if(hSerial != null){
log.info("清理["+hSerial+"]使用的过料架["+rfid+"]");
Map<String, ShelfInfo> shelfMap = hSerialShelfMap.get(hSerial);
if(shelfMap != null){
ShelfInfo shelfInfo = findSameShelf(hSerial, rfid);
if(shelfInfo != null){
String tempRfid = shelfInfo.tempRfid();
shelfMap.remove(tempRfid);
hSerialShelfMap.put(hSerial, shelfMap);
clearResult = true;
}
}
}
return clearResult;
}
private static List<ShelfInfo> getSortedCAndDShelfList(DataLog task){
......@@ -322,7 +340,7 @@ public class InquiryShelfBean {
if(shelfMap != null){
for (ShelfInfo shelf : shelfMap.values()) {
String shelfRFID = shelf.getRealRfid();
log.info(shelf.tempRfid() + "判断料架["+shelfRFID+"] = " + rfid);
log.debug(shelf.tempRfid() + "判断料架["+shelfRFID+"] = " + rfid);
if(shelfRFID != null && rfid != null){
if(shelfRFID.equals(rfid)){
//已经绑定过该Temp料架
......@@ -559,9 +577,8 @@ public class InquiryShelfBean {
if(appendInfo.isFirstReelAction()){
//首盘料,解除绑定的位置
if(shelfMap != null){
ShelfInfo shelfInfo = shelfMap.get(task.getTempRfid());
if(shelfInfo != null){
boolean result = shelfInfo.cancelLimitLoc(taskShelfType, barcode);
for (ShelfInfo shelfInfo : shelfMap.values()) {
boolean result = shelfInfo.cancelLimitLoc(barcode);
if(result){
log.info("首盘料["+task.getBarcode()+"]任务取消,解除料架" + shelfInfo.tempRfid() +"锁定架位绑定");
updateShelfInfo(shelfInfo);
......@@ -573,17 +590,20 @@ public class InquiryShelfBean {
//补料盘,解除最后一个料架上的位置
ShelfInfo maxShelf = null;
for (ShelfInfo shelfInfo : shelfMap.values()) {
if(shelfInfo.getShelfType().equals(taskShelfType)){
int limitLoc = shelfInfo.getBarcodeLoc(barcode, taskShelfType);
if(limitLoc > 0){
//已经锁定过
boolean result = shelfInfo.cancelLimitLoc(taskShelfType,barcode);
if(result){
log.info("补料盘["+task.getBarcode()+"]任务取消,解除料架" + shelfInfo.tempRfid() +"的锁定架位绑定");
updateShelfInfo(shelfInfo);
}
int limitLoc = shelfInfo.getBarcodeLoc(barcode, taskShelfType);
if(limitLoc > 0){
//已经锁定过
boolean result = shelfInfo.cancelLimitLoc(barcode);
if(result){
log.info("补料盘["+task.getBarcode()+"]任务取消,解除料架" + shelfInfo.tempRfid() +"的锁定架位绑定");
updateShelfInfo(shelfInfo);
}
if(!shelfInfo.isAShelf()){
//非包装料,只取消一个料架, 包装料需要取消C料架和A料架
return;
}else{
}
}else{
if(shelfInfo.getShelfType().equals(taskShelfType)){
if(maxShelf == null || shelfInfo.getRfidIndex() > maxShelf.getRfidIndex()){
maxShelf = shelfInfo;
}
......@@ -620,7 +640,7 @@ public class InquiryShelfBean {
boolean putInResult = bindedShelf.putInLimitLoc(rfid,loc,barcode);
if(putInResult){
updateShelfInfo(bindedShelf);
log.info("包装料["+task.getBarcode()+"]放入料架" + rfid +"["+loc+"]缓存更新成功");
log.info("紧急/分盘料["+task.getBarcode()+"]放入料架" + rfid +"["+loc+"]缓存更新成功");
return new ShelfLoc(rfid,loc);
}
}else{
......@@ -630,7 +650,7 @@ public class InquiryShelfBean {
boolean putInResult = shelfInfo.putInLimitLoc(rfid,loc, barcode);
if(putInResult){
updateShelfInfo(shelfInfo);
log.info("包装物料["+task.getBarcode()+"]使用新料架" + rfid +"["+loc+"]缓存更新成功");
log.info("紧急/分盘料["+task.getBarcode()+"]使用新料架" + rfid +"["+loc+"]缓存更新成功");
return new ShelfLoc(rfid,loc);
}
}
......@@ -641,10 +661,11 @@ public class InquiryShelfBean {
newBShelf.setRfidIndex(rfidIndex);
newBShelf.sethSerial(shelfMapKey);
log.info("添加新料架["+newBShelf.tempRfid() + "]");
loc = bindedShelf.addLimitLoc(barcode, task.getReelType());
boolean putInResult = bindedShelf.putInLimitLoc(rfid,loc,barcode);
loc = newBShelf.addLimitLoc(barcode, task.getReelType());
boolean putInResult = newBShelf.putInLimitLoc(rfid,loc,barcode);
if(putInResult){
log.info("物料["+task.getBarcode()+"]放入料架" + rfid +"["+loc+"]缓存更新成功");
updateShelfInfo(newBShelf);
log.info("紧急/分盘料["+task.getBarcode()+"]放入料架" + rfid +"["+loc+"]缓存更新成功");
return new ShelfLoc(rfid,loc);
}
}
......
......@@ -232,17 +232,16 @@ public class ShelfInfo {
/**
* 为首盘料取消一个锁定的库位
*/
public boolean cancelLimitLoc(String rfidType, String barcode){
if(rfidType.equals(this.getShelfType())){
for (ShelfLoc shelfLoc : locMap.values()) {
if(shelfLoc.isInThisLoc(barcode)){
if(shelfLoc.isEmpty()){
shelfLoc.putIn(barcode);
locMap.put(shelfLoc.getLoc(), shelfLoc);
return true;
}else {
log.error("料盘["+barcode+"]解除绑定架位失败,此位置料盘已放入");
}
public boolean cancelLimitLoc(String barcode){
for (ShelfLoc shelfLoc : locMap.values()) {
if(shelfLoc.isInThisLoc(barcode)){
if(shelfLoc.isEmpty()){
shelfLoc.putIn(barcode);
locMap.put(shelfLoc.getLoc(), shelfLoc);
return true;
}else {
log.error("料盘["+barcode+"]解除绑定架位"+shelfLoc.getTempRfid()+"["+shelfLoc.getLoc()+"]失败,此位置料盘已放入");
return false;
}
}
}
......@@ -465,6 +464,10 @@ public class ShelfInfo {
return StorageConstants.SHEFL_TYPE.isDShelf(getShelfType());
}
public boolean isAShelf(){
return StorageConstants.SHEFL_TYPE.isAShelf(getShelfType());
}
public void setShelfType(String shelfType) {
this.shelfType = shelfType;
}
......@@ -472,4 +475,17 @@ public class ShelfInfo {
public String tempRfid(){
return gethSerial() + "-" + rfidIndex + shelfType;
}
@Override
public String toString() {
return "ShelfInfo{" +
"hSerial='" + hSerial + '\'' +
", log=" + log +
", rfidIndex=" + rfidIndex +
", realRfid='" + realRfid + '\'' +
", shelfType='" + shelfType + '\'' +
", maxLocCount=" + maxLocCount +
", locMap=" + locMap +
'}';
}
}
......@@ -150,4 +150,16 @@ public class ShelfLoc {
public void setRealRfid(String realRfid) {
this.realRfid = realRfid;
}
@Override
public String toString() {
return "ShelfLoc{" +
"barcode='" + barcode + '\'' +
", realRfid='" + realRfid + '\'' +
", tempRfid='" + tempRfid + '\'' +
", loc=" + loc +
", reelType=" + reelType +
", empty=" + empty +
'}';
}
}
......@@ -445,7 +445,7 @@ public class BarcodeRule {
if(partNumber.startsWith("QT")){
log.info("料号["+partNumber+"]为移远料号,进行料号转换");
try {
partNumber = QisdaApiController.PartNoMapping(partNumber);
partNumber = QisdaApi.PartNoMapping(partNumber);
} catch (ApiException e) {
codeBean.setError(e.getMessage());
return codeBean;
......
......@@ -50,7 +50,7 @@ public class AlarmInfoSearchController extends BaseSearchController {
}
}
super.addLikeParam(request,baseCriteria,"alarmMsg");
query.addCriteria(baseCriteria);
PageList pageList = alarmInfoDao.findByQuery(query, searchCriteria.getPageList());
......
......@@ -24,6 +24,7 @@ import com.myproject.exception.ApiException;
import com.myproject.exception.ValidateException;
import com.myproject.manager.IBarcodeManager;
import com.myproject.manager.IStoragePosManager;
import com.myproject.util.QisdaApi;
import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.storage.BaseController;
import com.myproject.webapp.controller.webService.DataCache;
......@@ -71,7 +72,7 @@ public class DifferentInventoryController extends BaseController {
qisdaReelMap = readQisda(file);
}else{
log.info("开始与Qisda比对库存");
qisdaReelMap = QisdaApiController.getInventory();
qisdaReelMap = QisdaApi.getInventory();
}
List<StoragePos> posList = storagePosManager.findNotEmpty();
......
......@@ -28,6 +28,7 @@ import com.myproject.exception.ApiException;
import com.myproject.exception.ValidateException;
import com.myproject.manager.IBarcodeManager;
import com.myproject.manager.IStoragePosManager;
import com.myproject.util.QisdaApi;
import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.qisda.util.OutInfoCache;
import com.myproject.webapp.controller.storage.BaseController;
......@@ -211,6 +212,9 @@ public class QisdaController extends BaseController {
@RequestMapping("/service/store/qisda/bindDn")
@ResponseBody
public String bindDn(HttpServletRequest request){
if(dataCache.getSettings().isStopOut()){
return "x系统更新中,暂停出入库,请稍后再试";
}
String rfid = request.getParameter("rfid");
String dnNo = request.getParameter("dnNo");
String facility = request.getParameter("facility");
......@@ -246,7 +250,7 @@ public class QisdaController extends BaseController {
log.info("未找到DN单["+dnNo+"],从佳世达获取");
boolean isCheck = false;
try {
List<DNItem> dnItems = QisdaApiController.GetDNDetails(dnNo, isCheck);
List<DNItem> dnItems = QisdaApi.GetDNDetails(dnNo, isCheck);
dNItemDao.insertAll(dnItems);
newDnInfo = dNInfoDao.save(newDnInfo);
newDnInfo.addItems(dnItems);
......
......@@ -109,7 +109,7 @@ public class OutInfoCache {
/**
* 更新需求单的发料状态
*/
private void updateStatus(String hSerial){
public void updateStatus(String hSerial){
OutInfo outInfo = outInfoMap.get(hSerial);
if(outInfo != null){
log.info("更新需求单["+hSerial+"]的发料状态 [" + outInfo.getSendStatus()+"]");
......
......@@ -66,9 +66,11 @@ public class StorageUpdateController extends BaseUpdateController {
return getSuccessView();
} else {
try {
storage = storageManager.save(storage);
dataCache.reloadStorage(storage);
//fileUpload.setParam(storage.getId());
saveMessage(request, getText("storage.saveSuccess", request.getLocale()));
//return "redirect:storageUpdate.html?id="+storage.getId();
} catch (Exception e) {
log.error(e);
......
......@@ -228,8 +228,8 @@ public class DataCache{
codeBeanFromRule.setError(null);
codeBeanFromRule.setCodeStr(barcode.getBarcode());
codeBeanFromRule.setBarcode(barcode);
Component component = componentManager.findByPartNumber(barcode.getPartNumber());
codeBeanFromRule.setShowImg(component.getShowImg());
//Component component = componentManager.findByPartNumber(barcode.getPartNumber());
//codeBeanFromRule.setShowImg(component.getShowImg());
return codeBeanFromRule;
}
......@@ -317,7 +317,7 @@ public class DataCache{
}else{
}
codeBeanFromRule.setShowImg(component.getShowImg());
//codeBeanFromRule.setShowImg(component.getShowImg());
}
}
......
......@@ -65,6 +65,8 @@ public interface ITaskService {
*/
String checkout(StoragePos pos, String subSourceId, boolean isSingleOut);
List<DataLog> getAllTasks();
DataLog getFinishedTask(String barcode);
void updateFinishedTask(DataLog task);
......
package com.myproject.webapp.controller.webService;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.myproject.bean.qisda.*;
import com.myproject.bean.update.*;
import com.myproject.bean.update.qisda.DNInfo;
......@@ -65,9 +64,6 @@ public class QisdaApiController extends BaseController {
private OutInfoCache outInfoCache;
protected final static Logger log = LogManager.getLogger(QisdaApiController.class);
private static String USER_NAME = "SMD-BOX";
/**
* 基础数据同步
*/
......@@ -135,9 +131,9 @@ public class QisdaApiController extends BaseController {
public static Barcode CISInCheck(DNInfo dnInfo, Barcode barcode) throws ValidateException{
//纯入库
if(barcode.getAppendInfo().isCISIn()){
return VMILocationInCheck(barcode);
return QisdaApi.VMILocationInCheck(barcode);
}else{
VMIMateriaReceiveJudge(dnInfo, barcode);
QisdaApi.VMIMateriaReceiveJudge(dnInfo, barcode);
}
return null;
}
......@@ -150,11 +146,48 @@ public class QisdaApiController extends BaseController {
public static void PutInFinished(Barcode barcode, DataLog task){
//纯入库
if(barcode.getAppendInfo().isCISIn()){
VMILocationIn(barcode.getBarcode(),task.getPosName());
QisdaApi.VMILocationIn(barcode.getBarcode(),task.getPosName());
}else{
//DN单收料或Facility收料
VMIMateriaReceive(barcode, task);
QisdaApi.VMIMateriaReceive(barcode, task);
}
}
/**
* 检测料盘是否绑定工单
*/
@RequestMapping(value = "/checkLockReel",method = RequestMethod.POST)
@ResponseBody
public ResultBean checkLockSo(HttpServletRequest request) {
List<Map<String, String>> bindReelInfos = new ArrayList<>();
try {
String paramInfo = receiveParamInfo(request);
log.info("收到检测锁定工单请求:"+paramInfo);
if(paramInfo == null){
return ResultBean.newErrorResult(-1,"参数为空");
}
List<String> reelIds = JsonUtil.toList(paramInfo, String.class);
for (String reelId : reelIds) {
//指定出某盘料或单独出库,如果已经绑定,不允许出,如果未绑定直接进行绑定
StoragePos pos = storagePosDao.findByBarcode(reelId);
if(pos != null){
Barcode barcode = pos.getBarcode();
AppendInfo appendInfo = barcode.getAppendInfo();
int bindSlot = Integer.valueOf(appendInfo.getBindSlot());
if(bindSlot > 0 || barcode.hasCutInfo()) {
//已经真实绑定过
Map<String,String> map = new HashMap<>();
map.put("reelId", reelId);
map.put("so", appendInfo.getSo());
bindReelInfos.add(map);
}
}
}
} catch (Exception e) {
log.error("需求单请求处理出错", e);
return ResultBean.newErrorResult(1001,"内部错误:" + e.getMessage());
}
return ResultBean.newOkResult(bindReelInfos);
}
/**
......@@ -165,18 +198,14 @@ public class QisdaApiController extends BaseController {
public Object out(HttpServletRequest request) {
List<String> failedReelIdList = new ArrayList<>();
try {
String paramInfo = request.getParameter("paramInfo");
if(Strings.isNullOrEmpty(paramInfo)){
//从body里面再获取一次
Map<String, String> bodyParamMap = getParamMapFromBody(request);
paramInfo = bodyParamMap.get("paramInfo");
}
String paramInfo = receiveParamInfo(request);
log.info("收到需求单请求:"+paramInfo);
if(paramInfo == null){
return ResultBean.newErrorResult(-1,"参数为空");
}
List<RequestOutItemBean> items = JsonUtil.toList(paramInfo, RequestOutItemBean.class);
//key为需求单号
Map<String, OutInfo> outInfoMap = new HashMap<>();
......@@ -299,7 +328,7 @@ public class QisdaApiController extends BaseController {
//首盘和分盘进行缺料反馈
List<OutItem> outItemList = outItemDao.findByHSerial(outInfo.gethSerial());
boolean lessBind = true;
VMILocationOutFeedback(outItemList, lessBind);
QisdaApi.VMILocationOutFeedback(outItemList, lessBind);
}else{
log.info("需求单["+outInfo+"]不需要进行缺料反馈");
}
......@@ -387,184 +416,6 @@ public class QisdaApiController extends BaseController {
}
}
/**
* 移远料号转换
*/
public static String PartNoMapping(String vdPartNum) throws ApiException{
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/PartNoMapping";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("vdPartNum",vdPartNum);
log.info("从Qisda获取料号转换:vdPartNum=" + vdPartNum);
String result = HttpHelper.postParam(url,paramMap);
log.info("从Qisda获取料号转换:(PartNoMapping)返回:" + result);
Map<String, Object> resultMap = JsonUtil.toMap(result);
String msg = resultMap.get("msg").toString();
if(msg.startsWith("0")){
String errorMsg = "从Qisda获取料号["+vdPartNum+"]转换出错:" + msg;
log.info(errorMsg);
throw new ApiException(errorMsg);
}
return msg;
}
public static Map<String,DiffInfo> getInventory() throws ApiException{
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIStcok";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("area","4D");
log.info("从Qisda获取库存信息进行比对");
Map<String,DiffInfo> diffInfoMap = new HashMap<>();
String result = HttpHelper.postParam(url,paramMap);
log.info("Qisda获取库存信息进行比对返回:" + result);
Map<String, Object> resultMap = JsonUtil.toMap(result);
String code = resultMap.get("code").toString();
if(code.equals("200")){
List<Map<String,Object>> data = (List<Map<String, Object>>) resultMap.get("data");
for (Map<String, Object> itemMap : data) {
DiffInfo diffInfo = new DiffInfo();
String partno = itemMap.get("partno").toString();
String facility = itemMap.get("facility").toString();
String location = itemMap.get("location").toString();
String reelid = itemMap.get("reelid").toString();
String qty = itemMap.get("qty").toString();
diffInfo.setPn(partno);
diffInfo.setReelId(reelid);
diffInfo.setLocation(location);
diffInfo.setQty(qty);
diffInfo.setFacility(facility);
diffInfoMap.put(reelid,diffInfo);
}
}else{
String errorMsg = " Qisda获取库存信息进行比对转换出错:" + resultMap.get("msg");
log.info(errorMsg);
throw new ApiException(errorMsg);
}
return diffInfoMap;
}
/**
*
* 缺料反馈接口 (出完工单时调用),绑定首盘不管是否缺料都调用,其他类型的只在所有出库完成时调用一次
*
* 只有首盘会反馈多次缺料信息,若首盘反馈第一次缺料后,料自动匹配齐了,第二次反馈时料号传N/A
*
* @param outItemList
* @param lessBind 是否是绑定缺料反馈
*/
public static void VMILocationOutFeedback(List<OutItem> outItemList, boolean lessBind){
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationOutFeedback";
List<Map<String,Object>> materialInfoList = new ArrayList<>();
for (OutItem outItem : outItemList) {
Map<String,Object> materialInfoMap = new HashMap<String,Object>();
materialInfoMap.put("so",outItem.getSo());//DN单号或者是厂别
materialInfoMap.put("partNum",outItem.getPn());//料号
int lossqty = outItem.outLessQty();
if(lessBind){
//绑定缺料反馈
lossqty = outItem.preBindLessQty();
}
materialInfoMap.put("lossqty",lossqty + "");//缺料数量
materialInfoMap.put("slot",outItem.getSlotStr());//料站
materialInfoMap.put("serial",outItem.gethSerial());//需求单号
materialInfoList.add(materialInfoMap);
}
if(materialInfoList.isEmpty()){
log.info("需求单不缺料,不进行缺料反馈");
}else{
String lackOfMaterial = JsonUtil.toJsonStr(materialInfoList);
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("lackOfMaterial",lackOfMaterial);
log.info("缺料反馈接口(VMILocationOutFeedback)参数lackOfMaterial="+lackOfMaterial);
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("收到缺料反馈接口(VMILocationOutFeedback)返回:" + result);
} catch (ApiException e) {
log.error("缺料反馈接口(VMILocationOutFeedback)接口出错",e);
}
}
}
/**
* 获取DN单详情
* @param dnNo
* @param isCheck
* @return
* @throws ApiException
*/
public static List<DNItem> GetDNDetails(String dnNo, boolean isCheck) throws ApiException {
String url = "http://10.85.17.43:8080/WMSWeb.asmx/GetDNDetailsJson";
Map<String,Object> paramMap = new HashMap<String,Object>();
//paramMap.put("DHNO","DNMISW1911197845");
paramMap.put("DHNO",dnNo);
String isCheckStr = "N";
if(isCheck){
isCheckStr = "Y";
}
paramMap.put("ISCheck",isCheckStr);
paramMap.put("isBack","Y");
String errorMsg = "";
Map<String,DNItem> itemMap = new HashMap<>();
try {
String returnResult = HttpHelper.postParam(url,paramMap);
log.info("获取DN单详情结果:" + returnResult);
String resultStr = XmlUtil.getNodeBody("string", returnResult);
if(resultStr.startsWith("[")){
List<Map<String,Object>> items = JsonUtil.toObj(resultStr, List.class);
for (Map<String,Object> map : items) {
DNItem item = new DNItem();
String no = map.get("DLNO").toString();
item.setDnNo(no);
String dnDateStr = map.get("DLCRDTE").toString()+ " " + map.get("DLCRTIME").toString();
item.setDnDateStr(dnDateStr);
int dnQty = Float.valueOf(map.get("WACTQTY").toString()).intValue();
item.setDnQty(dnQty);
String facility = map.get("WPORD").toString();
item.setFacility(facility);
String company = map.get("DSN").toString();
item.setCompany(company);
String pn = map.get("WPROD").toString();
item.setPn(pn);
DNItem dnItem = itemMap.get(pn);
if(dnItem != null){
int totalDNQty = dnItem.getDnQty() + item.getDnQty();
log.info("PN["+pn+"]有重复,合并数量[" + dnItem.getDnQty() +" + " + item.getDnQty() + " = " + totalDNQty);
dnItem.setDnQty(totalDNQty);
}else{
dnItem = item;
}
itemMap.put(pn, dnItem);
}
}else{
//返回错训误了
errorMsg = resultStr;
}
} catch (Exception e) {
errorMsg = e.getMessage();
log.error("获取DN单详情接口出错",e);
}
if(!Strings.isNullOrEmpty(errorMsg)){
throw new ApiException(errorMsg);
}
List<DNItem> dnItems = Lists.newArrayList();
if(!itemMap.isEmpty()){
dnItems.addAll(itemMap.values());
}
return dnItems;
}
//-------------------------Private Method----------------------------------------
/**
......@@ -615,6 +466,25 @@ public class QisdaApiController extends BaseController {
lockQty = realBindQty;
outItem.setLockQty(lockQty);
}
if(outItem.isCutMaterial()){
//分盘料,需要将已绑定未出库的物料也计算进去
List<StoragePos> cutReels = storagePosDao.findCutList(outItem.getSo(), outItem.getSlotlocation(), outItem.getSoseq());
for (StoragePos cutReel : cutReels) {
List<Map<String, Object>> cutItems = cutReel.getBarcode().getCutItems();
for (Map<String, Object> cutItem : cutItems) {
String so = cutItem.get("so").toString();
String soseqStr = cutItem.get("soseq").toString();
String slotlocation = cutItem.get("slotlocation").toString();
if(outItem.getSo().equals(so) && outItem.getSoseq().equals(soseqStr) && outItem.getSlotlocation() == Integer.valueOf(slotlocation)){
log.info("查找到未出库的分盘料信息["+cutItem+"],更新预绑定数量");
String qty = cutItem.get("qty").toString();
lockQty = outItem.getLockQty() + Integer.valueOf(qty);
outItem.setLockQty(lockQty);
}
}
}
}
outItem = outItemDao.save(outItem);
log.info("更新["+outItem.getSlotlocation()+"]"+outItem.getPn()+"真实绑定数量为["+realBindQty+"/"+outItem.getQty()+"]");
return outItem;
......@@ -863,208 +733,7 @@ public class QisdaApiController extends BaseController {
}
/**
* 6. CIS收料判定接口(绑过料串的条码扫码入库时判断)
*/
private static void VMIMateriaReceiveJudge(DNInfo dnInfo,Barcode barcode) throws ValidateException{
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIMateriaReceiveJudge";
Map<String,Object> materialInfoMap = new HashMap<String,Object>();
String dnOrFacility = dnInfo.getDnNo();
if(dnInfo.isFacilityIn()){
dnOrFacility = dnInfo.getFacility();
}
materialInfoMap.put("dnOrFacility",dnOrFacility);//DN单号或者是厂别
materialInfoMap.put("reelID",barcode.getBarcode());//料卷ID
materialInfoMap.put("partNum",barcode.getPartNumber());//料号
materialInfoMap.put("qty",barcode.getAmount());//数量
materialInfoMap.put("lifeCycle",barcode.getLifeCycle());//生命周期
String productCode = DateUtil.toDateString(barcode.getProduceDate(),"yyyyMMdd");
materialInfoMap.put("productCode",productCode);//生产日期
materialInfoMap.put("lot", barcode.getBatch());//生产批次(批次号)
materialInfoMap.put("vendor",barcode.getProvider());//供应商
materialInfoMap.put("location","");//location
materialInfoMap.put("qrCodeInfo",barcode.getFullCodeStr());//完整的二维码信息
String materialInfo = JsonUtil.toJsonStr(materialInfoMap);
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("materialInfo",materialInfo);
log.info("DN单Facility收料判断参数:materialInfo=" + materialInfo);
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("DN单Facility收料判定接口返回:" + result);
String resultStr = XmlUtil.getNodeBody("string", result);
//0+提示信息/1/-1 0为NG,1为OK,-1为系统内部异常
if(resultStr.startsWith("1")){
log.info(barcode.getBarcode() + " ["+dnOrFacility+"]收料判定: OK");
}else{
log.info(barcode.getBarcode() + " ["+dnOrFacility+"]收料判定: NG" + resultStr);
if(resultStr.startsWith("0")){
throw new ValidateException(" ["+dnOrFacility+"]收料判定NG:" + resultStr);
}else{
throw new ValidateException(" ["+dnOrFacility+"]收料判定NG:" + resultStr);
}
}
} catch (ApiException e) {
log.error(" ["+dnOrFacility+"]收料判定接口",e);
throw new ValidateException(" ["+dnOrFacility+"]收料接口处理异常:" + e.getMessage());
}
}
/**
* 3. CIS入库判定接口 (没绑过料串的条码调用此接口)
*/
public static Barcode VMILocationInCheck(Barcode barcode) throws ValidateException{
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationInCheck";
String reelid = barcode.getBarcode();
String partNum = barcode.getPartNumber();
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("reelid",reelid);
paramMap.put("partNum",partNum);
log.info("纯入库判断参数:reelid=" + reelid);
try {
//0+提示信息/1+工单 0:为NG ;1:为OK 工单号码则表示该料卷被绑定在此工单上;-1为内部异常
String result = HttpHelper.postParam(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>";
log.info("收到纯入库判定接口返回:" + result);
String resultStr = XmlUtil.getNodeBody("string", result);
//0+提示信息/1/-1 0为NG,1为OK,-1为系统内部异常
Map<String, Object> resultMap = JsonUtil.toMap(resultStr);
String state = resultMap.get("state").toString();
if(state.equals("1")){
log.info(reelid + " CIS入库判定: OK");
AppendInfo appendInfo = barcode.getAppendInfo();
Object infoObj = resultMap.get("info");
if(infoObj != null){
log.info("写入条码工单数量信息,并清空分盘数据");
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;
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){
}
}
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);
}
}else{
log.info(reelid + " 纯入库判定: NG" + resultStr);
String ngMsg = resultMap.get("msg").toString();
throw new ValidateException("纯入库判定NG:["+state+"]" + ngMsg);
}
} catch (Exception e) {
log.error("纯入库判定接口出错"+e.getMessage());
throw new ValidateException("纯入库判定接口处理异常:" + e.getMessage());
}
return barcode;
}
/**
* 纯入库操作完成时通知Qisda
*/
private static void VMILocationIn(String reelID, String location){
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationIn";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("reelID",reelID);
paramMap.put("location",location);
paramMap.put("userName",USER_NAME);
log.info("纯入库操作完成时通知Qisda接口(VMILocationIn):reelID=" + reelID + "&location="+location);
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("纯入库操作完成时通知Qisda接口(VMILocationIn)返回:" + result);
} catch (ApiException e) {
log.error("纯入库操作完成时通知Qisda接口(VMILocationIn)出错",e);
}
}
/**
* CIS收料入库接口
*/
private static void VMIMateriaReceive(Barcode barcode,DataLog task){
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIMateriaReceive";
Map<String,Object> materialInfoMap = new HashMap<String,Object>();
materialInfoMap.put("dnOrFacility",barcode.getAppendInfo().getDnOrFacility());//DN单号或者是厂别
materialInfoMap.put("reelID",barcode.getBarcode());//料卷ID
materialInfoMap.put("partNum",barcode.getPartNumber());//料号
materialInfoMap.put("qty",barcode.getAmount() + "");//数量
materialInfoMap.put("lifeCycle",barcode.getLifeCycle());//生命周期
String productCode = DateUtil.toDateString(barcode.getProduceDate(),"yyyyMMdd");
materialInfoMap.put("productCode",productCode);//生产日期
materialInfoMap.put("lot", barcode.getBatch());//生产批次(批次号)
materialInfoMap.put("vendor",barcode.getProvider());//供应商
materialInfoMap.put("location",task.getPosName());//location
materialInfoMap.put("qrCodeInfo",barcode.getFullCodeStr());//完整的二维码信息
materialInfoMap.put("reelType","0");//料卷类型
String materialInfo = JsonUtil.toJsonStr(materialInfoMap);
//materialInfo = "{\"dnOrFacility\":\"DNMIST1901002587\",\"reelID\":\"R000002014042300013\",\"reelType\":\"0\",\"partNum\":\"6H.15010.204\",\"qty\":\"3\",\"lifeCycle\":\"240\",\"productCode\":\"20191102\",\"lot\":\"L00000000IA9617JL1D81\",\"vendor\":\"82012\",\"location\":\"1-1\",\"qrCodeInfo\":\"L00000000IA9617JL1D81;E20190101 0730;B8C.00501.010503562019010103000;R000002014042300013\"}";
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("materialInfo",materialInfo);
paramMap.put("userName",USER_NAME);
log.info("DN单收料或Facility收料通知Qisda接口(VMIMateriaReceive)返回:" + materialInfo);
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("DN单收料或Facility收料接口返回:" + result);
} catch (ApiException e) {
log.error("DN单收料或Facility收料接口出错",e);
}
}
/**
......@@ -1099,10 +768,10 @@ public class QisdaApiController extends BaseController {
materialInfoMap.put("slotserial", slotlocation + "");
log.info("发送分盘料信息:" + cutItem);
VMILocationOut(materialInfoMap);
QisdaApi.VMILocationOut(materialInfoMap);
}
}else{
VMILocationOut(materialInfoMap);
QisdaApi.VMILocationOut(materialInfoMap);
}
}
......@@ -1138,78 +807,7 @@ public class QisdaApiController extends BaseController {
return materialInfoMap;
}
private static void VMILocationOut(Map<String, Object> materialInfoMap){
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationOut";
String materialInfo = JsonUtil.toJsonStr(materialInfoMap);
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("materialInfo",materialInfo);
paramMap.put("userName",USER_NAME);
log.info("出仓完成时通知Qisda:materialInfo=" + materialInfo);
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("出仓完成时通知Qisda(VMILocationOut)返回:" + result);
} catch (ApiException e) {
log.error("出仓完成时通知Qisda(VMILocationOut)接口出错",e);
}
}
/**
* 物料放上小车时调用
* @param task 任务信息
* @param barcode 条码信息
* @param latest 本次工单第几盘料(F 第一次,L 最后一次, M 中间)
*/
public static void VMIMateriaRecAss(DataLog task, Barcode barcode, String latest){
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIMateriaRecAss";
Map<String,Object> materialInfoMap = new HashMap<String,Object>();
AppendInfo appendInfo = task.getAppendInfo();
materialInfoMap.put("action",appendInfo.getAction());
materialInfoMap.put("facility",appendInfo.getFacility());
materialInfoMap.put("so",appendInfo.getSo());
materialInfoMap.put("partNum",task.getPartNumber());
materialInfoMap.put("reelID",task.getBarcode());
materialInfoMap.put("slot", appendInfo.getSlotStr());
materialInfoMap.put("slotserial", appendInfo.getSlotIndex());
materialInfoMap.put("qty",task.getNum() +"");
materialInfoMap.put("latest",latest);//本次工单第几盘料(F 第一次,L 最后一次, M 中间, E是错误)
materialInfoMap.put("cloudLocation",task.getPosName());//云料仓的库位
materialInfoMap.put("location","");//料架库位
materialInfoMap.put("vehicleID",appendInfo.getRfid());//料车编号
if(latest.equals("E")){
//错误状态不发料车编号
materialInfoMap.put("vehicleID","");//料车编号
}
materialInfoMap.put("vehicleLocation",appendInfo.getRfidLoc());//料车架位号
materialInfoMap.put("lot", barcode.getBatch());//生产批次(批次号)
String productCode = DateUtil.toDateString(barcode.getProduceDate(),"yyyyMMdd");
materialInfoMap.put("productCode",productCode);//生产日期
materialInfoMap.put("vendorCode",barcode.getProvider());//供应商
materialInfoMap.put("hSerial",appendInfo.gethSerial());
materialInfoMap.put("flag", "");//子盘或母盘(L:子盘,M:母盘,其他'')
String idte = DateUtil.toDateString(task.getUpdateDate(), "yyyyMMdd");
String idme = DateUtil.toDateString(task.getUpdateDate(), "HHmmss");
materialInfoMap.put("idte",idte);//发料日期
materialInfoMap.put("itme",idme);//发料时间
materialInfoMap.put("soseq",appendInfo.getSoseq());//工单序号
String materialInfo = JsonUtil.toJsonStr(materialInfoMap);
Map<String,Object> paramMap = new HashMap<String,Object>();
paramMap.put("materialInfo",materialInfo);
paramMap.put("userName",USER_NAME);
log.info("物料放上小车时通知Qisda:materialInfo=" + materialInfo);
try {
String result = HttpHelper.postParam(url,paramMap);
log.info("物料放上小车时通知Qisda(VMIMateriaRecAss)返回:" + result);
} catch (ApiException e) {
log.error("物料放上小车时通知Qisda(VMIMateriaRecAss)接口出错",e);
}
}
private List<DataLog> checkOutUrgent(OutItem outItem){
......@@ -1385,8 +983,8 @@ public class QisdaApiController extends BaseController {
}
if(!hasUrgenReel){
log.info("已无紧急料和分盘料任务,清空紧急料/分盘料料架");
InquiryShelfBean.clearShelf("1");
InquiryShelfBean.clearShelf("2");
InquiryShelfBean.clearShelf(InquiryShelfBean.URGENT_SHELF_MAP_KEY);
InquiryShelfBean.clearShelf(InquiryShelfBean.CUT_SHELF_MAP_KEY);
}
//首盘和补料
......@@ -1463,13 +1061,28 @@ public class QisdaApiController extends BaseController {
if(outReelNum == 0){
List<OutItem> outItemList = outItemDao.findByHSerial(outInfo.gethSerial());
boolean lessBind = false;
VMILocationOutFeedback(outItemList, lessBind);
QisdaApi.VMILocationOutFeedback(outItemList, lessBind);
}
}
return "需求单"+hSerial+"任务分配完成,共["+outReelNum+"]盘任务";
}
/**
* 获取接收参数
*/
private String receiveParamInfo(HttpServletRequest request){
String paramInfo = request.getParameter("paramInfo");
if(Strings.isNullOrEmpty(paramInfo)){
//从body里面再获取一次
Map<String, String> bodyParamMap = getParamMapFromBody(request);
paramInfo = bodyParamMap.get("paramInfo");
}
return paramInfo;
}
private DataLog newTask(OutItem outItem, StoragePos pos){
DataLog task = new DataLog();
task.setType(StorageConstants.OP.CHECKOUT);
......
......@@ -16,6 +16,7 @@ import com.myproject.dao.mongo.qisda.IOutItemDao;
import com.myproject.exception.ValidateException;
import com.myproject.manager.IBarcodeManager;
import com.myproject.manager.IComponentManager;
import com.myproject.util.QisdaApi;
import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.qisda.util.OutInfoCache;
import com.myproject.webapp.controller.storage.BaseController;
......@@ -236,6 +237,18 @@ public class QisdaDeviceController extends BaseController {
if(hSerial.isEmpty()){
return ResultBean.newErrorResult(-2, "未找到大料架["+bigRfid+"]");
}
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog task : allTasks) {
//如果还有小料任务未完成,说明换了需求单了,放行大料架
if(task.isCheckOutTask() && task.isSmallReel() && !task.isPackageReel()){
AppendInfo appendInfo = task.getAppendInfo();
if(appendInfo.isFirstReelAction() || appendInfo.isTailAction()){
return ResultBean.newErrorResult(-3, "还有小料任务,需求单已更换,大料架["+bigRfid+"]放行");
}
}
}
log.info("收到机器人[3]获取包装料摆放位置信息请求:[packageRfid=" + packageRfid + "]bigRfid=" + bigRfid + "当前工单料需求:["+hSerial+"]");
ShelfInfo packageShelf = inquiryShelfBean.findPackageShelf(hSerial, packageRfid);
......@@ -253,11 +266,6 @@ public class QisdaDeviceController extends BaseController {
}
if(bigShelf != null){
Collection<DataLog> queueTasks = taskService.getQueueTasks();
List<DataLog> allTasks = taskService.getFinishedTasks();
if(!queueTasks.isEmpty()){
allTasks.addAll(queueTasks);
}
//剩余包装料任务
int packageTask = 0;
for (DataLog task : allTasks) {
......@@ -294,7 +302,7 @@ public class QisdaDeviceController extends BaseController {
//包装料架上有料,且大料架有空位,从大料架上查找空位
DataLog task = taskService.getFinishedTask(barcode);
if(task == null){
String msg = "机器人[3]获取包装料摆放位置信息,未找到包装料架[]上条码["+barcode+"]的任务";
String msg = "机器人[3]获取包装料摆放位置信息,未找到条码["+barcode+"]的任务";
log.error(msg);
return ResultBean.newErrorResult(103, msg);
}
......@@ -510,6 +518,48 @@ public class QisdaDeviceController extends BaseController {
}
/**
* 分盘料/紧急料放上料串或料架流出时调用
*/
@RequestMapping(value = "/clearRfid")
@ResponseBody
public ResultBean clearRfid(HttpServletRequest request) {
String rfid = request.getParameter("rfid");
if(rfid == null){
rfid = "";
}
boolean clearResult = InquiryShelfBean.clearShelf(InquiryShelfBean.URGENT_SHELF_MAP_KEY,rfid);
if(!clearResult){
log.info("从分盘料料架中查找["+rfid+"]准备清除");
clearResult = InquiryShelfBean.clearShelf(InquiryShelfBean.CUT_SHELF_MAP_KEY,rfid);
}
log.info("清除料架["+rfid+"]完成:" + clearResult);
return ResultBean.newOkResult(clearResult);
}
/**
* 取消入库任务
*/
@RequestMapping(value = "/cancelPutInTask")
@ResponseBody
public ResultBean cancelPutInTask(HttpServletRequest request) {
String barcode = request.getParameter("barcode");
if(Strings.isBlank(barcode)){
return ResultBean.newErrorResult(2001,"未找到参数barcode");
}
Collection<DataLog> queueTasks = taskService.getQueueTasks();
for (DataLog queueTask : queueTasks) {
if(queueTask.isPutInTask() && queueTask.getBarcode().equals(barcode)){
//只能取消入库任务
boolean cancelResult = taskService.cancelTask(queueTask.getId());
log.info("客户端取消["+barcode+"]的入库任务结果:" + cancelResult);
return ResultBean.newOkResult(cancelResult);
}
}
return ResultBean.newErrorResult(2002, "任务["+barcode+"]取消失败");
}
/**
* 分盘料/紧急料放上料串或料架时调用
*/
@RequestMapping(value = "/afterPutCut")
......@@ -522,37 +572,31 @@ public class QisdaDeviceController extends BaseController {
String barcode = request.getParameter("barcode");
String rfid = request.getParameter("rfid");
String rfidLoc = request.getParameter("rfidLoc");
log.info("收到["+cid+"]紧急/分盘料[" + barcode + "]放入"+rfid+"[" + rfidLoc + "]指令");
log.debug("收到["+cid+"]紧急/分盘料[" + barcode + "]放入"+rfid+"[" + rfidLoc + "]指令");
DataLog task = findFinishedTask(barcode);
if(task == null){
return ResultBean.newErrorResult(301, "任务不存在");
}
ShelfLoc shelfLoc = inquiryShelfBean.putInCutReel(task,rfid, Integer.valueOf(rfidLoc));
if(shelfLoc != null){
log.info("收到["+cid+"]紧急/分盘料[" + barcode + "]放入"+rfid+"[" + rfidLoc + "]成功");
task.setStatus(StorageConstants.OP_STATUS.FINISHED.name());
rfidLoc = shelfLoc.getLoc() + "";
}else{
log.info("收到"+cid+"紧急/分盘料[" + barcode + "]放入"+rfid+"[" + rfidLoc + "]失败");
task.setStatus(StorageConstants.OP_STATUS.INSHELF.toString());
if(task != null){
ShelfLoc shelfLoc = inquiryShelfBean.putInCutReel(task,rfid, Integer.valueOf(rfidLoc));
if(shelfLoc != null){
log.info("["+cid+"]紧急/分盘料[" + barcode + "]放入"+rfid+"[" + rfidLoc + "]成功");
task.setStatus(StorageConstants.OP_STATUS.FINISHED.name());
rfidLoc = shelfLoc.getLoc() + "";
}else{
log.info(""+cid+"紧急/分盘料[" + barcode + "]放入"+rfid+"[" + rfidLoc + "]失败");
task.setStatus(StorageConstants.OP_STATUS.INSHELF.toString());
}
AppendInfo appendInfo = task.getAppendInfo();
appendInfo.setRfid(rfid);
appendInfo.setRfidLoc(Integer.valueOf(rfidLoc));
task.setAppendInfo(appendInfo);
task = dataLogDao.save(task);
taskService.updateFinishedTask(task);
}
AppendInfo appendInfo = task.getAppendInfo();
appendInfo.setRfid(rfid);
appendInfo.setRfidLoc(Integer.valueOf(rfidLoc));
task.setAppendInfo(appendInfo);
task = dataLogDao.save(task);
taskService.updateFinishedTask(task);
int cutPackageTask = 0;
int urgentPackageTask = 0;
int cutTask = 0;
int urgentTask = 0;
Collection<DataLog> queueTasks = taskService.getQueueTasks();
List<DataLog> allTasks = taskService.getFinishedTasks();
if(!queueTasks.isEmpty()){
allTasks.addAll(queueTasks);
}
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog unFinishedTask : allTasks) {
if(!unFinishedTask.isFinished() && !unFinishedTask.isCancel() && unFinishedTask.isCheckOutTask()){
if(unFinishedTask.isPackageReel()){
......@@ -563,9 +607,9 @@ public class QisdaDeviceController extends BaseController {
urgentPackageTask = urgentPackageTask + 1;
}
}
}else if(task.isCutReel()){
}else if(unFinishedTask.isCutReel()){
cutTask = cutTask + 1;
}else if(task.isUrgentReel()){
}else if(unFinishedTask.isUrgentReel()){
urgentTask = urgentTask + 1;
}
}
......@@ -577,6 +621,16 @@ public class QisdaDeviceController extends BaseController {
resultMap.put("cutTask", cutTask + "");
resultMap.put("urgentTask", urgentTask + "");
if(cutPackageTask + cutTask == 0){
log.info("已无分盘料任务,清空分盘料使用料架/料串");
InquiryShelfBean.clearShelf(InquiryShelfBean.CUT_SHELF_MAP_KEY);
}
if(urgentPackageTask + urgentTask == 0){
log.info("已无紧急料任务,清空紧急料使用料架/料串");
InquiryShelfBean.clearShelf(InquiryShelfBean.URGENT_SHELF_MAP_KEY);
}
return ResultBean.newOkResult(resultMap);
}
......@@ -589,7 +643,7 @@ public class QisdaDeviceController extends BaseController {
String barcode = request.getParameter("barcode");
String statusStr = request.getParameter("status");
String locInfo = request.getParameter("locInfo");
log.info("收到料盘["+barcode+"]更新位置指令["+statusStr+"]=" + locInfo);
log.debug("收到料盘["+barcode+"]更新位置指令["+statusStr+"]=" + locInfo);
DataLog task = findFinishedTask(barcode);
if(task == null){
......@@ -682,7 +736,7 @@ public class QisdaDeviceController extends BaseController {
String latest = outInfo.getShelfLatest();
QisdaApiController.VMIMateriaRecAss(cacheTask, barcodeObj,latest);
QisdaApi.VMIMateriaRecAss(cacheTask, barcodeObj,latest);
//发料完成,更新发料数量
int slotSeq = appendInfo.getSlotIndex();
OutItem outItem = outItemDao.findItem(hSerial, slotSeq);
......
......@@ -28,6 +28,7 @@ import com.myproject.manager.IStoragePosManager;
import com.myproject.model.User;
import com.myproject.service.UserManager;
import com.myproject.util.HttpHelper;
import com.myproject.util.QisdaApi;
import com.myproject.util.StorageConstants;
import com.myproject.webapp.controller.qisda.QisdaController;
import com.myproject.webapp.controller.qisda.util.OutInfoCache;
......@@ -192,6 +193,19 @@ public class TaskService implements ITaskService {
return resultTasks;
}
/**
* 获取所有任务
*/
@Override
public List<DataLog> getAllTasks(){
Collection<DataLog> queueTasks = getQueueTasks();
List<DataLog> allTasks = getFinishedTasks();
if(!queueTasks.isEmpty()){
allTasks.addAll(queueTasks);
}
return allTasks;
}
@Override
public DataLog getFinishedTask(String barcode){
......@@ -834,7 +848,7 @@ public class TaskService implements ITaskService {
log.info("需求单[" + outInfo.gethSerial() + "]任务完成数量:" + outInfo.getTaskFinishNum() + "/" + outInfo.getTaskNum() + "已出仓料盘数量:" + outInfo.getOutReelNum());
outInfoDao.save(outInfo);
InquiryShelfBean.cancelReelTask(task);
QisdaApiController.VMIMateriaRecAss(task, barcode, "E");
QisdaApi.VMIMateriaRecAss(task, barcode, "E");
}
}
finishedTaskMap.remove(task.getBarcode());
......@@ -2015,7 +2029,6 @@ public class TaskService implements ITaskService {
if(outItem != null){
if(barcode.hasCutInfo()){
log.info("分盘料出库,更新需求单出库数量");
//分盘料,需要更新对应的需求单出库数量
final List<Map<String, Object>> cutItems = barcode.getCutItems();
for (Map<String, Object> cutItem : cutItems) {
......@@ -2049,16 +2062,19 @@ public class TaskService implements ITaskService {
outInfo = outInfoDao.findByHSerial(outItem.gethSerial());
int outReelNum = outInfo.getOutReelNum();
outInfo.setOutReelNum(outReelNum + 1);
if(outItem.isUrgentAction() || outItem.isReelCutAction()){
outInfo.setTaskFinishNum(outInfo.getTaskFinishNum() + 1);
}
outInfo = outInfoDao.save(outInfo);
String latest = outInfo.getOutLatest();
QisdaApiController.OutFinished(task, barcode, latest);
if (latest.equals("L")) {
log.info("工单[" + outItem.getSo() + "]的最后一盘出库完成,发送缺料通知");
log.info("工单[" + outItem.getSo() + "]需求单["+outItem.gethSerial()+"]的最后一盘出库完成,发送缺料通知");
List<OutItem> outItemList = outItemDao.findByHSerial(outItem.gethSerial());
boolean lessBind = false;
QisdaApiController.VMILocationOutFeedback(outItemList, lessBind);
QisdaApi.VMILocationOutFeedback(outItemList, lessBind);
}
}
......
......@@ -43,6 +43,15 @@
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="form-group form-inline">
<div class="input-group margin-top-10">
<span class="input-group-addon"><fmt:message key="条码"/></span>
<input type="text" class="form-control input-xlarge" name="alarmMsg" value="${alarmMsg}"/>
</div>
</div>
</div>
<div class="col-md-2">
<button class="btn purple margin-top-10" type="submit"><i class="fa fa-search"></i>
<fmt:message key="button.search"/>
......
......@@ -164,6 +164,9 @@
<%--&lt;%&ndash;<display:column property="barcode.amount" titleKey="数量"/>&ndash;%&gt;--%>
<%--<display:column property="barcode.lockName" titleKey="menu.inRule"/>--%>
<display:column property="posName" titleKey="checkOut.pos" sortProperty="posName" sortable="true"/>
<display:column titleKey="尺寸">
${pos.sizeStr}
</display:column>
<display:column property="barcode.appendInfo.facility" titleKey="Facility" sortProperty="barcode.appendInfo.facility" sortable="true"/>
<display:column titleKey="时间" sortProperty="barcode.updateDate" sortable="true">
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!