add:增加手持入库业务
This commit is contained in:
@@ -20,7 +20,6 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.config.ElAdminProperties;
|
import org.nl.config.ElAdminProperties;
|
||||||
import org.nl.config.SpringContextHolder;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
@@ -245,4 +244,7 @@ public class StringUtils {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
package org.nl.common.utils;
|
package org.nl.common.utils;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.config.language.LangProcess;
|
import org.nl.config.language.LangProcess;
|
||||||
|
|
||||||
@@ -41,4 +42,20 @@ public class ValidationUtil{
|
|||||||
public static boolean isEmail(String email) {
|
public static boolean isEmail(String email) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入参校验
|
||||||
|
*/
|
||||||
|
public static void assertNotBlankJson(JSONObject json, String message, String... keys) {
|
||||||
|
if (json == null) {
|
||||||
|
throw new IllegalArgumentException(message);
|
||||||
|
}
|
||||||
|
for (String key : keys) {
|
||||||
|
String value = json.getString(key);
|
||||||
|
if (value == null || value.trim().isEmpty()) {
|
||||||
|
throw new IllegalArgumentException(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.logging.annotation.Log;
|
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.nl.wms.pda.ios_manage.service.PdaIosInService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -15,11 +16,10 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import static org.nl.common.utils.ValidationUtil.assertNotBlankJson;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* 手持入库管理
|
||||||
* 手持入库确认 控制层
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author Liuxy
|
* @author Liuxy
|
||||||
* @since 2025-06-05
|
* @since 2025-06-05
|
||||||
*/
|
*/
|
||||||
@@ -32,17 +32,13 @@ public class PdaIosInController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PdaIosInService pdaIosInService;
|
private PdaIosInService pdaIosInService;
|
||||||
|
|
||||||
@PostMapping("/sweepCode")
|
|
||||||
@Log("扫码解析")
|
|
||||||
@SaIgnore
|
|
||||||
public ResponseEntity<Object> sweepCode(@RequestBody JSONObject whereJson) {
|
|
||||||
return new ResponseEntity<>(pdaIosInService.sweepCode(whereJson),HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/groupPlate")
|
@PostMapping("/groupPlate")
|
||||||
@Log("组盘")
|
@Log("物料组盘")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> groupPlate(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> groupPlate(@RequestBody JSONObject whereJson) {
|
||||||
|
assertNotBlankJson(whereJson, "请求参数不能为空", "vehicle_code", "material_id","qty");
|
||||||
return new ResponseEntity<>(pdaIosInService.groupPlate(whereJson),HttpStatus.OK);
|
return new ResponseEntity<>(pdaIosInService.groupPlate(whereJson),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +56,13 @@ public class PdaIosInController {
|
|||||||
return new ResponseEntity<>(pdaIosInService.deleteDtl(whereJson), HttpStatus.OK);
|
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")
|
@PostMapping("/getSect")
|
||||||
@Log("获取库区")
|
@Log("获取库区")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@@ -67,6 +70,20 @@ public class PdaIosInController {
|
|||||||
return new ResponseEntity<>(pdaIosInService.getSect(), HttpStatus.OK);
|
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("/confirmIn")
|
@PostMapping("/confirmIn")
|
||||||
@Log("入库确认")
|
@Log("入库确认")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@@ -74,4 +91,24 @@ public class PdaIosInController {
|
|||||||
return new ResponseEntity<>(pdaIosInService.confirmIn(whereJson),HttpStatus.OK);
|
return new ResponseEntity<>(pdaIosInService.confirmIn(whereJson),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣选余料回库物料查询
|
||||||
|
*/
|
||||||
|
@PostMapping("/getReturnMaterial")
|
||||||
|
@Log("拣选余料回库物料查询")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> getReturnMaterial(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(pdaIosInService.getReturnMaterial(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/confirmReturnMaterial")
|
||||||
|
@Log("余料回库确认")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> confirmReturnMaterial(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(pdaIosInService.confirmIn(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,14 +13,7 @@ import org.nl.wms.pda.util.PdaResponse;
|
|||||||
*/
|
*/
|
||||||
public interface PdaIosInService {
|
public interface PdaIosInService {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param whereJson {
|
|
||||||
* code: 二维码内容
|
|
||||||
* }
|
|
||||||
* @return PdaResponse
|
|
||||||
*/
|
|
||||||
PdaResponse sweepCode(JSONObject whereJson);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组盘
|
* 组盘
|
||||||
@@ -55,20 +48,59 @@ public interface PdaIosInService {
|
|||||||
*/
|
*/
|
||||||
PdaResponse deleteDtl(JSONObject whereJson);
|
PdaResponse deleteDtl(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询仓库列表
|
||||||
|
*
|
||||||
|
* @return PdaResponse
|
||||||
|
*/
|
||||||
|
PdaResponse getStorageList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料列表
|
||||||
|
*
|
||||||
|
* @return PdaResponse
|
||||||
|
*/
|
||||||
|
PdaResponse getMaterialList(JSONObject whereJson);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询库区
|
* 查询库区
|
||||||
|
*
|
||||||
* @return PdaResponse
|
* @return PdaResponse
|
||||||
*/
|
*/
|
||||||
PdaResponse getSect();
|
PdaResponse getSect();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入库确认
|
* 入库确认
|
||||||
|
*
|
||||||
* @param whereJson {
|
* @param whereJson {
|
||||||
* storagevehicle_code:载具编码
|
* vehicle_code:载具编码
|
||||||
* point_code:点位编码
|
|
||||||
* sect_id:库区
|
* sect_id:库区
|
||||||
* }
|
* }
|
||||||
* @return PdaResponse
|
* @return PdaResponse
|
||||||
*/
|
*/
|
||||||
PdaResponse confirmIn(JSONObject whereJson);
|
PdaResponse confirmIn(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣选余料回库物料查询
|
||||||
|
*
|
||||||
|
* @param whereJson {
|
||||||
|
* vehicle_code:载具编码
|
||||||
|
* }
|
||||||
|
* @return PdaResponse
|
||||||
|
*/
|
||||||
|
PdaResponse getReturnMaterial(JSONObject whereJson);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 余料回库确认
|
||||||
|
*
|
||||||
|
* @param whereJson {
|
||||||
|
* vehicle_code:载具编码
|
||||||
|
* sect_id:库区
|
||||||
|
* }
|
||||||
|
* @return PdaResponse
|
||||||
|
*/
|
||||||
|
PdaResponse confirmReturnMaterial(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,22 @@ package org.nl.wms.pda.ios_manage.service.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
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.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.common.utils.RedissonUtils;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
import org.nl.wms.basedata_manage.service.*;
|
||||||
import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
import org.nl.wms.basedata_manage.service.dao.*;
|
||||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
|
||||||
import org.nl.wms.basedata_manage.service.ISectattrService;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
|
||||||
import org.nl.wms.pda.ios_manage.service.PdaIosInService;
|
import org.nl.wms.pda.ios_manage.service.PdaIosInService;
|
||||||
import org.nl.wms.pda.util.PdaResponse;
|
import org.nl.wms.pda.util.PdaResponse;
|
||||||
|
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||||
|
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;
|
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||||
@@ -30,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -61,7 +64,8 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||||
|
@Resource
|
||||||
|
private IStructattrService iStructattrService;
|
||||||
/**
|
/**
|
||||||
* 计量单位服务
|
* 计量单位服务
|
||||||
*/
|
*/
|
||||||
@@ -80,6 +84,20 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISectattrService iSectattrService;
|
private ISectattrService iSectattrService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点位服务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private ISchBasePointService iSchBasePointService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库区服务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IBsrealStorattrService iSrealStorattrService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入库服务
|
* 入库服务
|
||||||
*/
|
*/
|
||||||
@@ -92,100 +110,51 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public PdaResponse sweepCode(JSONObject whereJson) {
|
|
||||||
// 解析二维码内容:"wl0001##pc050401##1000##kg##dj000001##01"
|
|
||||||
String code = whereJson.getString("code");
|
|
||||||
String[] split = code.split("##");
|
|
||||||
// 物料编码
|
|
||||||
String material_code = split[0];
|
|
||||||
// 批次
|
|
||||||
String pcsn = split[1];
|
|
||||||
// 数量
|
|
||||||
String qty = split[2];
|
|
||||||
// 计量单位
|
|
||||||
String unit_code = split[3];
|
|
||||||
// 单据号
|
|
||||||
String ext_code = split[4];
|
|
||||||
// 业务类型
|
|
||||||
String ext_type = split[5];
|
|
||||||
|
|
||||||
// 校验
|
|
||||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(material_code);
|
|
||||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getByCode(unit_code);
|
|
||||||
GroupPlate groupDao = iMdPbGroupplateService.getOne(
|
|
||||||
new QueryWrapper<GroupPlate>().lambda()
|
|
||||||
.eq(GroupPlate::getMaterial_code, materDao.getMaterial_code())
|
|
||||||
.eq(GroupPlate::getPcsn, pcsn)
|
|
||||||
.eq(GroupPlate::getQty, qty)
|
|
||||||
.eq(GroupPlate::getQty_unit_id, unitDao.getMeasure_unit_id())
|
|
||||||
.eq(GroupPlate::getExt_code, ext_code)
|
|
||||||
.eq(GroupPlate::getExt_type, ext_type)
|
|
||||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("生成"))
|
|
||||||
);
|
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(groupDao)) {
|
|
||||||
// 插入组盘记录表
|
|
||||||
groupDao = new GroupPlate();
|
|
||||||
groupDao.setGroup_id(IdUtil.getStringId());
|
|
||||||
groupDao.setMaterial_code(materDao.getMaterial_code());
|
|
||||||
groupDao.setPcsn(pcsn);
|
|
||||||
groupDao.setQty_unit_id(unitDao.getMeasure_unit_id());
|
|
||||||
groupDao.setQty_unit_name(unitDao.getUnit_name());
|
|
||||||
groupDao.setQty(BigDecimal.valueOf(Double.parseDouble(qty)));
|
|
||||||
groupDao.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成"));
|
|
||||||
groupDao.setExt_code(ext_code);
|
|
||||||
groupDao.setExt_type(ext_type);
|
|
||||||
groupDao.setCreate_id(SecurityUtils.getCurrentUserId());
|
|
||||||
groupDao.setCreate_name(SecurityUtils.getCurrentNickName());
|
|
||||||
groupDao.setCreate_time(DateUtil.now());
|
|
||||||
iMdPbGroupplateService.save(groupDao);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 组织返回数据
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
result.put("group_id", groupDao.getGroup_id());
|
|
||||||
result.put("material_code", material_code);
|
|
||||||
result.put("pcsn", pcsn);
|
|
||||||
result.put("qty", qty);
|
|
||||||
result.put("qty_unit_name", unitDao.getUnit_name());
|
|
||||||
return PdaResponse.requestParamOk(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public PdaResponse groupPlate(JSONObject whereJson) {
|
public PdaResponse groupPlate(JSONObject whereJson) {
|
||||||
// 校验载具
|
// 物料编码
|
||||||
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("storagevehicle_code"));
|
String materialId = whereJson.getString("material_id");
|
||||||
// 校验组盘记录
|
//批次
|
||||||
GroupPlate groupDao = iMdPbGroupplateService.getById(whereJson.getString("group_id"));
|
String pcsn = whereJson.getString("pcsn");
|
||||||
if (!groupDao.getStatus().equals(IOSEnum.GROUP_PLATE_STATUS.code("生成"))) {
|
// 数量
|
||||||
throw new BadRequestException("当前组盘记录不为生成状态!【"+whereJson.getString("group_id")+"】");
|
String qty = whereJson.getString("qty");
|
||||||
|
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
|
||||||
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(materialId);
|
||||||
|
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getBase_unit_id());
|
||||||
|
// 校验
|
||||||
|
if (ObjectUtil.isEmpty(vehicleDao) || ObjectUtil.isEmpty(materDao)) {
|
||||||
|
throw new BadRequestException("载具,物料或单位信息有误!");
|
||||||
}
|
}
|
||||||
// 校验组盘物料批次是否一样
|
RedissonUtils.lock(() -> {
|
||||||
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list(
|
//判断该载具编号是否已经存在库内
|
||||||
new QueryWrapper<GroupPlate>().lambda()
|
long count = iStructattrService.count(
|
||||||
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
new LambdaQueryWrapper<Structattr>()
|
||||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
.eq(Structattr::getStoragevehicle_code, vehicleDao.getStoragevehicle_code())
|
||||||
);
|
);
|
||||||
if (ObjectUtil.isNotEmpty(plateDaoList)) {
|
if (count > 0) {
|
||||||
boolean is_like = plateDaoList.stream()
|
throw new BadRequestException("载具编码:" + vehicleDao.getStoragevehicle_code() + "已存在库内,请对数据进行核实!");
|
||||||
.allMatch(row -> row.getMaterial_code().equals(groupDao.getMaterial_code()) &&
|
|
||||||
row.getPcsn().equals(groupDao.getPcsn())
|
|
||||||
);
|
|
||||||
if (!is_like) {
|
|
||||||
throw new BadRequestException("当前托盘所绑物料批次与当前组盘物料批次不一致!");
|
|
||||||
}
|
}
|
||||||
}
|
}, StatusEnum.STRATEGY_TYPE.code("入库") + vehicleDao.getStoragevehicle_code(), 5);
|
||||||
|
GroupPlate groupDao = GroupPlate.builder()
|
||||||
// 更新数据
|
.group_id(IdUtil.getStringId())
|
||||||
groupDao.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
|
.material_id(materDao.getMaterial_code())
|
||||||
groupDao.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
.storagevehicle_code(vehicleDao.getStoragevehicle_code())
|
||||||
iMdPbGroupplateService.updateById(groupDao);
|
.pcsn(pcsn)
|
||||||
|
.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("组盘"))
|
||||||
|
.ext_code(whereJson.getString("ext_code"))
|
||||||
|
.create_id(SecurityUtils.getCurrentUserId())
|
||||||
|
.create_name(SecurityUtils.getCurrentNickName())
|
||||||
|
.create_time(DateUtil.now())
|
||||||
|
.build();
|
||||||
|
iMdPbGroupplateService.save(groupDao);
|
||||||
return PdaResponse.requestOk();
|
return PdaResponse.requestOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PdaResponse getPlateDtl(JSONObject whereJson) {
|
public PdaResponse getPlateDtl(JSONObject whereJson) {
|
||||||
return PdaResponse.requestParamOk(mdPbGroupplateMapper.getDtl(whereJson));
|
return PdaResponse.requestParamOk(mdPbGroupplateMapper.getDtl(whereJson));
|
||||||
@@ -199,18 +168,68 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PdaResponse getSect() {
|
public PdaResponse getStorageList() {
|
||||||
List<Sectattr> sectList = iSectattrService.list(
|
List<BsrealStorattr> storageList = iSrealStorattrService.list(
|
||||||
new QueryWrapper<Sectattr>().lambda()
|
new QueryWrapper<BsrealStorattr>().lambda()
|
||||||
.eq(Sectattr::getIs_delete, IOSConstant.IS_DELETE_NO)
|
.eq(BsrealStorattr::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||||
.eq(Sectattr::getIs_used, IOSConstant.IS_DELETE_YES)
|
.eq(BsrealStorattr::getIs_used, IOSConstant.IS_DELETE_YES).select(BsrealStorattr::getStor_name, BsrealStorattr::getStor_code, BsrealStorattr::getStor_id)
|
||||||
);
|
);
|
||||||
return PdaResponse.requestParamOk(sectList);
|
return PdaResponse.requestParamOk(storageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PdaResponse getMaterialList(JSONObject whereJson) {
|
||||||
|
String search = whereJson.getString("search");
|
||||||
|
LambdaQueryWrapper<MdMeMaterialbase> wrapper = new QueryWrapper<MdMeMaterialbase>().lambda();
|
||||||
|
if (StringUtils.isNotBlank(search)) {
|
||||||
|
wrapper.nested(r -> r
|
||||||
|
.like(MdMeMaterialbase::getMaterial_code, search)
|
||||||
|
.or()
|
||||||
|
.like(MdMeMaterialbase::getMaterial_name, search)
|
||||||
|
.or()
|
||||||
|
.like(MdMeMaterialbase::getMaterial_spec, search)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
wrapper.eq(MdMeMaterialbase::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||||
|
.eq(MdMeMaterialbase::getIs_used, IOSConstant.IS_DELETE_YES)
|
||||||
|
.select(
|
||||||
|
MdMeMaterialbase::getMaterial_id,
|
||||||
|
MdMeMaterialbase::getMaterial_code,
|
||||||
|
MdMeMaterialbase::getMaterial_name,
|
||||||
|
MdMeMaterialbase::getMaterial_model,
|
||||||
|
MdMeMaterialbase::getMaterial_spec,
|
||||||
|
MdMeMaterialbase::getBase_unit_id
|
||||||
|
)
|
||||||
|
.last("LIMIT 100");
|
||||||
|
List<MdMeMaterialbase> materialist = iMdMeMaterialbaseService.list(wrapper);
|
||||||
|
return PdaResponse.requestParamOk(materialist);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PdaResponse getSect() {
|
||||||
|
PageQuery page = new PageQuery();
|
||||||
|
page.setSize(100);
|
||||||
|
page.setPage(0);
|
||||||
|
IPage<SectattrDto> sectList = iSectattrService.queryAll(new HashMap(), page);
|
||||||
|
List<SectattrDto> result = sectList.getRecords();
|
||||||
|
result.forEach(r -> r.setSect_name(r.getStor_name() + "-" + r.getSect_name()));
|
||||||
|
result.sort(Comparator.comparing(SectattrDto::getSect_name));
|
||||||
|
return PdaResponse.requestParamOk(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public PdaResponse confirmIn(JSONObject whereJson) {
|
public PdaResponse confirmIn(JSONObject whereJson) {
|
||||||
|
//校验起点
|
||||||
|
SchBasePoint schBasePoint = iSchBasePointService.getOne(
|
||||||
|
new LambdaQueryWrapper<SchBasePoint>().
|
||||||
|
eq(SchBasePoint::getStoragevehicle_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);
|
Map<String, Object> jsonMst = organizeInsertData(whereJson);
|
||||||
// 调用服务新增数据
|
// 调用服务新增数据
|
||||||
@@ -238,7 +257,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
// 查询组盘明细
|
// 查询组盘明细
|
||||||
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list(
|
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list(
|
||||||
new QueryWrapper<GroupPlate>().lambda()
|
new QueryWrapper<GroupPlate>().lambda()
|
||||||
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("vehicle_code"))
|
||||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||||
);
|
);
|
||||||
if (ObjectUtil.isEmpty(plateDaoList)) {
|
if (ObjectUtil.isEmpty(plateDaoList)) {
|
||||||
@@ -264,12 +283,12 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
HashMap<String, String> dtl = new HashMap<>();
|
HashMap<String, String> dtl = new HashMap<>();
|
||||||
GroupPlate plateDao = plateDaoList.get(0);
|
GroupPlate plateDao = plateDaoList.get(0);
|
||||||
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
||||||
dtl.put("material_id", plateDao.getMaterial_code());
|
dtl.put("material_id", plateDao.getMaterial_id());
|
||||||
dtl.put("pcsn", plateDao.getPcsn());
|
dtl.put("pcsn", plateDao.getPcsn());
|
||||||
dtl.put("qty_unit_id", plateDao.getQty_unit_id());
|
dtl.put("qty_unit_id", plateDao.getQty_unit_id());
|
||||||
dtl.put("qty_unit_name", plateDao.getQty_unit_name());
|
dtl.put("qty_unit_name", plateDao.getQty_unit_name());
|
||||||
dtl.put("qty", String.valueOf(total_qty));
|
dtl.put("qty", String.valueOf(total_qty));
|
||||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code());
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(plateDao.getMaterial_id());
|
||||||
dtl.put("material_code", materDao.getMaterial_code());
|
dtl.put("material_code", materDao.getMaterial_code());
|
||||||
dtl.put("material_name", materDao.getMaterial_name());
|
dtl.put("material_name", materDao.getMaterial_name());
|
||||||
dtl.put("plan_qty", String.valueOf(total_qty));
|
dtl.put("plan_qty", String.valueOf(total_qty));
|
||||||
@@ -345,4 +364,35 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
|
|
||||||
iRawAssistIStorService.divPoint(jsonMst);
|
iRawAssistIStorService.divPoint(jsonMst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣选余料回库物料查询
|
||||||
|
*
|
||||||
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ public class PdaSchPointServiceImpl extends ServiceImpl<SchBasePointMapper, SchB
|
|||||||
@Transactional
|
@Transactional
|
||||||
public PdaResponse dissect(JSONObject whereJson) {
|
public PdaResponse dissect(JSONObject whereJson) {
|
||||||
// 判断载具是否存在
|
// 判断载具是否存在
|
||||||
iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("storagevehicle_code"));
|
iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
|
||||||
this.update(
|
this.update(
|
||||||
new UpdateWrapper<SchBasePoint>().lambda()
|
new UpdateWrapper<SchBasePoint>().lambda()
|
||||||
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
|
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
|
||||||
.set(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))
|
.set(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code"))
|
||||||
);
|
);
|
||||||
return PdaResponse.requestOk();
|
return PdaResponse.requestOk();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
|||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
Assert.notNull(entity.getTask_status(), "任务状态不能为空!");
|
Assert.notNull(entity.getTask_status(), "任务状态不能为空!");
|
||||||
|
|
||||||
entity.setTask_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
entity.setTask_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
entity.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
entity.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
entity.setCreate_id(currentUserId);
|
entity.setCreate_id(currentUserId);
|
||||||
@@ -105,7 +104,6 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
|||||||
entity.setUpdate_name(nickName);
|
entity.setUpdate_name(nickName);
|
||||||
entity.setUpdate_time(now);
|
entity.setUpdate_time(now);
|
||||||
schBaseTaskMapper.insert(entity);
|
schBaseTaskMapper.insert(entity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ package org.nl.wms.warehouse_management.service.dao;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -12,6 +15,9 @@ import java.math.BigDecimal;
|
|||||||
* 2025/5/20
|
* 2025/5/20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@TableName("md_pb_groupplate")
|
@TableName("md_pb_groupplate")
|
||||||
public class GroupPlate implements Serializable {
|
public class GroupPlate implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -26,11 +32,11 @@ public class GroupPlate implements Serializable {
|
|||||||
* 载具编码
|
* 载具编码
|
||||||
*/
|
*/
|
||||||
private String storagevehicle_code;
|
private String storagevehicle_code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料编码
|
* 物料id
|
||||||
*/
|
*/
|
||||||
private String material_code;
|
private String material_id;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批次
|
* 批次
|
||||||
|
|||||||
@@ -1137,7 +1137,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
groupPlateMapper.update(new GroupPlate(),new LambdaUpdateWrapper<>(GroupPlate.class)
|
groupPlateMapper.update(new GroupPlate(),new LambdaUpdateWrapper<>(GroupPlate.class)
|
||||||
.set(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
.set(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||||
.eq(GroupPlate::getPcsn,ioStorInvDis.getPcsn())
|
.eq(GroupPlate::getPcsn,ioStorInvDis.getPcsn())
|
||||||
.eq(GroupPlate::getMaterial_code,ioStorInvDis.getMaterial_code())
|
.eq(GroupPlate::getMaterial_id,ioStorInvDis.getMaterial_id())
|
||||||
.eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.getStoragevehicle_code())
|
.eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.getStoragevehicle_code())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1221,7 +1221,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
groupPlateMapper.update(new GroupPlate(),new LambdaUpdateWrapper<>(GroupPlate.class)
|
groupPlateMapper.update(new GroupPlate(),new LambdaUpdateWrapper<>(GroupPlate.class)
|
||||||
.set(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
.set(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||||
.eq(GroupPlate::getPcsn,ioStorInvDis.getPcsn())
|
.eq(GroupPlate::getPcsn,ioStorInvDis.getPcsn())
|
||||||
.eq(GroupPlate::getMaterial_code,ioStorInvDis.getMaterial_code())
|
.eq(GroupPlate::getMaterial_id,ioStorInvDis.getMaterial_id())
|
||||||
.eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.getStoragevehicle_code())
|
.eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.getStoragevehicle_code())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,6 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
||||||
|
|
||||||
JSONObject dis = new JSONObject();
|
JSONObject dis = new JSONObject();
|
||||||
dis.put("iostorinvdis_id", IdUtil.getStringId());
|
dis.put("iostorinvdis_id", IdUtil.getStringId());
|
||||||
dis.put("iostorinv_id", iostorinv_id);
|
dis.put("iostorinv_id", iostorinv_id);
|
||||||
@@ -592,13 +591,13 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
.eq(IOStorInvDtl::getIostorinvdtl_id,ioStorInvDis.getIostorinvdtl_id())
|
.eq(IOStorInvDtl::getIostorinvdtl_id,ioStorInvDis.getIostorinvdtl_id())
|
||||||
.ne(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
.ne(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
||||||
);
|
);
|
||||||
// //更新组盘记录表
|
//更新组盘记录表
|
||||||
// mdPbGroupplateService.update(new GroupPlate(),new LambdaUpdateWrapper<>(GroupPlate.class)
|
mdPbGroupplateService.update(new GroupPlate(),new LambdaUpdateWrapper<>(GroupPlate.class)
|
||||||
// .set(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
.set(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||||
// .eq(GroupPlate::getPcsn,ioStorInvDis.getPcsn())
|
.eq(GroupPlate::getPcsn,ioStorInvDis.getPcsn())
|
||||||
// .eq(GroupPlate::getMaterial_code,ioStorInvDis.getMaterial_code())
|
.eq(GroupPlate::getMaterial_id,ioStorInvDis.getMaterial_id())
|
||||||
// .eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.getStoragevehicle_code())
|
.eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.getStoragevehicle_code())
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新主表状态
|
//更新主表状态
|
||||||
|
|||||||
Reference in New Issue
Block a user