dingxin vor 6 Jahren
Ursprung
Commit
e051c20f73

+ 3
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Datei anzeigen

@@ -91,7 +91,7 @@ public class TicketController extends BaseController {
91 91
             @ApiImplicitParam(paramType = "path",dataType = "Integer",name = "communityId", value = "小区编号"),
92 92
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNum", value = "第几页"),
93 93
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize", value = "一页多少数据"),
94
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "type", value = "工单类型 (0报修/1投诉/2联系单)"),
94
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "type", value = "工单类型 (1:投诉   2:报修 3:联系物业)"),
95 95
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
96 96
 
97 97
     })
@@ -148,7 +148,7 @@ public class TicketController extends BaseController {
148 148
     @ApiOperation(value = "添加 报修/投诉/联系单", notes = "添加 报修/投诉/联系单")
149 149
     @ApiImplicitParams({
150 150
             @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
151
-                    "ticketTitle:工单标题,ticketContent:工单内容,type: 0 代表 报修  1 代表 投诉  2代表 联系单 , repairType:0:公共区域  1: 房屋质量  2:户内设施, imageUrl:图片地址 "),
151
+                    "ticketTitle:工单标题,ticketContent:工单内容,type: 1:投诉   2:报修 3:联系物业 , repairType:0:公共区域  1: 房屋质量  2:户内设施, imageUrl:图片地址 "),
152 152
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
153 153
     })
154 154
     @RequestMapping(value = "/addtpTicket", method = RequestMethod.POST)
@@ -171,17 +171,15 @@ public class TicketController extends BaseController {
171 171
     @ApiOperation(value = "修改 报修/投诉/联系单", notes = "修改 报修/投诉/联系单")
172 172
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "ticketId", value = "工单Id"),
173 173
             @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType = "TpTicket"),
174
-            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "type", value = "工单类型  0 代表 报修  1 代表 投诉  2代表 联系单"),
175 174
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
176 175
     })
177 176
     @RequestMapping(value = "/updateTicket/{ticketId}", method = RequestMethod.POST)
178 177
     public ResponseBean updateTicketContent(@PathVariable("ticketId") Integer ticketId,
179 178
                                             @RequestBody TpTicket tpTicket,
180
-                                            @RequestParam("type") String type,
181 179
                                             HttpSession session) {
182 180
         ResponseBean responseBean = new ResponseBean();
183 181
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
184
-        iTicketService.updateTicketContent(ticketId, tpTicket, type,userElement.getId());
182
+        responseBean = iTicketService.updateTicketContent(ticketId, tpTicket,userElement.getId());
185 183
         return responseBean;
186 184
     }
187 185
 

+ 1
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java Datei anzeigen

