Commit fd84a2ee zshaohui

原材料仓 功能提交

1 个父辈 ea01bade
正在显示 114 个修改的文件 包含 4226 行增加24 行删除
......@@ -184,6 +184,30 @@ public class DataInitManager {
addNewFunctionMenu(10,poutOut, "safetyInventory", "安全库存", "safetyInventory", "system/safetyInventory/index", "safeInventory",functionMenuMap);
Menu raw = Menu.CreatePMenu("原材料仓", 2, "raw", 2, "", null);
//Gr入库
addNewFunctionMenu(2, raw, "grStorage", "Gr入库", "grStorage", "grStorage/index", "grStorage", functionMenuMap);
//Pk出库
addNewFunctionMenu(3, raw, "pkStorage", "Pk出库", "pkStorage", "pkStorage/index", "pkStorage", functionMenuMap);
//储位转移
addNewFunctionMenu(4, raw, "storageTransfer", "储位转移", "storageTransfer", "storageTransfer/index", "transfer", functionMenuMap);
//931单据领料
addNewFunctionMenu(5, raw, "docMaterialRe", "单据领料", "docMaterialRe", "receipt/docMaterialRe/index", "docMaterial", functionMenuMap);
//单据转库
addNewFunctionMenu(6, raw, "docTransferWarehous", "单据转库", "docTransferWarehous", "receipt/docTransferWarehous/index", "docTransfer", functionMenuMap);
//单据退料
addNewFunctionMenu(7, raw, "docReturn", "单据退料", "docReturn", "receipt/docReturn/index", "docRe", functionMenuMap);
//手动入库
addNewFunctionMenu(8, raw, "manualWarehous", "手动入库", "manualWarehous", "manualWarehous/index", "manualWa", functionMenuMap);
//MSD管理:MSD库存.MSD追溯性.MSD设置
Menu msd = Menu.CreatePMenu("MSD管理", 2, "msd", 2, "MSD",null);
addNewFunctionMenu(21, msd, "msdManage", "MSD库存", "msdManage", "neolight/msdManage/index", "MSDManager",functionMenuMap);
......
......@@ -901,6 +901,16 @@ public class BarcodeRule {
codeStr = "=7X8=CS0010-1";
rule = "RI[0:6:2]PN[-1:2:-1]";
codeStr = "B0700001-01";
rule = "RI[0:11:0]PN[0:3:8]";
//codeStr = "B0700001A";
//rule = "RI[0:8:1]PN[0:3:6]";
//codeStr = "=7x8=131S00650-017131|20240422-0831|20000|L130171311724000EK|TAIYO|";
//rule = "PN[-1:50:-1]PROVIDERNUMBER[-1:50:-1]|BATCH[-1:50:-1]DATECODE[-1:50:-1]|QTY|RI|SP|6";
BarcodeRule br = BarcodeRule.newRule(rule);
Barcode b = br.toCodeBean(codeStr).getBarcode();
if(b != null){
......
......@@ -190,6 +190,51 @@ public class Barcode extends BasePo implements Serializable {
* 工单详情id
*/
private String orderItemId;
//半成品仓,增加的参数
// 厂区
private String plantCode;
// 箱号
private String cartonId;
// 栈板号
private String palletId;
// 料号
private String pn;
// 机种
private String modelFamily;
// 物料类型
private String materialType;
// 库别
private String warehouseCode;
// 是否HOLD
private int hold;
// 数量
private int qty;
// 满箱数量
private int fullQty;
// 包装类型
private String packType;
// 生产日期
private String createAt;
//区域
private String region;
private String barSource;
/**
* 是否是锡膏
*/
......@@ -260,18 +305,8 @@ public class Barcode extends BasePo implements Serializable {
*/
private String grLabel;
private String keeperCode;
/**
* 库别
*/
private String warehouseCode = "W10B";
/**
* 是否根据查询出库
*/
......@@ -295,6 +330,10 @@ public class Barcode extends BasePo implements Serializable {
*/
private boolean isInventory = false;
//记录序列号
private int seq = 0;
/**
* 添加相关联条码
*
......
......@@ -131,4 +131,79 @@ public class OrderItemDto {
@ApiModelProperty("楼层")
private String floor;
/**
* 行号
*/
private String itemId;
/**
* 挑料单号
*/
private String pickingId;
/**
* 料号
*/
private String materialCode;
/**
* 库别
*/
private String warehouse;
/**
* 需求数量
*/
private int reqQty;
/**
* 需求卷数
*/
private int reqReel;
/**
* 传承数量
*/
private int cpQty;
/**
* 传承卷数
*/
private int cpReel;
/**
* 已发数量
*/
private int issuedQty;
/**
* 已发卷数
*/
private int issuedReel;
/**
* 退回数量
*/
private int retQty;
/**
* 面别
*/
private String face;
/**
* 创建日期
*/
private String createAt;
/**
* 更新日期
*/
private String updateAt;
/**
* BIN_CODE
*/
private String binCode;
}
......@@ -164,6 +164,8 @@ public class LiteOrder extends BasePo implements Serializable {
private boolean transReelBox = false;
//目的地
private String loc = "";
//迈征额外参数
private String guid;
......@@ -176,6 +178,10 @@ public class LiteOrder extends BasePo implements Serializable {
private String startTime;
private String reelBoxId;
/**
* 出库类型
*/
private int checkType = -1;
public void setClosed(boolean value){
......
......@@ -151,10 +151,6 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
*/
private String line;
/**
* 厂别
*/
private String plantCode;
/**
* 机器名称
......@@ -240,6 +236,156 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
private List<String> positionList;
/**
* 厂区
*/
private String plantCode;
/**
* 行号
*/
private String itemId;
/**
* 挑料单号
*/
private String pickingId;
/**
* 料号
*/
private String materialCode;
/**
* 库别
*/
private String warehouse;
/**
* 需求数量
*/
private int reqQty;
/**
* 需求卷数
*/
private int reqReel;
/**
* 传承数量
*/
private int cpQty;
/**
* 传承卷数
*/
private int cpReel;
/**
* 已发数量
*/
private int issuedQty;
/**
* 已发卷数
*/
private int issuedReel;
/**
* 退回数量
*/
private int retQty;
/**
* 面别
*/
private String face;
/**
* 创建日期
*/
private String createAt;
/**
* 更新日期
*/
private String updateAt;
/**
* BIN_CODE
*/
private String binCode;
//半成品仓增加的参数
/**
* 行ID
*/
private String rtvId;
/**
* 出货单号
*/
private String ticketCode;
/**
* 单据行号
*/
private String ticketItem;
/**
* 物料类型
*/
private String materialType;
/**
* 供应商代码
*/
private String vendorCode;
/**
* 单据数量
*/
private int qty;
/**
* 单位
*/
private String unit;
/**
* 状态
*/
private String status;
/**
* 原数量
*/
private int originQty;
/**
* 制造商
*/
private int manufacture;
/**
* 报关模式
*/
private String importMode;
/**
* 进口编号
*/
private String importCode;
/**
* 收货工厂
*/
private String shipTo;
public void setOutReelList(String reel) {
if (outReelList == null){
......
......@@ -363,6 +363,8 @@ public class DataLog extends BasePo implements Serializable {
private int height = 0;
private boolean outFromPos = false;
/**
* 出口位置
*/
......
......@@ -115,8 +115,7 @@ public class TaskService {
DataLog task = new DataLog(storage, barcode, storagePos);
task.setType(OP.PUT_IN);
task.setStatus(OP_STATUS.EXECUTING.name());
task.setExtendType(ExtendType.AUTO_PUTIN); //自动入库
task.setStatus(OP_STATUS.WAIT.name());
if (barcode != null) {
task.setWarehouseCode(barcode.getWarehouseCode());
task.setDescribe(barcode.getDescribe());
......@@ -125,6 +124,7 @@ public class TaskService {
task.setProvider(barcode.getProvider());
task.setProviderNumber(barcode.getProviderNumber());
task.setKeeperCode(barcode.getKeeperCode());
//task.setNum(barcode.getAmount());
barcode.setPutInTime(System.currentTimeMillis());
barcode.updateSluggishTime(dataCache.getPNsluggishDay(barcode.getPartNumber()));
barcodeManager.saveBarcode(barcode);
......@@ -882,6 +882,7 @@ public class TaskService {
List<Storage> availbleStorageList = new ArrayList<>();
for (Storage storage : storageList) {
log.info("收到料盘尺寸为:"+barcode.getPlateSize()+"X"+ barcode.getHeight());
if (storage.canPutIn(barcode.getPlateSize(), barcode.getHeight())) {
availbleStorageList.add(storage);
}
......@@ -977,7 +978,7 @@ public class TaskService {
} else {
pos = storagePosManager.getByBarcodeId(barcodeSave.getId());
if (!barcodeSave.getBarcode().startsWith("CS") && !barcodeSave.getBarcode().startsWith("CB") && !barcodeSave.getBarcode().startsWith("CM")) {
if (!barcodeSave.getBarcode().startsWith("C07") && !barcodeSave.getBarcode().startsWith("C13") && !barcodeSave.getBarcode().startsWith("C15")) {
if (barcodeSave.getAmount() <= 0) {
throw new ValidateException("smfcore.error.barcode.wrongQty", "条码[{0}]对应的数量<=0为: {1}", new String[]{barcodeSave.getBarcode(), barcodeSave.getAmount() + ""});
}
......
......@@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@RestController
@RequestMapping("/api/Mes")
@RequestMapping("wcs")
public class LizhenController {
@Autowired
......@@ -234,7 +234,7 @@ public class LizhenController {
@ApiOperation("内仓:机台叫料")
@PostMapping("/mPickingList")
@PostMapping("/ReelWarningInfo")
@AnonymousAccess
public ResultBean mPickingList(@RequestBody List<Map<String, String>> params) {
if (params == null || params.isEmpty()) {
......
......@@ -58,7 +58,7 @@ public class KafkaService {
/**
* 设备状态发送
*/
@Scheduled(fixedRate = 1000 * 60 * 1)
//@Scheduled(fixedRate = 1000 * 60 * 1)
public void setMachineStatus() {
log.info("发送设备状态开始");
Collection<Storage> storages = dataCache.getAllStorage().values();
......@@ -158,7 +158,7 @@ public class KafkaService {
/**
* 心跳数据发送
*/
@Scheduled(fixedRate = 1000 * 60 * 5)
//@Scheduled(fixedRate = 1000 * 60 * 5)
public void setHeartbeat() {
log.info("发送心跳开始");
//根据machineId,找到设备状态,是否正常
......@@ -203,7 +203,7 @@ public class KafkaService {
/**
* 设备状态发送
*/
@Scheduled(fixedRate = 1000 * 60 * 1)
//@Scheduled(fixedRate = 1000 * 60 * 1)
public void setStorageExportStatus() {
log.info("发送出料口信息开始");
......@@ -272,7 +272,7 @@ public class KafkaService {
/**
* 发送出料口心跳
*/
@Scheduled(fixedRate = 1000 * 60 * 5)
//@Scheduled(fixedRate = 1000 * 60 * 5)
public void setStorageHeartbeat() {
log.info("发送出料口心跳开始");
EquipStatusBean statusBean = EquipStatusUtil.getStatusBean(KafkaConfig.LINE_CID);
......@@ -308,7 +308,7 @@ public class KafkaService {
/**
* MachineParameter发送
*/
@Scheduled(fixedRate = 1000 * 60 * 5)
//@Scheduled(fixedRate = 1000 * 60 * 5)
public void setMachineParameter() {
log.info("MachineParameter开始发送");
List<String> machineIdList = getMachineIdList();
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.exception.ApiException;
import com.neotel.smfcore.common.utils.HttpHelper;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.order.service.po.LiteOrderItem;
import com.neotel.smfcore.custom.lizhen.third.maicheng.bean.StationStatus;
......@@ -37,6 +38,9 @@ public class MaiZhengApi {
*/
public List<StationStatus> StationStatus() {
try {
if (StringUtils.isEmpty(stationStatusApi)){
return null;
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("SessionID", "0");
paramMap.put("MesType", "Get");
......@@ -57,6 +61,11 @@ public class MaiZhengApi {
public String transReelBox(LiteOrder liteOrder) {
if (StringUtils.isEmpty(transReelBoxApi)){
return null;
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("GUID", liteOrder.getGuid());
paramMap.put("CacheIndex", liteOrder.getCacheIndex());
......@@ -101,6 +110,11 @@ public class MaiZhengApi {
public void prepareReelBox(String guid, String result) {
if (StringUtils.isEmpty(prepareReelBoxApi)){
return;
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("GUID", guid);
paramMap.put("Result", result);
......@@ -115,6 +129,9 @@ public class MaiZhengApi {
}
public void workIdCancelApi(String guid) {
if (StringUtils.isEmpty(workIdCancleApi)){
return;
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("GUID", guid);
log.info("仓储请求取消工单入参为:" + JSON.toJSONString(paramMap));
......
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
import java.util.List;
/**
* 电子料入退库 请求
*/
@Data
public class BackToWarehouseRequest {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 目标储位
*/
private String BIN_CODE;
/**
* 料卷清单
*/
private List<String> REEL_LIST;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
@Data
@AllArgsConstructor
public class BinMoveRequest {
private String PLANT_CODE;
private String BIN_CODE;
private List<String> REEL_LIST;
private int QTY;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class BrandQtyRequest {
private String material_code;
private String brand;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
@Data
public class BrandQtyResult {
private String id;
private String material_code;
private String brand;
private int qty;
private int reel_size;
private String create_by;
private String create_at;
private String update_by;
private String update_at;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 箱去向接口
*/
@Data
public class CartonDstRequest {
//厂区
private String PLANT;
//箱号
private String CARTON_ID;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* PPS CHECK检查结果
*/
@Data
public class CheckLabelRequest {
//箱号
private String CARTON_NO;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* PPS 按栈板获取箱清单
*/
@Data
public class CheckPalletCartonRequest {
//栈板号
private String PALLET_NO;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
@Data
public class CheckPassStationRequest {
// 出货栈板号
private String PALLET_NO;
// 箱号
private String CARTON_NO;
// SSCC/Tracking No
private String BARCODE;
// DN号
private String DN_NO;
// SHIPPINGLABEL/CARRIERLABEL打印类型
private String PRINT_TYPE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 获取不可用(HOLD)库存信息
*/
@Data
public class FetchHoldInfoRequest {
//工厂代码
private String PLANT;
//库别代码
private String WAREHOUSE_CODE;
//物料编号
private String MATERIAL_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* 拉取转库单据
*/
@Data
@AllArgsConstructor
public class FetchMoveTicketRequest {
//工厂代码
private String PLANT_CODE;
//单据号
private String TICKET_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 用栈板号获取箱信息清单
*/
@Data
public class FetchPalletCartonRequest {
//库存栈板号
private String PALLET_ID;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* 获取栈板信息 请求
*/
@Data
@AllArgsConstructor
public class FetchPalletInfoRequest {
private String REQUEST_ID;
private String PLANT;
private List<String> PALLET_LIST;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class FetchShipmentInfoRequest {
/**
* 工厂代码
*/
private String PLANT_CODE;
/**
* 出货单号
*/
private String TICKET_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 获取可用库存
*/
@Data
public class FetchValidInvRequest {
private String REQ_ID;
private String MATERIAL_CODE;
private String WAREHOUSE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* GetInDate 校验DC有效期
*/
@Data
@AllArgsConstructor
public class GetInDateRequest {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 制造商
*/
private String BRAND;
/**
* 日期编码
*/
private String DATE_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* GetPickingItems请求实体类
*/
@Data
@AllArgsConstructor
public class GetPickingItemsRequest {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 任务类型
*/
private String PICKING_ID;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 集货单锁定料箱查询
*/
@Data
public class LockedCartonQueryRequest {
//出货单号
private String SHIPMENT_ID;
//出货栈板号
private String PALLET_NO;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
import java.util.List;
@Data
public class MoveTicketPickData {
// 工厂代码
private String PLANT_CODE;
// 单据号
private String TICKET_CODE;
// 单据行号
private String TICKET_ITEM;
// 料号
private String MATERIAL_CODE;
// 库存栈板清单
private List<String> LABEL_LIST;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 转库单据备料
*/
@Data
public class MoveTicketPickRequest {
//工厂代码
private String PLANT_CODE;
//单据号
private String TICKET_CODE;
private MoveTicketPickData DATA;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 转库单据过账
*/
@Data
public class MoveTicketPostRequest {
//工厂代码
private String PLANT_CODE;
//单据号
private String TICKET_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 转库单据备料还原
*/
@Data
public class MoveTicketRestoreRequest {
//工厂代码
private String PLANT_CODE;
//单据号
private String TICKET_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* 按GR生成标签码并上架 请求
*/
@Data
@AllArgsConstructor
public class NewLabelToCellRequest {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 过账编码
*/
private List<String> UD_LIST;
/**
* 数量
*/
private int QTY;
/**
* 储位号
*/
private String BIN_CODE;
/**
* 料卷行
*/
private List<String> REEL_LIST;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
import java.util.List;
/**
* 栈板合并
*/
@Data
public class PalletMergeRequest {
// 合并到
private String MERGE_TO;
// 合并清单
private List<String> MERGE_LIST;
// 厂区
private String PLANT_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 栈板拆分
*/
@Data
public class PalletSplitRequest {
//库存栈板号
private String PALLET_ID;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
import java.util.List;
/**
* 栈板同库别转移
*/
@Data
public class PalletUpdateRequest {
// 请求标识
private String REQUEST_ID;
// 库存栈板号列表
private List<String> PALLET_LIST;
// 储位号
private String BIN_CODE;
// 业务类型
private String BIZ_TYPE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* PickingIssue请求
*/
@Data
@AllArgsConstructor
public class PickingIssueRequest {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 挑料单号
*/
private String PICKING_ID;
/**
* 行号
*/
private String ITEM_ID;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 库别
*/
private String WAREHOUSE_CODE;
/**
* 制造商
*/
private String BRAND;
/**
* 面别
*/
private String FACE;
/**
* 批次码
*/
private String BATCH_CODE;
/**
* 料卷清单
*/
private List<String> REEL_LIST;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* QueryBin请求
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QueryBinRequest {
/**
* 工厂代码
*/
private String PLANT_CODE;
/**
* 存储类型
*/
private String STORAGE_TYPE;
/**
* 储位状态
*/
private int BIN_STATUS;
/**
* 储位库别
*/
private String WAREHOUSE_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* QueryGr请求实体类
*/
@Data
@AllArgsConstructor
public class QueryGrRequest {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 供应商
*/
private String BRAND;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* GR过账状态查询 请求
*/
@Data
@AllArgsConstructor
public class QueryGrStatusRequest {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 供应商
*/
private String BRAND;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 单据号
*/
private String GR_CODE;
/**
* 单据行
*/
private String GR_ITEM;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class QueryPickingRequest {
private String PLANT_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 重置转库单据
*/
@Data
public class ResetMoveTicketRequest {
//工厂代码
private String PLANT_CODE;
//单据号
private String TICKET_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
import java.util.List;
/**
* 料卷退PK 请求
*/
@Data
public class ReturnToPKRequest {
// 厂区
private String PLANT_CODE;
// 挑料单号
private String PICKING_ID;
// 料号
private String MATERIAL_CODE;
// 目标储位
private String BIN_CODE;
// 料卷清单
private List<String> REEL_LIST;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
import java.util.List;
@Data
public class TicketPostRequest {
// 厂区
private String PLANT_CODE;
// 单据号
private String TICKET_CODE;
// 单据行
private String TICKET_ITEM;
// 料卷清单
private List<String> REEL_LIST;
// 数量
private int QTY;
// 储位号
private String BIN_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
import java.util.List;
/**
* Tower发料 请求
*/
@Data
public class TowerIssueRequest {
// 厂区
private String PLANT_CODE;
// 挑料单号
private String PICKING_ID;
// 料号
private String MATERIAL_CODE;
// 库别
private String WAREHOUSE_CODE;
// 制造商
private String BRAND;
// 面别
private String FACE;
// 批次码
private String BATCH_CODE;
// 料卷清单
private List<String> REEL_LIST;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* UpdateBin 更新储位 请求
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UpdateBinRequest {
/**
* 工厂代码
*/
private String PLANT_CODE;
/**
* 储位代码
*/
private String BIN_CODE;
/**
* 储位库别
*/
private String WAREHOUSE_CODE;
/**
* 存储类型
*/
private String STORAGE_TYPE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* 校验箱号信息
*/
@Data
@AllArgsConstructor
public class ValidCartonRequest {
// 请求ID
private String REQUEST_ID;
// 卡板ID
private String CARTON_ID;
// 厂区
private String PLANT;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 电子料入退库 结果
*/
@Data
public class BackToWarehouseResult {
/**
*厂区
*/
private String PLANT_CODE;
/**
*标签码
*/
private String LABEL_ID;
/**
*料号
*/
private String MATERIAL_CODE;
/**
*库别
*/
private String WAREHOUSE_CODE;
/**
*数量
*/
private int LABEL_QTY;
/**
*厂商代码
*/
private String VENDOR_CODE;
/**
*厂商名称
*/
private String VENDOR_NAME;
/**
*版本
*/
private String VERSION;
/**
*单据日期
*/
private String GR_DATE;
/**
*异动日期
*/
private String TRAN_DATE;
/**
*状态
*/
private int STATUS;
/**
*仓管员
*/
private String KEEPER_CODE;
/**
*制造商
*/
private String BRAND;
/**
*单位
*/
private String UNIT;
/**
*批次号
*/
private String BATCH_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
@Data
public class BinMoveResult {
//厂区
private String PLANT_CODE;
// 描述: 标签码
private String LABEL_ID;
// 描述: 料号
private String MATERIAL_CODE;
// 描述: 库别
private String WAREHOUSE_CODE;
// 描述: 数量
private Integer LABEL_QTY;
// 描述: 厂商代码
private String VENDOR_CODE;
// 描述: 厂商名称
private String VENDOR_NAME;
// 描述: 版本
private String VERSION;
// 描述: 单据日期
private String GR_DATE;
// 描述: 异动日期
private String TRAN_DATE;
// 描述: 状态
private int STATUS;
// 描述: 仓管员
private String KEEPER_CODE;
// 描述: 制造商
private String BRAND;
// 描述: 单位
private String UNIT;
// 描述: 批次号
private String BATCH_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 箱去向接口
*/
@Data
public class CartonDstResult {
//目的地
private String DESTINATION;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
import java.util.List;
/**
* PPS 按栈板获取箱清单
*/
@Data
public class CheckPalletCartonResult {
// 箱号
private String CARTON_ID;
// 工厂代码
private String PLANT;
private String PART_NO;
// 库别
private String WAREHOUSE_CODE;
// 原产国
private String COO;
private List<String> PALLET_PACK_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 获取不可用(HOLD)库存信息
*/
@Data
public class FetchHoldInfoResult {
// 箱号
private String CARTON_ID;
// 工厂代码
private String PLANT_CODE;
// 批次
private String BATCH_CODE;
// 库存栈板号
private String PALLET_ID;
// 料号
private String MATERIAL_CODE;
// HOLD数量
private Integer HOLD;
// 数量(PCS)
private Integer QTY;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 拉取转库单据
*/
@Data
public class FetchMoveTicketResult {
// 单据行号
private String TICKET_ITEM;
// 料号
private String MATERIAL_CODE;
// 源工厂
private String SRC_PLANT;
// 目的工厂
private String DST_PLANT;
// 来源库别
private String SRC_WAREHOUSE;
// 目的库别
private String DST_WAREHOUSE;
// 来源批次
private String SRC_BATCH;
// 目的批次
private String DST_BATCH;
// 数量
private int QTY;
// 移动类型
private String MOVE_TYPE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 用栈板号获取箱信息清单
*/
@Data
public class FetchPalletCartonResult {
// 箱号
private String CARTON_ID;
// 工厂代码
private String PLANT;
// 料号
private String PN;
// 库存栈板号
private String PALLET_ID;
// 机种
private String MODEL_FAMILY;
// 库别
private String WAREHOUSE_CODE;
// 状态
private String STATUS;
// 是否 HOLD
private String HOLD;
// 数量(PCS)
private Integer QTY;
// 包规
private Integer FULL_QTY;
// 版本号
private String OS_VERSION;
// 原产国
private String COO;
// 包装类型
private String PACK_TYPE;
// 生产日期
private String CREATE_AT;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 获取栈板信息 结果
*/
@Data
public class FetchPalletInfoResult {
// 厂区
private String PLANT;
// 库存栈板号
private String PALLET_ID;
// 机种
private String MODEL_FAMILY;
// 库别
private String WAREHOUSE_CODE;
// 生产日期
private String CREATED_TIME;
// 储位号
private String BIN_CODE;
// 数量
private int QTY;
// 批次
private String BATCH_CODE;
// 料号
private String MATERIAL_CODE;
// 物料类型
private String MATERIAL_TYPE;
// 原产国
private String COO;
// 版本
private String OS_VERSION;
// 包装类型
private String PACK_TYPE;
// 厂区(重复字段名,可能需要根据实际情况调整)
private String PLANT_CODE;
// 状态
private int STATUS;
// 禁用
private int HOLD;
// 失败说明
private String ERROR;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
@Data
public class FetchShipmentInfoResult {
/**
* 行ID
*/
private String RTV_ID;
/**
* 工厂代码
*/
private String PLANT_CODE;
/**
* 出货单号
*/
private String TICKET_CODE;
/**
* 单据行号
*/
private String TICKET_ITEM;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 物料类型
*/
private String MATERIAL_TYPE;
/**
* 仓库代码
*/
private String WAREHOUSE_CODE;
/**
* 供应商代码
*/
private String VENDOR_CODE;
/**
* 单据数量
*/
private int QTY;
/**
* 单位
*/
private String UNIT;
/**
* 状态
*/
private String STATUS;
/**
* 原数量
*/
private int ORIGIN_QTY;
/**
* 制造商
*/
private int MANUFACTURE;
/**
* 报关模式
*/
private String IMPORT_MODE;
/**
* 进口编号
*/
private String IMPORT_CODE;
/**
* 收货工厂
*/
private String SHIP_TO;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 获取可用库存
*/
@Data
public class FetchValidInvResult {
// 料号
private String MATERIAL_CODE;
// 库存栈板号
private String PALLET_ID;
// 数量
private int QTY;
// 扣货
private int HOLD;
// 储位
private String BIN_CODE;
// 库别
private String WAREHOUSE;
// 状态
private int STATUS;
// 批次
private String BATCH_CODE;
// 时间
private String CREATED_AT;
// 原产国
private String COO;
// 版本
private String OS_VERSION;
// 包装类型
private String PACK_TYPE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* GetPickingItems结果实体类
*/
@Data
public class GetPickingItemsResult {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 行号
*/
private String ITEM_ID;
/**
* 挑料单号
*/
private String PICKING_ID;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 库别
*/
private String WAREHOUSE;
/**
* 需求数量
*/
private int REQ_QTY;
/**
* 需求卷数
*/
private int REQ_REEL;
/**
* 传承数量
*/
private int CP_QTY;
/**
* 传承卷数
*/
private int CP_REEL;
/**
* 已发数量
*/
private int ISSUED_QTY;
/**
* 已发卷数
*/
private int ISSUED_REEL;
/**
* 退回数量
*/
private int RET_QTY;
/**
* 面别
*/
private String FACE;
/**
* 批次
*/
private String BATCH_CODE;
/**
* 制造商
*/
private String BRAND;
/**
* 创建日期
*/
private String CREATE_AT;
/**
* 更新日期
*/
private String UPDATE_AT;
private String MO;
private String BIN_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 集货单锁定料箱查询
*/
@Data
public class LockedCartonQueryResult {
// 出货单号
private String SHIPMENT_ID;
// 出货栈板号
private String PALLET_NO;
// 行号
private String ROW_ID;
// 箱号
private String CARTON_ID;
// 锁定时间
private String CREATE_AT;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 按GR生成标签码并上架 返回
*/
@Data
public class NewLabelToCellResult {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 标签码
*/
private String LABEL_ID;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 库别
*/
private String WAREHOUSE_CODE;
/**
* 数量
*/
private int LABEL_QTY;
/**
* 厂商代码
*/
private String VENDOR_CODE;
/**
* 厂商名称
*/
private String VENDOR_NAME;
/**
* 版本
*/
private String VERSION;
/**
* 单据日期
*/
private String GR_DATE;
/**
* 异动日期
*/
private String TRAN_DATE;
/**
* 状态
*/
private int STATUS;
/**
* 仓管员
*/
private String KEEPER_CODE;
/**
* 制造商
*/
private String BRAND;
/**
* 单位
*/
private String UNIT;
/**
* 批次号
*/
private String BATCH_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 栈板合并
*/
@Data
public class PalletMergeResult {
// 库存栈板号
private String PALLET_ID;
// 机种
private String MODEL_FAMILY;
// 库别
private String WAREHOUSE_CODE;
// 生产日期
private String CREATED_TIME;
// 储位号
private String BIN_CODE;
// 数量
private int QTY;
// 批次
private String BATCH_CODE;
// 料号
private String MATERIAL_CODE;
// 物料类型
private String MATERIAL_TYPE;
// 原产国
private String COO;
// 版本
private String OS_VERSION;
// 包装类型
private String PACK_TYPE;
// 厂区
private String PLANT_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 栈板同库别转移
*/
@Data
public class PalletUpdateResult {
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
/**
* PickingIssue返回
*/
public class PickingIssueResult {
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* QueryBin返回
*/
@Data
public class QueryBinResult {
/**
* 储位代码
*/
private String BIN_CODE;
/**
* 储位类型
*/
private String BIN_TYPE;
/**
* 储位状态
*/
private int BIN_STATUS;
/**
* 容量
*/
private int BIN_SIZE;
/**
* 仓管员
*/
private String BIN_KEEPER;
/**
* 储位库别
*/
private String WAREHOUSE_CODE;
/**
* 存储类型
*/
private String STORAGE_TYPE;
/**
* 储位厂区
*/
private String PLANT_CODE;
/**
* 储位楼栋
*/
private String BUILDING;
/**
* 储位分类
*/
private String BIN_CATEGORY;
/**
* 储位点位
*/
private String BIN_ZONE;
/**
* 储位楼层
*/
private String BIN_FLOOR;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* QueryGr结果实体类
*/
@Data
public class QueryGrResult {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 单据号
*/
private String GR_CODE;
/**
* 单据行
*/
private String GR_ITEM;
/**
* 单据日期
*/
private String GR_DATE;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 厂商代码
*/
private String VENDOR_CODE;
/**
* 厂商名称
*/
private String VENDOR_NAME;
/**
* 制造商
*/
private String BRAND;
/**
* 仓管员
*/
private String KEEPER_CODE;
/**
* 库别
*/
private String WAREHOUSE_CODE;
/**
* 批次
*/
private String BATCH_CODE;
/**
* 数量
*/
private int GR_QTY;
/**
* 单据状态
*/
private int POST_STATUS;
/**
* 异动日期
*/
private String POST_DATE;
/**
* 原单据
*/
private String ORIGIN_GR;
/**
* 保税标识
*/
private String MATERIAL_BONDED;
/**
* A级物料
*/
private String MATERIAL_CONTROL;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* GR过账状态查询 返回
*/
@Data
public class QueryGrStatusResult {
/**
* 厂区
*/
private String PLANT_CODE;
/**
* 单据号
*/
private String GR_CODE;
/**
* 单据行
*/
private String GR_ITEM;
/**
* 单据日期
*/
private String GR_DATE;
/**
* 料号
*/
private String MATERIAL_CODE;
/**
* 厂商代码
*/
private String VENDOR_CODE;
/**
* 厂商名称
*/
private String VENDOR_NAME;
/**
* 状态
*/
private String STATUS;
/**
* 供应商
*/
private String BRAND;
/**
* 仓管员
*/
private String KEEPER_CODE;
/**
* 库别
*/
private String WAREHOUSE_CODE;
/**
* 过账代码
*/
private String UD_CODE;
/**
* 过账数量
*/
private String UD_QTY;
/**
* 单据数量
*/
private String LOT_QTY;
/**
* 过账时间
*/
private String POST_DATE;
/**
* 批次
*/
private String BATCH_CODE;
/**
* 原单据
*/
private String ORIGIN_GR;
/**
* 保税标识
*/
private String MATERIAL_BONDED;
/**
* A级物料
*/
private String MATERIAL_CONTROL;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 查询挑料单列表
*/
@Data
public class QueryPickingResult {
// 厂区
private String PLANT_CODE;
// 挑料单号
private String PICKING_ID;
// 线别
private String LINE;
// 状态
private Integer STATUS;
// 原单号
private String ORG_PICKING_ID;
// SMT料号
private String SMT_PN;
// 创建时间
private String CREATE_AT;
// 更新时间
private String UPDATE_AT;
// 更新工号
private String UPDATE_BY;
// 更新姓名
private String UPDATE_NAME;
private boolean checkOut = false;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 料卷退PK 返回
*/
@Data
public class ReturnToPKResult {
// 厂区
private String PLANT_CODE;
// 标签码
private String LABEL_ID;
// 料号
private String MATERIAL_CODE;
// 库别
private String WAREHOUSE_CODE;
// 数量
private int LABEL_QTY;
// 厂商代码
private String VENDOR_CODE;
// 厂商名称
private String VENDOR_NAME;
// 版本
private String VERSION;
// 单据日期
private String GR_DATE;
// 异动日期
private String TRAN_DATE;
// 状态
private int STATUS;
// 仓管员
private String KEEPER_CODE;
// 制造商
private String BRAND;
// 单位
private String UNIT;
// 批次号
private String BATCH_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
@Data
public class TicketPostResult {
// 厂区
private String PLANT_CODE;
// 标签码
private String LABEL_ID;
// 料号
private String MATERIAL_CODE;
// 库别
private String WAREHOUSE_CODE;
// 数量
private int LABEL_QTY;
// 厂商代码
private String VENDOR_CODE;
// 厂商名称
private String VENDOR_NAME;
// 版本
private String VERSION;
// 单据日期
private String GR_DATE;
// 异动日期
private String TRAN_DATE;
// 状态
private int STATUS;
// 仓管员
private String KEEPER_CODE;
// 制造商
private String BRAND;
// 单位
private String UNIT;
// 批次号
private String BATCH_CODE;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* UpdateBin 更新储位 返回
*/
@Data
public class UpdateBinResult {
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
import java.util.Date;
/**
* 校验箱号信息 返回
*/
@Data
public class ValidCartonResult {
// 厂区
private String PLANT;
// 箱号
private String CARTON_ID;
// 栈板号
private String PALLET_ID;
// 料号
private String PN;
// 机种
private String MODEL_FAMILY;
// 物料类型
private String MATERIAL_TYPE;
// 状态
private int STATUS;
// 库别
private String WAREHOUSE_CODE;
// 是否HOLD
private int HOLD;
// 数量
private int QTY;
// 满箱数量
private int FULL_QTY;
// 包装类型
private String PACK_TYPE;
// 生产日期
private String CREATE_AT;
// 区域
private String REGION;
}
package com.neotel.smfcore.custom.luxsan.api.bean.util;
import lombok.Data;
@Data
public class LuxsanApiResult {
private String MSGTY;
private String MSGTX;
private String DATA;
}
package com.neotel.smfcore.custom.luxsan.api.enums;
/**
* Bin 枚举
*/
public class BinEnum {
//R:货架, P:栈板, C:箱格, B:胶框, T:料塔
public static final String STORAGE_TYPE_R = "R";
public static final String STORAGE_TYPE_P = "P";
public static final String STORAGE_TYPE_C = "C";
public static final String STORAGE_TYPE_B = "B";
public static final String STORAGE_TYPE_T = "T";
//0:空闲, 1:占用, 2:锁定
public static final int BIN_STATUS_0 = 0;
public static final int BIN_STATUS_1 = 1;
public static final int BIN_STATUS_2 = 2;
}
package com.neotel.smfcore.custom.luxsan.api.enums;
public class LuxsanApiEnum {
public static final String SUCCESS = "S";
public static final String ERROR = "E";
}
package com.neotel.smfcore.custom.luxsan.api.enums;
public class PalletEnum {
//待入库
public static final int PENDING_STORAGE = 1;
//单据分配
public static final int DOCUMENT_ALLOCATION = 2;
//已挑料
public static final int MATERIAL_PICKED = 3;
//在库库存
public static final int INVENTORY_IN_WAREHOUSE = 4;
//出货已备料
public static final int SHIPMENT_MATERIALS_PREPARED = 5;
//已过账,待上架
public static final int POSTED_AND_PENDING_SHELVING = 6;
//已出货
public static final int SHIPPED = 7;
//已经生成栈板,待过账
public static final int PENDING_POSTING = 8;
//出货取消
public static final int SHIPMENT_CANCELLATION = 9;
}
package com.neotel.smfcore.custom.luxsan.api.enums;
public class QueryGrEnum {
// -1:已撤消,0:新单据, 1:已过账/待上架
public static final int cancel = -1;
public static final int newDoc = 0;
public static final int pending = 1;
public static String getStatusName(int status) {
if (status == cancel) {
return "已撤消";
} else if (status == newDoc) {
return "新单据";
} else if (status == pending) {
return "已过账/待上架";
}
return "";
}
}
package com.neotel.smfcore.custom.luxsan.api.enums;
public class QueryGrStatusEnum {
//status: -1 Cancel:已撤消,0 New:新单据, 1 PostIn:已过账/待上架
// 2 AllocBin:已分配/待上架 3 In:已上架/已结案 4 AllocInv:已分配待下架
// 5 Picked:已下架待过账 6 PostOut:已下架已过账 7 Out:已发料已结案
// 8 AllocLack:已分配但缺料 10 LackBin:未分配无库存 11 AllocAuto:已分配未完成
public static final String cancel = "Cancel";
public static final String newDoc = "New";
public static final String postIn = "PostIn";
public static final String allocBin = "AllocBin";
public static final String in = "In";
public static final String allocInv = "AllocInv";
public static final String picked = "Picked";
public static final String postOut = "PostOut";
public static final String out = "Out";
public static final String allocLack = "AllocLack";
public static final String lackBin = "LackBin";
public static final String allocAuto = "AllocAuto";
public static String getStatusName(String status) {
if (status.equals(cancel)) {
return "已撤消";
} else if (status.equals(newDoc)) {
return "新单据";
} else if (status.equals(postIn)) {
return "已过账/待上架";
} else if (status.equals(allocBin)) {
return "已分配/待上架";
} else if (status.equals(in)) {
return "已上架/已结案";
} else if (status.equals(allocInv)) {
return "已分配待下架";
} else if (status.equals(picked)) {
return "已下架待过账";
} else if (status.equals(postOut)) {
return "已下架已过账";
} else if (status.equals(out)) {
return "已发料已结案";
} else if (status.equals(allocLack)) {
return "已分配但缺料";
} else if (status.equals(lackBin)) {
return "未分配无库存";
} else if (status.equals(allocAuto)) {
return "已分配未完成";
}
return "";
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.common.bean.request;
import lombok.Data;
@Data
public class SendTicketInfo {
// 厂区
private String PLANT_CODE;
// 单据号
private String TICKET_CODE;
// 单据行号
private String TICKET_ITEM;
// 单据类型
private String TICKET_TYPE;
// 异动类型
private String MOVE_TYPE;
// 料号
private String MATERIAL_CODE;
// 数量
private Double QTY;
// 仓管员
private String KEEPER_CODE;
// 来源厂区
private String SRC_PLANT;
// 来源库别
private String SRC_WAREHOUSE;
// 目的厂区
private String DST_PLANT;
// 目的库别
private String DST_WAREHOUSE;
// 过账数量
private Double POST_QTY;
// 过账日期
private String POST_DATE;
// 状态
private String STATUS;
// 分配数量
private Double ALLOCATE_QTY;
// 挑料数量
private Double PICKED_QTY;
// 源批次
private String SRC_BATCH;
// 目的批次
private String DST_BATCH;
}
package com.neotel.smfcore.custom.luxsan.factory_c.common.bean.result;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class WcsResult {
@JsonProperty("MSGTY")
private String MSGTY;
@JsonProperty("MSGTX")
private String MSGTX;
}
package com.neotel.smfcore.custom.luxsan.factory_c.common.controller;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.*;
import com.neotel.smfcore.custom.luxsan.api.bean.result.*;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CommonUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/luxsanApi")
public class LuxsanApiController {
@ApiOperation("3 GR查询")
@RequestMapping("/queryGr")
@AnonymousAccess
public List<QueryGrResult> queryGr(@RequestBody QueryGrRequest request) {
return LuxsanApi.queryGr(request);
}
@ApiOperation("5 GR过账状态查询")
@RequestMapping("/queryGrStatus")
@AnonymousAccess
public List<QueryGrStatusResult> queryGrStatus(@RequestBody QueryGrStatusRequest request) {
return LuxsanApi.queryGrStatus(request);
}
@ApiOperation("6 按GR生成标签码并上架")
@RequestMapping("/newLabelToCell")
@AnonymousAccess
public NewLabelToCellResult newLabelToCell(@RequestBody NewLabelToCellRequest request) {
return LuxsanApi.newLabelToCell(request);
}
@ApiOperation("11 查询挑料单列表")
@RequestMapping("/queryPicking")
@AnonymousAccess
public List<QueryPickingResult> queryPicking(@RequestBody QueryPickingRequest request) {
return LuxsanApi.queryPicking(request);
}
@ApiOperation("12 获取挑料单详情")
@RequestMapping("/getPickingItems")
@AnonymousAccess
public List<GetPickingItemsResult> getPickingItems(@RequestBody GetPickingItemsRequest request) {
return LuxsanApi.getPickingItems(request);
}
@ApiOperation("14 Picking发料")
@RequestMapping("/pickingIssue")
@AnonymousAccess
public void pickingIssue(@RequestBody PickingIssueRequest request) {
LuxsanApi.pickingIssue(request);
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.common.controller;
import com.alibaba.fastjson.JSON;
import com.neotel.smfcore.custom.luxsan.factory_c.common.bean.request.SendTicketInfo;
import com.neotel.smfcore.custom.luxsan.factory_c.common.bean.result.WcsResult;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Slf4j
@RequestMapping("/wcs")
@RestController
public class WcsController {
@ApiOperation("单据推送")
@RequestMapping("/SendTicketInfo")
@AnonymousAccess
public WcsResult sendTicketInfo(@RequestBody List<SendTicketInfo> paramList){
log.info("收到单据推送请求信息为:"+ JSON.toJSONString(paramList));
WcsResult wcsResult = new WcsResult();
wcsResult.setMSGTX("S");
wcsResult.setMSGTY("接收成功");
return wcsResult;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean;
import lombok.Data;
/**
* 料串需要绑定的GR信息
*/
@Data
public class BindGrInfo {
//料串信息
private String materialStr;
// 厂区
private String plantCode;
// 单据号
private String grCode;
// 单据行
private String grItem;
// 单据日期
private String grDate;
// 料号
private String materialCode;
// 厂商代码
private String vendorCode;
// 厂商名称
private String vendorName;
// 状态
private String status;
// 供应商
private String brand;
// 仓管员
private String keeperCode;
// 库别
private String warehouseCode;
// 过账代码
private String udCode;
// 过账数量
private Double udQty;
// 单据数量
private Double lotQty;
// 过账时间
private String postDate;
// 批次
private String batchCode;
// 原单据
private String originGr;
// 保税标识
private String materialBonded;
// A级物料
private String materialControl;
private int h;
private int w;
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class TicketReturn {
private String material;
private String ticketCode;
private String ticketItem;
private String warehouseCode;
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto;
import com.neotel.smfcore.custom.luxsan.api.bean.result.FetchMoveTicketResult;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class FetchMoveTicketDto {
// 单据行号
private String ticketItem;
// 料号
private String materialCode;
// 源工厂
private String srcPlant;
// 目的工厂
private String dstPlant;
// 来源库别
private String srcWarehouse;
// 目的库别
private String dstWarehouse;
// 来源批次
private String srcBatch;
// 目的批次
private String dstBatch;
// 数量
private int qty;
// 移动类型
private String moveType;
public static FetchMoveTicketDto convertFetchMoveTicketDto(FetchMoveTicketResult result) {
FetchMoveTicketDto dto = new FetchMoveTicketDto();
dto.setTicketItem(result.getTICKET_ITEM());
dto.setMaterialCode(result.getMATERIAL_CODE());
dto.setSrcPlant(result.getSRC_PLANT());
dto.setDstPlant(result.getDST_PLANT());
dto.setSrcWarehouse(result.getSRC_WAREHOUSE());
dto.setDstWarehouse(result.getDST_WAREHOUSE());
dto.setSrcBatch(result.getSRC_BATCH());
dto.setDstBatch(result.getDST_BATCH());
dto.setQty(result.getQTY());
dto.setMoveType(result.getMOVE_TYPE());
return dto;
}
public static List<FetchMoveTicketDto> convertFetchMoveTicketDto(List<FetchMoveTicketResult> resultList) {
List<FetchMoveTicketDto> dtoList = new ArrayList<>();
for (FetchMoveTicketResult result : resultList) {
dtoList.add(convertFetchMoveTicketDto(result));
}
return dtoList;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto;
import com.google.common.collect.Lists;
import com.neotel.smfcore.custom.luxsan.api.bean.result.GetPickingItemsResult;
import lombok.Data;
import java.util.List;
@Data
public class GetPickingItemsDto {
/**
* 厂区
*/
private String plantCode;
/**
* 行号
*/
private String itemId;
/**
* 挑料单号
*/
private String pickingId;
/**
* 料号
*/
private String materialCode;
/**
* 库别
*/
private String warehouse;
/**
* 需求数量
*/
private int reqQty;
/**
* 需求卷数
*/
private int reqReel;
/**
* 传承数量
*/
private int cpQty;
/**
* 传承卷数
*/
private int cpReel;
/**
* 已发数量
*/
private int issuedQty;
/**
* 已发卷数
*/
private int issuedReel;
/**
* 退回数量
*/
private int retQty;
/**
* 面别
*/
private String face;
/**
* 批次
*/
private String batchCode;
/**
* 制造商
*/
private String brand;
/**
* 创建日期
*/
private String createAt;
/**
* 更新日期
*/
private String updateAt;
private String mo;
private String binCode;
public static GetPickingItemsDto convertGetPickingItemsResultDto(GetPickingItemsResult result){
GetPickingItemsDto getPickingItemsResultDto = new GetPickingItemsDto();
getPickingItemsResultDto.setPlantCode(result.getPLANT_CODE());
getPickingItemsResultDto.setItemId(result.getITEM_ID());
getPickingItemsResultDto.setPickingId(result.getPICKING_ID());
getPickingItemsResultDto.setMaterialCode(result.getMATERIAL_CODE());
getPickingItemsResultDto.setWarehouse(result.getWAREHOUSE());
getPickingItemsResultDto.setReqQty(result.getREQ_QTY());
getPickingItemsResultDto.setReqReel(result.getREQ_REEL());
getPickingItemsResultDto.setCpQty(result.getCP_QTY());
getPickingItemsResultDto.setCpReel(result.getCP_REEL());
getPickingItemsResultDto.setIssuedQty(result.getISSUED_QTY());
getPickingItemsResultDto.setIssuedReel(result.getISSUED_REEL());
getPickingItemsResultDto.setRetQty(result.getRET_QTY());
getPickingItemsResultDto.setFace(result.getFACE());
getPickingItemsResultDto.setBatchCode(result.getBATCH_CODE());
getPickingItemsResultDto.setBrand(result.getBRAND());
getPickingItemsResultDto.setCreateAt(result.getCREATE_AT());
getPickingItemsResultDto.setUpdateAt(result.getUPDATE_AT());
getPickingItemsResultDto.setMo(result.getMO());
getPickingItemsResultDto.setBinCode(result.getBIN_CODE());
return getPickingItemsResultDto;
}
public static List<GetPickingItemsDto> convertGetPickingItemsResultDto(List<GetPickingItemsResult> resultList) {
List<GetPickingItemsDto> getPickingItemsResultDtolist=Lists.newArrayList();
for (GetPickingItemsResult getPickingItemsResult :resultList) {
getPickingItemsResultDtolist.add(convertGetPickingItemsResultDto(getPickingItemsResult));
}
return getPickingItemsResultDtolist;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryGrResult;
import com.neotel.smfcore.custom.luxsan.api.enums.QueryGrEnum;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class QueryGrDto {
/**
* 厂区
*/
private String plantCode;
/**
* 单据号
*/
private String grCode;
/**
* 单据行
*/
private String grItem;
/**
* 单据日期
*/
private String grDate;
/**
* 料号
*/
private String materialCode;
/**
* 厂商代码
*/
private String vendorCode;
/**
* 厂商名称
*/
private String vendorName;
/**
* 制造商
*/
private String brand;
/**
* 仓管员
*/
private String keeperCode;
/**
* 库别
*/
private String warehouseCode;
/**
* 批次
*/
private String batchCode;
/**
* 数量
*/
private int grQty;
/**
* 单据状态
*/
private String postStatus;
/**
* 异动日期
*/
private String postDate;
/**
* 原单据
*/
private String originGr;
/**
* 保税标识
*/
private String materialBonded;
/**
* A级物料
*/
private String materialControl;
public static QueryGrDto convert(QueryGrResult result){
QueryGrDto queryGrResultDto = new QueryGrDto();
queryGrResultDto.setPlantCode(result.getPLANT_CODE());
queryGrResultDto.setGrCode(result.getGR_CODE());
queryGrResultDto.setGrItem(result.getGR_ITEM());
queryGrResultDto.setGrDate(result.getGR_DATE());
queryGrResultDto.setMaterialCode(result.getMATERIAL_CODE());
queryGrResultDto.setVendorCode(result.getVENDOR_CODE());
queryGrResultDto.setVendorName(result.getVENDOR_NAME());
queryGrResultDto.setBrand(result.getBRAND());
queryGrResultDto.setKeeperCode(result.getKEEPER_CODE());
queryGrResultDto.setWarehouseCode(result.getWAREHOUSE_CODE());
queryGrResultDto.setBatchCode(result.getBATCH_CODE());
queryGrResultDto.setGrQty(result.getGR_QTY());
queryGrResultDto.setPostStatus(QueryGrEnum.getStatusName(result.getPOST_STATUS()));
queryGrResultDto.setPostDate(result.getPOST_DATE());
queryGrResultDto.setOriginGr(result.getORIGIN_GR());
queryGrResultDto.setMaterialBonded(result.getMATERIAL_BONDED());
queryGrResultDto.setMaterialControl(result.getMATERIAL_CONTROL());
return queryGrResultDto;
}
public static List<QueryGrDto> convert(List<QueryGrResult> queryGrResultList){
List<QueryGrDto> resultList = new ArrayList<>();
for (QueryGrResult queryGrResult : queryGrResultList) {
resultList.add(convert(queryGrResult));
}
return resultList;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryGrStatusResult;
import com.neotel.smfcore.custom.luxsan.api.enums.QueryGrStatusEnum;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class QueryGrStatusDto {
/**
* 厂区
*/
private String plantCode;
/**
* 单据号
*/
private String grCode;
/**
* 单据行
*/
private String grItem;
/**
* 单据日期
*/
private String grDate;
/**
* 料号
*/
private String materialCode;
/**
* 厂商代码
*/
private String vendorCode;
/**
* 厂商名称
*/
private String vendorName;
/**
* 状态
*/
private String status;
/**
* 供应商
*/
private String brand;
/**
* 仓管员
*/
private String keeperCode;
/**
* 库别
*/
private String warehouseCode;
/**
* 过账代码
*/
private String udCode;
/**
* 过账数量
*/
private String udQty;
/**
* 单据数量
*/
private String lotQty;
/**
* 过账时间
*/
private String postDate;
/**
* 批次
*/
private String batchCode;
/**
* 原单据
*/
private String originGr;
/**
* 保税标识
*/
private String materialBonded;
/**
* A级物料
*/
private String materialControl;
public static QueryGrStatusDto convertQueryGrStatusResultDto(QueryGrStatusResult result){
QueryGrStatusDto queryGrStatusResultDto = new QueryGrStatusDto();
queryGrStatusResultDto.setPlantCode(result.getPLANT_CODE());
queryGrStatusResultDto.setGrCode(result.getGR_CODE());
queryGrStatusResultDto.setGrItem(result.getGR_ITEM());
queryGrStatusResultDto.setGrDate(result.getGR_DATE());
queryGrStatusResultDto.setMaterialCode(result.getMATERIAL_CODE());
queryGrStatusResultDto.setVendorCode(result.getVENDOR_CODE());
queryGrStatusResultDto.setVendorName(result.getVENDOR_NAME());
queryGrStatusResultDto.setStatus(QueryGrStatusEnum.getStatusName(result.getSTATUS()));
queryGrStatusResultDto.setBrand(result.getBRAND());
queryGrStatusResultDto.setKeeperCode(result.getKEEPER_CODE());
queryGrStatusResultDto.setWarehouseCode(result.getWAREHOUSE_CODE());
queryGrStatusResultDto.setUdCode(result.getUD_CODE());
queryGrStatusResultDto.setUdQty(result.getUD_QTY());
queryGrStatusResultDto.setLotQty(result.getLOT_QTY());
queryGrStatusResultDto.setPostDate(result.getPOST_DATE());
queryGrStatusResultDto.setBatchCode(result.getBATCH_CODE());
queryGrStatusResultDto.setOriginGr(result.getORIGIN_GR());
queryGrStatusResultDto.setMaterialBonded(result.getMATERIAL_BONDED());
queryGrStatusResultDto.setMaterialControl(result.getMATERIAL_CONTROL());
return queryGrStatusResultDto;
}
public static List<QueryGrStatusDto> convertQueryGrStatusResultDto(List<QueryGrStatusResult> queryGrStatusResultList){
List<QueryGrStatusDto> resultList = new ArrayList<>();
for (QueryGrStatusResult queryGrStatusResult : queryGrStatusResultList) {
resultList.add(convertQueryGrStatusResultDto(queryGrStatusResult));
}
return resultList;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryPickingResult;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class QueryPickingDto {
// 厂区
private String plantCode;
// 挑料单号
private String pickingId;
// 线别
private String line;
// 状态
private String status;
// 原单号
private String orgPickingId;
// SMT料号
private String smtPn;
// 创建时间
private String createAt;
// 更新时间
private String updateAt;
// 更新工号
private String updateBy;
// 更新姓名
private String updateName;
private boolean checkOut = false;
public static QueryPickingDto convertQueryPickingResultDto(QueryPickingResult result){
QueryPickingDto queryPickingResultDto = new QueryPickingDto();
queryPickingResultDto.setPlantCode(result.getPLANT_CODE());
queryPickingResultDto.setPickingId(result.getPICKING_ID());
queryPickingResultDto.setLine(result.getLINE());
queryPickingResultDto.setStatus(result.getSTATUS() == 4 ? "关闭" : "其他:可发料");
queryPickingResultDto.setOrgPickingId(result.getORG_PICKING_ID());
queryPickingResultDto.setSmtPn(result.getSMT_PN());
queryPickingResultDto.setCreateAt(result.getCREATE_AT());
queryPickingResultDto.setUpdateAt(result.getUPDATE_AT());
queryPickingResultDto.setUpdateBy(result.getUPDATE_BY());
queryPickingResultDto.setUpdateName(result.getUPDATE_NAME());
queryPickingResultDto.setCheckOut(result.isCheckOut());
return queryPickingResultDto;
}
public static List<QueryPickingDto> convertQueryPickingResultDto(List<QueryPickingResult> result) {
List<QueryPickingDto> resultList = new ArrayList<>();
for (QueryPickingResult queryPickingResult : result) {
resultList.add(convertQueryPickingResultDto(queryPickingResult));
}
return resultList;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.controller;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.StringUtils;
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.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.BrandQtyRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.BrandQtyResult;
import com.neotel.smfcore.custom.luxsan.api.bean.request.QueryGrRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.QueryGrStatusRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryGrResult;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryGrStatusResult;
import com.neotel.smfcore.custom.luxsan.api.enums.QueryGrStatusEnum;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.BindGrInfo;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryGrDto;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryGrStatusDto;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CacheNameUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CommonUtil;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/grPutIn")
public class GrPutInController {
@Autowired
private CodeResolve codeResolve;
@Autowired
private DataCache dataCache;
@Autowired
private IComponentManager componentManager;
@ApiOperation("判断料串是否已经绑定Gr信息")
@RequestMapping("/alreadyBindGr")
@AnonymousAccess
public ResultBean alreadyBindGr(String materialStr) {
//判断GR有没有绑定成功
Map<String, BindGrInfo> cacheMap = dataCache.getCache(CacheNameUtil.CACHE_BIND_GR);
if (cacheMap != null) {
BindGrInfo bindGrInfo = cacheMap.get(materialStr);
if (bindGrInfo != null) {
return ResultBean.newErrorResult(-1, "", materialStr + "已经绑定Gr信息,单据号为:" + bindGrInfo.getGrCode() + ",单据行为:" + bindGrInfo.getGrItem());
}
}
return ResultBean.newOkResult("");
}
@ApiOperation("获取Gr列表")
@RequestMapping("/grList")
@AnonymousAccess
public ResultBean grList(@RequestBody Map<String, String> paramMap) {
//料串
String materialStr = paramMap.get("materialStr");
if (StringUtils.isEmpty(materialStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料串信息"});
}
//判断GR有没有绑定成功
Map<String, BindGrInfo> cacheMap = dataCache.getCache(CacheNameUtil.CACHE_BIND_GR);
if (cacheMap != null) {
BindGrInfo bindGrInfo = cacheMap.get(materialStr);
if (bindGrInfo != null) {
return ResultBean.newErrorResult(-1, "", materialStr + "已经绑定Gr信息,单据号为:" + bindGrInfo.getGrCode() + ",单据行为:" + bindGrInfo.getGrItem());
}
}
//物料
String codeStr = paramMap.get("codeStr");
if (StringUtils.isEmpty(codeStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"条码信息"});
}
//解析条码为barcode
Barcode barcode = codeResolve.resolveCode(codeStr);
if (barcode == null) {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.noValidCode", "条码无效");
}
//查询GR列表
QueryGrRequest request = new QueryGrRequest(CommonUtil.plantCode, barcode.getPartNumber(), barcode.getProvider());
List<QueryGrResult> queryGrResultList = LuxsanApi.queryGr(request);
return ResultBean.newOkResult(QueryGrDto.convert(queryGrResultList));
}
@ApiOperation("获取GR已过账的列表")
@RequestMapping("/grStatus")
@AnonymousAccess
public ResultBean grStatus(@RequestBody Map<String, String> paramMap) {
//料串
String materialStr = paramMap.get("materialStr");
if (StringUtils.isEmpty(materialStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料串信息"});
}
//判断GR有没有绑定成功
Map<String, BindGrInfo> cacheMap = dataCache.getCache(CacheNameUtil.CACHE_BIND_GR);
if (cacheMap != null) {
BindGrInfo bindGrInfo = cacheMap.get(materialStr);
if (bindGrInfo != null) {
return ResultBean.newErrorResult(-1, "", materialStr + "已经绑定Gr信息,单据号为:" + bindGrInfo.getGrCode() + ",单据行为:" + bindGrInfo.getGrItem());
}
}
//物料
String codeStr = paramMap.get("codeStr");
if (StringUtils.isEmpty(codeStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"条码信息"});
}
log.info("获取GR过账信息,料串为:"+materialStr+",物料为:"+codeStr);
//解析条码为barcode
Barcode barcode = codeResolve.resolveCode(codeStr);
if (barcode == null) {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.noValidCode", "条码无效");
}
QueryGrStatusRequest request = new QueryGrStatusRequest(CommonUtil.plantCode, barcode.getProvider(), barcode.getPartNumber(),"","");
List<QueryGrStatusResult> queryGrStatusList = LuxsanApi.queryGrStatus(request);
return ResultBean.newOkResult(QueryGrStatusDto.convertQueryGrStatusResultDto(queryGrStatusList));
}
@ApiOperation("绑定GR信息")
@RequestMapping("/bindGr")
@AnonymousAccess
public synchronized ResultBean bindGr(@RequestBody BindGrInfo info) {
String materialStr = info.getMaterialStr();
if (StringUtils.isEmpty(materialStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料串信息"});
}
//判断是不是已过账状态
log.info(info.getGrCode()+"状态为:"+info.getStatus());
if (!info.getStatus().equalsIgnoreCase(QueryGrStatusEnum.getStatusName(QueryGrStatusEnum.postIn))) {
if (!info.getStatus().equalsIgnoreCase(QueryGrStatusEnum.getStatusName(QueryGrStatusEnum.lackBin))) {
return ResultBean.newErrorResult(-1, "", info.getUdCode() + "不是已过账/待上架或者未分配无库存状态,不允许绑定");
}
}
//判断GR有没有绑定成功
Map<String, BindGrInfo> cacheMap = dataCache.getCache(CacheNameUtil.CACHE_BIND_GR);
if (cacheMap != null) {
BindGrInfo bindGrInfo = cacheMap.get(materialStr);
if (bindGrInfo != null) {
return ResultBean.newErrorResult(-1, "", materialStr + "已经绑定Gr信息,单据号为:" + bindGrInfo.getGrCode() + ",单据行为:" + bindGrInfo.getGrItem());
}
} else {
cacheMap = new HashMap<>();
}
//
Component component = componentManager.findByPartNumberAndProvider(info.getMaterialCode(), info.getBrand());
if (component == null) {
BrandQtyResult result = LuxsanApi.brandQtyUrl(new BrandQtyRequest(info.getMaterialCode(), info.getBrand()));
if (result == null) {
return ResultBean.newErrorResult(-1, "", "未找到对应的尺寸信息");
}
int reelSize = result.getReel_size();
int h = 0;
if (reelSize == 7) {
h = 8;
} else if (reelSize == 13) {
h = 24;
} else if (reelSize == 15) {
h = 32;
}
info.setW(reelSize);
info.setH(h);
} else {
info.setW(component.getPlateSize());
info.setH(component.getHeight());
}
cacheMap.put(materialStr, info);
dataCache.updateCache(CacheNameUtil.CACHE_BIND_GR, cacheMap);
return ResultBean.newOkResult("");
}
@ApiOperation("GR与料串绑定信息")
@RequestMapping("/bindGrInfo")
@AnonymousAccess
public synchronized ResultBean bindGrInfo() {
Map<String, BindGrInfo> cacheMap = dataCache.getCache(CacheNameUtil.CACHE_BIND_GR);
if (cacheMap != null){
return ResultBean.newOkResult(cacheMap.values());
}
return ResultBean.newOkResult(new ArrayList<>());
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.controller;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CacheNameUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.concurrent.ConcurrentHashMap;
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.Map;
@Api(tags = "手动入库")
@Slf4j
@RestController
@RequestMapping("/manual")
public class ManualPutInController {
@Autowired
private DataCache dataCache;
@ApiOperation("手动入库")
@RequestMapping("/putIn")
@AnonymousAccess
public ResultBean putIn(@RequestBody Map<String, String> paramMap) {
String materialStr = paramMap.get("materialStr");
String warehouseCode = paramMap.get("warehouseCode");
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_MANUAL_PUTIN);
if (cacheMap == null) {
cacheMap = new ConcurrentHashMap<>();
}
if (cacheMap.containsKey(materialStr)) {
return ResultBean.newErrorResult(-1, "", materialStr + "已经在手动入库列表中");
}
cacheMap.put(materialStr, warehouseCode);
dataCache.updateCache(CacheNameUtil.CHCHE_MANUAL_PUTIN, cacheMap);
return ResultBean.newOkResult("");
}
@ApiOperation("手动入库信息")
@RequestMapping("/putInInfo")
@AnonymousAccess
public ResultBean ticketReturnMaterialInfo() {
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_MANUAL_PUTIN);
if (cacheMap == null) {
cacheMap = new ConcurrentHashMap<>();
}
return ResultBean.newOkResult(cacheMap);
}
@ApiOperation("手动入库信息移除")
@RequestMapping("/removePutInInfo")
@AnonymousAccess
public ResultBean removePutInInfo(String materialStr) {
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_MANUAL_PUTIN);
if (cacheMap == null) {
cacheMap = new ConcurrentHashMap<>();
}
cacheMap.remove(materialStr);
return ResultBean.newOkResult("");
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.controller;
import cn.hutool.core.date.DateUtil;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE;
import com.neotel.smfcore.core.order.rest.bean.mapstruct.OrderMapper;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager;
import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.order.service.po.LiteOrderItem;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.GetPickingItemsRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.QueryPickingRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.result.GetPickingItemsResult;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryPickingResult;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.GetPickingItemsDto;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryPickingDto;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.LiteorderCheckType;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.CheckOutUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CommonUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
@RestController
@RequestMapping("/pkCheckOut")
public class PkCheckOutController {
@Autowired
private LiteOrderCache liteOrderCache;
@Autowired
private ILiteOrderManager liteOrderManager;
@Autowired
private OrderMapper orderMapper;
@ApiOperation("出库目的地")
@RequestMapping("/checkLoc")
@AnonymousAccess
public ResultBean checkOutLoc() {
Map<String, String> resultMap = new HashMap<>();
resultMap.put(CheckOutUtil.loc_1F,CheckOutUtil.loc_1F);
resultMap.put(CheckOutUtil.loc_C2,CheckOutUtil.loc_C2);
resultMap.put(CheckOutUtil.loc_3F,CheckOutUtil.loc_3F);
return ResultBean.newOkResult(resultMap);
}
@ApiOperation("查询pk列表")
@RequestMapping("/queryPicking")
@AnonymousAccess
public ResultBean queryPicking() {
List<QueryPickingResult> pickingResultList = LuxsanApi.queryPicking(new QueryPickingRequest(CommonUtil.plantCode));
/*for (QueryPickingResult queryPickingResult : pickingResultList) {
String pickingId = queryPickingResult.getPICKING_ID();
LiteOrder liteOrder = liteOrderCache.getLiteOrder(pickingId);
if (liteOrder == null) {
liteOrder = liteOrderManager.findByOrderNo(pickingId);
}
if (liteOrder != null && !liteOrder.isNew()){
queryPickingResult.setCheckOut(true);
}
}*/
return ResultBean.newOkResult(QueryPickingDto.convertQueryPickingResultDto(pickingResultList));
}
@ApiOperation("查询pk详情")
@RequestMapping("/getPickingItems")
@AnonymousAccess
public ResultBean getPickingItems(@RequestParam("pickingId") String pickingId) {
if (StringUtils.isEmpty(pickingId)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"pickingId"});
}
List<GetPickingItemsResult> pickingItems = LuxsanApi.getPickingItems(new GetPickingItemsRequest(CommonUtil.plantCode, pickingId));
return ResultBean.newOkResult(GetPickingItemsDto.convertGetPickingItemsResultDto(pickingItems));
}
@ApiOperation("pk出库")
@RequestMapping("/checkOut")
//@AnonymousAccess
public ResultBean checkOut(@RequestParam("pickingId") String pickingId,
@RequestParam("confirmExcess") boolean confirmExcess,
@RequestParam("loc") String loc) {
List<QueryPickingResult> resultList = LuxsanApi.queryPicking(new QueryPickingRequest(CommonUtil.plantCode));
for (QueryPickingResult result : resultList) {
if (result.getPICKING_ID().equals(pickingId)){
if (result.getSTATUS() == 4) {
return ResultBean.newErrorResult(-1, "", pickingId + "已经关闭,不允许发料");
}
}
}
//1.判断是否存在
LiteOrder liteOrder = liteOrderCache.getLiteOrder(pickingId);
if (liteOrder == null) {
liteOrder = liteOrderManager.findByOrderNo(pickingId);
}
if (liteOrder != null) {
if (!liteOrder.isTaskFinished() && !liteOrder.isNew()) {
return ResultBean.newErrorResult(-1, "", pickingId + "正在执行中,不允许出库");
}
//2.如果存在,改个名字
liteOrder.setOrderNo(liteOrder.getOrderNo() + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
liteOrderManager.createWithItems(liteOrder);
}
//3.获取pk详情
GetPickingItemsRequest request = new GetPickingItemsRequest(CommonUtil.plantCode, pickingId);
List<GetPickingItemsResult> pickingItemList = LuxsanApi.getPickingItems(request);
//4.循环新建工单
List<LiteOrderItem> itemList = new ArrayList<>();
for (GetPickingItemsResult pkItem : pickingItemList) {
LiteOrderItem item = new LiteOrderItem();
item.setPlantCode(pkItem.getPLANT_CODE());
item.setItemId(pkItem.getITEM_ID());
item.setPickingId(pkItem.getPICKING_ID());
item.setMaterialCode(pkItem.getMATERIAL_CODE());
item.setPn(pkItem.getMATERIAL_CODE());
item.setWarehouse(pkItem.getWAREHOUSE());
item.setWarehouseCode(pkItem.getWAREHOUSE());
item.setReqQty(pkItem.getREQ_QTY());
item.setReqReel(pkItem.getREQ_REEL());
item.setCpQty(pkItem.getCP_QTY());
item.setCpReel(pkItem.getCP_REEL());
item.setIssuedQty(pkItem.getISSUED_QTY());
item.setIssuedReel(pkItem.getISSUED_REEL());
item.setRetQty(pkItem.getRET_QTY());
item.setFace(pkItem.getFACE());
item.setBatchCode(pkItem.getBATCH_CODE());
item.setBrand(pkItem.getBRAND());
item.setCreateAt(pkItem.getCREATE_AT());
item.setUpdateAt(pkItem.getUPDATE_AT());
item.setMo(pkItem.getMO());
item.setBinCode(pkItem.getBIN_CODE());
//需要发料的数量
int needNum = pkItem.getREQ_QTY() - pkItem.getCP_QTY() - pkItem.getISSUED_QTY() + pkItem.getRET_QTY();
item.setNeedNum(needNum);
//需要发料的卷数
int needReelCount = pkItem.getREQ_REEL() - pkItem.getCP_REEL() + (pkItem.getRET_QTY() > 0 ? pkItem.getRET_QTY() : 0);
item.setNeedReelCount(needReelCount);
itemList.add(item);
}
//5.创建工单
LiteOrder newOrder = new LiteOrder();
newOrder.setOrderNo(pickingId);
newOrder.setSource(LITEORDER_SOURCE.OUTTER.name());
newOrder.setConfirmExcess(confirmExcess);
newOrder.setOrderItems(itemList);
newOrder.setLoc(loc);
newOrder.setCheckType(LiteorderCheckType.PICKING_CHECKOUT);
newOrder = liteOrderManager.createWithItems(newOrder);
liteOrderCache.addOrderToMap(newOrder);
//6.执行工单出库
String result = liteOrderCache.checkOutLiteOrderOut(pickingId, false, null);
if (StringUtils.isNotEmpty(result)){
return ResultBean.newErrorResult(-1,"", MessageUtils.getText(result,new Locale(SecurityUtils.getCurrentUserLanguage()),result));
}
return ResultBean.newOkResult("");
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.controller;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CacheNameUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.concurrent.ConcurrentHashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
@Api(tags = "W2 1F储位移转")
@Slf4j
@RequestMapping("/storTransfer")
@RestController
public class StorTransferController {
@Autowired
private DataCache dataCache;
@ApiOperation("刷料串,进行转移")
@RequestMapping("/inputMaterial")
@AnonymousAccess
public ResultBean inputMaterial(String materialStr, String warehouseCode) {
if (StringUtils.isEmpty(materialStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料串信息"});
}
if (StringUtils.isEmpty(warehouseCode)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"库别信息"});
}
log.info(materialStr + "进行储位转移,库别为:" + warehouseCode);
//1.判断料仓信息是否在储位转移中
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_STOR_TRANSFER);
if (cacheMap == null) {
cacheMap = new ConcurrentHashMap<>();
}
if (cacheMap.get(materialStr) != null) {
return ResultBean.newErrorResult(-1, "", materialStr + "已经在储位转移列表中");
}
cacheMap.put(materialStr, warehouseCode);
dataCache.updateCache(CacheNameUtil.CHCHE_STOR_TRANSFER, cacheMap);
return ResultBean.newOkResult("");
}
@ApiOperation("储位转移信息")
@RequestMapping("/transferInfo")
@AnonymousAccess
public ResultBean transferInfo() {
//1.判断料仓信息是否在储位转移中
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_STOR_TRANSFER);
if (cacheMap == null){
cacheMap = new ConcurrentHashMap<>();
}
return ResultBean.newOkResult(cacheMap);
}
@ApiOperation("移除料串信息")
@RequestMapping("/removeMaterial")
@AnonymousAccess
public ResultBean removeMaterial(String materialStr) {
//1.判断料仓信息是否在储位转移中
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_STOR_TRANSFER);
if (cacheMap == null){
cacheMap = new ConcurrentHashMap<>();
}
cacheMap.remove(materialStr);
return ResultBean.newOkResult(cacheMap);
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.controller;
import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.FetchMoveTicketRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.result.FetchMoveTicketResult;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.TicketReturn;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.FetchMoveTicketDto;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CacheNameUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CommonUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.concurrent.ConcurrentHashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
@Api(tags = "931单据领料和932单据退料")
@Slf4j
@RestController
@RequestMapping("/ticket")
public class TicketController {
@Autowired
private DataCache dataCache;
@ApiOperation("拉取单据信息")
@RequestMapping("/fetchTicket")
@AnonymousAccess
public ResultBean fetchTicket(String ticket) {
List<FetchMoveTicketResult> ticketList = LuxsanApi.fetchMoveTicket(new FetchMoveTicketRequest(CommonUtil.plantCode, ticket));
return ResultBean.newOkResult(FetchMoveTicketDto.convertFetchMoveTicketDto(ticketList));
}
@ApiOperation("单据领料")
@RequestMapping("/checkOut")
@AnonymousAccess
public ResultBean checkOut(String ticket) {
return ResultBean.newOkResult("");
}
@ApiOperation("单据退料")
@RequestMapping("/ticketReturn")
@AnonymousAccess
public ResultBean ticketReturn(@RequestBody Map<String,String> paramMap) {
String ticket = paramMap.get("ticket");
String materialStr = paramMap.get("materialList");
String ticketItem = paramMap.get("ticketItem");
String warehouseCode = paramMap.get("warehouseCode");
Map<String, TicketReturn> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_TICKET_RETURN);
if (cacheMap == null) {
cacheMap = new ConcurrentHashMap<>();
}
List<String> materialList = JSONObject.parseArray(materialStr, String.class);
for (String material : materialList) {
if (cacheMap.containsKey(material)) {
return ResultBean.newErrorResult(-1, "", materialStr + "已经绑定单据:" + cacheMap.get(materialStr));
}
}
for (String material : materialList) {
cacheMap.put(material, new TicketReturn(material,ticket,ticketItem,warehouseCode));
}
dataCache.updateCache(CacheNameUtil.CHCHE_TICKET_RETURN, cacheMap);
return ResultBean.newOkResult("");
}
@ApiOperation("单据退料料串绑定信息")
@RequestMapping("/ticketReturnMaterialInfo")
@AnonymousAccess
public ResultBean ticketReturnMaterialInfo() {
Map<String, TicketReturn> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_TICKET_RETURN);
if (cacheMap == null) {
cacheMap = new ConcurrentHashMap<>();
}
return ResultBean.newOkResult(cacheMap.values());
}
@ApiOperation("单据退料移除料串绑定信息")
@RequestMapping("/ticketReturnRemoveMaterialInfo")
@AnonymousAccess
public ResultBean ticketReturnRemoveMaterialInfo(String materialStr) {
Map<String, TicketReturn> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_TICKET_RETURN);
if (cacheMap == null) {
cacheMap = new ConcurrentHashMap<>();
}
cacheMap.remove(materialStr);
return ResultBean.newOkResult("");
}
@ApiOperation("单据转库")
@RequestMapping("/ticketTransfer")
@AnonymousAccess
public ResultBean ticketTransfer(@RequestBody Map<String, String> paramMap) {
String ticketCode = paramMap.get("ticketCode");
String ticketItem = paramMap.get("ticketItem");
String materialStr = paramMap.get("materialList");
String warehouseCode = paramMap.get("warehouseCode");
log.info("收到单据号:"+ticketCode+",单据行:"+ticketItem+",料串信息为:"+materialStr+",库别为:"+warehouseCode);
List<String> materialList = JSONObject.parseArray(materialStr, String.class);
return ResultBean.newOkResult("");
}
@ApiOperation("单据转库返回结果")
@RequestMapping("/ticketTransferResult")
@AnonymousAccess
public PageData ticketTransferResult(Pageable pageable) {
PageData pageData = new PageData();
List<Map<String,Object>> content = new ArrayList<>();
for (int i = 0; i < 50; i++) {
Map<String,Object> map = new HashMap<>();
map.put("material","123");
map.put("ticketCode","ticketCode");
map.put("ticketItem","ticketItem");
map.put("binCode","binCode");
map.put("result","123");
map.put("warehouseCode","warehouseCode"+i);
content.add(map);
}
pageData.setContent(content);
pageData.setTotalElements(100);
return pageData;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums;
public class LiteorderCheckType {
public static final int PICKING_CHECKOUT = 1;
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.QueryBinRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.UpdateBinRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryBinResult;
import com.neotel.smfcore.custom.luxsan.api.enums.BinEnum;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CacheNameUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class BinCacheUtil {
private static DataCache dataCache;
private static long binCodeUpdateTime = 0l;
@Autowired
private void setDataCache(DataCache cache){
BinCacheUtil.dataCache = cache;
}
public static boolean canPutInBinCode(String binCode, String warehouseCode) {
Map<String, String> cacheMap = new HashMap<>();
if (binCodeUpdateTime == 0l || (System.currentTimeMillis() - binCodeUpdateTime >= 1000 * 60 * 60)) {
List<QueryBinResult> resultList = LuxsanApi.queryBin(new QueryBinRequest(CommonUtil.plantCode, BinEnum.STORAGE_TYPE_C, BinEnum.BIN_STATUS_0, warehouseCode));
for (QueryBinResult result : resultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
}
List<QueryBinResult> useBinResultList = LuxsanApi.queryBin(new QueryBinRequest(CommonUtil.plantCode, BinEnum.STORAGE_TYPE_C, BinEnum.BIN_STATUS_1, warehouseCode));
for (QueryBinResult result : useBinResultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
}
binCodeUpdateTime = System.currentTimeMillis();
dataCache.updateCache(CacheNameUtil.CHCHE_QUERY_BIN, cacheMap);
} else {
cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_QUERY_BIN);
}
//判断code是否相同
String code = cacheMap.get(binCode);
if (StringUtils.isNotEmpty(code)) {
if (code.equals(warehouseCode)) {
//binCodeUpdateTime = System.currentTimeMillis();
return true;
} else {
LuxsanApi.updateBin(new UpdateBinRequest(CommonUtil.plantCode, binCode, warehouseCode, BinEnum.STORAGE_TYPE_C));
cacheMap.put(binCode, warehouseCode);
dataCache.updateCache(CacheNameUtil.CHCHE_QUERY_BIN, cacheMap);
binCodeUpdateTime = System.currentTimeMillis();
return true;
}
}
return false;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.util.DataCache;
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.StoragePos;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
public class BoxHandleUtil {
private static IBarcodeManager barcodeManager;
@Autowired
public void setBarcodeManager(IBarcodeManager manager) {
BoxHandleUtil.barcodeManager = manager;
}
private static IStoragePosManager storagePosManager;
@Autowired
public void setStoragePosManager(IStoragePosManager manager) {
BoxHandleUtil.storagePosManager = manager;
}
private static DataCache dataCache;
@Autowired
public void setDataCache(DataCache cache) {
BoxHandleUtil.dataCache = cache;
}
private static TaskService taskService;
@Autowired
public void setTaskService(TaskService service) {
BoxHandleUtil.taskService = service;
}
public static void intoPos(DataLog opTask) {
//已完成,加入库存,并且从完成队列中清除
StoragePos storagePos = storagePosManager.get(opTask.getPosId());
//二维码状态
Barcode barcode = barcodeManager.findByBarcode(opTask.getBarcode());
if (barcode != null) {
barcode.setUsedCount(barcode.getUsedCount() + 1);
barcode.setPutInTime(System.currentTimeMillis());
barcode.setInOpor("");
barcode.setCheckOutDate(null, "");
barcode.setPosName(opTask.getPosName());
barcode = barcodeManager.save(barcode);
}
storagePos.setBarcode(barcode);
storagePos.setUsed(true);
storagePos.setCanCheckOutTime(System.currentTimeMillis());
storagePosManager.save(storagePos);
taskService.moveTaskToFinished(opTask);
taskService.updateFinishedTask(opTask);
}
public static void outFromPos(DataLog opTask) {
//从队列里面移除操作
taskService.removeQueueTask(opTask);
StoragePos storagePos = storagePosManager.get(opTask.getPosId());
Barcode barcode = storagePos.getBarcode();
if (barcode == null) {
log.warn("任务:" + opTask.getId() + " 仓位:" + opTask.getPosId() + " 的 Barcode 为null, 之前可能处理过,结束任务后直接返回");
return;
}
barcode = barcodeManager.get(barcode.getId());
if (barcode != null) {
//二维码状态
barcode.setUsed(true);
barcode.setUsedDate(new Date());
//仓位状态
barcode.setCheckOutDate(new Date(), "");
barcode.setPosName("");
barcodeManager.save(barcode);
}
storagePos.setBarcode(null);
storagePos.setUsed(false);
storagePosManager.save(storagePos);
log.info("出库完成,清空仓位: " + storagePos.getId() + "[" + storagePos.getPosName() + "]");
taskService.moveTaskToFinished(opTask);
}
public static String getBoxStr(String code) {
if (code.endsWith("A") || code.endsWith("B")) {
code = code.substring(0, code.length() - 1);
code = code + "A";
}
if (code.contains("-")) {
code = code.substring(0, code.indexOf("-"));
code = code + "A";
}
return code;
}
}
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util;
public class CheckOutUtil {
public static final String loc_C2 = "C2/3F/BG";
public static final String loc_3F = "C2/3F/CG";
public static final String loc_1F = "W2/1F";
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!