张延森 преди 3 години
родител
ревизия
18b252db6d
променени са 65 файла, в които са добавени 1423 реда и са изтрити 109 реда
  1. 8
    0
      src/main/java/com/yunzhi/shigongli/common/Callback.java
  2. 9
    3
      src/main/java/com/yunzhi/shigongli/common/Constants.java
  3. 4
    1
      src/main/java/com/yunzhi/shigongli/common/CurrentContext.java
  4. 4
    0
      src/main/java/com/yunzhi/shigongli/common/ResponseBean.java
  5. 4
    8
      src/main/java/com/yunzhi/shigongli/controller/TaHotelWorkerController.java
  6. 163
    0
      src/main/java/com/yunzhi/shigongli/controller/TaNotificationController.java
  7. 54
    6
      src/main/java/com/yunzhi/shigongli/controller/TaShopController.java
  8. 15
    14
      src/main/java/com/yunzhi/shigongli/controller/TaShopPackageController.java
  9. 3
    6
      src/main/java/com/yunzhi/shigongli/controller/TaShopWorkerController.java
  10. 41
    11
      src/main/java/com/yunzhi/shigongli/controller/TaTouristController.java
  11. 23
    18
      src/main/java/com/yunzhi/shigongli/controller/TdCityController.java
  12. 22
    19
      src/main/java/com/yunzhi/shigongli/controller/TdDietMarkController.java
  13. 53
    0
      src/main/java/com/yunzhi/shigongli/entity/TaNotification.java
  14. 22
    5
      src/main/java/com/yunzhi/shigongli/entity/TaShop.java
  15. 1
    1
      src/main/java/com/yunzhi/shigongli/entity/TaShopPackageSetting.java
  16. 42
    0
      src/main/java/com/yunzhi/shigongli/entity/TaTargetDietMark.java
  17. 50
    0
      src/main/java/com/yunzhi/shigongli/entity/TaTargetQuota.java
  18. 43
    0
      src/main/java/com/yunzhi/shigongli/entity/TaTargetType.java
  19. 14
    9
      src/main/java/com/yunzhi/shigongli/entity/TaTourist.java
  20. 9
    0
      src/main/java/com/yunzhi/shigongli/entity/TdCity.java
  21. 4
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaHotelWorkerMapper.java
  22. 18
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaNotificationMapper.java
  23. 2
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaShopMapper.java
  24. 4
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaShopPackageMapper.java
  25. 4
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaShopWorkerMapper.java
  26. 22
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaTargetDietMarkMapper.java
  27. 20
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaTargetQuotaMapper.java
  28. 18
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaTargetTypeMapper.java
  29. 3
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaTouristMapper.java
  30. 2
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaUvMapper.java
  31. 3
    0
      src/main/java/com/yunzhi/shigongli/service/ITaHotelWorkerService.java
  32. 16
    0
      src/main/java/com/yunzhi/shigongli/service/ITaNotificationService.java
  33. 3
    0
      src/main/java/com/yunzhi/shigongli/service/ITaPvService.java
  34. 3
    0
      src/main/java/com/yunzhi/shigongli/service/ITaShopImagesService.java
  35. 9
    0
      src/main/java/com/yunzhi/shigongli/service/ITaShopPackageService.java
  36. 2
    0
      src/main/java/com/yunzhi/shigongli/service/ITaShopService.java
  37. 3
    0
      src/main/java/com/yunzhi/shigongli/service/ITaShopWorkerService.java
  38. 16
    0
      src/main/java/com/yunzhi/shigongli/service/ITaTargetDietMarkService.java
  39. 20
    0
      src/main/java/com/yunzhi/shigongli/service/ITaTargetQuotaService.java
  40. 21
    0
      src/main/java/com/yunzhi/shigongli/service/ITaTargetTypeService.java
  41. 5
    0
      src/main/java/com/yunzhi/shigongli/service/ITaTouristService.java
  42. 10
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaHotelWorkerServiceImpl.java
  43. 19
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaNotificationServiceImpl.java
  44. 11
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaPvServiceImpl.java
  45. 37
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaShopImagesServiceImpl.java
  46. 125
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaShopPackageServiceImpl.java
  47. 52
    4
      src/main/java/com/yunzhi/shigongli/service/impl/TaShopServiceImpl.java
  48. 10
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaShopWorkerServiceImpl.java
  49. 19
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaTargetDietMarkServiceImpl.java
  50. 73
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaTargetQuotaServiceImpl.java
  51. 61
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaTargetTypeServiceImpl.java
  52. 27
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaTouristServiceImpl.java
  53. 18
    0
      src/main/java/com/yunzhi/shigongli/vo/HotelWorkerListVO.java
  54. 31
    0
      src/main/java/com/yunzhi/shigongli/vo/ShopPackageVO.java
  55. 17
    0
      src/main/java/com/yunzhi/shigongli/vo/ShopWorkerListVO.java
  56. 16
    0
      src/main/resources/mapper/TaHotelWorkerMapper.xml
  57. 5
    0
      src/main/resources/mapper/TaNotificationMapper.xml
  58. 10
    4
      src/main/resources/mapper/TaShopMapper.xml
  59. 19
    0
      src/main/resources/mapper/TaShopPackageMapper.xml
  60. 16
    0
      src/main/resources/mapper/TaShopWorkerMapper.xml
  61. 16
    0
      src/main/resources/mapper/TaTargetDietMarkMapper.xml
  62. 12
    0
      src/main/resources/mapper/TaTargetQuotaMapper.xml
  63. 5
    0
      src/main/resources/mapper/TaTargetTypeMapper.xml
  64. 22
    0
      src/main/resources/mapper/TaTouristMapper.xml
  65. 10
    0
      src/main/resources/mapper/TaUvMapper.xml

+ 8
- 0
src/main/java/com/yunzhi/shigongli/common/Callback.java Целия файл

@@ -0,0 +1,8 @@
1
+package com.yunzhi.shigongli.common;
2
+
3
+/**
4
+ * 实现类似 JS 回调函数的功能
5
+ */
6
+public abstract class Callback {
7
+    public abstract void next() throws Exception;
8
+}

+ 9
- 3
src/main/java/com/yunzhi/shigongli/common/Constants.java Целия файл

@@ -33,9 +33,15 @@ public class Constants {
33 33
     public final static String ACCOUNT_SETTLEMENT = "settlement";   // 佣金结算
34 34
 
35 35
     // 系统模块
36
-    public final static String TARGET_ORDER = "order";  // 订单
37
-    public final static String TARGET_HOTEL = "hotel";  // 民宿
38
-    public final static String TARGET_SHOP = "shop";    // 商铺
36
+    public final static String TARGET_ORDER = "order";                  // 订单
37
+    public final static String TARGET_HOTEL = "hotel";                  // 民宿
38
+    public final static String TARGET_SHOP = "shop";                    // 商铺
39
+    public final static String TARGET_SHOP_PACKAGE = "shop_package";    // 商铺套餐
40
+    public final static String TARGET_TOURIST = "tourist";                // 景点
41
+
42
+    // 商品套餐类型
43
+    public final static String PACKAGE_NORMAL = "normal";           // 普通套餐
44
+    public final static String PACKAGE_CASH = "cash_coupon";        // 现金抵用券
39 45
 
40 46
     // 推荐人类型
41 47
     public final static String RECOMMEND_SHOP = "shop";     // 商铺

+ 4
- 1
src/main/java/com/yunzhi/shigongli/common/CurrentContext.java Целия файл

@@ -14,9 +14,12 @@ public class CurrentContext {
14 14
         tokenParamHolder.set(tokenParam);
15 15
     }
16 16
 
17
+    public static void clear() {
18
+        tokenParamHolder.remove();
19
+    }
20
+
17 21
     public static Map<String, Object> getTokenParam() {
18 22
         Map<String, Object> params = tokenParamHolder.get();
19
-        tokenParamHolder.remove();
20 23
         return params;
21 24
     }
22 25
 }

+ 4
- 0
src/main/java/com/yunzhi/shigongli/common/ResponseBean.java Целия файл

@@ -39,6 +39,8 @@ public class ResponseBean<T> implements Serializable {
39 39
             responseBean.message = msgs[0];
40 40
         }
41 41
 
42
+        CurrentContext.clear();
43
+
42 44
         return responseBean;
43 45
     }
44 46
 
@@ -56,6 +58,8 @@ public class ResponseBean<T> implements Serializable {
56 58
             responseBean.data = datas[0];
57 59
         }
58 60
 
61
+        CurrentContext.clear();
62
+
59 63
         return responseBean;
60 64
     }
61 65
 

+ 4
- 8
src/main/java/com/yunzhi/shigongli/controller/TaHotelWorkerController.java Целия файл

@@ -7,6 +7,7 @@ import com.yunzhi.shigongli.common.BaseController;
7 7
 import com.yunzhi.shigongli.common.Constants;
8 8
 import com.yunzhi.shigongli.common.ResponseBean;
9 9
 import com.yunzhi.shigongli.common.StringUtils;
10
+import com.yunzhi.shigongli.vo.HotelWorkerListVO;
10 11
 import io.swagger.annotations.Api;
11 12
 import io.swagger.annotations.ApiOperation;
12 13
 import io.swagger.annotations.ApiParam;
@@ -49,18 +50,13 @@ public class TaHotelWorkerController extends BaseController {
49 50
      * @return
50 51
      */
51 52
     @RequestMapping(value="/admin/taHotelWorker",method= RequestMethod.GET)
52
-    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
53
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = HotelWorkerListVO.class)
53 54
     public ResponseBean taHotelWorkerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
54 55
                                           @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
55 56
                                           @ApiParam("民宿ID") @RequestParam(value ="hotelId", required = false) String hotelId) throws Exception{
56 57
 
57
-        IPage<TaHotelWorker> pg = new Page<>(pageNum, pageSize);
58
-        QueryWrapper<TaHotelWorker> queryWrapper = new QueryWrapper<>();
59
-        queryWrapper.eq(!StringUtils.isEmpty(hotelId), "hotel_id", hotelId);
60
-        queryWrapper.gt("status", Constants.STATUS_DELETED);
61
-        queryWrapper.orderByDesc("create_date");
62
-
63
-        IPage<TaHotelWorker> result = iTaHotelWorkerService.page(pg, queryWrapper);
58
+        IPage<HotelWorkerListVO> pg = new Page<>(pageNum, pageSize);
59
+        IPage<HotelWorkerListVO> result = iTaHotelWorkerService.getPagedListBy(pg, hotelId);
64 60
         return ResponseBean.success(result);
65 61
     }
66 62
 

+ 163
- 0
src/main/java/com/yunzhi/shigongli/controller/TaNotificationController.java Целия файл

