Bladeren bron

解决冲突

dingxin 6 jaren geleden
bovenliggende
commit
169a76b467
38 gewijzigde bestanden met toevoegingen van 1613 en 43 verwijderingen
  1. 48
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/cache/AppkeyCache.java
  2. 9
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java
  3. 6
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CodeController.java
  4. 6
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java
  5. 6
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  6. 51
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java
  7. 15
    15
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  8. 1
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java
  9. 3
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java
  10. 29
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketMapper.java
  11. 33
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordCommentMapper.java
  12. 19
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordMapper.java
  13. 10
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUser.java
  14. 205
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicket.java
  15. 65
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecord.java
  16. 105
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecordComment.java
  17. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BannerServiceI.java
  18. 3
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  19. 25
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java
  20. 14
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BannerServiceImpl.java
  21. 0
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java
  22. 0
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  23. 46
    5
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  24. 164
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java
  25. 45
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java
  26. 44
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TpTicketInfoVO.java
  27. 48
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TpTicketVO.java
  28. 12
    0
      CODE/smart-community/app-api/src/main/resources/log4j.properties
  29. 14
    3
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml
  30. 16
    1
      CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml
  31. 6
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpCarouselSettingMapper.xml
  32. 287
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml
  33. 160
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordCommentMapper.xml
  34. 106
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml
  35. 8
    1
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  36. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class
  37. 3
    0
      CODE/smart-community/zuul/src/main/resources/bootstrap.yml
  38. BIN
      文档/需求/app接口需求-第二版.xlsx

+ 48
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/cache/AppkeyCache.java Bestand weergeven

@@ -0,0 +1,48 @@
1
+package com.community.huiju.common.code.cache;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.google.common.cache.CacheBuilder;
5
+import com.google.common.cache.CacheLoader;
6
+import com.google.common.cache.LoadingCache;
7
+import lombok.extern.slf4j.Slf4j;
8
+
9
+import java.util.concurrent.ExecutionException;
10
+import java.util.concurrent.TimeUnit;
11
+
12
+/**
13
+ * 缓存
14
+ * @author weiximei
15
+ */
16
+@Slf4j
17
+public class AppkeyCache {
18
+
19
+    // .refreshAfterWrite(3, TimeUnit.HOURS)// 给定时间内没有被读/写访问,则回收。
20
+    static LoadingCache<String, Object> cache = CacheBuilder.newBuilder()
21
+            .expireAfterAccess(Constant.CACHE_EXPIRE, TimeUnit.HOURS)// 缓存过期时间和redis缓存时长一样
22
+            .maximumSize(Constant.CACHE_SIZE).// 设置缓存个数
23
+            build(new CacheLoader<String, Object>() {
24
+            @Override
25
+            /** 当本地缓存命没有中时,调用load方法获取结果并将结果缓存 **/
26
+            public String load(String appKey) throws Exception {
27
+                return null;
28
+            }
29
+
30
+    });
31
+
32
+    public static Object getCache(String appKey) {
33
+        Object value = null;
34
+        try {
35
+            value = cache.get(appKey);
36
+        } catch (ExecutionException e) {
37
+            e.printStackTrace();
38
+        }
39
+        return value;
40
+    }
41
+
42
+    public static void setCache(String appKey,Object appValue){
43
+        log.info("缓存的key-value: {}-{}", appKey,appValue);
44
+        cache.put(appKey,appValue);
45
+    }
46
+
47
+
48
+}

+ 9
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java Bestand weergeven

@@ -34,7 +34,7 @@ public class BannerController {
34 34
 
35 35
     @ApiOperation(value = "首页运营banner接口", notes = "获取首页运营banner")
36 36
     @RequestMapping(value = "/banner/{bannerId}", method = RequestMethod.GET)
37
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Long", name = "bannerId", value = "运营banner图Id") })
37
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "bannerId", value = "运营banner图Id") })
38 38
     public ResponseBean selectToBannerImg(@PathVariable("bannerId")Integer bannerId){
39 39
         ResponseBean responseBean = new ResponseBean();
40 40
         ToBanner toBannerList = bannerService.viewBannerImg(bannerId);
@@ -42,4 +42,12 @@ public class BannerController {
42 42
         return responseBean;
43 43
     }
44 44
 
45
+    @ApiOperation(value = "首页运营所有banner接口", notes = "获取首页所有运营banner")
46
+    @RequestMapping(value = "/banners", method = RequestMethod.GET)
47
+    public ResponseBean selectAllToBannerImg(){
48
+        ResponseBean responseBean = new ResponseBean();
49
+        List<ToBanner> toBannerList = bannerService.viewAllBannerImg();
50
+        responseBean.addSuccess(toBannerList);
51
+        return responseBean;
52
+    }
45 53
 }

+ 6
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/CodeController.java Bestand weergeven

@@ -3,6 +3,7 @@ package com.community.huiju.controller;
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5 5
 import com.community.huiju.common.code.ICode;
6
+import com.community.huiju.common.code.cache.AppkeyCache;
6 7
 import io.swagger.annotations.Api;
7 8
 import io.swagger.annotations.ApiImplicitParam;
8 9
 import io.swagger.annotations.ApiImplicitParams;
@@ -23,7 +24,7 @@ import javax.servlet.http.HttpSession;
23 24
  * @author weiximei
24 25
  */
25 26
 @RestController
26
-@RequestMapping("/code")
27
+@RequestMapping("/")
27 28
 @RefreshScope
28 29
 @Api("获取验证码的API")
29 30
 @Slf4j
@@ -35,7 +36,7 @@ public class CodeController {
35 36
 
36 37
     @ApiOperation(value = "获取手机验证码", notes = "根据手机号发送验证码")
37 38
     @ApiImplicitParams({@ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "手机号")})
