Commit 689cbc20 zshaohui

上传库位时 增加库别信息

1 个父辈 925fbf53
......@@ -6,10 +6,7 @@ import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.csv.CsvReader;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.PointUtil;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.*;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.enums.DeviceType;
......@@ -445,6 +442,7 @@ public class StorageController {
titles.add(("h"));
titles.add("w");
titles.add("pn");
titles.add("whcode");
for(int i=1;i<=10;i++) {
Map<String, Object> map = new LinkedHashMap<>();
......@@ -453,7 +451,8 @@ public class StorageController {
map.put("pri", i);
map.put("h", 8);
map.put("w", 7);
map.put("pn","虚拟仓填写料号");
map.put("pn","");
map.put("whcode","W10B");
maps.add(map);
}
......@@ -485,6 +484,7 @@ public class StorageController {
int priIndex = csvRead.getCsvIndex("优先级","pri");
int hIndex = csvRead.getCsvIndex("高度","h");
int wIndex = csvRead.getCsvIndex("宽度","w");
int whcodeIndex = csvRead.getCsvIndex("库别","whcode");
int row = 1;
int newRowCount = 0;
......@@ -499,6 +499,7 @@ public class StorageController {
Integer priority =0;
Integer height =0;
Integer width =0;
String whcode = lineValues[whcodeIndex];
try {
priority =Integer.parseInt(lineValues[priIndex]) ;
height = Integer.parseInt(lineValues[hIndex]);
......@@ -512,14 +513,21 @@ public class StorageController {
log.warn("第"+row+"行中有空白内容,此行忽略");
continue;
}
if (StringUtils.isEmpty(whcode)){
log.warn("第"+row+"行中有空白内容,此行忽略");
continue;
}
// StoragePos posInfo = storagePosManager.getByPosName(posName);
StoragePos posInfo =findFormList(storagePosList,posName);
if(posInfo == null){
posInfo=new StoragePos(storageId,posName,height,width,priority);
posInfo.setWareHouseCode(whcode);
newRowCount++;
newList.add(posInfo);
}else{
boolean needUpdate=posInfo.updatePosInfo(storageId,posName,height,width,priority);
boolean needUpdate=posInfo.updatePosInfo(storageId,posName,height,width,priority,whcode);
if(needUpdate){
updateRowCount++;
storagePosManager.save(posInfo);
......
......@@ -3,6 +3,7 @@ package com.neotel.smfcore.core.storage.service.po;
import com.google.common.base.Strings;
import com.neotel.smfcore.common.base.BasePo;
import com.neotel.smfcore.common.utils.PointUtil;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import lombok.Data;
import org.springframework.data.geo.Point;
......@@ -31,7 +32,7 @@ public class StoragePos extends BasePo implements Serializable {
setCoordinate(new double[]{point.getX(),point.getY()});
}
public boolean updatePosInfo(String storageId,String posName,int h,int w,int priority){
public boolean updatePosInfo(String storageId,String posName,int h,int w,int priority,String whCode){
boolean needUpdate=false;
if(!getPosName().equals(posName)){
needUpdate=true;
......@@ -53,6 +54,12 @@ public class StoragePos extends BasePo implements Serializable {
needUpdate=true;
setPriority(priority);
}
if (StringUtils.isNotEmpty(whCode)) {
setWareHouseCode(whCode);
needUpdate = true;
}
Point point= PointUtil.getPosPoint(getPosName());
if(getCoordinate()==null||getCoordinate().length!=2||
(getCoordinate()[0]!=point.getX()) ||(getCoordinate()[1]!=point.getY())){
......@@ -142,6 +149,9 @@ public class StoragePos extends BasePo implements Serializable {
*/
private String source;
private String wareHouseCode;
public String getLabelStr(){
String posNameLabel = posName;
int index = posNameLabel.lastIndexOf(":");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!