Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangzq
2025-09-19 10:14:38 +08:00
14 changed files with 175 additions and 99 deletions

View File

@@ -195,7 +195,7 @@
<if test="sect_code!= null and sect_code!= ''"> <if test="sect_code!= null and sect_code!= ''">
AND AND
st.sect_code = #{sect_code} st.sect_id = #{sect_code}
</if> </if>
</where> </where>
</select> </select>
@@ -227,7 +227,7 @@
</if> </if>
<if test="sect_code!= null and sect_code!= ''"> <if test="sect_code!= null and sect_code!= ''">
AND AND
st.sect_code = #{sect_code} st.sect_id = #{sect_code}
</if> </if>
</where> </where>
ORDER BY quality_day,ex.insert_time,ex.canuse_qty ORDER BY quality_day,ex.insert_time,ex.canuse_qty

View File

@@ -192,6 +192,7 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
.eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定")) .eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.eq(Structattr::getIs_emptyvehicle, IOSConstant.ONE) .eq(Structattr::getIs_emptyvehicle, IOSConstant.ONE)
.and(wrapper -> wrapper.isNotNull(Structattr::getStoragevehicle_code).or().ne(Structattr::getStoragevehicle_code, "")) .and(wrapper -> wrapper.isNotNull(Structattr::getStoragevehicle_code).or().ne(Structattr::getStoragevehicle_code, ""))
.orderByAsc(Structattr::getPlacement_type)
.orderByAsc(Structattr::getStruct_code) .orderByAsc(Structattr::getStruct_code)
); );
if (ObjectUtil.isNotEmpty(vehicleAttrList)) { if (ObjectUtil.isNotEmpty(vehicleAttrList)) {
@@ -206,6 +207,7 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
.eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定")) .eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.ne(Structattr::getIs_emptyvehicle, IOSConstant.ONE) .ne(Structattr::getIs_emptyvehicle, IOSConstant.ONE)
.and(wrapper -> wrapper.isNull(Structattr::getStoragevehicle_code).or().eq(Structattr::getStoragevehicle_code, "")) .and(wrapper -> wrapper.isNull(Structattr::getStoragevehicle_code).or().eq(Structattr::getStoragevehicle_code, ""))
.orderByAsc(Structattr::getPlacement_type)
.orderByAsc(Structattr::getStruct_code) .orderByAsc(Structattr::getStruct_code)
); );
if (ObjectUtil.isNotEmpty(attrList)) { if (ObjectUtil.isNotEmpty(attrList)) {

View File

@@ -70,6 +70,13 @@ public class PdaLargeMaterialBoxController {
return new ResponseEntity<>(pdaLargeMaterialBoxService.materialBoxOutConfirm(reqParam), HttpStatus.OK); 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") @PostMapping("/returnConfirm")
@Log("大料箱-退库确认-确认退回") @Log("大料箱-退库确认-确认退回")
@SaIgnore @SaIgnore

View File

@@ -128,4 +128,11 @@ public interface PdaLargeMaterialBoxService {
* @return * @return
*/ */
PdaResponse getType(JSONObject reqParam); PdaResponse getType(JSONObject reqParam);
/**
* 查询MOB明细
* @param reqParam
* @return
*/
PdaResponse getBomMaterDtl(JSONObject reqParam);
} }

View File

@@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.large_material_box.service.PdaLargeMaterialBoxService;
import org.nl.wms.pda.util.PDAEnum; 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.service.IPdmBomCallMaterialDtlService; 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.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.IOSConstant;
import org.nl.wms.warehouse_management.enums.IOSEnum; import org.nl.wms.warehouse_management.enums.IOSEnum;
import org.nl.wms.warehouse_management.service.*; 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.IOStorInvDisMapper;
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper; import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper;
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtCheckdtlMapper; import org.nl.wms.warehouse_management.service.dao.mapper.StIvtCheckdtlMapper;
@@ -67,6 +70,10 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
@Autowired @Autowired
private IPdmBomCallMaterialService pdmBomCallMaterialService; private IPdmBomCallMaterialService pdmBomCallMaterialService;
@Autowired @Autowired
private IPdmBomCallMaterialDtlService iPdmBomCallMaterialDtlService;
@Autowired
private PdmBomCallMaterialDtlMapper pdmBomCallMaterialDtlMapper;
@Autowired
private StIvtMoveinvdtlMapper stIvtMoveinvdtlMapper; private StIvtMoveinvdtlMapper stIvtMoveinvdtlMapper;
@Autowired @Autowired
private StIvtCheckdtlMapper stIvtCheckdtlMapper; private StIvtCheckdtlMapper stIvtCheckdtlMapper;
@@ -255,7 +262,7 @@ 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"); List<LinkedHashMap> tableData = reqParam.getJSONArray("tableData").toJavaList(LinkedHashMap.class);
Assert.notEmpty(tableData, "组盘信息数据不能为空!"); Assert.notEmpty(tableData, "组盘信息数据不能为空!");
JSONObject material_info = reqParam.getJSONObject("material_info"); JSONObject material_info = reqParam.getJSONObject("material_info");
Assert.notNull(material_info, "新加物料信息不能为空!"); Assert.notNull(material_info, "新加物料信息不能为空!");
@@ -273,8 +280,8 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
throw new BadRequestException("物料数量格式不正确!"); throw new BadRequestException("物料数量格式不正确!");
} }
//校验加物料是否一致 //校验加物料是否一致
JSONObject groupJson = tableData.getJSONObject(0); LinkedHashMap groupJson = tableData.get(0);
if (!StrUtil.equals(groupJson.getString("material_code"), material_code)) { if (!StrUtil.equals(groupJson.get("material_code").toString(), material_code)) {
throw new BadRequestException("新加物料信息与原物料信息不一致!"); throw new BadRequestException("新加物料信息与原物料信息不一致!");
} }
//新增入库单及入库单明细 //新增入库单及入库单明细
@@ -291,9 +298,7 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
param.put("material_qty", material_qty); param.put("material_qty", material_qty);
rawAssistIStorService.insertPdaDtl(param); rawAssistIStorService.insertPdaDtl(param);
//更新组盘表组盘数量 //更新组盘表组盘数量
JSONObject row = tableData.getJSONObject(0); GroupPlate groupPlate = mdPbGroupplateService.getById(groupJson.get("group_id").toString());
String group_id = row.getString("group_id");
GroupPlate groupPlate = mdPbGroupplateService.getById(group_id);
groupPlate.setQty(groupPlate.getQty().add(new BigDecimal(material_qty))); groupPlate.setQty(groupPlate.getQty().add(new BigDecimal(material_qty)));
mdPbGroupplateService.updateById(groupPlate); mdPbGroupplateService.updateById(groupPlate);
//更新库存数量 //更新库存数量
@@ -370,15 +375,29 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
.eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id()) .eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库")) .eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
); );
plate.setStoragevehicle_code(ts_storagevehicle_code); plate.setStoragevehicle_code(ts_storagevehicle_code);
plate.setQty(ioStorInvDis.getPlan_qty()); plate.setQty(ioStorInvDis.getPlan_qty());
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘")); plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
mdPbGroupplateService.create(plate); mdPbGroupplateService.create(plate);
} }
} }
// 调用出库服务明细确认方法 // 调用出库服务明细确认方法
iOutBillService.disFinish(ioStorInvDis); 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(); return PdaResponse.requestOk();
} }
@@ -391,68 +410,25 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
String bom_code = reqParam.getString("bom_code"); String bom_code = reqParam.getString("bom_code");
Assert.notEmpty(bom_code, "BOM编码不能为空"); Assert.notEmpty(bom_code, "BOM编码不能为空");
String residue_qty = reqParam.getString("residue_qty"); 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) { if (StrUtil.isBlank(residue_qty) || BigDecimal.ZERO.compareTo(new BigDecimal(residue_qty)) == 0) {
//如果剩余物料为0或空就删除组盘信息 // 更新称重重量
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>() dtlDto.setWeigh_qty(BigDecimal.ZERO);
.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);
}
}
} else { } else {
//有重量,更新剩余物料到组盘信息的重量 // 更新称重重量
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>() dtlDto.setWeigh_qty(NumberUtil.sub(groupPlate.getQty(), new BigDecimal(residue_qty)));
.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);
}
}
} }
// 更新叫料单明细
iPdmBomCallMaterialDtlService.confirm(dtlDto);
return PdaResponse.requestOk(); return PdaResponse.requestOk();
} }
@@ -681,7 +657,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("组盘"))); .in(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"), 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 -> {
@@ -723,7 +699,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("出库"))); .in(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"), IOSEnum.GROUP_PLATE_STATUS.code("组盘")));
Assert.notEmpty(groupPlateList, "没有找到对应的组盘信息!"); Assert.notEmpty(groupPlateList, "没有找到对应的组盘信息!");
GroupPlate groupPlateOne = groupPlateList.get(0); GroupPlate groupPlateOne = groupPlateList.get(0);
PdmBomCallMaterial pdmBomCallMaterial = pdmBomCallMaterialService.getById(groupPlateOne.getBom_id()); PdmBomCallMaterial pdmBomCallMaterial = pdmBomCallMaterialService.getById(groupPlateOne.getBom_id());
@@ -859,4 +835,20 @@ public class PadLargeMaterialBoxServiceImpl implements PdaLargeMaterialBoxServic
public PdaResponse getType(JSONObject reqParam) { public PdaResponse getType(JSONObject reqParam) {
return PdaResponse.requestParamOk(PDAEnum.IN_BILL_TYPE.getDict()); 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);
}
} }