@@ -0,0 +1,163 @@
1
+package com.yunzhi.shigongli.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.shigongli.common.BaseController;
7
+import com.yunzhi.shigongli.common.Constants;
8
+import com.yunzhi.shigongli.common.ResponseBean;
9
+import com.yunzhi.shigongli.common.StringUtils;
10
+import com.yunzhi.shigongli.entity.TaNotification;
11
+import com.yunzhi.shigongli.service.ITaNotificationService;
12
+import io.swagger.annotations.Api;
13
+import io.swagger.annotations.ApiOperation;
14
+import io.swagger.annotations.ApiParam;
15
+import org.slf4j.Logger;
16
+import org.slf4j.LoggerFactory;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.web.bind.annotation.*;
19
+
20
+/**
21
+ * <p>
22
+    * 通知公告 前端控制器
23
+    * </p>
24
+ *
25
+ * @author yansen
26
+ * @since 2021-08-17
27
+ */
28
+
29
+@Api(tags = "通知公告")
30
+@RestController
31
+@RequestMapping("/")
32
+public class TaNotificationController extends BaseController {
33
+
34
+    private final Logger logger = LoggerFactory.getLogger(TaNotificationController.class);
35
+
36
+    @Autowired
37
+    public ITaNotificationService iTaNotificationService;
38
+
39
+
40
+    /**
41
+     * 分页查询列表
42
+     * @param pageNum
43
+     * @param pageSize
44
+     * @return
45
+     */
46
+    @RequestMapping(value="/{plat}/notification",method= RequestMethod.GET)
47
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
48
+    public ResponseBean taPvList(@ApiParam(value = "客户端", allowableValues = "wx,admin") String client,
49
+                                 @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
50
+                                 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
51
+                                 @ApiParam(value = "发布状态") @RequestParam(value ="status", required = false) Integer status) throws Exception{
52
+
53
+        IPage<TaNotification> pg = new Page<>(pageNum, pageSize);
54
+        QueryWrapper<TaNotification> queryWrapper = new QueryWrapper<>();
55
+        queryWrapper.eq("wx".equals(client), "status", Constants.STATUS_NORMAL);
56
+        queryWrapper.eq(null != status && "admin".equals(client), "status", status);
57
+        queryWrapper.gt(null == status && "admin".equals(client), "status", Constants.STATUS_DELETED);
58
+        queryWrapper.orderByDesc("weight");
59
+        queryWrapper.orderByDesc("create_date");
60
+
61
+        IPage<TaNotification> result = iTaNotificationService.page(pg, queryWrapper);
62
+        return ResponseBean.success(result);
63
+    }
64
+
65
+    /**
66
+     * 保存对象
67
+     * @param taNotification 实体对象
68
+     * @return
69
+     */
70
+    @RequestMapping(value="/admin/notification",method= RequestMethod.POST)
71
+    @ApiOperation(value="新增通知公告", notes = "新增通知公告", httpMethod = "POST", response = ResponseBean.class)
72
+    public ResponseBean taPvAdd(@ApiParam("保存内容") @RequestBody TaNotification taNotification) throws Exception{
73
+
74
+        if (null == taNotification || StringUtils.isEmpty(taNotification.getContent())) {
75
+            return ResponseBean.error("通知内容不能为空", ResponseBean.ERROR_ILLEGAL_PARAMS);
76
+        }
77
+
78
+        taNotification.setStatus(Constants.STATUS_READY);
79
+
80
+        if (iTaNotificationService.save(taNotification)){
81
+            return ResponseBean.success(taNotification);
82
+        }else {
83
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 根据id删除对象
89
+     * @param id  实体ID
90
+     */
91
+    @RequestMapping(value="/admin/notification/{id}", method= RequestMethod.DELETE)
92
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
93
+    public ResponseBean taPvDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
94
+        if(iTaNotificationService.removeLogicById(id)){
95
+            return ResponseBean.success("success");
96
+        }else {
97
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
98
+        }
99
+    }
100
+
101
+    /**
102
+     * 修改对象
103
+     * @param id  实体ID
104
+     * @param taNotification 实体对象
105
+     * @return
106
+     */
107
+    @RequestMapping(value="/admin/notification/{id}",method= RequestMethod.PUT)
108
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
109
+    public ResponseBean taPvUpdate(@ApiParam("对象ID") @PathVariable String id,
110
+                                        @ApiParam("更新内容") @RequestBody TaNotification taNotification) throws Exception {
111
+        if (null == taNotification || StringUtils.isEmpty(taNotification.getContent())) {
112
+            return ResponseBean.error("通知内容不能为空", ResponseBean.ERROR_ILLEGAL_PARAMS);
113
+        }
114
+
115
+        // 只允许修改内容
116
+        TaNotification notification = iTaNotificationService.getById(id);
117
+        notification.setContent(taNotification.getContent());
118
+
119
+        if (iTaNotificationService.updateById(notification)){
120
+            return ResponseBean.success(notification);
121
+        }else {
122
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
123
+        }
124
+    }
125
+
126
+    /**
127
+     * 发布通知公告
128
+     * @param id  实体ID
129
+     * @return
130
+     */
131
+    @RequestMapping(value="/admin/notification/{id}/publish",method= RequestMethod.PUT)
132
+    @ApiOperation(value="发布通知公告", notes = "发布通知公告", httpMethod = "PUT", response = ResponseBean.class)
133
+    public ResponseBean publish(@ApiParam("对象ID") @PathVariable String id) throws Exception {
134
+
135
+        TaNotification notification = iTaNotificationService.getById(id);
136
+        notification.setStatus(Constants.STATUS_NORMAL);
137
+
138
+        if (iTaNotificationService.updateById(notification)){
139
+            return ResponseBean.success(notification);
140
+        }else {
141
+            return ResponseBean.error("发布失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
142
+        }
143
+    }
144
+
145
+    /**
146
+     * 取消发布通知公告
147
+     * @param id  实体ID
148
+     * @return
149
+     */
150
+    @RequestMapping(value="/admin/notification/{id}/unPublish",method= RequestMethod.PUT)
151
+    @ApiOperation(value="取消发布通知公告", notes = "取消发布通知公告", httpMethod = "PUT", response = ResponseBean.class)
152
+    public ResponseBean unPublish(@ApiParam("对象ID") @PathVariable String id) throws Exception {
153
+
154
+        TaNotification notification = iTaNotificationService.getById(id);
155
+        notification.setStatus(Constants.STATUS_READY);
156
+
157
+        if (iTaNotificationService.updateById(notification)){
158
+            return ResponseBean.success(notification);
159
+        }else {
160
+            return ResponseBean.error("取消发布失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
161
+        }
162
+    }
163
+}

+ 54
- 6
src/main/java/com/yunzhi/shigongli/controller/TaShopController.java Целия файл

@@ -1,10 +1,13 @@
1 1
 package com.yunzhi.shigongli.controller;
2 2
 
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 5
 import com.yunzhi.shigongli.common.BaseController;
6
+import com.yunzhi.shigongli.common.Constants;
7
+import com.yunzhi.shigongli.common.Callback;
7 8
 import com.yunzhi.shigongli.common.ResponseBean;
9
+import com.yunzhi.shigongli.entity.*;
10
+import com.yunzhi.shigongli.service.*;
8 11
 import com.yunzhi.shigongli.vo.ShopListVO;
9 12
 import io.swagger.annotations.Api;
10 13
 import io.swagger.annotations.ApiOperation;
@@ -17,10 +20,10 @@ import org.springframework.web.bind.annotation.RequestBody;
17 20
 import org.springframework.web.bind.annotation.RequestMapping;
18 21
 import org.springframework.web.bind.annotation.RequestMethod;
19 22
 import org.springframework.web.bind.annotation.RequestParam;
20
-import com.yunzhi.shigongli.service.ITaShopService;
21
-import com.yunzhi.shigongli.entity.TaShop;
22 23
 import org.springframework.web.bind.annotation.RestController;
23 24
 
25
+import java.time.LocalDateTime;
26
+
24 27
 /**
25 28
  * <p>
26 29
     * 商铺 前端控制器
@@ -41,6 +44,19 @@ public class TaShopController extends BaseController {
41 44
     public ITaShopService iTaShopService;
42 45
 
43 46
 
47
+    @Autowired
48
+    public ITaShopImagesService shopImagesService;
49
+
50
+    @Autowired
51
+    public ITaTargetTypeService taTargetTypeService;
52
+
53
+    @Autowired
54
+    public ITaPvService iTaPvService;
55
+
56
+    @Autowired
57
+    public ITaTargetQuotaService targetQuotaService;
58
+
59
+
44 60
     /**
45 61
      * 分页查询列表
46 62
      * @param pageNum
@@ -70,6 +86,7 @@ public class TaShopController extends BaseController {
70 86
 
71 87
         try {
72 88
             iTaShopService.createNew(taShop);
89
+            shopImagesService.updateImages(taShop.getShopId(), taShop.getImageList());
73 90
         } catch (Exception e) {
74 91
             e.printStackTrace();
75 92
             return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
@@ -104,6 +121,15 @@ public class TaShopController extends BaseController {
104 121
                                         @ApiParam("更新内容") @RequestBody TaShop taShop) throws Exception{
105 122
 
106 123
         if (iTaShopService.updateById(taShop)){
124
+            shopImagesService.updateImages(taShop.getShopId(), taShop.getImageList());
125
+            taTargetTypeService.updateTypes(Constants.TARGET_SHOP, taShop.getShopId(), taShop.getTypeList());
126
+
127
+            TaTargetQuota taTargetQuota = targetQuotaService.getByTarget(Constants.TARGET_SHOP, id);
128
+            taTargetQuota.setUvNum(taShop.getUvNum());
129
+            taTargetQuota.setPvNum(taShop.getPvNum());
130
+            taTargetQuota.setLikeNum(taShop.getLikeNum());
131
+
132
+            targetQuotaService.updateById(taTargetQuota);
107 133
             return ResponseBean.success(iTaShopService.getById(id));
108 134
         }else {
109 135
             return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
@@ -114,9 +140,31 @@ public class TaShopController extends BaseController {
114 140
      * 根据id查询对象
115 141
      * @param id  实体ID
116 142
      */
117
-    @RequestMapping(value="/admin/taShop/{id}",method= RequestMethod.GET)
143
+    @RequestMapping(value="/{plat}/taShop/{id}",method= RequestMethod.GET)
118 144
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
119
-    public ResponseBean taShopGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
120
-        return ResponseBean.success(iTaShopService.getById(id));
145
+    public ResponseBean taShopGet(@ApiParam(value = "客户端", allowableValues = "wx,admin") @PathVariable String plat,
146
+                                  @ApiParam("对象ID") @PathVariable String id) throws Exception {
147
+        TaShop taShop = iTaShopService.getById(id);
148
+        if (Constants.STATUS_DELETED.equals(taShop.getStatus())) {
149
+            return ResponseBean.error("当前商铺信息不存在", ResponseBean.ERROR_ILLEGAL_PARAMS);
150
+        }
151
+
152
+        TaTargetQuota taTargetQuota = targetQuotaService.getByTarget(Constants.TARGET_SHOP, id);
153
+        taShop.setPvNum(taTargetQuota.getPvNum());
154
+        taShop.setUvNum(taTargetQuota.getUvNum());
155
+        taShop.setLikeNum(taTargetQuota.getLikeNum());
156
+        taShop.setImageList(shopImagesService.getBy(TaShopImages::getShopId, id));
157
+        taShop.setTypeList(taTargetTypeService.getListBy(Constants.TARGET_SHOP, id));
158
+        
159
+        if ("wx".equals(plat)) {
160
+            try {
161
+                targetQuotaService.recordPerson(Constants.TARGET_SHOP, id, getCurrentPerson());
162
+            } catch (Exception e) {
163
+                e.printStackTrace();
164
+            }
165
+        }
166
+
167
+        return ResponseBean.success(taShop);
121 168
     }
169
+
122 170
 }

+ 15
- 14
src/main/java/com/yunzhi/shigongli/controller/TaShopPackageController.java Целия файл

@@ -6,11 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.yunzhi.shigongli.common.BaseController;
7 7
 import com.yunzhi.shigongli.common.Constants;
8 8
 import com.yunzhi.shigongli.common.ResponseBean;
9
+import com.yunzhi.shigongli.entity.TaShopPackageSetting;
10
+import com.yunzhi.shigongli.vo.ShopPackageVO;
9 11
 import io.swagger.annotations.Api;
10 12
 import io.swagger.annotations.ApiOperation;
11 13
 import io.swagger.annotations.ApiParam;
12 14
 import org.slf4j.Logger;
13 15
 import org.slf4j.LoggerFactory;
16
+import org.springframework.beans.BeanUtils;
14 17
 import org.springframework.beans.factory.annotation.Autowired;
15 18
 import org.springframework.web.bind.annotation.PathVariable;
16 19
 import org.springframework.web.bind.annotation.RequestBody;
@@ -54,26 +57,21 @@ public class TaShopPackageController extends BaseController {
54 57
                                           @ApiParam("商铺") @RequestParam(value ="shopId") String shopId) throws Exception{
55 58
 
56 59
         IPage<TaShopPackage> pg = new Page<>(pageNum, pageSize);
57
-        QueryWrapper<TaShopPackage> queryWrapper = new QueryWrapper<>();
58
-        queryWrapper.eq("shop_id", shopId);
59
-        queryWrapper.gt("status", Constants.STATUS_DELETED);
60
-        queryWrapper.orderByDesc("create_date");
61
-
62
-        IPage<TaShopPackage> result = iTaShopPackageService.page(pg, queryWrapper);
60
+        IPage<ShopPackageVO> result = iTaShopPackageService.getProfilePage(pg, shopId);
63 61
         return ResponseBean.success(result);
64 62
     }
65 63
 
66 64
     /**
67 65
      * 保存对象
68
-     * @param taShopPackage 实体对象
66
+     * @param shopPackageVO 实体对象
69 67
      * @return
70 68
      */
71 69
     @RequestMapping(value="/admin/taShopPackage",method= RequestMethod.POST)
72 70
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
73
-    public ResponseBean taShopPackageAdd(@ApiParam("保存内容") @RequestBody TaShopPackage taShopPackage) throws Exception{
71
+    public ResponseBean taShopPackageAdd(@ApiParam("保存内容") @RequestBody ShopPackageVO shopPackageVO) throws Exception {
74 72
 
75
-        if (iTaShopPackageService.save(taShopPackage)){
76
-            return ResponseBean.success(taShopPackage);
73
+        if (iTaShopPackageService.saveProfile(shopPackageVO)){
74
+            return ResponseBean.success(shopPackageVO);
77 75
         }else {
78 76
             return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
79 77
         }
@@ -96,15 +94,15 @@ public class TaShopPackageController extends BaseController {
96 94
     /**
97 95
      * 修改对象
98 96
      * @param id  实体ID
99
-     * @param taShopPackage 实体对象
97
+     * @param shopPackageVO 实体对象
100 98
      * @return
101 99
      */
102 100
     @RequestMapping(value="/admin/taShopPackage/{id}",method= RequestMethod.PUT)
103 101
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
104 102
     public ResponseBean taShopPackageUpdate(@ApiParam("对象ID") @PathVariable String id,
105
-                                        @ApiParam("更新内容") @RequestBody TaShopPackage taShopPackage) throws Exception{
103
+                                        @ApiParam("更新内容") @RequestBody ShopPackageVO shopPackageVO) throws Exception{
106 104
 
107
-        if (iTaShopPackageService.updateById(taShopPackage)){
105
+        if (iTaShopPackageService.updateProfile(shopPackageVO)){
108 106
             return ResponseBean.success(iTaShopPackageService.getById(id));
109 107
         }else {
110 108
             return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
@@ -118,6 +116,9 @@ public class TaShopPackageController extends BaseController {
118 116
     @RequestMapping(value="/admin/taShopPackage/{id}",method= RequestMethod.GET)
119 117
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
120 118
     public ResponseBean taShopPackageGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
121
-        return ResponseBean.success(iTaShopPackageService.getById(id));
119
+
120
+        ShopPackageVO shopPackageVO = iTaShopPackageService.getProfileById(id);
121
+
122
+        return ResponseBean.success(shopPackageVO);
122 123
     }
123 124
 }

+ 3
- 6
src/main/java/com/yunzhi/shigongli/controller/TaShopWorkerController.java Целия файл

@@ -9,6 +9,7 @@ import com.yunzhi.shigongli.common.ResponseBean;
9 9
 import com.yunzhi.shigongli.common.StringUtils;
10 10
 import com.yunzhi.shigongli.entity.TaShopWorker;
11 11
 import com.yunzhi.shigongli.service.ITaShopWorkerService;
12
+import com.yunzhi.shigongli.vo.ShopWorkerListVO;
12 13
 import io.swagger.annotations.Api;
13 14
 import io.swagger.annotations.ApiOperation;
14 15
 import io.swagger.annotations.ApiParam;
@@ -49,13 +50,9 @@ public class TaShopWorkerController extends BaseController {
49 50
                                          @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
50 51
                                          @ApiParam("商铺ID") @RequestParam(value ="shopId", required = false) String shopId) throws Exception{
51 52
 
52
-        IPage<TaShopWorker> pg = new Page<>(pageNum, pageSize);
53
-        QueryWrapper<TaShopWorker> queryWrapper = new QueryWrapper<>();
54
-        queryWrapper.eq(!StringUtils.isEmpty(shopId), "shop_id", shopId);
55
-        queryWrapper.gt("status", Constants.STATUS_DELETED);
56
-        queryWrapper.orderByDesc("create_date");
53
+        IPage<ShopWorkerListVO> pg = new Page<>(pageNum, pageSize);
57 54
 
58
-        IPage<TaShopWorker> result = iTaShopWorkerService.page(pg, queryWrapper);
55
+        IPage<ShopWorkerListVO> result = iTaShopWorkerService.getPagedListBy(pg, shopId);
59 56
         return ResponseBean.success(result);
60 57
     }
61 58
 

+ 41
- 11
src/main/java/com/yunzhi/shigongli/controller/TaTouristController.java Целия файл

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.yunzhi.shigongli.common.BaseController;
7 7
 import com.yunzhi.shigongli.common.Constants;
8 8
 import com.yunzhi.shigongli.common.ResponseBean;
9
+import com.yunzhi.shigongli.entity.TaTargetQuota;
10
+import com.yunzhi.shigongli.service.ITaTargetQuotaService;
9 11
 import io.swagger.annotations.Api;
10 12
 import io.swagger.annotations.ApiOperation;
11 13
 import io.swagger.annotations.ApiParam;
@@ -40,6 +42,9 @@ public class TaTouristController extends BaseController {
40 42
     @Autowired
41 43
     public ITaTouristService iTaTouristService;
42 44
 
45
+    @Autowired
46
+    public ITaTargetQuotaService targetQuotaService;
47
+
43 48
 
44 49
     /**
45 50
      * 分页查询列表
@@ -47,20 +52,19 @@ public class TaTouristController extends BaseController {
47 52
      * @param pageSize
48 53
      * @return
49 54
      */
50
-    @RequestMapping(value="/{plat}/taTourist",method= RequestMethod.GET)
55
+    @RequestMapping(value="/admin/taTourist",method= RequestMethod.GET)
51 56
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
52
-    public ResponseBean taTouristList(@ApiParam(value = "客户端", allowableValues = "wx,admin") @PathVariable String plat,
53
-                                      @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
54
-                                      @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
57
+    public ResponseBean taTouristList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
58
+                                      @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
59
+                                      @ApiParam("景点名称") @RequestParam(value ="touristName", required = false) String touristName,
60
+                                      @ApiParam("区位") @RequestParam(value ="cityId", required = false) String cityId) throws Exception{
55 61
 
56 62
         IPage<TaTourist> pg = new Page<>(pageNum, pageSize);
57 63
         QueryWrapper<TaTourist> queryWrapper = new QueryWrapper<>();
58
-        queryWrapper.eq("wx".equals(plat), "status", Constants.STATUS_NORMAL);
59
-        queryWrapper.gt("admin".equals(plat), "status", Constants.STATUS_DELETED);
60 64
         queryWrapper.orderByDesc("weight");
61 65
         queryWrapper.orderByDesc("create_date");
62 66
 
63
-        IPage<TaTourist> result = iTaTouristService.page(pg, queryWrapper);
67
+        IPage<TaTourist> result = iTaTouristService.getPagedBy(pg, touristName, cityId);
64 68
         return ResponseBean.success(result);
65 69
     }
66 70
 
@@ -73,7 +77,7 @@ public class TaTouristController extends BaseController {
73 77
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
74 78
     public ResponseBean taTouristAdd(@ApiParam("保存内容") @RequestBody TaTourist taTourist) throws Exception{
75 79
 
76
-        if (iTaTouristService.save(taTourist)){
80
+        if (iTaTouristService.createNew(taTourist)){
77 81
             return ResponseBean.success(taTourist);
78 82
         }else {
79 83
             return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
@@ -106,6 +110,13 @@ public class TaTouristController extends BaseController {
106 110
                                         @ApiParam("更新内容") @RequestBody TaTourist taTourist) throws Exception{
107 111
 
108 112
         if (iTaTouristService.updateById(taTourist)){
113
+            TaTargetQuota taTargetQuota = targetQuotaService.getByTarget(Constants.TARGET_TOURIST, id);
114
+
115
+            taTargetQuota.setPvNum(taTourist.getPvNum());
116
+            taTargetQuota.setUvNum(taTourist.getUvNum());
117
+            taTargetQuota.setLikeNum(taTourist.getLikeNum());
118
+            targetQuotaService.updateById(taTargetQuota);
119
+
109 120
             return ResponseBean.success(iTaTouristService.getById(id));
110 121
         }else {
111 122
             return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
@@ -116,9 +127,28 @@ public class TaTouristController extends BaseController {
116 127
      * 根据id查询对象
117 128
      * @param id  实体ID
118 129
      */
119
-    @RequestMapping(value="/admin/taTourist/{id}",method= RequestMethod.GET)
130
+    @RequestMapping(value="/{plat}/taTourist/{id}",method= RequestMethod.GET)
120 131
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
121
-    public ResponseBean taTouristGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
122
-        return ResponseBean.success(iTaTouristService.getById(id));
132
+    public ResponseBean taTouristGet(@ApiParam(value = "客户端", allowableValues = "wx,admin") @PathVariable String plat,
133
+                                     @ApiParam("对象ID") @PathVariable String id) throws Exception{
134
+        TaTourist taTourist = iTaTouristService.getById(id);
135
+        if (Constants.STATUS_DELETED.equals(taTourist.getStatus())) {
136
+            return ResponseBean.error("景点不存在", ResponseBean.ERROR_ILLEGAL_PARAMS);
137
+        }
138
+
139
+        TaTargetQuota taTargetQuota = targetQuotaService.getByTarget(Constants.TARGET_TOURIST, id);
140
+        taTourist.setPvNum(taTargetQuota.getPvNum());
141
+        taTourist.setUvNum(taTargetQuota.getUvNum());
142
+        taTourist.setLikeNum(taTargetQuota.getLikeNum());
143
+
144
+        if ("wx".equals(plat)) {
145
+            try {
146
+                targetQuotaService.recordPerson(Constants.TARGET_TOURIST, id, getCurrentPerson());
147
+            } catch (Exception e) {
148
+                e.printStackTrace();
149
+            }
150
+        }
151
+
152
+        return ResponseBean.success(taTourist);
123 153
     }
124 154
 }

+ 23
- 18
src/main/java/com/yunzhi/shigongli/controller/TdCityController.java Целия файл

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.yunzhi.shigongli.common.BaseController;
7 7
 import com.yunzhi.shigongli.common.ResponseBean;
8
+import com.yunzhi.shigongli.common.StringUtils;
8 9
 import io.swagger.annotations.Api;
9 10
 import io.swagger.annotations.ApiOperation;
10 11
 import io.swagger.annotations.ApiParam;
@@ -40,24 +41,28 @@ public class TdCityController extends BaseController {
40 41
     public ITdCityService iTdCityService;
41 42
 
42 43
 
43
-//    /**
44
-//     * 分页查询列表
45
-//     * @param pageNum
46
-//     * @param pageSize
47
-//     * @return
48
-//     */
49
-//    @RequestMapping(value="/tdCity",method= RequestMethod.GET)
50
-//    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
-//    public ResponseBean tdCityList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-//									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
-//
54
-//		    IPage<TdCity> pg = new Page<>(pageNum, pageSize);
55
-//            QueryWrapper<TdCity> queryWrapper = new QueryWrapper<>();
56
-//            queryWrapper.orderByDesc("create_date");
57
-//
58
-//            IPage<TdCity> result = iTdCityService.page(pg, queryWrapper);
59
-//            return ResponseBean.success(result);
60
-//    }
44
+    /**
45
+     * 分页查询列表
46
+     * @param pageNum
47
+     * @param pageSize
48
+     * @return
49
+     */
50
+    @RequestMapping(value="/admin/city",method= RequestMethod.GET)
51
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
52
+    public ResponseBean tdCityList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53
+                                   @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
54
+                                   @ApiParam("父级分类") @RequestParam(value ="areaPId", required = false) String areaPId,
55
+                                   @ApiParam("名称") @RequestParam(value ="areaName", required = false) String areaName) throws Exception{
56
+
57
+        IPage<TdCity> pg = new Page<>(pageNum, pageSize);
58
+        QueryWrapper<TdCity> queryWrapper = new QueryWrapper<>();
59
+        queryWrapper.eq(!StringUtils.isEmpty(areaPId),"area_p_id", areaPId);
60
+        queryWrapper.like(!StringUtils.isEmpty(areaName), "area_name","%"+areaName+"%");
61
+        queryWrapper.orderByAsc("area_id");
62
+
63
+        IPage<TdCity> result = iTdCityService.page(pg, queryWrapper);
64
+        return ResponseBean.success(result);
65
+    }
61 66
 //
62 67
 //    /**
63 68
 //     * 保存对象

+ 22
- 19
src/main/java/com/yunzhi/shigongli/controller/TdDietMarkController.java Целия файл

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.yunzhi.shigongli.common.BaseController;
7
+import com.yunzhi.shigongli.common.Constants;
7 8
 import com.yunzhi.shigongli.common.ResponseBean;
8 9
 import io.swagger.annotations.Api;
9 10
 import io.swagger.annotations.ApiOperation;
@@ -39,25 +40,27 @@ public class TdDietMarkController extends BaseController {
39 40
     @Autowired
40 41
     public ITdDietMarkService iTdDietMarkService;
41 42
 
42
-//
43
-//    /**
44
-//     * 分页查询列表
45
-//     * @param pageNum
46
-//     * @param pageSize
47
-//     * @return
48
-//     */
49
-//    @RequestMapping(value="/admin/tdDietMark",method= RequestMethod.GET)
50
-//    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
-//    public ResponseBean tdDietMarkList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-//									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
-//
54
-//		    IPage<TdDietMark> pg = new Page<>(pageNum, pageSize);
55
-//            QueryWrapper<TdDietMark> queryWrapper = new QueryWrapper<>();
56
-//            queryWrapper.orderByDesc("create_date");
57
-//
58
-//            IPage<TdDietMark> result = iTdDietMarkService.page(pg, queryWrapper);
59
-//            return ResponseBean.success(result);
60
-//    }
43
+
44
+    /**
45
+     * 分页查询列表
46
+     * @param pageNum
47
+     * @param pageSize
48
+     * @return
49
+     */
50
+    @RequestMapping(value="/{client}/dietMark",method= RequestMethod.GET)
51
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
52
+    public ResponseBean tdDietMarkList(@ApiParam(value = "客户端", allowableValues = "wx,admin") @PathVariable(value ="client") String client,
53
+                                       @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
54
+                                       @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
55
+
56
+        IPage<TdDietMark> pg = new Page<>(pageNum, pageSize);
57
+        QueryWrapper<TdDietMark> queryWrapper = new QueryWrapper<>();
58
+        queryWrapper.eq("status", Constants.STATUS_NORMAL);
59
+        queryWrapper.orderByDesc("sort");
60
+
61
+        IPage<TdDietMark> result = iTdDietMarkService.page(pg, queryWrapper);
62
+        return ResponseBean.success(result);
63
+    }
61 64
 //
62 65
 //    /**
63 66
 //     * 保存对象

+ 53
- 0
src/main/java/com/yunzhi/shigongli/entity/TaNotification.java Целия файл

@@ -0,0 +1,53 @@
1
+package com.yunzhi.shigongli.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+import java.io.Serializable;
13
+import java.time.LocalDateTime;
14
+
15
+/**
16
+ * <p>
17
+ * 通知公告
18
+ * </p>
19
+ *
20
+ * @author yansen
21
+ * @since 2021-08-17
22
+ */
23
+@Data
24
+@EqualsAndHashCode(callSuper = false)
25
+@Accessors(chain = true)
26
+@ApiModel(value="TaNotification对象", description="通知公告")
27
+public class TaNotification implements Serializable {
28
+
29
+    private static final long serialVersionUID = 1L;
30
+
31
+    @ApiModelProperty(value = "搜索ID")
32
+    @TableId(value = "notice_id", type = IdType.UUID)
33
+    private String noticeId;
34
+
35
+    @ApiModelProperty(value = "发布人")
36
+    private String createPerson;
37
+
38
+    @ApiModelProperty(value = "发布时间")
39
+    private LocalDateTime createDate;
40
+
41
+    @ApiModelProperty(value = "通知类型")
42
+    private String noticeType;
43
+
44
+    @ApiModelProperty(value = "通知内容")
45
+    private String content;
46
+
47
+    @ApiModelProperty(value = "状态")
48
+    @TableField("`status`")
49
+    private Integer status;
50
+
51
+    @ApiModelProperty(value = "权重")
52
+    private Integer weight;
53
+}

+ 22
- 5
src/main/java/com/yunzhi/shigongli/entity/TaShop.java Целия файл

@@ -3,8 +3,12 @@ package com.yunzhi.shigongli.entity;
3 3
 import java.math.BigDecimal;
4 4
 import com.baomidou.mybatisplus.annotation.IdType;
5 5
 import java.time.LocalDateTime;
6
+
7
+import com.baomidou.mybatisplus.annotation.TableField;
6 8
 import com.baomidou.mybatisplus.annotation.TableId;
7 9
 import java.io.Serializable;
10
+import java.util.List;
11
+
8 12
 import io.swagger.annotations.ApiModel;
9 13
 import io.swagger.annotations.ApiModelProperty;
10 14
 import lombok.Data;
@@ -40,6 +44,9 @@ public class TaShop implements Serializable {
40 44
     @ApiModelProperty(value = "所属区")
41 45
     private String cityId;
42 46
 
47
+    @ApiModelProperty(value = "联系电话")
48
+    private String phone;
49
+
43 50
     @ApiModelProperty(value = "定位")
44 51
     private String locaton;
45 52
 
@@ -61,20 +68,30 @@ public class TaShop implements Serializable {
61 68
     @ApiModelProperty(value = "服务评分")
62 69
     private BigDecimal serviceScore;
63 70
 
71
+    @ApiModelProperty(value = "状态")
72
+    private Integer status;
73
+
74
+    @ApiModelProperty(value = "创建时间")
75
+    private LocalDateTime createDate;
76
+
64 77
     @ApiModelProperty(value = "点赞数")
78
+    @TableField(exist = false)
65 79
     private Integer likeNum;
66 80
 
67 81
     @ApiModelProperty(value = "浏览量")
82
+    @TableField(exist = false)
68 83
     private Integer pvNum;
69 84
 
70 85
     @ApiModelProperty(value = "用户数")
86
+    @TableField(exist = false)
71 87
     private Integer uvNum;
72 88
 
73
-    @ApiModelProperty(value = "状态")
74
-    private Integer status;
75
-
76
-    @ApiModelProperty(value = "创建时间")
77
-    private LocalDateTime createDate;
89
+    @ApiModelProperty(value = "图片列表")
90
+    @TableField(exist = false)
91
+    private List<TaShopImages> imageList;
78 92
 
93
+    @ApiModelProperty(value = "分类标签")
94
+    @TableField(exist = false)
95
+    private List<TaTargetType> typeList;
79 96
 
80 97
 }

+ 1
- 1
src/main/java/com/yunzhi/shigongli/entity/TaShopPackageSetting.java Целия файл

@@ -37,7 +37,7 @@ public class TaShopPackageSetting implements Serializable {
37 37
     private Integer platformRate;
38 38
 
39 39
     @ApiModelProperty(value = "参与攻略")
40
-    private Integer isStrategy;
40
+    private Boolean isStrategy;
41 41
 
42 42
     @ApiModelProperty(value = "推荐等级")
43 43
     private String strategyLevel;

+ 42
- 0
src/main/java/com/yunzhi/shigongli/entity/TaTargetDietMark.java Целия файл

@@ -0,0 +1,42 @@
1
+package com.yunzhi.shigongli.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import io.swagger.annotations.ApiModel;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+
13
+/**
14
+ * <p>
15
+ * 资源时刻表
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-08-17
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaTargetDietMark对象", description="资源时刻表")
25
+public class TaTargetDietMark implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "序号")
30
+    @TableId(value = "mark_no", type = IdType.AUTO)
31
+    private Integer markNo;
32
+
33
+    @ApiModelProperty(value = "类型ID")
34
+    private String markId;
35
+
36
+    @ApiModelProperty(value = "资源类型")
37
+    private String targetType;
38
+
39
+    @ApiModelProperty(value = "对象ID")
40
+    private String targetId;
41
+
42
+}

+ 50
- 0
src/main/java/com/yunzhi/shigongli/entity/TaTargetQuota.java Целия файл

@@ -0,0 +1,50 @@
1
+package com.yunzhi.shigongli.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import io.swagger.annotations.ApiModel;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.math.BigDecimal;
13
+import java.time.LocalDateTime;
14
+
15
+/**
16
+ * <p>
17
+ * 资源指标集
18
+ * </p>
19
+ *
20
+ * @author yansen
21
+ * @since 2021-08-17
22
+ */
23
+@Data
24
+@EqualsAndHashCode(callSuper = false)
25
+@Accessors(chain = true)
26
+@ApiModel(value="TaTargetQuota对象", description="资源指标集")
27
+public class TaTargetQuota implements Serializable {
28
+
29
+    private static final long serialVersionUID = 1L;
30
+
31
+    @ApiModelProperty(value = "targetNo")
32
+    @TableId(value = "target_no", type = IdType.AUTO)
33
+    private Integer targetNo;
34
+
35
+    @ApiModelProperty(value = "访问对象类型")
36
+    private String targetType;
37
+
38
+    @ApiModelProperty(value = "访问对象ID")
39
+    private String targetId;
40
+
41
+    @ApiModelProperty(value = "点赞数")
42
+    private Integer likeNum;
43
+
44
+    @ApiModelProperty(value = "浏览量")
45
+    private Integer pvNum;
46
+
47
+    @ApiModelProperty(value = "用户数")
48
+    private Integer uvNum;
49
+
50
+}

+ 43
- 0
src/main/java/com/yunzhi/shigongli/entity/TaTargetType.java Целия файл

@@ -0,0 +1,43 @@
1
+package com.yunzhi.shigongli.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import io.swagger.annotations.ApiModel;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+
14
+/**
15
+ * <p>
16
+ * 资源分类表
17
+ * </p>
18
+ *
19
+ * @author yansen
20
+ * @since 2021-08-17
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@ApiModel(value="TaTargetType对象", description="资源分类表")
26
+public class TaTargetType implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @ApiModelProperty(value = "序号")
31
+    @TableId(value = "type_no", type = IdType.AUTO)
32
+    private Integer typeNo;
33
+
34
+    @ApiModelProperty(value = "类型ID")
35
+    private String typeId;
36
+
37
+    @ApiModelProperty(value = "资源类型")
38
+    private String targetType;
39
+
40
+    @ApiModelProperty(value = "对象ID")
41
+    private String targetId;
42
+
43
+}

+ 14
- 9
src/main/java/com/yunzhi/shigongli/entity/TaTourist.java Целия файл

@@ -2,6 +2,8 @@ package com.yunzhi.shigongli.entity;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4 4
 import java.time.LocalDateTime;
5
+
6
+import com.baomidou.mybatisplus.annotation.TableField;
5 7
 import com.baomidou.mybatisplus.annotation.TableId;
6 8
 import java.io.Serializable;
7 9
 import io.swagger.annotations.ApiModel;
@@ -48,15 +50,6 @@ public class TaTourist implements Serializable {
48 50
     @ApiModelProperty(value = "地址")
49 51
     private String address;
50 52
 
51
-    @ApiModelProperty(value = "点赞数")
52
-    private Integer likeNum;
53
-
54
-    @ApiModelProperty(value = "浏览量")
55
-    private Integer pvNum;
56
-
57
-    @ApiModelProperty(value = "用户数")
58
-    private Integer uvNum;
59
-
60 53
     @ApiModelProperty(value = "权重")
61 54
     private Integer weight;
62 55
 
@@ -70,4 +63,16 @@ public class TaTourist implements Serializable {
70 63
     private LocalDateTime createDate;
71 64
 
72 65
 
66
+    @ApiModelProperty(value = "点赞数")
67
+    @TableField(exist = false)
68
+    private Integer likeNum;
69
+
70
+    @ApiModelProperty(value = "浏览量")
71
+    @TableField(exist = false)
72
+    private Integer pvNum;
73
+
74
+    @ApiModelProperty(value = "用户数")
75
+    @TableField(exist = false)
76
+    private Integer uvNum;
77
+
73 78
 }

+ 9
- 0
src/main/java/com/yunzhi/shigongli/entity/TdCity.java Целия файл

@@ -29,13 +29,22 @@ public class TdCity implements Serializable {
29 29
     @TableId(value = "area_id", type = IdType.INPUT)
30 30
     private String areaId;
31 31
 
32
+    @ApiModelProperty(value = "名称")
32 33
     private String areaName;
33 34
 
35
+    @ApiModelProperty(value = "父级ID")
34 36
     private String areaPId;
35 37
 
38
+    @ApiModelProperty(value = "等级")
36 39
     private String areaLevel;
37 40
 
41
+    @ApiModelProperty(value = "状态")
38 42
     private Integer status;
39 43
 
44
+    @ApiModelProperty(value = "经度")
45
+    private String lng;
46
+
47
+    @ApiModelProperty(value = "纬度")
48
+    private String lat;
40 49
 
41 50
 }

+ 4
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaHotelWorkerMapper.java Целия файл

@@ -1,8 +1,11 @@
1 1
 package com.yunzhi.shigongli.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaHotelWorker;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6
+import com.yunzhi.shigongli.vo.HotelWorkerListVO;
5 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
6 9
 
7 10
 /**
8 11
  * <p>
@@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
15 18
 @Mapper
16 19
 public interface TaHotelWorkerMapper extends BaseMapper<TaHotelWorker> {
17 20
 
21
+    IPage<HotelWorkerListVO> getPagedListBy(IPage<HotelWorkerListVO> pg, @Param("hotelId") String hotelId);
18 22
 }

+ 18
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaNotificationMapper.java Целия файл

@@ -0,0 +1,18 @@
1
+package com.yunzhi.shigongli.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.yunzhi.shigongli.entity.TaNotification;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 通知公告 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-08-17
14
+ */
15
+@Mapper
16
+public interface TaNotificationMapper extends BaseMapper<TaNotification> {
17
+
18
+}

+ 2
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaShopMapper.java Целия файл

@@ -19,4 +19,6 @@ import org.apache.ibatis.annotations.Param;
19 19
 public interface TaShopMapper extends BaseMapper<TaShop> {
20 20
 
21 21
     IPage<ShopListVO> getPageListBy(IPage<ShopListVO> pg, @Param("shopName") String shopName, @Param("phone") String phone);
22
+
23
+    int updatePVNum(@Param("phone") String id);
22 24
 }

+ 4
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaShopPackageMapper.java Целия файл

@@ -1,8 +1,11 @@
1 1
 package com.yunzhi.shigongli.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaShopPackage;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6
+import com.yunzhi.shigongli.vo.ShopPackageVO;
5 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
6 9
 
7 10
 /**
8 11
  * <p>
@@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
15 18
 @Mapper
16 19
 public interface TaShopPackageMapper extends BaseMapper<TaShopPackage> {
17 20
 
21
+    IPage<ShopPackageVO> getProfilePage(IPage<TaShopPackage> pg, @Param("shopId") String shopId);
18 22
 }

+ 4
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaShopWorkerMapper.java Целия файл

@@ -1,8 +1,11 @@
1 1
 package com.yunzhi.shigongli.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.yunzhi.shigongli.entity.TaShopWorker;
6
+import com.yunzhi.shigongli.vo.ShopWorkerListVO;
5 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
6 9
 
7 10
 /**
8 11
  * <p>
@@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
15 18
 @Mapper
16 19
 public interface TaShopWorkerMapper extends BaseMapper<TaShopWorker> {
17 20
 
21
+    IPage<ShopWorkerListVO> getPagedListBy(IPage<ShopWorkerListVO> pg, @Param("shopId") String shopId);
18 22
 }

+ 22
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaTargetDietMarkMapper.java Целия файл

@@ -0,0 +1,22 @@
1
+package com.yunzhi.shigongli.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.yunzhi.shigongli.entity.TaTargetDietMark;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * <p>
12
+ * 资源时刻表 Mapper 接口
13
+ * </p>
14
+ *
15
+ * @author yansen
16
+ * @since 2021-08-17
17
+ */
18
+@Mapper
19
+public interface TaTargetDietMarkMapper extends BaseMapper<TaTargetDietMark> {
20
+
21
+    List<TaTargetDietMark> getListBy(@Param("targetType") String targetType, @Param("targetId") String targetId);
22
+}

+ 20
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaTargetQuotaMapper.java Целия файл

@@ -0,0 +1,20 @@
1
+package com.yunzhi.shigongli.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.yunzhi.shigongli.entity.TaTargetQuota;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+/**
9
+ * <p>
10
+ * 资源类型表 Mapper 接口
11
+ * </p>
12
+ *
13
+ * @author yansen
14
+ * @since 2021-08-17
15
+ */
16
+@Mapper
17
+public interface TaTargetQuotaMapper extends BaseMapper<TaTargetQuota> {
18
+
19
+    int increaseQuota(@Param("quota") String quota, @Param("targetType") String targetType, @Param("targetId") String targetId);
20
+}

+ 18
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaTargetTypeMapper.java Целия файл

@@ -0,0 +1,18 @@
1
+package com.yunzhi.shigongli.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.yunzhi.shigongli.entity.TaTargetType;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 资源类型表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-08-17
14
+ */
15
+@Mapper
16
+public interface TaTargetTypeMapper extends BaseMapper<TaTargetType> {
17
+
18
+}

+ 3
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaTouristMapper.java Целия файл

@@ -1,8 +1,10 @@
1 1
 package com.yunzhi.shigongli.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaTourist;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
6 8
 
7 9
 /**
8 10
  * <p>
@@ -15,4 +17,5 @@ import org.apache.ibatis.annotations.Mapper;
15 17
 @Mapper
16 18
 public interface TaTouristMapper extends BaseMapper<TaTourist> {
17 19
 
20
+    IPage<TaTourist> getPagedBy(IPage<TaTourist> pg, @Param("touristName") String touristName, @Param("cityId") String cityId);
18 21
 }

+ 2
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaUvMapper.java Целия файл

@@ -3,6 +3,7 @@ package com.yunzhi.shigongli.mapper;
3 3
 import com.yunzhi.shigongli.entity.TaUv;
4 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 /**
8 9
  * <p>
@@ -15,4 +16,5 @@ import org.apache.ibatis.annotations.Mapper;
15 16
 @Mapper
16 17
 public interface TaUvMapper extends BaseMapper<TaUv> {
17 18
 
19
+    TaUv getByTargetAndPerson(@Param("targetType") String targetType, @Param("targetId") String targetId, @Param("personId") String personId);
18 20
 }

+ 3
- 0
src/main/java/com/yunzhi/shigongli/service/ITaHotelWorkerService.java Целия файл

@@ -1,6 +1,8 @@
1 1
 package com.yunzhi.shigongli.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaHotelWorker;
5
+import com.yunzhi.shigongli.vo.HotelWorkerListVO;
4 6
 
5 7
 
6 8
 /**
@@ -13,4 +15,5 @@ import com.yunzhi.shigongli.entity.TaHotelWorker;
13 15
  */
14 16
 public interface ITaHotelWorkerService extends IBaseService<TaHotelWorker> {
15 17
 
18
+    IPage<HotelWorkerListVO> getPagedListBy(IPage<HotelWorkerListVO> pg, String hotelId);
16 19
 }

+ 16
- 0
src/main/java/com/yunzhi/shigongli/service/ITaNotificationService.java Целия файл

@@ -0,0 +1,16 @@
1
+package com.yunzhi.shigongli.service;
2
+
3
+import com.yunzhi.shigongli.entity.TaNotification;
4
+
5
+
6
+/**
7
+ * <p>
8
+ * 通知公告 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2021-08-17
13
+ */
14
+public interface ITaNotificationService extends IBaseService<TaNotification> {
15
+
16
+}

+ 3
- 0
src/main/java/com/yunzhi/shigongli/service/ITaPvService.java Целия файл

@@ -1,5 +1,7 @@
1 1
 package com.yunzhi.shigongli.service;
2 2
 
3
+import com.yunzhi.shigongli.common.Callback;
4
+import com.yunzhi.shigongli.entity.TaPerson;
3 5
 import com.yunzhi.shigongli.entity.TaPv;
4 6
 
5 7
 
@@ -13,4 +15,5 @@ import com.yunzhi.shigongli.entity.TaPv;
13 15
  */
14 16
 public interface ITaPvService extends IBaseService<TaPv> {
15 17
 
18
+    void newRecord(TaPv taPv, Callback cb) throws Exception;
16 19
 }

+ 3
- 0
src/main/java/com/yunzhi/shigongli/service/ITaShopImagesService.java Целия файл

@@ -2,6 +2,8 @@ package com.yunzhi.shigongli.service;
2 2
 
3 3
 import com.yunzhi.shigongli.entity.TaShopImages;
4 4
 
5
+import java.util.List;
6
+
5 7
 
6 8
 /**
7 9
  * <p>
@@ -13,4 +15,5 @@ import com.yunzhi.shigongli.entity.TaShopImages;
13 15
  */
14 16
 public interface ITaShopImagesService extends IBaseService<TaShopImages> {
15 17
 
18
+    void updateImages(String shopId, List<TaShopImages> imageList) throws Exception;
16 19
 }

+ 9
- 0
src/main/java/com/yunzhi/shigongli/service/ITaShopPackageService.java Целия файл

@@ -1,6 +1,8 @@
1 1
 package com.yunzhi.shigongli.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaShopPackage;
5
+import com.yunzhi.shigongli.vo.ShopPackageVO;
4 6
 
5 7
 
6 8
 /**
@@ -13,4 +15,11 @@ import com.yunzhi.shigongli.entity.TaShopPackage;
13 15
  */
14 16
 public interface ITaShopPackageService extends IBaseService<TaShopPackage> {
15 17
 
18
+    boolean saveProfile(ShopPackageVO shopPackageVO) throws Exception;
19
+
20
+    boolean updateProfile(ShopPackageVO shopPackageVO) throws Exception;
21
+
22
+    ShopPackageVO getProfileById(String id);
23
+
24
+    IPage<ShopPackageVO> getProfilePage(IPage<TaShopPackage> pg, String shopId);
16 25
 }

+ 2
- 0
src/main/java/com/yunzhi/shigongli/service/ITaShopService.java Целия файл

@@ -18,4 +18,6 @@ public interface ITaShopService extends IBaseService<TaShop> {
18 18
     IPage<ShopListVO> getPageListBy(IPage<ShopListVO> pg, String shopName, String phone);
19 19
 
20 20
     void createNew(TaShop taShop) throws Exception;
21
+
22
+    boolean updatePVNum(String id);
21 23
 }

+ 3
- 0
src/main/java/com/yunzhi/shigongli/service/ITaShopWorkerService.java Целия файл

@@ -1,7 +1,9 @@
1 1
 package com.yunzhi.shigongli.service;
2 2
 
3 3
 
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.yunzhi.shigongli.entity.TaShopWorker;
6
+import com.yunzhi.shigongli.vo.ShopWorkerListVO;
5 7
 
6 8
 /**
7 9
  * <p>
@@ -13,4 +15,5 @@ import com.yunzhi.shigongli.entity.TaShopWorker;
13 15
  */
14 16
 public interface ITaShopWorkerService extends IBaseService<TaShopWorker> {
15 17
 
18
+    IPage<ShopWorkerListVO> getPagedListBy(IPage<ShopWorkerListVO> pg, String shopId);
16 19
 }

+ 16
- 0
src/main/java/com/yunzhi/shigongli/service/ITaTargetDietMarkService.java Целия файл

@@ -0,0 +1,16 @@
1
+package com.yunzhi.shigongli.service;
2
+
3
+
4
+import com.yunzhi.shigongli.entity.TaTargetDietMark;
5
+
6
+/**
7
+ * <p>
8
+ * 资源时刻表 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2021-08-17
13
+ */
14
+public interface ITaTargetDietMarkService extends IBaseService<TaTargetDietMark> {
15
+
16
+}

+ 20
- 0
src/main/java/com/yunzhi/shigongli/service/ITaTargetQuotaService.java Целия файл

@@ -0,0 +1,20 @@
1
+package com.yunzhi.shigongli.service;
2
+
3
+import com.yunzhi.shigongli.entity.TaPerson;
4
+import com.yunzhi.shigongli.entity.TaTargetQuota;
5
+
6
+
7
+/**
8
+ * <p>
9
+ * 访问人 服务类
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-08-17
14
+ */
15
+public interface ITaTargetQuotaService extends IBaseService<TaTargetQuota> {
16
+
17
+    TaTargetQuota getByTarget(String targetType, String targetId);
18
+
19
+    void recordPerson(String targetType, String targetId, TaPerson taPerson) throws Exception;
20
+}

+ 21
- 0
src/main/java/com/yunzhi/shigongli/service/ITaTargetTypeService.java Целия файл

@@ -0,0 +1,21 @@
1
+package com.yunzhi.shigongli.service;
2
+
3
+import com.yunzhi.shigongli.entity.TaTargetType;
4
+
5
+import java.util.List;
6
+
7
+
8
+/**
9
+ * <p>
10
+ * 资源分类表 服务类
11
+ * </p>
12
+ *
13
+ * @author yansen
14
+ * @since 2021-08-17
15
+ */
16
+public interface ITaTargetTypeService extends IBaseService<TaTargetType> {
17
+
18
+    void updateTypes(String targetType, String targetId, List<TaTargetType> typeList) throws Exception;
19
+
20
+    List<TaTargetType> getListBy(String targetType, String targetId);
21
+}

+ 5
- 0
src/main/java/com/yunzhi/shigongli/service/ITaTouristService.java Целия файл

@@ -1,6 +1,8 @@
1 1
 package com.yunzhi.shigongli.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaTourist;
5
+import org.apache.ibatis.annotations.Param;
4 6
 
5 7
 
6 8
 /**
@@ -13,4 +15,7 @@ import com.yunzhi.shigongli.entity.TaTourist;
13 15
  */
14 16
 public interface ITaTouristService extends IBaseService<TaTourist> {
15 17
 
18
+    IPage<TaTourist> getPagedBy(IPage<TaTourist> pg, @Param("touristName") String touristName, @Param("cityId") String cityId);
19
+
20
+    boolean createNew(TaTourist taTourist) throws Exception;
16 21
 }

+ 10
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaHotelWorkerServiceImpl.java Целия файл

@@ -1,9 +1,12 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaHotelWorker;
4 5
 import com.yunzhi.shigongli.mapper.TaHotelWorkerMapper;
5 6
 import com.yunzhi.shigongli.service.ITaHotelWorkerService;
6 7
 
8
+import com.yunzhi.shigongli.vo.HotelWorkerListVO;
9
+import org.springframework.beans.factory.annotation.Autowired;
7 10
 import org.springframework.stereotype.Service;
8 11
 
9 12
 /**
@@ -17,4 +20,11 @@ import org.springframework.stereotype.Service;
17 20
 @Service
18 21
 public class TaHotelWorkerServiceImpl extends BaseServiceImpl<TaHotelWorkerMapper, TaHotelWorker> implements ITaHotelWorkerService {
19 22
 
23
+    @Autowired
24
+    TaHotelWorkerMapper hotelWorkerMapper;
25
+
26
+    @Override
27
+    public IPage<HotelWorkerListVO> getPagedListBy(IPage<HotelWorkerListVO> pg, String hotelId) {
28
+        return hotelWorkerMapper.getPagedListBy(pg, hotelId);
29
+    }
20 30
 }

+ 19
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaNotificationServiceImpl.java Целия файл

@@ -0,0 +1,19 @@
1
+package com.yunzhi.shigongli.service.impl;
2
+
3
+import com.yunzhi.shigongli.entity.TaNotification;
4
+import com.yunzhi.shigongli.mapper.TaNotificationMapper;
5
+import com.yunzhi.shigongli.service.ITaNotificationService;
6
+import org.springframework.stereotype.Service;
7
+
8
+/**
9
+ * <p>
10
+ * 点赞表 服务实现类
11
+ * </p>
12
+ *
13
+ * @author yansen
14
+ * @since 2021-08-17
15
+ */
16
+@Service
17
+public class TaNotificationServiceImpl extends BaseServiceImpl<TaNotificationMapper, TaNotification> implements ITaNotificationService {
18
+
19
+}

+ 11
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaPvServiceImpl.java Целия файл

@@ -1,10 +1,14 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3
+import com.yunzhi.shigongli.common.Callback;
4
+import com.yunzhi.shigongli.entity.TaPerson;
3 5
 import com.yunzhi.shigongli.entity.TaPv;
4 6
 import com.yunzhi.shigongli.mapper.TaPvMapper;
5 7
 import com.yunzhi.shigongli.service.ITaPvService;
6 8
 
9
+import org.springframework.scheduling.annotation.Async;
7 10
 import org.springframework.stereotype.Service;
11
+import org.springframework.transaction.annotation.Transactional;
8 12
 
9 13
 /**
10 14
  * <p>
@@ -17,4 +21,11 @@ import org.springframework.stereotype.Service;
17 21
 @Service
18 22
 public class TaPvServiceImpl extends BaseServiceImpl<TaPvMapper, TaPv> implements ITaPvService {
19 23
 
24
+    @Async
25
+    @Override
26
+    public void newRecord(TaPv taPv, Callback cb) throws Exception {
27
+        if (save(taPv)) {
28
+            cb.next();
29
+        }
30
+    }
20 31
 }

+ 37
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaShopImagesServiceImpl.java Целия файл

@@ -1,11 +1,16 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.yunzhi.shigongli.common.StringUtils;
3 5
 import com.yunzhi.shigongli.entity.TaShopImages;
4 6
 import com.yunzhi.shigongli.mapper.TaShopImagesMapper;
5 7
 import com.yunzhi.shigongli.service.ITaShopImagesService;
6 8
 
9
+import org.springframework.beans.factory.annotation.Autowired;
7 10
 import org.springframework.stereotype.Service;
8 11
 
12
+import java.util.List;
13
+
9 14
 /**
10 15
  * <p>
11 16
  * 商铺图片 服务实现类
@@ -17,4 +22,36 @@ import org.springframework.stereotype.Service;
17 22
 @Service
18 23
 public class TaShopImagesServiceImpl extends BaseServiceImpl<TaShopImagesMapper, TaShopImages> implements ITaShopImagesService {
19 24
 
25
+    @Autowired
26
+    TaShopImagesMapper taShopImagesMapper;
27
+
28
+
29
+    @Override
30
+    public void updateImages(String shopId, List<TaShopImages> imageList) throws Exception {
31
+        if (null == imageList) {
32
+            throw new Exception("未找到图片列表信息");
33
+        }
34
+
35
+        if (StringUtils.isEmpty(shopId)) {
36
+            throw new Exception("未找到有效的商铺信息");
37
+        }
38
+
39
+        // 先删除所有的
40
+        removeByShop(shopId);
41
+
42
+        // 再插入新记录
43
+        for (TaShopImages image: imageList) {
44
+            image.setImageId(null);
45
+            image.setShopId(shopId);
46
+        }
47
+
48
+        saveBatch(imageList);
49
+    }
50
+
51
+    private boolean removeByShop(String shopId) throws Exception {
52
+        LambdaQueryWrapper<TaShopImages> queryWrapper = new LambdaQueryWrapper<>();
53
+        queryWrapper.eq(TaShopImages::getShopId, shopId);
54
+
55
+        return remove(queryWrapper);
56
+    }
20 57
 }

+ 125
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaShopPackageServiceImpl.java Целия файл

@@ -1,11 +1,25 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.yunzhi.shigongli.common.Constants;
3 6
 import com.yunzhi.shigongli.entity.TaShopPackage;
7
+import com.yunzhi.shigongli.entity.TaShopPackageSetting;
8
+import com.yunzhi.shigongli.entity.TaTargetDietMark;
9
+import com.yunzhi.shigongli.mapper.TaTargetDietMarkMapper;
4 10
 import com.yunzhi.shigongli.mapper.TaShopPackageMapper;
11
+import com.yunzhi.shigongli.mapper.TaShopPackageSettingMapper;
5 12
 import com.yunzhi.shigongli.service.ITaShopPackageService;
6 13
 
14
+import com.yunzhi.shigongli.vo.ShopPackageVO;
15
+import org.springframework.beans.BeanUtils;
16
+import org.springframework.beans.factory.annotation.Autowired;
7 17
 import org.springframework.stereotype.Service;
8 18
 
19
+import java.util.HashMap;
20
+import java.util.List;
21
+import java.util.Map;
22
+
9 23
 /**
10 24
  * <p>
11 25
  * 商铺套餐 服务实现类
@@ -17,4 +31,115 @@ import org.springframework.stereotype.Service;
17 31
 @Service
18 32
 public class TaShopPackageServiceImpl extends BaseServiceImpl<TaShopPackageMapper, TaShopPackage> implements ITaShopPackageService {
19 33
 
34
+    @Autowired
35
+    TaShopPackageSettingMapper shopPackageSettingMapper;
36
+
37
+    @Autowired
38
+    TaTargetDietMarkMapper dietMarkMapper;
39
+
40
+    @Override
41
+    public boolean saveProfile(ShopPackageVO shopPackageVO) throws Exception {
42
+        TaShopPackage taShopPackage = new TaShopPackage();
43
+        TaShopPackageSetting shopPackageSetting = new TaShopPackageSetting();
44
+
45
+        BeanUtils.copyProperties(shopPackageVO, taShopPackage);
46
+        BeanUtils.copyProperties(shopPackageVO, shopPackageSetting);
47
+
48
+        save(taShopPackage);
49
+        shopPackageVO.setPackageId(taShopPackage.getPackageId());
50
+
51
+        shopPackageSetting.setPackageId(taShopPackage.getPackageId());
52
+
53
+        // 现金券不参与攻略
54
+        if (Constants.PACKAGE_CASH.equals(taShopPackage.getPackageCategory())) {
55
+            shopPackageSetting.setIsStrategy(false);
56
+        } else {
57
+            shopPackageSetting.setIsStrategy(true);
58
+        }
59
+
60
+        shopPackageSettingMapper.insert(shopPackageSetting);
61
+
62
+        List<TaTargetDietMark> dietMarkList = shopPackageVO.getDietMarkList();
63
+        if (null != dietMarkList) {
64
+            for (TaTargetDietMark dietMark : dietMarkList) {
65
+                dietMark.setTargetId(taShopPackage.getPackageId());
66
+                dietMark.setTargetType(Constants.TARGET_SHOP_PACKAGE);
67
+
68
+                dietMarkMapper.insert(dietMark);
69
+            }
70
+            shopPackageVO.setDietMarkList(dietMarkList);
71
+        }
72
+
73
+        return true;
74
+    }
75
+
76
+    @Override
77
+    public boolean updateProfile(ShopPackageVO shopPackageVO) throws Exception {
78
+        TaShopPackage taShopPackage = new TaShopPackage();
79
+        TaShopPackageSetting shopPackageSetting = new TaShopPackageSetting();
80
+
81
+        BeanUtils.copyProperties(shopPackageVO, taShopPackage);
82
+        BeanUtils.copyProperties(shopPackageVO, shopPackageSetting);
83
+
84
+        updateById(taShopPackage);
85
+        shopPackageVO.setPackageId(taShopPackage.getPackageId());
86
+
87
+        shopPackageSetting.setPackageId(taShopPackage.getPackageId());
88
+
89
+        // 现金券不参与攻略
90
+        if (Constants.PACKAGE_CASH.equals(taShopPackage.getPackageCategory())) {
91
+            shopPackageSetting.setIsStrategy(false);
92
+        } else {
93
+            shopPackageSetting.setIsStrategy(true);
94
+        }
95
+        shopPackageSettingMapper.updateById(shopPackageSetting);
96
+
97
+        // 先删除
98
+        Map<String, Object> columnMap = new HashMap<>();
99
+        columnMap.put("target_type", Constants.TARGET_SHOP_PACKAGE);
100
+        columnMap.put("target_id", taShopPackage.getPackageId());
101
+        dietMarkMapper.deleteByMap(columnMap);
102
+
103
+        // 再插入
104
+        List<TaTargetDietMark> dietMarkList = shopPackageVO.getDietMarkList();
105
+        if (null != dietMarkList) {
106
+            for (TaTargetDietMark dietMark : dietMarkList) {
107
+                dietMark.setTargetId(taShopPackage.getPackageId());
108
+                dietMark.setTargetType(Constants.TARGET_SHOP_PACKAGE);
109
+
110
+                dietMarkMapper.insert(dietMark);
111
+            }
112
+            shopPackageVO.setDietMarkList(dietMarkList);
113
+        }
114
+
115
+        return true;
116
+    }
117
+
118
+    @Override
119
+    public ShopPackageVO getProfileById(String id) {
120
+        ShopPackageVO shopPackageVO = new ShopPackageVO();
121
+
122
+        // 先查询基本信息
123
+        TaShopPackage taShopPackage = getById(id);
124
+        BeanUtils.copyProperties(taShopPackage, shopPackageVO);
125
+
126
+        // 再查配置信息
127
+        LambdaQueryWrapper<TaShopPackageSetting> query1 = new LambdaQueryWrapper<>();
128
+        query1.eq(TaShopPackageSetting::getPackageId, id);
129
+        TaShopPackageSetting shopPackageSetting = shopPackageSettingMapper.selectOne(query1);
130
+        if (null != shopPackageSetting) {
131
+            BeanUtils.copyProperties(shopPackageSetting, shopPackageVO);
132
+        }
133
+
134
+        //
135
+        List<TaTargetDietMark> dietMarkList = dietMarkMapper.getListBy(Constants.TARGET_SHOP_PACKAGE, id);
136
+        shopPackageVO.setDietMarkList(dietMarkList);
137
+
138
+        return shopPackageVO;
139
+    }
140
+
141
+    @Override
142
+    public IPage<ShopPackageVO> getProfilePage(IPage<TaShopPackage> pg, String shopId) {
143
+        return baseMapper.getProfilePage(pg, shopId);
144
+    }
20 145
 }

+ 52
- 4
src/main/java/com/yunzhi/shigongli/service/impl/TaShopServiceImpl.java Целия файл

@@ -1,17 +1,20 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
-import com.yunzhi.shigongli.entity.TaShop;
5
-import com.yunzhi.shigongli.entity.TaShopAccount;
6
-import com.yunzhi.shigongli.mapper.TaShopAccountMapper;
7
-import com.yunzhi.shigongli.mapper.TaShopMapper;
4
+import com.yunzhi.shigongli.common.Constants;
5
+import com.yunzhi.shigongli.entity.*;
6
+import com.yunzhi.shigongli.mapper.*;
8 7
 import com.yunzhi.shigongli.service.ITaShopService;
9 8
 
10 9
 import com.yunzhi.shigongli.vo.ShopListVO;
10
+import org.apache.poi.ss.formula.functions.T;
11 11
 import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.scheduling.annotation.Async;
12 13
 import org.springframework.stereotype.Service;
13 14
 import org.springframework.transaction.annotation.Transactional;
14 15
 
16
+import java.util.List;
17
+
15 18
 /**
16 19
  * <p>
17 20
  * 商铺 服务实现类
@@ -29,6 +32,15 @@ public class TaShopServiceImpl extends BaseServiceImpl<TaShopMapper, TaShop> imp
29 32
     @Autowired
30 33
     TaShopAccountMapper taShopAccountMapper;
31 34
 
35
+    @Autowired
36
+    TaShopImagesMapper imagesMapper;
37
+
38
+    @Autowired
39
+    TaTargetTypeMapper targetTypeMapper;
40
+
41
+    @Autowired
42
+    TaTargetQuotaMapper taTargetQuotaMapper;
43
+
32 44
     @Override
33 45
     public IPage<ShopListVO> getPageListBy(IPage<ShopListVO> pg, String shopName, String phone) {
34 46
         return taShopMapper.getPageListBy(pg, shopName, phone);
@@ -43,5 +55,41 @@ public class TaShopServiceImpl extends BaseServiceImpl<TaShopMapper, TaShop> imp
43 55
         account.setShopId(taShop.getShopId());
44 56
 
45 57
         taShopAccountMapper.insert(account);
58
+
59
+        // 指标表
60
+        TaTargetQuota taTargetQuota = new TaTargetQuota();
61
+        taTargetQuota.setTargetType(Constants.TARGET_SHOP);
62
+        taTargetQuota.setTargetId(taShop.getShopId());
63
+        taTargetQuota.setLikeNum(taShop.getLikeNum());
64
+        taTargetQuota.setPvNum(taShop.getPvNum());
65
+        taTargetQuota.setUvNum(taShop.getUvNum());
66
+        taTargetQuotaMapper.insert(taTargetQuota);
67
+
68
+        // 图片
69
+        if (null != taShop.getImageList()) {
70
+            for (TaShopImages image: taShop.getImageList()) {
71
+                image.setShopId(taShop.getShopId());
72
+                imagesMapper.insert(image);
73
+            }
74
+        }
75
+
76
+        // 分类标签
77
+        if (null != taShop.getTypeList()) {
78
+            for (TaTargetType type: taShop.getTypeList()) {
79
+                type.setTargetType(Constants.TARGET_SHOP);
80
+                type.setTypeId(taShop.getShopId());
81
+                targetTypeMapper.insert(type);
82
+            }
83
+        }
84
+    }
85
+
86
+    @Override
87
+    public boolean updatePVNum(String id) {
88
+        try {
89
+            return taShopMapper.updatePVNum(id) > 0;
90
+        } catch (Exception e) {
91
+            e.printStackTrace();
92
+            return false;
93
+        }
46 94
     }
47 95
 }

+ 10
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaShopWorkerServiceImpl.java Целия файл

@@ -1,9 +1,12 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3 3
 
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.yunzhi.shigongli.entity.TaShopWorker;
5 6
 import com.yunzhi.shigongli.mapper.TaShopWorkerMapper;
6 7
 import com.yunzhi.shigongli.service.ITaShopWorkerService;
8
+import com.yunzhi.shigongli.vo.ShopWorkerListVO;
9
+import org.springframework.beans.factory.annotation.Autowired;
7 10
 import org.springframework.stereotype.Service;
8 11
 
9 12
 /**
@@ -17,4 +20,11 @@ import org.springframework.stereotype.Service;
17 20
 @Service
18 21
 public class TaShopWorkerServiceImpl extends BaseServiceImpl<TaShopWorkerMapper, TaShopWorker> implements ITaShopWorkerService {
19 22
 
23
+    @Autowired
24
+    TaShopWorkerMapper shopWorkerMapper;
25
+
26
+    @Override
27
+    public IPage<ShopWorkerListVO> getPagedListBy(IPage<ShopWorkerListVO> pg, String shopId) {
28
+        return shopWorkerMapper.getPagedListBy(pg, shopId);
29
+    }
20 30
 }

+ 19
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaTargetDietMarkServiceImpl.java Целия файл

@@ -0,0 +1,19 @@
1
+package com.yunzhi.shigongli.service.impl;
2
+
3
+import com.yunzhi.shigongli.entity.TaTargetDietMark;
4
+import com.yunzhi.shigongli.mapper.TaTargetDietMarkMapper;
5
+import com.yunzhi.shigongli.service.ITaTargetDietMarkService;
6
+import org.springframework.stereotype.Service;
7
+
8
+/**
9
+ * <p>
10
+ * 资源时刻表 服务实现类
11
+ * </p>
12
+ *
13
+ * @author yansen
14
+ * @since 2021-08-17
15
+ */
16
+@Service
17
+public class TaTargetDietMarkServiceImpl extends BaseServiceImpl<TaTargetDietMarkMapper, TaTargetDietMark> implements ITaTargetDietMarkService {
18
+
19
+}

+ 73
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaTargetQuotaServiceImpl.java Целия файл

@@ -0,0 +1,73 @@
1
+package com.yunzhi.shigongli.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.yunzhi.shigongli.entity.TaPerson;
5
+import com.yunzhi.shigongli.entity.TaPv;
6
+import com.yunzhi.shigongli.entity.TaTargetQuota;
7
+import com.yunzhi.shigongli.entity.TaUv;
8
+import com.yunzhi.shigongli.mapper.TaPvMapper;
9
+import com.yunzhi.shigongli.mapper.TaTargetQuotaMapper;
10
+import com.yunzhi.shigongli.mapper.TaUvMapper;
11
+import com.yunzhi.shigongli.service.ITaTargetQuotaService;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.scheduling.annotation.Async;
14
+import org.springframework.stereotype.Service;
15
+import org.springframework.transaction.annotation.Transactional;
16
+
17
+import java.time.LocalDateTime;
18
+
19
+/**
20
+ * <p>
21
+ * 访问人 服务实现类
22
+ * </p>
23
+ *
24
+ * @author yansen
25
+ * @since 2021-08-17
26
+ */
27
+@Service
28
+public class TaTargetQuotaServiceImpl extends BaseServiceImpl<TaTargetQuotaMapper, TaTargetQuota> implements ITaTargetQuotaService {
29
+
30
+    @Autowired
31
+    TaPvMapper taPvMapper;
32
+
33
+    @Autowired
34
+    TaUvMapper taUvMapper;
35
+
36
+    @Override
37
+    public TaTargetQuota getByTarget(String targetType, String targetId) {
38
+        LambdaQueryWrapper<TaTargetQuota> queryWrapper = new LambdaQueryWrapper<>();
39
+        queryWrapper.eq(TaTargetQuota::getTargetType, targetType);
40
+        queryWrapper.eq(TaTargetQuota::getTargetId, targetId);
41
+
42
+        return getOne(queryWrapper);
43
+    }
44
+
45
+    @Async
46
+    @Transactional(rollbackFor = Exception.class)
47
+    @Override
48
+    public void recordPerson(String targetType, String targetId, TaPerson taPerson) throws Exception {
49
+        LocalDateTime now = LocalDateTime.now();
50
+        String personId = taPerson.getPersonId();
51
+
52
+        // pv
53
+        TaPv taPv = new TaPv();
54
+        taPv.setTargetType(targetType);
55
+        taPv.setTargetId(targetId);
56
+        taPv.setPersonId(personId);
57
+        taPv.setCreateDate(now);
58
+        taPvMapper.insert(taPv);
59
+        baseMapper.increaseQuota("pv_num", targetType, targetId);
60
+
61
+        // uv
62
+        TaUv taUv = taUvMapper.getByTargetAndPerson(targetType, targetId, personId);
63
+        if (null == taUv) {
64
+            taUv = new TaUv();
65
+            taUv.setTargetType(targetType);
66
+            taUv.setTargetId(targetId);
67
+            taUv.setPersonId(personId);
68
+            taUv.setCreateDate(now);
69
+            taUvMapper.insert(taUv);
70
+            baseMapper.increaseQuota("uv_num", targetType, targetId);
71
+        }
72
+    }
73
+}

+ 61
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaTargetTypeServiceImpl.java Целия файл

@@ -0,0 +1,61 @@
1
+package com.yunzhi.shigongli.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.yunzhi.shigongli.common.StringUtils;
5
+import com.yunzhi.shigongli.entity.TaShopImages;
6
+import com.yunzhi.shigongli.entity.TaTargetType;
7
+import com.yunzhi.shigongli.mapper.TaTargetTypeMapper;
8
+import com.yunzhi.shigongli.service.ITaTargetTypeService;
9
+import org.springframework.stereotype.Service;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 资源分类表 服务实现类
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-08-17
20
+ */
21
+@Service
22
+public class TaTargetTypeServiceImpl extends BaseServiceImpl<TaTargetTypeMapper, TaTargetType> implements ITaTargetTypeService {
23
+
24
+    @Override
25
+    public void updateTypes(String targetType, String targetId, List<TaTargetType> typeList) throws Exception {
26
+        if (null == typeList) {
27
+            throw new Exception("未找到图片列表信息");
28
+        }
29
+
30
+        if (StringUtils.isEmpty(targetType) || StringUtils.isEmpty(targetId)) {
31
+            throw new Exception("分类标签对象信息不完整");
32
+        }
33
+
34
+        // 先删除所有的
35
+        removeByTarget(targetType, targetId);
36
+
37
+        // 再插入新记录
38
+        for (TaTargetType item : typeList) {
39
+            item.setTargetType(targetType);
40
+            item.setTypeId(targetId);
41
+        }
42
+
43
+        saveBatch(typeList);
44
+    }
45
+
46
+    @Override
47
+    public List<TaTargetType> getListBy(String targetType, String targetId) {
48
+        LambdaQueryWrapper<TaTargetType> queryWrapper = new LambdaQueryWrapper<>();
49
+        queryWrapper.eq(TaTargetType::getTargetType, targetType);
50
+        queryWrapper.eq(TaTargetType::getTargetId, targetId);
51
+        return list(queryWrapper);
52
+    }
53
+
54
+    private boolean removeByTarget(String targetType, String targetId) throws Exception {
55
+        LambdaQueryWrapper<TaTargetType> queryWrapper = new LambdaQueryWrapper<>();
56
+        queryWrapper.eq(TaTargetType::getTargetType, targetType);
57
+        queryWrapper.eq(TaTargetType::getTargetId, targetId);
58
+
59
+        return remove(queryWrapper);
60
+    }
61
+}

+ 27
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaTouristServiceImpl.java Целия файл

@@ -1,10 +1,16 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.yunzhi.shigongli.common.Constants;
5
+import com.yunzhi.shigongli.entity.TaTargetQuota;
3 6
 import com.yunzhi.shigongli.entity.TaTourist;
7
+import com.yunzhi.shigongli.mapper.TaTargetQuotaMapper;
4 8
 import com.yunzhi.shigongli.mapper.TaTouristMapper;
5 9
 import com.yunzhi.shigongli.service.ITaTouristService;
6 10
 
11
+import org.springframework.beans.factory.annotation.Autowired;
7 12
 import org.springframework.stereotype.Service;
13
+import org.springframework.transaction.annotation.Transactional;
8 14
 
9 15
 /**
10 16
  * <p>
@@ -17,4 +23,25 @@ import org.springframework.stereotype.Service;
17 23
 @Service
18 24
 public class TaTouristServiceImpl extends BaseServiceImpl<TaTouristMapper, TaTourist> implements ITaTouristService {
19 25
 
26
+    @Autowired
27
+    TaTargetQuotaMapper quotaMapper;
28
+
29
+    @Override
30
+    public IPage<TaTourist> getPagedBy(IPage<TaTourist> pg, String touristName, String cityId) {
31
+        return baseMapper.getPagedBy(pg, touristName, cityId);
32
+    }
33
+
34
+    @Transactional(rollbackFor = Exception.class)
35
+    @Override
36
+    public boolean createNew(TaTourist taTourist) throws Exception {
37
+        boolean isSuccess = save(taTourist);
38
+        if (!isSuccess) return false;
39
+
40
+        TaTargetQuota taTargetQuota = new TaTargetQuota();
41
+        taTargetQuota.setTargetType(Constants.TARGET_TOURIST);
42
+        taTargetQuota.setTargetId(taTourist.getTouristId());
43
+        int row = quotaMapper.insert(taTargetQuota);
44
+
45
+        return row > 0;
46
+    }
20 47
 }

+ 18
- 0
src/main/java/com/yunzhi/shigongli/vo/HotelWorkerListVO.java Целия файл

@@ -0,0 +1,18 @@
1
+package com.yunzhi.shigongli.vo;
2
+
3
+import com.yunzhi.shigongli.entity.TaHotelWorker;
4
+import io.swagger.annotations.ApiModel;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import lombok.Data;
7
+
8
+
9
+@ApiModel(description = "民宿员工列表")
10
+@Data
11
+public class HotelWorkerListVO extends TaHotelWorker {
12
+
13
+    @ApiModelProperty(value = "昵称")
14
+    private String nickName;
15
+
16
+    @ApiModelProperty(value = "头像")
17
+    private String avatar;
18
+}

+ 31
- 0
src/main/java/com/yunzhi/shigongli/vo/ShopPackageVO.java Целия файл

@@ -0,0 +1,31 @@
1
+package com.yunzhi.shigongli.vo;
2
+
3
+import com.yunzhi.shigongli.entity.TaShopPackage;
4
+import com.yunzhi.shigongli.entity.TaTargetDietMark;
5
+import io.swagger.annotations.ApiModel;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.Data;
8
+
9
+import java.util.List;
10
+
11
+
12
+@ApiModel(description = "商品套餐全字段")
13
+@Data
14
+public class ShopPackageVO extends TaShopPackage {
15
+
16
+    @ApiModelProperty(value = "引流分成;单位千分之一")
17
+    private Integer trafficRate;
18
+
19
+    @ApiModelProperty(value = "平台分成;单位千分之一")
20
+    private Integer platformRate;
21
+
22
+    @ApiModelProperty(value = "参与攻略")
23
+    private Boolean isStrategy;
24
+
25
+    @ApiModelProperty(value = "推荐等级")
26
+    private String strategyLevel;
27
+
28
+    @ApiModelProperty(value = "类别")
29
+    private List<TaTargetDietMark> dietMarkList;
30
+
31
+}

+ 17
- 0
src/main/java/com/yunzhi/shigongli/vo/ShopWorkerListVO.java Целия файл

@@ -0,0 +1,17 @@
1
+package com.yunzhi.shigongli.vo;
2
+
3
+import com.yunzhi.shigongli.entity.TaShopWorker;
4
+import io.swagger.annotations.ApiModel;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import lombok.Data;
7
+
8
+@ApiModel(description = "商铺员工列表")
9
+@Data
10
+public class ShopWorkerListVO extends TaShopWorker {
11
+
12
+    @ApiModelProperty(value = "昵称")
13
+    private String nickName;
14
+
15
+    @ApiModelProperty(value = "头像")
16
+    private String avatar;
17
+}

+ 16
- 0
src/main/resources/mapper/TaHotelWorkerMapper.xml Целия файл

@@ -2,4 +2,20 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.shigongli.mapper.TaHotelWorkerMapper">
4 4
 
5
+    <select id="getPagedListBy" resultType="com.yunzhi.shigongli.vo.HotelWorkerListVO">
6
+        SELECT
7
+            t.*,
8
+            s.nick_name,
9
+            s.avatar
10
+        FROM
11
+            ta_hotel_worker t
12
+                LEFT JOIN ta_person s ON t.person_id = s.person_id
13
+        WHERE
14
+            t.`status` &gt; - 1
15
+          <if test="hotelId != null and hotelId != ''">
16
+              AND t.hotel_id = #{hotelId}
17
+          </if>
18
+        ORDER BY
19
+            t.create_date DESC
20
+    </select>
5 21
 </mapper>

+ 5
- 0
src/main/resources/mapper/TaNotificationMapper.xml Целия файл

@@ -0,0 +1,5 @@
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.yunzhi.shigongli.mapper.TaNotificationMapper">
4
+
5
+</mapper>

+ 10
- 4
src/main/resources/mapper/TaShopMapper.xml Целия файл

@@ -1,6 +1,12 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.shigongli.mapper.TaShopMapper">
4
+    <update id="updatePVNum">
5
+        UPDATE ta_shop t
6
+        SET t.pv_num = IFNULL( t.pv_num, 0 ) + 1
7
+        WHERE
8
+            t.shop_id = #{id}
9
+    </update>
4 10
 
5 11
     <select id="getPageListBy" resultType="com.yunzhi.shigongli.vo.ShopListVO">
6 12
         SELECT
@@ -8,7 +14,7 @@
8 14
             s.brokerage_charges,
9 15
             s.paid_charges,
10 16
             s.brokerage_charges - s.paid_charges AS unpaid_charges,
11
-            m.phone,
17
+            t.phone,
12 18
             ( SELECT count( 1 ) FROM ta_shop_worker a WHERE a.shop_id = t.shop_id AND a.`status` &gt; -1 ) AS worker_num,
13 19
             IFNULL(
14 20
                     ( SELECT sum( b.charges ) FROM ta_order_sub b WHERE b.shop_id = t.shop_id AND b.`status` &gt; -1 ),
@@ -18,15 +24,15 @@
18 24
         FROM
19 25
             ta_shop t
20 26
                 INNER JOIN ta_shop_account s ON t.shop_id = s.shop_id
21
-                LEFT JOIN ta_shop_worker m ON t.shop_id = m.shop_id
22
-                AND m.is_manager = 1
27
+--                 LEFT JOIN ta_shop_worker m ON t.shop_id = m.shop_id
28
+--                 AND m.is_manager = 1
23 29
         WHERE
24 30
             t.`status` &gt; - 1
25 31
           <if test="shopName != null and shopName != ''">
26 32
               AND t.shop_name LIKE CONCAT( '%', #{shopName}, '%' )
27 33
           </if>
28 34
           <if test="phone != null and phone != ''">
29
-              AND m.phone LIKE CONCAT( '%', #{phone}, '%' )
35
+              AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
30 36
           </if>
31 37
         ORDER BY
32 38
             t.weight DESC,

+ 19
- 0
src/main/resources/mapper/TaShopPackageMapper.xml Целия файл

@@ -2,4 +2,23 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.shigongli.mapper.TaShopPackageMapper">
4 4
 
5
+    <select id="getProfilePage" resultType="com.yunzhi.shigongli.vo.ShopPackageVO">
6
+        SELECT
7
+            t.*,
8
+            s.traffic_rate,
9
+            s.platform_rate,
10
+            s.is_strategy,
11
+            s.strategy_level
12
+        FROM
13
+            ta_shop_package t
14
+                INNER JOIN ta_shop_package_setting s ON t.package_id = s.package_id
15
+        WHERE
16
+            t.`status` &gt; - 1
17
+          <if test="shopId != null and shopId != ''">
18
+              AND t.shop_id = #{shopId}
19
+          </if>
20
+        ORDER BY
21
+            t.weight DESC,
22
+            t.create_date DESC
23
+    </select>
5 24
 </mapper>

+ 16
- 0
src/main/resources/mapper/TaShopWorkerMapper.xml Целия файл

@@ -2,4 +2,20 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.shigongli.mapper.TaShopWorkerMapper">
4 4
 
5
+    <select id="getPagedListBy" resultType="com.yunzhi.shigongli.vo.ShopWorkerListVO">
6
+        SELECT
7
+            t.*,
8
+            s.nick_name,
9
+            s.avatar
10
+        FROM
11
+            ta_shop_worker t
12
+                LEFT JOIN ta_person s ON t.person_id = s.person_id
13
+        WHERE
14
+            t.`status` &gt; - 1
15
+        <if test="shopId != null and shopId != ''">
16
+            AND t.shop_id = #{shopId}
17
+        </if>
18
+        ORDER BY
19
+            t.create_date DESC
20
+    </select>
5 21
 </mapper>

+ 16
- 0
src/main/resources/mapper/TaTargetDietMarkMapper.xml Целия файл

@@ -0,0 +1,16 @@
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.yunzhi.shigongli.mapper.TaTargetDietMarkMapper">
4
+
5
+    <select id="getListBy" resultType="com.yunzhi.shigongli.entity.TaTargetDietMark">
6
+        SELECT
7
+            *
8
+        FROM
9
+            ta_target_diet_mark t
10
+        WHERE
11
+            t.target_type = #{targetType}
12
+          AND t.target_id = #{targetId}
13
+        ORDER BY
14
+            t.mark_no ASC
15
+    </select>
16
+</mapper>

+ 12
- 0
src/main/resources/mapper/TaTargetQuotaMapper.xml Целия файл

@@ -0,0 +1,12 @@
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.yunzhi.shigongli.mapper.TaTargetQuotaMapper">
4
+
5
+    <update id="increaseQuota">
6
+        UPDATE ta_target_quota
7
+        SET ${quota} = IFNULL( ${quota}, 0 ) + 1
8
+        WHERE
9
+            target_type = #{targetType}
10
+          AND target_id = #{targetId}
11
+    </update>
12
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaTargetTypeMapper.xml Целия файл

@@ -0,0 +1,5 @@
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.yunzhi.shigongli.mapper.TaTargetTypeMapper">
4
+
5
+</mapper>

+ 22
- 0
src/main/resources/mapper/TaTouristMapper.xml Целия файл

@@ -2,4 +2,26 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.shigongli.mapper.TaTouristMapper">
4 4
 
5
+    <select id="getPagedBy" resultType="com.yunzhi.shigongli.entity.TaTourist">
6
+        SELECT
7
+            t.*,
8
+            s.like_num,
9
+            s.pv_num,
10
+            s.uv_num
11
+        FROM
12
+            ta_tourist t
13
+                LEFT JOIN ta_target_quota s ON s.target_type = 'tourist'
14
+                AND s.target_id = t.tourist_id
15
+        WHERE
16
+            t.`status` &gt; - 1
17
+          <if test="touristName != null and touristName != ''">
18
+              AND t.tourist_name LIKE CONCAT( '%', #{touristName}, '%' )
19
+          </if>
20
+          <if test="cityId != null and cityId != ''">
21
+              AND t.city_id = #{cityId}
22
+          </if>
23
+        ORDER BY
24
+            t.weight DESC,
25
+            t.create_date DESC
26
+    </select>
5 27
 </mapper>

+ 10
- 0
src/main/resources/mapper/TaUvMapper.xml Целия файл

@@ -2,4 +2,14 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.shigongli.mapper.TaUvMapper">
4 4
 
5
+    <select id="getByTargetAndPerson" resultType="com.yunzhi.shigongli.entity.TaUv">
6
+        SELECT
7
+            *
8
+        FROM
9
+            ta_uv t
10
+        WHERE
11
+            t.target_type = #{targetType}
12
+          AND t.target_id = #{targetId}
13
+          AND t.person_id = #{personId}
14
+    </select>
5 15
 </mapper>