退料接收单据完结
This commit is contained in:
parent
9483d7dd95
commit
f98a284238
|
|
@ -268,17 +268,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (taskStatus == 0) {
|
||||
throw new RuntimeException("该退料单已完成退料");
|
||||
}
|
||||
//修改任务状态
|
||||
/* res = updateTaskStatus(taskId, 40);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("tm_task修改状态");
|
||||
}*/
|
||||
record.setId(record.getParentId());
|
||||
List<BackApplyInfo> list = receiveView2(record);
|
||||
boolean allZeros = list.stream().allMatch(n -> Double.valueOf(n.getNum()).intValue() == 0);
|
||||
if (allZeros) {
|
||||
res = updateTaskStatus(taskId, 40);
|
||||
}
|
||||
//更加退料接收的数据创建下一步流程
|
||||
//合格的插入入库记录input_apply_details,修改库存ma_type,修改机具状态
|
||||
if (StringUtils.isNotBlank(record.getTypeId())) {
|
||||
|
|
@ -289,6 +279,8 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
int passNum = 0;
|
||||
int maintenanceNum = 0;
|
||||
int scrapNum = 0;
|
||||
List<BackApplyInfo> list = receiveView2(record);
|
||||
boolean allZeros = list.stream().allMatch(n -> Double.valueOf(n.getNum()).intValue() == 0);
|
||||
if (allZeros) {
|
||||
//修改back_apply_details为已退料(1)
|
||||
res = updateStatus(record);
|
||||
|
|
@ -369,6 +361,12 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
int postStoreNum = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setPostStoreNum(postStoreNum);
|
||||
}
|
||||
List<BackApplyInfo> endList = receiveView2(record);
|
||||
// 如果endList中所有数据的backStatus都为1,则修改任务状态为完成
|
||||
boolean allFinished = endList.stream().allMatch(n -> "1".equals(n.getBackStatus()));
|
||||
if (allFinished) {
|
||||
res = updateTaskStatus(taskId, 40);
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("typeId为空");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1179,6 +1179,9 @@
|
|||
) aa on aa.typeId=bad.type_id
|
||||
WHERE
|
||||
bai.id=#{id}
|
||||
<if test="typeId != null and typeId !=''">
|
||||
AND bad.type_id = #{typeId}
|
||||
</if>
|
||||
order by bad.create_time
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -543,6 +543,13 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
// 查看该协议已建立退料数据
|
||||
List<BackApplyInfo> oldBackTypes = backApplyMapper.getBackApplyDetailsTypeCount(bean);
|
||||
if (CollectionUtils.isNotEmpty(oldBackTypes)) {
|
||||
// 判断oldBackTypes中的backStatus是否为1,如果为1,去back_check_details表查询实际退料数量
|
||||
for (BackApplyInfo backApplyInfo : oldBackTypes) {
|
||||
if ("1".equals(backApplyInfo.getBackStatus())) {
|
||||
BackApplyInfo info = backApplyMapper.getList(backApplyInfo);
|
||||
backApplyInfo.setBackNum(info != null ? (int) Double.parseDouble(info.getNum()) : 0);
|
||||
}
|
||||
}
|
||||
oldBackMap = oldBackTypes.stream().collect(Collectors.groupingBy(BackApplyInfo::getTypeId,
|
||||
Collectors.summingInt(BackApplyInfo::getBackNum)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -918,6 +918,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="getViewByApply" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id AS id,
|
||||
bai.back_person AS backPerson,
|
||||
bai.phone AS phone,
|
||||
bai.back_time as backTime,
|
||||
|
|
@ -1083,17 +1084,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getBackApplyDetailsTypeCount" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bcd.type_id AS typeId,
|
||||
sum( bcd.back_num ) AS backNum
|
||||
bad.parent_id AS id,
|
||||
bad.back_status AS backStatus,
|
||||
bad.type_id AS typeId,
|
||||
sum( bad.audit_num ) AS backNum
|
||||
FROM
|
||||
back_check_details bcd
|
||||
LEFT JOIN back_apply_info bai ON bai.id = bcd.parent_id
|
||||
back_apply_details bad
|
||||
LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id
|
||||
LEFT JOIN tm_task tt ON bai.task_id = tt.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
|
||||
WHERE
|
||||
tta.agreement_id = #{agreementId}
|
||||
GROUP BY
|
||||
bcd.type_id
|
||||
bad.parent_id,
|
||||
bad.type_id
|
||||
</select>
|
||||
|
||||
<select id="getLeaseApplyDetailsTypeCount" resultType="com.bonus.sgzb.material.domain.LeaseApplyDetails">
|
||||
|
|
|
|||
Loading…
Reference in New Issue