opt: 出库修改

This commit is contained in:
2025-12-01 16:20:35 +08:00
parent d3382c4a16
commit 2942b5d65e
4 changed files with 90 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ import java.util.LinkedList;
import java.util.List;
/**
* hint: 解包机已经没有输送线
* @Author: lyd
* @Date: 2025/8/11
*/

View File

@@ -11,6 +11,7 @@ import java.math.BigDecimal;
*/
@Data
public class GroupInfoPdaVo implements Serializable {
private String group_id;
private String storagevehicle_code;
private String pcsn;
private BigDecimal qty;

View File

@@ -480,7 +480,7 @@ public class PdaJBServiceImpl implements PdaJBService {
ioStorInv.setStor_code(structattr.getStor_code());
ioStorInv.setStor_name(structattr.getStor_name());
ioStorInv.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
ioStorInv.setBill_type("0009");
ioStorInv.setBill_type("1009");
ioStorInv.setIs_delete(BaseDataEnum.IS_YES_NOT.code(""));
ioStorInv.setIs_upload(BaseDataEnum.IS_YES_NOT.code(""));
ioStorInv.setInput_optid(currentUserId);
@@ -703,7 +703,92 @@ public class PdaJBServiceImpl implements PdaJBService {
}
List<GroupInfoPdaVo> groups = pdaJBMapper.getGroupInfoByVehicle(structattr.getStoragevehicle_code(), "02");
if (groups.size() > 0) {
throw new BadRequestException("当前位置是满桶,无法取出,请确认库存信息!");
GroupInfoPdaVo groupInfoPdaVo = groups.get(0);
GroupPlate groupPlate = groupplateService.getById(groupInfoPdaVo.getGroup_id());
MdMeMaterialbase materialbase = materialbaseService.getByCode(groupPlate.getMaterial_code(), true);
MdPbStoragevehicleinfo vehicleVo = storagevehicleinfoService.getByCode(groupPlate.getStoragevehicle_code());
if (ObjectUtil.isEmpty(vehicleVo)) {
throw new BadRequestException("载具" + groupPlate.getStoragevehicle_code() + "不存在!");
}
// 1、创建出库单、明细、分配明细
// 1.1 单据表
String invId = IdUtil.getStringId();
IOStorInv ioStorInv = new IOStorInv();
ioStorInv.setIostorinv_id(invId);
ioStorInv.setBill_code(CodeUtil.getNewCode("OUT_STORE_CODE"));
ioStorInv.setBiz_date(DateUtil.format(new Date(), "yyyy-MM-dd"));
ioStorInv.setIo_type(IOSEnum.IO_TYPE.code("出库"));
ioStorInv.setDetail_count(1);
ioStorInv.setCreate_mode(IOSEnum.CREATE_MODE.code("终端产生"));
ioStorInv.setStor_id(structattr.getStor_id());
ioStorInv.setStor_code(structattr.getStor_code());
ioStorInv.setStor_name(structattr.getStor_name());
ioStorInv.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
ioStorInv.setBill_type("0009");
ioStorInv.setIs_delete(BaseDataEnum.IS_YES_NOT.code(""));
ioStorInv.setIs_upload(BaseDataEnum.IS_YES_NOT.code(""));
ioStorInv.setInput_optid(currentUserId);
ioStorInv.setInput_optname(nickName);
ioStorInv.setInput_time(now);
ioStorInv.setUpdate_optid(currentUserId);
ioStorInv.setUpdate_optname(nickName);
ioStorInv.setUpdate_time(now);
ioStorInv.setTotal_qty(groupPlate.getQty());
ioStorInv.setDetail_count(1);
outBillService.save(ioStorInv);
// 1.2 单据明细
IOStorInvDtl dtl = new IOStorInvDtl();
dtl.setIostorinvdtl_id(IdUtil.getStringId());
dtl.setIostorinv_id(invId);
dtl.setSeq_no("1");
dtl.setMaterial_id(materialbase.getMaterial_id());
dtl.setMaterial_code(groupPlate.getMaterial_code());
dtl.setPcsn(groupPlate.getPcsn());
dtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
dtl.setQty_unit_id(groupPlate.getQty_unit_id());
dtl.setQty_unit_name(groupPlate.getQty_unit_name());
dtl.setPlan_qty(groupPlate.getQty());
dtl.setAssign_qty(groupPlate.getQty());
dtl.setUnassign_qty(BigDecimal.ZERO);
ioStorInvDtlMapper.insert(dtl);
// 1.3 分配明细
IOStorInvDis ioStorInvDis = new IOStorInvDis();
ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId());
ioStorInvDis.setIostorinv_id(dtl.getIostorinv_id());
ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id());
ioStorInvDis.setSeq_no("1");
ioStorInvDis.setSect_id(structattr.getSect_id());
ioStorInvDis.setPcsn(groupPlate.getPcsn());
ioStorInvDis.setMaterial_id(materialbase.getMaterial_id());
ioStorInvDis.setMaterial_code(materialbase.getMaterial_code());
ioStorInvDis.setSect_name(structattr.getSect_name());
ioStorInvDis.setSect_code(structattr.getSect_code());
ioStorInvDis.setStruct_id(structattr.getStruct_id());
ioStorInvDis.setStruct_name(structattr.getStruct_name());
ioStorInvDis.setStruct_code(structattr.getStruct_code());
ioStorInvDis.setStoragevehicle_code(groupPlate.getStoragevehicle_code());
ioStorInvDis.setIs_issued(BaseDataEnum.IS_YES_NOT.code(""));
ioStorInvDis.setQty_unit_id(groupPlate.getQty_unit_id());
ioStorInvDis.setQty_unit_name(groupPlate.getQty_unit_name());
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("完成"));
ioStorInvDis.setPlan_qty(groupPlate.getQty());
ioStorInvDisMapper.insert(ioStorInvDis);
// 1.3 仓位赋值
structattr.setStoragevehicle_code(groupPlate.getStoragevehicle_code());
structattr.setStoragevehicle_type(vehicleVo.getStoragevehicle_type());
structattr.setOccupancy_state(3);
structattr.setUpdate_id(currentUserId);
structattr.setUpdate_name(nickName);
structattr.setUpdate_time(now);
structattrService.updateById(structattr);
// 1.4 组盘设置入库
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
groupPlate.setUpdate_time(now);
groupplateService.updateById(groupPlate);
return PdaResponse.requestOk();
// throw new BadRequestException("当前位置是满桶,无法取出,请确认库存信息!");
}
// 1.3 仓位赋值
structattr.setStoragevehicle_code(null);

View File

@@ -39,6 +39,7 @@
</select>
<select id="getGroupInfoByVehicle" resultType="org.nl.wms.pda_manage.sch_manage.service.GroupInfoPdaVo">
SELECT
mg.group_id,
mg.storagevehicle_code,
mg.pcsn,
mg.qty,