View File

@@ -39,4 +39,13 @@ public interface PdmBomCallMaterialDtlMapper extends BaseMapper<PdmBomCallMateri
* @return List<PdmBomCallMaterialDtlDto> * @return List<PdmBomCallMaterialDtlDto>
*/ */
List<PdmBomCallMaterialDtlDto> getDtl(@Param("param") JSONObject whereJson); List<PdmBomCallMaterialDtlDto> getDtl(@Param("param") JSONObject whereJson);
/**
* 平板查询明细
* @param reqParam {
* storagevehicle_code 载具编码
* }
* @return List<JSONObject>
*/
List<JSONObject> getBomMaterDtl(@Param("param") JSONObject reqParam);
} }

View File

@@ -86,4 +86,42 @@
ORDER BY dtl.create_time Desc ORDER BY dtl.create_time Desc
</select> </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> </mapper>

View File

@@ -111,6 +111,11 @@ public class IOSConstant {
*/ */
public final static String STOR_ID = "1582991156504039424"; public final static String STOR_ID = "1582991156504039424";
/**
* 库区:合格库区
*/
public final static String SECT_CODE_HG = "1955103578733547520";
/** /**
* 物料id焊丝盘状 * 物料id焊丝盘状
*/ */

View File

@@ -172,7 +172,7 @@ public interface IOutBillService extends IService<IOStorInv> {
void taskFinish(SchBaseTask task); void taskFinish(SchBaseTask task);
/** /**
* 出库分配明细完成 * 出库分配明细完成(大料箱)
* *
* @param dis * @param dis
*/ */

View File

@@ -98,7 +98,7 @@
INNER JOIN md_me_materialbase mater ON mater.material_id = late.material_id 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 md_cs_supplierbase supp ON supp.supp_code = late.supp_code
<where> <where>
late.status = '3' late.status in ('3','1')
AND IFNULL(late.bom_id,'') = '' AND IFNULL(late.bom_id,'') = ''
<if test="param.storagevehicle_code != null and param.storagevehicle_code != ''"> <if test="param.storagevehicle_code != null and param.storagevehicle_code != ''">

View File

@@ -431,10 +431,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
String pcsn = dtl.getPcsn(); String pcsn = dtl.getPcsn();
String material_id = dtl.getMaterial_id(); String material_id = dtl.getMaterial_id();
// 根据物料和批次号查询库存可用: 如果是领料出库则查合格区 String sect_code = whereJson.getString("sect_id");
String sect_code = ""; // 如果为空则只查询合格区
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))) { if (ObjectUtil.isEmpty(sect_code)) {
sect_code = IOSEnum.SECT_CODE.code("合格区"); sect_code = IOSConstant.SECT_CODE_HG;
} }
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code); 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 material_id = dtl.getMaterial_id();
// 根据物料和批次号查询库存可用 // 根据物料和批次号查询库存可用
String sect_code = ""; String sect_code = whereJson.getString("sect_id");
if (ioStorInv.getBill_type().equals(IOSEnum.OUT_BILL_TYPE.code("领料出库"))) { // 如果为空则只查询合格区
sect_code = IOSEnum.SECT_CODE.code("合格区"); if (ObjectUtil.isEmpty(sect_code)) {
sect_code = IOSConstant.SECT_CODE_HG;
} }
BigDecimal canuseSum = mdPbStoragevehicleextMapper.queryCanuseSum(pcsn, material_id, sect_code); 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); 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)) { if (ObjectUtil.isEmpty(ioStorInvDisList)) {
throw new BadRequestException("当前没有可设置的分配明细"); throw new BadRequestException("当前没有可设置的分配明细");
@@ -1514,7 +1521,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
String now = DateUtil.now(); String now = DateUtil.now();
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class) 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)) { if (ObjectUtil.isEmpty(ioStorInvDis)) {
throw new BadRequestException("未找分配明细"); throw new BadRequestException("未找分配明细");
@@ -1537,11 +1544,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
//解锁库位 //解锁库位
JSONObject finish_map = new JSONObject(); JSONObject finish_map = new JSONObject();
finish_map.put("struct_code", ioStorInvDis.getStruct_code()); finish_map.put("struct_code", ioStorInvDis.getStruct_code());
finish_map.put("storagevehicle_code", null);
finish_map.put("inv_type", null); finish_map.put("inv_type", null);
finish_map.put("inv_id", null); finish_map.put("inv_id", null);
finish_map.put("inv_code", null); finish_map.put("inv_code", null);
iStructattrService.updateStatusByCode("1", finish_map); iStructattrService.updateStatusByCode("2", finish_map);
//修改库存 恢复库存 手持进行减扣 //修改库存 恢复库存 手持进行减扣
List<JSONObject> updateIvtList = new ArrayList<>(); List<JSONObject> updateIvtList = new ArrayList<>();
@@ -1572,6 +1578,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
if (ioStorInvDis.getIs_check().equals(IOSConstant.ZERO)) { if (ioStorInvDis.getIs_check().equals(IOSConstant.ZERO)) {
groupPlate.setIs_need_delete(IOSConstant.ONE); groupPlate.setIs_need_delete(IOSConstant.ONE);
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库")); groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
} else {
// 更新明细是否拣选为否
ioStorInvDtl.setIs_check(IOSConstant.ZERO);
ioStorInvDtlMapper.updateById(ioStorInvDtl);
} }
groupPlateMapper.updateById(groupPlate); groupPlateMapper.updateById(groupPlate);
@@ -1590,7 +1600,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
materDtlDao.setStruct_code(ioStorInvDis.getStruct_code()); materDtlDao.setStruct_code(ioStorInvDis.getStruct_code());
materDtlDao.setBom_status(BomEnum.CALL_BOM_DTL_STATUS.code("生成")); materDtlDao.setBom_status(BomEnum.CALL_BOM_DTL_STATUS.code("生成"));
materDtlDao.setOut_dis_id(ioStorInvDis.getIostorinvdis_id()); 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_id(SecurityUtils.getCurrentUserId());
materDtlDao.setCreate_name(SecurityUtils.getCurrentNickName()); materDtlDao.setCreate_name(SecurityUtils.getCurrentNickName());
materDtlDao.setCreate_time(DateUtil.now()); materDtlDao.setCreate_time(DateUtil.now());

View File

@@ -846,11 +846,11 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
ioStorInvDtl.put("plan_qty", qty); ioStorInvDtl.put("plan_qty", qty);
total_qty += Double.parseDouble(qty.toString()); total_qty += Double.parseDouble(qty.toString());
//判断该载具编号是否已经存在库内 /* //判断该载具编号是否已经存在库内
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code, row.get("storagevehicle_code"))); Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code, row.get("storagevehicle_code")));
if (ObjectUtil.isNotEmpty(structattr)) { if (ObjectUtil.isNotEmpty(structattr)) {
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!"); throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
} }*/
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class)); ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));