@@ -60,10 +60,9 @@ public interface ITicketService {
60 60
 	 * 修改 维修/投诉/联系单 内容
61 61
 	 * @param ticketId
62 62
 	 * @param tpTicket
63
-	 * @param type
64 63
 	 * @param userId
65 64
 	 */
66
-	void updateTicketContent(Integer ticketId, TpTicket tpTicket, String type,Integer userId);
65
+	ResponseBean updateTicketContent(Integer ticketId, TpTicket tpTicket,Integer userId);
67 66
 
68 67
 	/**
69 68
 	 * 终止 维修/投诉/联系单

+ 12
- 9
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Datei anzeigen

@@ -326,20 +326,23 @@ public class SocialServiceImpl implements SocialServiceI {
326 326
     /**
327 327
      * 图片入库
328 328
      * @param tpTransaction
329
-     * @param imageUrl
329
+     * @param imageUrl 多个图片都好分割
330 330
      * @param userId
331 331
      * @param type 服务:service, 公告:announcement , 活动:activity  租赁 : transaction
332 332
      * @throws IOException
333 333
      */
334 334
     private void insertTdImage(TpTransaction tpTransaction, String imageUrl, Integer userId,String type) throws IOException {
335
-        TdImages tdImages = new TdImages();
336
-        Integer uuId = tpTransaction.getId();
337
-        tdImages.setImageUrl(imageUrl);
338
-        tdImages.setType(type);
339
-        tdImages.setUuid(uuId);
340
-        tdImages.setCreateUser(userId);
341
-        tdImages.setCreateTime(new Date());
342
-        tdImagesMapper.insertSelective(tdImages);
335
+        String [] imgArr = imageUrl.split(",");
336
+        for (String url  : imgArr) {
337
+            TdImages tdImages = new TdImages();
338
+            Integer uuId = tpTransaction.getId();
339
+            tdImages.setImageUrl(url);
340
+            tdImages.setType(type);
341
+            tdImages.setUuid(uuId);
342
+            tdImages.setCreateUser(userId);
343
+            tdImages.setCreateTime(new Date());
344
+            tdImagesMapper.insertSelective(tdImages);
345
+        }
343 346
     }
344 347
     @Override
345 348
     public ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer paeSize,Integer type) {

+ 24
- 17
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Datei anzeigen

@@ -58,8 +58,8 @@ public class TicketServiceImpl implements ITicketService {
58 58
         parameter.put("communityId", tpTicket.getCommunityId());
59 59
         parameter.put("taUserId", tpTicket.getTaUserId());
60 60
 
61
-        //  0 代表 报修  1 代表 投诉  2代表 联系单
62
-        parameter.put("type", 0);
61
+        //  1:投诉   2:报修 3:联系物业
62
+        parameter.put("type", 2);
63 63
         // 报修
64 64
         Page<TpTicket> pageRepairs = PageHelper.startPage(pageNum, pageSize);
65 65
         List<TpTicket> tpTicketRepairsList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
@@ -67,7 +67,7 @@ public class TicketServiceImpl implements ITicketService {
67 67
         tpTicketVOConvert(tpTicketRepairsList, repairsList);
68 68
 
69 69
         // 投诉
70
-        //  0 代表 报修  1 代表 投诉  2代表 联系单
70
+        //  1:投诉   2:报修 3:联系物业
71 71
         parameter.put("type", 1);
72 72
         Page<TpTicket> pageComplaint = PageHelper.startPage(pageNum, pageSize);
73 73
         List<TpTicket> tpTicketComplaintList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
@@ -75,8 +75,8 @@ public class TicketServiceImpl implements ITicketService {
75 75
         tpTicketVOConvert(tpTicketComplaintList, complaintList);
76 76
 
77 77
         // 联系工单
78
-        //  0 代表 报修  1 代表 投诉  2代表 联系单
79
-        parameter.put("type", 2);
78
+        //  1:投诉   2:报修 3:联系物业
79
+        parameter.put("type", 3);
80 80
         Page<TpTicket> pageLiaison = PageHelper.startPage(pageNum, pageSize);
81 81
         List<TpTicket> tpTicketLiaisonList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
82 82
         List<TpTicketVO> liaisonList = Lists.newArrayList();
@@ -154,7 +154,7 @@ public class TicketServiceImpl implements ITicketService {
154 154
         parameter.put("communityId", tpTicket.getCommunityId());
155 155
         parameter.put("taUserId", tpTicket.getTaUserId());
156 156
 
157
-        //  0 代表 报修  1 代表 投诉  2代表 联系单
157
+        //  1:投诉   2:报修 3:联系物业
158 158
         parameter.put("type", tpTicket.getType());
159 159
 
160 160
        Page<TpTicket> pagelist=PageHelper.startPage(pageNum, pageSize);
@@ -238,8 +238,8 @@ public class TicketServiceImpl implements ITicketService {
238 238
         TpTicket tpTicketReco = tpTicketMapper.selectByPrimaryKey(id);
239 239
         tpTicketRecord.setCommunityId(user.getCommunityId());
240 240
         tpTicketRecord.setTicketId(tpTicketReco.getId());
241
-        // 0 代表 报修  1 代表 投诉  2代表 联系单
242
-        String typeName = "0".equals(tpTicket.getType())?"报修":"1".equals(tpTicket.getType())?"投诉":"2".equals(tpTicket.getType())?"联系工单":"";
241
+        // 1:投诉   2:报修 3:联系物业
242
+        String typeName = "2".equals(tpTicket.getType())?"报修":"1".equals(tpTicket.getType())?"投诉":"3".equals(tpTicket.getType())?"联系工单":"未知类型";
243 243
         tpTicketRecord.setContent("您的"+ typeName +"正在分配物业处理人员, 若长时间无人处理, 请联系物业!");
244 244
         tpTicketRecord.setStatus(tpTicketReco.getStatus());
245 245
         tpTicketRecord.setCreateUser(userId);
@@ -295,10 +295,8 @@ public class TicketServiceImpl implements ITicketService {
295 295
 
296 296
     @Override
297 297
     @Transactional(rollbackFor = Exception.class)
298
-    public void updateTicketContent(Integer ticketId, TpTicket tpTicket, String type,Integer userId) {
299
-        // 获取图片
300
-        List<TdImages> tdImagesList = tpTicket.getTdImagesList();
301
-        tdImagesList.stream().forEach(e->e.setCreateUser(userId));
298
+    public ResponseBean updateTicketContent(Integer ticketId, TpTicket tpTicket,Integer userId) {
299
+        ResponseBean responseBean = new ResponseBean();
302 300
 
303 301
         // 删除旧图片链接
304 302
         Map<String,Object> map = Maps.newHashMap();
@@ -306,12 +304,21 @@ public class TicketServiceImpl implements ITicketService {
306 304
         map.put("type","service");
307 305
         tdImagesMapper.deleteByUuidAndType(map);
308 306
 
309
-        // 插入图片链接
310
-        tdImagesMapper.insertBatch(tdImagesList);
307
+        // 获取图片
308
+        List<TdImages> tdImagesList = tpTicket.getTdImagesList();
309
+        if (null != tdImagesList && tdImagesList.size() > 0) {
310
+            tdImagesList.stream().forEach(e->e.setCreateUser(userId));
311
+            // 插入图片链接
312
+            tdImagesMapper.insertBatch(tdImagesList);
313
+        }
311 314
 
312
-        tpTicket.setId(ticketId);
313
-        tpTicket.setType(type);
314
-        tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
315
+        TpTicket ticket = tpTicketMapper.selectByPrimaryKey(ticketId);
316
+        ticket.setTicketTitle(tpTicket.getTicketTitle());
317
+        ticket.setTicketContent(tpTicket.getTicketContent());
318
+
319
+        tpTicketMapper.updateByPrimaryKeySelective(ticket);
320
+        responseBean.addSuccess("操作成功!");
321
+        return responseBean;
315 322
     }
316 323
 
317 324
     @Transactional

+ 2
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml Datei anzeigen

@@ -204,6 +204,7 @@ LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
204 204
     <if test="transactionTitle != null and transactionTitle !=''">
205 205
       and transaction_title LIKE concat('%',#{transactionTitle,jdbcType=VARCHAR},'%')
206 206
     </if>
207
+    order by create_date DESC
207 208
   </select>
208 209
 
209 210
   <select id="selectTransaction" resultMap="BaseResultMap">
@@ -215,7 +216,7 @@ LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
215 216
     <if test="type != null and type != ''">
216 217
       and type = #{type,jdbcType=INTEGER}
217 218
     </if>
218
-
219
+    order by create_date DESC
219 220
   </select>
220 221
 
221 222
   <update id="updateTransaction" parameterType="com.community.huiju.model.TpTransaction" >

+ 5
- 5
文档/MYSQL/smartCommunity.pdb Datei anzeigen

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1542770145" Name="smartCommunity" Objects="655" Symbols="78" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
2
+<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1542791427" Name="smartCommunity" Objects="656" Symbols="78" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
3 3
 <!-- do not edit this file -->
4 4
 
5 5
 <Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@@ -5945,9 +5945,9 @@ LABL 0 新宋体,8,N</a:FontList>
5945 5945
 </o:TableSymbol>
5946 5946
 <o:TableSymbol Id="o159">
5947 5947
 <a:CreationDate>1542706044</a:CreationDate>
5948
-<a:ModificationDate>1542706044</a:ModificationDate>
5948
+<a:ModificationDate>1542791427</a:ModificationDate>
5949 5949
 <a:IconMode>-1</a:IconMode>
5950
-<a:Rect>((-21601,-60687), (-4813,-54689))</a:Rect>
5950
+<a:Rect>((-22201,-62967), (-5413,-56969))</a:Rect>
5951 5951
 <a:LineColor>12615680</a:LineColor>
5952 5952
 <a:FillColor>16570034</a:FillColor>
5953 5953
 <a:ShadowColor>12632256</a:ShadowColor>
@@ -9335,9 +9335,9 @@ LABL 0 新宋体,8,N</a:FontList>
9335 9335
 <a:Code>type</a:Code>
9336 9336
 <a:CreationDate>1539162638</a:CreationDate>
9337 9337
 <a:Creator>szc</a:Creator>
9338
-<a:ModificationDate>1539591244</a:ModificationDate>
9338
+<a:ModificationDate>1542791171</a:ModificationDate>
9339 9339
 <a:Modifier>szc</a:Modifier>
9340
-<a:Comment>类型    0 代表 报修  1 代表 投诉  2代表 联系单   字典</a:Comment>
9340
+<a:Comment>类型    2 代表 报修  1 代表 投诉  3代表 联系单   字典</a:Comment>
9341 9341
 <a:DataType>char(1)</a:DataType>
9342 9342
 <a:Length>1</a:Length>
9343 9343
 </o:Column>

+ 5
- 5
文档/MYSQL/smartCommunity.pdm Datei anzeigen

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1542770145" Name="smartCommunity" Objects="655" Symbols="78" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
2
+<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1542791427" Name="smartCommunity" Objects="656" Symbols="78" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
3 3
 <!-- do not edit this file -->
4 4
 
5 5
 <Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@@ -5945,9 +5945,9 @@ LABL 0 新宋体,8,N</a:FontList>
5945 5945
 </o:TableSymbol>
5946 5946
 <o:TableSymbol Id="o159">
5947 5947
 <a:CreationDate>1542706044</a:CreationDate>
5948
-<a:ModificationDate>1542706044</a:ModificationDate>
5948
+<a:ModificationDate>1542791427</a:ModificationDate>
5949 5949
 <a:IconMode>-1</a:IconMode>
5950
-<a:Rect>((-21601,-60687), (-4813,-54689))</a:Rect>
5950
+<a:Rect>((-22201,-62967), (-5413,-56969))</a:Rect>
5951 5951
 <a:LineColor>12615680</a:LineColor>
5952 5952
 <a:FillColor>16570034</a:FillColor>
5953 5953
 <a:ShadowColor>12632256</a:ShadowColor>
@@ -9335,9 +9335,9 @@ LABL 0 新宋体,8,N</a:FontList>
9335 9335
 <a:Code>type</a:Code>
9336 9336
 <a:CreationDate>1539162638</a:CreationDate>
9337 9337
 <a:Creator>szc</a:Creator>
9338
-<a:ModificationDate>1539591244</a:ModificationDate>
9338
+<a:ModificationDate>1542791171</a:ModificationDate>
9339 9339
 <a:Modifier>szc</a:Modifier>
9340
-<a:Comment>类型    0 代表 报修  1 代表 投诉  2代表 联系单   字典</a:Comment>
9340
+<a:Comment>类型    2 代表 报修  1 代表 投诉  3代表 联系单   字典</a:Comment>
9341 9341
 <a:DataType>char(1)</a:DataType>
9342 9342
 <a:Length>1</a:Length>
9343 9343
 </o:Column>