瀏覽代碼

Merge branch 'develop' of http://git.ycjcjy.com/fuxingfan/smartCommunity into develop

# Conflicts:
#	CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class
傅行帆 6 年之前
父節點
當前提交
7543656267

+ 22
- 14
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 查看文件

86
         return responseBean;
86
         return responseBean;
87
     }
87
     }
88
 
88
 
89
+    @ApiOperation(value = "获取活动轮播图", notes = "获取活动轮播图")
90
+    @ApiImplicitParams({
91
+            @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区id")
92
+    })
93
+    @RequestMapping(value = "/activity/Img/{communityId}", method = RequestMethod.GET)
94
+    public ResponseBean getActivity(@PathVariable(value = "communityId") Integer communityId) {
95
+        ResponseBean responseBean = new ResponseBean();
96
+        List<TpActivity> agreement = socialServiceI.getActivity(communityId);
97
+        responseBean.addSuccess(agreement);
98
+        return responseBean;
99
+    }
100
+
89
 
101
 
90
     @ApiOperation(value = "按小区获取分页活动列表", notes = "按小区获取分页活动列表,公告标题模糊查询")
102
     @ApiOperation(value = "按小区获取分页活动列表", notes = "按小区获取分页活动列表,公告标题模糊查询")
91
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
103
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
120
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
132
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
121
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id"),
133
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id"),
122
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")})
134
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")})
123
-    @RequestMapping(value = "/secondHand/{communityId}", method = RequestMethod.GET)
135
+    @RequestMapping(value = "/getTransaction/{communityId}", method = RequestMethod.GET)
124
     public ResponseBean findUsedDetails(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
136
     public ResponseBean findUsedDetails(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
125
         ResponseBean responseBean = new ResponseBean();
137
         ResponseBean responseBean = new ResponseBean();
126
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
138
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
147
 
159
 
148
     @ApiOperation(value = "添加二手租赁帖子", notes = "添加二手租赁帖子")
160
     @ApiOperation(value = "添加二手租赁帖子", notes = "添加二手租赁帖子")
149
     @ApiImplicitParams({
161
     @ApiImplicitParams({
150
-            @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "交易标题"),
151
-            @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionContent", value = "交易内容"),
152
-            @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "0:二手 1:求购  2:租赁"),
162
+            @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
163
+                    "title:小区标题,content:小区类容, type"),
153
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
164
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
154
     })
165
     })
155
     @RequestMapping(value = "/addTransaction", method = RequestMethod.POST)
166
     @RequestMapping(value = "/addTransaction", method = RequestMethod.POST)
156
     @ResponseBody
167
     @ResponseBody
157
-    public ResponseBean addTransaction(TpTransaction tpTransaction, HttpSession session) {
168
+    public ResponseBean addTransaction(@RequestBody String paramets, HttpSession session) {
158
         ResponseBean responseBean = new ResponseBean();
169
         ResponseBean responseBean = new ResponseBean();
159
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
170
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
160
         Integer userId = userElement.getId();
171
         Integer userId = userElement.getId();
161
-        ResponseBean response = socialServiceI.addAllTransaction(userId, tpTransaction);
172
+        ResponseBean response = socialServiceI.addAllTransaction(userId, paramets);
162
         return response;
173
         return response;
163
     }
174
     }
164
 
175
 
165
     @ApiOperation(value = "获取我发布所有二手租赁帖子", notes = "获取我发布所有二手租赁帖子")
176
     @ApiOperation(value = "获取我发布所有二手租赁帖子", notes = "获取我发布所有二手租赁帖子")
166
     @ApiImplicitParams({
177
     @ApiImplicitParams({
178
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),
167
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
179
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
168
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度"),
180
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度"),
169
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
181
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
181
 
193
 
182
     @ApiOperation(value = "修改二手租赁帖子", notes = "修改二手租赁帖子")
194
     @ApiOperation(value = "修改二手租赁帖子", notes = "修改二手租赁帖子")
183
     @ApiImplicitParams({
195
     @ApiImplicitParams({
184
-            @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "小区标题"),
185
-            @ApiImplicitParam(paramType = "body", dataType = "String", name = "transactionContent", value = "交易内容"),
186
-            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "Type", value = "0 代表,1求购,2租赁"),
196
+            @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
197
+                    "id:小区id,title:小区标题,content:小区类容"),
187
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
198
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
188
     })
199
     })
189
     @RequestMapping(value = "/updateTransaction/{Id}", method = RequestMethod.PUT)
