Commit 789d042d sunke

分盘/紧急料出到不同的料架上

1 个父辈 20e745be
...@@ -242,7 +242,42 @@ IP: 10.85.160.181 ...@@ -242,7 +242,42 @@ IP: 10.85.160.181
>> - packing-24:24: 表示包装仓19的空闲仓位数是24 >> - packing-24:24: 表示包装仓19的空闲仓位数是24
问题点 10. 分盘料/紧急料放上料串或料架时调用
>地址:
>>/rest/api/qisda/device/afterPutCut
>
>参数:
>>cid: 料仓cid,流水线可传入空
>>barcode : 条码
>>rfid : RFID
>>rfidLoc: 料架位置,流水线可传-1
>
> 返回:
>>` {"code": 0, "msg":"ok", "data":{"cutPackageTask":"0","urgentPackageTask":"20","cutTask":"21","urgentTask":"22"}} `
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
>> - cutPackageTask: 表示当前包装仓的分盘任务数
>> - urgentPackageTask: 表示当前包装仓的紧急料任务数
>> - cutTask: 表示流水线分盘任务数
>> - urgentTask: 表示流水线紧急料任务数
11. 分盘料/紧急料启动时获取料架的虚拟RFID调用
>地址:
>>/rest/api/qisda/device/findTempRfid
>
>参数:
>>rfid : RFID
>
> 返回:
>>` {"code": 0, "msg":"ok", "data":{"tempRfid":""}} `
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
>> - tempRfid: 表示当前料架(料串)对应的虚拟RFID
1 分盘数量
2 CJZ料位置39
...@@ -312,10 +312,6 @@ public class AppendInfo { ...@@ -312,10 +312,6 @@ public class AppendInfo {
return cisIn || dnNo == null || dnNo.isEmpty(); return cisIn || dnNo == null || dnNo.isEmpty();
} }
public String getTempRfid(){
return gethSerial() + "-" + rfidIndex + shelfType;
}
public String getSoseq() { public String getSoseq() {
return soseq; return soseq;
} }
......
...@@ -17,6 +17,14 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -17,6 +17,14 @@ import java.util.concurrent.ConcurrentHashMap;
public class InquiryShelfBean { public class InquiryShelfBean {
protected final static Logger log = LogManager.getLogger(InquiryShelfBean.class); protected final static Logger log = LogManager.getLogger(InquiryShelfBean.class);
/**
* 紧急料Shelf Key
*/
public static final String URGENT_SHELF_MAP_KEY = "1";
/**
* 分盘料Shelf Key
*/
public static final String CUT_SHELF_MAP_KEY = "2";
/** /**
* 料架管理Map, key为 hSerial, value的key为 tempRfid, value为料架 * 料架管理Map, key为 hSerial, value的key为 tempRfid, value为料架
...@@ -124,7 +132,7 @@ public class InquiryShelfBean { ...@@ -124,7 +132,7 @@ public class InquiryShelfBean {
} }
String shelfNameStr = ""; String shelfNameStr = "";
if(firstEmptyShelf != null){ if(firstEmptyShelf != null){
if(firstEmptyShelf.tempRfid().equals(taskAppendInfo.getTempRfid())){ if(firstEmptyShelf.tempRfid().equals(task.getTempRfid())){
//与最小的料架号相同,可以出库 //与最小的料架号相同,可以出库
return true; return true;
}; };
...@@ -132,13 +140,13 @@ public class InquiryShelfBean { ...@@ -132,13 +140,13 @@ public class InquiryShelfBean {
} }
if(secondEmptyShelf != null){ if(secondEmptyShelf != null){
if(secondEmptyShelf.tempRfid().equals(taskAppendInfo.getTempRfid())){ if(secondEmptyShelf.tempRfid().equals(task.getTempRfid())){
//与最次小的料架号相同,可以出库 //与最次小的料架号相同,可以出库
return true; return true;
}; };
shelfNameStr = shelfNameStr + "," + secondEmptyShelf.tempRfid(); shelfNameStr = shelfNameStr + "," + secondEmptyShelf.tempRfid();
} }
log.info("任务"+task.getBarcode()+"["+taskAppendInfo.getTempRfid()+"]不在两个料架当中,暂不出库"); log.info("任务"+task.getBarcode()+"["+task.getTempRfid()+"]不在两个料架"+shelfNameStr+"当中,暂不出库");
} }
return false; return false;
} }
...@@ -259,6 +267,14 @@ public class InquiryShelfBean { ...@@ -259,6 +267,14 @@ public class InquiryShelfBean {
private static synchronized DataLog addLoc(DataLog task, OutItem outItem, String barcode){ private static synchronized DataLog addLoc(DataLog task, OutItem outItem, String barcode){
String shelfType = getShelfType(task); String shelfType = getShelfType(task);
String hSerial = outItem.gethSerial(); String hSerial = outItem.gethSerial();
if(task.isUrgentReel()){
//紧急料放在同一个料串或包装料架上,需求单号使用1
hSerial = "1";
}else if(task.isCutReel()){
//分盘料放在同一个料串或包装料架上,需求单号使用2
hSerial = "2";
}
ShelfInfo emptyShelfInfo = getOrAddShelfInfo(hSerial,shelfType); ShelfInfo emptyShelfInfo = getOrAddShelfInfo(hSerial,shelfType);
if(emptyShelfInfo != null){ if(emptyShelfInfo != null){
if(task != null){ if(task != null){
...@@ -275,7 +291,7 @@ public class InquiryShelfBean { ...@@ -275,7 +291,7 @@ public class InquiryShelfBean {
appendInfo.setRfidIndex(emptyShelfInfo.getRfidIndex()); appendInfo.setRfidIndex(emptyShelfInfo.getRfidIndex());
appendInfo.setShelfType(shelfType); appendInfo.setShelfType(shelfType);
appendInfo.sethSerial(hSerial); appendInfo.sethSerial(outItem.gethSerial());
if(barcode != null && !barcode.isEmpty()){ if(barcode != null && !barcode.isEmpty()){
appendInfo.setRfidLoc(loc); appendInfo.setRfidLoc(loc);
} }
...@@ -300,7 +316,7 @@ public class InquiryShelfBean { ...@@ -300,7 +316,7 @@ public class InquiryShelfBean {
/** /**
* 根据tempRfid编号获取料架信息 * 根据tempRfid编号获取料架信息
*/ */
public ShelfInfo findSameShelf(String hSerial, String rfid){ public static ShelfInfo findSameShelf(String hSerial, String rfid){
if(hSerial != null && !hSerial.isEmpty()){ if(hSerial != null && !hSerial.isEmpty()){
Map<String, ShelfInfo> shelfMap = hSerialShelfMap.get(hSerial); Map<String, ShelfInfo> shelfMap = hSerialShelfMap.get(hSerial);
if(shelfMap != null){ if(shelfMap != null){
...@@ -495,7 +511,7 @@ public class InquiryShelfBean { ...@@ -495,7 +511,7 @@ public class InquiryShelfBean {
} }
shelfInfo = minIndexShelf; shelfInfo = minIndexShelf;
if(shelfInfo != null){ if(shelfInfo != null){
log.info(task.getBarcode() + "["+ appendInfo.getTempRfid()+"]未找到rfid=["+rfid+"]的空料架,使用序号最小的同种料架["+shelfInfo.tempRfid()+"]"); log.info(task.getBarcode() + "["+ task.getTempRfid()+"]未找到rfid=["+rfid+"]的空料架,使用序号最小的同种料架["+shelfInfo.tempRfid()+"]");
}else{ }else{
log.info("已没有与["+rfid+"]类型相同的料架");; log.info("已没有与["+rfid+"]类型相同的料架");;
} }
...@@ -511,7 +527,7 @@ public class InquiryShelfBean { ...@@ -511,7 +527,7 @@ public class InquiryShelfBean {
ShelfLoc lockLoc = shelfInfo.lockOneEmptyLoc(task.getBarcode(), task.getReelType(), robotIndex); ShelfLoc lockLoc = shelfInfo.lockOneEmptyLoc(task.getBarcode(), task.getReelType(), robotIndex);
if(lockLoc != null){ if(lockLoc != null){
log.info("为["+task.getBarcode()+"]锁定架位:" + shelfInfo.tempRfid() + "[" +shelfInfo.getRealRfid()+"]["+lockLoc.getLoc()+"]原来分配架位:" + appendInfo.getTempRfid() + "[" + appendInfo.getRfidLoc() + "]"); log.info("为["+task.getBarcode()+"]锁定架位:" + shelfInfo.tempRfid() + "[" +shelfInfo.getRealRfid()+"]["+lockLoc.getLoc()+"]原来分配架位:" + task.getTempRfid() + "[" + appendInfo.getRfidLoc() + "]");
// ShelfLoc shelfLoc = new ShelfLoc(); // ShelfLoc shelfLoc = new ShelfLoc();
// shelfLoc.setLoc(lockLoc); // shelfLoc.setLoc(lockLoc);
// shelfLoc.setRfid(rfid); // shelfLoc.setRfid(rfid);
...@@ -543,7 +559,7 @@ public class InquiryShelfBean { ...@@ -543,7 +559,7 @@ public class InquiryShelfBean {
if(appendInfo.isFirstReelAction()){ if(appendInfo.isFirstReelAction()){
//首盘料,解除绑定的位置 //首盘料,解除绑定的位置
if(shelfMap != null){ if(shelfMap != null){
ShelfInfo shelfInfo = shelfMap.get(appendInfo.getTempRfid()); ShelfInfo shelfInfo = shelfMap.get(task.getTempRfid());
if(shelfInfo != null){ if(shelfInfo != null){
boolean result = shelfInfo.cancelLimitLoc(taskShelfType, barcode); boolean result = shelfInfo.cancelLimitLoc(taskShelfType, barcode);
if(result){ if(result){
...@@ -584,6 +600,62 @@ public class InquiryShelfBean { ...@@ -584,6 +600,62 @@ public class InquiryShelfBean {
} }
} }
/**
* 紧急料/分盘料放入料架或料串
*/
public synchronized ShelfLoc putInCutReel(DataLog task, String rfid, int loc){
String barcode = task.getBarcode();
String shelfMapKey = task.getShelfMapKey();
Map<String, ShelfInfo> shelfMap = hSerialShelfMap.get(shelfMapKey);
if(shelfMap != null){
//该料架是否已经绑定过
ShelfInfo bindedShelf = findSameShelf(shelfMapKey,rfid);
if(bindedShelf != null){
if(task.isPackageReel()){
//包装料架
}else{
//料串
loc = bindedShelf.addLimitLoc(barcode, task.getReelType());
}
boolean putInResult = bindedShelf.putInLimitLoc(rfid,loc,barcode);
if(putInResult){
updateShelfInfo(bindedShelf);
log.info("包装料["+task.getBarcode()+"]放入料架" + rfid +"["+loc+"]缓存更新成功");
return new ShelfLoc(rfid,loc);
}
}else{
if(task.isPackageReel()){
//包装料架
for (ShelfInfo shelfInfo : shelfMap.values()) {
boolean putInResult = shelfInfo.putInLimitLoc(rfid,loc, barcode);
if(putInResult){
updateShelfInfo(shelfInfo);
log.info("包装物料["+task.getBarcode()+"]使用新料架" + rfid +"["+loc+"]缓存更新成功");
return new ShelfLoc(rfid,loc);
}
}
}else{
//添加一个新的料串,并放入
ShelfInfo newBShelf = ShelfInfo.newBShelf();
int rfidIndex = shelfMap.size();
newBShelf.setRfidIndex(rfidIndex);
newBShelf.sethSerial(shelfMapKey);
log.info("添加新料架["+newBShelf.tempRfid() + "]");
loc = bindedShelf.addLimitLoc(barcode, task.getReelType());
boolean putInResult = bindedShelf.putInLimitLoc(rfid,loc,barcode);
if(putInResult){
log.info("物料["+task.getBarcode()+"]放入料架" + rfid +"["+loc+"]缓存更新成功");
return new ShelfLoc(rfid,loc);
}
}
}
}else{
log.info("未找到["+shelfMapKey+"]相关料架");
}
log.error("物料["+task.getBarcode()+"]("+task.getTempRfid()+"["+task.getAppendInfo().getRfidLoc()+"])料架" + rfid +"["+loc+"]缓存更新失败");
return null;
}
public synchronized boolean putInShelf(DataLog task, String rfid, int loc){ public synchronized boolean putInShelf(DataLog task, String rfid, int loc){
AppendInfo appendInfo = task.getAppendInfo(); AppendInfo appendInfo = task.getAppendInfo();
...@@ -638,7 +710,7 @@ public class InquiryShelfBean { ...@@ -638,7 +710,7 @@ public class InquiryShelfBean {
}else{ }else{
log.info("未找到["+hSerial+"]相关料架"); log.info("未找到["+hSerial+"]相关料架");
} }
log.error("物料["+task.getBarcode()+"]("+task.getAppendInfo().getTempRfid()+"["+task.getAppendInfo().getRfidLoc()+"])料架" + rfid +"["+loc+"]缓存更新失败"); log.error("物料["+task.getBarcode()+"]("+task.getTempRfid()+"["+task.getAppendInfo().getRfidLoc()+"])料架" + rfid +"["+loc+"]缓存更新失败");
return false; return false;
} }
......
...@@ -7,6 +7,14 @@ import com.myproject.util.StorageConstants; ...@@ -7,6 +7,14 @@ import com.myproject.util.StorageConstants;
*/ */
public class ShelfLoc { public class ShelfLoc {
public ShelfLoc() {
}
public ShelfLoc(String realRfid,int loc) {
this.loc = loc;
this.realRfid = realRfid;
}
/** /**
* 真实料架 * 真实料架
*/ */
......
...@@ -5,6 +5,7 @@ import com.google.common.base.Strings; ...@@ -5,6 +5,7 @@ import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.myproject.bean.BaseMongoBean; import com.myproject.bean.BaseMongoBean;
import com.myproject.bean.qisda.AppendInfo; import com.myproject.bean.qisda.AppendInfo;
import com.myproject.bean.qisda.InquiryShelfBean;
import com.myproject.util.StorageConstants; import com.myproject.util.StorageConstants;
import java.util.Date; import java.util.Date;
...@@ -556,6 +557,23 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ { ...@@ -556,6 +557,23 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
} }
} }
public String getShelfMapKey(){
String shelfMapKey = appendInfo.gethSerial();
if(isUrgentReel()){
//紧急料放在同一个料串或包装料架上,需求单号使用1
shelfMapKey = InquiryShelfBean.URGENT_SHELF_MAP_KEY;
}else if(isCutReel()){
//分盘料放在同一个料串或包装料架上,需求单号使用2
shelfMapKey = InquiryShelfBean.CUT_SHELF_MAP_KEY;
}
return shelfMapKey;
}
public String getTempRfid(){
String tempRfid = getShelfMapKey() + "-" + appendInfo.getRfidIndex() + appendInfo.getShelfType();
return tempRfid;
}
public String getLocInfo() { public String getLocInfo() {
return locInfo; return locInfo;
} }
......
...@@ -1352,7 +1352,7 @@ public class QisdaApiController extends BaseController { ...@@ -1352,7 +1352,7 @@ public class QisdaApiController extends BaseController {
return tasks; return tasks;
} }
private String checkOutOutItems(String hSerial){ private synchronized String checkOutOutItems(String hSerial){
log.info("执行需求单["+hSerial+"]出库"); log.info("执行需求单["+hSerial+"]出库");
OutInfo outInfo = outInfoDao.findByHSerial(hSerial); OutInfo outInfo = outInfoDao.findByHSerial(hSerial);
if(outInfo == null){ if(outInfo == null){
...@@ -1367,6 +1367,7 @@ public class QisdaApiController extends BaseController { ...@@ -1367,6 +1367,7 @@ public class QisdaApiController extends BaseController {
//是否有工单料任务 //是否有工单料任务
boolean hasOrderTask = false; boolean hasOrderTask = false;
boolean hasUrgenReel = false;
for (DataLog dataLog : allTasks) { for (DataLog dataLog : allTasks) {
if(dataLog.isCheckOutTask()){ if(dataLog.isCheckOutTask()){
if(!dataLog.isUrgentReel() && !dataLog.isCutReel()){ if(!dataLog.isUrgentReel() && !dataLog.isCutReel()){
...@@ -1378,9 +1379,15 @@ public class QisdaApiController extends BaseController { ...@@ -1378,9 +1379,15 @@ public class QisdaApiController extends BaseController {
if(taskHSerial.equals(hSerial)){ if(taskHSerial.equals(hSerial)){
return "当前需求单还有未完成的任务"; return "当前需求单还有未完成的任务";
} }
hasUrgenReel = true;
} }
} }
} }
if(!hasUrgenReel){
log.info("已无紧急料和分盘料任务,清空紧急料/分盘料料架");
InquiryShelfBean.clearShelf("1");
InquiryShelfBean.clearShelf("2");
}
//首盘和补料 //首盘和补料
if(!outInfo.isReelCutAction() && !outInfo.isUrgentAction() && hasOrderTask){ if(!outInfo.isReelCutAction() && !outInfo.isUrgentAction() && hasOrderTask){
......
...@@ -456,15 +456,12 @@ public class QisdaDeviceController extends BaseController { ...@@ -456,15 +456,12 @@ public class QisdaDeviceController extends BaseController {
/** /**
* 更新位置信息 * 查找已经完成的任务,如果不存在从数据库中查找,如果任务是未完成状态,执行出库完成指令,同时通知Qisda
*/ */
@RequestMapping(value = "/updateLocInfo") private DataLog findFinishedTask(String barcode){
@ResponseBody if(Strings.isBlank(barcode)){
public ResultBean updateLocInfo(HttpServletRequest request) { return null;
String barcode = request.getParameter("barcode"); }
String statusStr = request.getParameter("status");
String locInfo = request.getParameter("locInfo");
log.info("收到料盘["+barcode+"]更新位置指令["+statusStr+"]=" + locInfo);
DataLog task = taskService.getFinishedTask(barcode); DataLog task = taskService.getFinishedTask(barcode);
if(task == null){ if(task == null){
log.info("未从缓存中找到条码["+barcode+"]的任务信息,从数据库中查询"); log.info("未从缓存中找到条码["+barcode+"]的任务信息,从数据库中查询");
...@@ -472,7 +469,7 @@ public class QisdaDeviceController extends BaseController { ...@@ -472,7 +469,7 @@ public class QisdaDeviceController extends BaseController {
} }
if(task == null){ if(task == null){
log.error("料盘["+barcode+"]的任务不存在"); log.error("料盘["+barcode+"]的任务不存在");
return ResultBean.newErrorResult(301, "任务不存在"); return null;
} }
if(task.isExecuting() || task.isCancel()){ if(task.isExecuting() || task.isCancel()){
log.error("料盘["+barcode+"]的任务未完成,补发出库通知到Qisda"); log.error("料盘["+barcode+"]的任务未完成,补发出库通知到Qisda");
...@@ -482,12 +479,123 @@ public class QisdaDeviceController extends BaseController { ...@@ -482,12 +479,123 @@ public class QisdaDeviceController extends BaseController {
} catch (ValidateException e) { } catch (ValidateException e) {
log.error("补发通知出错",e); log.error("补发通知出错",e);
} }
}else if(task.isFinished()){
log.error("料盘["+barcode+"]的任务已完成");
return null;
}
return task;
} }
if(task.isFinished()){ /**
log.error("料盘["+barcode+"]的任务已完成"); * 分盘料/紧急料放上料串或料架时调用
return ResultBean.newErrorResult(302, "料盘["+barcode+"]的任务已完成"); */
@RequestMapping(value = "/findTempRfid")
@ResponseBody
public ResultBean findTempRfid(HttpServletRequest request) {
String rfid = request.getParameter("rfid");
if(rfid == null){
rfid = "";
}
ShelfInfo shelfInfo = InquiryShelfBean.findSameShelf(InquiryShelfBean.URGENT_SHELF_MAP_KEY,rfid);
if(shelfInfo == null){
shelfInfo = InquiryShelfBean.findSameShelf(InquiryShelfBean.CUT_SHELF_MAP_KEY,rfid);
}
String tempRfid = "";
if(shelfInfo != null){
tempRfid = shelfInfo.tempRfid();
}
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("tempRfid", tempRfid);
return ResultBean.newOkResult(resultMap);
} }
/**
* 分盘料/紧急料放上料串或料架时调用
*/
@RequestMapping(value = "/afterPutCut")
@ResponseBody
public ResultBean afterPutCut(HttpServletRequest request) {
String cid = request.getParameter("cid");
if(cid == null){
cid = "";
}
String barcode = request.getParameter("barcode");
String rfid = request.getParameter("rfid");
String rfidLoc = request.getParameter("rfidLoc");
log.info("收到["+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());
}
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);
}
for (DataLog unFinishedTask : allTasks) {
if(!unFinishedTask.isFinished() && !unFinishedTask.isCancel() && unFinishedTask.isCheckOutTask()){
if(unFinishedTask.isPackageReel()){
if(unFinishedTask.getCid().equals(cid)){
if(unFinishedTask.isCutReel()){
cutPackageTask = cutPackageTask + 1;
}else if(unFinishedTask.isUrgentReel()){
urgentPackageTask = urgentPackageTask + 1;
}
}
}else if(task.isCutReel()){
cutTask = cutTask + 1;
}else if(task.isUrgentReel()){
urgentTask = urgentTask + 1;
}
}
}
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("cutPackageTask", cutPackageTask + "");
resultMap.put("urgentPackageTask",urgentPackageTask + "");
resultMap.put("cutTask", cutTask + "");
resultMap.put("urgentTask", urgentTask + "");
return ResultBean.newOkResult(resultMap);
}
/**
* 更新位置信息
*/
@RequestMapping(value = "/updateLocInfo")
@ResponseBody
public ResultBean updateLocInfo(HttpServletRequest request) {
String barcode = request.getParameter("barcode");
String statusStr = request.getParameter("status");
String locInfo = request.getParameter("locInfo");
log.info("收到料盘["+barcode+"]更新位置指令["+statusStr+"]=" + locInfo);
DataLog task = findFinishedTask(barcode);
if(task == null){
return ResultBean.newErrorResult(301, "任务不存在");
}
statusStr = statusStr.toUpperCase(); statusStr = statusStr.toUpperCase();
log.info("更新料盘["+barcode+"]的任务状态["+task.getStatus()+"=" + task.getLocInfo() + "]为["+statusStr+"="+locInfo+"]"); log.info("更新料盘["+barcode+"]的任务状态["+task.getStatus()+"=" + task.getLocInfo() + "]为["+statusStr+"="+locInfo+"]");
task.setStatus(statusStr); task.setStatus(statusStr);
...@@ -529,7 +637,7 @@ public class QisdaDeviceController extends BaseController { ...@@ -529,7 +637,7 @@ public class QisdaDeviceController extends BaseController {
* @param rfid 料架RFID * @param rfid 料架RFID
* @param rfidLoc 料架位置 * @param rfidLoc 料架位置
*/ */
private 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();
boolean putResult = inquiryShelfBean.putInShelf(cacheTask,rfid, Integer.valueOf(rfidLoc)); boolean putResult = inquiryShelfBean.putInShelf(cacheTask,rfid, Integer.valueOf(rfidLoc));
...@@ -537,7 +645,7 @@ public class QisdaDeviceController extends BaseController { ...@@ -537,7 +645,7 @@ public class QisdaDeviceController extends BaseController {
boolean isCutTask = cacheTask.isUrgentReel() || cacheTask.isCutReel(); boolean isCutTask = cacheTask.isUrgentReel() || cacheTask.isCutReel();
if(!isCutTask && !putResult){ if(!isCutTask && !putResult){
//记录日志 //记录日志
String errorMsg = "料盘["+cacheTask.getBarcode()+"]放入位置"+rfid+"["+rfidLoc+"]失败,原分配位置"+appendInfo.getTempRfid()+"["+appendInfo.getRfidLoc()+"],不更改状态,不进行发料"; String errorMsg = "料盘["+cacheTask.getBarcode()+"]放入位置"+rfid+"["+rfidLoc+"]失败,原分配位置"+cacheTask.getTempRfid()+"["+appendInfo.getRfidLoc()+"],不更改状态,不进行发料";
log.error(errorMsg); log.error(errorMsg);
AlarmInfo alarmInfo = new AlarmInfo(); AlarmInfo alarmInfo = new AlarmInfo();
alarmInfo.setBoxId("0"); alarmInfo.setBoxId("0");
......
...@@ -449,6 +449,7 @@ public class TaskService implements ITaskService { ...@@ -449,6 +449,7 @@ public class TaskService implements ITaskService {
throw new ValidateException("[ " + barcodeSave.getBarcode() + "]已在"+storage.getName()+"["+pos.getPosName()+"]中"); throw new ValidateException("[ " + barcodeSave.getBarcode() + "]已在"+storage.getName()+"["+pos.getPosName()+"]中");
} }
for (DataLog task : taskMap.values()) { for (DataLog task : taskMap.values()) {
if(task.isPutInTask()){ if(task.isPutInTask()){
if(task.getBarcode().equals(barcodeSave.getBarcode())){ if(task.getBarcode().equals(barcodeSave.getBarcode())){
...@@ -682,7 +683,7 @@ public class TaskService implements ITaskService { ...@@ -682,7 +683,7 @@ public class TaskService implements ITaskService {
statusBean.addData("urgentReel",task.isUrgentReel() + ""); statusBean.addData("urgentReel",task.isUrgentReel() + "");
//需要分盘,进入分盘料 //需要分盘,进入分盘料
statusBean.addData("cutReel",task.isCutReel() + ""); statusBean.addData("cutReel",task.isCutReel() + "");
statusBean.addData("rfid", appendInfo.getTempRfid()); statusBean.addData("rfid", task.getTempRfid());
statusBean.addData("realRfid",appendInfo.getRfid()); statusBean.addData("realRfid",appendInfo.getRfid());
statusBean.addData("rfidLoc", appendInfo.getRfidLoc() + ""); statusBean.addData("rfidLoc", appendInfo.getRfidLoc() + "");
statusBean.addData("barcode", task.getBarcode()); statusBean.addData("barcode", task.getBarcode());
...@@ -930,6 +931,7 @@ public class TaskService implements ITaskService { ...@@ -930,6 +931,7 @@ public class TaskService implements ITaskService {
} }
if(urgentTask != null){ if(urgentTask != null){
log.info("出库最先生成的分盘/紧急/包装料任务"+urgentTask.getBarcode()+"["+urgentTask.getPosName()+"]"); log.info("出库最先生成的分盘/紧急/包装料任务"+urgentTask.getBarcode()+"["+urgentTask.getPosName()+"]");
return urgentTask;
} }
//按料架顺序,从小盘开始出库 //按料架顺序,从小盘开始出库
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<display:column titleKey="料架" sortable="true" sortProperty="appendInfo.rfidIndex"> <display:column titleKey="料架" sortable="true" sortProperty="appendInfo.rfidIndex">
<c:if test="${dataLog.type == 2}"> <c:if test="${dataLog.type == 2}">
${dataLog.appendInfo.tempRfid}(${dataLog.appendInfo.rfid}) ${dataLog.tempRfid}(${dataLog.appendInfo.rfid})
</c:if> </c:if>
</display:column> </display:column>
......
...@@ -262,10 +262,14 @@ ...@@ -262,10 +262,14 @@
<h4 class="modal-title" id="orderNo">使用率</h4> <h4 class="modal-title" id="orderNo">使用率</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<h4 class="modal-title">非包装料</h4>
<div class="row theItems" id="usageList"> <div class="row theItems" id="usageList">
</div> </div>
<h4 class="modal-title">包装料</h4>
<div class="row theItems" id="pkgUsageList">
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<%--<button type="button" data-dismiss="modal" class="btn default" id="cancelAuthBtn">取消</button>--%> <%--<button type="button" data-dismiss="modal" class="btn default" id="cancelAuthBtn">取消</button>--%>
...@@ -357,10 +361,15 @@ ...@@ -357,10 +361,15 @@
var bgColors = ["bg-blue-madison","bg-green-haze","bg-purple-plum","bg-red-intense","bg-green","bg-yellow","bg-blue","bg-red","bg-purple","bg-blue-ebonyclay","bg-red-sunglo","bg-yellow-crusta"]; var bgColors = ["bg-blue-madison","bg-green-haze","bg-purple-plum","bg-red-intense","bg-green","bg-yellow","bg-blue","bg-red","bg-purple","bg-blue-ebonyclay","bg-red-sunglo","bg-yellow-crusta"];
$("#viewTotal").click(function(){ $("#viewTotal").click(function(){
showUsageList("usageList",lineTotalSizeData);
showUsageList("pkgUsageList",pkgTotalSizeData);
$("#allUsage").modal("show");
});
function showUsageList(id, sizeData){
var sizeList = new Array(); var sizeList = new Array();
for(var sizeStr in totalSizeData){ for(var sizeStr in sizeData){
var newSizeItem = totalSizeData[sizeStr]; var newSizeItem = sizeData[sizeStr];
sizeList.push(newSizeItem); sizeList.push(newSizeItem);
} }
sizeList.sort(function(a,b){ sizeList.sort(function(a,b){
...@@ -381,9 +390,8 @@ ...@@ -381,9 +390,8 @@
trHtml = trHtml + tr; trHtml = trHtml + tr;
} }
var html = "<table class='table table-striped table-bordered table-hover'><thead><th>尺寸</th><th>已使用</th><th>总数量</th></thead>"+trHtml+"</table>" var html = "<table class='table table-striped table-bordered table-hover'><thead><th>尺寸</th><th>已使用</th><th>总数量</th></thead>"+trHtml+"</table>"
$("#usageList").html(html); $("#"+id).html(html);
$("#allUsage").modal("show"); }
});
...@@ -586,11 +594,13 @@ ...@@ -586,11 +594,13 @@
} }
var totalSizeData = {}; var lineTotalSizeData = {};
var pkgTotalSizeData = {};
//刷新库存情况 //刷新库存情况
function flushUsageItem(){ function flushUsageItem(){
$.post("${ctx}/service/store/storageList", {cids:"${cids}"}, function (storageList) { $.post("${ctx}/service/store/storageList", {cids:"${cids}"}, function (storageList) {
var newTotalSizeData = {}; var newLineTotalSizeData = {};
var newPkgTotalSizeData = {};
for(var i in storageList){ for(var i in storageList){
var storage = storageList[i]; var storage = storageList[i];
var sizeData = storage.usageMap; var sizeData = storage.usageMap;
...@@ -599,14 +609,24 @@ ...@@ -599,14 +609,24 @@
for(var sizeStr in sizeData){ for(var sizeStr in sizeData){
var newSizeItem = sizeData[sizeStr]; var newSizeItem = sizeData[sizeStr];
sizeList.push(newSizeItem); sizeList.push(newSizeItem);
var sizeItem = newTotalSizeData[sizeStr]; var sizeItem;
if(storage['type'] == 'PACKAGE'){
sizeItem = newPkgTotalSizeData[sizeStr];
}else{
sizeItem = newLineTotalSizeData[sizeStr];
}
if(sizeItem){ if(sizeItem){
sizeItem.totalCount = sizeItem.totalCount + newSizeItem.totalCount; sizeItem.totalCount = sizeItem.totalCount + newSizeItem.totalCount;
sizeItem.usedCount = sizeItem.usedCount + newSizeItem.usedCount; sizeItem.usedCount = sizeItem.usedCount + newSizeItem.usedCount;
}else{ }else{
sizeItem = newSizeItem; sizeItem = newSizeItem;
} }
newTotalSizeData[sizeStr] = sizeItem;
if(storage['type'] == 'PACKAGE'){
newPkgTotalSizeData[sizeStr] = sizeItem;
}else{
newLineTotalSizeData[sizeStr] = sizeItem;
}
} }
...@@ -634,7 +654,8 @@ ...@@ -634,7 +654,8 @@
} }
} }
totalSizeData = newTotalSizeData; lineTotalSizeData = newLineTotalSizeData;
pkgTotalSizeData = newPkgTotalSizeData;
var allContent = $(".task-content"); var allContent = $(".task-content");
allContent.each(function(index){ allContent.each(function(index){
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!