1. 更新数据类型重量: int => double
2. 更新数据类型规格: int => String 3. 修复bug: OrderInCheckor打印日志错误的问题
This commit is contained in:
parent
ec6487d87e
commit
e7436bcf46
482
db/wms_ntyc.sql
482
db/wms_ntyc.sql
File diff suppressed because it is too large
Load Diff
|
|
@ -67,5 +67,5 @@ public class GoodsExcelTemplate {
|
||||||
* SLED时间(天)
|
* SLED时间(天)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "SLED时间(天)")
|
@Excel(name = "SLED时间(天)")
|
||||||
private Integer sledDays;
|
private String sledDays;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,10 @@ public class ErpGoodsDetail {
|
||||||
private String goodsName;
|
private String goodsName;
|
||||||
private String batch;
|
private String batch;
|
||||||
private String goodsType;
|
private String goodsType;
|
||||||
private Integer specification;
|
private String specification;
|
||||||
private BigDecimal quantity;
|
private Double quantity;
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
private String goodsBarcode;
|
||||||
private String xsfbillno;
|
private String xsfbillno;
|
||||||
private String xsfseq;
|
private String xsfseq;
|
||||||
private String neibubianhao;
|
private String neibubianhao;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class MesDetailTaskInfo {
|
||||||
* 线圈数量
|
* 线圈数量
|
||||||
*/
|
*/
|
||||||
@JsonProperty("quantity")
|
@JsonProperty("quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
/**
|
/**
|
||||||
* 重量
|
* 重量
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public class GoodsInfoForTask {
|
||||||
* 操作数量
|
* 操作数量
|
||||||
*/
|
*/
|
||||||
@JsonProperty("opNum")
|
@JsonProperty("opNum")
|
||||||
private Integer opNum;
|
private Double opNum;
|
||||||
/**
|
/**
|
||||||
* 生产日期
|
* 生产日期
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ public class OrderInGoodsDetail {
|
||||||
private String goodsType;
|
private String goodsType;
|
||||||
|
|
||||||
@JsonProperty("specification")
|
@JsonProperty("specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
@JsonProperty("quantity")
|
@JsonProperty("quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
|
|
||||||
@JsonProperty("goodsDesc")
|
@JsonProperty("goodsDesc")
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ public class OrderOutRequest {
|
||||||
private String batch;
|
private String batch;
|
||||||
|
|
||||||
@JsonProperty("specification")
|
@JsonProperty("specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
@JsonProperty("quantity")
|
@JsonProperty("quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,16 @@ public class OrderInGoodsDetail {
|
||||||
private String goodsType;
|
private String goodsType;
|
||||||
|
|
||||||
@JsonProperty("specification")
|
@JsonProperty("specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
@JsonProperty("quantity")
|
@JsonProperty("quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
|
|
||||||
@JsonProperty("goodsDesc")
|
@JsonProperty("goodsDesc")
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
|
||||||
|
@JsonProperty("goodsBarcode")
|
||||||
|
private String goodsBarcode;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@ public class OrderOutReq {
|
||||||
private String batch;
|
private String batch;
|
||||||
|
|
||||||
@JsonProperty("specification")
|
@JsonProperty("specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
@JsonProperty("quantity")
|
@JsonProperty("quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public class StockReq {
|
||||||
private String goodsId;
|
private String goodsId;
|
||||||
|
|
||||||
@JsonProperty("specification")
|
@JsonProperty("specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
|
|
||||||
public boolean empty() {
|
public boolean empty() {
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ public class StockRespGoodsDetail {
|
||||||
private String goodsType;
|
private String goodsType;
|
||||||
|
|
||||||
@JsonProperty("specification")
|
@JsonProperty("specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
@JsonProperty("quantity")
|
@JsonProperty("quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
|
|
||||||
@JsonProperty("goodsDesc")
|
@JsonProperty("goodsDesc")
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public class TAppGoods extends BaseImportEntity {
|
||||||
* SLED天数
|
* SLED天数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "sled_days")
|
@TableField(value = "sled_days")
|
||||||
private Integer sledDays;
|
private String sledDays;
|
||||||
/**
|
/**
|
||||||
* 补料方式
|
* 补料方式
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,10 @@ public class TAppOrderIn {
|
||||||
private String goodsType;
|
private String goodsType;
|
||||||
|
|
||||||
@TableField(value = "specification")
|
@TableField(value = "specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
@TableField(value = "quantity")
|
@TableField(value = "quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
|
|
||||||
@TableField(value = "goods_desc")
|
@TableField(value = "goods_desc")
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@ public class TAppOrderOut {
|
||||||
private String batch;
|
private String batch;
|
||||||
|
|
||||||
@TableField(value = "specification")
|
@TableField(value = "specification")
|
||||||
private Integer specification;
|
private String specification;
|
||||||
|
|
||||||
@TableField(value = "quantity")
|
@TableField(value = "quantity")
|
||||||
private Integer quantity;
|
private Double quantity;
|
||||||
|
|
||||||
@TableField(value = "order_status")
|
@TableField(value = "order_status")
|
||||||
private Integer orderStatus;
|
private Integer orderStatus;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class TAppPickPlan {
|
||||||
* 计划拣选数量
|
* 计划拣选数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "plan_pick_qty")
|
@TableField(value = "plan_pick_qty")
|
||||||
private Integer planPickQty;
|
private Double planPickQty;
|
||||||
/**
|
/**
|
||||||
* 拣选类型
|
* 拣选类型
|
||||||
* 1. 工作拣选
|
* 1. 工作拣选
|
||||||
|
|
|
||||||
|
|
@ -73,17 +73,17 @@ public class TAppStock {
|
||||||
* 入库总量
|
* 入库总量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "total_num")
|
@TableField(value = "total_num")
|
||||||
private Integer totalNum;
|
private Double totalNum;
|
||||||
/**
|
/**
|
||||||
* 剩余数量
|
* 剩余数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "remain_num")
|
@TableField(value = "remain_num")
|
||||||
private Integer remainNum;
|
private Double remainNum;
|
||||||
/**
|
/**
|
||||||
* 实际数量
|
* 实际数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "real_num")
|
@TableField(value = "real_num")
|
||||||
private Integer realNum;
|
private Double realNum;
|
||||||
/**
|
/**
|
||||||
* 物料描述
|
* 物料描述
|
||||||
*/
|
*/
|
||||||
|
|
@ -98,7 +98,7 @@ public class TAppStock {
|
||||||
* sled 天数
|
* sled 天数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "sled")
|
@TableField(value = "sled")
|
||||||
private Integer sled;
|
private String sled;
|
||||||
/**
|
/**
|
||||||
* 条码
|
* 条码
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,12 @@ public class TAppStockUpdate {
|
||||||
* 原数量
|
* 原数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "before_num")
|
@TableField(value = "before_num")
|
||||||
private Integer beforeNum;
|
private Double beforeNum;
|
||||||
/**
|
/**
|
||||||
* 新数量
|
* 新数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "after_num")
|
@TableField(value = "after_num")
|
||||||
private Integer afterNum;
|
private Double afterNum;
|
||||||
/**
|
/**
|
||||||
* 更新理由
|
* 更新理由
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -77,12 +77,12 @@ public class TAppTask {
|
||||||
* 操作数量
|
* 操作数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "op_num")
|
@TableField(value = "op_num")
|
||||||
private Integer opNum;
|
private Double opNum;
|
||||||
/**
|
/**
|
||||||
* 库存数量
|
* 库存数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "stock_num")
|
@TableField(value = "stock_num")
|
||||||
private Integer stockNum;
|
private Double stockNum;
|
||||||
/**
|
/**
|
||||||
* 操纵用户
|
* 操纵用户
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -77,12 +77,12 @@ public class TAppTaskBak {
|
||||||
* 操作数量
|
* 操作数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "op_num")
|
@TableField(value = "op_num")
|
||||||
private Integer opNum;
|
private Double opNum;
|
||||||
/**
|
/**
|
||||||
* 库存数量
|
* 库存数量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "stock_num")
|
@TableField(value = "stock_num")
|
||||||
private Integer stockNum;
|
private Double stockNum;
|
||||||
/**
|
/**
|
||||||
* 操纵用户
|
* 操纵用户
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -57,17 +57,17 @@ public class StockVo {
|
||||||
* 入库总数
|
* 入库总数
|
||||||
*/
|
*/
|
||||||
@JsonProperty("totalNum")
|
@JsonProperty("totalNum")
|
||||||
private Integer totalNum;
|
private Double totalNum;
|
||||||
/**
|
/**
|
||||||
* 实际剩余数量
|
* 实际剩余数量
|
||||||
*/
|
*/
|
||||||
@JsonProperty("realNum")
|
@JsonProperty("realNum")
|
||||||
private Integer realNum;
|
private Double realNum;
|
||||||
/**
|
/**
|
||||||
* 剩余数量
|
* 剩余数量
|
||||||
*/
|
*/
|
||||||
@JsonProperty("remainNum")
|
@JsonProperty("remainNum")
|
||||||
private Integer remainNum;
|
private Double remainNum;
|
||||||
/**
|
/**
|
||||||
* 有效期
|
* 有效期
|
||||||
*/
|
*/
|
||||||
|
|
@ -79,7 +79,7 @@ public class StockVo {
|
||||||
* sled
|
* sled
|
||||||
*/
|
*/
|
||||||
@JsonProperty("sled")
|
@JsonProperty("sled")
|
||||||
private Integer sled;
|
private String sled;
|
||||||
/**
|
/**
|
||||||
* 初次入库时间
|
* 初次入库时间
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import com.wms_main.model.bo.erp.ErpVehicleNoResp;
|
||||||
import com.wms_main.model.bo.ycwms.YCWmsApiResponse;
|
import com.wms_main.model.bo.ycwms.YCWmsApiResponse;
|
||||||
import com.wms_main.model.dto.request.ycwms.OrderInCBReq;
|
import com.wms_main.model.dto.request.ycwms.OrderInCBReq;
|
||||||
import com.wms_main.model.dto.request.ycwms.OrderOutCBReq;
|
import com.wms_main.model.dto.request.ycwms.OrderOutCBReq;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
|
||||||
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
||||||
|
|
||||||
public interface IExternalApiService {
|
public interface IExternalApiService {
|
||||||
|
|
|
||||||
|
|
@ -68,12 +68,13 @@ public class ExternalApiServiceImpl implements IExternalApiService {
|
||||||
goodsDetail.setGoodsName((String) detail.get("goodsName"));
|
goodsDetail.setGoodsName((String) detail.get("goodsName"));
|
||||||
goodsDetail.setBatch((String) detail.get("batch"));
|
goodsDetail.setBatch((String) detail.get("batch"));
|
||||||
goodsDetail.setGoodsType((String) detail.get("goodsType"));
|
goodsDetail.setGoodsType((String) detail.get("goodsType"));
|
||||||
goodsDetail.setSpecification(Integer.parseInt(detail.get("specification").toString()));
|
goodsDetail.setSpecification((String) (detail.get("specification")));
|
||||||
goodsDetail.setQuantity(new java.math.BigDecimal(detail.get("quantity").toString()));
|
goodsDetail.setQuantity(Double.parseDouble(detail.get("quantity").toString()));
|
||||||
goodsDetail.setGoodsDesc((String) detail.get("goodsDesc"));
|
goodsDetail.setGoodsDesc((String) detail.get("goodsDesc"));
|
||||||
goodsDetail.setXsfbillno((String) detail.get("xsfbillno"));
|
goodsDetail.setXsfbillno((String) detail.get("xsfbillno"));
|
||||||
goodsDetail.setXsfseq((String) detail.get("xsfseq"));
|
goodsDetail.setXsfseq((String) detail.get("xsfseq"));
|
||||||
goodsDetail.setNeibubianhao((String) detail.get("neibubianhao"));
|
goodsDetail.setNeibubianhao((String) detail.get("neibubianhao"));
|
||||||
|
goodsDetail.setGoodsBarcode((String) detail.get("goodsBarcode"));
|
||||||
erpsGoodsDetails.add(goodsDetail);
|
erpsGoodsDetails.add(goodsDetail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,6 @@ public interface IStockDataService {
|
||||||
* @param goodsIds 物料列表
|
* @param goodsIds 物料列表
|
||||||
* @return 结果map
|
* @return 结果map
|
||||||
*/
|
*/
|
||||||
Map<String, Map<String, Integer>> getCanPutGoodsMap(List<String> goodsIds);
|
Map<String, Map<String, Double>> getCanPutGoodsMap(List<String> goodsIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -541,13 +541,13 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
.filter(stock -> Objects.equals(stock.getGoodsId(), thisVehicleInTask.getGoodsId()))
|
.filter(stock -> Objects.equals(stock.getGoodsId(), thisVehicleInTask.getGoodsId()))
|
||||||
.toList();
|
.toList();
|
||||||
TAppGoods thisGoods = appCommon.getInstantGoodsByGoodsId(thisVehicleInTask.getGoodsId());
|
TAppGoods thisGoods = appCommon.getInstantGoodsByGoodsId(thisVehicleInTask.getGoodsId());
|
||||||
Integer sledDays = null;// -1表示非有效期管理
|
String sledDays = null;// -1表示非有效期管理
|
||||||
LocalDate expireDate = null;// null表示非有效期管理
|
LocalDate expireDate = null;// null表示非有效期管理
|
||||||
if (thisGoods != null && Objects.equals(thisGoods.getPutArea(), "ASRS") && thisGoods.getIsSled().contains("Y")) {
|
if (thisGoods != null && Objects.equals(thisGoods.getPutArea(), "ASRS") && thisGoods.getIsSled().contains("Y")) {
|
||||||
// 有效期管理的物料
|
// 有效期管理的物料
|
||||||
if (thisGoods.getSledDays() != null) {
|
if (thisGoods.getSledDays() != null) {
|
||||||
sledDays = thisGoods.getSledDays();
|
sledDays = thisGoods.getSledDays();
|
||||||
expireDate = thisVehicleInTask.getCreateTime().plusDays(sledDays).toLocalDate();
|
expireDate = LocalDate.now();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (oldStockList.isEmpty()) {
|
if (oldStockList.isEmpty()) {
|
||||||
|
|
@ -578,11 +578,11 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
// 更新已有库存信息
|
// 更新已有库存信息
|
||||||
if (oldStockList.size() > 1) {
|
if (oldStockList.size() > 1) {
|
||||||
// 需要合并库存信息
|
// 需要合并库存信息
|
||||||
int originSum = oldStockList.stream()
|
Double originSum = oldStockList.stream()
|
||||||
.mapToInt(TAppStock::getRealNum)
|
.mapToDouble(TAppStock::getRealNum)
|
||||||
.sum();
|
.sum();
|
||||||
int originTotal = oldStockList.stream()
|
Double originTotal = oldStockList.stream()
|
||||||
.mapToInt(TAppStock::getTotalNum)
|
.mapToDouble(TAppStock::getTotalNum)
|
||||||
.sum();
|
.sum();
|
||||||
// 新库存,增加库存信息
|
// 新库存,增加库存信息
|
||||||
newStockList.add(new TAppStock(
|
newStockList.add(new TAppStock(
|
||||||
|
|
@ -729,17 +729,17 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
||||||
// 获取订单的商品属性
|
// 获取订单的商品属性
|
||||||
String goodsId = order.getGoodsId();
|
String goodsId = order.getGoodsId();
|
||||||
String batch = order.getBatch();
|
String batch = order.getBatch();
|
||||||
int specification = order.getSpecification();
|
String specification = order.getSpecification();
|
||||||
|
|
||||||
// 筛选匹配的库存并计算总数量
|
// 筛选匹配的库存并计算总数量
|
||||||
int totalQty = appStockService.list(new LambdaQueryWrapper<TAppStock>().eq(TAppStock::getVehicleId, vehicleId)).stream()
|
Double totalQty = appStockService.list(new LambdaQueryWrapper<TAppStock>().eq(TAppStock::getVehicleId, vehicleId)).stream()
|
||||||
.filter(stock ->
|
.filter(stock ->
|
||||||
goodsId.equals(stock.getGoodsId()) && batch.equals(stock.getBatch()) && specification == stock.getSled())
|
goodsId.equals(stock.getGoodsId()) && batch.equals(stock.getBatch()) && specification.equals(stock.getSled()))
|
||||||
.mapToInt(TAppStock::getTotalNum)
|
.mapToDouble(TAppStock::getTotalNum)
|
||||||
.sum();
|
.sum();
|
||||||
|
|
||||||
if (totalQty > 0) {
|
if (totalQty > 0) {
|
||||||
int newQuantity = order.getQuantity() - totalQty;
|
Double newQuantity = order.getQuantity() - totalQty;
|
||||||
// 更新订单数量
|
// 更新订单数量
|
||||||
appOrderOutService.update(
|
appOrderOutService.update(
|
||||||
new LambdaUpdateWrapper<TAppOrderOut>()
|
new LambdaUpdateWrapper<TAppOrderOut>()
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
// 库存更新记录列表
|
// 库存更新记录列表
|
||||||
List<TAppStockUpdate> stockUpdateList = new ArrayList<>();
|
List<TAppStockUpdate> stockUpdateList = new ArrayList<>();
|
||||||
// 剩余数量
|
// 剩余数量
|
||||||
int remainQty = stockConfirm.getPlanRemainQty();
|
Double remainQty = Double.valueOf(stockConfirm.getPlanRemainQty());
|
||||||
for (TAppStock stock : stockList) {
|
for (TAppStock stock : stockList) {
|
||||||
if (remainQty <= 0) {
|
if (remainQty <= 0) {
|
||||||
removeStocks.add(stock);
|
removeStocks.add(stock);
|
||||||
|
|
@ -78,7 +78,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
);
|
);
|
||||||
stockUpdateList.add(stockUpdate);
|
stockUpdateList.add(stockUpdate);
|
||||||
stock.setRealNum(remainQty);
|
stock.setRealNum(remainQty);
|
||||||
remainQty = 0;
|
remainQty = 0.0;
|
||||||
}
|
}
|
||||||
updateStocks.add(stock);
|
updateStocks.add(stock);
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +164,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
* @return 结果map
|
* @return 结果map
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Map<String, Integer>> getCanPutGoodsMap(List<String> goodsIds) {
|
public Map<String, Map<String, Double>> getCanPutGoodsMap(List<String> goodsIds) {
|
||||||
// 筛选出料号,查询库存
|
// 筛选出料号,查询库存
|
||||||
if (goodsIds == null || goodsIds.isEmpty()) {
|
if (goodsIds == null || goodsIds.isEmpty()) {
|
||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
|
|
@ -175,10 +175,10 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
.in(TAppStock::getGoodsId, distinctGoodsIds)
|
.in(TAppStock::getGoodsId, distinctGoodsIds)
|
||||||
.orderByAsc(TAppStock::getFirstInTime));
|
.orderByAsc(TAppStock::getFirstInTime));
|
||||||
// 根据载具号合并数量----因为这个项目默认一箱一料
|
// 根据载具号合并数量----因为这个项目默认一箱一料
|
||||||
Map<String, Map<String, Integer>> goodsQtyMap = new HashMap<>();
|
Map<String, Map<String, Double>> goodsQtyMap = new HashMap<>();
|
||||||
for (TAppStock stock : stocksOfThisGoodsIds) {
|
for (TAppStock stock : stocksOfThisGoodsIds) {
|
||||||
if (goodsQtyMap.containsKey(stock.getGoodsId())) {
|
if (goodsQtyMap.containsKey(stock.getGoodsId())) {
|
||||||
Map<String, Integer> qtyByVehicleMap = goodsQtyMap.get(stock.getGoodsId());
|
Map<String, Double> qtyByVehicleMap = goodsQtyMap.get(stock.getGoodsId());
|
||||||
if (qtyByVehicleMap.containsKey(stock.getVehicleId())) {
|
if (qtyByVehicleMap.containsKey(stock.getVehicleId())) {
|
||||||
qtyByVehicleMap.replace(stock.getVehicleId(), qtyByVehicleMap.get(stock.getVehicleId()) + stock.getRemainNum());
|
qtyByVehicleMap.replace(stock.getVehicleId(), qtyByVehicleMap.get(stock.getVehicleId()) + stock.getRemainNum());
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -186,7 +186,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
}
|
}
|
||||||
goodsQtyMap.replace(stock.getGoodsId(), qtyByVehicleMap);
|
goodsQtyMap.replace(stock.getGoodsId(), qtyByVehicleMap);
|
||||||
} else {
|
} else {
|
||||||
Map<String, Integer> qtyByVehicleMap = new HashMap<>();
|
Map<String, Double> qtyByVehicleMap = new HashMap<>();
|
||||||
qtyByVehicleMap.put(stock.getVehicleId(), stock.getRemainNum());
|
qtyByVehicleMap.put(stock.getVehicleId(), stock.getRemainNum());
|
||||||
goodsQtyMap.put(stock.getGoodsId(), qtyByVehicleMap);
|
goodsQtyMap.put(stock.getGoodsId(), qtyByVehicleMap);
|
||||||
}
|
}
|
||||||
|
|
@ -200,7 +200,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 根据数量过滤
|
// 根据数量过滤
|
||||||
Map<String, Integer> qtyByVehicleMap = goodsQtyMap.get(goodsId);
|
Map<String, Double> qtyByVehicleMap = goodsQtyMap.get(goodsId);
|
||||||
List<String> vehicleIdsOfThisGoods = new ArrayList<>(qtyByVehicleMap.keySet());
|
List<String> vehicleIdsOfThisGoods = new ArrayList<>(qtyByVehicleMap.keySet());
|
||||||
for (String vehicleId : vehicleIdsOfThisGoods) {
|
for (String vehicleId : vehicleIdsOfThisGoods) {
|
||||||
if (qtyByVehicleMap.get(vehicleId) > (thisGoods.getMaxBoxNum() - 1) * thisGoods.getBoxQty()) {
|
if (qtyByVehicleMap.get(vehicleId) > (thisGoods.getMaxBoxNum() - 1) * thisGoods.getBoxQty()) {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ public class MesControllerServiceImpl implements IMesControllerService {
|
||||||
null,
|
null,
|
||||||
mesDetailTaskInfo.getGoodsId(),
|
mesDetailTaskInfo.getGoodsId(),
|
||||||
mesDetailTaskInfo.getQuantity(),
|
mesDetailTaskInfo.getQuantity(),
|
||||||
0,
|
0.0,
|
||||||
"mes",
|
"mes",
|
||||||
"",
|
"",
|
||||||
mesInTaskRequest.getStandId(),
|
mesInTaskRequest.getStandId(),
|
||||||
|
|
@ -134,7 +134,7 @@ public class MesControllerServiceImpl implements IMesControllerService {
|
||||||
null,
|
null,
|
||||||
mesDetailTaskInfo.getGoodsId(),
|
mesDetailTaskInfo.getGoodsId(),
|
||||||
mesDetailTaskInfo.getQuantity(),
|
mesDetailTaskInfo.getQuantity(),
|
||||||
0,
|
0.0,
|
||||||
"mes",
|
"mes",
|
||||||
"",
|
"",
|
||||||
mesOutTaskRequest.getStandId(),
|
mesOutTaskRequest.getStandId(),
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,8 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
LocalDateTime.now(),
|
LocalDateTime.now(),
|
||||||
null,
|
null,
|
||||||
AppConstant.EMPTY_GOODS_ID,
|
AppConstant.EMPTY_GOODS_ID,
|
||||||
0,
|
0.0,
|
||||||
0,
|
0.0,
|
||||||
stockInRequest.getUserName(),
|
stockInRequest.getUserName(),
|
||||||
"",
|
"",
|
||||||
stockInRequest.getStandId(),
|
stockInRequest.getStandId(),
|
||||||
|
|
@ -178,7 +178,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
null,
|
null,
|
||||||
goodsInfoForTask.getGoodsId(),
|
goodsInfoForTask.getGoodsId(),
|
||||||
goodsInfoForTask.getOpNum(),
|
goodsInfoForTask.getOpNum(),
|
||||||
0,
|
0.0,
|
||||||
stockInRequest.getUserName(),
|
stockInRequest.getUserName(),
|
||||||
goodsInfoForTask.getRemark(),
|
goodsInfoForTask.getRemark(),
|
||||||
stockInRequest.getStandId(),
|
stockInRequest.getStandId(),
|
||||||
|
|
@ -195,12 +195,12 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
// 判断数量是否超载
|
// 判断数量是否超载
|
||||||
TAppGoods thisGoods = goodsMap.get(goodsInfoForTask.getGoodsId());
|
TAppGoods thisGoods = goodsMap.get(goodsInfoForTask.getGoodsId());
|
||||||
int maxQty1Vehicle = thisGoods.getBoxQty() * thisGoods.getMaxBoxNum();
|
int maxQty1Vehicle = thisGoods.getBoxQty() * thisGoods.getMaxBoxNum();
|
||||||
int oldStockNum = 0;
|
Double oldStockNum = 0.0;
|
||||||
if (thisVehicleStocks != null && !thisVehicleStocks.isEmpty()) {
|
if (thisVehicleStocks != null && !thisVehicleStocks.isEmpty()) {
|
||||||
// 计算出该物料的库存数量
|
// 计算出该物料的库存数量
|
||||||
oldStockNum = thisVehicleStocks.stream()
|
oldStockNum = thisVehicleStocks.stream()
|
||||||
.filter(stock -> stock.getGoodsId().equals(goodsInfoForTask.getGoodsId()))
|
.filter(stock -> stock.getGoodsId().equals(goodsInfoForTask.getGoodsId()))
|
||||||
.mapToInt(TAppStock::getRealNum)
|
.mapToDouble(TAppStock::getRealNum)
|
||||||
.sum();
|
.sum();
|
||||||
}
|
}
|
||||||
if (goodsIdTaskMap.get(goodsInfoForTask.getGoodsId()).getOpNum() + oldStockNum > maxQty1Vehicle) {
|
if (goodsIdTaskMap.get(goodsInfoForTask.getGoodsId()).getOpNum() + oldStockNum > maxQty1Vehicle) {
|
||||||
|
|
@ -282,10 +282,13 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
.eq(TAppStock::getGoodsId, stockOutRequest.getGoodsId())
|
.eq(TAppStock::getGoodsId, stockOutRequest.getGoodsId())
|
||||||
.gt(TAppStock::getRemainNum, 0));
|
.gt(TAppStock::getRemainNum, 0));
|
||||||
// 生成物料数量map
|
// 生成物料数量map
|
||||||
Map<String, Integer> stockByGoodsMap = new HashMap<>();
|
Map<String, Double> stockByGoodsMap = new HashMap<>();
|
||||||
for (TAppStock stock : stockList) {
|
for (TAppStock stock : stockList) {
|
||||||
if (stockByGoodsMap.containsKey(stock.getGoodsId())) {
|
if (stockByGoodsMap.containsKey(stock.getGoodsId())) {
|
||||||
stockByGoodsMap.replace(stock.getGoodsId(), stockByGoodsMap.get(stock.getGoodsId()) + stock.getRemainNum());
|
stockByGoodsMap.replace(
|
||||||
|
stock.getGoodsId(),
|
||||||
|
stockByGoodsMap.get(stock.getGoodsId()) + stock.getRemainNum()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
stockByGoodsMap.put(stock.getGoodsId(), stock.getRemainNum());
|
stockByGoodsMap.put(stock.getGoodsId(), stock.getRemainNum());
|
||||||
}
|
}
|
||||||
|
|
@ -293,7 +296,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
if (!stockByGoodsMap.containsKey(stockOutRequest.getGoodsId())) {
|
if (!stockByGoodsMap.containsKey(stockOutRequest.getGoodsId())) {
|
||||||
return BaseWmsApiResponse.error("请求错误:库内无该料库存。");
|
return BaseWmsApiResponse.error("请求错误:库内无该料库存。");
|
||||||
}
|
}
|
||||||
if (stockByGoodsMap.get(stockOutRequest.getGoodsId()) < stockOutRequest.getNeedNum()) {
|
if (stockOutRequest.getNeedNum() == null || stockOutRequest.getNeedNum().compareTo(0) <= 0) {
|
||||||
return BaseWmsApiResponse.error("请求错误:库内该料库存不足,库内数量:" + stockByGoodsMap.get(stockOutRequest.getGoodsId()) + ",需求数量: " + stockOutRequest.getNeedNum() + "。");
|
return BaseWmsApiResponse.error("请求错误:库内该料库存不足,库内数量:" + stockByGoodsMap.get(stockOutRequest.getGoodsId()) + ",需求数量: " + stockOutRequest.getNeedNum() + "。");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,8 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
|
||||||
orderIn.setGoodsName("空托盘");
|
orderIn.setGoodsName("空托盘");
|
||||||
orderIn.setBatch("0");
|
orderIn.setBatch("0");
|
||||||
orderIn.setGoodsType("0");
|
orderIn.setGoodsType("0");
|
||||||
orderIn.setSpecification(0);
|
orderIn.setSpecification("");
|
||||||
orderIn.setQuantity(1);
|
orderIn.setQuantity(1.0);
|
||||||
orderIn.setGoodsDesc("");
|
orderIn.setGoodsDesc("");
|
||||||
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
||||||
orderIn.setCreateTime(LocalDateTime.now());
|
orderIn.setCreateTime(LocalDateTime.now());
|
||||||
|
|
@ -131,8 +131,8 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
|
||||||
orderIn.setGoodsName("空托盘");
|
orderIn.setGoodsName("空托盘");
|
||||||
orderIn.setBatch("0");
|
orderIn.setBatch("0");
|
||||||
orderIn.setGoodsType("0");
|
orderIn.setGoodsType("0");
|
||||||
orderIn.setSpecification(0);
|
orderIn.setSpecification("");
|
||||||
orderIn.setQuantity(1);
|
orderIn.setQuantity(1.0);
|
||||||
orderIn.setGoodsDesc("");
|
orderIn.setGoodsDesc("");
|
||||||
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
||||||
orderIn.setCreateTime(LocalDateTime.now());
|
orderIn.setCreateTime(LocalDateTime.now());
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService {
|
||||||
public YcwmsResponse<Object> orderIn(OrderInReq request) {
|
public YcwmsResponse<Object> orderIn(OrderInReq request) {
|
||||||
log.info("入库单请求参数{}", JSON.toJSON(request));
|
log.info("入库单请求参数{}", JSON.toJSON(request));
|
||||||
if(request == null) return YcwmsResponse.error("参数错误", null);
|
if(request == null) return YcwmsResponse.error("参数错误", null);
|
||||||
if(StringUtils.isEmpty(request.getOrderId()) || StringUtils.isEmpty(request.getClientId())
|
if(StringUtils.isEmpty(request.getOrderId())
|
||||||
|| StringUtils.isEmpty(request.getVehicleNo()) || StringUtils.isEmpty(request.getVehicleSize())
|
|| StringUtils.isEmpty(request.getVehicleNo()) || StringUtils.isEmpty(request.getVehicleSize())
|
||||||
|| StringUtils.isEmpty(request.getInStand()) || request.getGoodsDetail() == null || request.getGoodsDetail().isEmpty()) {
|
|| StringUtils.isEmpty(request.getInStand()) || request.getGoodsDetail() == null || request.getGoodsDetail().isEmpty()) {
|
||||||
return YcwmsResponse.error("参数错误", null);
|
return YcwmsResponse.error("参数错误", null);
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.wms_main.model.bo.erp.ErpVehicleNoResp;
|
||||||
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
||||||
import com.wms_main.model.po.TAppOrderIn;
|
import com.wms_main.model.po.TAppOrderIn;
|
||||||
import com.wms_main.model.po.TAppWcsTask;
|
import com.wms_main.model.po.TAppWcsTask;
|
||||||
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.service.api.IExternalApiService;
|
import com.wms_main.service.api.IExternalApiService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -58,6 +59,9 @@ public class OrderInCheckor implements Job {
|
||||||
log.error("处理载具[{}]数据时发生异常:", vehicleNo, e);
|
log.error("处理载具[{}]数据时发生异常:", vehicleNo, e);
|
||||||
}
|
}
|
||||||
List<TAppOrderIn> inTasks = vehicleIdToTaskMap.get(vehicleNo);
|
List<TAppOrderIn> inTasks = vehicleIdToTaskMap.get(vehicleNo);
|
||||||
|
if (inTasks.stream().anyMatch(task -> StringUtils.isEmpty(task.getClientId()))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// 对比inTasks和goodsDetails
|
// 对比inTasks和goodsDetails
|
||||||
Iterator<ErpGoodsDetail> iterator = goodsDetails.iterator();
|
Iterator<ErpGoodsDetail> iterator = goodsDetails.iterator();
|
||||||
|
|
@ -65,7 +69,7 @@ public class OrderInCheckor implements Job {
|
||||||
ErpGoodsDetail goodsDetail = iterator.next();
|
ErpGoodsDetail goodsDetail = iterator.next();
|
||||||
boolean matchFound = inTasks.stream().anyMatch(task ->
|
boolean matchFound = inTasks.stream().anyMatch(task ->
|
||||||
task.getGoodsId().equals(goodsDetail.getGoodsId()) &&
|
task.getGoodsId().equals(goodsDetail.getGoodsId()) &&
|
||||||
task.getBatch().equals(goodsDetail.getBatch()) &&
|
Objects.equals(task.getQuantity(), goodsDetail.getQuantity()) &&
|
||||||
task.getGoodsType().equals(goodsDetail.getGoodsType()) &&
|
task.getGoodsType().equals(goodsDetail.getGoodsType()) &&
|
||||||
Objects.equals(task.getSpecification(), goodsDetail.getSpecification())
|
Objects.equals(task.getSpecification(), goodsDetail.getSpecification())
|
||||||
);
|
);
|
||||||
|
|
@ -80,7 +84,7 @@ public class OrderInCheckor implements Job {
|
||||||
wcsTaskService.remove(new LambdaUpdateWrapper<TAppWcsTask>()
|
wcsTaskService.remove(new LambdaUpdateWrapper<TAppWcsTask>()
|
||||||
.eq(TAppWcsTask::getVehicleId, vehicleNo));
|
.eq(TAppWcsTask::getVehicleId, vehicleNo));
|
||||||
} else {
|
} else {
|
||||||
log.error("MES校验入库单失败, 载具[{}]", vehicleNo);
|
log.info("MES校验入库单成功, 载具[{}]", vehicleNo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ public class OutsExecutor implements Job {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(TAppOrderOut orderOut : orderOutsList) {
|
for(TAppOrderOut orderOut : orderOutsList) {
|
||||||
Integer needQuantity = orderOut.getQuantity();
|
Double needQuantity = orderOut.getQuantity();
|
||||||
if(needQuantity == null || needQuantity < 1 ) {
|
if(needQuantity == null || needQuantity < 1 ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -95,8 +95,8 @@ public class OutsExecutor implements Job {
|
||||||
needQuantity -= stockItem.getRemainNum();
|
needQuantity -= stockItem.getRemainNum();
|
||||||
}
|
}
|
||||||
stockItem.setStockStatus(WmsStockStatusEnums.OUTING.getCode());
|
stockItem.setStockStatus(WmsStockStatusEnums.OUTING.getCode());
|
||||||
stockItem.setRemainNum(0);
|
stockItem.setRemainNum(0.0);
|
||||||
stockItem.setRealNum(0);
|
stockItem.setRealNum(0.0);
|
||||||
outStockList.add(stockItem);
|
outStockList.add(stockItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,8 +174,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
LocalDateTime.now(),
|
LocalDateTime.now(),
|
||||||
null,
|
null,
|
||||||
AppConstant.EMPTY_GOODS_ID,
|
AppConstant.EMPTY_GOODS_ID,
|
||||||
0,
|
0.0,
|
||||||
0,
|
0.0,
|
||||||
appOuts.getUserName(),
|
appOuts.getUserName(),
|
||||||
"",
|
"",
|
||||||
appOuts.getDestination(),
|
appOuts.getDestination(),
|
||||||
|
|
@ -209,7 +209,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 根据箱号+料号 map一下数量
|
// 根据箱号+料号 map一下数量
|
||||||
Map<String, Integer> goodsNumMap = new HashMap<>();
|
Map<String, Double> goodsNumMap = new HashMap<>();
|
||||||
for (TAppStock stock : allStocks) {
|
for (TAppStock stock : allStocks) {
|
||||||
String key = stock.getVehicleId() + "_" + stock.getGoodsId();
|
String key = stock.getVehicleId() + "_" + stock.getGoodsId();
|
||||||
if (goodsNumMap.containsKey(key)) {
|
if (goodsNumMap.containsKey(key)) {
|
||||||
|
|
@ -243,7 +243,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String key = stock.getVehicleId() + "_" + stock.getGoodsId();
|
String key = stock.getVehicleId() + "_" + stock.getGoodsId();
|
||||||
int stockNum = goodsNumMap.getOrDefault(key, appGoods.getBoxQty() * appGoods.getMaxBoxNum());
|
Double stockNum = goodsNumMap.getOrDefault(key, Double.valueOf(appGoods.getBoxQty() * appGoods.getMaxBoxNum()));
|
||||||
// 判断是否还能够入库用
|
// 判断是否还能够入库用
|
||||||
if (stockNum <= (appGoods.getMaxBoxNum() - 1) * appGoods.getBoxQty()) {
|
if (stockNum <= (appGoods.getMaxBoxNum() - 1) * appGoods.getBoxQty()) {
|
||||||
// 已有的拣选任务
|
// 已有的拣选任务
|
||||||
|
|
@ -283,8 +283,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
LocalDateTime.now(),
|
LocalDateTime.now(),
|
||||||
null,
|
null,
|
||||||
AppConstant.EMPTY_GOODS_ID,
|
AppConstant.EMPTY_GOODS_ID,
|
||||||
0,
|
0.0,
|
||||||
0,
|
0.0,
|
||||||
appOuts.getUserName(),
|
appOuts.getUserName(),
|
||||||
"",
|
"",
|
||||||
appOuts.getDestination(),
|
appOuts.getDestination(),
|
||||||
|
|
@ -346,15 +346,15 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 判断当前的这条库存,当前站台是否需要
|
// 判断当前的这条库存,当前站台是否需要
|
||||||
int originNum = stock.getRemainNum();
|
Double originNum = stock.getRemainNum();
|
||||||
int remainNum = stock.getRemainNum();
|
Double remainNum = stock.getRemainNum();
|
||||||
int needNum = appOuts.getNeedNum() - appOuts.getDistributeNum();
|
int needNum = appOuts.getNeedNum() - appOuts.getDistributeNum();
|
||||||
if (needNum < remainNum) {
|
if (needNum < remainNum) {
|
||||||
appOuts.setDistributeNum(appOuts.getNeedNum());
|
appOuts.setDistributeNum(appOuts.getNeedNum());
|
||||||
remainNum = remainNum - needNum;
|
remainNum = remainNum - needNum;
|
||||||
} else {
|
} else {
|
||||||
appOuts.setDistributeNum(appOuts.getDistributeNum() + remainNum);
|
appOuts.setDistributeNum((int) (appOuts.getDistributeNum() + remainNum));
|
||||||
remainNum = 0;
|
remainNum = 0.0;
|
||||||
}
|
}
|
||||||
if (remainNum == originNum) {
|
if (remainNum == originNum) {
|
||||||
// 没用到这条库存
|
// 没用到这条库存
|
||||||
|
|
@ -390,8 +390,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
LocalDateTime.now(),
|
LocalDateTime.now(),
|
||||||
null,
|
null,
|
||||||
AppConstant.EMPTY_GOODS_ID,
|
AppConstant.EMPTY_GOODS_ID,
|
||||||
0,
|
0.0,
|
||||||
0,
|
0.0,
|
||||||
appOuts.getUserName(),
|
appOuts.getUserName(),
|
||||||
"",
|
"",
|
||||||
appOuts.getDestination(),
|
appOuts.getDestination(),
|
||||||
|
|
@ -559,8 +559,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 判断当前的这条库存,当前站台是否需要
|
// 判断当前的这条库存,当前站台是否需要
|
||||||
int originRemainNum = stock.getRemainNum();
|
Double originRemainNum = stock.getRemainNum();
|
||||||
int remainNum = stock.getRemainNum();
|
Double remainNum = stock.getRemainNum();
|
||||||
for (TAppWork thisWork : works) {
|
for (TAppWork thisWork : works) {
|
||||||
if (!Objects.equals(thisWork.getGoodsId(), stock.getGoodsId())) {
|
if (!Objects.equals(thisWork.getGoodsId(), stock.getGoodsId())) {
|
||||||
// 不是这个料
|
// 不是这个料
|
||||||
|
|
@ -570,20 +570,20 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 需求数量
|
// 需求数量
|
||||||
int remainNeedNum = thisWork.getNeedNum() - thisWork.getDistributeNum();
|
Double remainNeedNum = (double) (thisWork.getNeedNum() - thisWork.getDistributeNum());
|
||||||
if (remainNeedNum <= 0) {
|
if (remainNeedNum <= 0) {
|
||||||
// 不需要分配
|
// 不需要分配
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int thisTimePickNum;
|
Double thisTimePickNum;
|
||||||
if (remainNeedNum < remainNum) {
|
if (remainNeedNum < remainNum) {
|
||||||
thisTimePickNum = remainNeedNum;
|
thisTimePickNum = remainNeedNum;
|
||||||
thisWork.setDistributeNum(thisWork.getNeedNum());
|
thisWork.setDistributeNum(thisWork.getNeedNum());
|
||||||
remainNum = remainNum - thisTimePickNum;
|
remainNum = remainNum - thisTimePickNum;
|
||||||
} else {
|
} else {
|
||||||
thisTimePickNum = remainNum;
|
thisTimePickNum = remainNum;
|
||||||
thisWork.setDistributeNum(thisWork.getDistributeNum() + thisTimePickNum);
|
thisWork.setDistributeNum((int) (thisWork.getDistributeNum() + thisTimePickNum));
|
||||||
remainNum = 0;
|
remainNum = 0.0;
|
||||||
}
|
}
|
||||||
thisWork.setWorkStatus(1);// 正在做
|
thisWork.setWorkStatus(1);// 正在做
|
||||||
// 生成拣选计划
|
// 生成拣选计划
|
||||||
|
|
@ -621,8 +621,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
LocalDateTime.now(),
|
LocalDateTime.now(),
|
||||||
null,
|
null,
|
||||||
AppConstant.EMPTY_GOODS_ID,
|
AppConstant.EMPTY_GOODS_ID,
|
||||||
0,
|
0.0,
|
||||||
0,
|
0.0,
|
||||||
"wms_auto",
|
"wms_auto",
|
||||||
"",
|
"",
|
||||||
stand.getStandId(),
|
stand.getStandId(),
|
||||||
|
|
@ -873,7 +873,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
// 筛选出料号
|
// 筛选出料号
|
||||||
List<String> distinctGoodsIdList = inOuts.stream().map(TAppOuts::getGoodsId).distinct().toList();
|
List<String> distinctGoodsIdList = inOuts.stream().map(TAppOuts::getGoodsId).distinct().toList();
|
||||||
// 获取数据map
|
// 获取数据map
|
||||||
Map<String, Map<String, Integer>> goodsQtyMap = stockDataService.getCanPutGoodsMap(distinctGoodsIdList);
|
Map<String, Map<String, Double>> goodsQtyMap = stockDataService.getCanPutGoodsMap(distinctGoodsIdList);
|
||||||
for (TAppOuts inOut : inOuts) {
|
for (TAppOuts inOut : inOuts) {
|
||||||
int needNum = inOut.getNeedNum() - inOut.getDistributeNum();
|
int needNum = inOut.getNeedNum() - inOut.getDistributeNum();
|
||||||
if (needNum <= 0) {
|
if (needNum <= 0) {
|
||||||
|
|
@ -885,7 +885,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 判断数量够不够
|
// 判断数量够不够
|
||||||
Map<String, Integer> goodsQtyMapByGoodsId = goodsQtyMap.get(inOut.getGoodsId());
|
Map<String, Double> goodsQtyMapByGoodsId = goodsQtyMap.get(inOut.getGoodsId());
|
||||||
if (goodsQtyMapByGoodsId.isEmpty()) {
|
if (goodsQtyMapByGoodsId.isEmpty()) {
|
||||||
goodsQtyMap.remove(inOut.getGoodsId());
|
goodsQtyMap.remove(inOut.getGoodsId());
|
||||||
addRemovingOutsAndRecord(needRemoveOutIds, inOut, needAddOutRecords);
|
addRemovingOutsAndRecord(needRemoveOutIds, inOut, needAddOutRecords);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,19 @@
|
||||||
import request from "@/http/request";
|
import request from "@/http/request";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交入库单
|
* 提交入库单
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const _request = axios.create({
|
||||||
|
// baseURL: 'http://10.18.58.20:12315/wms',
|
||||||
|
baseURL: 'http://10.18.58.20:12315',
|
||||||
|
timeout: 5000
|
||||||
|
})
|
||||||
|
|
||||||
const submitOrderInForm = (params) => {
|
const submitOrderInForm = (params) => {
|
||||||
return request({
|
return _request({
|
||||||
url: '/order/orderIn',
|
url: '/ycwms/orderIn',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,19 @@
|
||||||
import request from "@/http/request";
|
import request from "@/http/request";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交入库单
|
* 提交入库单
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const _request = axios.create({
|
||||||
|
// baseURL: 'http://10.18.58.20:12315/wms',
|
||||||
|
baseURL: 'http://10.18.58.20:12315',
|
||||||
|
timeout: 5000
|
||||||
|
})
|
||||||
|
|
||||||
const submitOrderOutForm = (params) => {
|
const submitOrderOutForm = (params) => {
|
||||||
return request({
|
return _request({
|
||||||
url: '/order/orderOut',
|
url: '/ycwms/orderOut',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,12 @@
|
||||||
<el-form ref="orderInFormRef" :model="orderInForm" :rules="rules" label-width="100px"
|
<el-form ref="orderInFormRef" :model="orderInForm" :rules="rules" label-width="100px"
|
||||||
:label-position="labelPosition" status-icon>
|
:label-position="labelPosition" status-icon>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
|
<el-col :xs="24" :sm="12" :md="6" :lg="5">
|
||||||
|
<el-form-item label="订单号" prop="orderId">
|
||||||
|
<el-input v-model="orderInForm.orderId" clearable @keyup.enter="handleEnter('vehicleNo')"
|
||||||
|
ref="orderIdRef"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="6" :lg="5">
|
<el-col :xs="24" :sm="12" :md="6" :lg="5">
|
||||||
<el-form-item label="料箱号" prop="vehicleNo">
|
<el-form-item label="料箱号" prop="vehicleNo">
|
||||||
<el-input v-model="orderInForm.vehicleNo" clearable @keyup.enter="handleEnter('vehicleSize')"
|
<el-input v-model="orderInForm.vehicleNo" clearable @keyup.enter="handleEnter('vehicleSize')"
|
||||||
|
|
@ -298,9 +304,11 @@ import {submitOrderInForm, getOrderIns, updateOrderIn} from '@/api/orderIn.js'
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const orderInFormRef = ref()
|
const orderInFormRef = ref()
|
||||||
const orderInForm = reactive({
|
const orderInForm = reactive({
|
||||||
|
orderId: '',
|
||||||
vehicleNo: '',
|
vehicleNo: '',
|
||||||
vehicleSize: '',
|
vehicleSize: '',
|
||||||
inStand: '',
|
inStand: '',
|
||||||
|
clientId: 'YaChi',
|
||||||
goodsDetail: []
|
goodsDetail: []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -325,12 +333,14 @@ const queryForm = reactive({
|
||||||
|
|
||||||
// 表单规则
|
// 表单规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
|
orderId: [{required: true, message: '请输入订单号', trigger: 'blur'}],
|
||||||
vehicleNo: [{required: true, message: '请输入料箱号', trigger: 'blur'}],
|
vehicleNo: [{required: true, message: '请输入料箱号', trigger: 'blur'}],
|
||||||
vehicleSize: [{required: true, message: '请输入料箱尺寸', trigger: 'blur'}],
|
vehicleSize: [{required: true, message: '请输入料箱尺寸', trigger: 'blur'}],
|
||||||
inStand: [{required: true, message: '请输入入库站台', trigger: 'blur'}],
|
inStand: [{required: true, message: '请输入入库站台', trigger: 'blur'}],
|
||||||
})
|
})
|
||||||
|
|
||||||
// 引用DOM元素
|
// 引用DOM元素
|
||||||
|
const orderIdRef = ref()
|
||||||
const vehicleNoRef = ref()
|
const vehicleNoRef = ref()
|
||||||
const vehicleSizeRef = ref()
|
const vehicleSizeRef = ref()
|
||||||
const inStandRef = ref()
|
const inStandRef = ref()
|
||||||
|
|
@ -350,7 +360,7 @@ const currentOrderIn = ref(null)
|
||||||
// 初始化时聚焦第一个输入框
|
// 初始化时聚焦第一个输入框
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
vehicleNoRef.value.focus()
|
orderIdRef.value.focus()
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -6,22 +6,27 @@
|
||||||
<legend>出库单信息</legend>
|
<legend>出库单信息</legend>
|
||||||
<el-form ref="orderOutFormRef" :model="orderOutForm" :rules="rules" label-width="70px" :label-position="labelPosition" status-icon>
|
<el-form ref="orderOutFormRef" :model="orderOutForm" :rules="rules" label-width="70px" :label-position="labelPosition" status-icon>
|
||||||
<el-row :gutter="5" class="form-row">
|
<el-row :gutter="5" class="form-row">
|
||||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
|
<el-form-item label="订单号" prop="orderId">
|
||||||
|
<el-input v-model="orderOutForm.orderId" clearable @keyup.enter="handleEnter('goodsId')" ref="orderIdRef" class="custom-input" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
<el-form-item label="物料编号" prop="goodsId">
|
<el-form-item label="物料编号" prop="goodsId">
|
||||||
<el-input v-model="orderOutForm.goodsId" clearable @keyup.enter="handleEnter('batch')" ref="goodsIdRef" class="custom-input" />
|
<el-input v-model="orderOutForm.goodsId" clearable @keyup.enter="handleEnter('batch')" ref="goodsIdRef" class="custom-input" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
<el-form-item label="批次" prop="batch">
|
<el-form-item label="批次" prop="batch">
|
||||||
<el-input v-model="orderOutForm.batch" clearable @keyup.enter="handleEnter('specification')" ref="batchRef" class="custom-input" />
|
<el-input v-model="orderOutForm.batch" clearable @keyup.enter="handleEnter('specification')" ref="batchRef" class="custom-input" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
<el-form-item label="规格" prop="specification">
|
<el-form-item label="规格" prop="specification">
|
||||||
<el-input-number v-model="orderOutForm.specification" :min="1" controls-position="right" clearable @keyup.enter="handleEnter('quantity')" ref="specificationRef" class="custom-input" />
|
<el-input-number v-model="orderOutForm.specification" :min="1" controls-position="right" clearable @keyup.enter="handleEnter('quantity')" ref="specificationRef" class="custom-input" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
<el-form-item label="数量" prop="quantity">
|
<el-form-item label="数量" prop="quantity">
|
||||||
<el-input-number v-model="orderOutForm.quantity" :min="1" controls-position="right" clearable ref="quantityRef" class="custom-input" />
|
<el-input-number v-model="orderOutForm.quantity" :min="1" controls-position="right" clearable ref="quantityRef" class="custom-input" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -59,6 +64,7 @@ import { submitOrderOutForm } from '@/api/orderOut.js'
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const orderOutFormRef = ref()
|
const orderOutFormRef = ref()
|
||||||
const orderOutForm = reactive({
|
const orderOutForm = reactive({
|
||||||
|
orderId: '',
|
||||||
goodsId: '',
|
goodsId: '',
|
||||||
batch: '',
|
batch: '',
|
||||||
specification: null,
|
specification: null,
|
||||||
|
|
@ -67,6 +73,7 @@ const orderOutForm = reactive({
|
||||||
|
|
||||||
// 表单规则
|
// 表单规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
|
orderId: [{ required: true, message: '请输入订单号', trigger: 'blur' }],
|
||||||
goodsId: [{ required: true, message: '请输入物料编号', trigger: 'blur' }],
|
goodsId: [{ required: true, message: '请输入物料编号', trigger: 'blur' }],
|
||||||
batch: [{ required: true, message: '请输入批次', trigger: 'blur' }],
|
batch: [{ required: true, message: '请输入批次', trigger: 'blur' }],
|
||||||
specification: [{ required: true, message: '请输入规格', trigger: 'blur' }],
|
specification: [{ required: true, message: '请输入规格', trigger: 'blur' }],
|
||||||
|
|
@ -74,6 +81,7 @@ const rules = reactive({
|
||||||
})
|
})
|
||||||
|
|
||||||
// 引用DOM元素
|
// 引用DOM元素
|
||||||
|
const orderIdRef = ref()
|
||||||
const goodsIdRef = ref()
|
const goodsIdRef = ref()
|
||||||
const batchRef = ref()
|
const batchRef = ref()
|
||||||
const specificationRef = ref()
|
const specificationRef = ref()
|
||||||
|
|
@ -86,7 +94,7 @@ const responseResult = ref({})
|
||||||
// 初始化时聚焦第一个输入框
|
// 初始化时聚焦第一个输入框
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
goodsIdRef.value.focus()
|
orderIdRef.value.focus()
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -103,6 +111,7 @@ const resizeHeight = () => {
|
||||||
// 处理回车事件
|
// 处理回车事件
|
||||||
const handleEnter = (nextField) => {
|
const handleEnter = (nextField) => {
|
||||||
const refMap = {
|
const refMap = {
|
||||||
|
'goodsId': goodsIdRef,
|
||||||
'batch': batchRef,
|
'batch': batchRef,
|
||||||
'specification': specificationRef,
|
'specification': specificationRef,
|
||||||
'quantity': quantityRef
|
'quantity': quantityRef
|
||||||
|
|
@ -117,7 +126,7 @@ const handleEnter = (nextField) => {
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
orderOutFormRef.value.resetFields()
|
orderOutFormRef.value.resetFields()
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
goodsIdRef.value.focus()
|
orderIdRef.value.focus()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user