200
     @RequestMapping(value = "/updateTransaction/{Id}", method = RequestMethod.PUT)
190
-    public ResponseBean ubdateTransaction(HttpSession session, @PathVariable(value = "Id") Integer Id,
191
-                                          @RequestParam(value = "transactionTitle") String transactionTitle,
192
-                                          @RequestParam(value = "transactionContent") String transactionContent,
193
-                                          @RequestParam(value = "Type") Integer Type) {
201
+    public ResponseBean ubdateTransaction(HttpSession session, @RequestBody String paramets) {
194
         ResponseBean responseBean = new ResponseBean();
202
         ResponseBean responseBean = new ResponseBean();
195
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
203
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
196
         Integer userId = userElement.getId();
204
         Integer userId = userElement.getId();
197
-        ResponseBean response = socialServiceI.updateTransaction(Id, transactionTitle, transactionContent, userId, Type);
205
+        ResponseBean response = socialServiceI.updateTransaction(paramets, userId);
198
         return response;
206
         return response;
199
     }
207
     }
200
 
208
 

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java 查看文件

61
     }
61
     }
62
     @ApiOperation(value = "修改手机号", notes = "修改手机号")
62
     @ApiOperation(value = "修改手机号", notes = "修改手机号")
63
     @ApiImplicitParams({
63
     @ApiImplicitParams({
64
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "登陆(手机号)"),
65
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码"),
64
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "phone",value = "phone:登陆(手机号),code:(手机验证码)"),
65
+
66
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
66
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
67
     })
67
     })
68
             @RequestMapping(value = "/user/phone",method = RequestMethod.PUT)
68
             @RequestMapping(value = "/user/phone",method = RequestMethod.PUT)

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java 查看文件

23
     int updateByPrimaryKey(TpActivity record);
23
     int updateByPrimaryKey(TpActivity record);
24
     
24
     
25
     List<TpActivity> getActivitys(@Param("communityId")Integer communityId,@Param("title") String title);
25
     List<TpActivity> getActivitys(@Param("communityId")Integer communityId,@Param("title") String title);
26
+
27
+    /**
28
+     * 获取活动轮播图
29
+     * @param communityId
30
+     * @param num
31
+     * @return
32
+     */
33
+    List<TpActivity> getActivity(@Param("communityId")Integer communityId, @Param("num")Integer num);
26
 }
34
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java 查看文件

17
 
17
 
18
     int updateByPrimaryKey(TpCarouselSetting record);
18
     int updateByPrimaryKey(TpCarouselSetting record);
19
 
19
 
20
-     int getcarouselNum(String lease);
20
+     Integer getcarouselNum(String lease);
21
 
21
 
22
     Integer selectCarouselNum(String carouselType);
22
     Integer selectCarouselNum(String carouselType);
23
 
23
 

+ 3
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java 查看文件

24
 
24
 
25
     List<TpTransaction> selectTransaction(@Param("userId")Integer userId, @Param("communityId")Integer communityId);
25
     List<TpTransaction> selectTransaction(@Param("userId")Integer userId, @Param("communityId")Integer communityId);
26
 
26
 
27
-    void updateTransaction(@Param("id")Integer id, @Param("transactionTitle")String transactionTitle, @Param("transactionContent")String transactionContent, @Param("userId")Integer userId,@Param("Type")Integer Type);
27
+    void updateTransaction(@Param("id")Integer id, @Param("transactionTitle")String transactionTitle, @Param("transactionContent")String transactionContent, @Param("userId")Integer userId);
28
+
29
+    TpTransaction getById(@Param("id")Integer id);
28
 }
30
 }

+ 9
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java 查看文件

69
 	/**
69
 	/**
70
 	 * 添加二手租赁帖子
70
 	 * 添加二手租赁帖子
71
 	 */
71
 	 */
72
-    ResponseBean addAllTransaction(Integer userId,  TpTransaction Transaction);
72
+    ResponseBean addAllTransaction(Integer userId, String paramets);
73
 
73
 
74
 	/**
74
 	/**
75
 	 * 获取当前用户所有的帖子
75
 	 * 获取当前用户所有的帖子
81
 	/**
81
 	/**
82
 	 * 修改当前帖子
82
 	 * 修改当前帖子
83
 	 */
83
 	 */
84
-	ResponseBean updateTransaction(Integer Id,String transactionTitle,String transactionContent,Integer userId,Integer Type);
84
+	ResponseBean updateTransaction(String paramets,Integer userId);
85
 
85
 
