部分退料
This commit is contained in:
parent
cab68ff11b
commit
a3fc3d3890
|
|
@ -207,4 +207,6 @@ public interface BackReceiveMapper {
|
|||
List<BackApplyInfo> getCtList(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> backReceiveRecordWebPt(BackApplyInfo record);
|
||||
|
||||
int finishBackCheckDetails(BackApplyInfo record);
|
||||
}
|
||||
|
|
@ -98,6 +98,10 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int finishBackCheckDetails(BackApplyInfo record) {
|
||||
return backReceiveMapper.finishBackCheckDetails(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int setCodeBack(BackApplyInfo record) {
|
||||
|
|
@ -236,6 +240,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
record.setPostStoreNum(postStoreNum);
|
||||
}
|
||||
|
||||
//完成退料的部分,更新 back_check_details 为 is_finished=1,此部分不支持撤回
|
||||
finishBackCheckDetails(record);
|
||||
|
||||
//库存日志
|
||||
record.setBackNum(passNum+maintenanceNum+scrapNum);
|
||||
record.setPassNum(passNum);
|
||||
|
|
|
|||
|
|
@ -578,6 +578,11 @@
|
|||
status = '1'
|
||||
where id = #{info.id}
|
||||
</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 from back_check_details where parent_id = #{parentId} and type_id = #{typeId}
|
||||
<if test="maId != null and maId != ''">
|
||||
|
|
@ -669,6 +674,7 @@
|
|||
bad.status as status,
|
||||
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
|
||||
mt.manage_type as manageType,
|
||||
bb.finished_back_num,
|
||||
mtk.user_id,
|
||||
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`
|
||||
FROM
|
||||
|
|
@ -688,6 +694,16 @@
|
|||
parent_id=#{id}
|
||||
GROUP BY 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
|
||||
bai.id=#{id}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
|
|
|
|||
Loading…
Reference in New Issue