dingxin il y a 6 ans
Parent
révision
65d28d92c7

+ 15
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Voir le fichier

@@ -146,12 +146,13 @@ public class SocialController {
146 146
     }
147 147
 
148 148
     @ApiOperation(value = "修改报修内容", notes = "修改报修内容")
149
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "ticketId", value = "小区Id"),
150
-                         @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType ="TpTicket")})
149
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "ticketId", value = "工单Id"),
150
+                         @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType ="TpTicket"),
151
+                         @ApiImplicitParam(paramType = "query", dataType = "integer", name = "type", value = "工单类型")})
151 152
     @RequestMapping(value = "/updateTicket/{ticketId}", method = RequestMethod.POST)
152
-    public ResponseBean updateTicketContent(@PathVariable("ticketId")Integer ticketId, @RequestBody TpTicket tpTicket){
153
+    public ResponseBean updateTicketContent(@PathVariable("ticketId")Integer ticketId, @RequestBody TpTicket tpTicket, @RequestParam("type")String type){
153 154
         ResponseBean responseBean = new ResponseBean();
154
-        socialServiceI.updateTicketContent(ticketId, tpTicket);
155
+        socialServiceI.updateTicketContent(ticketId, tpTicket, type);
155 156
         return responseBean;
156 157
     }
157 158
 
@@ -197,5 +198,15 @@ public class SocialController {
197 198
         Integer userId=userElement.getId();
198 199
         ResponseBean response=socialServiceI.ubdateTransaction(tpTransaction,userId);
199 200
         return response;
201
+
202
+    @ApiOperation(value = "评价工单内容以及评分", notes = "评价工单内容以及评分")
203
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
204
+            @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType ="TpTicket"),
205
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "工单Id")})
206
+    @RequestMapping(value = "/accessTicket/{communityId}", method = RequestMethod.POST)
207
+    public ResponseBean accessTicket(@PathVariable("communityId")Integer communityId, @RequestBody TpTicket tpTicket, @RequestParam("ticketId")String ticketId){
208
+        ResponseBean responseBean = new ResponseBean();
209
+        socialServiceI.accessTicket(communityId, tpTicket, ticketId);
210
+        return responseBean;
200 211
     }
201 212
 }

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Voir le fichier

@@ -6,6 +6,7 @@ import com.community.commom.mode.ResponseBean;
6 6
 import com.community.huiju.common.code.cache.AppkeyCache;
7 7
 import com.community.huiju.config.entity.UserElement;
8 8
 import com.community.huiju.model.TaUser;
9
+import com.community.huiju.model.TpTicket;
9 10
 import com.community.huiju.service.ITaUserService;
10 11
 import com.community.huiju.vo.TaUserVO;
11 12
 import io.swagger.annotations.Api;
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
21 22
 
22 23
 import javax.servlet.http.HttpSession;
23 24
 import javax.xml.crypto.dsig.keyinfo.PGPData;
25
+import java.util.List;
24 26
 
25 27
 /**
26 28
  * 用户控制器
@@ -72,6 +74,15 @@ public class UserController {
72 74
         return response;
73 75
     }
74 76
 
77
+    @ApiOperation(value = "查看房屋成员列表", notes = "查看房屋成员列表")
78
+    @RequestMapping(value = "/roomUserList", method = RequestMethod.GET)
79
+    public ResponseBean accessTicket(){
80
+        ResponseBean responseBean = new ResponseBean();
81
+        //todo
82
+        List<TaUser> taUserList = iTaUserService.getAllRoomUserList(1);
83
+        responseBean.addSuccess(taUserList);
84
+        return responseBean;
85
+    }
75 86
     @ApiOperation(value = "修改用户名和性别", notes = "修改用户名和性别")
76 87
     @ApiImplicitParams({
77 88
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "userName",value = "用户民"),

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserMapper.java Voir le fichier

@@ -3,6 +3,7 @@ package com.community.huiju.dao;
3 3
 import com.community.huiju.model.TaUser;
4 4
 import org.apache.ibatis.annotations.Mapper;
5 5
 
6
+import java.util.List;
6 7
 import java.util.Map;
7 8
 
8 9
 @Mapper
@@ -39,4 +40,11 @@ public interface TaUserMapper {
39 40
      * @return
40 41
      */
41 42
     TaUser ubdateLongName(TaUser record);
43
+
44
+    /**
45
+     * 查询房屋成员列表
46
+     * @param parentId
47
+     * @return
48
+     */
49
+    List<TaUser> selectUserListByParentId(Integer parentId);
42 50
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivitySignupMapper.java Voir le fichier

@@ -20,4 +20,6 @@ public interface TpActivitySignupMapper {
20 20
     int updateByPrimaryKey(TpActivitySignup record);
21 21
 
22 22
     Integer sumActivitySignUpNum(@Param("id")Integer id, @Param("communityId")Integer communityId);
23
+
24
+    Integer findTpActivetitySignByUserId(@Param("activityId") Integer activityId, @Param("communityId")Integer communityId, @Param("userId")Integer userId);
23 25
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Voir le fichier

@@ -3,6 +3,8 @@ package com.community.huiju.service;
3 3
 import com.community.commom.mode.ResponseBean;
4 4
 import com.community.huiju.model.TaUser;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * 用户业务 接口
8 10
  * @author weiximei
@@ -39,6 +41,12 @@ public interface ITaUserService {
39 41
      */
40 42
     ResponseBean udDateloginName(Integer id, String paramets);
41 43
 
44
+    /**
45
+     * 获取房屋成员列表
46
+     * @param parentId
47
+     * @return
48
+     */
49
+    List<TaUser> getAllRoomUserList(Integer parentId);
42 50
 
43 51
     /**
44 52
      * 修改用户

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Voir le fichier

@@ -100,4 +100,13 @@ public interface SocialServiceI {
100 100
 	 * @return
101 101
 	 */
102 102
 	ResponseBean ubdateTransaction(TpTransaction tpTransaction,Integer userId);
103
+	void updateTicketContent(Integer ticketId, TpTicket tpTicket, String type);
104
+
105
+	/**
106
+	 * 评价工单以及评分
107
+	 * @param communityId
108
+	 * @param tpTicket
109
+	 * @param ticketId
110
+	 */
111
+	void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId);
103 112
 }