View File

@@ -180,7 +180,7 @@ public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, S
StIvtCheckdtl dtlDao = iStIvtCheckdtlService.getById(dao.getCheckdtl_id()); StIvtCheckdtl dtlDao = iStIvtCheckdtlService.getById(dao.getCheckdtl_id());
String dtlVehicle = dtlDao.getStoragevehicle_code(); String dtlVehicle = dtlDao.getStoragevehicle_code();
if (!dtlVehicle.equals(dao.getStoragevehicle_code())) { if (!dtlVehicle.equals(dao.getStoragevehicle_code())) {
throw new BadRequestException("扫码托盘不属于当前盘点"); throw new BadRequestException("扫码托盘不属于当前盘点托盘");
} }
dtlDao.setFac_qty(dao.getFac_qty()); dtlDao.setFac_qty(dao.getFac_qty());
// 是否异常 1-正常 2-异常 // 是否异常 1-正常 2-异常
@@ -304,6 +304,12 @@ public class StIvtCheckmstServiceImpl extends ServiceImpl<StIvtCheckmstMapper, S
.eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id()) .eq(StIvtCheckdtl::getCheck_id, dto.getCheck_id())
.eq(StIvtCheckdtl::getStatus, IOSEnum.CHECK_DTL_STATUS.code("生成")) .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) { if (dtlDaoList.size() > 1) {
throw new BadRequestException("当前CTU只支持单条盘点移库任务请保证盘点单只有一条明细!"); throw new BadRequestException("当前CTU只支持单条盘点移库任务请保证盘点单只有一条明细!");

View File

@@ -23,7 +23,7 @@
<span class="role-span">出库明细</span> <span class="role-span">出库明细</span>
<div class="crud-opts-form"> <div class="crud-opts-form">
<el-form ref="form" :inline="true" :model="form" size="mini"> <el-form ref="form" :inline="true" :model="form" size="mini">
<!-- <el-form-item label="库区" prop="gender2"> <el-form-item label="分配库区" prop="gender2">
<el-cascader <el-cascader
placeholder="请选择" placeholder="请选择"
:options="sects" :options="sects"
@@ -31,7 +31,7 @@
clearable clearable
@change="sectQueryChange" @change="sectQueryChange"
/> />
</el-form-item>--> </el-form-item>
</el-form> </el-form>
</div> </div>
<span class="crud-opts-right2"> <span class="crud-opts-right2">