Przeglądaj źródła

报修进度接口

傅行帆 6 lat temu
rodzic
commit
c14b46cdf0

+ 10
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Wyświetl plik

16
 import org.springframework.web.bind.annotation.*;
16
 import org.springframework.web.bind.annotation.*;
17
 
17
 
18
 import javax.servlet.http.HttpSession;
18
 import javax.servlet.http.HttpSession;
19
+import java.util.List;
19
 
20
 
20
 @RestController
21
 @RestController
21
 @RefreshScope
22
 @RefreshScope
49
         return response;
50
         return response;
50
     }
51
     }
51
     
52
     
52
-    public ResponseBean getTicketSchedule(){
53
+    @ApiOperation(value = "获取报修详情数据",notes = "获取报修详情数据")
54
+    @ApiImplicitParams({
55
+            @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区编号"),
56
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "ticketId",value = "报修id")
57
+    })
58
+    @RequestMapping(value = "/ticket/schedule/{communityId}", method = RequestMethod.GET)
59
+    public ResponseBean getTicketSchedule(@PathVariable(value = "communityId") String communityId,@RequestParam Integer ticketId){
53
         ResponseBean responseBean = new ResponseBean();
60
         ResponseBean responseBean = new ResponseBean();
61
+        TpTicket ticket = iTicketService.getTicketSchedule(communityId,ticketId);
62
+        responseBean.addSuccess(ticket);
54
         return responseBean;
63
         return responseBean;
55
     }
64
     }
56
     
65
     

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketMapper.java Wyświetl plik

2
 
2
 
3
 import com.community.huiju.model.TpTicket;
3
 import com.community.huiju.model.TpTicket;
4
 import org.apache.ibatis.annotations.Mapper;
4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
5
 
6
 
6
 import java.util.List;
7
 import java.util.List;
7
 import java.util.Map;
8
 import java.util.Map;
26
      * @return
27
      * @return
27
      */
28
      */
28
     List<TpTicket> selectByCommuniytIdAndByTaUserIdAndByType(Map map);
29
     List<TpTicket> selectByCommuniytIdAndByTaUserIdAndByType(Map map);
30
+    
31
+    /**
32
+     * 获取报修进度
33
+     * @param communityId
34
+     * @param ticketId
35
+     * @return
36
+     */
37
+	TpTicket selectByTicketId(@Param("communityId") String communityId,@Param("ticketId") Integer ticketId);
29
 }
38
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordCommentMapper.java Wyświetl plik

1
 package com.community.huiju.dao;
1
 package com.community.huiju.dao;
2
 
2
 
3
+import com.community.huiju.model.TpTicketRecord;
3
 import com.community.huiju.model.TpTicketRecordComment;
4
 import com.community.huiju.model.TpTicketRecordComment;
4
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
5
 
6
 
30
      * @return
31
      * @return
31
      */
32
      */
32
     List<TpTicketRecordComment> selectByTicketId(Map map);
33
     List<TpTicketRecordComment> selectByTicketId(Map map);
34
+    
35
+    /**
36
+     * 查询出这个处理撞他下所有的回复数据
37
+     * @param tpTicketRecord
38
+     * @return
39
+     */
40
+	List<TpTicketRecordComment> selectByTicketRecordId(TpTicketRecord tpTicketRecord);
33
 }
41
 }

+ 5
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordMapper.java Wyświetl plik

2
 
2
 
3
 import com.community.huiju.model.TpTicketRecord;
3
 import com.community.huiju.model.TpTicketRecord;
4
 import org.apache.ibatis.annotations.Mapper;
4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
5
 
8
 
6
 @Mapper
9
 @Mapper
7
 public interface TpTicketRecordMapper {
10
 public interface TpTicketRecordMapper {
16
     int updateByPrimaryKeySelective(TpTicketRecord record);
19
     int updateByPrimaryKeySelective(TpTicketRecord record);
17
 
20
 
18
     int updateByPrimaryKey(TpTicketRecord record);
21
     int updateByPrimaryKey(TpTicketRecord record);
22
+	
23
+	List<TpTicketRecord> getTicketRecordByTicketId(@Param("communityId") String communityId,@Param("ticketId") Integer ticketId);
19
 }
24
 }

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicket.java Wyświetl plik

1
 package com.community.huiju.model;
1
 package com.community.huiju.model;
2
 
2
 
3
 import java.util.Date;
