add 提交

This commit is contained in:
ls
2025-12-15 08:50:13 +08:00
parent 8b16c31548
commit 8565db7179
5 changed files with 137 additions and 11 deletions

View File

@@ -422,16 +422,19 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (subList.get(0).getQuanlity_in_box().intValue() != split.length) { if (subList.get(0).getQuanlity_in_box().intValue() != split.length) {
throw new BadRequestException("当前木箱" + subList.get(0).getQuanlity_in_box() + "要装箱的子卷" + split.length + "未装完"); throw new BadRequestException("当前木箱" + subList.get(0).getQuanlity_in_box() + "要装箱的子卷" + split.length + "未装完");
} }
String boxSn = subList.get(0).getPackage_box_sn();
PdmBiContainerinbound pdmBiContainerinbound = new PdmBiContainerinbound(); //查找包装关系,获取子卷组号,子卷号校验
pdmBiContainerinbound.setId(org.nl.common.utils.IdUtil.getStringId()); PdmBiContainerinbound pdmBiContainerinbound = iPdmBiContainerinboundService.getOne(new QueryWrapper<PdmBiContainerinbound>().eq("box", subList.get(0).getPackage_box_sn()));
pdmBiContainerinbound.setContainer_name(containerName); String containerNameStr = pdmBiContainerinbound.getContainer_name();
pdmBiContainerinbound.setBox(boxSn); if (StrUtil.isEmpty(containerNameStr)){
Boolean inbound = param.getBoolean("inbound"); throw new BadRequestException("当前木箱关联的子卷为空");
if (inbound != null) { }
pdmBiContainerinbound.setInbound(inbound); List<String> containerBiList = Arrays.asList(containerNameStr.split(","));
HashSet<String> containerSet = new HashSet<>(containerList);
HashSet<String> containerBiSet = new HashSet<>(containerBiList);
if (!containerSet.containsAll(containerBiSet) || !containerBiSet.containsAll(containerSet)){
throw new BadRequestException("手持扫描子卷和木箱出库子卷不属于同一组" + containerBiList);
} }
iPdmBiContainerinboundService.save(pdmBiContainerinbound);
PdmProductSpecServiceImpl.doRecord(SpecEnum.ZXRK, null, Boolean.TRUE, null, containerList); PdmProductSpecServiceImpl.doRecord(SpecEnum.ZXRK, null, Boolean.TRUE, null, containerList);
} }

View File

