rev:手持大料箱测试修改
This commit is contained in:
@@ -195,7 +195,7 @@
|
||||
|
||||
<if test="sect_code!= null and sect_code!= ''">
|
||||
AND
|
||||
st.sect_code = #{sect_code}
|
||||
st.sect_id = #{sect_code}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@@ -227,7 +227,7 @@
|
||||
</if>
|
||||
<if test="sect_code!= null and sect_code!= ''">
|
||||
AND
|
||||
st.sect_code = #{sect_code}
|
||||
st.sect_id = #{sect_code}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY quality_day,ex.insert_time,ex.canuse_qty
|
||||
|
||||
@@ -192,6 +192,7 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
||||
.eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.eq(Structattr::getIs_emptyvehicle, IOSConstant.ONE)
|
||||
.and(wrapper -> wrapper.isNotNull(Structattr::getStoragevehicle_code).or().ne(Structattr::getStoragevehicle_code, ""))
|
||||
.orderByAsc(Structattr::getPlacement_type)
|
||||
.orderByAsc(Structattr::getStruct_code)
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(vehicleAttrList)) {
|
||||
@@ -206,6 +207,7 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
||||
.eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.ne(Structattr::getIs_emptyvehicle, IOSConstant.ONE)
|
||||
.and(wrapper -> wrapper.isNull(Structattr::getStoragevehicle_code).or().eq(Structattr::getStoragevehicle_code, ""))
|
||||
.orderByAsc(Structattr::getPlacement_type)
|
||||
.orderByAsc(Structattr::getStruct_code)
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(attrList)) {
|
||||
|
||||
@@ -70,6 +70,13 @@ public class PdaLargeMaterialBoxController {
|
||||
return new ResponseEntity<>(pdaLargeMaterialBoxService.materialBoxOutConfirm(reqParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getBomMaterDtl")
|
||||
@Log("大料箱-退库确认-查询BOM明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getBomMaterDtl(@RequestBody JSONObject reqParam) {
|
||||
return new ResponseEntity<>(pdaLargeMaterialBoxService.getBomMaterDtl(reqParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/returnConfirm")
|
||||
@Log("大料箱-退库确认-确认退回")
|
||||
@SaIgnore
|
||||
|
||||
@@ -128,4 +128,11 @@ public interface PdaLargeMaterialBoxService {
|
||||
* @return
|
||||
*/
|
||||
PdaResponse getType(JSONObject reqParam);
|
||||
|
||||
/**
|
||||
* 查询MOB明细
|
||||
* @param reqParam
|
||||
* @return
|
||||
*/
|
||||
PdaResponse getBomMaterDtl(JSONObject reqParam);
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -18,15 +17,19 @@ import org.nl.wms.basedata_manage.service.dao.*;
|
||||
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.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.dao.PdmBomCallMaterial;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterialDtl;
|
||||
import org.nl.wms.pdm_manage.service.dao.mapper.PdmBomCallMaterialDtlMapper;
|
||||
import org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDtlDto;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.*;
|
||||
import org.nl.wms.warehouse_management.service.dao.*;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinvdtl;
|
||||
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.StIvtCheckdtlMapper;
|
||||
@@ -67,6 +70,10 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
@Autowired
|
||||
private IPdmBomCallMaterialService pdmBomCallMaterialService;
|
||||
@Autowired
|
||||
private IPdmBomCallMaterialDtlService iPdmBomCallMaterialDtlService;
|
||||
@Autowired
|
||||
private PdmBomCallMaterialDtlMapper pdmBomCallMaterialDtlMapper;
|
||||
@Autowired
|
||||
private StIvtMoveinvdtlMapper stIvtMoveinvdtlMapper;
|
||||
@Autowired
|
||||
private StIvtCheckdtlMapper stIvtCheckdtlMapper;
|
||||
@@ -255,7 +262,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
Structattr structattr = structattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getStruct_code, struct_code));
|
||||
Assert.notNull(structattr, "仓位信息不存在!");
|
||||
JSONArray tableData = reqParam.getJSONArray("tableData");
|
||||
List<LinkedHashMap> tableData = reqParam.getJSONArray("tableData").toJavaList(LinkedHashMap.class);
|
||||
Assert.notEmpty(tableData, "组盘信息数据不能为空!");
|
||||
JSONObject material_info = reqParam.getJSONObject("material_info");
|
||||
Assert.notNull(material_info, "新加物料信息不能为空!");
|
||||
@@ -273,8 +280,8 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
throw new BadRequestException("物料数量格式不正确!");
|
||||
}
|
||||
//校验加物料是否一致
|
||||
JSONObject groupJson = tableData.getJSONObject(0);
|
||||
if (!StrUtil.equals(groupJson.getString("material_code"), material_code)) {
|
||||
LinkedHashMap groupJson = tableData.get(0);
|
||||
if (!StrUtil.equals(groupJson.get("material_code").toString(), material_code)) {
|
||||
throw new BadRequestException("新加物料信息与原物料信息不一致!");
|
||||
}
|
||||
//新增入库单及入库单明细
|
||||
@@ -291,9 +298,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
param.put("material_qty", material_qty);
|
||||
rawAssistIStorService.insertPdaDtl(param);
|
||||
//更新组盘表组盘数量
|
||||
JSONObject row = tableData.getJSONObject(0);
|
||||
String group_id = row.getString("group_id");
|
||||
GroupPlate groupPlate = mdPbGroupplateService.getById(group_id);
|
||||
GroupPlate groupPlate = mdPbGroupplateService.getById(groupJson.get("group_id").toString());
|
||||
groupPlate.setQty(groupPlate.getQty().add(new BigDecimal(material_qty)));
|
||||
mdPbGroupplateService.updateById(groupPlate);
|
||||
//更新库存数量
|
||||
@@ -328,19 +333,19 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
if (ObjectUtil.isNotEmpty(ts_storagevehicle_code)) {
|
||||
MdPbStoragevehicleinfo tsVehicle = mdPbStoragevehicleinfoService.getByCode(ts_storagevehicle_code);
|
||||
if (ObjectUtil.isEmpty(tsVehicle)) {
|
||||
throw new BadRequestException("配送载具不存在!【"+ts_storagevehicle_code+"】");
|
||||
throw new BadRequestException("配送载具不存在!【" + ts_storagevehicle_code + "】");
|
||||
}
|
||||
if (!tsVehicle.getStoragevehicle_type().equals(IOSEnum.VEHICLE_TYPE.code("大料箱"))) {
|
||||
throw new BadRequestException("当前配送载具不属于大料箱载具!【"+ts_storagevehicle_code+"】");
|
||||
throw new BadRequestException("当前配送载具不属于大料箱载具!【" + ts_storagevehicle_code + "】");
|
||||
}
|
||||
// 更新组盘信息为新载具信息
|
||||
mdPbGroupplateService.update(
|
||||
new UpdateWrapper<GroupPlate>().lambda()
|
||||
.set(GroupPlate::getStoragevehicle_code, ts_storagevehicle_code)
|
||||
.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("入库"))
|
||||
.set(GroupPlate::getStoragevehicle_code, ts_storagevehicle_code)
|
||||
.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("入库"))
|
||||
);
|
||||
// 更新仓位
|
||||
attrDao.setIs_emptyvehicle(IOSConstant.ONE);
|
||||
@@ -356,10 +361,10 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
if (ObjectUtil.isNotEmpty(ts_storagevehicle_code)) {
|
||||
MdPbStoragevehicleinfo tsVehicle = mdPbStoragevehicleinfoService.getByCode(ts_storagevehicle_code);
|
||||
if (ObjectUtil.isEmpty(tsVehicle)) {
|
||||
throw new BadRequestException("配送载具不存在!【"+ts_storagevehicle_code+"】");
|
||||
throw new BadRequestException("配送载具不存在!【" + ts_storagevehicle_code + "】");
|
||||
}
|
||||
if (!tsVehicle.getStoragevehicle_type().equals(IOSEnum.VEHICLE_TYPE.code("大料箱"))) {
|
||||
throw new BadRequestException("当前配送载具不属于大料箱载具!【"+ts_storagevehicle_code+"】");
|
||||
throw new BadRequestException("当前配送载具不属于大料箱载具!【" + ts_storagevehicle_code + "】");
|
||||
}
|
||||
|
||||
// 新增组盘信息
|
||||
@@ -370,15 +375,29 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
.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);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(ts_storagevehicle_code)) {
|
||||
// 更新分配明细新载具
|
||||
ioStorInvDis.setStoragevehicle_code(ts_storagevehicle_code);
|
||||
ioStorInvDisMapper.updateById(ioStorInvDis);
|
||||
// 更新退料明细载具号
|
||||
iPdmBomCallMaterialDtlService.update(
|
||||
new UpdateWrapper<PdmBomCallMaterialDtl>().lambda()
|
||||
.set(PdmBomCallMaterialDtl::getVehicle_code, ts_storagevehicle_code)
|
||||
.eq(PdmBomCallMaterialDtl::getOut_dis_id, ioStorInvDis.getIostorinvdis_id())
|
||||
);
|
||||
}
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@@ -391,68 +410,25 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
String bom_code = reqParam.getString("bom_code");
|
||||
Assert.notEmpty(bom_code, "BOM编码不能为空!");
|
||||
String residue_qty = reqParam.getString("residue_qty");
|
||||
|
||||
JSONObject row = reqParam.getJSONArray("rows").toJavaList(JSONObject.class).get(0);
|
||||
// 叫料明细
|
||||
PdmBomCallMaterialDtl bomDtl = pdmBomCallMaterialDtlMapper.selectById(row.getString("bomdtl_id"));
|
||||
// 类型转换
|
||||
PdmBomCallMaterialDtlDto dtlDto = JSONObject.parseObject(JSONObject.toJSONString(bomDtl), PdmBomCallMaterialDtlDto.class);
|
||||
// 查询组盘信息
|
||||
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getGroup_id, row.getString("group_id")));
|
||||
|
||||
if (StrUtil.isBlank(residue_qty) || BigDecimal.ZERO.compareTo(new BigDecimal(residue_qty)) == 0) {
|
||||
//如果剩余物料为0或空,就删除组盘信息
|
||||
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, storagevehicle_code)
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
if (groupPlate != null) {
|
||||
mdPbGroupplateService.removeById(groupPlate);
|
||||
}
|
||||
//更新工单实际重量 为组盘数量
|
||||
PdmBomCallMaterial bomCallMaterial = pdmBomCallMaterialService.findByCode(bom_code);
|
||||
if (bomCallMaterial != null) {
|
||||
//根据载具号和工单ID 查询叫料明细
|
||||
PdmBomCallMaterialDtl pdmBomCallMaterialDtl = pdmBomCallMaterialDtlService.getOne(new LambdaQueryWrapper<PdmBomCallMaterialDtl>()
|
||||
.eq(PdmBomCallMaterialDtl::getBom_id, bomCallMaterial.getBom_id())
|
||||
.eq(PdmBomCallMaterialDtl::getVehicle_code, storagevehicle_code)
|
||||
.lt(PdmBomCallMaterialDtl::getBom_status, BomEnum.CALL_BOM_DTL_STATUS.code("完成")));
|
||||
if (pdmBomCallMaterialDtl != null) {
|
||||
pdmBomCallMaterialDtl.setBom_status(BomEnum.CALL_BOM_DTL_STATUS.code("完成"));
|
||||
pdmBomCallMaterialDtlService.updateById(pdmBomCallMaterialDtl);
|
||||
bomCallMaterial.setReal_weigh_qty(bomCallMaterial.getReal_weigh_qty().add(groupPlate.getQty()));
|
||||
List<PdmBomCallMaterialDtl> pdmBomCallMaterialDtlList = pdmBomCallMaterialDtlService.list(new LambdaQueryWrapper<PdmBomCallMaterialDtl>()
|
||||
.eq(PdmBomCallMaterialDtl::getBom_id, pdmBomCallMaterialDtl.getBom_id())
|
||||
.lt(PdmBomCallMaterialDtl::getBom_status, BomEnum.CALL_BOM_DTL_STATUS.code("完成")));
|
||||
if (pdmBomCallMaterialDtlList.size() == 0) {
|
||||
bomCallMaterial.setBom_status(BomEnum.CALL_BOM_STATUS.code("完成"));
|
||||
}
|
||||
pdmBomCallMaterialService.updateById(bomCallMaterial);
|
||||
}
|
||||
}
|
||||
// 更新称重重量
|
||||
dtlDto.setWeigh_qty(BigDecimal.ZERO);
|
||||
} else {
|
||||
//有重量,更新剩余物料到组盘信息的重量
|
||||
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, storagevehicle_code)
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
//原组盘数量
|
||||
BigDecimal qty = groupPlate.getQty();
|
||||
if (groupPlate != null) {
|
||||
groupPlate.setQty(new BigDecimal(residue_qty));
|
||||
mdPbGroupplateService.updateById(groupPlate);
|
||||
}
|
||||
// ,更新工单的实际重量=组盘重量-剩余物料重量
|
||||
PdmBomCallMaterial bomCallMaterial = pdmBomCallMaterialService.findByCode(bom_code);
|
||||
if (bomCallMaterial != null) {
|
||||
//根据载具号和工单ID 查询叫料明细
|
||||
PdmBomCallMaterialDtl pdmBomCallMaterialDtl = pdmBomCallMaterialDtlService.getOne(new LambdaQueryWrapper<PdmBomCallMaterialDtl>()
|
||||
.eq(PdmBomCallMaterialDtl::getBom_id, bomCallMaterial.getBom_id())
|
||||
.eq(PdmBomCallMaterialDtl::getVehicle_code, storagevehicle_code)
|
||||
.lt(PdmBomCallMaterialDtl::getBom_status, BomEnum.CALL_BOM_DTL_STATUS.code("完成")));
|
||||
if (pdmBomCallMaterialDtl != null) {
|
||||
pdmBomCallMaterialDtl.setBom_status(BomEnum.CALL_BOM_DTL_STATUS.code("完成"));
|
||||
pdmBomCallMaterialDtlService.updateById(pdmBomCallMaterialDtl);
|
||||
bomCallMaterial.setReal_weigh_qty(bomCallMaterial.getReal_weigh_qty().add(qty.subtract(new BigDecimal(residue_qty))));
|
||||
List<PdmBomCallMaterialDtl> pdmBomCallMaterialDtlList = pdmBomCallMaterialDtlService.list(new LambdaQueryWrapper<PdmBomCallMaterialDtl>()
|
||||
.eq(PdmBomCallMaterialDtl::getBom_id, pdmBomCallMaterialDtl.getBom_id())
|
||||
.lt(PdmBomCallMaterialDtl::getBom_status, BomEnum.CALL_BOM_DTL_STATUS.code("完成")));
|
||||
if (pdmBomCallMaterialDtlList.size() == 0) {
|
||||
bomCallMaterial.setBom_status(BomEnum.CALL_BOM_STATUS.code("完成"));
|
||||
}
|
||||
pdmBomCallMaterialService.updateById(bomCallMaterial);
|
||||
}
|
||||
}
|
||||
// 更新称重重量
|
||||
dtlDto.setWeigh_qty(NumberUtil.sub(groupPlate.getQty(), new BigDecimal(residue_qty)));
|
||||
}
|
||||
// 更新叫料单明细
|
||||
iPdmBomCallMaterialDtlService.confirm(dtlDto);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@@ -681,7 +657,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
Assert.notBlank(storagevehicle_code, "载具号不能为空!");
|
||||
List<GroupPlate> groupPlateList = mdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, storagevehicle_code)
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘")));
|
||||
.in(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"), IOSEnum.GROUP_PLATE_STATUS.code("组盘")));
|
||||
//将GroupPlate对象转换为Map
|
||||
List<Map<String, Object>> groupPlateListMap = groupPlateList.stream()
|
||||
.map(groupPlate -> {
|
||||
@@ -723,7 +699,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
Assert.notBlank(storagevehicle_code, "载具号不能为空!");
|
||||
List<GroupPlate> groupPlateList = mdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, storagevehicle_code)
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
.in(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"), IOSEnum.GROUP_PLATE_STATUS.code("组盘")));
|
||||
Assert.notEmpty(groupPlateList, "没有找到对应的组盘信息!");
|
||||
GroupPlate groupPlateOne = groupPlateList.get(0);
|
||||
PdmBomCallMaterial pdmBomCallMaterial = pdmBomCallMaterialService.getById(groupPlateOne.getBom_id());
|
||||
@@ -859,4 +835,20 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
|
||||
public PdaResponse getType(JSONObject reqParam) {
|
||||
return PdaResponse.requestParamOk(PDAEnum.IN_BILL_TYPE.getDict());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getBomMaterDtl(JSONObject reqParam) {
|
||||
JSONObject result = new JSONObject();
|
||||
if (ObjectUtil.isEmpty(reqParam.getString("storagevehicle_code"))) {
|
||||
throw new BadRequestException("载具编码不能为空");
|
||||
}
|
||||
|
||||
List<JSONObject> data = pdmBomCallMaterialDtlMapper.getBomMaterDtl(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(data)) {
|
||||
result.put("device_code", data.get(0).getString("device_code"));
|
||||
result.put("bom_code", data.get(0).getString("bom_code"));
|
||||
}
|
||||
result.put("data", data);
|
||||
return PdaResponse.requestParamOk(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,13 @@ public interface PdmBomCallMaterialDtlMapper extends BaseMapper<PdmBomCallMateri
|
||||
* @return List<PdmBomCallMaterialDtlDto>
|
||||
*/
|
||||
List<PdmBomCallMaterialDtlDto> getDtl(@Param("param") JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 平板查询明细
|
||||
* @param reqParam {
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getBomMaterDtl(@Param("param") JSONObject reqParam);
|
||||
}
|
||||
|
||||
@@ -86,4 +86,42 @@
|
||||
ORDER BY dtl.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="getBomMaterDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.material_model,
|
||||
mater.quality_time AS quality_time_day,
|
||||
dtl.pcsn,
|
||||
dtl.out_qty AS qty,
|
||||
dtl.out_qty,
|
||||
late.quality_time,
|
||||
late.execution_stand,
|
||||
late.quality_type,
|
||||
late.produce_time,
|
||||
late.bake_num,
|
||||
late.group_id,
|
||||
supp.supp_code,
|
||||
supp.supp_name,
|
||||
dtl.bomdtl_id,
|
||||
mst.device_code,
|
||||
mst.bom_code
|
||||
FROM
|
||||
md_pb_groupplate late
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = late.material_id
|
||||
INNER JOIN md_cs_supplierbase supp ON supp.supp_code = late.supp_code
|
||||
INNER JOIN pdm_bom_callmaterial mst ON mst.bom_id = late.bom_id
|
||||
INNER JOIN pdm_bom_callmaterialdtl dtl ON mst.bom_id = dtl.bom_id
|
||||
<where>
|
||||
late.status IN ('1','3')
|
||||
AND dtl.bom_status = '1'
|
||||
<if test="param.storagevehicle_code != null and param.storagevehicle_code != ''">
|
||||
AND
|
||||
dtl.vehicle_code = #{param.storagevehicle_code}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -111,6 +111,11 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String STOR_ID = "1582991156504039424";
|
||||
|
||||
/**
|
||||
* 库区:合格库区
|
||||
*/
|
||||
public final static String SECT_CODE_HG = "1955103578733547520";
|
||||
|
||||
/**
|
||||
* 物料id:焊丝(盘状)
|
||||
*/
|
||||
|
||||
@@ -172,7 +172,7 @@ public interface IOutBillService extends IService<IOStorInv> {
|
||||
void taskFinish(SchBaseTask task);
|
||||
|
||||
/**
|
||||
* 出库分配明细完成
|
||||
* 出库分配明细完成(大料箱)
|
||||
*
|
||||
* @param dis
|
||||
*/
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = late.material_id
|
||||
INNER JOIN md_cs_supplierbase supp ON supp.supp_code = late.supp_code
|
||||
<where>
|
||||
late.status = '3'
|
||||
late.status in ('3','1')
|
||||
AND IFNULL(late.bom_id,'') = ''
|
||||
|
||||
<if test="param.storagevehicle_code != null and param.storagevehicle_code != ''">
|
||||
|
||||
@@ -431,10 +431,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
String pcsn = dtl.getPcsn();
|
||||
String material_id = dtl.getMaterial_id();
|
||||
|
||||
// 根据物料和批次号查询库存可用: 如果是领料出库则查合格区
|
||||
String sect_code = "";
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))) {
|
||||
sect_code = IOSEnum.SECT_CODE.code("合格区");
|
||||
String sect_code = whereJson.getString("sect_id");
|
||||
// 如果为空则只查询合格区
|
||||
if (ObjectUtil.isEmpty(sect_code)) {
|
||||
sect_code = IOSConstant.SECT_CODE_HG;
|
||||
}
|
||||
|
||||
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code);
|
||||
@@ -675,9 +675,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
String material_id = dtl.getMaterial_id();
|
||||
|
||||
// 根据物料和批次号查询库存可用
|
||||
String sect_code = "";
|
||||
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))) {
|
||||
sect_code = IOSEnum.SECT_CODE.code("合格区");
|
||||
String sect_code = whereJson.getString("sect_id");
|
||||
// 如果为空则只查询合格区
|
||||
if (ObjectUtil.isEmpty(sect_code)) {
|
||||
sect_code = IOSConstant.SECT_CODE_HG;
|
||||
}
|
||||
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code);
|
||||
|
||||
@@ -1138,6 +1139,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
}
|
||||
|
||||
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.getListDisSend(whereJson);
|
||||
// 判断仓位是否是大料箱区
|
||||
boolean is_sect = ioStorInvDisList.stream()
|
||||
.anyMatch(row -> row.getSect_code().equals(IOSEnum.SECT_CODE.code("大料箱区")));
|
||||
if (is_sect) {
|
||||
throw new BadRequestException("当前分配明细有大料箱,不允许下发任务!");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(ioStorInvDisList)) {
|
||||
throw new BadRequestException("当前没有可设置的分配明细");
|
||||
@@ -1514,7 +1521,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
String now = DateUtil.now();
|
||||
|
||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getTask_id, dis.getIostorinvdis_id())
|
||||
.eq(IOStorInvDis::getIostorinvdis_id, dis.getIostorinvdis_id())
|
||||
);
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)) {
|
||||
throw new BadRequestException("未找分配明细");
|
||||
@@ -1537,11 +1544,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
//解锁库位
|
||||
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);
|
||||
iStructattrService.updateStatusByCode("2", finish_map);
|
||||
|
||||
//修改库存 恢复库存 手持进行减扣
|
||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
@@ -1572,6 +1578,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
if (ioStorInvDis.getIs_check().equals(IOSConstant.ZERO)) {
|
||||
groupPlate.setIs_need_delete(IOSConstant.ONE);
|
||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
|
||||
} else {
|
||||
// 更新明细是否拣选为否
|
||||
ioStorInvDtl.setIs_check(IOSConstant.ZERO);
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
}
|
||||
|
||||
groupPlateMapper.updateById(groupPlate);
|
||||
@@ -1590,7 +1600,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
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.setOut_qty(ioStorInvDis.getPlan_qty());
|
||||
materDtlDao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
materDtlDao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
materDtlDao.setCreate_time(DateUtil.now());
|
||||
|
||||
@@ -846,11 +846,11 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
ioStorInvDtl.put("plan_qty", qty);
|
||||
total_qty += Double.parseDouble(qty.toString());
|
||||
|
||||
//判断该载具编号是否已经存在库内
|
||||
/* //判断该载具编号是否已经存在库内
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code, row.get("storagevehicle_code")));
|
||||
if (ObjectUtil.isNotEmpty(structattr)) {
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
||||
}
|
||||
}*/
|
||||
|
||||
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, S
|
||||
StIvtCheckdtl dtlDao = iStIvtCheckdtlService.getById(dao.getCheckdtl_id());
|
||||
String dtlVehicle = dtlDao.getStoragevehicle_code();
|
||||
if (!dtlVehicle.equals(dao.getStoragevehicle_code())) {
|
||||
throw new BadRequestException("扫码托盘不属于当前盘点当");
|
||||
throw new BadRequestException("扫码托盘不属于当前盘点托盘");
|
||||
}
|
||||
dtlDao.setFac_qty(dao.getFac_qty());
|
||||
// 是否异常 1-正常 2-异常
|
||||
@@ -304,6 +304,12 @@ public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, S
|
||||
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
|
||||
.eq(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("生成"))
|
||||
);
|
||||
// 判断当前是否有大料箱
|
||||
boolean is_sect = dtlDaoList.stream()
|
||||
.anyMatch(row -> row.getSect_code().equals(IOSEnum.SECT_CODE.code("大料箱区")));
|
||||
if (is_sect) {
|
||||
throw new BadRequestException("当前盘点单存在大料箱库区货位,不允许下发任务!");
|
||||
}
|
||||
|
||||
if (dtlDaoList.size() > 1) {
|
||||
throw new BadRequestException("当前CTU只支持单条盘点移库任务,请保证盘点单只有一条明细!");
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<span class="role-span">出库明细</span>
|
||||
<div class="crud-opts-form">
|
||||
<el-form ref="form" :inline="true" :model="form" size="mini">
|
||||
<!-- <el-form-item label="库区" prop="gender2">
|
||||
<el-form-item label="分配库区" prop="gender2">
|
||||
<el-cascader
|
||||
placeholder="请选择"
|
||||
:options="sects"
|
||||
@@ -31,7 +31,7 @@
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span class="crud-opts-right2">
|
||||
|
||||
Reference in New Issue
Block a user