3
 import java.util.Date;
4
+import java.util.List;
4
 
5
 
5
 public class TpTicket {
6
 public class TpTicket {
6
     private Integer id;
7
     private Integer id;
18
     private String type;
19
     private String type;
19
 
20
 
20
     private String repairType;
21
     private String repairType;
22
+    
23
+    /**
24
+     * 报修类型的名字
25
+     */
26
+    private String repairName;
21
 
27
 
22
     private Integer tpUserId;
28
     private Integer tpUserId;
23
 
29
 
32
     private Integer updateUser;
38
     private Integer updateUser;
33
 
39
 
34
     private Date updateDate;
40
     private Date updateDate;
41
+    
42
+    private List<TpTicketRecord> ticketRecordList;
35
 
43
 
36
     public Integer getId() {
44
     public Integer getId() {
37
         return id;
45
         return id;
152
     public void setUpdateDate(Date updateDate) {
160
     public void setUpdateDate(Date updateDate) {
153
         this.updateDate = updateDate;
161
         this.updateDate = updateDate;
154
     }
162
     }
163
+    
164
+    public String getRepairName() {
165
+        return repairName;
166
+    }
167
+    
168
+    public void setRepairName(String repairName) {
169
+        this.repairName = repairName;
170
+    }
171
+    
172
+    public List<TpTicketRecord> getTicketRecordList() {
173
+        return ticketRecordList;
174
+    }
175
+    
176
+    public void setTicketRecordList(List<TpTicketRecord> ticketRecordList) {
177
+        this.ticketRecordList = ticketRecordList;
178
+    }
155
 }
179
 }

+ 21
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecord.java Wyświetl plik

1
 package com.community.huiju.model;
1
 package com.community.huiju.model;
2
 
2
 
3
 import java.util.Date;
3
 import java.util.Date;
4
+import java.util.List;
4
 
5
 
5
 public class TpTicketRecord {
6
 public class TpTicketRecord {
6
     private Integer id;
7
     private Integer id;
10
     private Integer ticketId;
11
     private Integer ticketId;
11
 
12
 
12
     private String status;
13
     private String status;
14
+    
15
+    private String ticketStatusName;
13
 
16
 
14
     private Integer createUser;
17
     private Integer createUser;
15
 
18
 
16
     private Date createDate;
19
     private Date createDate;
20
+    
21
+    private List<TpTicketRecordComment> ticketRecordCommentList;
17
 
22
 
18
     public Integer getId() {
23
     public Integer getId() {
19
         return id;
24
         return id;
62
     public void setCreateDate(Date createDate) {
67
     public void setCreateDate(Date createDate) {
63
         this.createDate = createDate;
68
         this.createDate = createDate;
64
     }
69
     }
70
+    
71
+    public String getTicketStatusName() {
72
+        return ticketStatusName;
73
+    }
74
+    
75
+    public void setTicketStatusName(String ticketStatusName) {
76
+        this.ticketStatusName = ticketStatusName;
77
+    }
78
+    
79
+    public List<TpTicketRecordComment> getTicketRecordCommentList() {
80
+        return ticketRecordCommentList;
81
+    }
82
+    
83
+    public void setTicketRecordCommentList(List<TpTicketRecordComment> ticketRecordCommentList) {
84
+        this.ticketRecordCommentList = ticketRecordCommentList;
85
+    }
65
 }
86
 }

+ 8
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecordComment.java Wyświetl plik

7
 
7
 
8
     private Integer communityId;
8
     private Integer communityId;
9
 
9
 
10
-    private Integer tickerId;
10
+    private Integer ticketId;
11
 
11
 
12
     private Integer ticketRecordId;
12
     private Integer ticketRecordId;
13
 
13
 
38
     public void setCommunityId(Integer communityId) {
38
     public void setCommunityId(Integer communityId) {
39
         this.communityId = communityId;
39
         this.communityId = communityId;
40
     }
40
     }
41
-
42
-    public Integer getTickerId() {
43
-        return tickerId;
41
+    
42
+    public Integer getTicketId() {
43
+        return ticketId;
44
     }
44
     }
45
-
46
-    public void setTickerId(Integer tickerId) {
47
-        this.tickerId = tickerId;
45
+    
46
+    public void setTicketId(Integer ticketId) {
47
+        this.ticketId = ticketId;
48
     }
48
     }
49
-
49
+    
50
     public Integer getTicketRecordId() {
50
     public Integer getTicketRecordId() {
51
         return ticketRecordId;
51
         return ticketRecordId;
52
     }
52
     }

+ 8
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java Wyświetl plik

29
      * @return 返回 维修/投诉/联系单 记录列表
29
      * @return 返回 维修/投诉/联系单 记录列表
30
      */
30
      */
31
     ResponseBean getByTypeList(TpTicket tpTicket,Integer pageNum, Integer pageSize);
31
     ResponseBean getByTypeList(TpTicket tpTicket,Integer pageNum, Integer pageSize);
32
-
33
-
32
+	
33
+	/**
34
+	 * 获取报修详情
35
+	 * @param communityId
36
+	 * @param ticketId
37
+	 * @return
38
+	 */
39
+	TpTicket getTicketSchedule(String communityId, Integer ticketId);
34
 }
40
 }

+ 26
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Wyświetl plik

3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
 import com.community.huiju.dao.TpTicketMapper;
4
 import com.community.huiju.dao.TpTicketMapper;
5
 import com.community.huiju.dao.TpTicketRecordCommentMapper;
5
 import com.community.huiju.dao.TpTicketRecordCommentMapper;
6
+import com.community.huiju.dao.TpTicketRecordMapper;
6
 import com.community.huiju.model.TpTicket;
7
 import com.community.huiju.model.TpTicket;
8
+import com.community.huiju.model.TpTicketRecord;
7
 import com.community.huiju.model.TpTicketRecordComment;
9
 import com.community.huiju.model.TpTicketRecordComment;
8
 import com.community.huiju.service.ITicketService;
10
 import com.community.huiju.service.ITicketService;
9
 import com.community.huiju.vo.TpTicketVO;
11
 import com.community.huiju.vo.TpTicketVO;
28
 
30
 
29
     @Autowired
31
     @Autowired
30
     private TpTicketMapper tpTicketMapper;
32
     private TpTicketMapper tpTicketMapper;
33
+    
34
+    @Autowired
35
+    private TpTicketRecordMapper tpTicketRecordMapper;
31
 
36
 
32
     @Autowired
37
     @Autowired
33
     private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
38
     private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
137
 
142
 
138
         return response;
143
         return response;
139
     }
144
     }
