Parcourir la source

修改 工单部分逻辑

weiximei il y a 6 ans
Parent
révision
f1a65d279e

+ 13
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecord.java Voir le fichier

@@ -10,6 +10,11 @@ public class TpTicketRecord {
10 10
 
11 11
     private Integer ticketId;
12 12
 
13
+    /**
14
+     * 自动生成的回复
15
+     */
16
+    private String content;
17
+
13 18
     private String status;
14 19
     
15 20
     private String ticketStatusName;
@@ -44,6 +49,14 @@ public class TpTicketRecord {
44 49
         this.ticketId = ticketId;
45 50
     }
46 51
 
52
+    public String getContent() {
53
+        return content;
54
+    }
55
+
56
+    public void setContent(String content) {
57
+        this.content = content;
58
+    }
59
+
47 60
     public String getStatus() {
48 61
         return status;
49 62
     }

+ 15
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Voir le fichier

@@ -212,16 +212,23 @@ public class TicketServiceImpl implements ITicketService {
212 212
 
213 213
         TpTicket tpTicket = JSONObject.parseObject(parameter,TpTicket.class);
214 214
 
215
+        /**
216
+         * 工单表 -> 工单处理表 -> 消息表
217
+         * 依次插入相关数据, 该工单默认的第一条数据(待分配), 是工单标题,
218
+          */
219
+
220
+
215 221
         TaUser user = taUserMapper.selectByPrimaryKey(userId);
216 222
 
217 223
         tpTicket.setCommunityId(user.getCommunityId());
218 224
         tpTicket.setTaUserId(userId);
219
-        tpTicket.setStatus("2");
225
+        // 默认待分配
226
+        tpTicket.setStatus("0");
220 227
         tpTicket.setCreateUser(userId);
221 228
         tpTicket.setCreateDate(new Date());
222 229
         tpTicket.setUpdateUser(userId);
223 230
         tpTicket.setUpdateDate(new Date());
224
-
231
+        // 插入工单
225 232
         tpTicketMapper.insertSelective(tpTicket);
226 233
         insertTdImage(tpTicket, imageUrl, userId);
227 234
 
@@ -231,12 +238,17 @@ public class TicketServiceImpl implements ITicketService {
231 238
         TpTicket tpTicketReco = tpTicketMapper.selectByPrimaryKey(id);
232 239
         tpTicketRecord.setCommunityId(user.getCommunityId());
233 240
         tpTicketRecord.setTicketId(tpTicketReco.getId());
241
+        // 0 代表 报修  1 代表 投诉  2代表 联系单
242
+        String typeName = "0".equals(tpTicket.getType())?"报修":"1".equals(tpTicket.getType())?"投诉":"2".equals(tpTicket.getType())?"联系工单":"";
243
+        tpTicketRecord.setContent("您的"+ typeName +"正在分配物业处理人员, 若长时间无人处理, 请联系物业!");
234 244
         tpTicketRecord.setStatus(tpTicketReco.getStatus());
235 245
         tpTicketRecord.setCreateUser(userId);
236 246
         tpTicketRecord.setCreateDate(new Date());
237
-
247
+        // 插入工单处理表
238 248
         tpTicketRecordMapper.insertSelective(tpTicketRecord);
239 249
 
250
+
251
+
240 252
         // 把工单信息添加到消息表
241 253
         insertTicketMessage(tpTicket,userId);
242 254
 

+ 14
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml Voir le fichier

@@ -5,12 +5,13 @@
5 5
     <id column="id" property="id" jdbcType="INTEGER" />
6 6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7 7
     <result column="ticket_id" property="ticketId" jdbcType="INTEGER" />
8
+    <result column="content" property="content" jdbcType="VARCHAR" />
8 9
     <result column="status" property="status" jdbcType="CHAR" />
9 10
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
10 11
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11 12
   </resultMap>
12 13
   <sql id="Base_Column_List" >
13
-    id, community_id, ticket_id, status, create_user, create_date
14
+    id, community_id, ticket_id, content, status, create_user, create_date
14 15
   </sql>
15 16
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
16 17
     select 
@@ -23,11 +24,11 @@
23 24
     where id = #{id,jdbcType=INTEGER}
24 25
   </delete>
25 26
   <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecord" >
26
-    insert into tp_ticket_record (id, community_id, ticket_id, 
27
+    insert into tp_ticket_record (id, community_id, ticket_id, content,
27 28
       status, create_user, create_date
28 29
       )
29 30
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{ticketId,jdbcType=INTEGER}, 
30
-      #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}
31
+      #{content,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}
31 32
       )
32 33
   </insert>
33 34
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpTicketRecord" >
@@ -42,6 +43,9 @@
42 43
       <if test="ticketId != null" >
43 44
         ticket_id,
44 45
       </if>
46
+      <if test="content != null">
47
+        content,
48
+      </if>
45 49
       <if test="status != null" >
46 50
         status,
47 51
       </if>
@@ -62,6 +66,9 @@
62 66
       <if test="ticketId != null" >
63 67
         #{ticketId,jdbcType=INTEGER},
64 68
       </if>
69
+      <if test="content != null">
70
+        #{content,jdbcType=VARCHAR},
71
+      </if>
65 72
       <if test="status != null" >
66 73
         #{status,jdbcType=CHAR},
67 74
       </if>
@@ -82,6 +89,9 @@
82 89
       <if test="ticketId != null" >
83 90
         ticket_id = #{ticketId,jdbcType=INTEGER},
84 91
       </if>
92
+      <if test="content != null">
93
+        content = #{content,jdbcType=VARCHAR},
94
+      </if>
85 95
       <if test="status != null" >
86 96
         status = #{status,jdbcType=CHAR},
87 97
       </if>
@@ -98,6 +108,7 @@
98 108
     update tp_ticket_record
99 109
     set community_id = #{communityId,jdbcType=INTEGER},
100 110
       ticket_id = #{ticketId,jdbcType=INTEGER},
111
+      content = #{content,jdbcType=VARCHAR},
101 112
       status = #{status,jdbcType=CHAR},
102 113
       create_user = #{createUser,jdbcType=INTEGER},
103 114
       create_date = #{createDate,jdbcType=TIMESTAMP}