Commit c991b116 张少辉

1.电子仓增加元器件信息给客户端

1 个父辈 62671c60
正在显示 9 个修改的文件 包含 85 行增加20 行删除
......@@ -6,7 +6,7 @@ public class CORRESPONDING_WAREHOUSE {
public static final int ELECTRONIC_WAREHOUSE = 0;
//结构仓
public static final int STRUCTURAL_WAREHOUSE = 1;
public static final int structural_warehouse = 1;
//成品仓
public static final int FINISHED_GOODS_WAREHOUSE = 2;
......
package com.neotel.smfcore.custom.aiqingzhiyin1643.electronicWarehouse;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.service.po.Component;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/elecDevice")
public class ElecDeviceController {
@Autowired
private IComponentManager componentManager;
@Autowired
private CodeResolve codeResolve;
@ApiOperation("根据条码获取维护的元器件信息")
@RequestMapping("/getComponentByCode")
@AnonymousAccess
public ResultBean getComponentByCode(@RequestBody Map<String, String> paramMap) {
String code = paramMap.get("code");
Barcode barcode = null;
try {
barcode = codeResolve.resolveOneValideBarcode(code);
} catch (ValidateException e) {
return ResultBean.newErrorResult(-1, e.getMsgKey(), e.getDefaultMsg(), e.getMsgParam());
}
Component component = componentManager.findByPartNumberAndProvider(barcode.getPartNumber(), barcode.getProvider());
if (component != null) {
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("partNumber", component.getPartNumber() == null ? "" : component.getPartNumber());
resultMap.put("description", component.getDescription() == null ? "" : component.getDescription());
resultMap.put("provider", component.getProvider() == null ? "" : component.getProvider());
resultMap.put("providerMaterialCode", component.getProviderMaterialCode() == null ? "" : component.getProviderMaterialCode());
resultMap.put("producerNumber", component.getProducerNumber() == null ? "" : component.getProducerNumber());
resultMap.put("containmentAmount", component.getContainmentAmount() );
resultMap.put("plant", component.getPlant() == null ? "" : component.getPlant());
resultMap.put("originalFactory", component.getOriginalFactory() == null ? "" : component.getOriginalFactory());
resultMap.put("massProduction", component.getMassProduction() == null ? "" : component.getMassProduction());
return ResultBean.newOkResult(resultMap);
}
return ResultBean.newErrorResult(-1, "", barcode.getPartNumber() + "对应的元器件信息不存在");
}
}
......@@ -12,7 +12,7 @@ import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.aiqingzhiyin1643.bean.CtuCheckOutTask;
import com.neotel.smfcore.custom.aiqingzhiyin1643.bean.CtuPutInTask;
import com.neotel.smfcore.custom.aiqingzhiyin1643.finishedGoodsWarehouse.util.PutOutLocInfoCache;
import com.neotel.smfcore.custom.aiqingzhiyin1643.util.BoxUtil;
import com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.util.BoxUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......
package com.neotel.smfcore.custom.aiqingzhiyin1643.controller;
package com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.controller;
import com.google.common.collect.Lists;
import com.neotel.smfcore.common.bean.ReelLockPosInfo;
......@@ -12,10 +12,7 @@ import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.inList.service.po.InList;
import com.neotel.smfcore.core.inList.service.po.InListItem;
import com.neotel.smfcore.core.inList.util.InListCache;
import com.neotel.smfcore.core.storage.enums.DeviceType;
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;
......@@ -25,17 +22,13 @@ import com.neotel.smfcore.custom.aiqingzhiyin1643.bean.CtuCheckOutTask;
import com.neotel.smfcore.custom.aiqingzhiyin1643.bean.CtuPutInTask;
import com.neotel.smfcore.custom.aiqingzhiyin1643.bean.Station;
import com.neotel.smfcore.custom.aiqingzhiyin1643.momo.MomoApi;
import com.neotel.smfcore.custom.aiqingzhiyin1643.momo.bean.request.SplitContainerRequest;
import com.neotel.smfcore.custom.aiqingzhiyin1643.momo.bean.response.SplitContainerResponse;
import com.neotel.smfcore.custom.aiqingzhiyin1643.util.BoxUtil;
import com.neotel.smfcore.custom.aiqingzhiyin1643.util.StationCacheUtil;
import com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.util.BoxUtil;
import com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.util.StationCacheUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
......@@ -354,6 +347,21 @@ public class AgvDeviceController {
resultMap.put("needStockOutNum", needStockNum);
resultMap.put("stockOutNo", barcode.getStockoutNo());
resultMap.put("currentNum", barcode.getAmount());
int hasTask = -1;
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog task : allTasks) {
if (!task.isFinished() && !task.isCancel() && barcode.getBarcode().equals(task.getBarcode())) {
if (task.isPutInTask()) {
hasTask = 0;
} else if (task.isCheckOutTask()) {
hasTask = 1;
}
break;
}
}
resultMap.put("hasTask",hasTask);
// 3. 打印核心返回信息日志(关键数据一目了然)
log.info("料箱条码{}处理完成,返回信息:需要出库数={},是否全出={},出库单号={},当前库存数={}",
code, needStockNum, resultMap.get("allStockOut"), barcode.getStockoutNo(), barcode.getAmount());
......
package com.neotel.smfcore.custom.aiqingzhiyin1643.controller;
package com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.controller;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.enums.OP;
......@@ -15,7 +14,7 @@ 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.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.aiqingzhiyin1643.util.BoxUtil;
import com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.util.BoxUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......
package com.neotel.smfcore.custom.aiqingzhiyin1643.controller;
package com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.controller;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ApiException;
......
package com.neotel.smfcore.custom.aiqingzhiyin1643.controller;
package com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.controller;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
......
package com.neotel.smfcore.custom.aiqingzhiyin1643.util;
package com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.util;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
......@@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
......
package com.neotel.smfcore.custom.aiqingzhiyin1643.util;
package com.neotel.smfcore.custom.aiqingzhiyin1643.structuralWarehouse.util;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.aiqingzhiyin1643.bean.Station;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!