86
 	/**
86
 	/**
87
 	 * 评价工单以及评分
87
 	 * 评价工单以及评分
90
 	 * @param ticketId
90
 	 * @param ticketId
91
 	 */
91
 	 */
92
 	void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId, Integer userId);
92
 	void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId, Integer userId);
93
+
94
+	/**
95
+	 * 获取活动轮播图
96
+	 * @param communityId
97
+	 * @return
98
+	 */
99
+	List<TpActivity> getActivity(Integer communityId);
93
 }
100
 }

+ 58
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

216
         return tpTransactionMapper.findAllTransaction(communityId, type);
216
         return tpTransactionMapper.findAllTransaction(communityId, type);
217
     }
217
     }
218
 
218
 
219
+
219
     @Transactional
220
     @Transactional
220
     @Override
221
     @Override
221
-    public ResponseBean addAllTransaction(Integer userId, TpTransaction tpTransaction) {
222
+    public ResponseBean addAllTransaction(Integer userId, String paramets) {
223
+
222
         ResponseBean response = new ResponseBean();
224
         ResponseBean response = new ResponseBean();
225
+
226
+        JSONObject jsonObject = JSONObject.parseObject(paramets);
227
+        String transactionTitle = (String) jsonObject.get("title");
228
+        String transactionContent = (String) jsonObject.get("content");
229
+        String  type= (String) jsonObject.get("type");
230
+
223
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
231
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
232
+        TpTransaction tpTransaction=new TpTransaction();
233
+        tpTransaction.setTransactionTitle(transactionTitle);
234
+        tpTransaction.setTransactionContent(transactionContent);
235
+        tpTransaction.setType(type);
224
         tpTransaction.setCommunityId(user.getCommunityId());
236
         tpTransaction.setCommunityId(user.getCommunityId());
225
         tpTransaction.setTaUserId(userId);
237
         tpTransaction.setTaUserId(userId);
226
         tpTransaction.setCreateUser(userId);
238
         tpTransaction.setCreateUser(userId);
228
         tpTransaction.setCreateDate(new Date());
240
         tpTransaction.setCreateDate(new Date());
229
         tpTransaction.setUpdateUser(userId);
241
         tpTransaction.setUpdateUser(userId);
230
         tpTransaction.setUpdateDate(new Date());
242
         tpTransaction.setUpdateDate(new Date());
231
-        tpTransactionMapper.insertSelective(tpTransaction);
232
-        response.addSuccess("发布成功");
243
+
244
+        //判断身份是否为业主且状态为已停用
245
+        TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
246
+        TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
247
+        if (Constant.INVALID.equals(taUser.getStatus())
248
+                && Constant.OWNER.equals(sysRole.getRoleName())){
249
+
250
+            response.addError("9996", "您的身份已停用,请联系物业");
251
+            return response;
252
+        }
253
+
254
+        //身份为家属租客,状态为已停用
255
+        if (Constant.INVALID.equals(taUser.getStatus())
256
+                && (Constant.RELATION.equals(sysRole.getRoleName())) || Constant.TENANT.equals(sysRole.getRoleName())){
257
+
258
+            response.addError("9996", "您的身份已停用,请联系物业");
259
+            return response;
260
+        }
261
+
262
+        if (Constant.EFFECTIVE.equals(taUser.getStatus())
263
+                && (Constant.RELATION.equals(sysRole.getRoleName()))
264
+                || Constant.TENANT.equals(sysRole.getRoleName())
265
+                || Constant.OWNER.equals(sysRole.getRoleName())){
266
+            tpTransactionMapper.insertSelective(tpTransaction);
267
+            TpTransaction tpTransaction1=tpTransactionMapper.getById(tpTransaction.getId());
268
+            response.addSuccess(tpTransaction1);
269
+        }
270
+        response.addError("9995", "无法确认您的身份,请联系物业");
233
         return response;
271
         return response;
272
+
234
     }
273
     }
235
 
274
 
236
     @Override
275
     @Override
237
     public ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer paeSize) {
276
     public ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer paeSize) {
238
-        PageHelper.startPage(pageNum, paeSize);
239
         ResponseBean responseBean = new ResponseBean();
277
         ResponseBean responseBean = new ResponseBean();
240
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
278
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
241
          Integer communityId=user.getCommunityId();
279
          Integer communityId=user.getCommunityId();
280
+
281
+        PageHelper.startPage(pageNum, paeSize);
242
         List<TpTransaction> tpTransactions=tpTransactionMapper.selectTransaction(userId,communityId);
282
         List<TpTransaction> tpTransactions=tpTransactionMapper.selectTransaction(userId,communityId);
283
+
243
         responseBean.addSuccess(tpTransactions);
284
         responseBean.addSuccess(tpTransactions);
244
         return responseBean;
285
         return responseBean;
245
     }