38
-    @RequestMapping(value = "/sendCode",method = RequestMethod.POST)
39
+    @RequestMapping(value = "/code/sendCode",method = RequestMethod.POST)
39 40
     public ResponseBean sendCode(@RequestParam String phone, HttpSession session) {
40 41
         ResponseBean response = new ResponseBean();
41 42
         int code = (int) ((Math.random()*9+1)*1000);
@@ -43,7 +44,9 @@ public class CodeController {
43 44
         boolean result = true;
44 45
         if (result) {
45 46
             log.info("{} 验证码: {}",phone,code);
46
-            session.setAttribute(Constant.SESSION_PHONE_CODE,String.valueOf(code));
47
+            // 设置缓存
48
+            AppkeyCache.setCache(phone,String.valueOf(code));
49
+            //session.setAttribute(Constant.SESSION_PHONE_CODE,String.valueOf(code));
47 50
             response.addSuccess("发送成功!");
48 51
         } else {
49 52
             response.addError("发送失败!");

+ 6
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java Bestand weergeven

@@ -48,7 +48,9 @@ public class MessageController {
48 48
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
49 49
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
50 50
 	@RequestMapping(value = "/message/{communityId}/news",method = RequestMethod.GET)
51
-	public ResponseBean getNews(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
51
+	public ResponseBean getNews(@PathVariable Integer communityId,
52
+	                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53
+	                            @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
52 54
 		ResponseBean responseBean = new ResponseBean();
53 55
 		List<TpMessage> newsList = messageService.getMessages(communityId,pageNum,pageSize, Constant.MODEL_TYPE_NEWS);
54 56
 		responseBean.addSuccess(newsList);
@@ -60,7 +62,9 @@ public class MessageController {
60 62
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
61 63
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
62 64
 	@RequestMapping(value = "/message/{communityId}/upcoming",method = RequestMethod.GET)
63
-	public ResponseBean getUpcoming(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
65
+	public ResponseBean getUpcoming(@PathVariable Integer communityId,
66
+	                                @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
67
+	                                @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
64 68
 		ResponseBean responseBean = new ResponseBean();
65 69
 		List<TpMessage> upcomingList = messageService.getMessages(communityId,pageNum,pageSize,Constant.MODEL_TYPE_UPCOMING);
66 70
 		responseBean.addSuccess(upcomingList);

+ 6
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Bestand weergeven

@@ -55,7 +55,9 @@ public class SocialController {
55 55
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
56 56
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
57 57
     @RequestMapping(value = "/announcements/{communityId}",method = RequestMethod.GET)
58
-    public ResponseBean getAnnouncements(@PathVariable Integer communityId,@RequestParam String title,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
58
+    public ResponseBean getAnnouncements(@PathVariable Integer communityId,@RequestParam String title,
59
+                                         @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
60
+                                         @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
59 61
         ResponseBean responseBean = new ResponseBean();
60 62
         List<TpAnnouncement> announcementList = socialServiceI.getAnnouncements(communityId,title,pageNum,pageSize);
61 63
         responseBean.addSuccess(announcementList);
@@ -81,7 +83,9 @@ public class SocialController {
81 83
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
82 84
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
83 85
     @RequestMapping(value = "/activitys/{communityId}",method = RequestMethod.GET)
84
-    public ResponseBean getActivitys(@PathVariable Integer communityId,@RequestParam String title,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
86
+    public ResponseBean getActivitys(@PathVariable Integer communityId,@RequestParam String title,
87
+                                     @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
88
+                                     @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
85 89
         ResponseBean responseBean = new ResponseBean();
86 90
         List<TpActivity> activityList = socialServiceI.getActivitys(communityId,title,pageNum,pageSize);
87 91
         responseBean.addSuccess(activityList);

+ 51
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Bestand weergeven

@@ -0,0 +1,51 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.config.entity.UserElement;
6
+import com.community.huiju.model.TaUser;
7
+import com.community.huiju.model.TpTicket;
8
+import com.community.huiju.service.ITicketService;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiImplicitParam;
11
+import io.swagger.annotations.ApiImplicitParams;
12
+import io.swagger.annotations.ApiOperation;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.cloud.context.config.annotation.RefreshScope;
15
+import org.springframework.web.bind.annotation.*;
16
+
17
+import javax.servlet.http.HttpSession;
18
+
19
+@RestController
20
+@RefreshScope
21
+@RequestMapping("/")
22
+@Api("工单API")
23
+public class TicketController {
24
+
25
+    @Autowired
26
+    private ITicketService iTicketService;
27
+
28
+    @RequestMapping(value = "/ticket/service/{communityId}",method = RequestMethod.GET)
29
+    @ApiOperation(value = "获取 报修/投诉/联系单 各3条数据",notes = "根据 小区编号,第几页,一页多少行")
30
+    @ApiImplicitParams({
31
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区编号"),
32
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "pageCode",value = "第几页"),
33
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "pageSize",value = "一页多少数据"),
34
+    })
35
+    public ResponseBean getService(@PathVariable(value = "communityId") String communityId,
36
+                                   @RequestParam(value = "pageCode",defaultValue = "1") Integer pageCode,
37
+                                   @RequestParam(value = "pageSize",defaultValue = "3") Integer pageSize,
38
+                                   HttpSession session) {
39
+        ResponseBean response = new ResponseBean();
40
+
41
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
42
+
43
+        TpTicket tpTicket = new TpTicket();
44
+        tpTicket.setCommunityId(Integer.valueOf(communityId));
45
+        tpTicket.setTaUserId(userElement.getId());
46
+
47
+        response = iTicketService.getList(tpTicket,pageCode,pageSize);
48
+        return response;
49
+    }
50
+
51
+}

+ 15
- 15
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Bestand weergeven

@@ -2,9 +2,11 @@ package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.common.code.cache.AppkeyCache;
5 6
 import com.community.huiju.config.entity.UserElement;
6 7
 import com.community.huiju.model.TaUser;
7 8
 import com.community.huiju.service.ITaUserService;
9
+import com.community.huiju.vo.TaUserVO;
8 10
 import io.swagger.annotations.Api;
9 11
 import io.swagger.annotations.ApiImplicitParam;
10 12
 import io.swagger.annotations.ApiImplicitParams;
@@ -23,7 +25,7 @@ import javax.xml.crypto.dsig.keyinfo.PGPData;
23 25
  */
24 26
 @RestController
25 27
 @RefreshScope
26
-@RequestMapping("/user")
28
+@RequestMapping("/")
27 29
 @Api("用户相关操作")
28 30
 public class UserController {
29 31
 
@@ -32,26 +34,24 @@ public class UserController {
32 34
 
33 35
     @ApiOperation(value = "登录", notes = "根据登录名和密码")
34 36
     @ApiImplicitParams({
37
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区"),
35 38
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginName",value = "手机号"),
36 39
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginPassword",value = "密码")
37 40
     })
38
-    @RequestMapping(value = "/login",method = RequestMethod.POST)
39
-    public ResponseBean login(@RequestParam(value = "loginName") String loginName,@RequestParam(value = "code",defaultValue = "") String code, HttpSession session){
40
-        ResponseBean responseBean = new ResponseBean();
41
-        String phondeCode = (String) session.getAttribute(Constant.SESSION_PHONE_CODE);
42
-        if (!code.equals(phondeCode)) {
43
-            responseBean.addError("验证码错误!");
44
-            return responseBean;
45
-        }
46
-        responseBean = iTaUserService.login(loginName);
47
-        TaUser taUser = (TaUser) responseBean.getData();
48
-
49
-        if (null != taUser) {
41
+    @RequestMapping(value = "/user/login/{communityId}",method = RequestMethod.POST)
42
+    public ResponseBean login(@RequestParam(value = "loginName") String loginName,
43
+                              @RequestParam(value = "code",defaultValue = "") String code,
44
+                              @PathVariable(value = "communityId") String communityId,
45
+                              HttpSession session){
46
+        ResponseBean responseBean = iTaUserService.login(loginName,communityId,code);
47
+        TaUserVO userVO = (TaUserVO) responseBean.getData();
48
+
49
+        if (null != userVO) {
50 50
             UserElement userElement = new UserElement();
51
-            BeanUtils.copyProperties(taUser,userElement);
51
+            BeanUtils.copyProperties(userVO,userElement);
52 52
             session.setAttribute(Constant.APP_USER_SESSION,userElement);
53
+            userVO.setToken(session.getId());
53 54
         }
54
-
55 55
         return responseBean;
56 56
 
57 57
     }

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java Bestand weergeven

@@ -11,4 +11,5 @@ public interface ToBannerMapper {
11 11
 
12 12
     ToBanner selectByCommunityId(@Param("bannerId") Integer bannerId, @Param("nowTime") String nowTime);
13 13
 
14
+    List<ToBanner> selectAllByNum(@Param("nowTime") String nowTime, @Param("num")Integer num);
14 15
 }

+ 3
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java Bestand weergeven

@@ -18,4 +18,7 @@ public interface TpCarouselSettingMapper {
18 18
     int updateByPrimaryKey(TpCarouselSetting record);
19 19
 
20 20
      int getcarouselNum(String lease);
21
+     
22
+    Integer selectCarouselNum(String carouselType);
23
+
21 24
 }

+ 29
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketMapper.java Bestand weergeven

@@ -0,0 +1,29 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpTicket;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+@Mapper
10
+public interface TpTicketMapper {
11
+    int deleteByPrimaryKey(Integer id);
12
+
13
+    int insert(TpTicket record);
14
+
15
+    int insertSelective(TpTicket record);
16
+
17
+    TpTicket selectByPrimaryKey(Integer id);
18
+
19
+    int updateByPrimaryKeySelective(TpTicket record);
20
+
21
+    int updateByPrimaryKey(TpTicket record);
22
+
23
+    /**
24
+     * 根据 小区ID 用户ID 类型 查询数据
25
+     * @param map
26
+     * @return
27
+     */
28
+    List<TpTicket> selectByCommuniytIdAndByTaUserIdAndByType(Map map);
29
+}

+ 33
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordCommentMapper.java Bestand weergeven

@@ -0,0 +1,33 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpTicketRecordComment;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+@Mapper
10
+public interface TpTicketRecordCommentMapper {
11
+    int deleteByPrimaryKey(Integer id);
12
+
13
+    int insert(TpTicketRecordComment record);
14
+
15
+    int insertSelective(TpTicketRecordComment record);
16
+
17
+    TpTicketRecordComment selectByPrimaryKey(Integer id);
18
+
19
+    int updateByPrimaryKeySelective(TpTicketRecordComment record);
20
+
21
+    int updateByPrimaryKey(TpTicketRecordComment record);
22
+
23
+    /**
24
+     * 根据工单ID,最新的几条 查询出最新的追答记录
25
+     *
26
+     *  size 表示最新几条
27
+     *  tickerId 工单ID
28
+     *
29
+     * @param map
30
+     * @return
31
+     */
32
+    List<TpTicketRecordComment> selectByTicketId(Map map);
33
+}

+ 19
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordMapper.java Bestand weergeven

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpTicketRecord;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface TpTicketRecordMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(TpTicketRecord record);
11
+
12
+    int insertSelective(TpTicketRecord record);
13
+
14
+    TpTicketRecord selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(TpTicketRecord record);
17
+
18
+    int updateByPrimaryKey(TpTicketRecord record);
19
+}

+ 10
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUser.java Bestand weergeven

@@ -1,7 +1,5 @@
1 1
 package com.community.huiju.model;
2 2
 
3
-import com.alibaba.fastjson.annotation.JSONField;
4
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
5 3
 
6 4
 import java.util.Date;
7 5
 
@@ -32,6 +30,8 @@ public class TaUser {
32 30
 
33 31
     private String acceptAgreementStatus;
34 32
 
33
+    private String verifyStatus;
34
+
35 35
     private Integer createUser;
36 36
 
37 37
     private Date createDate;
@@ -144,6 +144,14 @@ public class TaUser {
144 144
         this.acceptAgreementStatus = acceptAgreementStatus == null ? null : acceptAgreementStatus.trim();
145 145
     }
146 146
 
147
+    public String getVerifyStatus() {
148
+        return verifyStatus;
149
+    }
150
+
151
+    public void setVerifyStatus(String verifyStatus) {
152
+        this.verifyStatus = verifyStatus;
153
+    }
154
+
147 155
     public Integer getCreateUser() {
148 156
         return createUser;
149 157
     }

+ 205
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicket.java Bestand weergeven

@@ -0,0 +1,205 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpTicket {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer taUserId;
11
+
12
+    private String ticketTitle;
13
+
14
+    private String ticketContent;
15
+
16
+    private String status;
17
+
18
+    private String type;
19
+
20
+    private String repairType;
21
+
22
+    private String ticketMatchImg1;
23
+
24
+    private String ticketMatchImg2;
25
+
26
+    private String ticketMatchImg3;
27
+
28
+    private String ticketMatchImg4;
29
+
30
+    private String ticketMatchImg5;
31
+
32
+    private Integer tpUserId;
33
+
34
+    private String score;
35
+
36
+    private String comment;
37
+
38
+    private Integer createUser;
39
+
40
+    private Date createDate;
41
+
42
+    private Integer updateUser;
43
+
44
+    private Date updateDate;
45
+
46
+    public Integer getId() {
47
+        return id;
48
+    }
49
+
50
+    public void setId(Integer id) {
51
+        this.id = id;
52
+    }
53
+
54
+    public Integer getCommunityId() {
55
+        return communityId;
56
+    }
57
+
58
+    public void setCommunityId(Integer communityId) {
59
+        this.communityId = communityId;
60
+    }
61
+
62
+    public Integer getTaUserId() {
63
+        return taUserId;
64
+    }
65
+
66
+    public void setTaUserId(Integer taUserId) {
67
+        this.taUserId = taUserId;
68
+    }
69
+
70
+    public String getTicketTitle() {
71
+        return ticketTitle;
72
+    }
73
+
74
+    public void setTicketTitle(String ticketTitle) {
75
+        this.ticketTitle = ticketTitle == null ? null : ticketTitle.trim();
76
+    }
77
+
78
+    public String getTicketContent() {
79
+        return ticketContent;
80
+    }
81
+
82
+    public void setTicketContent(String ticketContent) {
83
+        this.ticketContent = ticketContent == null ? null : ticketContent.trim();
84
+    }
85
+
86
+    public String getStatus() {
87
+        return status;
88
+    }
89
+
90
+    public void setStatus(String status) {
91
+        this.status = status == null ? null : status.trim();
92
+    }
93
+
94
+    public String getType() {
95
+        return type;
96
+    }
97
+
98
+    public void setType(String type) {
99
+        this.type = type == null ? null : type.trim();
100
+    }
101
+
102
+    public String getRepairType() {
103
+        return repairType;
104
+    }
105
+
106
+    public void setRepairType(String repairType) {
107
+        this.repairType = repairType == null ? null : repairType.trim();
108
+    }
109
+
110
+    public String getTicketMatchImg1() {
111
+        return ticketMatchImg1;
112
+    }
113
+
114
+    public void setTicketMatchImg1(String ticketMatchImg1) {
115
+        this.ticketMatchImg1 = ticketMatchImg1 == null ? null : ticketMatchImg1.trim();
116
+    }
117
+
118
+    public String getTicketMatchImg2() {
119
+        return ticketMatchImg2;
120
+    }
121
+
122
+    public void setTicketMatchImg2(String ticketMatchImg2) {
123
+        this.ticketMatchImg2 = ticketMatchImg2 == null ? null : ticketMatchImg2.trim();
124
+    }
125
+
126
+    public String getTicketMatchImg3() {
127
+        return ticketMatchImg3;
128
+    }
129
+
130
+    public void setTicketMatchImg3(String ticketMatchImg3) {
131
+        this.ticketMatchImg3 = ticketMatchImg3 == null ? null : ticketMatchImg3.trim();
132
+    }
133
+
134
+    public String getTicketMatchImg4() {
135
+        return ticketMatchImg4;
136
+    }
137
+
138
+    public void setTicketMatchImg4(String ticketMatchImg4) {
139
+        this.ticketMatchImg4 = ticketMatchImg4 == null ? null : ticketMatchImg4.trim();
140
+    }
141
+
142
+    public String getTicketMatchImg5() {
143
+        return ticketMatchImg5;
144
+    }
145
+
146
+    public void setTicketMatchImg5(String ticketMatchImg5) {
147
+        this.ticketMatchImg5 = ticketMatchImg5 == null ? null : ticketMatchImg5.trim();
148
+    }
149
+
150
+    public Integer getTpUserId() {
151
+        return tpUserId;
152
+    }
153
+
154
+    public void setTpUserId(Integer tpUserId) {
155
+        this.tpUserId = tpUserId;
156
+    }
157
+
158
+    public String getScore() {
159
+        return score;
160
+    }
161
+
162
+    public void setScore(String score) {
163
+        this.score = score == null ? null : score.trim();
164
+    }
165
+
166
+    public String getComment() {
167
+        return comment;
168
+    }
169
+
170
+    public void setComment(String comment) {
171
+        this.comment = comment == null ? null : comment.trim();
172
+    }
173
+
174
+    public Integer getCreateUser() {
175
+        return createUser;
176
+    }
177
+
178
+    public void setCreateUser(Integer createUser) {
179
+        this.createUser = createUser;
180
+    }
181
+
182
+    public Date getCreateDate() {
183
+        return createDate;
184
+    }
185
+
186
+    public void setCreateDate(Date createDate) {
187
+        this.createDate = createDate;
188
+    }
189
+
190
+    public Integer getUpdateUser() {
191
+        return updateUser;
192
+    }
193
+
194
+    public void setUpdateUser(Integer updateUser) {
195
+        this.updateUser = updateUser;
196
+    }
197
+
198
+    public Date getUpdateDate() {
199
+        return updateDate;
200
+    }
201
+
202
+    public void setUpdateDate(Date updateDate) {
203
+        this.updateDate = updateDate;
204
+    }
205
+}

+ 65
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecord.java Bestand weergeven

@@ -0,0 +1,65 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpTicketRecord {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer ticketId;
11
+
12
+    private String status;
13
+
14
+    private Integer createUser;
15
+
16
+    private Date createDate;
17
+
18
+    public Integer getId() {
19
+        return id;
20
+    }
21
+
22
+    public void setId(Integer id) {
23
+        this.id = id;
24
+    }
25
+
26
+    public Integer getCommunityId() {
27
+        return communityId;
28
+    }
29
+
30
+    public void setCommunityId(Integer communityId) {
31
+        this.communityId = communityId;
32
+    }
33
+
34
+    public Integer getTicketId() {
35
+        return ticketId;
36
+    }
37
+
38
+    public void setTicketId(Integer ticketId) {
39
+        this.ticketId = ticketId;
40
+    }
41
+
42
+    public String getStatus() {
43
+        return status;
44
+    }
45
+
46
+    public void setStatus(String status) {
47
+        this.status = status == null ? null : status.trim();
48
+    }
49
+
50
+    public Integer getCreateUser() {
51
+        return createUser;
52
+    }
53
+
54
+    public void setCreateUser(Integer createUser) {
55
+        this.createUser = createUser;
56
+    }
57
+
58
+    public Date getCreateDate() {
59
+        return createDate;
60
+    }
61
+
62
+    public void setCreateDate(Date createDate) {
63
+        this.createDate = createDate;
64
+    }
65
+}

+ 105
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecordComment.java Bestand weergeven

@@ -0,0 +1,105 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpTicketRecordComment {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer tickerId;
11
+
12
+    private Integer ticketRecordId;
13
+
14
+    private Integer uuid;
15
+
16
+    private String userType;
17
+
18
+    private String content;
19
+
20
+    private Integer parentId;
21
+
22
+    private String userName;
23
+
24
+    private Date createDate;
25
+
26
+    public Integer getId() {
27
+        return id;
28
+    }
29
+
30
+    public void setId(Integer id) {
31
+        this.id = id;
32
+    }
33
+
34
+    public Integer getCommunityId() {
35
+        return communityId;
36
+    }
37
+
38
+    public void setCommunityId(Integer communityId) {
39
+        this.communityId = communityId;
40
+    }
41
+
42
+    public Integer getTickerId() {
43
+        return tickerId;
44
+    }
45
+
46
+    public void setTickerId(Integer tickerId) {
47
+        this.tickerId = tickerId;
48
+    }
49
+
50
+    public Integer getTicketRecordId() {
51
+        return ticketRecordId;
52
+    }
53
+
54
+    public void setTicketRecordId(Integer ticketRecordId) {
55
+        this.ticketRecordId = ticketRecordId;
56
+    }
57
+
58
+    public Integer getUuid() {
59
+        return uuid;
60
+    }
61
+
62
+    public void setUuid(Integer uuid) {
63
+        this.uuid = uuid;
64
+    }
65
+
66
+    public String getUserType() {
67
+        return userType;
68
+    }
69
+
70
+    public void setUserType(String userType) {
71
+        this.userType = userType == null ? null : userType.trim();
72
+    }
73
+
74
+    public String getContent() {
75
+        return content;
76
+    }
77
+
78
+    public void setContent(String content) {
79
+        this.content = content == null ? null : content.trim();
80
+    }
81
+
82
+    public Integer getParentId() {
83
+        return parentId;
84
+    }
85
+
86
+    public void setParentId(Integer parentId) {
87
+        this.parentId = parentId;
88
+    }
89
+
90
+    public String getUserName() {
91
+        return userName;
92
+    }
93
+
94
+    public void setUserName(String userName) {
95
+        this.userName = userName == null ? null : userName.trim();
96
+    }
97
+
98
+    public Date getCreateDate() {
99
+        return createDate;
100
+    }
101
+
102
+    public void setCreateDate(Date createDate) {
103
+        this.createDate = createDate;
104
+    }
105
+}

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BannerServiceI.java Bestand weergeven

@@ -12,5 +12,5 @@ import java.util.List;
12 12
 public interface BannerServiceI {
13 13
 
14 14
     ToBanner viewBannerImg(Integer bannerId);
15
-
15
+    List<ToBanner> viewAllBannerImg();
16 16
 }

+ 3
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Bestand weergeven

@@ -20,9 +20,11 @@ public interface ITaUserService {
20 20
     /**
21 21
      * 用户登录
22 22
      * @param loginName
23
+     * @param communityId 小区id
24
+     * @param code 验证码
23 25
      * @return 用户对象
24 26
      */
25
-    ResponseBean login(String loginName);
27
+    ResponseBean login(String loginName,String communityId,String code);
26 28
 
27 29
     /**
28 30
      * 注册用户

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java Bestand weergeven

@@ -0,0 +1,25 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.TpTicket;
5
+import com.community.huiju.vo.TpTicketVO;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * 工单业务
11
+ * @author weiximei
12
+ */
13
+public interface ITicketService {
14
+
15
+    /**
16
+     * 根据 小区ID 用户ID 类型 查询数据
17
+     * @param tpTicket
18
+     * @param pageCode
19
+     * @param pageSize
20
+     * @return
21
+     */
22
+    ResponseBean getList(TpTicket tpTicket,Integer pageCode, Integer pageSize);
23
+
24
+
25
+}

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BannerServiceImpl.java Bestand weergeven

@@ -1,7 +1,9 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.community.commom.constant.Constant;
3 4
 import com.community.commom.utils.DateUtils;
4 5
 import com.community.huiju.dao.ToBannerMapper;
6
+import com.community.huiju.dao.TpCarouselSettingMapper;
5 7
 import com.community.huiju.model.ToBanner;
6 8
 import com.community.huiju.service.BannerServiceI;
7 9
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,9 +22,21 @@ public class BannerServiceImpl implements BannerServiceI {
20 22
     @Autowired
21 23
     private ToBannerMapper toBannerMapper;
22 24
 
25
+    @Autowired
26
+    private TpCarouselSettingMapper tpCarouselSettingMapper;
27
+
23 28
     @Override
24 29
     public ToBanner viewBannerImg(Integer bannerId) {
25 30
         String nowTime = DateUtils.getDate("yyyy-MM-dd");
26 31
         return toBannerMapper.selectByCommunityId(bannerId, nowTime);
27 32
     }
33
+
34
+    @Override
35
+    public List<ToBanner> viewAllBannerImg() {
36
+        //查询轮播图数量
37
+        Integer bannerNum = tpCarouselSettingMapper.selectCarouselNum(Constant.ANNOUNCEMENT);
38
+
39
+        String nowTime = DateUtils.getDate("yyyy-MM-dd");
40
+        return toBannerMapper.selectAllByNum(nowTime, bannerNum);
41
+    }
28 42
 }

+ 0
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java Bestand weergeven

@@ -44,8 +44,6 @@ public class MessageServiceImpl implements MessageServiceI {
44 44
 	public List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType) {
45 45
 		//todo
46 46
 		Integer userId = 1;
47
-		pageNum = null == pageNum ? 1 : pageNum;
48
-		pageSize = null == pageSize ? 10 : pageSize;
49 47
 		//使用分页插件
50 48
 		PageHelper.startPage(pageNum, pageSize);
51 49
 		// 获取数据

+ 0
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Bestand weergeven

@@ -69,8 +69,6 @@ public class SocialServiceImpl implements SocialServiceI {
69 69
      */
70 70
     @Override
71 71
     public List<TpAnnouncement> getAnnouncements(Integer communityId,String title, Integer pageNum, Integer pageSize) {
72
-        pageNum = null == pageNum ? 1 : pageNum;
73
-        pageSize = null == pageSize ? 10 : pageSize;
74 72
         //使用分页插件
75 73
         PageHelper.startPage(pageNum, pageSize);
76 74
         // 获取数据
@@ -100,8 +98,6 @@ public class SocialServiceImpl implements SocialServiceI {
100 98
      */
101 99
     @Override
102 100
     public List<TpActivity> getActivitys(Integer communityId, String title, Integer pageNum, Integer pageSize) {
103
-        pageNum = null == pageNum ? 1 : pageNum;
104
-        pageSize = null == pageSize ? 10 : pageSize;
105 101
         //使用分页插件
106 102
         PageHelper.startPage(pageNum, pageSize);
107 103
         // 获取数据

+ 46
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Bestand weergeven

@@ -3,11 +3,15 @@ package com.community.huiju.service.impl;
3 3
 import com.community.commom.mode.ResponseBean;
4 4
 import com.community.commom.utils.AccountValidatorUtil;
5 5
 import com.community.commom.utils.MD5Utils;
6
+import com.community.huiju.common.code.cache.AppkeyCache;
6 7
 import com.community.huiju.dao.TaUserMapper;
7 8
 import com.community.huiju.model.TaUser;
8 9
 import com.community.huiju.service.ITaUserService;
10
+import com.community.huiju.vo.TaUserVO;
9 11
 import com.google.common.collect.Maps;
10 12
 import lombok.extern.slf4j.Slf4j;
13
+import org.apache.commons.lang.StringUtils;
14
+import org.springframework.beans.BeanUtils;
11 15
 import org.springframework.beans.factory.annotation.Autowired;
12 16
 import org.springframework.stereotype.Service;
13 17
 import org.springframework.transaction.annotation.Transactional;
@@ -19,7 +23,7 @@ import java.util.Map;
19 23
  * 用户业务 实现
20 24
  * @author weiximei
21 25
  */
22
-@Service("iToUserService")
26
+@Service("iTaUserService")
23 27
 @Slf4j
24 28
 public class TaUserServiceImpl implements ITaUserService {
25 29
 
@@ -57,18 +61,40 @@ public class TaUserServiceImpl implements ITaUserService {
57 61
     }
58 62
 
59 63
     @Override
60
-    public ResponseBean login(String loginName) {
64
+    public ResponseBean login(String loginName,String communityId,String code) {
61 65
         ResponseBean response = new ResponseBean();
66
+        String phoneCode = (String) AppkeyCache.getCache(loginName);
67
+        if (!phoneCode.equals(code)) {
68
+            response.addError("验证码错误!");
69
+            return response;
70
+        }
71
+        // 设置验证码为null字符
72
+        AppkeyCache.setCache(loginName,"null");
62 73
         log.info("{} 手机号校验结果: {}",loginName,AccountValidatorUtil.isPhone(loginName));
63 74
         if (!AccountValidatorUtil.isPhone(loginName)){
64 75
             response.addError("请输入正取的手机号!");
65 76
             return response;
66 77
         }
78
+        if (StringUtils.isBlank(communityId)) {
79
+            response.addError("请选择小区!");
80
+            return response;
81
+        }
82
+        if (StringUtils.isBlank(code)) {
83
+            response.addError("请输入验证码!");
84
+            return response;
85
+        }
86
+
67 87
         Map<String,Object> map = Maps.newHashMap();
68 88
         map.put("loginName",loginName);
69 89
         TaUser currentUser = taUserMapper.selectByLoginName(map);
70 90
         if (null != currentUser){
71
-            response.addSuccess(currentUser);
91
+            if (!communityId.equals(currentUser.getCommunityId()+"")) {
92
+                response.addError("用户不在此小区!");
93
+                return response;
94
+            }
95
+            TaUserVO taUserVO = new TaUserVO();
96
+            BeanUtils.copyProperties(currentUser,taUserVO);
97
+            response.addSuccess(taUserVO);
72 98
             return response;
73 99
         }else {
74 100
             TaUser user = new TaUser();
@@ -82,7 +108,18 @@ public class TaUserServiceImpl implements ITaUserService {
82 108
     @Transactional
83 109
     @Override
84 110
     public ResponseBean register(TaUser user) {
85
-        ResponseBean<TaUser> response = new ResponseBean();
111
+
112
+        // TODO 注册逻辑需要完善
113
+        /**
114
+         * 1.自动生成账号的基本信息
115
+         * 2.匹配资料库 已认证 未认证
116
+         * 2.角色类型
117
+         *
118
+         * 具体看原型图
119
+         *
120
+         */
121
+
122
+        ResponseBean<TaUserVO> response = new ResponseBean();
86 123
         // 开始注册
87 124
         user.setCreateDate(new Date());
88 125
         user.setUpdateDate(new Date());
@@ -90,10 +127,14 @@ public class TaUserServiceImpl implements ITaUserService {
90 127
         user.setAcceptAgreementStatus("1");
91 128
         user.setUserName(user.getLoginName());
92 129
         user.setRemark("这是系统自动注册!");
130
+        user.setCommunityId(3);
131
+        user.setVerifyStatus("1");
93 132
         //user.setLoginPassword(MD5Utils.encode(user.getLoginPassword()));
94 133
         taUserMapper.insertSelective(user);
95 134
 
96
-        response.addSuccess(user);
135
+        TaUserVO taUserVO = new TaUserVO();
136
+        BeanUtils.copyProperties(user,taUserVO);
137
+        response.addSuccess(taUserVO);
97 138
         return response;
98 139
     }
99 140
 }

+ 164
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Bestand weergeven

@@ -0,0 +1,164 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.dao.TpTicketMapper;
5
+import com.community.huiju.dao.TpTicketRecordCommentMapper;
6
+import com.community.huiju.model.TpTicket;
7
+import com.community.huiju.model.TpTicketRecordComment;
8
+import com.community.huiju.service.ITicketService;
9
+import com.community.huiju.vo.TpTicketVO;
10
+import com.github.pagehelper.PageHelper;
11
+import com.google.common.collect.Lists;
12
+import com.google.common.collect.Maps;
13
+import lombok.extern.slf4j.Slf4j;
14
+import org.apache.commons.collections.ListUtils;
15
+import org.apache.commons.lang.ObjectUtils;
16
+import org.springframework.beans.BeanUtils;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.stereotype.Service;
19
+import sun.security.krb5.internal.Ticket;
20
+
21
+import java.util.List;
22
+import java.util.Map;
23
+
24
+/**
25
+ * 工单业务 实现
26
+ * @author weiximei
27
+ */
28
+@Service("iTicketService")
29
+@Slf4j
30
+public class TicketServiceImpl implements ITicketService {
31
+
32
+    @Autowired
33
+    private TpTicketMapper tpTicketMapper;
34
+
35
+    @Autowired
36
+    private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
37
+
38
+    @Override
39
+    public ResponseBean getList(TpTicket tpTicket,Integer pageCode, Integer pageSize) {
40
+
41
+        ResponseBean<Map<String,Object>> responseBean = new ResponseBean();
42
+        // 最终返回值
43
+        Map<String,Object> result = Maps.newHashMap();
44
+
45
+        // 查询参数
46
+        Map<String,Object> lastRecordMap = Maps.newHashMap();
47
+        lastRecordMap.put("size",1);
48
+
49
+
50
+        Map<String,Object> parameter = Maps.newHashMap();
51
+        parameter.put("communityId",tpTicket.getCommunityId());
52
+        parameter.put("taUserId",tpTicket.getTaUserId());
53
+        //  0 代表 报修  1 代表 投诉  2代表 联系单
54
+        parameter.put("type",0);
55
+
56
+
57
+        // 报修
58
+        PageHelper.startPage(pageCode,pageSize);
59
+        List<TpTicket> tpTicketRepairsList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
60
+
61
+        List<TpTicketVO> repairsList = Lists.newArrayList();
62
+        tpTicketRepairsList.stream().forEach(e->{
63
+            TpTicketVO tpTicketVO = new TpTicketVO();
64
+            BeanUtils.copyProperties(e,tpTicketVO);
65
+            // 设置工单编号
66
+            lastRecordMap.put("tickerId",e.getId());
67
+            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
68
+            if (null != comment) {
69
+                tpTicketVO.setCommentContent(comment.getContent());
70
+                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
71
+            }
72
+
73
+
74
+            repairsList.add(tpTicketVO);
75
+        });
76
+
77
+        // 投诉
78
+        //  0 代表 报修  1 代表 投诉  2代表 联系单
79
+        parameter.put("type",1);
80
+        PageHelper.startPage(pageCode,pageSize);
81
+        List<TpTicket> tpTicketComplaintList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
82
+
83
+        List<TpTicketVO> complaintList = Lists.newArrayList();
84
+        tpTicketComplaintList.stream().forEach(e->{
85
+            TpTicketVO tpTicketVO = new TpTicketVO();
86
+            BeanUtils.copyProperties(e,tpTicketVO);
87
+            // 设置工单编号
88
+            lastRecordMap.put("tickerId",e.getId());
89
+            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
90
+            if (null != comment) {
91
+                tpTicketVO.setCommentContent(comment.getContent());
92
+                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
93
+            }
94
+
95
+            complaintList.add(tpTicketVO);
96
+        });
97
+
98
+        // 联系工单
99
+        //  0 代表 报修  1 代表 投诉  2代表 联系单
100
+        parameter.put("type",2);
101
+        PageHelper.startPage(pageCode,pageSize);
102
+        List<TpTicket> tpTicketLiaisonList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
103
+
104
+        List<TpTicketVO> liaisonList = Lists.newArrayList();
105
+        tpTicketLiaisonList.stream().forEach(e->{
106
+            TpTicketVO tpTicketVO = new TpTicketVO();
107
+            BeanUtils.copyProperties(e,tpTicketVO);
108
+            // 设置工单编号
109
+            lastRecordMap.put("tickerId",e.getId());
110
+            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
111
+            if (null != comment) {
112
+                tpTicketVO.setCommentContent(comment.getContent());
113
+                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
114
+            }
115
+
116
+            liaisonList.add(tpTicketVO);
117
+        });
118
+
119
+        result.put("repairs",repairsList);
120
+        result.put("complaint",complaintList);
121
+        result.put("liaison",liaisonList);
122
+
123
+        responseBean.addSuccess(result);
124
+        return responseBean;
125
+    }
126
+
127
+    /**
128
+     * 公共方法, 获取一条数据
129
+     * @param map
130
+     * @return
131
+     */
132
+    private TpTicketRecordComment getTicketRecordComment(Map map){
133
+        List<TpTicketRecordComment> list = tpTicketRecordCommentMapper.selectByTicketId(map);
134
+        return null==list
135
+                ?null:list.size()==0
136
+                ?null:list.get(0);
137
+    }
138
+
139
+//    public <T> List<T> setTicketData(T t, List<Ticket> source, Map map){
140
+//        List<T> list = Lists.newArrayList();
141
+//
142
+//        // 查询参数
143
+//        Map<String,Object> lastRecordMap = Maps.newHashMap();
144
+//        lastRecordMap.put("size",1);
145
+//
146
+//        source.stream().forEach(e->{
147
+//            TpTicketVO tpTicketVO = new TpTicketVO();
148
+//            BeanUtils.copyProperties(e,tpTicketVO);
149
+//            // 设置工单编号
150
+//            lastRecordMap.put("tickerId",e.getId());
151
+//            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
152
+//            if (null != comment) {
153
+//                tpTicketVO.setCommentContent(comment.getContent());
154
+//                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
155
+//            }
156
+//
157
+//            liaisonList.add(tpTicketVO);
158
+//        });
159
+
160
+
161
+        //return list;
162
+    //}
163
+
164
+}

+ 45
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java Bestand weergeven

@@ -0,0 +1,45 @@
1
+package com.community.huiju.vo;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+/**
8
+ * @author weiximei
9
+ */
10
+@Data
11
+@AllArgsConstructor
12
+@NoArgsConstructor
13
+public class TaUserVO {
14
+
15
+    /** 编号 **/
16
+    private Integer id;
17
+
18
+    /** 小区编号 **/
19
+    private Integer communityId;
20
+
21
+    /** 头像 **/
22
+    private String headPortrait;
23
+
24
+    /** 用户名 **/
25
+    private String userName;
26
+
27
+    /** 登录名 **/
28
+    private String loginName;
29
+
30
+    /** 邮箱 **/
31
+    private String email;
32
+
33
+    /** 性别 **/
34
+    private String gender;
35
+
36
+    /** 认证状态 **/
37
+    private String verifyStatus;
38
+
39
+    /** 用户状态 **/
40
+    private String status;
41
+
42
+    /** 用户token **/
43
+    private String token;
44
+
45
+}

+ 44
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TpTicketInfoVO.java Bestand weergeven

@@ -0,0 +1,44 @@
1
+package com.community.huiju.vo;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.util.Date;
8
+
9
+/**
10
+ * @author weiximei
11
+ */
12
+@Data
13
+@AllArgsConstructor
14
+@NoArgsConstructor
15
+public class TpTicketInfoVO extends TpTicketVO {
16
+
17
+
18
+    /** 工单内容 **/
19
+    private String ticketContent;
20
+
21
+    /** 流转状态 **/
22
+    private String status;
23
+
24
+    /** 报修类型 0:公共区域  1: 房屋质量  2::户内设施   **/
25
+    private String repairType;
26
+
27
+    private String ticketMatchImg1;
28
+
29
+    private String ticketMatchImg2;
30
+
31
+    private String ticketMatchImg3;
32
+
33
+    private String ticketMatchImg4;
34
+
35
+    private String ticketMatchImg5;
36
+
37
+    /** 评分 **/
38
+    private String score;
39
+
40
+    /** 评语 **/
41
+    private String comment;
42
+
43
+
44
+}

+ 48
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TpTicketVO.java Bestand weergeven

@@ -0,0 +1,48 @@
1
+package com.community.huiju.vo;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.util.Date;
8
+
9
+/**
10
+ * @author weiximei
11
+ */
12
+@Data
13
+@AllArgsConstructor
14
+@NoArgsConstructor
15
+public class TpTicketVO {
16
+
17
+    /** 编号 **/
18
+    private Integer id;
19
+
20
+    /** 小区编号 **/
21
+    private Integer communityId;
22
+
23
+    /** 用户appd的id **/
24
+    private Integer taUserId;
25
+
26
+    /** ================================ **/
27
+
28
+    /** 工单标题 **/
29
+    private String ticketTitle;
30
+
31
+    /** 类型 报修/投诉/联系单 **/
32
+    private String type;
33
+
34
+    /** 受理人的id **/
35
+    private Integer tpUserId;
36
+
37
+    private Date createDate;
38
+
39
+    private Date updateDate;
40
+
41
+    /** ====================================== **/
42
+
43
+    /** 最新进展 **/
44
+    private String commentContent;
45
+
46
+    /** 最新进展的时间 **/
47
+    private Date commentCreateDate;
48
+}

+ 12
- 0
CODE/smart-community/app-api/src/main/resources/log4j.properties Bestand weergeven

@@ -17,3 +17,15 @@ log4j.logger.org.springframework.transaction.support.TransactionSynchronizationM
17 17
 log4j.logger.java.sql.Connection=DEBUG
18 18
 log4j.logger.java.sql.Statement=DEBUG
19 19
 log4j.logger.java.sql.PreparedStatement=DEBUG
20
+
21
+###############Log4j 4 SQL Output start################# #DEBUG
22
+log4j.logger.com.**.dao=INFO
23
+log4j.logger.com.springframework=DEBUG
24
+log4j.logger.com.ibatis=DEBUG  
25
+log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG  
26
+log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG  
27
+log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
28
+log4j.logger.java.sql.ResultSet=DEBUG
29
+log4j.logger.org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl=DEBUG
30
+log4j.logger.java.sql=DEBUG,CONSOLE 
31
+###############Log4j 4 SQL Output end###################

+ 14
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml Bestand weergeven

@@ -15,6 +15,7 @@
15 15
     <result column="remark" property="remark" jdbcType="VARCHAR" />
16 16
     <result column="parent_id" property="parentId" jdbcType="INTEGER" />
17 17
     <result column="accept_agreement_status" property="acceptAgreementStatus" jdbcType="CHAR" />
18
+    <result column="verify_status" property="verifyStatus" jdbcType="CHAR" />
18 19
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
19 20
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
20 21
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
@@ -22,7 +23,7 @@
22 23
   </resultMap>
23 24
   <sql id="Base_Column_List" >
24 25
     id, community_id, building_owner_info_id, head_portrait, user_name, login_name, login_password, 
25
-    email, gender, status, remark, parent_id, accept_agreement_status, create_user, create_date, 
26
+    email, gender, status, remark, parent_id, accept_agreement_status, verify_status,create_user, create_date,
26 27
     update_user, update_date
27 28
   </sql>
28 29
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
@@ -40,13 +41,13 @@
40 41
       head_portrait, user_name, login_name, 
41 42
       login_password, email, gender, 
42 43
       status, remark, parent_id, 
43
-      accept_agreement_status, create_user, create_date, 
44
+      accept_agreement_status, verify_status, create_user, create_date,
44 45
       update_user, update_date)
45 46
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{buildingOwnerInfoId,jdbcType=INTEGER}, 
46 47
       #{headPortrait,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR}, 
47 48
       #{loginPassword,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR}, 
48 49
       #{status,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, 
49
-      #{acceptAgreementStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
50
+      #{acceptAgreementStatus,jdbcType=CHAR}, #{verifyStatus,jdbcType=CHAR},#{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP},
50 51
       #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
51 52
   </insert>
52 53
   <insert id="insertSelective" parameterType="com.community.huiju.model.TaUser" >
@@ -91,6 +92,9 @@
91 92
       <if test="acceptAgreementStatus != null" >
92 93
         accept_agreement_status,
93 94
       </if>
95
+      <if test="verifyStatus != null">
96
+        verify_status,
97
+      </if>
94 98
       <if test="createUser != null" >
95 99
         create_user,
96 100
       </if>
@@ -144,6 +148,9 @@
144 148
       <if test="acceptAgreementStatus != null" >
145 149
         #{acceptAgreementStatus,jdbcType=CHAR},
146 150
       </if>
151
+      <if test="verifyStatus != null">
152
+        #{verifyStatus,jdbcType=CHAR},
153
+      </if>
147 154
       <if test="createUser != null" >
148 155
         #{createUser,jdbcType=INTEGER},
149 156
       </if>
@@ -197,6 +204,9 @@
197 204
       <if test="acceptAgreementStatus != null" >
198 205
         accept_agreement_status = #{acceptAgreementStatus,jdbcType=CHAR},
199 206
       </if>
207
+      <if test="verifyStatus != null">
208
+        verify_status = #{verifyStatus,jdbcType=CHAR},
209
+      </if>
200 210
       <if test="createUser != null" >
201 211
         create_user = #{createUser,jdbcType=INTEGER},
202 212
       </if>
@@ -226,6 +236,7 @@
226 236
       remark = #{remark,jdbcType=VARCHAR},
227 237
       parent_id = #{parentId,jdbcType=INTEGER},
228 238
       accept_agreement_status = #{acceptAgreementStatus,jdbcType=CHAR},
239
+      verify_status = #{verifyStatus,jdbcType=CHAR},
229 240
       create_user = #{createUser,jdbcType=INTEGER},
230 241
       create_date = #{createDate,jdbcType=TIMESTAMP},
231 242
       update_user = #{updateUser,jdbcType=INTEGER},

+ 16
- 1
CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml Bestand weergeven

@@ -24,6 +24,21 @@
24 24
   <select id="selectByCommunityId" resultMap="BaseResultMap">
25 25
     select
26 26
     <include refid="Base_Column_List"></include>
27
-    from to_banner t where id = #{bannerId} and t.eff_time &lt; #{nowTime} and t.exp_time &gt; #{nowTime} order by t.sort, t.eff_time
27
+    from to_banner t where id = #{bannerId}
28
+    and t.eff_time &lt; #{nowTime}
29
+    and t.exp_time &gt; #{nowTime}
30
+    order by t.sort, t.eff_time
31
+  </select>
32
+
33
+  <select id="selectAllByNum" resultMap="BaseResultMap">
34
+    select
35
+    <include refid="Base_Column_List"></include>
36
+    from to_banner t where t.eff_time &lt; #{nowTime}
37
+    and t.exp_time &gt; #{nowTime}
38
+    order by t.sort, t.eff_time
39
+    <if test="num != null">
40
+      limit #{num}
41
+    </if>
42
+
28 43
   </select>
29 44
 </mapper>

+ 6
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpCarouselSettingMapper.xml Bestand weergeven

@@ -16,6 +16,12 @@
16 16
     from tp_carousel_setting
17 17
     where id = #{id,jdbcType=INTEGER}
18 18
   </select>
19
+  <select id="selectCarouselNum" resultType="java.lang.Integer" parameterType="java.lang.String" >
20
+    select
21
+    carousel_num
22
+    from tp_carousel_setting
23
+    where carousel_type = #{carouselType}
24
+  </select>
19 25
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
20 26
     delete from tp_carousel_setting
21 27
     where id = #{id,jdbcType=INTEGER}

+ 287
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml Bestand weergeven

@@ -0,0 +1,287 @@
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.TpTicketMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTicket" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
8
+    <result column="ticket_title" property="ticketTitle" jdbcType="VARCHAR" />
9
+    <result column="ticket_content" property="ticketContent" jdbcType="VARCHAR" />
10
+    <result column="status" property="status" jdbcType="CHAR" />
11
+    <result column="type" property="type" jdbcType="CHAR" />
12
+    <result column="repair_type" property="repairType" jdbcType="CHAR" />
13
+    <result column="ticket_match_img1" property="ticketMatchImg1" jdbcType="VARCHAR" />
14
+    <result column="ticket_match_img2" property="ticketMatchImg2" jdbcType="VARCHAR" />
15
+    <result column="ticket_match_img3" property="ticketMatchImg3" jdbcType="VARCHAR" />
16
+    <result column="ticket_match_img4" property="ticketMatchImg4" jdbcType="VARCHAR" />
17
+    <result column="ticket_match_img5" property="ticketMatchImg5" jdbcType="VARCHAR" />
18
+    <result column="tp_user_id" property="tpUserId" jdbcType="INTEGER" />
19
+    <result column="score" property="score" jdbcType="VARCHAR" />
20
+    <result column="comment" property="comment" jdbcType="VARCHAR" />
21
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
22
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
23
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
24
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
25
+  </resultMap>
26
+  <sql id="Base_Column_List" >
27
+    id, community_id, ta_user_id, ticket_title, ticket_content, status, type, repair_type, 
28
+    ticket_match_img1, ticket_match_img2, ticket_match_img3, ticket_match_img4, ticket_match_img5, 
29
+    tp_user_id, score, comment, create_user, create_date, update_user, update_date
30
+  </sql>
31
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
32
+    select 
33
+    <include refid="Base_Column_List" />
34
+    from tp_ticket
35
+    where id = #{id,jdbcType=INTEGER}
36
+  </select>
37
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
38
+    delete from tp_ticket
39
+    where id = #{id,jdbcType=INTEGER}
40
+  </delete>
41
+  <insert id="insert" parameterType="com.community.huiju.model.TpTicket" >
42
+    insert into tp_ticket (id, community_id, ta_user_id, 
43
+      ticket_title, ticket_content, status, 
44
+      type, repair_type, ticket_match_img1, 
45
+      ticket_match_img2, ticket_match_img3, ticket_match_img4, 
46
+      ticket_match_img5, tp_user_id, score, 
47
+      comment, create_user, create_date, 
48
+      update_user, update_date)
49
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER}, 
50
+      #{ticketTitle,jdbcType=VARCHAR}, #{ticketContent,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, 
51
+      #{type,jdbcType=CHAR}, #{repairType,jdbcType=CHAR}, #{ticketMatchImg1,jdbcType=VARCHAR}, 
52
+      #{ticketMatchImg2,jdbcType=VARCHAR}, #{ticketMatchImg3,jdbcType=VARCHAR}, #{ticketMatchImg4,jdbcType=VARCHAR}, 
53
+      #{ticketMatchImg5,jdbcType=VARCHAR}, #{tpUserId,jdbcType=INTEGER}, #{score,jdbcType=VARCHAR}, 
54
+      #{comment,jdbcType=VARCHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
55
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
56
+  </insert>
57
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTicket" >
58
+    insert into tp_ticket
59
+    <trim prefix="(" suffix=")" suffixOverrides="," >
60
+      <if test="id != null" >
61
+        id,
62
+      </if>
63
+      <if test="communityId != null" >
64
+        community_id,
65
+      </if>
66
+      <if test="taUserId != null" >
67
+        ta_user_id,
68
+      </if>
69
+      <if test="ticketTitle != null" >
70
+        ticket_title,
71
+      </if>
72
+      <if test="ticketContent != null" >
73
+        ticket_content,
74
+      </if>
75
+      <if test="status != null" >
76
+        status,
77
+      </if>
78
+      <if test="type != null" >
79
+        type,
80
+      </if>
81
+      <if test="repairType != null" >
82
+        repair_type,
83
+      </if>
84
+      <if test="ticketMatchImg1 != null" >
85
+        ticket_match_img1,
86
+      </if>
87
+      <if test="ticketMatchImg2 != null" >
88
+        ticket_match_img2,
89
+      </if>
90
+      <if test="ticketMatchImg3 != null" >
91
+        ticket_match_img3,
92
+      </if>
93
+      <if test="ticketMatchImg4 != null" >
94
+        ticket_match_img4,
95
+      </if>
96
+      <if test="ticketMatchImg5 != null" >
97
+        ticket_match_img5,
98
+      </if>
99
+      <if test="tpUserId != null" >
100
+        tp_user_id,
101
+      </if>
102
+      <if test="score != null" >
103
+        score,
104
+      </if>
105
+      <if test="comment != null" >
106
+        comment,
107
+      </if>
108
+      <if test="createUser != null" >
109
+        create_user,
110
+      </if>
111
+      <if test="createDate != null" >
112
+        create_date,
113
+      </if>
114
+      <if test="updateUser != null" >
115
+        update_user,
116
+      </if>
117
+      <if test="updateDate != null" >
118
+        update_date,
119
+      </if>
120
+    </trim>
121
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
122
+      <if test="id != null" >
123
+        #{id,jdbcType=INTEGER},
124
+      </if>
125
+      <if test="communityId != null" >
126
+        #{communityId,jdbcType=INTEGER},
127
+      </if>
128
+      <if test="taUserId != null" >
129
+        #{taUserId,jdbcType=INTEGER},
130
+      </if>
131
+      <if test="ticketTitle != null" >
132
+        #{ticketTitle,jdbcType=VARCHAR},
133
+      </if>
134
+      <if test="ticketContent != null" >
135
+        #{ticketContent,jdbcType=VARCHAR},
136
+      </if>
137
+      <if test="status != null" >
138
+        #{status,jdbcType=CHAR},
139
+      </if>
140
+      <if test="type != null" >
141
+        #{type,jdbcType=CHAR},
142
+      </if>
143
+      <if test="repairType != null" >
144
+        #{repairType,jdbcType=CHAR},
145
+      </if>
146
+      <if test="ticketMatchImg1 != null" >
147
+        #{ticketMatchImg1,jdbcType=VARCHAR},
148
+      </if>
149
+      <if test="ticketMatchImg2 != null" >
150
+        #{ticketMatchImg2,jdbcType=VARCHAR},
151
+      </if>
152
+      <if test="ticketMatchImg3 != null" >
153
+        #{ticketMatchImg3,jdbcType=VARCHAR},
154
+      </if>
155
+      <if test="ticketMatchImg4 != null" >
156
+        #{ticketMatchImg4,jdbcType=VARCHAR},
157
+      </if>
158
+      <if test="ticketMatchImg5 != null" >
159
+        #{ticketMatchImg5,jdbcType=VARCHAR},
160
+      </if>
161
+      <if test="tpUserId != null" >
162
+        #{tpUserId,jdbcType=INTEGER},
163
+      </if>
164
+      <if test="score != null" >
165
+        #{score,jdbcType=VARCHAR},
166
+      </if>
167
+      <if test="comment != null" >
168
+        #{comment,jdbcType=VARCHAR},
169
+      </if>
170
+      <if test="createUser != null" >
171
+        #{createUser,jdbcType=INTEGER},
172
+      </if>
173
+      <if test="createDate != null" >
174
+        #{createDate,jdbcType=TIMESTAMP},
175
+      </if>
176
+      <if test="updateUser != null" >
177
+        #{updateUser,jdbcType=INTEGER},
178
+      </if>
179
+      <if test="updateDate != null" >
180
+        #{updateDate,jdbcType=TIMESTAMP},
181
+      </if>
182
+    </trim>
183
+  </insert>
184
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTicket" >
185
+    update tp_ticket
186
+    <set >
187
+      <if test="communityId != null" >
188
+        community_id = #{communityId,jdbcType=INTEGER},
189
+      </if>
190
+      <if test="taUserId != null" >
191
+        ta_user_id = #{taUserId,jdbcType=INTEGER},
192
+      </if>
193
+      <if test="ticketTitle != null" >
194
+        ticket_title = #{ticketTitle,jdbcType=VARCHAR},
195
+      </if>
196
+      <if test="ticketContent != null" >
197
+        ticket_content = #{ticketContent,jdbcType=VARCHAR},
198
+      </if>
199
+      <if test="status != null" >
200
+        status = #{status,jdbcType=CHAR},
201
+      </if>
202
+      <if test="type != null" >
203
+        type = #{type,jdbcType=CHAR},
204
+      </if>
205
+      <if test="repairType != null" >
206
+        repair_type = #{repairType,jdbcType=CHAR},
207
+      </if>
208
+      <if test="ticketMatchImg1 != null" >
209
+        ticket_match_img1 = #{ticketMatchImg1,jdbcType=VARCHAR},
210
+      </if>
211
+      <if test="ticketMatchImg2 != null" >
212
+        ticket_match_img2 = #{ticketMatchImg2,jdbcType=VARCHAR},
213
+      </if>
214
+      <if test="ticketMatchImg3 != null" >
215
+        ticket_match_img3 = #{ticketMatchImg3,jdbcType=VARCHAR},
216
+      </if>
217
+      <if test="ticketMatchImg4 != null" >
218
+        ticket_match_img4 = #{ticketMatchImg4,jdbcType=VARCHAR},
219
+      </if>
220
+      <if test="ticketMatchImg5 != null" >
221
+        ticket_match_img5 = #{ticketMatchImg5,jdbcType=VARCHAR},
222
+      </if>
223
+      <if test="tpUserId != null" >
224
+        tp_user_id = #{tpUserId,jdbcType=INTEGER},
225
+      </if>
226
+      <if test="score != null" >
227
+        score = #{score,jdbcType=VARCHAR},
228
+      </if>
229
+      <if test="comment != null" >
230
+        comment = #{comment,jdbcType=VARCHAR},
231
+      </if>
232
+      <if test="createUser != null" >
233
+        create_user = #{createUser,jdbcType=INTEGER},
234
+      </if>
235
+      <if test="createDate != null" >
236
+        create_date = #{createDate,jdbcType=TIMESTAMP},
237
+      </if>
238
+      <if test="updateUser != null" >
239
+        update_user = #{updateUser,jdbcType=INTEGER},
240
+      </if>
241
+      <if test="updateDate != null" >
242
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
243
+      </if>
244
+    </set>
245
+    where id = #{id,jdbcType=INTEGER}
246
+  </update>
247
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTicket" >
248
+    update tp_ticket
249
+    set community_id = #{communityId,jdbcType=INTEGER},
250
+      ta_user_id = #{taUserId,jdbcType=INTEGER},
251
+      ticket_title = #{ticketTitle,jdbcType=VARCHAR},
252
+      ticket_content = #{ticketContent,jdbcType=VARCHAR},
253
+      status = #{status,jdbcType=CHAR},
254
+      type = #{type,jdbcType=CHAR},
255
+      repair_type = #{repairType,jdbcType=CHAR},
256
+      ticket_match_img1 = #{ticketMatchImg1,jdbcType=VARCHAR},
257
+      ticket_match_img2 = #{ticketMatchImg2,jdbcType=VARCHAR},
258
+      ticket_match_img3 = #{ticketMatchImg3,jdbcType=VARCHAR},
259
+      ticket_match_img4 = #{ticketMatchImg4,jdbcType=VARCHAR},
260
+      ticket_match_img5 = #{ticketMatchImg5,jdbcType=VARCHAR},
261
+      tp_user_id = #{tpUserId,jdbcType=INTEGER},
262
+      score = #{score,jdbcType=VARCHAR},
263
+      comment = #{comment,jdbcType=VARCHAR},
264
+      create_user = #{createUser,jdbcType=INTEGER},
265
+      create_date = #{createDate,jdbcType=TIMESTAMP},
266
+      update_user = #{updateUser,jdbcType=INTEGER},
267
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
268
+    where id = #{id,jdbcType=INTEGER}
269
+  </update>
270
+
271
+  <select id="selectByCommuniytIdAndByTaUserIdAndByType" parameterType="map" resultMap="BaseResultMap" >
272
+    select
273
+    <include refid="Base_Column_List" />
274
+    from tp_ticket
275
+      <trim prefix="where" prefixOverrides="and">
276
+        <if test="communityId != null" >
277
+          and community_id = #{communityId,jdbcType=INTEGER}
278
+        </if>
279
+        <if test="taUserId != null" >
280
+          and ta_user_id = #{taUserId,jdbcType=INTEGER}
281
+        </if>
282
+        <if test="type != null" >
283
+          and type = #{type,jdbcType=CHAR}
284
+        </if>
285
+      </trim>
286
+  </select>
287
+</mapper>

+ 160
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordCommentMapper.xml Bestand weergeven

@@ -0,0 +1,160 @@
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.TpTicketRecordCommentMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTicketRecordComment" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="ticker_id" property="tickerId" jdbcType="INTEGER" />
8
+    <result column="ticket_record_id" property="ticketRecordId" jdbcType="INTEGER" />
9
+    <result column="uuid" property="uuid" jdbcType="INTEGER" />
10
+    <result column="user_type" property="userType" jdbcType="CHAR" />
11
+    <result column="content" property="content" jdbcType="VARCHAR" />
12
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
13
+    <result column="user_name" property="userName" jdbcType="VARCHAR" />
14
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
15
+  </resultMap>
16
+  <sql id="Base_Column_List" >
17
+    id, community_id, ticker_id, ticket_record_id, uuid, user_type, content, parent_id, 
18
+    user_name, create_date
19
+  </sql>
20
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
+    select 
22
+    <include refid="Base_Column_List" />
23
+    from tp_ticket_record_comment
24
+    where id = #{id,jdbcType=INTEGER}
25
+  </select>
26
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
27
+    delete from tp_ticket_record_comment
28
+    where id = #{id,jdbcType=INTEGER}
29
+  </delete>
30
+  <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecordComment" >
31
+    insert into tp_ticket_record_comment (id, community_id, ticker_id, 
32
+      ticket_record_id, uuid, user_type, 
33
+      content, parent_id, user_name, 
34
+      create_date)
35
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{tickerId,jdbcType=INTEGER}, 
36
+      #{ticketRecordId,jdbcType=INTEGER}, #{uuid,jdbcType=INTEGER}, #{userType,jdbcType=CHAR}, 
37
+      #{content,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, 
38
+      #{createDate,jdbcType=TIMESTAMP})
39
+  </insert>
40
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTicketRecordComment" >
41
+    insert into tp_ticket_record_comment
42
+    <trim prefix="(" suffix=")" suffixOverrides="," >
43
+      <if test="id != null" >
44
+        id,
45
+      </if>
46
+      <if test="communityId != null" >
47
+        community_id,
48
+      </if>
49
+      <if test="tickerId != null" >
50
+        ticker_id,
51
+      </if>
52
+      <if test="ticketRecordId != null" >
53
+        ticket_record_id,
54
+      </if>
55
+      <if test="uuid != null" >
56
+        uuid,
57
+      </if>
58
+      <if test="userType != null" >
59
+        user_type,
60
+      </if>
61
+      <if test="content != null" >
62
+        content,
63
+      </if>
64
+      <if test="parentId != null" >
65
+        parent_id,
66
+      </if>
67
+      <if test="userName != null" >
68
+        user_name,
69
+      </if>
70
+      <if test="createDate != null" >
71
+        create_date,
72
+      </if>
73
+    </trim>
74
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
75
+      <if test="id != null" >
76
+        #{id,jdbcType=INTEGER},
77
+      </if>
78
+      <if test="communityId != null" >
79
+        #{communityId,jdbcType=INTEGER},
80
+      </if>
81
+      <if test="tickerId != null" >
82
+        #{tickerId,jdbcType=INTEGER},
83
+      </if>
84
+      <if test="ticketRecordId != null" >
85
+        #{ticketRecordId,jdbcType=INTEGER},
86
+      </if>
87
+      <if test="uuid != null" >
88
+        #{uuid,jdbcType=INTEGER},
89
+      </if>
90
+      <if test="userType != null" >
91
+        #{userType,jdbcType=CHAR},
92
+      </if>
93
+      <if test="content != null" >
94
+        #{content,jdbcType=VARCHAR},
95
+      </if>
96
+      <if test="parentId != null" >
97
+        #{parentId,jdbcType=INTEGER},
98
+      </if>
99
+      <if test="userName != null" >
100
+        #{userName,jdbcType=VARCHAR},
101
+      </if>
102
+      <if test="createDate != null" >
103
+        #{createDate,jdbcType=TIMESTAMP},
104
+      </if>
105
+    </trim>
106
+  </insert>
107
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTicketRecordComment" >
108
+    update tp_ticket_record_comment
109
+    <set >
110
+      <if test="communityId != null" >
111
+        community_id = #{communityId,jdbcType=INTEGER},
112
+      </if>
113
+      <if test="tickerId != null" >
114
+        ticker_id = #{tickerId,jdbcType=INTEGER},
115
+      </if>
116
+      <if test="ticketRecordId != null" >
117
+        ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
118
+      </if>
119
+      <if test="uuid != null" >
120
+        uuid = #{uuid,jdbcType=INTEGER},
121
+      </if>
122
+      <if test="userType != null" >
123
+        user_type = #{userType,jdbcType=CHAR},
124
+      </if>
125
+      <if test="content != null" >
126
+        content = #{content,jdbcType=VARCHAR},
127
+      </if>
128
+      <if test="parentId != null" >
129
+        parent_id = #{parentId,jdbcType=INTEGER},
130
+      </if>
131
+      <if test="userName != null" >
132
+        user_name = #{userName,jdbcType=VARCHAR},
133
+      </if>
134
+      <if test="createDate != null" >
135
+        create_date = #{createDate,jdbcType=TIMESTAMP},
136
+      </if>
137
+    </set>
138
+    where id = #{id,jdbcType=INTEGER}
139
+  </update>
140
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTicketRecordComment" >
141
+    update tp_ticket_record_comment
142
+    set community_id = #{communityId,jdbcType=INTEGER},
143
+      ticker_id = #{tickerId,jdbcType=INTEGER},
144
+      ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
145
+      uuid = #{uuid,jdbcType=INTEGER},
146
+      user_type = #{userType,jdbcType=CHAR},
147
+      content = #{content,jdbcType=VARCHAR},
148
+      parent_id = #{parentId,jdbcType=INTEGER},
149
+      user_name = #{userName,jdbcType=VARCHAR},
150
+      create_date = #{createDate,jdbcType=TIMESTAMP}
151
+    where id = #{id,jdbcType=INTEGER}
152
+  </update>
153
+
154
+  <select id="selectByTicketId" parameterType="map" resultMap="BaseResultMap" >
155
+    select ttrc.* from tp_ticket tp
156
+                inner join tp_ticket_record ttr on tp.id = ttr.ticket_id
157
+                inner join tp_ticket_record_comment ttrc on ttr.ticket_id = ttrc.ticket_record_id
158
+    where tp.id=#{tickerId,jdbcType=INTEGER} order by ttrc.create_date DESC LIMIT #{size,jdbcType=INTEGER}
159
+  </select>
160
+</mapper>

+ 106
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml Bestand weergeven

@@ -0,0 +1,106 @@
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.TpTicketRecordMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTicketRecord" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="ticket_id" property="ticketId" jdbcType="INTEGER" />
8
+    <result column="status" property="status" jdbcType="CHAR" />
9
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
10
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11
+  </resultMap>
12
+  <sql id="Base_Column_List" >
13
+    id, community_id, ticket_id, status, create_user, create_date
14
+  </sql>
15
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
16
+    select 
17
+    <include refid="Base_Column_List" />
18
+    from tp_ticket_record
19
+    where id = #{id,jdbcType=INTEGER}
20
+  </select>
21
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
22
+    delete from tp_ticket_record
23
+    where id = #{id,jdbcType=INTEGER}
24
+  </delete>
25
+  <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecord" >
26
+    insert into tp_ticket_record (id, community_id, ticket_id, 
27
+      status, create_user, create_date
28
+      )
29
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{ticketId,jdbcType=INTEGER}, 
30
+      #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}
31
+      )
32
+  </insert>
33
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTicketRecord" >
34
+    insert into tp_ticket_record
35
+    <trim prefix="(" suffix=")" suffixOverrides="," >
36
+      <if test="id != null" >
37
+        id,
38
+      </if>
39
+      <if test="communityId != null" >
40
+        community_id,
41
+      </if>
42
+      <if test="ticketId != null" >
43
+        ticket_id,
44
+      </if>
45
+      <if test="status != null" >
46
+        status,
47
+      </if>
48
+      <if test="createUser != null" >
49
+        create_user,
50
+      </if>
51
+      <if test="createDate != null" >
52
+        create_date,
53
+      </if>
54
+    </trim>
55
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
56
+      <if test="id != null" >
57
+        #{id,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="communityId != null" >
60
+        #{communityId,jdbcType=INTEGER},
61
+      </if>
62
+      <if test="ticketId != null" >
63
+        #{ticketId,jdbcType=INTEGER},
64
+      </if>
65
+      <if test="status != null" >
66
+        #{status,jdbcType=CHAR},
67
+      </if>
68
+      <if test="createUser != null" >
69
+        #{createUser,jdbcType=INTEGER},
70
+      </if>
71
+      <if test="createDate != null" >
72
+        #{createDate,jdbcType=TIMESTAMP},
73
+      </if>
74
+    </trim>
75
+  </insert>
76
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTicketRecord" >
77
+    update tp_ticket_record
78
+    <set >
79
+      <if test="communityId != null" >
80
+        community_id = #{communityId,jdbcType=INTEGER},
81
+      </if>
82
+      <if test="ticketId != null" >
83
+        ticket_id = #{ticketId,jdbcType=INTEGER},
84
+      </if>
85
+      <if test="status != null" >
86
+        status = #{status,jdbcType=CHAR},
87
+      </if>
88
+      <if test="createUser != null" >
89
+        create_user = #{createUser,jdbcType=INTEGER},
90
+      </if>
91
+      <if test="createDate != null" >
92
+        create_date = #{createDate,jdbcType=TIMESTAMP},
93
+      </if>
94
+    </set>
95
+    where id = #{id,jdbcType=INTEGER}
96
+  </update>
97
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTicketRecord" >
98
+    update tp_ticket_record
99
+    set community_id = #{communityId,jdbcType=INTEGER},
100
+      ticket_id = #{ticketId,jdbcType=INTEGER},
101
+      status = #{status,jdbcType=CHAR},
102
+      create_user = #{createUser,jdbcType=INTEGER},
103
+      create_date = #{createDate,jdbcType=TIMESTAMP}
104
+    where id = #{id,jdbcType=INTEGER}
105
+  </update>
106
+</mapper>

+ 8
- 1
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Bestand weergeven

@@ -23,7 +23,13 @@ public class Constant {
23 23
 
24 24
     /** 请求发送验证码的远程服务器地址 **/
25 25
     public static final String REQUEST_URL = "http://micservice.ycjcjy.com/sms";
26
-    
26
+
27
+    /** 本地缓存过期时间 单位秒 **/
28
+    public static final Long CACHE_EXPIRE = 60L;
29
+
30
+    /** 本地緩存最大个数 **/
31
+    public static final Long CACHE_SIZE = 1000L;
32
+
27 33
     /** 住户APP端消息 **/
28 34
     public static final Integer MODEL_TYPE_NEWS = 1;
29 35
     
@@ -38,4 +44,5 @@ public class Constant {
38 44
 
39 45
     /** 社交二手租赁类型**/
40 46
     public static final String LEASE = "lease";
47
+
41 48
 }

BIN
CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class Bestand weergeven


+ 3
- 0
CODE/smart-community/zuul/src/main/resources/bootstrap.yml Bestand weergeven

@@ -24,3 +24,6 @@ eureka:
24 24
     service-url:
25 25
       defaultZone: http://localhost:8080/eureka/
26 26
 
27
+zuul:
28
+  host:
29
+    connect-timeout-millis: 200000

BIN
文档/需求/app接口需求-第二版.xlsx Bestand weergeven