145
+    
146
+    /**
147
+     * 获取报修详情
148
+     * @param communityId
149
+     * @param ticketId
150
+     * @return
151
+     */
152
+    @Override
153
+    public TpTicket getTicketSchedule(String communityId, Integer ticketId) {
154
+        //查看工单详情
155
+        TpTicket ticket = tpTicketMapper.selectByTicketId(communityId,ticketId);
156
+        //工单进度
157
+        List<TpTicketRecord> ticketRecordList = tpTicketRecordMapper.getTicketRecordByTicketId(communityId,ticketId);
158
+        //工单回复
159
+        ticketRecordList.stream().forEach(TpTicketRecord -> {
160
+            List<TpTicketRecordComment> ticketRecordCommentList = tpTicketRecordCommentMapper.selectByTicketRecordId(TpTicketRecord);
161
+            TpTicketRecord.setTicketRecordCommentList(ticketRecordCommentList);
162
+         });
163
+        ticket.setTicketRecordList(ticketRecordList);
164
+        return ticket;
165
+    }
140
 }
166
 }

+ 23
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml Wyświetl plik

10
     <result column="status" property="status" jdbcType="CHAR" />
10
     <result column="status" property="status" jdbcType="CHAR" />
11
     <result column="type" property="type" jdbcType="CHAR" />
11
     <result column="type" property="type" jdbcType="CHAR" />
12
     <result column="repair_type" property="repairType" jdbcType="CHAR" />
12
     <result column="repair_type" property="repairType" jdbcType="CHAR" />
13
+    <result column="repair_name" property="repairName" jdbcType="VARCHAR" />
13
     <result column="tp_user_id" property="tpUserId" jdbcType="INTEGER" />
14
     <result column="tp_user_id" property="tpUserId" jdbcType="INTEGER" />
14
     <result column="score" property="score" jdbcType="VARCHAR" />
15
     <result column="score" property="score" jdbcType="VARCHAR" />
15
     <result column="comment" property="comment" jdbcType="VARCHAR" />
16
     <result column="comment" property="comment" jdbcType="VARCHAR" />
224
         </if>
225
         </if>
225
       </trim>
226
       </trim>
