rev:测试修改

This commit is contained in:
2026-01-08 15:55:28 +08:00
parent 4f0bf0e727
commit ebbfa976c4
9 changed files with 148 additions and 110 deletions

View File

@@ -173,7 +173,7 @@
<where>
ex.material_id = #{material_id}
AND
st.lock_type = 0
st.lock_type IN ('0','2')
<if test="pcsn!= null and pcsn!= ''">
AND
ex.pcsn = #{pcsn}
@@ -205,7 +205,7 @@
AND
ex.canuse_qty > 0
AND
st.lock_type = 0
st.lock_type IN ('0','2')
<if test="pcsn!= null and pcsn!= ''">
AND
ex.pcsn = #{pcsn}

View File

@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
@@ -48,6 +49,13 @@ public class PdaUpdatePointServiceImpl implements PdaPublicInterfaceService {
new QueryWrapper<SchBaseRegion>().lambda()
.eq(ObjectUtil.isNotEmpty(region_code), SchBaseRegion::getRegion_code, region_code)
);
return PdaResponse.requestParamOk(regionList);
List<JSONObject> collect = regionList.stream()
.map(row -> JSONObject.parseObject(JSONObject.toJSONString(row), JSONObject.class))
.collect(Collectors.toList());
collect.forEach(item -> {
item.put("text", item.getString("region_name"));
item.put("value", item.getString("region_code"));
});
return PdaResponse.requestParamOk(collect);
}
}

View File