+ 27
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Voir le fichier

@@ -7,6 +7,7 @@ import com.community.huiju.dao.*;
7 7
 import com.community.huiju.model.*;
8 8
 import com.community.huiju.service.SocialServiceI;
9 9
 import com.github.pagehelper.PageHelper;
10
+import com.netflix.discovery.converters.Auto;
10 11
 import org.springframework.beans.factory.annotation.Autowired;
11 12
 import org.springframework.stereotype.Service;
12 13
 import org.springframework.transaction.annotation.Transactional;
@@ -41,6 +42,7 @@ public class SocialServiceImpl implements SocialServiceI {
41 42
     @Autowired
42 43
     private TpTransactionMapper tpTransactionMapper;
43 44
 
45
+    @Autowired
44 46
     private TaSysRoleMapper taSysRoleMapper;
45 47
 
46 48
     @Autowired
@@ -245,8 +247,9 @@ public class SocialServiceImpl implements SocialServiceI {
245 247
     }
246 248
 
247 249
     @Override
248
-    public void updateTicketContent(Integer ticketId, TpTicket tpTicket) {
250
+    public void updateTicketContent(Integer ticketId, TpTicket tpTicket, String type) {
249 251
         tpTicket.setId(ticketId);
252
+        tpTicket.setType(type);
250 253
         tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
251 254
     }
252 255
 
@@ -290,10 +293,33 @@ public class SocialServiceImpl implements SocialServiceI {
290 293
         tpTransactionMapper.updateByPrimaryKey(tpTransaction);
291 294
         response.addSuccess("修改成功");
292 295
         return response;
296
+    public void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId) {
297
+        //修改工单内容和评分
298
+        tpTicket.setId(Integer.valueOf(ticketId));
299
+        tpTicket.setStatus("5");
300
+        tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
301
+
302
+        //工单处理表新增评分记录
303
+        TpTicketRecord record = new TpTicketRecord();
304
+        record.setCommunityId(communityId);
305
+        record.setTicketId(Integer.valueOf(ticketId));
306
+        record.setStatus("5");
307
+        //todo
308
+        record.setCreateUser(1);
309
+        record.setCreateDate(new Date());
310
+        tpTicketRecordMapper.insertSelective(record);
293 311
     }
294 312
 
295 313
     public ResponseBean insertActivitySignUp(TpActivity tpActivity, Integer communityId){
296 314
         ResponseBean responseBean = new ResponseBean();
315
+        //判断是否已经报名
316
+        //todo
317
+        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, 1);
318
+        if (signNum != 0){
319
+            responseBean.addError("9996", "您已报名,请勿重复报名");
320
+            return responseBean;
321
+        }
322
+
297 323
         TpActivitySignup tpActivitySignup = new TpActivitySignup();
298 324
         tpActivitySignup.setActivityId(tpActivity.getId());
299 325
         tpActivitySignup.setCommunityId(communityId);

+ 6
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Voir le fichier

@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
24 24
 import org.springframework.transaction.annotation.Transactional;
25 25
 
26 26
 import java.util.Date;
27
+import java.util.List;
27 28
 import java.util.Map;
28 29
 
29 30
 /**
@@ -184,6 +185,11 @@ public class TaUserServiceImpl implements ITaUserService {
184 185
 
185 186
     }
186 187
 
188
+    @Override
189
+    public List<TaUser> getAllRoomUserList(Integer parentId) {
190
+        return taUserMapper.selectUserListByParentId(parentId);
191
+    }
192
+
187 193
     @Transactional
188 194
     @Override
189 195
     public ResponseBean modifyUser(TaUser user) {

+ 6
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml Voir le fichier

@@ -267,4 +267,10 @@
267 267
     where id = #{id,jdbcType=INTEGER}
268 268
   </select>
269 269
 
270
+  <select id="selectUserListByParentId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
271
+    select
272
+    <include refid="Base_Column_List" />
273
+    from ta_user
274
+    where parent_id = #{parentId}
275
+  </select>
270 276
 </mapper>

+ 2
- 1
CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml Voir le fichier

@@ -32,7 +32,8 @@
32 32
 
33 33
   <select id="selectAllByNum" resultMap="BaseResultMap">
34 34
     select
35
-    <include refid="Base_Column_List"></include>
35
+    id, community_id, banner_description, sort, banner_cover, banner_position, eff_time,
36
+    exp_time, banner_type, external_link, banner_title, create_user, create_date
36 37
     from to_banner t where t.eff_time &lt; #{nowTime}
37 38
     and t.exp_time &gt; #{nowTime}
38 39
     order by t.sort, t.eff_time

+ 6
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpActivitySignupMapper.xml Voir le fichier

@@ -111,4 +111,10 @@
111 111
     where activity_id = #{id,jdbcType=INTEGER} and community_id = #{communityId}
112 112
   </select>
113 113
 
114
+  <select id="findTpActivetitySignByUserId" resultType="java.lang.Integer">
115
+    select
116
+    count(*)
117
+    from tp_activity_sign_up
118
+    where activity_id = #{activityId} and community_id = #{communityId} and ta_user_id = #{userId}
119
+  </select>
114 120
 </mapper>