226
   </select>
227
   </select>
228
+
229
+  <select id="selectByTicketId" resultMap="BaseResultMap" >
230
+     SELECT
231
+        t.id,
232
+        t.community_id,
233
+        t.ticket_title,
234
+        t.ticket_content,
235
+        t.STATUS,
236
+        t.type,
237
+        t.repair_type,
238
+        d.name as repair_name,
239
+        t.score,
240
+        t.COMMENT,
241
+        t.create_date
242
+    FROM
243
+        tp_ticket t
244
+        LEFT JOIN sys_dictionary d ON t.repair_type = d.CODE
245
+        AND d.group_id = ( SELECT id FROM sys_dictionary WHERE CODE = "ticket_repair_type" )
246
+    WHERE
247
+        t.id = #{ticketId,jdbcType=INTEGER}
248
+        AND t.community_id = #{communityId,jdbcType=INTEGER}
249
+  </select>
227
 </mapper>
250
 </mapper>

+ 23
- 12
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordCommentMapper.xml Wyświetl plik

4
   <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTicketRecordComment" >
4
   <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTicketRecordComment" >
5
     <id column="id" property="id" jdbcType="INTEGER" />
5
     <id column="id" property="id" jdbcType="INTEGER" />
6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
-    <result column="ticker_id" property="tickerId" jdbcType="INTEGER" />
7
+    <result column="ticket_id" property="ticketId" jdbcType="INTEGER" />
8
     <result column="ticket_record_id" property="ticketRecordId" jdbcType="INTEGER" />
8
     <result column="ticket_record_id" property="ticketRecordId" jdbcType="INTEGER" />
9
     <result column="uuid" property="uuid" jdbcType="INTEGER" />
9
     <result column="uuid" property="uuid" jdbcType="INTEGER" />
10
     <result column="user_type" property="userType" jdbcType="CHAR" />
10
     <result column="user_type" property="userType" jdbcType="CHAR" />
14
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
14
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
15
   </resultMap>
15
   </resultMap>
16
   <sql id="Base_Column_List" >
16
   <sql id="Base_Column_List" >
17
-    id, community_id, ticker_id, ticket_record_id, uuid, user_type, content, parent_id, 
17
+    id, community_id, ticket_id, ticket_record_id, uuid, user_type, content, parent_id,
18
     user_name, create_date
18
     user_name, create_date
19
   </sql>
19
   </sql>
20
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
20
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
28
     where id = #{id,jdbcType=INTEGER}
28
     where id = #{id,jdbcType=INTEGER}
29
   </delete>
29
   </delete>
30
   <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecordComment" >
30
   <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecordComment" >
31
-    insert into tp_ticket_record_comment (id, community_id, ticker_id, 
31
+    insert into tp_ticket_record_comment (id, community_id, ticket_id,
32
       ticket_record_id, uuid, user_type, 
32
       ticket_record_id, uuid, user_type, 
33
       content, parent_id, user_name, 
33
       content, parent_id, user_name, 
34
       create_date)
34
       create_date)
35
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{tickerId,jdbcType=INTEGER}, 
35
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{ticketId,jdbcType=INTEGER},
36
       #{ticketRecordId,jdbcType=INTEGER}, #{uuid,jdbcType=INTEGER}, #{userType,jdbcType=CHAR}, 
36
       #{ticketRecordId,jdbcType=INTEGER}, #{uuid,jdbcType=INTEGER}, #{userType,jdbcType=CHAR}, 
37
       #{content,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, 
37
       #{content,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, 
38
       #{createDate,jdbcType=TIMESTAMP})
38
       #{createDate,jdbcType=TIMESTAMP})
46
       <if test="communityId != null" >
46
       <if test="communityId != null" >
47
         community_id,
47
         community_id,
48
       </if>
48
       </if>
49
-      <if test="tickerId != null" >
50
-        ticker_id,
49
+      <if test="ticketId != null" >
50
+        ticket_id,
51
       </if>
51
       </if>
52
       <if test="ticketRecordId != null" >
52
       <if test="ticketRecordId != null" >
53
         ticket_record_id,
53
         ticket_record_id,
78
       <if test="communityId != null" >
78
       <if test="communityId != null" >
79
         #{communityId,jdbcType=INTEGER},
79
         #{communityId,jdbcType=INTEGER},
80
       </if>
80
       </if>
