Showing
6 changed files
with
21 additions
and
0 deletions
... | ... | @@ -75,6 +75,7 @@ CREATE TABLE "public"."qg_repair_record" ( |
75 | 75 | "repair_date" timestamp(6), |
76 | 76 | "repair_by" varchar(36), |
77 | 77 | "description" varchar(500), |
78 | + "malfunction_reason_id" varchar(36), | |
78 | 79 | "tenant_id" varchar(36), |
79 | 80 | "create_time" timestamp(6), |
80 | 81 | "creator" varchar(36), | ... | ... |
... | ... | @@ -932,6 +932,7 @@ CREATE TABLE IF NOT EXISTS qg_repair_record ( |
932 | 932 | "repair_date" timestamp(6), |
933 | 933 | "repair_by" varchar(36), |
934 | 934 | "description" varchar(500), |
935 | + "malfunction_reason_id" varchar(36), | |
935 | 936 | "tenant_id" varchar(36), |
936 | 937 | "create_time" timestamp(6), |
937 | 938 | "creator" varchar(36), | ... | ... |
... | ... | @@ -33,6 +33,12 @@ public class TkRepairRecordDTO extends TenantDTO { |
33 | 33 | @ApiModelProperty(value = "维修情况说明") |
34 | 34 | private String description; |
35 | 35 | |
36 | + @ApiModelProperty(value = "故障原因id") | |
37 | + private String malfunctionReasonId; | |
38 | + | |
39 | + @ApiModelProperty(value = "故障原因") | |
40 | + private String malfunctionReasonName; | |
41 | + | |
36 | 42 | @ApiModelProperty(value = "维修工单") |
37 | 43 | private TkRepairOrderDTO tkRepairOrderDTO; |
38 | 44 | ... | ... |
... | ... | @@ -85,6 +85,10 @@ public class TkRepairRecordServiceImpl extends AbstractBaseService<TkRepairRecor |
85 | 85 | throw new TkDataValidationException("维修人不能为空!"); |
86 | 86 | } |
87 | 87 | |
88 | + if (StringUtils.isBlank(dto.getMalfunctionReasonId())) { | |
89 | + throw new TkDataValidationException("故障原因不能为空!"); | |
90 | + } | |
91 | + | |
88 | 92 | if (StringUtils.isBlank(dto.getTenantId())) { |
89 | 93 | dto.setTenantId(SpringBeanUtils.getTenantId().getId().toString()); |
90 | 94 | } | ... | ... |
... | ... | @@ -9,6 +9,8 @@ |
9 | 9 | <result property="orderId" column="order_id"/> |
10 | 10 | <result property="repairBy" column="repair_by"/> |
11 | 11 | <result property="description" column="description"/> |
12 | + <result property="malfunctionReasonId" column="malfunctionReasonId"/> | |
13 | + <result property="malfunctionReasonName" column="malfunctionReasonName"/> | |
12 | 14 | <result property="repairName" column="repairName"/> |
13 | 15 | <result property="deviceAccountName" column="deviceAccountName"/> |
14 | 16 | <association property="tkRepairOrderDTO" |
... | ... | @@ -29,16 +31,21 @@ |
29 | 31 | SELECT rr.id,rr.code,rr.order_id,rr.repair_date,rr.repair_by,rr.description,da.name as deviceAccountName, |
30 | 32 | ro.order_code,ro.device_id,ro.report_date,ro.report_by,ro.status as roStatus, |
31 | 33 | ro.emergency,ro.situation_img,ro.description as roDescription,su2.real_name as reportByName, |
34 | + mr.id as malfunctionReasonId, mr.reason as malfunctionReasonName, | |
32 | 35 | rr.tenant_id,rr.create_time,rr.updater,rr.update_time,rr.creator,su.real_name as repairName |
33 | 36 | from qg_repair_record rr |
34 | 37 | inner join qg_repair_order ro on ro.id=rr.order_id |
35 | 38 | inner join sys_user su on su.id=rr.repair_by |
36 | 39 | inner join sys_user su2 on su2.id=ro.report_by |
37 | 40 | inner join qg_device_account da on da.id=ro.device_id |
41 | + inner join qg_malfunction_reason mr on mr.id=rr.malfunction_reason_id | |
38 | 42 | <where> |
39 | 43 | <if test="queryMap.tenantId !=null and queryMap.tenantId !=''"> |
40 | 44 | AND rr.tenant_id = #{queryMap.tenantId} |
41 | 45 | </if> |
46 | + <if test="queryMap.orderId !=null and queryMap.orderId !=''"> | |
47 | + AND rr.order_id = #{queryMap.orderId} | |
48 | + </if> | |
42 | 49 | <if test="queryMap.repairBy !=null and queryMap.repairBy !=''"> |
43 | 50 | AND rr.repair_by = #{queryMap.repairBy} |
44 | 51 | </if> | ... | ... |