维修驳回优化

This commit is contained in:
mashuai 2025-06-24 09:58:21 +08:00
parent 0467712248
commit af7f799433
6 changed files with 21 additions and 8 deletions

View File

@ -85,4 +85,7 @@ public class RepairApplyDetails extends BaseEntity {
@Excel(name = "维修人") @Excel(name = "维修人")
@ApiModelProperty(value = "维修人") @ApiModelProperty(value = "维修人")
private String repairer; private String repairer;
@ApiModelProperty(value = "前任务ID")
private Long preTaskId;
} }

View File

@ -137,4 +137,7 @@ public class RepairAuditDetails extends BaseEntity {
@ApiModelProperty(value = "app维修审核状态10 进行中 11已审核包含通过和驳回") @ApiModelProperty(value = "app维修审核状态10 进行中 11已审核包含通过和驳回")
private Integer appTaskStatus; private Integer appTaskStatus;
@ApiModelProperty(value = "维修拆分层级")
private String level;
} }

View File

@ -546,8 +546,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
TmTask preTmTaskInfo = taskMapper.selectTmTaskByTaskId(auditDetails.getTaskId()); TmTask preTmTaskInfo = taskMapper.selectTmTaskByTaskId(auditDetails.getTaskId());
List<RepairTaskDetails> detailsList = repairApplyDetailsMapper.getRepairDetailsWhichNotSent(preTmTaskInfo.getPreTaskId()); List<RepairTaskDetails> detailsList = repairApplyDetailsMapper.getRepairDetailsWhichNotSent(preTmTaskInfo.getPreTaskId());
Long backId = null; Long backId = null;
String level = null;
if (!CollectionUtils.isEmpty(detailsList)) { if (!CollectionUtils.isEmpty(detailsList)) {
backId = detailsList.get(0).getBackId(); backId = detailsList.get(0).getBackId();
level = detailsList.get(0).getLevel();
} }
/*if (Objects.nonNull(preTmTaskInfo) && Objects.nonNull(preTmTaskInfo.getPreTaskId())) { /*if (Objects.nonNull(preTmTaskInfo) && Objects.nonNull(preTmTaskInfo.getPreTaskId())) {
taskMapper.updateTaskStatus(String.valueOf(preTmTaskInfo.getPreTaskId()), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus()); taskMapper.updateTaskStatus(String.valueOf(preTmTaskInfo.getPreTaskId()), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus());
@ -570,7 +572,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
repairTaskDetails.setTypeId(repairAuditDetail.getTypeId().toString()); repairTaskDetails.setTypeId(repairAuditDetail.getTypeId().toString());
repairTaskDetails.setRepairNum(repairAuditDetail.getRepairNum()); repairTaskDetails.setRepairNum(repairAuditDetail.getRepairNum());
repairTaskDetails.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName()); repairTaskDetails.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
repairTaskDetails.setBackId(backId == null ? null : backId); repairTaskDetails.setBackId(backId);
if(StringUtils.isNotBlank( level)) {
repairTaskDetails.setLevel(String.valueOf(Integer.parseInt(level) + 1));
}
repairMapper.insertRepaired(repairTaskDetails); repairMapper.insertRepaired(repairTaskDetails);
} }
} }

View File

@ -30,7 +30,6 @@ import com.bonus.system.api.domain.SysUser;
import com.bonus.system.api.model.LoginUser; import com.bonus.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.hibernate.validator.internal.util.StringHelper; import org.hibernate.validator.internal.util.StringHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -1244,11 +1243,13 @@ public class RepairServiceImpl implements RepairService {
throw new ServiceException("维修驳回失败,请联系管理员"); throw new ServiceException("维修驳回失败,请联系管理员");
} }
// 更新结算信息表 // 更新结算信息表
result = sltAgreementInfoMapper.backInUseNum(repairApplyDetails);
if (result < 1) {
throw new ServiceException("维修驳回失败,请联系管理员");
}
if (repairApplyDetails != null) { if (repairApplyDetails != null) {
TmTask tmTask = taskMapper.selectTmTaskByTaskId(repairApplyDetails.getTaskId());
repairApplyDetails.setPreTaskId(tmTask.getPreTaskId());
result = sltAgreementInfoMapper.backInUseNum(repairApplyDetails);
if (result < 1) {
throw new ServiceException("维修驳回失败,请联系管理员");
}
extractedByDetails(repairApplyDetails); extractedByDetails(repairApplyDetails);
} }
} }

View File

@ -208,7 +208,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectById" resultType="com.bonus.material.repair.domain.RepairAuditDetails"> <select id="selectById" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
select task_id as taskId, select task_id as taskId,
type_id as typeId, type_id as typeId,
ma_id as maId ma_id as maId,
level as level
from repair_apply_details from repair_apply_details
where id = #{repairId} where id = #{repairId}
</select> </select>

View File

@ -592,7 +592,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set set
sai.end_time = null, sai.back_id = null, sai.status = '0', sai.update_time = CURRENT_TIMESTAMP sai.end_time = null, sai.back_id = null, sai.status = '0', sai.update_time = CURRENT_TIMESTAMP
where where
bai.task_id = #{taskId} and sai.status = '1' bai.task_id = #{preTaskId} and sai.status = '1'
<if test="typeId != null"> <if test="typeId != null">
and sai.type_id = #{typeId} and sai.type_id = #{typeId}
</if> </if>