维修单分拆

This commit is contained in:
sxu 2024-11-28 19:20:35 +08:00
parent b970a71b9c
commit 04b8cded95
3 changed files with 18 additions and 12 deletions

View File

@ -98,6 +98,9 @@ public class RepairTaskDetails extends BaseEntity {
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")
private String keyword; private String keyword;
@ApiModelProperty(value = "维修任务编码")
private String taskCode;
public RepairTaskDetails(Long taskId) { public RepairTaskDetails(Long taskId) {
this.taskId = taskId; this.taskId = taskId;
} }

View File

@ -804,15 +804,16 @@ public class RepairServiceImpl implements RepairService {
// 3.业务逻辑处理 // 3.业务逻辑处理
for (RepairTask task : taskList) { for (RepairTask task : taskList) {
// 查询维修任务的详情表 // 查询维修任务的详情表
Long wxTaskId = task.getTaskId(); Long oldWxTaskId = task.getTaskId();
List<RepairTaskDetails> detailsList = repairApplyDetailsMapper.getRepairDetailsWhichNotSent(wxTaskId); List<RepairTaskDetails> detailsList = repairApplyDetailsMapper.getRepairDetailsWhichNotSent(oldWxTaskId);
if (!CollectionUtils.isEmpty(detailsList)) { if (!CollectionUtils.isEmpty(detailsList)) {
task.setCreateBy(loginUser.getUserid()); task.setCreateBy(loginUser.getUserid());
Long agreementId = repairMapper.getAgreementId(task); Long agreementId = repairMapper.getAgreementId(task);
// 新增tm_task表数据修饰审核任务状态是待审核 // 新增tm_task表数据修饰审核任务状态是待审核
task.setTaskType(TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT.getTaskTypeId()); task.setTaskType(TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT.getTaskTypeId());
task.setTaskStatus(RepairTaskStatusEnum.TASK_STATUS_TO_EXAM.getStatus()); task.setTaskStatus(RepairTaskStatusEnum.TASK_STATUS_TO_EXAM.getStatus());
repairMapper.addTask(task); task.setRepairCode(detailsList.get(0).getTaskCode());
repairMapper.addTask(task); // 注意此处将会生成新的 taskId 审核入库用的
// 新增协议任务表tm_task_agreement--关联修饰任务与协议 // 新增协议任务表tm_task_agreement--关联修饰任务与协议
task.setAgreementId(agreementId); task.setAgreementId(agreementId);
repairMapper.createAgreementTask(task); repairMapper.createAgreementTask(task);

View File

@ -109,15 +109,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<select id="getRepairDetailsWhichNotSent" resultType="com.bonus.material.repair.domain.RepairTaskDetails"> <select id="getRepairDetailsWhichNotSent" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
select id, select rad.id,
ma_id as maId, rad.ma_id as maId,
type_id as typeId, rad.type_id as typeId,
repair_num as repairNum, rad.repair_num as repairNum,
repaired_num as repairedNum, rad.repaired_num as repairedNum,
scrap_num as scrapNum, rad.scrap_num as scrapNum,
company_id as companyId rad.company_id as companyId,
from repair_apply_details tt.code as taskCode
where task_id = #{taskId} and status = '1' and sent_to_next_phase = '0' from repair_apply_details rad
left join tm_task tt on rad.task_id = tt.task_id
where rad.task_id = #{taskId} and rad.status = '1' and rad.sent_to_next_phase = '0'
</select> </select>
<delete id="deleteRepairApplyDetailsById" parameterType="Long"> <delete id="deleteRepairApplyDetailsById" parameterType="Long">