rev:平板功能测试修改

This commit is contained in:
2025-09-17 15:08:28 +08:00
parent 78411c83b7
commit 523f8e69b0
7 changed files with 305 additions and 102 deletions

View File

@@ -42,6 +42,13 @@ public class PdaLargeMaterialBoxController {
return new ResponseEntity<>(pdaLargeMaterialBoxService.unBindEmptyVehicle(reqParam), HttpStatus.OK); return new ResponseEntity<>(pdaLargeMaterialBoxService.unBindEmptyVehicle(reqParam), HttpStatus.OK);
} }
@PostMapping("/getType")
@Log("大料箱-料箱入库-获取入库类型")
@SaIgnore
public ResponseEntity<Object> getType(@RequestBody JSONObject reqParam) {
return new ResponseEntity<>(pdaLargeMaterialBoxService.getType(reqParam), HttpStatus.OK);
}
@PostMapping("/materialBoxInConfirm") @PostMapping("/materialBoxInConfirm")
@Log("大料箱-料箱入库-确认入库") @Log("大料箱-料箱入库-确认入库")
@SaIgnore @SaIgnore

View File

@@ -121,4 +121,11 @@ public interface PdaLargeMaterialBoxService {
* @return * @return
*/ */
PdaResponse getInvInfoQty(JSONObject reqParam); PdaResponse getInvInfoQty(JSONObject reqParam);
/**
* 获取入库类型
* @param reqParam
* @return
*/
PdaResponse getType(JSONObject reqParam);
} }

View File

