维修单分拆
This commit is contained in:
parent
b970a71b9c
commit
04b8cded95
|
|
@ -98,6 +98,9 @@ public class RepairTaskDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty(value = "维修任务编码")
|
||||
private String taskCode;
|
||||
|
||||
public RepairTaskDetails(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -804,15 +804,16 @@ public class RepairServiceImpl implements RepairService {
|
|||
// 3.业务逻辑处理
|
||||
for (RepairTask task : taskList) {
|
||||
// 查询维修任务的详情表
|
||||
Long wxTaskId = task.getTaskId();
|
||||
List<RepairTaskDetails> detailsList = repairApplyDetailsMapper.getRepairDetailsWhichNotSent(wxTaskId);
|
||||
Long oldWxTaskId = task.getTaskId();
|
||||
List<RepairTaskDetails> detailsList = repairApplyDetailsMapper.getRepairDetailsWhichNotSent(oldWxTaskId);
|
||||
if (!CollectionUtils.isEmpty(detailsList)) {
|
||||
task.setCreateBy(loginUser.getUserid());
|
||||
Long agreementId = repairMapper.getAgreementId(task);
|
||||
// 新增tm_task表数据、修饰审核任务、状态是待审核
|
||||
task.setTaskType(TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT.getTaskTypeId());
|
||||
task.setTaskStatus(RepairTaskStatusEnum.TASK_STATUS_TO_EXAM.getStatus());
|
||||
repairMapper.addTask(task);
|
||||
task.setRepairCode(detailsList.get(0).getTaskCode());
|
||||
repairMapper.addTask(task); // 注意:此处将会生成新的 taskId (审核入库用的)
|
||||
// 新增协议任务表tm_task_agreement--关联修饰任务与协议
|
||||
task.setAgreementId(agreementId);
|
||||
repairMapper.createAgreementTask(task);
|
||||
|
|
|
|||
|
|
@ -109,15 +109,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<select id="getRepairDetailsWhichNotSent" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
||||
select id,
|
||||
ma_id as maId,
|
||||
type_id as typeId,
|
||||
repair_num as repairNum,
|
||||
repaired_num as repairedNum,
|
||||
scrap_num as scrapNum,
|
||||
company_id as companyId
|
||||
from repair_apply_details
|
||||
where task_id = #{taskId} and status = '1' and sent_to_next_phase = '0'
|
||||
select rad.id,
|
||||
rad.ma_id as maId,
|
||||
rad.type_id as typeId,
|
||||
rad.repair_num as repairNum,
|
||||
rad.repaired_num as repairedNum,
|
||||
rad.scrap_num as scrapNum,
|
||||
rad.company_id as companyId,
|
||||
tt.code as taskCode
|
||||
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>
|
||||
|
||||
<delete id="deleteRepairApplyDetailsById" parameterType="Long">
|
||||
|
|
|
|||
Loading…
Reference in New Issue