Commit 5b78e07e hc

Merge remote-tracking branch 'origin/SO1434' into SO1434

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