@@ -16,6 +16,7 @@ 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.large_material_box.service.PdaLargeMaterialBoxService; import org.nl.wms.pda.large_material_box.service.PdaLargeMaterialBoxService;
import org.nl.wms.pda.util.PDAEnum;
import org.nl.wms.pda.util.PdaResponse; import org.nl.wms.pda.util.PdaResponse;
import org.nl.wms.pdm_manage.enums.BomEnum; import org.nl.wms.pdm_manage.enums.BomEnum;
import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialDtlService; import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialDtlService;
@@ -36,10 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -99,21 +97,37 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
Assert.notEmpty(storagevehicle_code, "载具编码不能为空!"); Assert.notEmpty(storagevehicle_code, "载具编码不能为空!");
Structattr structattr = structattrService.getOne(new LambdaQueryWrapper<Structattr>() Structattr structattr = structattrService.getOne(new LambdaQueryWrapper<Structattr>()
.eq(Structattr::getStruct_code, struct_code) .eq(Structattr::getStruct_code, struct_code)
.eq(Structattr::getIs_delete, "0") .eq(Structattr::getIs_delete, IOSConstant.ZERO)
.eq(Structattr::getIs_used, "1")); .eq(Structattr::getIs_used, IOSConstant.ONE));
if (ObjectUtil.isEmpty(structattr)) { if (ObjectUtil.isEmpty(structattr)) {
throw new BadRequestException("仓位信息不存在或未启用!"); throw new BadRequestException("仓位信息不存在或未启用!");
} }
// 判断是否是大料箱库区
if (!structattr.getSect_code().equals(IOSEnum.SECT_CODE.code("大料箱区"))) {
throw new BadRequestException("当前仓位不属于大料箱库区【" + structattr.getStruct_code() + "");
}
// 判断是否有货
if (ObjectUtil.isNotEmpty(structattr.getStoragevehicle_code())) {
throw new BadRequestException("当前仓位有载具存在【" + structattr.getStoragevehicle_code() + "");
}
if (!structattr.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
throw new BadRequestException("当前仓位被锁定,无法绑定!");
}
MdPbStoragevehicleinfo storagevehicleinfo = mdPbStoragevehicleinfoService.getOne(new LambdaQueryWrapper<MdPbStoragevehicleinfo>() MdPbStoragevehicleinfo storagevehicleinfo = mdPbStoragevehicleinfoService.getOne(new LambdaQueryWrapper<MdPbStoragevehicleinfo>()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, storagevehicle_code) .eq(MdPbStoragevehicleinfo::getStoragevehicle_code, storagevehicle_code)
.eq(MdPbStoragevehicleinfo::getIs_delete, "0") .eq(MdPbStoragevehicleinfo::getIs_delete, IOSConstant.ZERO)
.eq(MdPbStoragevehicleinfo::getIs_used, "1")); .eq(MdPbStoragevehicleinfo::getIs_used, IOSConstant.ONE));
if (ObjectUtil.isEmpty(storagevehicleinfo)) { if (ObjectUtil.isEmpty(storagevehicleinfo)) {
throw new BadRequestException("载具信息不存在或未启用!"); throw new BadRequestException("载具信息不存在或未启用!");
} }
// 判断当前载具是否是大料箱载具
if (!storagevehicleinfo.getStoragevehicle_type().equals(IOSEnum.VEHICLE_TYPE.code("大料箱"))) {
throw new BadRequestException("当前载具不属于大料箱载具【" + storagevehicleinfo.getStoragevehicle_code() + "");
}
structattr.setStoragevehicle_code(storagevehicle_code); structattr.setStoragevehicle_code(storagevehicle_code);
structattr.setStoragevehicle_type(storagevehicleinfo.getStoragevehicle_type()); structattr.setIs_emptyvehicle(IOSConstant.ONE);
structattr.setIs_emptyvehicle("1");
structattr.setUpdate_optid(SecurityUtils.getCurrentUserId()); structattr.setUpdate_optid(SecurityUtils.getCurrentUserId());
structattr.setUpdate_optname(SecurityUtils.getCurrentNickName()); structattr.setUpdate_optname(SecurityUtils.getCurrentNickName());
structattr.setUpdate_time(DateUtil.now()); structattr.setUpdate_time(DateUtil.now());
@@ -132,16 +146,21 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
.eq(Structattr::getStruct_code, struct_code) .eq(Structattr::getStruct_code, struct_code)
.or() .or()
.eq(Structattr::getStoragevehicle_code, storagevehicle_code) .eq(Structattr::getStoragevehicle_code, storagevehicle_code)
.eq(Structattr::getIs_delete, "0") .eq(Structattr::getIs_delete, IOSConstant.ONE)
.eq(Structattr::getIs_used, "1")); .eq(Structattr::getIs_used, IOSConstant.ZERO));
if (ObjectUtil.isEmpty(structattr)) { if (ObjectUtil.isEmpty(structattr)) {
throw new BadRequestException("仓位信息不存在或未启用!"); throw new BadRequestException("仓位信息不存在或未启用!");
} }
if (!StrUtil.equals(structattr.getIs_emptyvehicle(), "0")) { if (!StrUtil.equals(structattr.getIs_emptyvehicle(), IOSConstant.ONE)) {
throw new BadRequestException("当前位或载具不是空载具,无法解绑!"); throw new BadRequestException("当前位或载具不是空载具,无法解绑!");
} }
if (!structattr.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
throw new BadRequestException("当前仓位被锁定,无法解绑!");
}
structattr.setStoragevehicle_code(""); structattr.setStoragevehicle_code("");
structattr.setIs_emptyvehicle("0"); structattr.setIs_emptyvehicle(IOSConstant.ZERO);
structattr.setUpdate_optid(SecurityUtils.getCurrentUserId()); structattr.setUpdate_optid(SecurityUtils.getCurrentUserId());
structattr.setUpdate_optname(SecurityUtils.getCurrentNickName()); structattr.setUpdate_optname(SecurityUtils.getCurrentNickName());
structattr.setUpdate_time(DateUtil.now()); structattr.setUpdate_time(DateUtil.now());
@@ -161,7 +180,20 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
Structattr structattr = structattrService.getOne(new LambdaQueryWrapper<Structattr>() Structattr structattr = structattrService.getOne(new LambdaQueryWrapper<Structattr>()
.eq(Structattr::getStruct_code, struct_code)); .eq(Structattr::getStruct_code, struct_code));
Assert.notNull(structattr, "仓位信息不存在!"); Assert.notNull(structattr, "仓位信息不存在!");
JSONArray tableData = reqParam.getJSONArray("tableData");
// 判断是否是大料箱库区
if (!structattr.getSect_code().equals(IOSEnum.SECT_CODE.code("大料箱区"))) {
throw new BadRequestException("当前仓位不属于大料箱库区【" + structattr.getStruct_code() + "");
}
// 判断是否有货
if (ObjectUtil.isNotEmpty(structattr.getStoragevehicle_code())) {
throw new BadRequestException("当前仓位有载具存在【" + structattr.getStoragevehicle_code() + "");
}
if (!structattr.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
throw new BadRequestException("当前仓位被锁定!");
}
List<LinkedHashMap> tableData = reqParam.getJSONArray("tableData").toJavaList(LinkedHashMap.class);
Assert.notEmpty(tableData, "组盘信息数据不能为空!"); Assert.notEmpty(tableData, "组盘信息数据不能为空!");
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("bill_type", bill_type); param.put("bill_type", bill_type);
@@ -175,17 +207,22 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
param.put("tableData", tableData); param.put("tableData", tableData);
rawAssistIStorService.insertPdaDtl(param); rawAssistIStorService.insertPdaDtl(param);
//更新组盘表组盘状态为入库状态 //更新组盘表组盘状态为入库状态
JSONObject row = tableData.getJSONObject(0); LinkedHashMap row = tableData.get(0);
String group_id = row.getString("group_id"); String group_id = row.get("group_id").toString();
GroupPlate groupPlate = mdPbGroupplateService.getById(group_id); GroupPlate groupPlate = mdPbGroupplateService.getById(group_id);
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("入库")); groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("入库"));
mdPbGroupplateService.updateById(groupPlate); mdPbGroupplateService.updateById(groupPlate);
MdPbStoragevehicleinfo storagevehicleinfo = mdPbStoragevehicleinfoService.getByCode(groupPlate.getStoragevehicle_code()); MdPbStoragevehicleinfo storagevehicleinfo = mdPbStoragevehicleinfoService.getByCode(groupPlate.getStoragevehicle_code());
Assert.notNull(storagevehicleinfo, "载具信息不存在!"); Assert.notNull(storagevehicleinfo, "载具信息不存在!");
// 判断当前载具是否是大料箱载具
if (!storagevehicleinfo.getStoragevehicle_type().equals(IOSEnum.VEHICLE_TYPE.code("大料箱"))) {
throw new BadRequestException("当前载具不属于大料箱载具【" + storagevehicleinfo.getStoragevehicle_code() + "");
}
//更新仓位表载具信息 //更新仓位表载具信息
structattr.setStoragevehicle_code(storagevehicleinfo.getStoragevehicle_code()); structattr.setStoragevehicle_code(storagevehicleinfo.getStoragevehicle_code());
structattr.setStoragevehicle_type(storagevehicleinfo.getStoragevehicle_type()); structattr.setIs_emptyvehicle(IOSConstant.ZERO);
structattr.setIs_emptyvehicle("0");
structattr.setUpdate_optid(SecurityUtils.getCurrentUserId()); structattr.setUpdate_optid(SecurityUtils.getCurrentUserId());
structattr.setUpdate_optname(SecurityUtils.getCurrentNickName()); structattr.setUpdate_optname(SecurityUtils.getCurrentNickName());
structattr.setUpdate_time(DateUtil.now()); structattr.setUpdate_time(DateUtil.now());
@@ -280,69 +317,68 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
String ts_storagevehicle_code = reqParam.getString("ts_storagevehicle_code"); String ts_storagevehicle_code = reqParam.getString("ts_storagevehicle_code");
String plan_qty = reqParam.getString("plan_qty"); String plan_qty = reqParam.getString("plan_qty");
Assert.notEmpty(plan_qty, "计划数量不能为空!"); Assert.notEmpty(plan_qty, "计划数量不能为空!");
if (StrUtil.isBlank(ts_storagevehicle_code)) {
//如果配送载具为空,则直接清除库存,将仓位表中的载具号清除,并标记为空载具,组盘信息更新为出库 // 查询分配明细
MdPbStoragevehicleext storagevehicleext = mdPbStoragevehicleextService.getOne(new LambdaQueryWrapper<MdPbStoragevehicleext>()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, storagevehicle_code));
if (storagevehicleext != null) {
mdPbStoragevehicleextService.removeById(storagevehicleext.getStoragevehicleext_id());
}
Structattr structattr = structattrService.findByCode(struct_code);
if (structattr != null) {
structattr.setIs_emptyvehicle("1");
structattr.setUpdate_optid(SecurityUtils.getCurrentUserId());
structattr.setUpdate_optname(SecurityUtils.getCurrentNickName());
structattr.setUpdate_time(DateUtil.now());
structattrService.updateById(structattr);
}
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, storagevehicle_code));
if (groupPlate != null) {
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
mdPbGroupplateService.updateById(groupPlate);
}
} else {
//如果配送载具不为空,则更新库存,更新组盘信息中的数量
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, storagevehicle_code));
if (groupPlate != null) {
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
groupPlate.setQty(groupPlate.getQty().subtract(new BigDecimal(plan_qty)));
mdPbGroupplateService.updateById(groupPlate);
}
MdPbStoragevehicleext storagevehicleext = mdPbStoragevehicleextService.getOne(new LambdaQueryWrapper<MdPbStoragevehicleext>()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, ts_storagevehicle_code));
if (storagevehicleext != null) {
storagevehicleext.setCanuse_qty(storagevehicleext.getCanuse_qty().subtract(new BigDecimal(plan_qty)));
mdPbStoragevehicleextService.updateById(storagevehicleext);
}
}
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectById(iostorinvdis_id); IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectById(iostorinvdis_id);
if (ioStorInvDis != null) { // 判断是否是拣选:不是:清空仓位信息
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("完成")); if (ioStorInvDis.getIs_check().equals(IOSConstant.ZERO)) {
ioStorInvDisMapper.updateById(ioStorInvDis); Structattr attrDao = structattrService.getByCode(ioStorInvDis.getStruct_code());
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<IOStorInvDis>()
.eq(IOStorInvDis::getIostorinvdtl_id, ioStorInvDis.getIostorinvdtl_id()) // 判断是否有新载具
.lt(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))); if (ObjectUtil.isNotEmpty(ts_storagevehicle_code)) {
if (ioStorInvDisList.size() == 0) { MdPbStoragevehicleinfo tsVehicle = mdPbStoragevehicleinfoService.getByCode(ts_storagevehicle_code);
//更新单据状态为完成 if (ObjectUtil.isEmpty(tsVehicle)) {
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id()); throw new BadRequestException("配送载具不存在!【"+ts_storagevehicle_code+"");
if (ioStorInvDtl != null) { }
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成")); if (!tsVehicle.getStoragevehicle_type().equals(IOSEnum.VEHICLE_TYPE.code("大料箱"))) {
ioStorInvDtlMapper.updateById(ioStorInvDtl); throw new BadRequestException("当前配送载具不属于大料箱载具!【"+ts_storagevehicle_code+"");
List<IOStorInvDtl> storInvDtlList = ioStorInvDtlMapper.selectList(new LambdaQueryWrapper<IOStorInvDtl>() }
.eq(IOStorInvDtl::getIostorinv_id, ioStorInvDtl.getIostorinv_id()) // 更新组盘信息为新载具信息
.lt(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("完成"))); mdPbGroupplateService.update(
if (storInvDtlList.size() == 0) { new UpdateWrapper<GroupPlate>().lambda()
IOStorInv ioStorInv = iOutBillService.getById(ioStorInvDtl.getIostorinv_id()); .set(GroupPlate::getStoragevehicle_code, ts_storagevehicle_code)
if (ioStorInv != null) { .eq(GroupPlate::getStoragevehicle_code, ioStorInvDis.getStoragevehicle_code())
ioStorInv.setBill_status(IOSEnum.BILL_STATUS.code("完成")); .eq(GroupPlate::getPcsn, ioStorInvDis.getPcsn())
iOutBillService.updateById(ioStorInv); .eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
} .eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
} );
} // 更新仓位
attrDao.setIs_emptyvehicle(IOSConstant.ONE);
} else {
// 更新仓位
attrDao.setStoragevehicle_code("");
}
structattrService.updateById(attrDao);
} else {
// 拣选
// 判断是否有新载具
if (ObjectUtil.isNotEmpty(ts_storagevehicle_code)) {
MdPbStoragevehicleinfo tsVehicle = mdPbStoragevehicleinfoService.getByCode(ts_storagevehicle_code);
if (ObjectUtil.isEmpty(tsVehicle)) {
throw new BadRequestException("配送载具不存在!【"+ts_storagevehicle_code+"");
}
if (!tsVehicle.getStoragevehicle_type().equals(IOSEnum.VEHICLE_TYPE.code("大料箱"))) {
throw new BadRequestException("当前配送载具不属于大料箱载具!【"+ts_storagevehicle_code+"");
}
// 新增组盘信息
GroupPlate plate = mdPbGroupplateService.getOne(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, ioStorInvDis.getStoragevehicle_code())
.eq(GroupPlate::getPcsn, ioStorInvDis.getPcsn())
.eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
);
plate.setStoragevehicle_code(ts_storagevehicle_code);
plate.setQty(ioStorInvDis.getPlan_qty());
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
mdPbGroupplateService.create(plate);
} }
} }
// 调用出库服务明细确认方法
iOutBillService.disFinish(ioStorInvDis);
return PdaResponse.requestOk(); return PdaResponse.requestOk();
} }
@@ -441,7 +477,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
// 更新移入库存信息 // 更新移入库存信息
iMdPbStoragevehicleextService.update( iMdPbStoragevehicleextService.update(
new UpdateWrapper<MdPbStoragevehicleext>().lambda() new UpdateWrapper<MdPbStoragevehicleext>().lambda()
.set(MdPbStoragevehicleext::getCanuse_qty, NumberUtil.add(jsonOut.getBigDecimal("qty"),jsonIn.getBigDecimal("qty"))) .set(MdPbStoragevehicleext::getCanuse_qty, NumberUtil.add(jsonOut.getBigDecimal("qty"), jsonIn.getBigDecimal("qty")))
.eq(MdPbStoragevehicleext::getStoragevehicle_code, jsonIn.getString("storagevehicle_code")) .eq(MdPbStoragevehicleext::getStoragevehicle_code, jsonIn.getString("storagevehicle_code"))
.eq(MdPbStoragevehicleext::getMaterial_id, jsonIn.getString("material_id")) .eq(MdPbStoragevehicleext::getMaterial_id, jsonIn.getString("material_id"))
.eq(MdPbStoragevehicleext::getPcsn, jsonIn.getString("pcsn")) .eq(MdPbStoragevehicleext::getPcsn, jsonIn.getString("pcsn"))
@@ -450,7 +486,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
// 更新组盘信息 // 更新组盘信息
mdPbGroupplateService.update( mdPbGroupplateService.update(
new UpdateWrapper<GroupPlate>().lambda() new UpdateWrapper<GroupPlate>().lambda()
.set(GroupPlate::getQty, NumberUtil.add(jsonOut.getBigDecimal("qty"),jsonIn.getBigDecimal("qty"))) .set(GroupPlate::getQty, NumberUtil.add(jsonOut.getBigDecimal("qty"), jsonIn.getBigDecimal("qty")))
.eq(GroupPlate::getGroup_id, jsonIn.getString("group_id")) .eq(GroupPlate::getGroup_id, jsonIn.getString("group_id"))
); );
@@ -473,7 +509,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
iStIvtMoveinvService.confirmTask(dtlDao); iStIvtMoveinvService.confirmTask(dtlDao);
} else { } else {
// 创建移库单据并确认 // 创建移库单据并确认
createPdaMove(jsonOut,jsonIn); createPdaMove(jsonOut, jsonIn);
} }
return PdaResponse.requestOk(); return PdaResponse.requestOk();
@@ -481,6 +517,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
/** /**
* 创建移库单据 * 创建移库单据
*
* @param jsonOut 移出数据 * @param jsonOut 移出数据
* @param jsonIn 移入数据 * @param jsonIn 移入数据
*/ */
@@ -539,7 +576,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
// 更新移入库存信息 // 更新移入库存信息
iMdPbStoragevehicleextService.update( iMdPbStoragevehicleextService.update(
new UpdateWrapper<MdPbStoragevehicleext>().lambda() new UpdateWrapper<MdPbStoragevehicleext>().lambda()
.set(MdPbStoragevehicleext::getCanuse_qty, NumberUtil.add(jsonOut.getBigDecimal("qty"),jsonIn.getBigDecimal("qty"))) .set(MdPbStoragevehicleext::getCanuse_qty, NumberUtil.add(jsonOut.getBigDecimal("qty"), jsonIn.getBigDecimal("qty")))
.eq(MdPbStoragevehicleext::getStoragevehicle_code, jsonIn.getString("storagevehicle_code")) .eq(MdPbStoragevehicleext::getStoragevehicle_code, jsonIn.getString("storagevehicle_code"))
.eq(MdPbStoragevehicleext::getMaterial_id, jsonIn.getString("material_id")) .eq(MdPbStoragevehicleext::getMaterial_id, jsonIn.getString("material_id"))
.eq(MdPbStoragevehicleext::getPcsn, jsonIn.getString("pcsn")) .eq(MdPbStoragevehicleext::getPcsn, jsonIn.getString("pcsn"))
@@ -548,7 +585,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
// 更新组盘信息 // 更新组盘信息
mdPbGroupplateService.update( mdPbGroupplateService.update(
new UpdateWrapper<GroupPlate>().lambda() new UpdateWrapper<GroupPlate>().lambda()
.set(GroupPlate::getQty, NumberUtil.add(jsonOut.getBigDecimal("qty"),jsonIn.getBigDecimal("qty"))) .set(GroupPlate::getQty, NumberUtil.add(jsonOut.getBigDecimal("qty"), jsonIn.getBigDecimal("qty")))
.eq(GroupPlate::getGroup_id, jsonIn.getString("group_id")) .eq(GroupPlate::getGroup_id, jsonIn.getString("group_id"))
); );
@@ -592,7 +629,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
* "fac_qty": 48 -- 盘点数量 * "fac_qty": 48 -- 盘点数量
* } * }
*/ */
iStIvtCheckmstService.dtlCheckConfirm(JSONObject.toJavaObject(reqParam,StIvtCheckdtl.class)); iStIvtCheckmstService.dtlCheckConfirm(JSONObject.toJavaObject(reqParam, StIvtCheckdtl.class));
return PdaResponse.requestOk(); return PdaResponse.requestOk();
} }
@@ -644,7 +681,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
Assert.notBlank(storagevehicle_code, "载具号不能为空!"); Assert.notBlank(storagevehicle_code, "载具号不能为空!");
List<GroupPlate> groupPlateList = mdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>() List<GroupPlate> groupPlateList = mdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, storagevehicle_code) .eq(GroupPlate::getStoragevehicle_code, storagevehicle_code)
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))); .eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘")));
//将GroupPlate对象转换为Map //将GroupPlate对象转换为Map
List<Map<String, Object>> groupPlateListMap = groupPlateList.stream() List<Map<String, Object>> groupPlateListMap = groupPlateList.stream()
.map(groupPlate -> { .map(groupPlate -> {
@@ -658,20 +695,22 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
groupPlateMap.put("material_name", materialbase.getMaterial_name()); groupPlateMap.put("material_name", materialbase.getMaterial_name());
groupPlateMap.put("material_spec", materialbase.getMaterial_spec()); groupPlateMap.put("material_spec", materialbase.getMaterial_spec());
groupPlateMap.put("material_mode", materialbase.getMaterial_model()); groupPlateMap.put("material_mode", materialbase.getMaterial_model());
groupPlateMap.put("quality_time", materialbase.getQuality_time());
} }
groupPlateMap.put("qty_unit_name", groupPlate.getQty_unit_name()); groupPlateMap.put("qty_unit_name", groupPlate.getQty_unit_name());
groupPlateMap.put("qty_unit_id", groupPlate.getQty_unit_id());
groupPlateMap.put("qty", groupPlate.getQty()); groupPlateMap.put("qty", groupPlate.getQty());
MdCsSupplierbase mdCsSupplierbase = mdCsSupplierbaseService.getOne(new LambdaQueryWrapper<MdCsSupplierbase>().eq(MdCsSupplierbase::getSupp_code, groupPlate.getSupp_code())); MdCsSupplierbase mdCsSupplierbase = mdCsSupplierbaseService.getOne(new LambdaQueryWrapper<MdCsSupplierbase>().eq(MdCsSupplierbase::getSupp_code, groupPlate.getSupp_code()));
groupPlateMap.put("supp_code", groupPlate.getSupp_code()); groupPlateMap.put("supp_code", groupPlate.getSupp_code());
if (ObjectUtil.isNotEmpty(mdCsSupplierbase)) { if (ObjectUtil.isNotEmpty(mdCsSupplierbase)) {
groupPlateMap.put("supp_name", mdCsSupplierbase.getSupp_name()); groupPlateMap.put("supp_name", mdCsSupplierbase.getSupp_name());
} }
groupPlateMap.put("quality_time", groupPlate.getQuality_time());
groupPlateMap.put("produce_time", groupPlate.getProduce_time()); groupPlateMap.put("produce_time", groupPlate.getProduce_time());
groupPlateMap.put("execution_stand", groupPlate.getExecution_stand()); groupPlateMap.put("execution_stand", groupPlate.getExecution_stand());
groupPlateMap.put("bake_num", groupPlate.getBake_num()); groupPlateMap.put("bake_num", groupPlate.getBake_num());
groupPlateMap.put("quality_type", groupPlate.getQuality_type()); groupPlateMap.put("quality_type", groupPlate.getQuality_type());
groupPlateMap.put("box_type", groupPlate.getBox_type()); groupPlateMap.put("box_type", groupPlate.getBox_type());
groupPlateMap.put("pcsn", groupPlate.getPcsn());
return groupPlateMap; return groupPlateMap;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return PdaResponse.requestParamOk(groupPlateListMap); return PdaResponse.requestParamOk(groupPlateListMap);
@@ -760,12 +799,9 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
@Override @Override
public PdaResponse getIoDisDocumentInfo(JSONObject reqParam) { public PdaResponse getIoDisDocumentInfo(JSONObject reqParam) {
Assert.notNull(reqParam, "请求参数不能为空!"); Assert.notNull(reqParam, "请求参数不能为空!");
String type = reqParam.getString("type");
Assert.notBlank(type, "出入库单据类型不能为空!");
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("query", reqParam.getString("query")); param.put("query", reqParam.getString("query"));
param.put("biz_date", reqParam.getString("biz_date")); param.put("biz_date", reqParam.getString("biz_date"));
param.put("bill_type", type);
param.put("bill_status", IOSEnum.BILL_STATUS.code("分配完")); param.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
List<Map<String, Object>> ioDisDtl = iOutBillService.getIoDisDtl(param); List<Map<String, Object>> ioDisDtl = iOutBillService.getIoDisDtl(param);
return PdaResponse.requestParamOk(ioDisDtl); return PdaResponse.requestParamOk(ioDisDtl);
@@ -776,7 +812,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
String type = reqParam.getString("type"); String type = reqParam.getString("type");
Assert.notBlank(type, "移库类型不能为空!"); Assert.notBlank(type, "移库类型不能为空!");
String vehicleStructCode = reqParam.getString("vehicleStructCode"); String vehicleStructCode = reqParam.getString("vehicleStructCode");
if(ObjectUtil.isEmpty(vehicleStructCode)) { if (ObjectUtil.isEmpty(vehicleStructCode)) {
if (ObjectUtil.isEmpty(reqParam.getString("moveinvdtl_id"))) { if (ObjectUtil.isEmpty(reqParam.getString("moveinvdtl_id"))) {
throw new BadRequestException("载具编码或点位编码不能为空!"); throw new BadRequestException("载具编码或点位编码不能为空!");
} }
@@ -818,4 +854,9 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
data.put("ivt_qty", storagevehicleext == null ? 0 : storagevehicleext.getCanuse_qty()); data.put("ivt_qty", storagevehicleext == null ? 0 : storagevehicleext.getCanuse_qty());
return PdaResponse.requestParamOk(data); return PdaResponse.requestParamOk(data);
} }
@Override
public PdaResponse getType(JSONObject reqParam) {
return PdaResponse.requestParamOk(PDAEnum.IN_BILL_TYPE.getDict());
}
} }

View File

@@ -77,15 +77,14 @@ public enum IOSEnum {
PLACEMENT_TYPE(MapOf.of("深货位", "1", "浅货位", "2")), PLACEMENT_TYPE(MapOf.of("深货位", "1", "浅货位", "2")),
// 库区编码 // 库区编码
SECT_CODE(MapOf.of("合格区", "HG01", "待检区", "DJ01", "不合格区", "BHG01")), SECT_CODE(MapOf.of("合格区", "HG01", "待检区", "DJ01", "不合格区", "BHG01", "大料箱区", "DLX01")),
// 存放载具类型 // 存放载具类型
VEHICLE_TYPE_PUT(MapOf.of("大料架(短边)", "1", "大料架(长边)", "2", "金属托盘", "3" VEHICLE_TYPE_PUT(MapOf.of("大料架(短边)", "1", "大料架(长边)", "2", "金属托盘", "3"
, "小料架", "4")), , "小料架", "4")),
// 载具类型 // 载具类型
VEHICLE_TYPE(MapOf.of("金属托盘", "00", "小料架", "01", "大料架(短边)", "02" VEHICLE_TYPE(MapOf.of("小料箱", "1", "大料箱", "2", "焊条筒", "3")),
, "大料架(长边)", "03")),
// 点位状态 // 点位状态
POINT_STATUS(MapOf.of("空位", "1", "有箱有料", "2", "空载具", "3" )), POINT_STATUS(MapOf.of("空位", "1", "有箱有料", "2", "空载具", "3" )),

View File

@@ -171,6 +171,13 @@ public interface IOutBillService extends IService<IOStorInv> {
*/ */
void taskFinish(SchBaseTask task); void taskFinish(SchBaseTask task);
/**
* 出库分配明细完成
*
* @param dis
*/
void disFinish(IOStorInvDis dis);
/** /**
* 获取出入库单据分配明细 * 获取出入库单据分配明细
* *

View File

@@ -75,11 +75,13 @@
sb.supp_name sb.supp_name
FROM st_ivt_iostorinv ios FROM st_ivt_iostorinv ios
LEFT JOIN st_ivt_iostorinvdis dis ON ios.iostorinv_id = dis.iostorinv_id LEFT JOIN st_ivt_iostorinvdis dis ON ios.iostorinv_id = dis.iostorinv_id
LEFT JOIN st_ivt_structattr attr ON dis.struct_code = attr.struct_code
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
LEFT JOIN md_pb_groupplate gp ON gp.storagevehicle_code = dis.storagevehicle_code LEFT JOIN md_pb_groupplate gp ON gp.storagevehicle_code = dis.storagevehicle_code
LEFT JOIN md_cs_supplierbase sb ON sb.supplier_code = gp.supplier_code LEFT JOIN md_cs_supplierbase sb ON sb.supp_code = gp.supp_code
<where> <where>
is_delete = '0' ios.is_delete = '0'
AND attr.sect_code = 'DLX01'
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
AND (ios.bill_code LIKE CONCAT('%', #{param.query}, '%') AND (ios.bill_code LIKE CONCAT('%', #{param.query}, '%')
OR mb.material_code LIKE CONCAT('%', #{param.query}, '%') OR mb.material_code LIKE CONCAT('%', #{param.query}, '%')

View File

@@ -28,8 +28,10 @@ import org.nl.wms.basedata_manage.service.dao.Structattr;
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper; import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto; import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto;
import org.nl.wms.pdm_manage.enums.BomEnum; import org.nl.wms.pdm_manage.enums.BomEnum;
import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialDtlService;
import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialService; import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialService;
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial; import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterialDtl;
import org.nl.wms.sch_manage.enums.TaskStatus; import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBaseTaskService; import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBaseTask; import org.nl.wms.sch_manage.service.dao.SchBaseTask;
@@ -150,6 +152,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
@Autowired @Autowired
private TaskFactory taskFactory; private TaskFactory taskFactory;
/**
* 退料单服务
*/
@Resource
private IPdmBomCallMaterialDtlService iPdmBomCallMaterialDtlService;
@Override @Override
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page, String[] stor_id, String[] bill_status, String[] bill_type) { public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page, String[] stor_id, String[] bill_status, String[] bill_type) {
HashMap<String, String> map = new HashMap<>(whereJson); HashMap<String, String> map = new HashMap<>(whereJson);
@@ -1498,6 +1506,138 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void disFinish(IOStorInvDis dis) {
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
.eq(IOStorInvDis::getTask_id, dis.getIostorinvdis_id())
);
if (ObjectUtil.isEmpty(ioStorInvDis)) {
throw new BadRequestException("未找分配明细");
}
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDis.getIostorinv_id());
//查询明细信息
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
if (ObjectUtil.isEmpty(ioStorInvDtl)) {
throw new BadRequestException("未找到明细");
}
ioStorInvDisMapper.update(ioStorInvDis, new LambdaUpdateWrapper<>(IOStorInvDis.class)
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
.set(IOStorInvDis::getReal_qty, dis.getPlan_qty())
.eq(IOStorInvDis::getIostorinvdis_id, ioStorInvDis.getIostorinvdis_id())
);
//解锁库位
JSONObject finish_map = new JSONObject();
finish_map.put("struct_code", ioStorInvDis.getStruct_code());
finish_map.put("storagevehicle_code", null);
finish_map.put("inv_type", null);
finish_map.put("inv_id", null);
finish_map.put("inv_code", null);
iStructattrService.updateStatusByCode("1", finish_map);
//修改库存 恢复库存 手持进行减扣
List<JSONObject> updateIvtList = new ArrayList<>();
JSONObject jsonIvt = new JSONObject();
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_SUB_FROZEN);
jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
updateIvtList.add(jsonIvt);
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
GroupPlate groupPlate = groupPlateMapper.selectOne(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getPcsn, ioStorInvDis.getPcsn())
.eq(GroupPlate::getStoragevehicle_code, ioStorInvDis.getStoragevehicle_code())
.eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
);
double sub_qty = NumberUtil.sub(groupPlate.getQty(), ioStorInvDis.getPlan_qty()).doubleValue();
if (sub_qty != 0) {
groupPlate.setQty(BigDecimal.valueOf(sub_qty));
}
groupPlate.setOut_type(ioStorInv.getBill_type());
if (ioStorInvDis.getIs_check().equals(IOSConstant.ZERO)) {
groupPlate.setIs_need_delete(IOSConstant.ONE);
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
}
groupPlateMapper.updateById(groupPlate);
// 判断是否是领料出库或者烘干出库
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))
|| ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("烘干出库"))
) {
// 创建退料明细
PdmBomCallMaterialDtl materDtlDao = new PdmBomCallMaterialDtl();
materDtlDao.setBomdtl_id(IdUtil.getStringId());
materDtlDao.setBom_id(ioStorInvDtl.getSource_billdtl_id());
materDtlDao.setMaterial_id(ioStorInvDis.getMaterial_id());
materDtlDao.setPcsn(ioStorInvDis.getPcsn());
materDtlDao.setVehicle_code(ioStorInvDis.getStoragevehicle_code());
materDtlDao.setStruct_code(ioStorInvDis.getStruct_code());
materDtlDao.setBom_status(BomEnum.CALL_BOM_DTL_STATUS.code("生成"));
materDtlDao.setOut_dis_id(ioStorInvDis.getIostorinvdis_id());
materDtlDao.setOut_qty(ioStorInvDis.getReal_qty());
materDtlDao.setCreate_id(SecurityUtils.getCurrentUserId());
materDtlDao.setCreate_name(SecurityUtils.getCurrentNickName());
materDtlDao.setCreate_time(DateUtil.now());
iPdmBomCallMaterialDtlService.save(materDtlDao);
}
// 查询该明细下是否还有未完成的分配明细
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
.eq(IOStorInvDis::getIostorinvdtl_id, ioStorInvDis.getIostorinvdtl_id())
.ne(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
);
// 如果分配明细全部完成则更新明细表状态
if (countDis == 0) {
// 更新明细表状态
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
ioStorInvDtl.setReal_qty(ioStorInvDtl.getAssign_qty());
// 如果是领料出库单则更新工单状态以及实际出库重量
if (ObjectUtil.isNotEmpty(ioStorInvDtl.getSource_bill_code())) {
PdmBomCallMaterial callMaterDao = iPdmBomCallMaterialService.findByCode(ioStorInvDtl.getSource_bill_code());
callMaterDao.setReal_qty(ioStorInvDtl.getPlan_qty());
callMaterDao.setBom_status(BomEnum.CALL_BOM_STATUS.code("叫料完成"));
iPdmBomCallMaterialService.updateById(callMaterDao);
}
ioStorInvDtlMapper.updateById(ioStorInvDtl);
// 查看明细是否全部完成
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
.ne(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
);
// 如果明细全部完成则更新主表状态
if (countDtl == 0) {
//更新主表状态
ioStorInvMapper.update(new IOStorInv(), new LambdaUpdateWrapper<>(IOStorInv.class)
.set(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
.set(IOStorInv::getConfirm_optid, currentUserId)
.set(IOStorInv::getConfirm_optname, nickName)
.set(IOStorInv::getConfirm_time, now)
.eq(IOStorInv::getIostorinv_id, ioStorInvDtl.getIostorinv_id())
);
}
}
}
@Override @Override
public List<Map<String, Object>> getIoDisDtl(JSONObject param) { public List<Map<String, Object>> getIoDisDtl(JSONObject param) {
return ioStorInvDisMapper.getIoDisDtl(param); return ioStorInvDisMapper.getIoDisDtl(param);