部分退料

This commit is contained in:
sxu 2024-08-22 18:31:49 +08:00
parent cab68ff11b
commit a3fc3d3890
3 changed files with 25 additions and 0 deletions

View File

@ -207,4 +207,6 @@ public interface BackReceiveMapper {
List<BackApplyInfo> getCtList(BackApplyInfo record); List<BackApplyInfo> getCtList(BackApplyInfo record);
List<BackApplyInfo> backReceiveRecordWebPt(BackApplyInfo record); List<BackApplyInfo> backReceiveRecordWebPt(BackApplyInfo record);
int finishBackCheckDetails(BackApplyInfo record);
} }

View File

@ -98,6 +98,10 @@ public class BackReceiveServiceImpl implements BackReceiveService {
return res; return res;
} }
private int finishBackCheckDetails(BackApplyInfo record) {
return backReceiveMapper.finishBackCheckDetails(record);
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int setCodeBack(BackApplyInfo record) { public int setCodeBack(BackApplyInfo record) {
@ -236,6 +240,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
record.setPostStoreNum(postStoreNum); record.setPostStoreNum(postStoreNum);
} }
//完成退料的部分更新 back_check_details is_finished=1此部分不支持撤回
finishBackCheckDetails(record);
//库存日志 //库存日志
record.setBackNum(passNum+maintenanceNum+scrapNum); record.setBackNum(passNum+maintenanceNum+scrapNum);
record.setPassNum(passNum); record.setPassNum(passNum);

View File

@ -578,6 +578,11 @@
status = '1' status = '1'
where id = #{info.id} where id = #{info.id}
</update> </update>
<update id="finishBackCheckDetails">
update back_check_details set is_finished = 1 where parent_id = #{parentId} and type_id = #{typeId}
</update>
<delete id="deleteCheckDetails"> <delete id="deleteCheckDetails">
delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId} delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId}
<if test="maId != null and maId != ''"> <if test="maId != null and maId != ''">
@ -669,6 +674,7 @@
bad.status as status, bad.status as status,
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num, IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
mt.manage_type as manageType, mt.manage_type as manageType,
bb.finished_back_num,
mtk.user_id, mtk.user_id,
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code` CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`
FROM FROM
@ -688,6 +694,16 @@
parent_id=#{id} parent_id=#{id}
GROUP BY type_id GROUP BY type_id
) aa on aa.typeId=bad.type_id ) aa on aa.typeId=bad.type_id
LEFT JOIN (
SELECT
type_id as typeId,
SUM(IFNULL(back_num,0)) as finished_back_num
FROM
back_check_details
WHERE
parent_id=#{id} and is_finished = 1
GROUP BY type_id
) bb on bb.typeId=bad.type_id
WHERE WHERE
bai.id=#{id} bai.id=#{id}
<if test="typeId != null and typeId != ''"> <if test="typeId != null and typeId != ''">