opt:优化收货组盘、组盘入库逻辑,修改收货组盘处理批次号默认值为1
This commit is contained in:
@@ -14,19 +14,19 @@ import org.nl.common.utils.MapOf;
|
|||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.basedata_manage.service.*;
|
import org.nl.wms.basedata_manage.service.*;
|
||||||
import org.nl.wms.basedata_manage.service.dao.*;
|
import org.nl.wms.basedata_manage.service.dao.*;
|
||||||
|
import org.nl.wms.pda_manage.ios_manage.purchase.service.InboundPdaService;
|
||||||
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.GroupPlateInboundDto;
|
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.GroupPlateInboundDto;
|
||||||
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.ManualInboundDto;
|
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.ManualInboundDto;
|
||||||
|
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.PdaGroupPlateDto;
|
||||||
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.UsualInboundDto;
|
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.UsualInboundDto;
|
||||||
|
import org.nl.wms.pda_manage.ios_manage.purchase.service.vo.PurchaseMatInfoVo;
|
||||||
import org.nl.wms.pm_manage.SourceBillTypeEnum;
|
import org.nl.wms.pm_manage.SourceBillTypeEnum;
|
||||||
import org.nl.wms.pm_manage.listener.PmManageEvent;
|
import org.nl.wms.pm_manage.listener.PmManageEvent;
|
||||||
import org.nl.wms.pm_manage.purchase.ListenerHandler.PurchaseListenerParams;
|
import org.nl.wms.pm_manage.purchase.ListenerHandler.PurchaseListenerParams;
|
||||||
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
import org.nl.wms.pm_manage.purchase.service.PurchaseService;
|
||||||
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
|
|
||||||
import org.nl.wms.pda_manage.ios_manage.purchase.service.InboundPdaService;
|
|
||||||
import org.nl.wms.pda_manage.ios_manage.purchase.service.vo.PurchaseMatInfoVo;
|
|
||||||
import org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl;
|
import org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl;
|
||||||
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
|
import org.nl.wms.pm_manage.purchase.service.dao.Purchasemst;
|
||||||
import org.nl.wms.pda_manage.ios_manage.purchase.service.dto.PdaGroupPlateDto;
|
import org.nl.wms.pm_manage.purchase.service.enums.PurchaseBillStatus;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||||
@@ -145,6 +145,24 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
public JSONObject submitGroupPlate(PdaGroupPlateDto dto) {
|
public JSONObject submitGroupPlate(PdaGroupPlateDto dto) {
|
||||||
log.info("PDA提交组盘, vehicleCode: {}", dto.getVehicle_code());
|
log.info("PDA提交组盘, vehicleCode: {}", dto.getVehicle_code());
|
||||||
|
|
||||||
|
//判断该载具是否存在组盘信息
|
||||||
|
long statusCount = iMdPbGroupplateService.count(
|
||||||
|
new LambdaQueryWrapper<GroupPlate>()
|
||||||
|
.eq(GroupPlate::getStoragevehicle_code, dto.getVehicle_code())
|
||||||
|
.lt(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库"))
|
||||||
|
);
|
||||||
|
if (statusCount > 0) {
|
||||||
|
throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在组盘信息,请对数据进行核实!");
|
||||||
|
}
|
||||||
|
//判断该载具编号是否已经存在库内
|
||||||
|
long count = iStructattrService.count(
|
||||||
|
new LambdaQueryWrapper<Structattr>()
|
||||||
|
.eq(Structattr::getStoragevehicle_code, dto.getVehicle_code())
|
||||||
|
);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在库内,请对数据进行核实!");
|
||||||
|
}
|
||||||
|
|
||||||
List<PdaGroupPlateDto.GroupPlateDtlDto> detailList = dto.getDetailList();
|
List<PdaGroupPlateDto.GroupPlateDtlDto> detailList = dto.getDetailList();
|
||||||
detailList.forEach((item)->{
|
detailList.forEach((item)->{
|
||||||
List<PurchaseMatInfoVo> purchaseMatInfoVos = purchaseService.selectPdaInMat(MapOf.of("orderNo", item.getOrder_no(),
|
List<PurchaseMatInfoVo> purchaseMatInfoVos = purchaseService.selectPdaInMat(MapOf.of("orderNo", item.getOrder_no(),
|
||||||
@@ -158,28 +176,12 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
}
|
}
|
||||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(item.getSku_code());
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(item.getSku_code());
|
||||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getQty_unit_id());
|
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getQty_unit_id());
|
||||||
//判断该载具是否存在组盘信息
|
|
||||||
long statusCount = iMdPbGroupplateService.count(
|
|
||||||
new LambdaQueryWrapper<GroupPlate>()
|
|
||||||
.eq(GroupPlate::getStoragevehicle_code, dto.getVehicle_code())
|
|
||||||
.lt(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库"))
|
|
||||||
);
|
|
||||||
if (statusCount > 0) {
|
|
||||||
throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在组盘信息,请对数据进行核实!");
|
|
||||||
}
|
|
||||||
//判断该载具编号是否已经存在库内
|
|
||||||
long count = iStructattrService.count(
|
|
||||||
new LambdaQueryWrapper<Structattr>()
|
|
||||||
.eq(Structattr::getStoragevehicle_code, dto.getVehicle_code())
|
|
||||||
);
|
|
||||||
if (count > 0) {
|
|
||||||
throw new BadRequestException("组盘失败:载具编码:" + dto.getVehicle_code() + "已存在库内,请对数据进行核实!");
|
|
||||||
}
|
|
||||||
GroupPlate groupDao = GroupPlate.builder()
|
GroupPlate groupDao = GroupPlate.builder()
|
||||||
.group_id(IdUtil.getStringId())
|
.group_id(IdUtil.getStringId())
|
||||||
.material_code(item.getSku_code())
|
.material_code(item.getSku_code())
|
||||||
.storagevehicle_code(dto.getVehicle_code())
|
.storagevehicle_code(dto.getVehicle_code())
|
||||||
.pcsn(item.getBatch_no())
|
.pcsn(Optional.ofNullable(item.getBatch_no()).filter(s -> !s.isEmpty()).orElse("1"))
|
||||||
.qty_unit_id(unitDao.getMeasure_unit_id())
|
.qty_unit_id(unitDao.getMeasure_unit_id())
|
||||||
.qty_unit_name(unitDao.getUnit_name())
|
.qty_unit_name(unitDao.getUnit_name())
|
||||||
.qty(item.getQty())
|
.qty(item.getQty())
|
||||||
@@ -327,7 +329,7 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
jsonMst.put("biz_date", DateUtil.now());
|
jsonMst.put("biz_date", DateUtil.now());
|
||||||
// 组织明细数据
|
// 组织明细数据
|
||||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||||
HashMap<String, String> dtl = new HashMap<>();
|
HashMap<String, Object> dtl = new HashMap<>();
|
||||||
// GroupPlate plateDao = plateDaoList.get(0);
|
// GroupPlate plateDao = plateDaoList.get(0);
|
||||||
for (GroupPlate plateDao : plateDaoList) {
|
for (GroupPlate plateDao : plateDaoList) {
|
||||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code());
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code());
|
||||||
@@ -338,8 +340,8 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
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", plateDao.getQty());
|
||||||
dtl.put("plan_qty", String.valueOf(total_qty));
|
dtl.put("plan_qty", plateDao.getQty());
|
||||||
dtl.put("ext_code", plateDao.getExt_code());
|
dtl.put("ext_code", plateDao.getExt_code());
|
||||||
dtl.put("ext_type", plateDao.getExt_type());
|
dtl.put("ext_type", plateDao.getExt_type());
|
||||||
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
||||||
@@ -431,7 +433,7 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
jsonMst.put("biz_date", DateUtil.now());
|
jsonMst.put("biz_date", DateUtil.now());
|
||||||
// 组织明细数据
|
// 组织明细数据
|
||||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||||
HashMap<String, String> dtl = new HashMap<>();
|
HashMap<String, Object> dtl = new HashMap<>();
|
||||||
// GroupPlate plateDao = plateDaoList.get(0);
|
// GroupPlate plateDao = plateDaoList.get(0);
|
||||||
for (GroupPlate plateDao : plateDaoList) {
|
for (GroupPlate plateDao : plateDaoList) {
|
||||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code());
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code());
|
||||||
@@ -442,8 +444,8 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
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", plateDao.getQty());
|
||||||
dtl.put("plan_qty", String.valueOf(total_qty));
|
dtl.put("plan_qty", plateDao.getQty());
|
||||||
dtl.put("ext_code", plateDao.getExt_code());
|
dtl.put("ext_code", plateDao.getExt_code());
|
||||||
dtl.put("ext_type", plateDao.getExt_type());
|
dtl.put("ext_type", plateDao.getExt_type());
|
||||||
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
||||||
|
|||||||
Reference in New Issue
Block a user