286
     }
246
 
287
 
247
     @Override
288
     @Override
248
-    public ResponseBean updateTransaction(Integer Id,String transactionTitle,String transactionContent,Integer userId,Integer Type) {
289
+    public ResponseBean updateTransaction(String paramets,Integer userId) {
249
         ResponseBean response = new ResponseBean();
290
         ResponseBean response = new ResponseBean();
250
-        tpTransactionMapper.updateTransaction(Id,transactionTitle,transactionContent,userId,Type);
291
+        JSONObject jsonObject = JSONObject.parseObject(paramets);
292
+        String id = (String) jsonObject.get("id");
293
+        String transactionTitle = (String) jsonObject.get("title");
294
+        String transactionContent = (String) jsonObject.get("content");
295
+        tpTransactionMapper.updateTransaction(Integer.valueOf(id),transactionTitle,transactionContent,userId);
251
         response.addSuccess("修改成功");
296
         response.addSuccess("修改成功");
252
         return response;
297
         return response;
253
     }
298
     }
270
         tpTicketRecordMapper.insertSelective(record);
315
         tpTicketRecordMapper.insertSelective(record);
271
     }
316
     }
272
 
317
 
318
+    @Override
319
+    public List<TpActivity> getActivity(Integer communityId) {
320
+        Integer Num=tpCarouselSettingMapper.getcarouselNum(Constant.ACTIVITY);
321
+        List<TpActivity> listActivity=tpActivityMapper.getActivity(communityId,Num);
322
+        return listActivity;
323
+    }
324
+
273
     public ResponseBean insertActivitySignUp(TpActivity tpActivity, Integer communityId, Integer userId){
325
     public ResponseBean insertActivitySignUp(TpActivity tpActivity, Integer communityId, Integer userId){
274
         ResponseBean responseBean = new ResponseBean();
326
         ResponseBean responseBean = new ResponseBean();
275
         //判断是否已经报名
327
         //判断是否已经报名

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java 查看文件

205
         tpTicketRecord.setStatus(tpTicketReco.getStatus());
205
         tpTicketRecord.setStatus(tpTicketReco.getStatus());
206
         tpTicketRecord.setCreateUser(userId);
206
         tpTicketRecord.setCreateUser(userId);
207
         tpTicketRecord.setCreateDate(new Date());
207
         tpTicketRecord.setCreateDate(new Date());
208
+
208
         tpTicketRecordMapper.insertSelective(tpTicketRecord);
209
         tpTicketRecordMapper.insertSelective(tpTicketRecord);
209
         response.addSuccess("新增成功");
210
         response.addSuccess("新增成功");
210
         return response;
211
         return response;

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml 查看文件

271
       a.activity_end_time DESC,
271
       a.activity_end_time DESC,
272
 	  a.create_date DESC
272
 	  a.create_date DESC
273
   </select>
273
   </select>
274
+
275
+  <select id="getActivity" resultMap="BaseResultMap">
276
+    select
277
+    <include refid="Base_Column_List" />
278
+    from tp_activity
279
+    where community_id = #{communityId,jdbcType=INTEGER}  and status=1 limit  #{num,jdbcType=INTEGER}
280
+  </select>
274
 </mapper>
281
 </mapper>

+ 8
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml 查看文件

41
       #{type,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
41
       #{type,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
42
       #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
42
       #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
43
   </insert>
43
   </insert>
44
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTransaction" >
44
+  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"  parameterType="com.community.huiju.model.TpTransaction" >
45
     insert into tp_transaction
45
     insert into tp_transaction
46
     <trim prefix="(" suffix=")" suffixOverrides="," >
46
     <trim prefix="(" suffix=")" suffixOverrides="," >
47
       <if test="id != null" >
47
       <if test="id != null" >
200
     update_date = now()
200
     update_date = now()
201
     where id = #{id,jdbcType=INTEGER}
201
     where id = #{id,jdbcType=INTEGER}
202
   </update>
202
   </update>
203
+
204
+  <select id="getById" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpTransaction">
205
+    select
206
+    <include refid="Base_Column_List" />
207
+    from tp_transaction
208
+    where id = #{id,jdbcType=INTEGER}
209
+  </select>
203
 </mapper>
210
 </mapper>

二進制
CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class 查看文件