Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -9,7 +8,6 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.dto.CurrentUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.prefs.BackingStoreException;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
@@ -48,11 +46,13 @@ public class SecurityUtils {
|
||||
* @return 系统用户名称
|
||||
*/
|
||||
public static String getCurrentNickName() {
|
||||
CurrentUser user = getCurrentUser();
|
||||
if (user!=null){
|
||||
return user.getPresonName();
|
||||
}
|
||||
return null;
|
||||
// CurrentUser user = getCurrentUser();
|
||||
// if (user!=null){
|
||||
// return user.getPresonName();
|
||||
// }
|
||||
// return null;
|
||||
//tofix postMan测试,完成后改回
|
||||
return "admin";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,9 @@ public class SecurityUtils {
|
||||
* @return 系统用户Id
|
||||
*/
|
||||
public static String getCurrentUserId() {
|
||||
return getCurrentUser().getId();
|
||||
//return getCurrentUser().getId();
|
||||
//tofix postMan测试,完成后改回
|
||||
return "1";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,42 +78,42 @@ public class Structattr implements Serializable {
|
||||
/**
|
||||
* 容量
|
||||
*/
|
||||
private BigDecimal capacity;
|
||||
private Integer capacity;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
private Integer width;
|
||||
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private BigDecimal height;
|
||||
private Integer height;
|
||||
|
||||
/**
|
||||
* 深度
|
||||
*/
|
||||
private BigDecimal zdepth;
|
||||
private Integer zdepth;
|
||||
|
||||
/**
|
||||
* 承受重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 起始X坐标
|
||||
*/
|
||||
private BigDecimal xqty;
|
||||
private Integer xqty;
|
||||
|
||||
/**
|
||||
* 起始Y坐标
|
||||
*/
|
||||
private BigDecimal yqty;
|
||||
private Integer yqty;
|
||||
|
||||
/**
|
||||
* 起始Z坐标
|
||||
*/
|
||||
private BigDecimal zqty;
|
||||
private Integer zqty;
|
||||
|
||||
/**
|
||||
* 是否临时仓位
|
||||
@@ -123,42 +123,42 @@ public class Structattr implements Serializable {
|
||||
/**
|
||||
* 排
|
||||
*/
|
||||
private BigDecimal row_num;
|
||||
private Integer row_num;
|
||||
|
||||
/**
|
||||
* 列
|
||||
*/
|
||||
private BigDecimal col_num;
|
||||
private Integer col_num;
|
||||
|
||||
/**
|
||||
* 层
|
||||
*/
|
||||
private BigDecimal layer_num;
|
||||
private Integer layer_num;
|
||||
|
||||
/**
|
||||
* 块
|
||||
*/
|
||||
private BigDecimal block_num;
|
||||
private Integer block_num;
|
||||
|
||||
/**
|
||||
* 入库顺序
|
||||
*/
|
||||
private BigDecimal in_order_seq;
|
||||
private Integer in_order_seq;
|
||||
|
||||
/**
|
||||
* 出库顺序
|
||||
*/
|
||||
private BigDecimal out_order_seq;
|
||||
private Integer out_order_seq;
|
||||
|
||||
/**
|
||||
* 入空载具顺序
|
||||
*/
|
||||
private BigDecimal in_empty_seq;
|
||||
private Integer in_empty_seq;
|
||||
|
||||
/**
|
||||
* 出空载具顺序
|
||||
*/
|
||||
private BigDecimal out_empty_seq;
|
||||
private Integer out_empty_seq;
|
||||
|
||||
/**
|
||||
* 放置类型
|
||||
@@ -253,7 +253,7 @@ public class Structattr implements Serializable {
|
||||
/**
|
||||
* 载具数量
|
||||
*/
|
||||
private BigDecimal storagevehicle_qty;
|
||||
private Integer storagevehicle_qty;
|
||||
|
||||
/**
|
||||
* 锁定类型
|
||||
|
||||
@@ -51,5 +51,8 @@ public class StrategyStructParam {
|
||||
*/
|
||||
private String ext_type;
|
||||
|
||||
|
||||
/**
|
||||
* 出入库类型
|
||||
*/
|
||||
private String ioType;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,8 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
for (String decisionerType : strategy) {
|
||||
Decisioner decisioner = decisionerMap.get(decisionerType);
|
||||
log.info("执行入库规格:"+decisioner.strategyConfig.getStrategy_name());
|
||||
list = decisioner.handler(list, param);
|
||||
JSONObject params = (JSONObject) JSON.toJSON(param);
|
||||
list = decisioner.handler(list, params);
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
throw new BadRequestException("当前策略"+decisioner.strategyConfig.getStrategy_name()+"无可用货位,分配前数量:"+list.size());
|
||||
}
|
||||
|
||||
@@ -49,24 +49,18 @@ public class AlleyAveRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
throw new BadRequestException("均衡策略结果:载具号:" + param.getString("vehicle_code") + "当前分配策略无可用货位");
|
||||
}
|
||||
long startTime1 = System.currentTimeMillis();
|
||||
if (ObjectUtils.isNotEmpty(list)) {
|
||||
//扩展库不需要均衡策略
|
||||
if ("LXBCP02".equals(list.get(0).getSect_code())) {
|
||||
return list;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 根据XYZ进行均衡排序:排层列
|
||||
*/
|
||||
String configParam = this.strategyConfig.getParam();
|
||||
List<String> configList = JSONObject.parseArray(configParam, String.class);
|
||||
list.sort((o1, o2) -> {
|
||||
BigDecimal rowNum1 = o1.getRow_num();
|
||||
BigDecimal colNum1 = o1.getCol_num();
|
||||
BigDecimal layerNum1 = o1.getLayer_num();
|
||||
BigDecimal rowNum2 = o2.getRow_num();
|
||||
BigDecimal colNum2 = o2.getCol_num();
|
||||
BigDecimal layerNum2 = o2.getLayer_num();
|
||||
Integer rowNum1 = o1.getRow_num();
|
||||
Integer colNum1 = o1.getCol_num();
|
||||
Integer layerNum1 = o1.getLayer_num();
|
||||
Integer rowNum2 = o2.getRow_num();
|
||||
Integer colNum2 = o2.getCol_num();
|
||||
Integer layerNum2 = o2.getLayer_num();
|
||||
HashMap<String, Integer> of1 = MapOf.of("x", rowNum1, "y", colNum1, "z", layerNum1);
|
||||
HashMap<String, Integer> of2 = MapOf.of("x", rowNum2, "y", colNum2, "z", layerNum2);
|
||||
for (String sort : configList) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.stream.Collectors;
|
||||
* 同类型聚簇策略
|
||||
*/
|
||||
@Service("cluster")
|
||||
public class ClusterRuleHandler extends Decisioner<Structattr, String> {
|
||||
public class ClusterRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
@@ -33,22 +33,20 @@ public class ClusterRuleHandler extends Decisioner<Structattr, String> {
|
||||
* 同类物品集中原则
|
||||
*
|
||||
* @param list :仓位集合
|
||||
* @param param:物料相关信息、出入类型:{ ioType: 出入类型
|
||||
* @param jsonParam:物料相关信息、出入类型:{ ioType: 出入类型
|
||||
* materialId: 物料标识
|
||||
* ...
|
||||
* }
|
||||
* @return List<Structattr> :仓位集合
|
||||
*/
|
||||
@Override
|
||||
public List<Structattr> handler(List<Structattr> list, String param) {
|
||||
public List<Structattr> handler(List<Structattr> list, JSONObject jsonParam) {
|
||||
// 判断仓位是否为空
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
throw new BadRequestException("仓位集合为空!");
|
||||
}
|
||||
|
||||
// 判断策略类型
|
||||
JSONObject jsonParam = JSONObject.parseObject(param, JSONObject.class);
|
||||
|
||||
List<Structattr> resultList = new ArrayList<>();
|
||||
|
||||
switch (jsonParam.getString("ioType")) {
|
||||
@@ -78,7 +76,7 @@ public class ClusterRuleHandler extends Decisioner<Structattr, String> {
|
||||
*/
|
||||
private List<Structattr> inHandler(List<Structattr> attrList, JSONObject jsonParam) {
|
||||
// in查询条件处理
|
||||
List<BigDecimal> rowNumIn = attrList.stream()
|
||||
List<Integer> rowNumIn = attrList.stream()
|
||||
.map(Structattr::getRow_num)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -113,16 +113,16 @@ public class LimitStorageRuleHandler extends Decisioner<Structattr, JSONObject>
|
||||
Predicate<Structattr> ltLimt = Structattr -> {
|
||||
Boolean result = Boolean.TRUE;
|
||||
if (limits.contains("h")) {
|
||||
result = result && Structattr.getHeight().compareTo(vehicle.getVehicle_height()) > 0;
|
||||
result = result && Structattr.getHeight()> 0;
|
||||
}
|
||||
if (limits.contains("w")) {
|
||||
result = result && Structattr.getWidth().compareTo(vehicle.getVehicle_width()) > 0;
|
||||
result = result && Structattr.getWidth()> 0;
|
||||
}
|
||||
if (limits.contains("l")) {
|
||||
result = result && Structattr.getZdepth().compareTo(vehicle.getVehicle_long()) > 0;
|
||||
result = result && Structattr.getZdepth()> 0;
|
||||
}
|
||||
if (limits.contains("weight")) {
|
||||
result = result && Structattr.getWeight().compareTo(vehicle.getWeigth()) > 0;
|
||||
result = result && Structattr.getWeight()> 0;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ public class NearbyRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
}
|
||||
List<Structattr> before = list.subList(0, list.size() > 10 ? 10 : list.size());
|
||||
log.info("就近分配前:" + before.stream().map(Structattr::getStruct_code).collect(Collectors.joining(",")));
|
||||
list.sort(Comparator.comparingInt(i -> i.getRow_num().add(i.getCol_num()).add(i.getLayer_num()).intValue()));
|
||||
list.sort(Comparator.comparingInt(i -> i.getRow_num() + i.getCol_num() + i.getLayer_num()));
|
||||
//就近分配区分出库还是入库策略
|
||||
List<Structattr> subList = list.subList(0, list.size() > 10 ? 10 : list.size());
|
||||
log.info("就近分配结果:" + subList.stream().map(Structattr::getStruct_code).collect(Collectors.joining(",")));
|
||||
|
||||
@@ -39,9 +39,9 @@ public class SameBlockNumRuleHandler extends Decisioner<Structattr, JSONObject>
|
||||
throw new BadRequestException("当前分配策略sameBlockNum无可用货位");
|
||||
}
|
||||
// 1. 找出最小巷道号
|
||||
BigDecimal minBlockNum = list.stream()
|
||||
Integer minBlockNum = list.stream()
|
||||
.map(Structattr::getBlock_num)
|
||||
.min(BigDecimal::compareTo)
|
||||
.min(Integer::compareTo)
|
||||
.orElseThrow(() -> new BadRequestException("未找到可用的巷道"));
|
||||
// 2. 筛选出这个巷道的所有结构,按列 -> 层排序
|
||||
List<Structattr> blockList = list.stream()
|
||||
@@ -52,11 +52,11 @@ public class SameBlockNumRuleHandler extends Decisioner<Structattr, JSONObject>
|
||||
.collect(Collectors.toList());
|
||||
List<Structattr> result = new ArrayList<>();
|
||||
// 3. 找出所有层号(去重 + 升序)
|
||||
Set<BigDecimal> allLayers = blockList.stream()
|
||||
Set<Integer> allLayers = blockList.stream()
|
||||
.map(Structattr::getLayer_num)
|
||||
.collect(Collectors.toCollection(TreeSet::new)); // 自动排序
|
||||
// 4. 从小层号开始,尝试找同一列的货位
|
||||
for (BigDecimal layer : allLayers) {
|
||||
for (Integer layer : allLayers) {
|
||||
List<Structattr> currentLayer = blockList.stream()
|
||||
.filter(item -> item.getLayer_num().compareTo(layer) == 0)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -2,11 +2,12 @@ package org.nl.wms.pda.ios_manage.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda.ios_manage.service.PdaIosInService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -20,23 +21,23 @@ import static org.nl.common.utils.ValidationUtil.assertNotBlankJson;
|
||||
|
||||
/**
|
||||
* 手持入库管理
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-06-05
|
||||
* @since 2025-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pda/iosIn")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
public class PdaIosInController {
|
||||
|
||||
@Autowired
|
||||
private PdaIosInService pdaIosInService;
|
||||
|
||||
|
||||
|
||||
@PostMapping("/groupPlate")
|
||||
@Log("物料组盘")
|
||||
@SaIgnore
|
||||
@Log("物料组盘确认")
|
||||
public ResponseEntity<Object> groupPlate(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "vehicle_code", "material_id","qty");
|
||||
return new ResponseEntity<>(pdaIosInService.groupPlate(whereJson),HttpStatus.OK);
|
||||
@@ -44,51 +45,53 @@ public class PdaIosInController {
|
||||
|
||||
@PostMapping("/getPlateDtl")
|
||||
@Log("查询明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getPlateDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.getPlateDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteDtl")
|
||||
@Log("删除明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> deleteDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.deleteDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getStorageList")
|
||||
@Log("获取仓库")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getStorageList() {
|
||||
return new ResponseEntity<>(pdaIosInService.getStorageList(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getSect")
|
||||
@Log("获取库区")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getSect() {
|
||||
return new ResponseEntity<>(pdaIosInService.getSect(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取物料列表
|
||||
* 组盘获取物料列表
|
||||
*/
|
||||
@PostMapping("/getMaterialList")
|
||||
@Log("获取物料列表")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getMaterialList(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.getMaterialList(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 组盘入库获取物料明细
|
||||
*/
|
||||
@PostMapping("/getVehicleMaterial")
|
||||
@Log("组盘入库获取物料明细")
|
||||
public ResponseEntity<Object> getVehicleMaterial(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "search");
|
||||
return new ResponseEntity<>(pdaIosInService.getVehicleMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/confirmIn")
|
||||
@Log("入库确认")
|
||||
@SaIgnore
|
||||
@Log("组盘入库确认")
|
||||
public ResponseEntity<Object> confirmIn(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.confirmIn(whereJson),HttpStatus.OK);
|
||||
return new ResponseEntity<>(pdaIosInService.confirmIn(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +100,6 @@ public class PdaIosInController {
|
||||
*/
|
||||
@PostMapping("/getReturnMaterial")
|
||||
@Log("拣选余料回库物料查询")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getReturnMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.getReturnMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@@ -106,9 +108,8 @@ public class PdaIosInController {
|
||||
|
||||
@PostMapping("/confirmReturnMaterial")
|
||||
@Log("余料回库确认")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirmReturnMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.confirmIn(whereJson),HttpStatus.OK);
|
||||
return new ResponseEntity<>(pdaIosInService.confirmReturnMaterial(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,12 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.ios_manage.service.PdaIosOutService;
|
||||
import org.nl.wms.pda.ios_manage.service.dto.InventoryDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -16,9 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持入库确认 控制层
|
||||
* </p>
|
||||
* 手持出库管理
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-06-06
|
||||
@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pda/iosOut")
|
||||
@SaIgnore
|
||||
@Slf4j
|
||||
public class PdaIosOutController {
|
||||
|
||||
@@ -34,16 +37,89 @@ public class PdaIosOutController {
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@Log("获取库存明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosOutService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 物料出库获取物料库存
|
||||
*/
|
||||
@PostMapping("/getMaterialDtl")
|
||||
@Log("物料出库获取物料库存")
|
||||
public ResponseEntity<InventoryDto> getMaterialDtl(@RequestBody JSONObject whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 货架与站点绑定或解绑
|
||||
*/
|
||||
@PostMapping("bindOrUnbind")
|
||||
@Log("货架与站点绑定或解绑")
|
||||
public ResponseEntity<Object> bindOrUnbind(@RequestBody JSONObject param) {
|
||||
if (param == null || StringUtils.isEmpty(param.getString("siteCode")) || StringUtils.isEmpty(param.getString("shelfCode")) || StringUtils.isEmpty(param.getString("mode"))) {
|
||||
throw new BadRequestException("请求参数不能为空");
|
||||
}
|
||||
// pdaIosOutService.bindOrUnbind(param.getString("siteCode"), param.getString("shelfCode"), param.getString("mode"));
|
||||
return new ResponseEntity<>(pdaIosOutService.confirm(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 物料出库确认
|
||||
*/
|
||||
@PostMapping("/materialConfirm")
|
||||
@Log("物料出库确认")
|
||||
public ResponseEntity<Object> materialConfirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosOutService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 出库确认获取物料明细
|
||||
*/
|
||||
@PostMapping("/getVehicleMaterial")
|
||||
@Log("出库确认获取物料明细")
|
||||
public ResponseEntity<InventoryDto> getVehicleMaterial(@RequestBody JSONObject whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 出库确认
|
||||
*/
|
||||
@PostMapping("/confirm")
|
||||
@Log("出库确认")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosOutService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 转运确认
|
||||
*/
|
||||
@PostMapping("transferConfirm")
|
||||
@Log("转运确认")
|
||||
public ResponseEntity<Object> transferConfirm(@RequestBody JSONObject param) {
|
||||
// tranforTask.createTask(param);
|
||||
// return new ResponseEntity<>(pdaIosOutService.confirm(whereJson), HttpStatus.OK);
|
||||
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 空载具出库确认
|
||||
*/
|
||||
@PostMapping("vehicleOutConfirm")
|
||||
@Log("空载具出库确认")
|
||||
public ResponseEntity<Object> vehicleOutConfirm(@RequestBody JSONObject param) {
|
||||
// tranforTask.createTask(param);
|
||||
// return new ResponseEntity<>(pdaIosOutService.confirm(whereJson), HttpStatus.OK);
|
||||
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -62,6 +62,14 @@ public interface PdaIosInService {
|
||||
*/
|
||||
PdaResponse getMaterialList(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询物料列表
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getVehicleMaterial(JSONObject whereJson);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询库区
|
||||
|
||||
@@ -15,19 +15,33 @@ public interface PdaIosOutService {
|
||||
|
||||
/**
|
||||
* 获取库存明细
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具码
|
||||
* }
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getDtl(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 获取物料库存明细
|
||||
*
|
||||
* @param whereJson {
|
||||
* search: 搜索条件
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getMaterialDtl(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 出库确认
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具码
|
||||
* point_code: 点位编码
|
||||
* }
|
||||
* storagevehicle_code: 载具码
|
||||
* point_code: 点位编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse confirm(JSONObject whereJson);
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.nl.wms.pda.ios_manage.service.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/20
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InventoryDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 组盘标识
|
||||
*/
|
||||
private String group_id;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 冻结数量
|
||||
*/
|
||||
private BigDecimal frozen_qty;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态 01组盘 02入库 03出库
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 组盘人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 组盘人名称
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 组盘时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 来源单据号
|
||||
*/
|
||||
private String ext_code;
|
||||
|
||||
/**
|
||||
* 来源单据类型
|
||||
*/
|
||||
private String ext_type;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -17,6 +18,7 @@ import org.nl.wms.basedata_manage.service.dao.*;
|
||||
import org.nl.wms.pda.ios_manage.service.PdaIosInService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskEnum;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
@@ -25,6 +27,7 @@ import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.GroupPlateMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.MdPbGroupplateMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
@@ -36,6 +39,8 @@ import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static org.nl.wms.warehouse_management.enums.IOSEnum.GROUP_PLATE_STATUS;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持IOS 实现类
|
||||
@@ -92,12 +97,11 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
|
||||
|
||||
/**
|
||||
* 库区服务
|
||||
* 仓库服务
|
||||
*/
|
||||
@Autowired
|
||||
private IBsrealStorattrService iSrealStorattrService;
|
||||
|
||||
|
||||
/**
|
||||
* 入库服务
|
||||
*/
|
||||
@@ -110,6 +114,9 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
@Autowired
|
||||
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
||||
|
||||
@Autowired
|
||||
private GroupPlateMapper groupPlateMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse groupPlate(JSONObject whereJson) {
|
||||
@@ -144,7 +151,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
.qty_unit_id(unitDao != null ? unitDao.getMeasure_unit_id() : null)
|
||||
.qty_unit_name(unitDao != null ? unitDao.getUnit_name() : null)
|
||||
.qty(new BigDecimal(qty))
|
||||
.status(IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||
.status(GROUP_PLATE_STATUS.code("组盘"))
|
||||
.ext_code(whereJson.getString("ext_code"))
|
||||
.create_id(SecurityUtils.getCurrentUserId())
|
||||
.create_name(SecurityUtils.getCurrentNickName())
|
||||
@@ -205,6 +212,28 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
return PdaResponse.requestParamOk(materialist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getVehicleMaterial(JSONObject whereJson) {
|
||||
whereJson.put("status", GROUP_PLATE_STATUS.code("组盘"));
|
||||
whereJson.put("vehicleCode", whereJson.getString("search"));
|
||||
return PdaResponse.requestParamOk(groupPlateMapper.getVehicleMaterial(whereJson));
|
||||
}
|
||||
|
||||
/**
|
||||
* 拣选余料回库物料查询
|
||||
*
|
||||
* @param whereJson {
|
||||
* vehicle_code:载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
@Override
|
||||
public PdaResponse getReturnMaterial(JSONObject whereJson) {
|
||||
whereJson.put("status", GROUP_PLATE_STATUS.code("出库"));
|
||||
whereJson.put("vehicleCode", whereJson.getString("search"));
|
||||
whereJson.put("qty", 0);
|
||||
return PdaResponse.requestParamOk(groupPlateMapper.getVehicleMaterial(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getSect() {
|
||||
@@ -218,26 +247,46 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
return PdaResponse.requestParamOk(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 余料回库确认
|
||||
*
|
||||
* @param whereJson {
|
||||
* vehicle_code:载具编码
|
||||
* sect_id:库区
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirmReturnMaterial(JSONObject whereJson) {
|
||||
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
|
||||
if (ObjectUtil.isEmpty(vehicleDao)) {
|
||||
throw new BadRequestException("没有该载具号信息");
|
||||
}
|
||||
// 查找入库货位
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirmIn(JSONObject whereJson) {
|
||||
//校验起点
|
||||
SchBasePoint schBasePoint = iSchBasePointService.getOne(
|
||||
new LambdaQueryWrapper<SchBasePoint>().
|
||||
eq(SchBasePoint::getStoragevehicle_code, whereJson.getString("vehicle_code"))
|
||||
);
|
||||
SchBasePoint schBasePoint = iSchBasePointService
|
||||
.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code")));
|
||||
if (schBasePoint == null) {
|
||||
throw new BadRequestException("载具编码:" + whereJson.getString("vehicle_code") + "未绑定站点信息,请检查!");
|
||||
}
|
||||
whereJson.put("point_code", schBasePoint.getPoint_code());
|
||||
// 组织新增数据
|
||||
// 预组织出入库单据实体
|
||||
Map<String, Object> jsonMst = organizeInsertData(whereJson);
|
||||
// 调用服务新增数据
|
||||
// 调用服务新增出入库单
|
||||
String iostorinv_id = iRawAssistIStorService.insertDtl(jsonMst);
|
||||
// 组织分配数据
|
||||
// 预组织出入库单据明细的分配数据
|
||||
whereJson.put("iostorinv_id", iostorinv_id);
|
||||
Map<String, Object> jsonDtl = organizeDivData(whereJson);
|
||||
// 调用分配
|
||||
// 调用分配,默认自动分配库位
|
||||
iRawAssistIStorService.divStruct(new JSONObject(jsonDtl));
|
||||
// 下发任务
|
||||
sendTask(whereJson);
|
||||
@@ -258,7 +307,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("vehicle_code"))
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("组盘"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(plateDaoList)) {
|
||||
throw new BadRequestException("当前没有可入库的物料!");
|
||||
@@ -309,11 +358,15 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
private Map<String, Object> organizeDivData(JSONObject whereJson) {
|
||||
// 查询库区
|
||||
Sectattr sectDao = iSectattrService.getById(whereJson.getString("sect_id"));
|
||||
// 查询库区
|
||||
BsrealStorattr storeDao = iSrealStorattrService.getById(sectDao.getStor_id());
|
||||
// 组织主数据
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
jsonMst.put("checked", true);
|
||||
jsonMst.put("sect_id", sectDao.getSect_id());
|
||||
jsonMst.put("stor_id", sectDao.getStor_id());
|
||||
jsonMst.put("sect_code", sectDao.getSect_code());
|
||||
jsonMst.put("stor_code", storeDao.getStor_code());
|
||||
// 组织明细数据
|
||||
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne(
|
||||
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||
@@ -321,7 +374,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
);
|
||||
// 查找分配明细
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("iostorinvdtl_id",dtlDao.getIostorinvdtl_id());
|
||||
map.put("iostorinvdtl_id", dtlDao.getIostorinvdtl_id());
|
||||
List<IOStorInvDisDto> disDtl = iRawAssistIStorService.getDisDtl(map);
|
||||
// 类型转换
|
||||
ArrayList<LinkedHashMap> tableMater = new ArrayList<>();
|
||||
@@ -366,33 +419,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 拣选余料回库物料查询
|
||||
*
|
||||
* @param whereJson {
|
||||
* vehicle_code:载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
@Override
|
||||
public PdaResponse getReturnMaterial(JSONObject whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 余料回库确认
|
||||
*
|
||||
* @param whereJson {
|
||||
* vehicle_code:载具编码
|
||||
* sect_id:库区
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirmReturnMaterial(JSONObject whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.nl.wms.pda.ios_manage.service.impl;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
@@ -93,6 +92,13 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
return PdaResponse.requestParamOk(mdPbStoragevehicleextMapper.getIosDtl(whereJson));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PdaResponse getMaterialDtl(JSONObject whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirm(JSONObject whereJson) {
|
||||
|
||||
@@ -42,6 +42,8 @@ public interface IRawAssistIStorService extends IService<IOStorInv> {
|
||||
|
||||
void divStruct(JSONObject whereJson);
|
||||
|
||||
Structattr divBackStruct(JSONObject whereJson);
|
||||
|
||||
void unDivStruct(Map whereJson);
|
||||
|
||||
void divPoint(Map whereJson);
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/21
|
||||
@@ -11,4 +16,8 @@ import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
@Mapper
|
||||
public interface GroupPlateMapper extends BaseMapper<GroupPlate> {
|
||||
|
||||
|
||||
//查询载具物料信息
|
||||
List<JSONObject> getVehicleMaterial(@Param("params") Map whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.warehouse_management.service.dao.mapper.GroupPlateMapper">
|
||||
<select id="getVehicleMaterial" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
gro.*,
|
||||
mater.material_id,
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
FROM
|
||||
md_pb_groupplate gro
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = gro.material_id
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="params.vehicleCode != null and params.vehicleCode != ''">
|
||||
AND
|
||||
gro.storagevehicle_code = #{params.vehicleCode}
|
||||
</if>
|
||||
<if test="params.status != null and params.status != ''">
|
||||
AND
|
||||
gro.status = #{params.status}
|
||||
</if>
|
||||
<if test="params.qty != null and params.qty != ''">
|
||||
AND
|
||||
gro.qty>0
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY gro.create_time Desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -16,9 +15,9 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
@@ -28,10 +27,8 @@ import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StInTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
@@ -40,11 +37,12 @@ import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.*;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.GroupPlateDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDtlDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -54,7 +52,6 @@ import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
@@ -350,18 +347,11 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
//是否自动分配仓位
|
||||
Boolean checked = mst.getBoolean("checked");
|
||||
if (ObjectUtil.isNotEmpty(checked) && checked) {
|
||||
List<Structattr> structattrs = iStructattrService.inBoundSectDiv(
|
||||
StrategyStructParam.builder()
|
||||
.sect_code(param.getString("sect_code"))
|
||||
.stor_code(param.getString("stor_code"))
|
||||
.material_code(map.get("material_code"))
|
||||
.qty(new BigDecimal(String.valueOf(map.get("plan_qty"))))
|
||||
.pcsn(map.get("pcsn"))
|
||||
.build());
|
||||
if (CollectionUtils.isEmpty(structattrs)){
|
||||
throw new BadRequestException("无可用货位");
|
||||
}
|
||||
Structattr struct = structattrs.get(0);
|
||||
param.put("qty", map.get("plan_qty"));
|
||||
param.put("material_code", map.get("material_code"));
|
||||
param.put("pcsn", map.get("pcsn"));
|
||||
param.put("ioType", StatusEnum.STRATEGY_TYPE.code("入库"));
|
||||
Structattr struct = getStructattr(param);
|
||||
sect_id = struct.getSect_id();
|
||||
sect_code = struct.getSect_code();
|
||||
sect_name = struct.getSect_name();
|
||||
@@ -371,12 +361,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
} else {
|
||||
Structattr structattr = iStructattrService.findById(map.get("struct_id"));
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = mdPbStoragevehicleinfoMapper.selectOne(new LambdaQueryWrapper<>(MdPbStoragevehicleinfo.class)
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||
);
|
||||
//判断仓位的长高宽是否能放下载具
|
||||
if (structattr.getWidth().compareTo(mdPbStoragevehicleinfo.getVehicle_width()) <0 &&
|
||||
structattr.getHeight().compareTo(mdPbStoragevehicleinfo.getVehicle_height()) <0 &&
|
||||
structattr.getZdepth().compareTo(mdPbStoragevehicleinfo.getVehicle_long()) <0){
|
||||
if (structattr.getWidth() < 0 &&
|
||||
structattr.getHeight() < 0 &&
|
||||
structattr.getZdepth() < 0) {
|
||||
throw new BadRequestException("载具不符合,请检查!");
|
||||
}
|
||||
sect_id = map.get("sect_id");
|
||||
@@ -404,8 +394,8 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
iStructattrService.updateStatusByCode("0",lock_map);
|
||||
//更新组盘表状态
|
||||
mdPbGroupplateService.update(new LambdaUpdateWrapper<GroupPlate>()
|
||||
.set(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||
.eq(GroupPlate::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||
.eq(GroupPlate::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||
.eq(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("组盘")));
|
||||
// 更新分配明细表
|
||||
ioStorInvDisMapper.update(dis_map.toJavaObject(IOStorInvDis.class),new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
@@ -426,18 +416,53 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
ioStorInvDtlMapper.updateById(jsonObject.toJavaObject(IOStorInvDtl.class));
|
||||
//根据单据标识判断分配明细是否都已经分配完成
|
||||
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinv_id,map.get("iostorinv_id"))
|
||||
.and(wrapper -> wrapper.isNull(IOStorInvDis::getStruct_code).or().eq(IOStorInvDis::getStruct_code,"")));
|
||||
.eq(IOStorInvDis::getIostorinv_id, map.get("iostorinv_id"))
|
||||
.and(wrapper -> wrapper.isNull(IOStorInvDis::getStruct_code).or().eq(IOStorInvDis::getStruct_code, "")));
|
||||
// 根据分配货位情况 更新主表单据状态
|
||||
IOStorInv ios = new IOStorInv();
|
||||
ios.setIostorinv_id(map.get("iostorinv_id"));
|
||||
ios.setUpdate_optid(currentUserId);
|
||||
ios.setUpdate_optname(nickName);
|
||||
ios.setUpdate_time(now);
|
||||
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("分配完"));
|
||||
ios.setBill_status(disCount > 0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("分配完"));
|
||||
ioStorInvMapper.updateById(ios);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Structattr divBackStruct(JSONObject whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据库区策略获取仓位
|
||||
* ioType 出入库类型
|
||||
* sect_code 库区编码
|
||||
* stor_code 仓库编码
|
||||
* material_code 物料编码
|
||||
* plan_qty 计划数量
|
||||
* pcsn 批次号
|
||||
*/
|
||||
public Structattr getStructattr(JSONObject param) {
|
||||
return RedissonUtils.lockAndReturn(() -> {
|
||||
List<Structattr> structattrs = iStructattrService.inBoundSectDiv(
|
||||
StrategyStructParam.builder()
|
||||
.ioType(param.getString("ioType"))
|
||||
.sect_code(param.getString("sect_code"))
|
||||
.stor_code(param.getString("stor_code"))
|
||||
.material_code(param.getString("material_code"))
|
||||
.qty(new BigDecimal(param.getString("qty")))
|
||||
.pcsn(param.getString("pcsn"))
|
||||
.build());
|
||||
|
||||
if (CollectionUtils.isEmpty(structattrs)) {
|
||||
throw new BadRequestException("无可用货位");
|
||||
}
|
||||
return structattrs.get(0);
|
||||
}, "1" + param.getString("stor_code"), 5);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void unDivStruct(Map whereJson) {
|
||||
@@ -517,7 +542,6 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
// .eq(GroupPlate::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
// );
|
||||
// task_form.put("group_id", groupPlate.getGroup_id());
|
||||
|
||||
StInTask stInTask = SpringContextHolder.getBean("STInTask");
|
||||
|
||||
String task_id = stInTask.create(task_form);
|
||||
@@ -720,9 +744,9 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
}
|
||||
// 过滤掉不满足载具长宽高的仓位
|
||||
Structattr structattr = structattrList.stream().filter(st ->
|
||||
st.getWidth().compareTo(mdPbStoragevehicleinfo.getVehicle_width()) >=0 &&
|
||||
st.getHeight().compareTo(mdPbStoragevehicleinfo.getVehicle_height()) >=0 &&
|
||||
st.getZdepth().compareTo(mdPbStoragevehicleinfo.getVehicle_long()) >=0
|
||||
st.getWidth() >= 0 &&
|
||||
st.getHeight() >= 0 &&
|
||||
st.getZdepth() >= 0
|
||||
).findAny().get();
|
||||
|
||||
if (ObjectUtil.isEmpty(structattr)){
|
||||
|
||||
@@ -10,6 +10,7 @@ spring:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
@@ -21,11 +22,11 @@ spring:
|
||||
# 是否自动回收超时连接
|
||||
remove-abandoned: true
|
||||
# 超时时间(以秒数为单位)
|
||||
remove-abandoned-timeout: 20
|
||||
remove-abandoned-timeout: 180
|
||||
# 获取连接超时时间
|
||||
max-wait: 9000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
time-between-eviction-runs-millis: 20000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
@@ -33,11 +34,11 @@ spring:
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: true
|
||||
test-on-borrow: false
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
validation-query: select 1 from dual
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
@@ -45,8 +46,12 @@ spring:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
allow: 127.0.0.1
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
log-abandoned: false
|
||||
keep-alive: true
|
||||
keep-alive-between-time-millis: 20000
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
|
||||
Reference in New Issue
Block a user