Przeglądaj źródła

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

魏超 6 lat temu
rodzic
commit
31e1f33cb9
20 zmienionych plików z 54 dodań i 214 usunięć
  1. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AgreementController.java
  2. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java
  3. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CodeController.java
  4. 1
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CommunityController.java
  5. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java
  6. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  7. 0
    74
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TestController.java
  8. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java
  9. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  10. 0
    11
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ScUserMapper.java
  11. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java
  12. 0
    14
      CODE/smart-community/app-api/src/main/java/com/community/huiju/microController/MicroTestController.java
  13. 0
    39
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/ScUser.java
  14. 0
    9
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ScUserServiceI.java
  15. 0
    25
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/ScUserServiceImpl.java
  16. 41
    12
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  17. 0
    16
      CODE/smart-community/app-api/src/main/resources/mapper/ScUserMapper.xml
  18. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml
  19. 3
    3
      CODE/smart-community/app-api/src/main/resources/mapper/TpSocialViewMapper.xml
  20. BIN
      文档/需求/app接口需求-第二版.xlsx

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AgreementController.java Wyświetl plik

@@ -27,7 +27,7 @@ import java.util.List;
27 27
 @RestController
28 28
 @RefreshScope
29 29
 @RequestMapping("/")
30
-@Api("app端协议相关的API")
30
+@Api(value = "协议相关的API", description = "协议相关的API")
31 31
 public class AgreementController {
32 32
 
33 33
     @Autowired

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java Wyświetl plik

@@ -26,7 +26,7 @@ import java.util.List;
26 26
 @RestController
27 27
 @RefreshScope
28 28
 @RequestMapping("/")
29
-@Api("首页运营banner接口类")
29
+@Api(value = "首页运营banner的API", description = "首页运营banner的API")
30 30
 public class BannerController {
31 31
 
32 32
     @Autowired

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CodeController.java Wyświetl plik

@@ -26,7 +26,7 @@ import javax.servlet.http.HttpSession;
26 26
 @RestController
27 27
 @RequestMapping("/")
28 28
 @RefreshScope
29
-@Api("获取验证码的API")
29
+@Api(value = "获取验证码的API", description = "获取验证码的API")
30 30
 @Slf4j
31 31
 public class CodeController {
32 32
 

+ 1
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CommunityController.java Wyświetl plik

@@ -1,7 +1,6 @@
1 1
 package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
-import com.community.huiju.model.ScUser;
5 4
 import com.community.huiju.model.ToCommunities;
6 5
 import com.community.huiju.service.CommunityServiceI;
7 6
 import io.swagger.annotations.Api;
@@ -24,7 +23,7 @@ import java.util.List;
24 23
 @RestController
25 24
 @RefreshScope
26 25
 @RequestMapping("/")
27
-@Api("app端小区相关的API")
26
+@Api(value = "小区相关的API",description = "小区相关的API")
28 27
 public class CommunityController {
29 28
 	
30 29
 	@Autowired

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java Wyświetl plik

@@ -27,7 +27,7 @@ import java.util.Map;
27 27
 @RestController
28 28
 @RefreshScope
29 29
 @RequestMapping("/")
30
-@Api("app端消息相关的API")
30
+@Api(value = "消息相关的API",description = "消息相关的API")
31 31
 public class MessageController {
32 32
 	
33 33
 	@Autowired

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Wyświetl plik

@@ -24,7 +24,7 @@ import java.util.List;
24 24
 @RestController
25 25
 @RefreshScope
26 26
 @RequestMapping("/")
27
-@Api("app端论坛相关的API")
27
+@Api(value = "app端论坛相关的API", description = "app端论坛相关的API")
28 28
 public class SocialController {
29 29
 
30 30
     @Autowired

+ 0
- 74
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TestController.java Wyświetl plik

@@ -1,74 +0,0 @@
1
-package com.community.huiju.controller;
2
-
3
-import com.community.huiju.config.entity.UserElement;
4
-import com.community.huiju.model.ScUser;
5
-import com.community.huiju.service.ScUserServiceI;
6
-import com.community.huiju.microController.MicroTestController;
7
-import io.swagger.annotations.Api;
8
-import io.swagger.annotations.ApiOperation;
9
-import lombok.extern.slf4j.Slf4j;
10
-import org.springframework.beans.factory.annotation.Autowired;
11
-import org.springframework.beans.factory.annotation.Value;
12
-import org.springframework.cloud.context.config.annotation.RefreshScope;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RequestMethod;
15
-import org.springframework.web.bind.annotation.ResponseBody;
16
-import org.springframework.web.bind.annotation.RestController;
17
-
18
-import javax.servlet.http.HttpServletRequest;
19
-import javax.servlet.http.HttpSession;
20
-import java.util.Arrays;
21
-import java.util.List;
22
-
23
-/**
24
- * @author FXF
25
- * @date 2018-09-11
26
- */
27
-@RestController
28
-@RefreshScope
29
-@RequestMapping("/client2")
30
-@Api("eureka-client2的测试controller的API")
31
-@Slf4j
32
-public class TestController {
33
-    
34
-    @Autowired
35
-    private ScUserServiceI scUserService;
36
-    
37
-    @Autowired
38
-    private MicroTestController microTestController;
39
-    
40
-    /**
41
-     * 获取所有的用户信息
42
-     * @return
43
-     */
44
-    @ApiOperation(value = "测试restful接口", notes = "测试接口2")
45
-    @RequestMapping(value = "/user",method = RequestMethod.GET)
46
-    @ResponseBody
47
-    public List<ScUser> getUser(){
48
-        return scUserService.getUser();
49
-    }
50
-    
51
-    @RequestMapping(value = "/feignUser",method = RequestMethod.GET)
52
-    @ResponseBody
53
-    public List<ScUser> getMicroUser(){
54
-        return microTestController.getUser();
55
-    }
56
-
57
-    /**
58
-     * 测试session
59
-     * @param request
60
-     * @param session
61
-     * @return
62
-     */
63
-    @RequestMapping(value = "/getUserElement",method = RequestMethod.GET)
64
-    public UserElement getUserElement(HttpServletRequest request, HttpSession session){
65
-        log.info("sessionId: {}", session.getId());
66
-        UserElement userElement = new UserElement();
67
-        userElement.setId(1);
68
-        userElement.setEmail("907147608@qq.com");
69
-        userElement.setUserName("weiximei");
70
-        userElement.setLoginName("weiximei");
71
-        userElement.setStatus("1");
72
-        return userElement;
73
-    }
74
-}

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Wyświetl plik

@@ -19,7 +19,7 @@ import javax.servlet.http.HttpSession;
19 19
 @RestController
20 20
 @RefreshScope
21 21
 @RequestMapping("/")
22
-@Api("工单API")
22
+@Api(value = "工单相关的API",description = "工单相关的API")
23 23
 public class TicketController {
24 24
 
25 25
     @Autowired

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Wyświetl plik

@@ -26,7 +26,7 @@ import javax.xml.crypto.dsig.keyinfo.PGPData;
26 26
 @RestController
27 27
 @RefreshScope
28 28
 @RequestMapping("/")
29
-@Api("用户相关操作")
29
+@Api(value = "用户相关操作的API",description = "用户相关操作的API")
30 30
 public class UserController {
31 31
 
32 32
     @Autowired

+ 0
- 11
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ScUserMapper.java Wyświetl plik

@@ -1,11 +0,0 @@
1
-package com.community.huiju.dao;
2
-
3
-import com.community.huiju.model.ScUser;
4
-import org.apache.ibatis.annotations.Mapper;
5
-
6
-import java.util.List;
7
-
8
-@Mapper
9
-public interface ScUserMapper {
10
-	List<ScUser> find();
11
-}

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java Wyświetl plik

@@ -15,7 +15,7 @@ public interface TpActivityMapper {
15 15
 
16 16
     int insertSelective(TpActivity record);
17 17
 
18
-    TpActivity selectByPrimaryKey(Integer id);
18
+    TpActivity selectByPrimaryKey(@Param("id") Integer id,@Param("communityId") Integer communityId);
19 19
 
20 20
     int updateByPrimaryKeySelective(TpActivity record);
21 21
 

+ 0
- 14
CODE/smart-community/app-api/src/main/java/com/community/huiju/microController/MicroTestController.java Wyświetl plik

@@ -1,14 +0,0 @@
1
-package com.community.huiju.microController;
2
-
3
-import com.community.huiju.model.ScUser;
4
-import org.springframework.cloud.openfeign.FeignClient;
5
-import org.springframework.web.bind.annotation.RequestMapping;
6
-
7
-import java.util.List;
8
-
9
-@FeignClient("eureka-client1")
10
-public interface MicroTestController {
11
-	
12
-	@RequestMapping("/user")
13
-	List<ScUser> getUser();
14
-}

+ 0
- 39
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/ScUser.java Wyświetl plik

@@ -1,39 +0,0 @@
1
-package com.community.huiju.model;
2
-
3
-import java.io.Serializable;
4
-
5
-/**
6
- * @author FXF
7
- * @date 2018-09-19
8
- */
9
-public class ScUser implements Serializable {
10
-	private Integer id;
11
-	
12
-	private String userName;
13
-	
14
-	private String userPassword;
15
-	
16
-	public Integer getId() {
17
-		return id;
18
-	}
19
-	
20
-	public void setId(Integer id) {
21
-		this.id = id;
22
-	}
23
-	
24
-	public String getUserName() {
25
-		return userName;
26
-	}
27
-	
28
-	public void setUserName(String userName) {
29
-		this.userName = userName;
30
-	}
31
-	
32
-	public String getUserPassword() {
33
-		return userPassword;
34
-	}
35
-	
36
-	public void setUserPassword(String userPassword) {
37
-		this.userPassword = userPassword;
38
-	}
39
-}

+ 0
- 9
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ScUserServiceI.java Wyświetl plik

@@ -1,9 +0,0 @@
1
-package com.community.huiju.service;
2
-
3
-import com.community.huiju.model.ScUser;
4
-
5
-import java.util.List;
6
-
7
-public interface ScUserServiceI {
8
-	List<ScUser> getUser();
9
-}

+ 0
- 25
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/ScUserServiceImpl.java Wyświetl plik

@@ -1,25 +0,0 @@
1
-package com.community.huiju.service.impl;
2
-
3
-import com.community.huiju.dao.ScUserMapper;
4
-import com.community.huiju.model.ScUser;
5
-import com.community.huiju.service.ScUserServiceI;
6
-import org.springframework.beans.factory.annotation.Autowired;
7
-import org.springframework.stereotype.Service;
8
-
9
-import java.util.List;
10
-
11
-/**
12
- * @author FXF
13
- * @date 2018-09-19
14
- */
15
-@Service("scUserService")
16
-public class ScUserServiceImpl implements ScUserServiceI {
17
-	
18
-	@Autowired
19
-	private ScUserMapper scUserMapper;
20
-	
21
-	@Override
22
-	public List<ScUser> getUser() {
23
-		return scUserMapper.find();
24
-	}
25
-}

+ 41
- 12
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Wyświetl plik

@@ -43,19 +43,11 @@ public class SocialServiceImpl implements SocialServiceI {
43 43
     @Override
44 44
     @Transactional
45 45
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
46
-        TpSocialView tpSocialView = new TpSocialView();
47 46
         //TODO
48
-        tpSocialView.setTaUserId(1);
49
-        tpSocialView.setSocialType(Constant.ANNOUNCEMENT);
50
-        tpSocialView.setCommunityId(communityId);
51
-        tpSocialView.setUuid(id);
52
-        Integer viewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
53
-
54
-        if (viewNum == 0){
55
-            tpSocialView.setCreateDate(new Date());
56
-            tpSocialViewMapper.insertSelective(tpSocialView);
57
-            tpSocialView.setTaUserId(null);
58
-            Integer allViewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
47
+        Integer userId = 1;
48
+        //更新此用户的查看次数操作
49
+        Integer allViewNum = updateSocialView(userId,Constant.ANNOUNCEMENT,communityId,id);
50
+        if (null != allViewNum){
59 51
             tpAnnouncementMapper.updateByPrimaryKeySelective(id, allViewNum);
60 52
         }
61 53
         return tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
@@ -115,6 +107,43 @@ public class SocialServiceImpl implements SocialServiceI {
115 107
      */
116 108
     @Override
117 109
     public TpActivity findActivityDetail(Integer activityId, Integer communityId) {
110
+        //TODO
111
+        Integer userId = 1;
112
+        //更新查看次数
113
+        Integer allViewNum = updateSocialView(userId,Constant.ACTIVITY,communityId,activityId);
114
+        if (null != allViewNum){
115
+            TpActivity activity = new TpActivity();
116
+            activity.setId(activityId);
117
+            activity.setViewCount(allViewNum);
118
+            tpActivityMapper.updateByPrimaryKeySelective(activity);
119
+        }
120
+        return tpActivityMapper.selectByPrimaryKey(activityId,communityId);
121
+    }
122
+    
123
+    /**
124
+     * 更新此用户的查看次数操作
125
+     * @param userId
126
+     * @param socialType
127
+     * @param communityId
128
+     * @param uuid
129
+     */
130
+    private Integer updateSocialView(Integer userId,String socialType,Integer communityId,Integer uuid) {
131
+        //检查是否查看过这个帖子
132
+        TpSocialView tpSocialView = new TpSocialView();
133
+        tpSocialView.setTaUserId(userId);
134
+        tpSocialView.setSocialType(socialType);
135
+        tpSocialView.setCommunityId(communityId);
136
+        tpSocialView.setUuid(uuid);
137
+        Integer viewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
138
+    
139
+        //查看过的话查看次数加一
140
+        if (viewNum == 0){
141
+            tpSocialView.setCreateDate(new Date());
142
+            tpSocialViewMapper.insertSelective(tpSocialView);
143
+            tpSocialView.setTaUserId(null);
144
+            Integer allViewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
145
+            return allViewNum;
146
+        }
118 147
         return null;
119 148
     }
120 149
 

+ 0
- 16
CODE/smart-community/app-api/src/main/resources/mapper/ScUserMapper.xml Wyświetl plik

@@ -1,16 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
-<mapper namespace="com.community.huiju.dao.ScUserMapper">
4
-
5
-    <parameterMap id="paramMap" type="ScUser"></parameterMap>
6
-
7
-    <resultMap id="resultMap" type="ScUser">
8
-        <id property="id" column="id"/>
9
-        <result property="userName" column="user_name"/>
10
-        <result property="userPassword" column="user_password"/>
11
-    </resultMap>
12
-
13
-    <select id="find" resultMap="resultMap">
14
-        select * from sc_user
15
-    </select>
16
-</mapper>

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml Wyświetl plik

@@ -32,7 +32,7 @@
32 32
     select 
33 33
     <include refid="Base_Column_List" />
34 34
     from tp_activity
35
-    where id = #{id,jdbcType=INTEGER}
35
+    where id = #{id,jdbcType=INTEGER} and #{communityId,jdbcType=INTEGER}
36 36
   </select>
37 37
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
38 38
     delete from tp_activity

+ 3
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpSocialViewMapper.xml Wyświetl plik

@@ -117,11 +117,11 @@
117 117
 
118 118
   <select id="selectViewNum" resultType="java.lang.Integer" parameterType="com.community.huiju.model.TpSocialView">
119 119
     select count(*) from tp_social_view
120
-    where
120
+    where 1=1
121 121
     <if test="taUserId != null" >
122
-      ta_user_id = #{taUserId} and
122
+      and ta_user_id = #{taUserId}
123 123
     </if>
124
-    uuid = #{uuid}
124
+    and uuid = #{uuid}
125 125
     and community_id = #{communityId}
126 126
     and social_type = #{socialType}
127 127
   </select>

BIN
文档/需求/app接口需求-第二版.xlsx Wyświetl plik