Commit 8a69e21b zshaohui

smdbox方舱 修改

1 个父辈 7c935ae2
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version> <version>2.4</version>
<configuration> <configuration>
<source>${java.version}</source> <source>8</source>
<target>${java.version}</target> <target>8</target>
</configuration> </configuration>
</plugin> </plugin>
......
...@@ -14,6 +14,16 @@ public class VerticalBoxOperateBean { ...@@ -14,6 +14,16 @@ public class VerticalBoxOperateBean {
private List<StoragePos> extendPosList; private List<StoragePos> extendPosList;
private int partitionAmount = 0;
public int getPartitionAmount() {
return partitionAmount;
}
public void setPartitionAmount(int partitionAmount) {
this.partitionAmount = partitionAmount;
}
public DataLog getCurrentTask() { public DataLog getCurrentTask() {
return currentTask; return currentTask;
} }
......
package com.myproject.bean.storage;
import com.myproject.bean.update.StoragePos;
import java.util.List;
public class XlStoragePos {
/**
* 箱子号
*/
private String posName;
private String posId;
private int partitionAmount = 0;
/**
* 隔口号
*/
private List<Partition> partitionList;
public int getPartitionAmount() {
return partitionAmount;
}
public void setPartitionAmount(int partitionAmount) {
this.partitionAmount = partitionAmount;
}
public String getPosName() {
return posName;
}
public void setPosName(String posName) {
this.posName = posName;
}
public String getPosId() {
return posId;
}
public void setPosId(String posId) {
this.posId = posId;
}
public List<Partition> getPartitionList() {
return partitionList;
}
public void setPartitionList(List<Partition> partitionList) {
this.partitionList = partitionList;
}
public static class Partition {
private String partition;
private List<StoragePos> storagePosList;
public String getPartition() {
return partition;
}
public void setPartition(String partition) {
this.partition = partition;
}
public List<StoragePos> getStoragePosList() {
return storagePosList;
}
public void setStoragePosList(List<StoragePos> storagePosList) {
this.storagePosList = storagePosList;
}
}
}
...@@ -51,6 +51,32 @@ public class StoragePos extends BaseMongoBean { ...@@ -51,6 +51,32 @@ public class StoragePos extends BaseMongoBean {
*/ */
private List<String> mergePosList; private List<String> mergePosList;
/**
* 隔口
*/
private String partition;
/**
* 隔口数量
*/
private int partitionAmount = 1;
public int getPartitionAmount() {
return partitionAmount;
}
public void setPartitionAmount(int partitionAmount) {
this.partitionAmount = partitionAmount;
}
public String getPartition() {
return partition;
}
public void setPartition(String partition) {
this.partition = partition;
}
public Barcode getBarcode() { public Barcode getBarcode() {
return barcode; return barcode;
} }
......
...@@ -126,4 +126,8 @@ public class BoxStatusBean { ...@@ -126,4 +126,8 @@ public class BoxStatusBean {
public String getPosId(){ public String getPosId(){
return data.get("posId"); return data.get("posId");
} }
public String getDoor(){
return data.get("door");
}
} }
...@@ -111,4 +111,8 @@ public interface IStoragePosManager extends IManager<StoragePos> { ...@@ -111,4 +111,8 @@ public interface IStoragePosManager extends IManager<StoragePos> {
List<PlateSizeBean> getStoragePosUsage(String storageId); List<PlateSizeBean> getStoragePosUsage(String storageId);
List<StoragePos> getSameSizeContinuityEmptyPosList(Storage storage, Barcode barcode) throws ValidateException; List<StoragePos> getSameSizeContinuityEmptyPosList(Storage storage, Barcode barcode) throws ValidateException;
List<StoragePos> findusedByStorageId(String id);
void updatePosPartitionAmount(String posName, String partitionAmount);
} }
...@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
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;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
...@@ -639,6 +640,25 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -639,6 +640,25 @@ public class StoragePosManagerImpl implements IStoragePosManager {
return new ArrayList<>(); return new ArrayList<>();
} }
@Override
public List<StoragePos> findusedByStorageId(String storageId) {
Criteria c = Criteria.where("used").is(true)
.and("enabled").is(true);//可用;
if (!Strings.isNullOrEmpty(storageId)) {
c = c.and("storageId").is(storageId);
}
Query query = new Query(c);
query.with(new Sort(Sort.Direction.ASC, "updateDate"));
return storagePosDao.findByQuery(query);
}
@Override
public void updatePosPartitionAmount(String posName, String partitionAmount) {
Query query = new Query(Criteria.where("posName").is(posName));
Update update = Update.update("partitionAmount", partitionAmount);
storagePosDao.updateMulti(query, update);
}
/** /**
* 获取下一库位的库位名(后缀数字+1) * 获取下一库位的库位名(后缀数字+1)
*/ */
......
package com.myproject.webapp.controller.storage; package com.myproject.webapp.controller.storage;
import com.mongodb.util.JSON;
import com.myproject.bean.CodeBean; import com.myproject.bean.CodeBean;
import com.myproject.bean.json.VerticalBoxOperateBean; import com.myproject.bean.json.VerticalBoxOperateBean;
import com.myproject.bean.storage.XlStoragePos;
import com.myproject.bean.update.*; import com.myproject.bean.update.*;
import com.myproject.dao.mongo.IDataLogDao; import com.myproject.dao.mongo.IDataLogDao;
import com.myproject.exception.ValidateException; import com.myproject.exception.ValidateException;
...@@ -13,6 +15,7 @@ import com.myproject.webapp.controller.webService.DataCache; ...@@ -13,6 +15,7 @@ import com.myproject.webapp.controller.webService.DataCache;
import com.myproject.webapp.controller.webService.ITaskService; import com.myproject.webapp.controller.webService.ITaskService;
import com.myproject.webapp.controller.webService.boxHandler.SmdXlBoxHandler; import com.myproject.webapp.controller.webService.boxHandler.SmdXlBoxHandler;
import com.myproject.webapp.controller.webService.boxHandler.VerticalBoxHandler; import com.myproject.webapp.controller.webService.boxHandler.VerticalBoxHandler;
import org.apache.commons.lang3.StringUtils;
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.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -20,10 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -20,10 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.*;
import java.util.Collection; import java.util.stream.Collectors;
import java.util.Date;
import java.util.List;
/** /**
...@@ -84,11 +85,52 @@ public class SmdXLController extends BaseController{ ...@@ -84,11 +85,52 @@ public class SmdXLController extends BaseController{
*/ */
@RequestMapping("/service/store/xl/storagePosList") @RequestMapping("/service/store/xl/storagePosList")
@ResponseBody @ResponseBody
public List<StoragePos> checkAll(HttpServletRequest request){ public List<XlStoragePos> checkAll(HttpServletRequest request) {
String cid = request.getParameter("cid"); String cid = request.getParameter("cid");
Storage storage = dataCache.getStorage(cid); Storage storage = dataCache.getStorage(cid);
List<StoragePos> notEmptyPosList = storagePosManager.findNotEmptyByStorageId(storage.getId()); List<StoragePos> notEmptyPosList = storagePosManager.findusedByStorageId(storage.getId());
return notEmptyPosList; //提取箱子号
List<XlStoragePos> xlStoragePosList = notEmptyPosList.stream().map(item -> {
XlStoragePos xlStoragePos = new XlStoragePos();
String hostPosId = item.getHostPosId();
if (StringUtils.isNotBlank(hostPosId)) {
StoragePos storagePos = storagePosManager.get(hostPosId);
if (storagePos != null) {
xlStoragePos.setPosId(storagePos.getId());
xlStoragePos.setPosName(storagePos.getPosName());
}
} else {
xlStoragePos.setPartitionAmount(item.getPartitionAmount());
xlStoragePos.setPosId(item.getId());
xlStoragePos.setPosName(item.getPosName());
}
return xlStoragePos;
}).collect(Collectors.toList());
xlStoragePosList = xlStoragePosList.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(
Comparator.comparing(p -> p.getPosId()))), ArrayList::new));
//2.找到隔口信息
if (xlStoragePosList != null && !xlStoragePosList.isEmpty()) {
for (XlStoragePos xlStoragePos : xlStoragePosList) {
List<String> partitionStrList = notEmptyPosList.stream().filter(item -> {
return xlStoragePos.getPosId().equals(item.getHostPosId()) && StringUtils.isNotBlank(item.getPartition());
}).map(item -> {
return item.getPartition();
}).collect(Collectors.toList());
partitionStrList = partitionStrList.stream().distinct().collect(Collectors.toList());
//3.整合隔口下的物料信息
List<XlStoragePos.Partition> partitionList = new ArrayList<>();
for (String partitionStr : partitionStrList) {
XlStoragePos.Partition partition = new XlStoragePos.Partition();
List<StoragePos> storagePosList = notEmptyPosList.stream().filter(item -> partitionStr.equals(item.getPartition()) && xlStoragePos.getPosId().equals(item.getHostPosId())).collect(Collectors.toList());
partition.setPartition(partitionStr);
partition.setStoragePosList(storagePosList);
partitionList.add(partition);
}
xlStoragePos.setPartitionList(partitionList);
}
}
return xlStoragePosList;
} }
/** /**
...@@ -148,21 +190,22 @@ public class SmdXLController extends BaseController{ ...@@ -148,21 +190,22 @@ public class SmdXLController extends BaseController{
} }
@RequestMapping("/service/store/xl/exePutIn") @RequestMapping("/service/store/xl/exePutIn")
@ResponseBody @ResponseBody
public String exePutIn(HttpServletRequest request){ public String exePutIn(HttpServletRequest request) {
String cid = request.getParameter("cid"); String cid = request.getParameter("cid");
String doorInfo = request.getParameter("door"); String doorInfo = request.getParameter("door");
DataLog currentTask = smdXlBoxHandler.getCurrentTask(cid); String posName = request.getParameter("posName");
if(currentTask != null){ DataLog currentTask = smdXlBoxHandler.getCurrentTask(cid,posName);
if (currentTask != null) {
DataLog putInTask = currentTask; DataLog putInTask = currentTask;
log.info(currentTask.getPosName()+"开始回库"); log.info(currentTask.getPosName() + "开始回库");
if(currentTask.isPutInTask()){ if (currentTask.isPutInTask()) {
}else{ } else {
StoragePos pos = storagePosManager.findOneById(putInTask.getPosId()); StoragePos pos = storagePosManager.findOneById(putInTask.getPosId());
if(pos.isExpandPos()){ if (pos.isExpandPos()) {
pos = storagePosManager.findOneById(pos.getHostPosId()); pos = storagePosManager.findOneById(pos.getHostPosId());
} }
if(pos != null){ if (pos != null) {
putInTask = new DataLog(); putInTask = new DataLog();
putInTask.setType(StorageConstants.OP.PUT_IN); putInTask.setType(StorageConstants.OP.PUT_IN);
putInTask.setCid(currentTask.getCid()); putInTask.setCid(currentTask.getCid());
...@@ -215,9 +258,13 @@ public class SmdXLController extends BaseController{ ...@@ -215,9 +258,13 @@ public class SmdXLController extends BaseController{
posOutTask.setStatus(StorageConstants.OP_STATUS.WAIT.name()); posOutTask.setStatus(StorageConstants.OP_STATUS.WAIT.name());
posOutTask.setCid(cid); posOutTask.setCid(cid);
Barcode barcode = pos.getBarcode(); Barcode barcode = pos.getBarcode();
if (barcode != null) {
posOutTask.setPartNumber(barcode.getPartNumber()); posOutTask.setPartNumber(barcode.getPartNumber());
posOutTask.setBarcode(barcode.getBarcode()); posOutTask.setBarcode(barcode.getBarcode());
posOutTask.setNum(barcode.getAmount()); posOutTask.setNum(barcode.getAmount());
} else {
posOutTask.setBarcode(pos.getPosName());
}
posOutTask.setStorageId(storage.getId()); posOutTask.setStorageId(storage.getId());
posOutTask.setStorageName(storage.getName()); posOutTask.setStorageName(storage.getName());
posOutTask.setPosId(pos.getId()); posOutTask.setPosId(pos.getId());
...@@ -243,6 +290,8 @@ public class SmdXLController extends BaseController{ ...@@ -243,6 +290,8 @@ public class SmdXLController extends BaseController{
String codeStr = request.getParameter("code"); String codeStr = request.getParameter("code");
String posName = request.getParameter("pos"); String posName = request.getParameter("pos");
String cid = request.getParameter("cid"); String cid = request.getParameter("cid");
String partition = request.getParameter("partition");
String partitionAmount = request.getParameter("partitionAmount");
DataLog currentTask = smdXlBoxHandler.getCurrentTask(cid); DataLog currentTask = smdXlBoxHandler.getCurrentTask(cid);
StoragePos hostPos = storagePosManager.getByPosName(posName); StoragePos hostPos = storagePosManager.getByPosName(posName);
...@@ -306,6 +355,7 @@ public class SmdXLController extends BaseController{ ...@@ -306,6 +355,7 @@ public class SmdXLController extends BaseController{
existBarcode.setAmount(oldAmount + opQty); existBarcode.setAmount(oldAmount + opQty);
existBarcode = barcodeManager.save(existBarcode); existBarcode = barcodeManager.save(existBarcode);
existPnPos.setBarcode(existBarcode); existPnPos.setBarcode(existBarcode);
existPnPos.setPartition(partition);
storagePosManager.save(existPnPos); storagePosManager.save(existPnPos);
finishTask(existPnPos, opType, currentTask, existBarcode, opQty); finishTask(existPnPos, opType, currentTask, existBarcode, opQty);
...@@ -333,6 +383,7 @@ public class SmdXLController extends BaseController{ ...@@ -333,6 +383,7 @@ public class SmdXLController extends BaseController{
StoragePos posToPut = getOrCreateNewPos(hostPos, barcode.getId()); StoragePos posToPut = getOrCreateNewPos(hostPos, barcode.getId());
posToPut.setUsed(true); posToPut.setUsed(true);
posToPut.setBarcode(barcode); posToPut.setBarcode(barcode);
posToPut.setPartition(partition);
storagePosManager.save(posToPut); storagePosManager.save(posToPut);
finishTask(posToPut, opType, currentTask, barcode, opQty); finishTask(posToPut, opType, currentTask, barcode, opQty);
...@@ -377,6 +428,7 @@ public class SmdXLController extends BaseController{ ...@@ -377,6 +428,7 @@ public class SmdXLController extends BaseController{
StoragePos posToPut = getOrCreateNewPos(hostPos, barcode.getId()); StoragePos posToPut = getOrCreateNewPos(hostPos, barcode.getId());
posToPut.setUsed(true); posToPut.setUsed(true);
posToPut.setBarcode(barcode); posToPut.setBarcode(barcode);
posToPut.setPartition(partition);
storagePosManager.save(posToPut); storagePosManager.save(posToPut);
finishTask(posToPut,opQty, currentTask, barcode, barcode.getAmount()); finishTask(posToPut,opQty, currentTask, barcode, barcode.getAmount());
log.info("条码"+ barcode.getBarcode()+"["+barcode.getPartNumber() + "]入库到库位["+posToPut.getPosName()+"]数量:" + barcode.getAmount()); log.info("条码"+ barcode.getBarcode()+"["+barcode.getPartNumber() + "]入库到库位["+posToPut.getPosName()+"]数量:" + barcode.getAmount());
...@@ -443,6 +495,7 @@ public class SmdXLController extends BaseController{ ...@@ -443,6 +495,7 @@ public class SmdXLController extends BaseController{
} }
StoragePos hostPos = storagePosManager.get(currentTask.getPosId()); StoragePos hostPos = storagePosManager.get(currentTask.getPosId());
operateBean.setPartitionAmount(hostPos.getPartitionAmount());
List<StoragePos> extendPosList = storagePosManager.getExtendPosList(hostPos.getId()); List<StoragePos> extendPosList = storagePosManager.getExtendPosList(hostPos.getId());
for (StoragePos storagePos : extendPosList) { for (StoragePos storagePos : extendPosList) {
if(outTaskIdList.contains(storagePos.getId())){ if(outTaskIdList.contains(storagePos.getId())){
...@@ -458,6 +511,21 @@ public class SmdXLController extends BaseController{ ...@@ -458,6 +511,21 @@ public class SmdXLController extends BaseController{
/** /**
* 修改库位中
* @param request
* @return
*/
@RequestMapping(value = "/service/store/xl/updatePosPartitionAmount")
@ResponseBody
public String updatePosPartitionAmount(HttpServletRequest request) {
String posName = request.getParameter("posName");
String partitionAmount = request.getParameter("partitionAmount");
storagePosManager.updatePosPartitionAmount(posName,partitionAmount);
return "";
}
/**
* 完成出入库任务 * 完成出入库任务
* @param operatePos 库位 * @param operatePos 库位
* @param currentTask 当前任务 * @param currentTask 当前任务
......
...@@ -70,8 +70,13 @@ public class SmdXlBoxHandler { ...@@ -70,8 +70,13 @@ public class SmdXlBoxHandler {
//判断是否存在 //判断是否存在
String newKey = cid; String newKey = cid;
if (operateTaskMap.get(cid) != null) { if (operateTaskMap.get(cid) != null) {
DataLog dataLog = operateTaskMap.get(cid);
if (dataLog.getId().equals(task.getId())) {
} else {
newKey = cid + task.getId(); newKey = cid + task.getId();
} }
}
operateTaskMap.put(newKey, task); operateTaskMap.put(newKey, task);
} }
} }
...@@ -94,7 +99,9 @@ public class SmdXlBoxHandler { ...@@ -94,7 +99,9 @@ public class SmdXlBoxHandler {
for (DataLog queueTask : queueTasks) { for (DataLog queueTask : queueTasks) {
if(queueTask.isExecuting() && queueTask.getPosName().equals(posName)){ if(queueTask.isExecuting() && queueTask.getPosName().equals(posName)){
currentTask = queueTask; currentTask = queueTask;
String doorInfo = statusBean.getFromData("door"); //String doorInfo = statusBean.getFromData("door");
String doorInfo = boxStatus.getData().get("door");
log.info(currentTask.getPosName()+"---door:"+doorInfo);
if(doorInfo == null){ if(doorInfo == null){
doorInfo = "1"; doorInfo = "1";
} }
...@@ -104,10 +111,16 @@ public class SmdXlBoxHandler { ...@@ -104,10 +111,16 @@ public class SmdXlBoxHandler {
} }
} }
DataLog cacheTask = operateTaskMap.get(cid); DataLog cacheTask = operateTaskMap.get(cid);
if(currentTask != null){ if (currentTask != null) {
if(cacheTask == null || !cacheTask.getId().equals(currentTask.getId())){ /* if (cacheTask != null) {
updateCurrentTask(currentTask.getCid(),currentTask); if (cacheTask.getId().equals(currentTask.getId())) {
updateCurrentTask(currentTask.getCid(), currentTask);
}
} }
if (cacheTask == null || !cacheTask.getId().equals(currentTask.getId())) {
updateCurrentTask(currentTask.getCid(), currentTask);
}*/
updateCurrentTask(currentTask.getCid(), currentTask);
} }
} }
} }
...@@ -154,4 +167,27 @@ public class SmdXlBoxHandler { ...@@ -154,4 +167,27 @@ public class SmdXlBoxHandler {
} }
public DataLog getCurrentTask(String cid, String posName) {
DataLog task = null;
if (operateTaskMap.get(cid) == null) {
for (Map.Entry<String, DataLog> taskEntry : operateTaskMap.entrySet()) {
if (taskEntry.getKey().contains(cid)) {
if (posName.equals(taskEntry.getValue().getPosName())) {
task = taskEntry.getValue();
break;
}
}
}
if (task != null) {
operateTaskMap.remove(cid + task.getId());
operateTaskMap.put(cid, task);
}
}
if (operateTaskMap.get(cid) != null) {
if (posName.equals(operateTaskMap.get(cid).getPosName())) {
task = operateTaskMap.get(cid);
}
}
return task;
}
} }
...@@ -3,6 +3,21 @@ ...@@ -3,6 +3,21 @@
<%@ page language="java" pageEncoding="UTF-8" %> <%@ page language="java" pageEncoding="UTF-8" %>
<style type="text/css"> <style type="text/css">
.material{
width: 10%;
}
.selectItem{
display: flex;
align-items: center;
}
.inputItem{
display: flex;
align-items: center;
}
.headerTitle{
display: flex;
justify-content: space-between;
}
.box{ .box{
margin-top: 10px; margin-top: 10px;
} }
...@@ -60,6 +75,7 @@ ...@@ -60,6 +75,7 @@
} }
.theItems{ .theItems{
min-width: 200px; min-width: 200px;
margin-top: -9px;
} }
.btn-box{ .btn-box{
...@@ -181,8 +197,6 @@ ...@@ -181,8 +197,6 @@
border-color: #c8c8c8 !important; border-color: #c8c8c8 !important;
text-decoration:line-through; text-decoration:line-through;
} }
</style> </style>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/> <link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
...@@ -261,10 +275,12 @@ ...@@ -261,10 +275,12 @@
<table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info" id="list"> <table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info" id="list">
<thead> <thead>
<tr role="row"> <tr role="row">
<th><fmt:message key="checkOut.pos"/></th> <th style="width:9%"><fmt:message key="checkOut.pos" /></th>
<%--<th><fmt:message key="尺寸"/></th>--%> <%--<th><fmt:message key="尺寸"/></th>--%>
<th><fmt:message key="物料"/></th> <th style="width:9%"><fmt:message key="隔口数量"/></th>
<th><fmt:message key="物料" /></th>
<%--<th><fmt:message key="操作"/></th>--%> <%--<th><fmt:message key="操作"/></th>--%>
</tr> </tr>
</thead> </thead>
<tbody class="dataTables"> <tbody class="dataTables">
...@@ -272,8 +288,14 @@ ...@@ -272,8 +288,14 @@
<tr> <tr>
<td>${pos.posName}</td> <td>${pos.posName}</td>
<%--<td>${pos.sizeStr}</td>--%> <%--<td>${pos.sizeStr}</td>--%>
<td id="${pos.id}">
<div class="${pos.used==true?'bg-blue-madison partnumber-box':''}"
onclick="checkout(${pos.id})">${pos.partitionAmount}
</div>
</td>
<td> <td>
<div class="row theItems" id="${pos.id}"> <div class="row theItems" id="box${pos.id}">
</div> </div>
</td> </td>
...@@ -307,7 +329,7 @@ ...@@ -307,7 +329,7 @@
<span class="help-block red" id="boxMsg"></span> <span class="help-block red" id="boxMsg"></span>
</div> </div>
<div class="col-md-12" > <div class="col-md-12" >
<input type="hidden" id="doorInfo"/> <input type="text" id="doorInfo"/>
<input type="text" class="form-control" id="boxCode" placeholder="料箱条码"/> <input type="text" class="form-control" id="boxCode" placeholder="料箱条码"/>
<span class="help-block red"></span> <span class="help-block red"></span>
</div> </div>
...@@ -325,7 +347,18 @@ ...@@ -325,7 +347,18 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header bg-green" id="operateHead"> <div class="modal-header bg-green" id="operateHead">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" style="font-weight: 500;"><span id="operateTitle"><fmt:message key="库位"/></span>: <span id="currentOperatePos">123</span></h4> <h4 class="modal-title headerTitle" style="font-weight: 500;">
<div>
<span id="operateTitle"><fmt:message key="库位"/></span>:
<span id="currentOperatePos">123</span>
</div>
<div style="display: flex;align-items: center">
<span>隔口数量:</span>
<span id="partitionAmount"></span>
<input type="button" onclick="showPartitionWindow()" value="设置" style="background-color: #44B6AE"/>
</div>
</h4>
<input value="" id="blur" type="hidden">
</div> </div>
<div class="modal-body" style="height: 290px;"> <div class="modal-body" style="height: 290px;">
<div class="row"> <div class="row">
...@@ -333,8 +366,12 @@ ...@@ -333,8 +366,12 @@
<span class="help-block red" id="msg"></span> <span class="help-block red" id="msg"></span>
</div> </div>
<div class="col-md-12"> <div class="col-md-12 selectItem">
<input type="text" class="form-control" id="scan-code" placeholder="扫码或填写要放入的物料信息"/> <tr>
<td>隔口:<select id="partition" <%--onclick="getBlur()"--%>></select></td>
<td><input type="text" class="form-control" id="scan-code" placeholder="扫码或填写要放入的物料信息" style="width:84%"/></td>
</tr>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
...@@ -342,7 +379,7 @@ ...@@ -342,7 +379,7 @@
<table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info" id="list"> <table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info" id="list">
<thead> <thead>
<tr role="row"> <tr role="row">
<th></th> <th><fmt:message key="隔口"/></th>
<th><fmt:message key="barcode.barcode"/></th> <th><fmt:message key="barcode.barcode"/></th>
<th><fmt:message key="barcode.partNumber"/></th> <th><fmt:message key="barcode.partNumber"/></th>
<th><fmt:message key="数量"/></th> <th><fmt:message key="数量"/></th>
...@@ -370,6 +407,27 @@ ...@@ -370,6 +407,27 @@
</div> </div>
</div> </div>
<div id="partitionWindow" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="margin-top: 10%;width:60%;margin-left:20%;">
<div class="modal-content">
<div class="modal-header bg-green">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" style="font-weight: 500;"><span><fmt:message key="设置"/></span></h4>
</div>
<div class="inputItem">
<span class="help-block red" id="boxPosName"></span>
<span>隔口数量为:</span>
<input type="text" id="partitionWindowAmount"/>
</div>
<div class="modal-footer">
<button type="button" onclick="updatePosPartitionAmount()"><fmt:message key="确定"/></button>
</div>
</div>
</div>
</div>
<fmt:message key="storage.status" var="currentStatus"/> <fmt:message key="storage.status" var="currentStatus"/>
<fmt:message key="storage.status.1" var="status_1"/> <fmt:message key="storage.status.1" var="status_1"/>
<fmt:message key="storage.status.2" var="status_2"/> <fmt:message key="storage.status.2" var="status_2"/>
...@@ -444,7 +502,33 @@ ...@@ -444,7 +502,33 @@
$.post("${ctx}/service/store/xl/storagePosList", {cid: '${show}'}, function (data) { $.post("${ctx}/service/store/xl/storagePosList", {cid: '${show}'}, function (data) {
$(".theItems").html(""); $(".theItems").html("");
for(var item in data){ for(var item in data){
var barcodeObj = data[item].barcode; //库位信息
var posName = data[item].posName;
//库位id
var posId = data[item].posId;
//开始整合隔口信息
var partitionHtml = '<table class="table">'
var partitionList = data[item].partitionList;
for (var partition in partitionList) {
partitionHtml = partitionHtml + '<tr>';
//隔口信息
var partitionStr = partitionList[partition].partition;
partitionHtml = partitionHtml + '<td style="text-align: center;line-height: 100px" class="material">' + partitionStr + '</td>';
//物料信息
var storagePosList = partitionList[partition].storagePosList;
for (var storagePos in storagePosList) {
var barcode = storagePosList[storagePos].barcode;
var partNumber = barcode.partNumber;
var amount = barcode.amount;
partitionHtml = partitionHtml + '<td class="material"><div class="bg-blue-madison partnumber-box" onclick="checkout(\''+storagePosList[storagePos].id+'\')">'+partNumber+'<br>'+amount+'</div></td>'
//partitionHtml = partitionHtml + '<td class="bg-blue-madison partnumber-box" onclick="checkout(\''+storagePosList[storagePos].id+'\')">'+partNumber+'<br>'+amount+'</td>'
}
partitionHtml = partitionHtml + '</tr>';
}
partitionHtml = partitionHtml + '</table>'
$("#box"+data[item].posId).append(partitionHtml);
/*var barcodeObj = data[item].barcode;
if(barcodeObj){ if(barcodeObj){
partNumber = barcodeObj.partNumber; partNumber = barcodeObj.partNumber;
amount = barcodeObj.amount; amount = barcodeObj.amount;
...@@ -459,9 +543,9 @@ ...@@ -459,9 +543,9 @@
alarmClass = "bg-red"; alarmClass = "bg-red";
} }
var itemHtml = '<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" onclick="checkout(\''+data[item].id+'\');">' + var itemHtml = '<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" onclick="checkout(\''+data[item].id+'\');">' +
'<div class="bg-blue-madison partnumber-box '+alarmClass+'">'+partNumber+'<br>'+amount+'</div>' + '<div class="bg-blue-madison partnumber-box '+alarmClass+'">'+partNumber+'<br>'+amount+'<br>'+data[item].partition+'</div>' +
'</div>'; '</div>';
$("#"+data[item].hostPosId).append(itemHtml); $("#"+data[item].hostPosId).append(itemHtml);*/
} }
}); });
} }
...@@ -661,6 +745,7 @@ ...@@ -661,6 +745,7 @@
} }
var extendPosList = data.extendPosList; var extendPosList = data.extendPosList;
$("#currentOperatePos").text(task.posName); $("#currentOperatePos").text(task.posName);
$("#partitionAmount").text(data.partitionAmount);
showOperateWindow(task, extendPosList); showOperateWindow(task, extendPosList);
}else{ }else{
$("#operateWindow").modal("hide"); $("#operateWindow").modal("hide");
...@@ -670,7 +755,8 @@ ...@@ -670,7 +755,8 @@
exePutIn = function(){ exePutIn = function(){
var doorInfo = $("#doorInfo").val(); var doorInfo = $("#doorInfo").val();
$.post("${ctx}/service/store/xl/exePutIn", {cid: '${show}',door:doorInfo}, function (data) { var posName = $("#currentOperatePos").text();
$.post("${ctx}/service/store/xl/exePutIn", {cid: '${show}',door:doorInfo,posName:posName}, function (data) {
//$("#operateWindow").modal("hide"); //$("#operateWindow").modal("hide");
}); });
}; };
...@@ -712,12 +798,13 @@ ...@@ -712,12 +798,13 @@
//入库任务 //入库任务
$("#operateHead").attr("class","modal-header bg-green-haze"); $("#operateHead").attr("class","modal-header bg-green-haze");
$("#operateTitle").text(task.subSourceId+"号门入库"); $("#operateTitle").text(task.subSourceId+"号门入库");
}else{ }else{
$("#operateHead").attr("class","modal-header bg-yellow"); $("#operateHead").attr("class","modal-header bg-yellow");
$("#operateTitle").text(task.subSourceId+"出库"); $("#operateTitle").text(task.subSourceId+"出库");
$("#doorInfo").val(task.subSourceId); $("#doorInfo").val(task.subSourceId);
//console.log('出库页面'+$("#doorInfo").val())
} }
$("#putInExtendPosList").html(""); $("#putInExtendPosList").html("");
for(i in extendPosList){ for(i in extendPosList){
var barcodeObj = extendPosList[i].barcode; var barcodeObj = extendPosList[i].barcode;
...@@ -730,12 +817,13 @@ ...@@ -730,12 +817,13 @@
var amount = barcodeObj.amount; var amount = barcodeObj.amount;
var hasOutTaskClass = ""; var hasOutTaskClass = "";
var hasOutTask = !extendPosList[i].used; var hasOutTask = !extendPosList[i].used;
var partition = extendPosList[i].partition;
if(hasOutTask){ if(hasOutTask){
hasOutTaskClass = "bg-green"; hasOutTaskClass = "bg-green";
} }
var tdStr = var tdStr =
"<td>"+index+"</td>" + "<td>"+partition+"</td>" +
"<td>"+barcode+"</td>"+ "<td>"+barcode+"</td>"+
"<td>"+partNumber+"</td>" + "<td>"+partNumber+"</td>" +
"<td>"+amount+"</td>"; "<td>"+amount+"</td>";
...@@ -743,7 +831,17 @@ ...@@ -743,7 +831,17 @@
$("#putInExtendPosList").append(trStr); $("#putInExtendPosList").append(trStr);
} }
$("#operateWindow").modal("show"); $("#operateWindow").modal("show");
$("#scan-code").focus();
var posName = task.posName;
var blur = document.getElementById("blur").value;
//console.log(posName);
//console.log(blur,'++');
//console.log(posName != blur);
if (posName != blur) {
this.getBlur();
$("#blur").val(posName);
}
//$("#scan-code").focus();
} }
function showOpResult(id, msg){ function showOpResult(id, msg){
...@@ -773,8 +871,9 @@ ...@@ -773,8 +871,9 @@
$("#scan-code").change(function () { $("#scan-code").change(function () {
var codeValue = $(this).val(); var codeValue = $(this).val();
var currentOperatePos = $("#currentOperatePos").text(); var currentOperatePos = $("#currentOperatePos").text();
var partition = document.getElementById("partition").value;
if(codeValue != ""){ if(codeValue != ""){
$.post("${ctx}/service/store/xl/operatePos", {cid: '${show}', code: codeValue, pos:currentOperatePos}, function (data) { $.post("${ctx}/service/store/xl/operatePos", {cid: '${show}', code: codeValue, pos:currentOperatePos ,partition :partition}, function (data) {
showOpResult("msg",data); showOpResult("msg",data);
$("#scan-code").val(""); $("#scan-code").val("");
}); });
...@@ -782,8 +881,27 @@ ...@@ -782,8 +881,27 @@
//showOperateWindow(); //showOperateWindow();
}); });
function showPartitionWindow() {
var currentOperatePos = document.getElementById("currentOperatePos").textContent;
document.getElementById("boxPosName").innerText = currentOperatePos;
$("#partitionWindow").modal("show");
}
function updatePosPartitionAmount() {
var posName = document.getElementById("boxPosName").innerText;
var partitionWindowAmount = document.getElementById("partitionWindowAmount").value;
$.post("${ctx}/service/store/xl/updatePosPartitionAmount", {posName:posName, partitionAmount:partitionWindowAmount}, function (data) {
if(data){
//$("#boxMsg").text(data);
}else{
$("#partitionWindow").modal("hide");
$("#blur").val("");
$("#partitionWindowAmount").val("");
}
});
}
updateTasks(); updateTasks();
listNotEmpty(); listNotEmpty();
//showOperateWindow(); //showOperateWindow();
...@@ -808,5 +926,19 @@ ...@@ -808,5 +926,19 @@
}, 1500); }, 1500);
} }
function getBlur() {
document.getElementById('partition').options.length = 0;
var partitions = document.getElementById("partitionAmount").textContent;
var partition = document.getElementById("partition");
for (let i = 1; i <= partitions; i++) {
var option = document.createElement("option");
option.text = i;
option.value = i;
partition.add(option);
}
}
</script> </script>
</c:set> </c:set>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!