二级库编码设备归还问题修复

This commit is contained in:
hayu 2025-02-27 14:43:44 +08:00
parent e1a00fd193
commit 3475e6418c
3 changed files with 24 additions and 4 deletions

View File

@ -95,4 +95,11 @@ public interface SecondaryWarehouseMapper {
List<SecondCcrapApplyDetails> getSecondScrapListDetails(SecondCcrapApplyDetails bean); List<SecondCcrapApplyDetails> getSecondScrapListDetails(SecondCcrapApplyDetails bean);
List<SecondCcrapApplyDetails> getSecondScrapByMaId(@Param("maId") String maId, @Param("typeId") String typeId); List<SecondCcrapApplyDetails> getSecondScrapByMaId(@Param("maId") String maId, @Param("typeId") String typeId);
/**
* 根据maId和typeId查询父级id
* @param teamLeaseInfo
* @return
*/
TeamLeaseInfo getParentIdByMaIdAndTypeId(TeamLeaseInfo teamLeaseInfo);
} }

View File

@ -327,7 +327,14 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
teamLeaseInfo.setMaId(maId); teamLeaseInfo.setMaId(maId);
teamLeaseInfo.setTypeId(bean.getTypeId()); teamLeaseInfo.setTypeId(bean.getTypeId());
teamLeaseInfo.setOutNum(1); teamLeaseInfo.setOutNum(1);
teamLeaseInfo.setId(bean.getId());
//此处需要根据maId和typeId去查询领料出库表获取parentId
TeamLeaseInfo bean1=mapper.getParentIdByMaIdAndTypeId(teamLeaseInfo);
if (bean1!=null && bean1.getParentId()!=null){
teamLeaseInfo.setId(Long.valueOf(bean1.getParentId()));
} else {
teamLeaseInfo.setId(bean.getId());
}
num = mapper.addNewOperate(teamLeaseInfo); num = mapper.addNewOperate(teamLeaseInfo);
mapper.updateMachine(maId, 15); mapper.updateMachine(maId, 15);
// // 修改库存总量 // // 修改库存总量

View File

@ -108,7 +108,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
GROUP BY GROUP BY
bui.unit_id, bui.unit_id,
lod.parent_id,
lod.type_id lod.type_id
</select> </select>
<select id="getList1" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse"> <select id="getList1" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse">
@ -335,7 +334,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM FROM
receive_detail rd receive_detail rd
WHERE WHERE
parent_id = #{id} unit_id = #{unitId}
AND type_id = #{typeId} AND type_id = #{typeId}
</select> </select>
<select id="getNewRecords" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo"> <select id="getNewRecords" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
@ -507,7 +506,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND rd4.team_group_id = rd2.team_group_id AND rd4.team_group_id = rd2.team_group_id
AND rd4.unit_id = rd2.unit_id))) AND rd4.unit_id = rd2.unit_id)))
) )
GROUP BY rd.type_id, rd.parent_id GROUP BY rd.type_id
</select> </select>
<select id="getDevCount" resultType="java.lang.Integer"> <select id="getDevCount" resultType="java.lang.Integer">
SELECT SELECT
@ -676,6 +675,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_machine mm on ssd.ma_id = mm.ma_id left join ma_machine mm on ssd.ma_id = mm.ma_id
where ssd.ma_id = #{maId} and ssd.type_id = #{typeId} and ssd.status in (0,1) where ssd.ma_id = #{maId} and ssd.type_id = #{typeId} and ssd.status in (0,1)
</select> </select>
<select id="getParentIdByMaIdAndTypeId" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
select parent_id as parentId
from lease_out_details
where ma_id = #{maId}
and type_id = #{typeId}
order by create_time desc limit 1
</select>
<insert id="addConfig"> <insert id="addConfig">
insert into second_lot_config (name,unit_id,creater,create_time) insert into second_lot_config (name,unit_id,creater,create_time)