81
-      <if test="tickerId != null" >
82
-        #{tickerId,jdbcType=INTEGER},
81
+      <if test="ticketId != null" >
82
+        #{ticketId,jdbcType=INTEGER},
83
       </if>
83
       </if>
84
       <if test="ticketRecordId != null" >
84
       <if test="ticketRecordId != null" >
85
         #{ticketRecordId,jdbcType=INTEGER},
85
         #{ticketRecordId,jdbcType=INTEGER},
110
       <if test="communityId != null" >
110
       <if test="communityId != null" >
111
         community_id = #{communityId,jdbcType=INTEGER},
111
         community_id = #{communityId,jdbcType=INTEGER},
112
       </if>
112
       </if>
113
-      <if test="tickerId != null" >
114
-        ticker_id = #{tickerId,jdbcType=INTEGER},
113
+      <if test="ticketId != null" >
114
+        ticket_id = #{ticketId,jdbcType=INTEGER},
115
       </if>
115
       </if>
116
       <if test="ticketRecordId != null" >
116
       <if test="ticketRecordId != null" >
117
         ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
117
         ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
140
   <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTicketRecordComment" >
140
   <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTicketRecordComment" >
141
     update tp_ticket_record_comment
141
     update tp_ticket_record_comment
142
     set community_id = #{communityId,jdbcType=INTEGER},
142
     set community_id = #{communityId,jdbcType=INTEGER},
143
-      ticker_id = #{tickerId,jdbcType=INTEGER},
143
+      ticket_id = #{ticketId,jdbcType=INTEGER},
144
       ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
144
       ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
145
       uuid = #{uuid,jdbcType=INTEGER},
145
       uuid = #{uuid,jdbcType=INTEGER},
146
       user_type = #{userType,jdbcType=CHAR},
146
       user_type = #{userType,jdbcType=CHAR},
155
     select ttrc.* from tp_ticket tp
155
     select ttrc.* from tp_ticket tp
156
                 inner join tp_ticket_record ttr on tp.id = ttr.ticket_id
156
                 inner join tp_ticket_record ttr on tp.id = ttr.ticket_id
157
                 inner join tp_ticket_record_comment ttrc on ttr.ticket_id = ttrc.ticket_record_id
157
                 inner join tp_ticket_record_comment ttrc on ttr.ticket_id = ttrc.ticket_record_id
158
-    where tp.id=#{tickerId,jdbcType=INTEGER} order by ttrc.create_date DESC LIMIT #{size,jdbcType=INTEGER}
158
+    where tp.id=#{ticketId,jdbcType=INTEGER} order by ttrc.create_date DESC LIMIT #{size,jdbcType=INTEGER}
159
+  </select>
160
+
161
+  <select id="selectByTicketRecordId" parameterType="com.community.huiju.model.TpTicketRecord" resultMap="BaseResultMap" >
162
+    SELECT
163
+    <include refid="Base_Column_List" />
164
+    FROM
165
+        tp_ticket_record_comment
166
+    WHERE
167
+        community_id = #{communityId,jdbcType=INTEGER}
168
+        AND ticket_id = #{ticketId,jdbcType=INTEGER}
169
+        AND ticket_record_id = #{id,jdbcType=INTEGER}
159
   </select>
170
   </select>
160
 </mapper>
171
 </mapper>

+ 15
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml Wyświetl plik

103
       create_date = #{createDate,jdbcType=TIMESTAMP}
103
       create_date = #{createDate,jdbcType=TIMESTAMP}
104
     where id = #{id,jdbcType=INTEGER}
104
     where id = #{id,jdbcType=INTEGER}
105
   </update>
105
   </update>
106
+
107
+  <select id="getTicketRecordByTicketId" resultType="com.community.huiju.model.TpTicketRecord">
108
+    SELECT
109
+        t.id,
110
+        t.ticket_id AS ticketId,
111
+        t.community_id AS communityId,
112
+        d.NAME AS ticketStatusName
113
+    FROM
114
+        tp_ticket_record t
115
+        LEFT JOIN sys_dictionary d ON t.STATUS = d.CODE
116
+        AND d.group_id = ( SELECT id FROM sys_dictionary WHERE CODE = "ticket_status" )
117
+    WHERE
118
+        community_id = #{communityId,jdbcType=INTEGER}
119
+        AND ticket_id = #{ticketId,jdbcType=INTEGER}
120
+  </select>
106
 </mapper>
121
 </mapper>