Commit 5fc99eba zshaohui

1.增加禁用料功能

1 个父辈 364c5e00
package com.neotel.smfcore.core.storage.rest; package com.neotel.smfcore.core.storage.rest;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.neotel.smfcore.common.base.IExcelDownLoad; import com.neotel.smfcore.common.base.IExcelDownLoad;
...@@ -36,6 +37,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage; ...@@ -36,6 +37,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos; import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.LizhenApi;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.custom.siemens.SiemensApi; import com.neotel.smfcore.custom.siemens.SiemensApi;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
...@@ -59,6 +61,7 @@ import java.io.IOException; ...@@ -59,6 +61,7 @@ import java.io.IOException;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RestController @RestController
...@@ -90,6 +93,9 @@ public class StoragePosController { ...@@ -90,6 +93,9 @@ public class StoragePosController {
@Autowired @Autowired
private LiteOrderCache liteOrderCache; private LiteOrderCache liteOrderCache;
@Autowired
private LizhenApi lizhenApi;
@ApiOperation("查询库位") @ApiOperation("查询库位")
@GetMapping @GetMapping
...@@ -672,45 +678,126 @@ public class StoragePosController { ...@@ -672,45 +678,126 @@ public class StoragePosController {
@ApiOperation("出库操作") @ApiOperation("出库操作")
@PutMapping("/checkout") @PutMapping("/checkout")
public ResultBean checkout(@Validated @RequestBody CheckOutDto checkOutDto) { public ResultBean checkout(@Validated @RequestBody CheckOutDto checkOutDto) {
if (checkOutDto.getPids() == null) { if (checkOutDto.getPids() == null) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"ID"}); throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"ID"});
} }
if (checkOutDto.getSingleOut() == null) { if (checkOutDto.getSingleOut() == null) {
checkOutDto.setSingleOut(true + ""); checkOutDto.setSingleOut(true + "");
} }
String line = checkOutDto.getLine(); String line = checkOutDto.getLine();
if (StringUtils.isEmpty(line)){ if (StringUtils.isEmpty(line)){
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"线体"}); throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"线体"});
} }
String model = "ALL";
if (StringUtils.isNotEmpty(line)) {
if (line.startsWith("C02-1FSMT-98")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-03")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-04")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-05")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-06")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-07")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-13")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-14")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-15")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-16")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-17")) {
model = "RAINIER";
} else if (line.startsWith("C03-1FSMT-02")) {
model = "RAINIER";
} else if (line.startsWith("C03-1FSMT-12")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-08")) {
model = "X11";
} else if (line.startsWith("C02-3FSMT-18")) {
model = "X11";
} else if (line.startsWith("C03-1FSMT-01")) {
model = "X11";
} else if (line.startsWith("C03-1FSMT-11")) {
model = "X11";
} else if (line.startsWith("C02-3FSMT-09")) {
model = "X8";
} else if (line.startsWith("C02-3FSMT-19")) {
model = "X8";
} else {
model = "ALL";
}
} else {
model = "ALL";
}
String isSingleOutStr = checkOutDto.getSingleOut(); String isSingleOutStr = checkOutDto.getSingleOut();
boolean isSingleOut = Boolean.valueOf(isSingleOutStr); boolean isSingleOut = Boolean.valueOf(isSingleOutStr);
List<StoragePos> needOutPosList = new ArrayList<>();
Collection<String> excludePosIds = taskService.excludePosIds();
for (String pid : checkOutDto.getPids()) { for (String pid : checkOutDto.getPids()) {
StoragePos pos = storagePosManager.get(pid); StoragePos pos = storagePosManager.get(pid);
if (pos == null) { if (pos == null){
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"pid", pid}); throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"pid", pid});
// throw new ValidateException("位置[" + pid + "]不存在");
} }
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage == null) { if (storage == null){
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"storageId", pos.getStorageId()}); throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"storageId", pos.getStorageId()});
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在");
} }
if (excludePosIds.contains(pos.getId())){
// //西门子接口验证 throw new ValidateException("smfcore.error.pos.inQueue", "位置:[{0}}]已在操作队列中,操作失败", new String[]{pos.getPosName()});
// boolean result=SiemensApi.getMaterialLot(2, storage.getId(),storage.getName(),pos.getBarcode().getBarcode());
// if(!result) {
// throw new ValidateException("smfcore.error.getMaterialLot.out", "条码[{0}]验证失败,无法出库", new String[]{pos.getBarcode().getBarcode()});
// }
log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】");
String outResult = taskService.checkout(storage, pos, isSingleOut,SecurityUtils.getCurrentUsername(),null,line);
if (!Strings.isNullOrEmpty(outResult)) {
throw new ValidateException("smfcore.error", outResult);
} }
if (!pos.isEnabled()) {
throw new ValidateException("", pos.getPosName() + "库位被禁用,无法出库");
}
needOutPosList.add(pos);
}
//判断是否有可用出库的任务
if (needOutPosList == null || needOutPosList.isEmpty()){
throw new ValidateException("","未找到可以出库的任务");
}
//获取禁用料
List<Barcode> barcodeList = needOutPosList.stream().map(StoragePos::getBarcode).collect(Collectors.toList());
List<String> checkReelList = lizhenApi.batchCheckReel(barcodeList, "", model);
List<String> errorBarcodeList = new ArrayList<>();
for (StoragePos pos : needOutPosList) {
Barcode barcode = pos.getBarcode();
String barcodeStr = barcode.getBarcode();
if (checkReelList != null && !checkReelList.isEmpty()){
if (checkReelList.contains(barcodeStr)){
errorBarcodeList.add(barcodeStr);
log.info(barcodeStr+"已经被禁用,库位为:"+pos.getPosName());
}
}
}
if (errorBarcodeList != null && !errorBarcodeList.isEmpty()){
throw new ValidateException("", JSON.toJSONString(errorBarcodeList)+"已经被禁用");
}
for (StoragePos pos : needOutPosList){
Barcode barcode = pos.getBarcode();
//生成出库任务
Storage storage = dataCache.getStorageById(pos.getStorageId());
DataLog task = new DataLog(storage, pos.getBarcode(), pos);
task.setType(OP.CHECKOUT);
task.setStorageId(storage.getId());
task.setPutInDate(barcode.getPutInDate());
task.setSingleOut(isSingleOut);
task.setWarehouseCode(barcode.getWarehouseCode());
task.setDescribe(barcode.getDescribe());
task.setBatchInfo(barcode.getBatch());
task.setDateCode(barcode.getDateCode());
task.setProvider(barcode.getProvider());
task.setProviderNumber(barcode.getProviderNumber());
task.setKeeperCode(barcode.getKeeperCode());
task.setOperator(SecurityUtils.getLoginUsername());
task.setLine(line);
taskService.updateQueueTask(task);
} }
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
......
...@@ -22,7 +22,9 @@ import com.neotel.smfcore.core.device.util.DataCache; ...@@ -22,7 +22,9 @@ import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.order.LiteOrderCache; import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.order.service.po.LiteOrder; import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.storage.enums.DeviceType; import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.Storage; import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.manager.IDataLogManager; import com.neotel.smfcore.core.system.service.manager.IDataLogManager;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.custom.lizhen.agvBox.bean.GrLabel; import com.neotel.smfcore.custom.lizhen.agvBox.bean.GrLabel;
...@@ -55,6 +57,9 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -55,6 +57,9 @@ public class LizhenApi extends DefaultSmfApiListener {
@Autowired @Autowired
private IDataLogManager dataLogManager; private IDataLogManager dataLogManager;
@Autowired
private IStoragePosManager storagePosManager;
@Value("${api.fetchGRUrl}") @Value("${api.fetchGRUrl}")
private String fetchGRUrl; private String fetchGRUrl;
...@@ -91,6 +96,9 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -91,6 +96,9 @@ public class LizhenApi extends DefaultSmfApiListener {
@Value("${api.commonRMRecordUrl}") @Value("${api.commonRMRecordUrl}")
private String commonRMRecordUrl = ""; private String commonRMRecordUrl = "";
@Value("${api.batchCheckReel}")
private String batchCheckReel = "";
@PostConstruct @PostConstruct
public void init(){ public void init(){
fetchGRUrl = dataCache.getConfigCache("fetchGRUrl",fetchGRUrl); fetchGRUrl = dataCache.getConfigCache("fetchGRUrl",fetchGRUrl);
...@@ -100,7 +108,7 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -100,7 +108,7 @@ public class LizhenApi extends DefaultSmfApiListener {
werks = dataCache.getConfigCache("werks",werks); werks = dataCache.getConfigCache("werks",werks);
outNotifyUrlPK = dataCache.getConfigCache("api.outNotifyUrlPK",outNotifyUrlPK); outNotifyUrlPK = dataCache.getConfigCache("api.outNotifyUrlPK",outNotifyUrlPK);
batchCheckUrl = dataCache.getConfigCache("api.batchCheckUrl",batchCheckUrl); batchCheckUrl = dataCache.getConfigCache("api.batchCheckUrl",batchCheckUrl);
checkReelMeasureUrl = dataCache.getConfigCache("api.checkReelMeasure",checkReelMeasureUrl); //checkReelMeasureUrl = dataCache.getConfigCache("api.checkReelMeasure",checkReelMeasureUrl);
getInDateUrl = dataCache.getConfigCache("api.getInDate",getInDateUrl); getInDateUrl = dataCache.getConfigCache("api.getInDate",getInDateUrl);
} }
...@@ -276,6 +284,8 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -276,6 +284,8 @@ public class LizhenApi extends DefaultSmfApiListener {
paramMap.put("datecode", barcode.getDateCode()); paramMap.put("datecode", barcode.getDateCode());
paramMap.put("lot", barcode.getBatch()); paramMap.put("lot", barcode.getBatch());
paramMap.put("vendor", barcode.getProvider()); paramMap.put("vendor", barcode.getProvider());
paramMap.put("werks","W339");
paramMap.put("model","ALL");
String param = JsonUtil.toJsonStr(paramMap); String param = JsonUtil.toJsonStr(paramMap);
log.info("禁用料接口wmsCheckReelfob入参为:" + param); log.info("禁用料接口wmsCheckReelfob入参为:" + param);
try { try {
...@@ -302,13 +312,20 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -302,13 +312,20 @@ public class LizhenApi extends DefaultSmfApiListener {
//保存禁用料记录 //保存禁用料记录
Barcode barcodeOri = barcodeManager.findByBarcode(barcode.getBarcode()); Barcode barcodeOri = barcodeManager.findByBarcode(barcode.getBarcode());
if (barcodeOri != null){ if (barcodeOri != null){
barcodeOri.setExpireDate(barcode.getExpireDate());
barcodeOri.setDisableMsg(resultStr); barcodeOri.setDisableMsg(resultStr);
barcodeManager.save(barcodeOri); barcode = barcodeManager.save(barcodeOri);
StoragePos storagePos = storagePosManager.getByBarcode(barcode.getBarcode());
if (storagePos != null){
storagePos.setBarcode(barcode);
storagePosManager.save(storagePos);
}
} }
if (StringUtils.isNotBlank(resultStr)) { if (StringUtils.isNotBlank(resultStr)) {
throw new ValidateException("smfcore.mesApi.inCheck.ng", /*"MES验证失败:" + */barcode.getBarcode() + "验证失败:" + resultStr); throw new ValidateException("smfcore.mesApi.inCheck.ng", /*"MES验证失败:" + */barcode.getBarcode() + "验证失败:" + resultStr);
} }
return barcode; return barcode;
} }
...@@ -604,18 +621,21 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -604,18 +621,21 @@ public class LizhenApi extends DefaultSmfApiListener {
* @return * @return
*/ */
public boolean checkReelMeasure(Barcode barcode) { public boolean checkReelMeasure(Barcode barcode) {
if (StringUtils.isBlank(checkReelMeasureUrl)){ if (StringUtils.isBlank(checkReelMeasureUrl)) {
return true; return true;
} }
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("reelID", barcode.getBarcode()); paramMap.put("model", "EVEREST");
paramMap.put("ipn", barcode.getPartNumber()); paramMap.put("reelid", barcode.getBarcode());
paramMap.put("data", "");
paramMap.put("emp", "smf");
paramMap.put("cmd", "AUTOWH");
try { try {
log.info(barcode.getBarcode() + "散料量测接口入参为-----" + JSON.toJSONString(paramMap)); log.info(barcode.getBarcode() + "散料量测接口入参为-----" + JSON.toJSONString(paramMap) + ",接口地址为:" + checkReelMeasureUrl);
String result = HttpHelper.postJson(checkReelMeasureUrl, paramMap); String result = HttpHelper.postJson(checkReelMeasureUrl, paramMap);
log.info(barcode.getBarcode() + "散料量测接口出参为-----" + result); log.info(barcode.getBarcode() + "散料量测接口出参为-----" + result);
JSONObject jsonObject = JSON.parseObject(result); JSONObject jsonObject = JSON.parseObject(result);
if (jsonObject.getInteger("status") == 200) { if (jsonObject.getInteger("code") == 1) {
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");
if (data.getBoolean("result")) { if (data.getBoolean("result")) {
return true; return true;
...@@ -773,6 +793,80 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -773,6 +793,80 @@ public class LizhenApi extends DefaultSmfApiListener {
} }
} }
public List<String> batchCheckReel(List<Barcode> barcodeList,String pickingId,String model) {
List<Map<String,Object>> paramList = new ArrayList<>();
for (Barcode barcode : barcodeList) {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("ipn",barcode.getPartNumber());
paramMap.put("reelId",barcode.getBarcode());
paramMap.put("wo","");
paramMap.put("datecode",barcode.getDateCode());
paramMap.put("lot",barcode.getBatch());
paramMap.put("vendor",barcode.getProvider());
paramMap.put("remark","ALL");
paramMap.put("werks","ALL");
paramMap.put("model","ALL");
if (StringUtils.isNotEmpty(model)){
paramMap.put("model",model);
}
paramMap.put("picking","ALL");
if (StringUtils.isNotEmpty(pickingId)){
paramMap.put("picking",pickingId);
}
paramList.add(paramMap);
}
log.info("批量禁用入参为:"+JSON.toJSONString(paramList));
List<String> reelList = new ArrayList<>();
try {
String resultStr = HttpHelper.postJson(batchCheckReel, paramList);
log.info("批量禁用接口返回结果为:"+resultStr);
JSONObject resultObj = JSONObject.parseObject(resultStr);
String status = resultObj.getString("status");
if ("200".equals(status)){
JSONArray dataArr = resultObj.getJSONArray("data");
if (dataArr != null && !dataArr.isEmpty()){
for (int i = 0; i < dataArr.size(); i++) {
JSONObject data = dataArr.getJSONObject(i);
JSONArray resultList = data.getJSONArray("resultList");
if (resultList != null && !resultList.isEmpty()){
for (int j = 0; j < resultList.size(); j++) {
JSONObject result = resultList.getJSONObject(j);
String reelId = result.getString("reelId");
if (StringUtils.isNotBlank(reelId)){
reelList.add(reelId);
}
}
}
}
}
}
} catch (Exception e){
log.info("批量禁用接口调用失败:"+e.getMessage());
}
//添加禁用料信息
for (Barcode barcode : barcodeList) {
if (reelList.contains(barcode.getBarcode())){
barcode.setDisableMsg("禁用料");
} else {
barcode.setDisableMsg("");
}
barcode =barcodeManager.save(barcode);
StoragePos storagePos = storagePosManager.getByBarcode(barcode.getBarcode());
if (storagePos != null){
storagePos.setBarcode(barcode);
storagePosManager.save(storagePos);
}
}
return reelList;
}
@Override @Override
public boolean isForThisApi(String apiName) { public boolean isForThisApi(String apiName) {
return apiName != null && apiName.equalsIgnoreCase("Lizhen"); return apiName != null && apiName.equalsIgnoreCase("Lizhen");
......
package com.neotel.smfcore.custom.lizhen.innerBox.rest; package com.neotel.smfcore.custom.lizhen.innerBox.rest;
import com.alibaba.fastjson.JSON;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.JsonUtil; import com.neotel.smfcore.common.utils.JsonUtil;
...@@ -678,6 +679,61 @@ public class InnerBoxRestController { ...@@ -678,6 +679,61 @@ public class InnerBoxRestController {
if (order == null) { if (order == null) {
return ResultBean.newErrorResult(-1, "smfcore.order.out.notFound", "工单未找到"); return ResultBean.newErrorResult(-1, "smfcore.order.out.notFound", "工单未找到");
} }
String model = "ALL";
String line = order.getLine();
if (StringUtils.isNotEmpty(line)) {
if (line.startsWith("C02-1FSMT-98")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-03")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-04")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-05")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-06")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-07")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-13")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-14")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-15")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-16")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-17")) {
model = "RAINIER";
} else if (line.startsWith("C03-1FSMT-02")) {
model = "RAINIER";
} else if (line.startsWith("C03-1FSMT-12")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-08")) {
model = "X11";
} else if (line.startsWith("C02-3FSMT-18")) {
model = "X11";
} else if (line.startsWith("C03-1FSMT-01")) {
model = "X11";
} else if (line.startsWith("C03-1FSMT-11")) {
model = "X11";
} else if (line.startsWith("C02-3FSMT-09")) {
model = "X8";
} else if (line.startsWith("C02-3FSMT-19")) {
model = "X8";
} else {
model = "ALL";
}
} else {
model = "ALL";
}
List<String> checkReelList = lizhenApi.batchCheckReel(Arrays.asList(barcode), "", model);
if (checkReelList != null && !checkReelList.isEmpty()) {
if (checkReelList.contains(barcode.getBarcode())) {
return ResultBean.newErrorResult(-1, "", barcode.getBarcode() + "已经被禁用");
}
}
boolean hasItem = false; boolean hasItem = false;
for (LiteOrderItem orderItem : order.getOrderItems()) { for (LiteOrderItem orderItem : order.getOrderItems()) {
if (orderItem.getPn().contains(barcode.getPartNumber())) { if (orderItem.getPn().contains(barcode.getPartNumber())) {
......
...@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.lizhen.innerBox.rest; ...@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.lizhen.innerBox.rest;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
...@@ -209,7 +210,7 @@ public class VirtualRestController { ...@@ -209,7 +210,7 @@ public class VirtualRestController {
private ResultBean checkout(@RequestBody Map<String,String> paramMap) { private ResultBean checkout(@RequestBody Map<String,String> paramMap) {
String code = paramMap.get("code"); String code = paramMap.get("code");
String line = paramMap.get("line"); String line = paramMap.get("line");
log.info("手动出库,code为:"+code+",线体为:"+line);
if (StringUtils.isEmpty(line)){ if (StringUtils.isEmpty(line)){
return ResultBean.newErrorResult(-1, "", "线体不能为空"); return ResultBean.newErrorResult(-1, "", "线体不能为空");
} }
...@@ -227,6 +228,61 @@ public class VirtualRestController { ...@@ -227,6 +228,61 @@ public class VirtualRestController {
if (pos == null){ if (pos == null){
return ResultBean.newErrorResult(-1, "", barcodeStr+"不在储位中,不允许进行出库"); return ResultBean.newErrorResult(-1, "", barcodeStr+"不在储位中,不允许进行出库");
} }
String model = "ALL";
if (StringUtils.isNotEmpty(line)) {
if (line.startsWith("C02-1FSMT-98")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-03")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-04")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-05")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-06")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-07")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-13")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-14")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-15")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-16")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-17")) {
model = "RAINIER";
} else if (line.startsWith("C03-1FSMT-02")) {
model = "RAINIER";
} else if (line.startsWith("C03-1FSMT-12")) {
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-08")) {
model = "X11";
} else if (line.startsWith("C02-3FSMT-18")) {
model = "X11";
} else if (line.startsWith("C03-1FSMT-01")) {
model = "X11";
} else if (line.startsWith("C03-1FSMT-11")) {
model = "X11";
} else if (line.startsWith("C02-3FSMT-09")) {
model = "X8";
} else if (line.startsWith("C02-3FSMT-19")) {
model = "X8";
} else {
model = "ALL";
}
} else {
model = "ALL";
}
List<String> checkReelList = lizhenApi.batchCheckReel(Arrays.asList(barcode), "", model);
if (checkReelList != null && !checkReelList.isEmpty()) {
if (checkReelList.contains(barcode.getBarcode())) {
throw new ValidateException("", barcode.getBarcode()+"已经被禁用");
}
}
if (pos != null) { if (pos != null) {
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
DataLog dataLog = new DataLog(storage, barcode, pos); DataLog dataLog = new DataLog(storage, barcode, pos);
......
...@@ -14,6 +14,8 @@ spring: ...@@ -14,6 +14,8 @@ spring:
host: localhost # 主机地址 host: localhost # 主机地址
port: 27017 # 端口 port: 27017 # 端口
database: smf # 数据库 database: smf # 数据库
username: neotel
password: neotel
servlet: servlet:
multipart: multipart:
......
...@@ -13,17 +13,19 @@ api: ...@@ -13,17 +13,19 @@ api:
fetchGRUrl: fetchGRUrl:
brandQtyUrl: brandQtyUrl:
importUrl: http://10.68.27.83/smf-core/ext/getDatalogs #虚拟仓从1F导入数据接口 importUrl: http://10.68.27.83/smf-core/ext/getDatalogs #虚拟仓从1F导入数据接口
checkReelMeasure: checkReelMeasure: #http://10.68.25.30:8000/SCT/checkreelinfo
getInDateUrl: getInDateUrl:
plant: plant:
werks: werks:
outerFactory: outerFactory:
#入库 #入库
save2DReelInfoUrl: http://10.68.27.68:8002/SmtAutoWH/Save2DReelInfo save2DReelInfoUrl: http://10.68.25.42:8002/SmtAutoWH/Save2DReelInfo
#发料 #发料
commonGIRecordUrl: http://10.68.27.69:8002/Sct/CommonGIRecord commonGIRecordUrl: http://10.68.25.42:8002/Sct/CommonGIRecord
#退料 #退料
commonRMRecordUrl: http://10.68.27.68:8002/Sct/CommonRMRecord commonRMRecordUrl: http://10.68.25.42:8002/Sct/CommonRMRecord
#批量禁用料
batchCheckReel: http://10.68.25.42:8001/Npm/CheckReelBatch
#缺料预警对应的地址 #缺料预警对应的地址
lizhen: lizhen:
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!