@@ -11,8 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack; import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack;
import org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper.BstIvtBoxstackMapper; import org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper.BstIvtBoxstackMapper;
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinbound;
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
import org.nl.b_lms.pdm.storagevehicleext.dao.MdPbStoragevehicleext; import org.nl.b_lms.pdm.storagevehicleext.dao.MdPbStoragevehicleext;
import org.nl.b_lms.pdm.storagevehicleext.dao.mapper.MdPbStoragevehicleextMapper; import org.nl.b_lms.pdm.storagevehicleext.dao.mapper.MdPbStoragevehicleextMapper;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService; import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum; import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
@@ -25,12 +29,14 @@ import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.sch.AcsTaskDto; import org.nl.wms.sch.AcsTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import static org.nl.wms.util.TaskUtil.getRoutePlanCode; import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
@@ -58,7 +64,12 @@ public class BoxSSXTask extends AbstractAcsTask {
@Resource @Resource
private MdStorageVehicleInfoMapper mdStorageVehicleInfoMapper; private MdStorageVehicleInfoMapper mdStorageVehicleInfoMapper;
@Autowired
private PdmBiSubpackagerelationMapper pdmBiSubpackagerelationMapper;
@Autowired
private IPdmBiContainerinboundService iPdmBiContainerinboundService;
@Override @Override
public List<AcsTaskDto> addTask() { public List<AcsTaskDto> addTask() {
/* /*
@@ -142,6 +153,23 @@ public class BoxSSXTask extends AbstractAcsTask {
mdPbStoragevehicleext.setUpdate_time( DateUtil.now()); mdPbStoragevehicleext.setUpdate_time( DateUtil.now());
mdPbStoragevehicleextMapper.updateById(mdPbStoragevehicleext); mdPbStoragevehicleextMapper.updateById(mdPbStoragevehicleext);
} }
//子卷和木箱组盘
String containerName = "";
List<PdmBiSubpackagerelation> pdmBiSubpackagerelations = pdmBiSubpackagerelationMapper.selectList(new QueryWrapper<PdmBiSubpackagerelation>().eq("package_box_sn", taskObj.getString("vehicle_code")));
if (!pdmBiSubpackagerelations.isEmpty() && pdmBiSubpackagerelations.size()>1){
containerName = pdmBiSubpackagerelations.stream()
.map(item -> item.getContainer_name() != null ? item.getContainer_name() : "")
.filter(name -> !name.isEmpty()) // 过滤掉空字符串
.collect(Collectors.joining(","));
}else {
containerName = pdmBiSubpackagerelations.get(0).getContainer_name();
}
PdmBiContainerinbound pdmBiContainerinbound = new PdmBiContainerinbound();
pdmBiContainerinbound.setId(org.nl.common.utils.IdUtil.getStringId());
pdmBiContainerinbound.setContainer_name(containerName);
pdmBiContainerinbound.setBox( taskObj.getString("vehicle_code"));
iPdmBiContainerinboundService.save(pdmBiContainerinbound);
} }
// 取消 // 取消

View File

@@ -649,9 +649,45 @@
#{code} #{code}
</foreach> </foreach>
</if> </if>
AND EXISTS (
SELECT 1 FROM ST_IVT_IOStorInv ios_sub
WHERE ios_sub.iostorinv_id = dtl.iostorinv_id
AND ios_sub.is_delete = '0'
AND ios_sub.io_type = '0'
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
AND ios_sub.stor_id IN
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</if>
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
AND ios_sub.stor_id = #{paramMap.stor_id}
</if>
<if test="paramMap.bill_type != null and paramMap.bill_type != ''">
AND ios_sub.bill_type = #{paramMap.bill_type}
</if>
<if test="paramMap.bill_code != null and paramMap.bill_code != ''">
AND ios_sub.bill_code LIKE '%${paramMap.bill_code}%'
</if>
<if test="paramMap.create_mode != null and paramMap.create_mode != ''">
AND ios_sub.create_mode = #{paramMap.create_mode}
</if>
<if test="paramMap.bill_status != null and paramMap.bill_status != ''">
AND ios_sub.bill_status = #{paramMap.bill_status}
</if>
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
AND ios_sub.input_time <![CDATA[ >= ]]> #{paramMap.begin_time}
</if>
<if test="paramMap.end_time != null and paramMap.end_time != ''">
AND ios_sub.input_time <![CDATA[ <= ]]> #{paramMap.end_time}
</if>
)
GROUP BY GROUP BY
dtl.iostorinv_id dtl.iostorinv_id
) dtl2 ON ios2.iostorinv_id = dtl2.iostorinv_id ) dtl2 ON ios2.iostorinv_id = dtl2.iostorinv_id
order BY
ios2.input_time DESC
</select> </select>
<select id="outBillPage" resultType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv"> <select id="outBillPage" resultType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv">
SELECT SELECT
@@ -799,6 +835,26 @@
<if test="paramMap.width != null and paramMap.width != ''"> <if test="paramMap.width != null and paramMap.width != ''">
AND dtl.width LIKE '%${paramMap.width}%' AND dtl.width LIKE '%${paramMap.width}%'
</if> </if>
AND EXISTS (
SELECT 1 FROM st_ivt_iostorinv mst_sub
WHERE mst_sub.iostorinv_id = dtl.iostorinv_id
AND mst_sub.io_type = '1'
AND mst_sub.is_delete = '0'
-- 复用主表核心筛选条件,缩小范围
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
AND mst_sub.stor_id IN
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</if>
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
AND mst_sub.input_time <![CDATA[ >= ]]> #{paramMap.begin_time}
</if>
<if test="paramMap.end_time != null and paramMap.end_time != ''">
AND mst_sub.input_time <![CDATA[ <= ]]> #{paramMap.end_time}
</if>
)
GROUP BY GROUP BY
dtl.iostorinv_id, dtl.iostorinv_id,
dtl.vbeln dtl.vbeln
@@ -841,6 +897,24 @@
#{code} #{code}
</foreach> </foreach>
</if> </if>
AND EXISTS (
SELECT 1 FROM st_ivt_iostorinv mst_sub
WHERE mst_sub.iostorinv_id = dis.iostorinv_id
AND mst_sub.io_type = '1'
AND mst_sub.is_delete = '0'
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
AND mst_sub.stor_id IN
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</if>
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
AND mst_sub.input_time <![CDATA[ >= ]]> #{paramMap.begin_time}
</if>
<if test="paramMap.end_time != null and paramMap.end_time != ''">
AND mst_sub.input_time <![CDATA[ <= ]]> #{paramMap.end_time}
</if>
)
GROUP BY GROUP BY
dis.iostorinv_id dis.iostorinv_id
) b ON b.iostorinv_id = ios.iostorinv_id ) b ON b.iostorinv_id = ios.iostorinv_id
@@ -857,6 +931,24 @@
b.io_type = '1' b.io_type = '1'
and b.is_delete='0' and b.is_delete='0'
and b.is_overdue = '0' and b.is_overdue = '0'
AND EXISTS (
SELECT 1 FROM st_ivt_iostorinv mst_sub
WHERE mst_sub.iostorinv_id = a.iostorinv_id
AND mst_sub.io_type = '1'
AND mst_sub.is_delete = '0'
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
AND mst_sub.stor_id IN
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
#{code}
</foreach>
</if>
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
AND mst_sub.input_time <![CDATA[ >= ]]> #{paramMap.begin_time}
</if>
<if test="paramMap.end_time != null and paramMap.end_time != ''">
AND mst_sub.input_time <![CDATA[ <= ]]> #{paramMap.end_time}
</if>
)
GROUP BY a.iostorinv_id GROUP BY a.iostorinv_id
) a ON a.iostorinv_id = ios.iostorinv_id ) a ON a.iostorinv_id = ios.iostorinv_id
ORDER BY iostorinv_id DESC ORDER BY iostorinv_id DESC

View File

@@ -373,8 +373,8 @@ public class OutChargeServiceImpl implements OutChargeService {
String msg = String.join(",", ivtList); String msg = String.join(",", ivtList);
throw new BadRequestException("此子卷已存在库存:" + msg); throw new BadRequestException("此子卷已存在库存:" + msg);
} }
iostorinvdtlService.updateBatchById(needSaveDtlList); iostorinvdtlService.saveBatch(needSaveDtlList);
iostorinvdisService.updateBatchById(needSaveDisList); iostorinvdisService.saveBatch(needSaveDisList);
} }
} }

View File

@@ -152,4 +152,7 @@ public class OutBillTaskVo implements Serializable {
private String sap_pcsn; private String sap_pcsn;
private String width_standard; private String width_standard;
private String task_type_name; private String task_type_name;
private String material_code;
private String material_name;
} }