瀏覽代碼

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,6 +86,18 @@ public class SocialController {
86 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 102
     @ApiOperation(value = "按小区获取分页活动列表", notes = "按小区获取分页活动列表,公告标题模糊查询")
91 103
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
@@ -120,7 +132,7 @@ public class SocialController {
120 132
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
121 133
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id"),
122 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 136
     public ResponseBean findUsedDetails(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
125 137
         ResponseBean responseBean = new ResponseBean();
126 138
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
@@ -147,23 +159,23 @@ public class SocialController {
147 159
 
148 160
     @ApiOperation(value = "添加二手租赁帖子", notes = "添加二手租赁帖子")
149 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 164
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
154 165
     })
155 166
     @RequestMapping(value = "/addTransaction", method = RequestMethod.POST)
156 167
     @ResponseBody
157
-    public ResponseBean addTransaction(TpTransaction tpTransaction, HttpSession session) {
168
+    public ResponseBean addTransaction(@RequestBody String paramets, HttpSession session) {
158 169
         ResponseBean responseBean = new ResponseBean();
159 170
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
160 171
         Integer userId = userElement.getId();
161
-        ResponseBean response = socialServiceI.addAllTransaction(userId, tpTransaction);
172
+        ResponseBean response = socialServiceI.addAllTransaction(userId, paramets);
162 173
         return response;
163 174
     }
164 175
 
165 176
     @ApiOperation(value = "获取我发布所有二手租赁帖子", notes = "获取我发布所有二手租赁帖子")
166 177
     @ApiImplicitParams({
178
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),
167 179
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
168 180
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度"),
169 181
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
@@ -181,20 +193,16 @@ public class SocialController {
181 193
 
182 194
     @ApiOperation(value = "修改二手租赁帖子", notes = "修改二手租赁帖子")
183 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 198
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
188 199
     })
189 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 202
         ResponseBean responseBean = new ResponseBean();
195 203
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
196 204
         Integer userId = userElement.getId();
197
-        ResponseBean response = socialServiceI.updateTransaction(Id, transactionTitle, transactionContent, userId, Type);
205
+        ResponseBean response = socialServiceI.updateTransaction(paramets, userId);
198 206
         return response;
199 207
     }
200 208
 

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

@@ -61,8 +61,8 @@ public class UserController {
61 61
     }
62 62
     @ApiOperation(value = "修改手机号", notes = "修改手机号")
63 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 66
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
67 67
     })
68 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,4 +23,12 @@ public interface TpActivityMapper {
23 23
     int updateByPrimaryKey(TpActivity record);
24 24
     
25 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,7 +17,7 @@ public interface TpCarouselSettingMapper {
17 17
 
18 18
     int updateByPrimaryKey(TpCarouselSetting record);
19 19
 
20
-     int getcarouselNum(String lease);
20
+     Integer getcarouselNum(String lease);
21 21
 
22 22
     Integer selectCarouselNum(String carouselType);
23 23
 

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

@@ -24,5 +24,7 @@ public interface TpTransactionMapper {
24 24
 
25 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,7 +69,7 @@ public interface SocialServiceI {
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,7 +81,7 @@ public interface SocialServiceI {
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,4 +90,11 @@ public interface SocialServiceI {
90 90
 	 * @param ticketId
91 91
 	 */
92 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,11 +216,23 @@ public class SocialServiceImpl implements SocialServiceI {
216 216
         return tpTransactionMapper.findAllTransaction(communityId, type);
217 217
     }
218 218
 
219
+
219 220
     @Transactional
220 221
     @Override
221
-    public ResponseBean addAllTransaction(Integer userId, TpTransaction tpTransaction) {
222
+    public ResponseBean addAllTransaction(Integer userId, String paramets) {
223
+
222 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 231
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
232
+        TpTransaction tpTransaction=new TpTransaction();
233
+        tpTransaction.setTransactionTitle(transactionTitle);
234
+        tpTransaction.setTransactionContent(transactionContent);
235
+        tpTransaction.setType(type);
224 236
         tpTransaction.setCommunityId(user.getCommunityId());
225 237
         tpTransaction.setTaUserId(userId);
226 238
         tpTransaction.setCreateUser(userId);
@@ -228,26 +240,59 @@ public class SocialServiceImpl implements SocialServiceI {
228 240
         tpTransaction.setCreateDate(new Date());
229 241
         tpTransaction.setUpdateUser(userId);
230 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 271
         return response;
272
+
234 273
     }
235 274
 
236 275
     @Override
237 276
     public ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer paeSize) {
238
-        PageHelper.startPage(pageNum, paeSize);
239 277
         ResponseBean responseBean = new ResponseBean();
240 278
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
241 279
          Integer communityId=user.getCommunityId();
280
+
281
+        PageHelper.startPage(pageNum, paeSize);
242 282
         List<TpTransaction> tpTransactions=tpTransactionMapper.selectTransaction(userId,communityId);
283
+
243 284
         responseBean.addSuccess(tpTransactions);
244 285
         return responseBean;
245 286
     }
246 287
 
247 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 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 296
         response.addSuccess("修改成功");
252 297
         return response;
253 298
     }
@@ -270,6 +315,13 @@ public class SocialServiceImpl implements SocialServiceI {
270 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 325
     public ResponseBean insertActivitySignUp(TpActivity tpActivity, Integer communityId, Integer userId){
274 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,6 +205,7 @@ public class TicketServiceImpl implements ITicketService {
205 205
         tpTicketRecord.setStatus(tpTicketReco.getStatus());
206 206
         tpTicketRecord.setCreateUser(userId);
207 207
         tpTicketRecord.setCreateDate(new Date());
208
+
208 209
         tpTicketRecordMapper.insertSelective(tpTicketRecord);
209 210
         response.addSuccess("新增成功");
210 211
         return response;

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

@@ -271,4 +271,11 @@
271 271
       a.activity_end_time DESC,
272 272
 	  a.create_date DESC
273 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 281
 </mapper>

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

@@ -41,7 +41,7 @@
41 41
       #{type,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
42 42
       #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
43 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 45
     insert into tp_transaction
46 46
     <trim prefix="(" suffix=")" suffixOverrides="," >
47 47
       <if test="id != null" >
@@ -200,4 +200,11 @@
200 200
     update_date = now()
201 201
     where id = #{id,jdbcType=INTEGER}
202 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 210
 </mapper>

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