@@ -179,12 +179,20 @@ public class PdaWarehouseServiceImpl implements PdaWarehouseService {
public PdaResponse queryReceiveSect() {
List<Sectattr> sectList = sectattrService.list(
new QueryWrapper<Sectattr>().lambda()
.eq(Sectattr::getStor_id, IOSEnum.STOR_ID.code("物料室仓库"))
.in(Sectattr::getStor_id, IOSEnum.STOR_ID.code("物料室仓库"),IOSEnum.STOR_ID.code("内包材仓库"))
.eq(Sectattr::getIs_delete, IOSConstant.ZERO)
.eq(Sectattr::getIs_used, IOSConstant.ONE)
);
return PdaResponse.requestParamOk(sectList);
List<JSONObject> collect = sectList.stream()
.map(row -> JSONObject.parseObject(JSONObject.toJSONString(row), JSONObject.class))
.collect(Collectors.toList());
collect.forEach(item -> {
item.put("text", item.getString("sect_name"));
item.put("value", item.getString("sect_code"));
});
return PdaResponse.requestParamOk(collect);
}
@Override

View File

@@ -76,7 +76,10 @@ public class PdaPackagingServiceImpl implements PdaPackagingService {
if (ObjectUtil.isEmpty(pointDao)) {
throw new BadRequestException("当前点位不存在!【" + whereJson.getString("point_code") + "");
}
return pdaPublicInterfaceService.queryRegionDropdown(JSONObjectOf.of("region", pointDao.getRegion_code()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("region_code",pointDao.getRegion_code());
return pdaPublicInterfaceService.queryRegionDropdown(jsonObject);
}
@Override
@@ -170,7 +173,14 @@ public class PdaPackagingServiceImpl implements PdaPackagingService {
.eq(SchBasePoint::getRegion_code, IOSEnum.REGION_CODE.code("外包材区域"))
.eq(SchBasePoint::getIs_used, IOSConstant.ONE)
);
return PdaResponse.requestParamOk(pointDaoList);
List<JSONObject> collect = pointDaoList.stream()
.map(row -> JSONObject.parseObject(JSONObject.toJSONString(row), JSONObject.class))
.collect(Collectors.toList());
collect.forEach(item -> {
item.put("text", item.getString("point_name"));
item.put("value", item.getString("point_code"));
});
return PdaResponse.requestParamOk(collect);
}
@Override

View File

@@ -28,7 +28,7 @@ import javax.annotation.Resource;
/**
* <p>
* 包材送入任务类
* 包材送入任务类
* </p>
*
* @author Liuxy
@@ -122,9 +122,7 @@ public class PackagingMiddleTask extends AbstractTask {
if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("该任务不存在");
}
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark("已完成");
taskService.updateById(taskObj);
this.finishTask(taskObj);
}
@Override
@@ -150,8 +148,8 @@ public class PackagingMiddleTask extends AbstractTask {
// 跟更新库存点位
iMdPdmPackagingService.update(
new UpdateWrapper<MdPdmPackaging>().lambda()
.set(MdPdmPackaging::getPoint_code, taskObj.getPoint_code3())
.eq(MdPdmPackaging::getPoint_code, taskObj.getPoint_code1())
.set(MdPdmPackaging::getPoint_code, taskObj.getPoint_code3())
);
}

View File

@@ -82,7 +82,7 @@ public enum IOSEnum {
PLACEMENT_TYPE(MapOf.of("深货位", "1", "浅货位", "2")),
// 仓库ID
STOR_ID(MapOf.of("物料室仓库", "1582991156504039424")),
STOR_ID(MapOf.of("物料室仓库", "1582991156504039424","内包材仓库","1582991156504039425")),
// 库区编码
SECT_CODE(MapOf.of("合格区", "HG01", "待检区", "DJ01", "不合格区", "BHG01", "大料箱区", "DLX01")),

View File

@@ -100,7 +100,7 @@
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 md_pb_classstandard class ON class.class_id = mater.material_type_id
LEFT JOIN md_pb_classstandard class ON class.class_id = mater.material_type_id
<where>
late.status = '1'

View File

@@ -109,9 +109,9 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
GroupPlate groupPlate = tableData.get(0);
boolean is_like = tableData.stream()
.allMatch(row -> row.getMaterial_id().equals(groupPlate.getMaterial_id()));
}
if (!is_yl) {
throw new BadRequestException("原料组盘物料必须相同!");
if (!is_like) {
throw new BadRequestException("原料组盘物料必须相同!");
}
}
List<GroupPlate> createList = tableData.stream()

View File

@@ -1095,6 +1095,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
@Override
@Transactional
public void createTask(IOStorInvDis ioStorInvDis, String point_code, IOStorInv ioStorInv) {
IOStorInvDis newDis = ioStorInvDisMapper.selectById(ioStorInvDis.getIostorinvdis_id());
if (newDis.getWork_status().equals(IOSEnum.INBILL_DIS_STATUS.code("生成"))) {
return;
}
//创建任务
JSONObject task_form = new JSONObject();
task_form.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
@@ -1112,14 +1116,22 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
AbstractTask task = taskFactory.getTask(IOSEnum.OUT_CONFIG_CODE.code(ioStorInv.getBill_type()));
String task_id = task.create(task_form);
//分配明细表更新任务相关数据
IOStorInvDis dis = new IOStorInvDis();
dis.setIostorinvdis_id(ioStorInvDis.getIostorinvdis_id());
dis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("生成"));
dis.setTask_id(task_id);
dis.setIs_issued(BaseDataEnum.IS_YES_NOT.code(""));
dis.setPoint_code(point_code);
ioStorInvDisMapper.updateById(dis);
// 查询单据下是否有相同载具
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(
new QueryWrapper<IOStorInvDis>().lambda()
.eq(IOStorInvDis::getIostorinv_id, ioStorInv.getIostorinv_id())
.eq(IOStorInvDis::getStoragevehicle_code, ioStorInvDis.getStoragevehicle_code())
.eq(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("未生成"))
);
for (IOStorInvDis dis : disList) {
//分配明细表更新任务相关数据
dis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("生成"));
dis.setTask_id(task_id);
dis.setIs_issued(BaseDataEnum.IS_YES_NOT.code(""));
dis.setPoint_code(point_code);
ioStorInvDisMapper.updateById(dis);
}
}
@Override
@@ -1263,102 +1275,104 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
List<IOStorInvDis> disList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
.eq(IOStorInvDis::getTask_id, task.getTask_id())
);
if (ObjectUtil.isEmpty(ioStorInvDis)) {
if (ObjectUtil.isEmpty(disList)) {
throw new BadRequestException("未找到任务对应的分配明细");
}
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDis.getIostorinv_id());
IOStorInv ioStorInv = ioStorInvMapper.selectById(disList.get(0).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, task.getMaterial_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);
List<GroupPlate> lateList = groupPlateMapper.selectList(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getPcsn, ioStorInvDis.getPcsn())
.eq(GroupPlate::getVehicle_code, ioStorInvDis.getStoragevehicle_code())
.eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
);
if (ObjectUtil.isEmpty(lateList)) {
throw new BadRequestException("此载具没有组盘【"+ioStorInvDis.getStoragevehicle_code()+"");
}
// 如果有袋码则不更新组盘信息,由手持进行更新
boolean is_emp = lateList.stream()
.anyMatch(row -> ObjectUtil.isEmpty(row.getBag_code()));
if (is_emp) {
GroupPlate groupPlate = lateList.get(0);
double sub_qty = NumberUtil.sub(groupPlate.getQty(), ioStorInvDis.getPlan_qty()).doubleValue();
if (sub_qty != 0) {
groupPlate.setQty(BigDecimal.valueOf(sub_qty));
for (IOStorInvDis ioStorInvDis : disList) {
//查询明细信息
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
if (ObjectUtil.isEmpty(ioStorInvDtl)) {
throw new BadRequestException("未找到明细");
}
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
groupPlateMapper.updateById(groupPlate);
}
// 查询该明细下是否还有未完成的分配明细
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());
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("完成"))
ioStorInvDisMapper.update(ioStorInvDis, new LambdaUpdateWrapper<>(IOStorInvDis.class)
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
.set(IOStorInvDis::getReal_qty, task.getMaterial_qty())
.eq(IOStorInvDis::getIostorinvdis_id, ioStorInvDis.getIostorinvdis_id())
);
// 如果明细全部完成则更新主表状态
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())
//解锁库位
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);
List<GroupPlate> lateList = groupPlateMapper.selectList(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getPcsn, ioStorInvDis.getPcsn())
.eq(GroupPlate::getVehicle_code, ioStorInvDis.getStoragevehicle_code())
.eq(GroupPlate::getMaterial_id, ioStorInvDis.getMaterial_id())
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
);
if (ObjectUtil.isEmpty(lateList)) {
throw new BadRequestException("此载具没有组盘【"+ioStorInvDis.getStoragevehicle_code()+"");
}
// 如果有袋码则不更新组盘信息,由手持进行更新
boolean is_emp = lateList.stream()
.anyMatch(row -> ObjectUtil.isEmpty(row.getBag_code()));
if (is_emp) {
GroupPlate groupPlate = lateList.get(0);
double sub_qty = NumberUtil.sub(groupPlate.getQty(), ioStorInvDis.getPlan_qty()).doubleValue();
if (sub_qty != 0) {
groupPlate.setQty(BigDecimal.valueOf(sub_qty));
}
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("出库"));
groupPlateMapper.updateById(groupPlate);
}
// 查询该明细下是否还有未完成的分配明细
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());
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())
);
}
}
}
}