张延森 3 år sedan
förälder
incheckning
29374bd3f9
25 ändrade filer med 383 tillägg och 61 borttagningar
  1. 45
    0
      src/main/java/com/yunzhi/shigongli/common/Weather.java
  2. 15
    8
      src/main/java/com/yunzhi/shigongli/controller/TaFeedbackController.java
  3. 9
    2
      src/main/java/com/yunzhi/shigongli/controller/TaLikeController.java
  4. 15
    9
      src/main/java/com/yunzhi/shigongli/controller/TaOrderSubController.java
  5. 8
    9
      src/main/java/com/yunzhi/shigongli/controller/TaRoomOrderController.java
  6. 26
    20
      src/main/java/com/yunzhi/shigongli/controller/TaSaveController.java
  7. 5
    0
      src/main/java/com/yunzhi/shigongli/entity/TaFeedback.java
  8. 3
    0
      src/main/java/com/yunzhi/shigongli/entity/TaVerifyTarget.java
  9. 7
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaFeedbackMapper.java
  10. 6
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaOrderSubMapper.java
  11. 7
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaSaveMapper.java
  12. 6
    0
      src/main/java/com/yunzhi/shigongli/service/ITaFeedbackService.java
  13. 3
    0
      src/main/java/com/yunzhi/shigongli/service/ITaOrderSubService.java
  14. 5
    0
      src/main/java/com/yunzhi/shigongli/service/ITaSaveService.java
  15. 12
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaFeedbackServiceImpl.java
  16. 1
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaOrderPayServiceImpl.java
  17. 6
    6
      src/main/java/com/yunzhi/shigongli/service/impl/TaOrderSubServiceImpl.java
  18. 9
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaSaveServiceImpl.java
  19. 27
    0
      src/main/java/com/yunzhi/shigongli/vo/OrderSubListVO.java
  20. 50
    0
      src/main/java/com/yunzhi/shigongli/vo/SavedVO.java
  21. 1
    1
      src/main/resources/application.yml
  22. 26
    0
      src/main/resources/mapper/TaFeedbackMapper.xml
  23. 28
    3
      src/main/resources/mapper/TaOrderSubMapper.xml
  24. 61
    0
      src/main/resources/mapper/TaSaveMapper.xml
  25. 2
    3
      src/main/resources/mapper/TaVerifyTargetMapper.xml

+ 45
- 0
src/main/java/com/yunzhi/shigongli/common/Weather.java Visa fil

@@ -9,6 +9,8 @@ import org.springframework.http.ResponseEntity;
9 9
 import org.springframework.stereotype.Component;
10 10
 import org.springframework.web.client.RestTemplate;
11 11
 
12
+import java.util.Arrays;
13
+
12 14
 @Slf4j
13 15
 @Component
14 16
 public class Weather {
@@ -16,6 +18,43 @@ public class Weather {
16 18
     @Value("${amap.weather.api}")
17 19
     String api;
18 20
 
21
+    @Value("${amap.weather.backImage}")
22
+    private String backImage;
23
+
24
+    // 默认支持的背景图片
25
+    private String[] imageList = new String[] {
26
+            "中雨",
27
+            "中雪",
28
+            "冰雹",
29
+            "冻雨",
30
+            "多云",
31
+            "夜晚多云",
32
+            "夜晚扬沙",
33
+            "夜晚晴",
34
+            "夜晚沙尘暴",
35
+            "夜晚阵雨",
36
+            "夜晚降雪",
37
+            "夜晚雾",
38
+            "大雨",
39
+            "大雪",
40
+            "大雾",
41
+            "大风",
42
+            "小雨",
43
+            "小雪",
44
+            "无数据",
45
+            "晴",
46
+            "暴雨",
47
+            "暴雪",
48
+            "沙尘暴",
49
+            "阴",
50
+            "阵雨",
51
+            "阵雪",
52
+            "雨夹雪",
53
+            "雷阵雨",
54
+            "雷阵雨伴有冰雹",
55
+            "雾"
56
+    };
57
+
19 58
     public AMapWeather getWeather(String areaId) throws Exception {
20 59
         RestTemplate restTemplate = new RestTemplate();
21 60
 
@@ -46,4 +85,10 @@ public class Weather {
46 85
 
47 86
         return result;
48 87
     }
88
+
89
+    public String getBackgroundImage(String weatherName) {
90
+        boolean isExist = Arrays.stream(imageList).anyMatch(x -> x.equals(weatherName));
91
+        String imageName = isExist ? weatherName : "无数据";
92
+        return  String.format(backImage, imageName);
93
+    }
49 94
 }

+ 15
- 8
src/main/java/com/yunzhi/shigongli/controller/TaFeedbackController.java Visa fil

@@ -4,7 +4,9 @@ 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.DateUtils;
7 8
 import com.yunzhi.shigongli.common.ResponseBean;
9
+import com.yunzhi.shigongli.common.StringUtils;
8 10
 import io.swagger.annotations.Api;
9 11
 import io.swagger.annotations.ApiOperation;
10 12
 import io.swagger.annotations.ApiParam;
@@ -52,20 +54,25 @@ public class TaFeedbackController extends BaseController {
52 54
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
53 55
     public ResponseBean taFeedbackList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
54 56
                                        @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
55
-                                       @ApiParam("是否管理首页") @RequestParam(value = "isIndex", required = false) Boolean isIndex ) throws Exception{
57
+                                       @ApiParam(value = "开始时间", example = "2021-09-01") @RequestParam(value ="start", required = false) String start,
58
+                                       @ApiParam(value = "结束时间", example = "2021-09-30") @RequestParam(value ="end", required = false) String end) throws Exception{
56 59
 
57 60
         IPage<TaFeedback> pg = new Page<>(pageNum, pageSize);
58 61
         QueryWrapper<TaFeedback> queryWrapper = new QueryWrapper<>();
59 62
         queryWrapper.orderByDesc("create_date");
60 63
 
61
-        if (null != isIndex && isIndex) {
62
-            // 只查询近3天的, 且未读的数据
63
-            LocalDateTime dt = LocalDateTime.now().minusDays(3);
64
-            queryWrapper.ge("create_date", dt);
65
-            queryWrapper.eq("is_readed", 0);
64
+        LocalDateTime startDate = null;
65
+        LocalDateTime endDate = null;
66
+
67
+        if (!StringUtils.isEmpty(start)) {
68
+            startDate = DateUtils.from(start + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
69
+        }
70
+
71
+        if (!StringUtils.isEmpty(end)) {
72
+            endDate = DateUtils.from(end + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
66 73
         }
67 74
 
68
-        IPage<TaFeedback> result = iTaFeedbackService.page(pg, queryWrapper);
75
+        IPage<TaFeedback> result = iTaFeedbackService.getProfilePage(pg, startDate, endDate);
69 76
         return ResponseBean.success(result);
70 77
     }
71 78
 
@@ -124,7 +131,7 @@ public class TaFeedbackController extends BaseController {
124 131
     @RequestMapping(value="/admin/taFeedback/{id}",method= RequestMethod.GET)
125 132
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
126 133
     public ResponseBean taFeedbackGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
127
-        TaFeedback feedback = iTaFeedbackService.getById(id);
134
+        TaFeedback feedback = iTaFeedbackService.getProfileById(id);
128 135
 
129 136
         // 更新为已读
130 137
         if (null == feedback.getIsReaded() || !feedback.getIsReaded()) {

+ 9
- 2
src/main/java/com/yunzhi/shigongli/controller/TaLikeController.java Visa fil

@@ -67,7 +67,8 @@ public class TaLikeController extends BaseController {
67 67
 
68 68
     /**
69 69
      * 保存对象
70
-     * @param taLike 实体对象
70
+     * @param targetType 实体对象
71
+     * @param targetId 实体对象
71 72
      * @return
72 73
      */
73 74
     @RequestMapping(value="/wx/{targetType}/like/{targetId}",method= RequestMethod.POST)
@@ -75,10 +76,16 @@ public class TaLikeController extends BaseController {
75 76
     public ResponseBean taLikeAdd(@ApiParam("对象类型") @PathVariable String targetType,
76 77
                                   @ApiParam("对象ID") @PathVariable String targetId) throws Exception{
77 78
 
79
+        String personId = getCurrentPerson().getPersonId();
80
+        TaLike origin = iTaLikeService.getByTarget(targetType, targetId, personId);
81
+        if (null != origin) {
82
+            return ResponseBean.success(origin);
83
+        }
84
+
78 85
         TaLike taLike = new TaLike();
79 86
         taLike.setTargetType(targetType);
80 87
         taLike.setTargetId(targetId);
81
-        taLike.setPersonId(getCurrentPerson().getPersonId());
88
+        taLike.setPersonId(personId);
82 89
         taLike.setCreateDate(LocalDateTime.now());
83 90
         if (iTaLikeService.save(taLike)){
84 91
             iTaResourceService.updateLike(taLike, 1);

+ 15
- 9
src/main/java/com/yunzhi/shigongli/controller/TaOrderSubController.java Visa fil

@@ -4,9 +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.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
7
-import com.yunzhi.shigongli.common.BaseController;
8
-import com.yunzhi.shigongli.common.Constants;
9
-import com.yunzhi.shigongli.common.ResponseBean;
7
+import com.yunzhi.shigongli.common.*;
10 8
 import com.yunzhi.shigongli.entity.TaOrder;
11 9
 import com.yunzhi.shigongli.entity.TaPerson;
12 10
 import com.yunzhi.shigongli.service.ITaOrderPayService;
@@ -14,6 +12,7 @@ import com.yunzhi.shigongli.service.ITaOrderService;
14 12
 import com.yunzhi.shigongli.service.ITaVerifyTargetService;
15 13
 import com.yunzhi.shigongli.vo.MineOrder;
16 14
 import com.yunzhi.shigongli.vo.MineOrderSummary;
15
+import com.yunzhi.shigongli.vo.OrderSubListVO;
17 16
 import io.swagger.annotations.Api;
18 17
 import io.swagger.annotations.ApiOperation;
19 18
 import io.swagger.annotations.ApiParam;
@@ -25,6 +24,7 @@ import com.yunzhi.shigongli.service.ITaOrderSubService;
25 24
 import com.yunzhi.shigongli.entity.TaOrderSub;
26 25
 
27 26
 import javax.servlet.http.HttpServletRequest;
27
+import java.time.LocalDateTime;
28 28
 
29 29
 /**
30 30
  * <p>
@@ -63,14 +63,20 @@ public class TaOrderSubController extends BaseController {
63 63
     @RequestMapping(value="/admin/taOrderSub",method= RequestMethod.GET)
64 64
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
65 65
     public ResponseBean taOrderSubList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
66
-                                       @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
66
+                                       @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
67
+                                       @ApiParam("商家名称") @RequestParam(value = "shopName", required = false) String shopName,
68
+                                       @ApiParam("标题") @RequestParam(value = "description", required = false) String description,
69
+                                       @ApiParam(value = "下单时间", example = "2021-09-01") @RequestParam(value = "createDate", required = false) String createDate) throws Exception{
67 70
 
68
-		    IPage<TaOrderSub> pg = new Page<>(pageNum, pageSize);
69
-            QueryWrapper<TaOrderSub> queryWrapper = new QueryWrapper<>();
70
-            queryWrapper.orderByDesc("create_date");
71
+        IPage<OrderSubListVO> pg = new Page<>(pageNum, pageSize);
71 72
 
72
-            IPage<TaOrderSub> result = iTaOrderSubService.page(pg, queryWrapper);
73
-            return ResponseBean.success(result);
73
+        LocalDateTime date = null;
74
+        if (!StringUtils.isEmpty(createDate)) {
75
+            date = DateUtils.from(createDate + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
76
+        }
77
+
78
+        IPage<OrderSubListVO> result = iTaOrderSubService.getAdminPagedBy(pg, shopName, description, date);
79
+        return ResponseBean.success(result);
74 80
     }
75 81
 
76 82
     /**

+ 8
- 9
src/main/java/com/yunzhi/shigongli/controller/TaRoomOrderController.java Visa fil

@@ -59,9 +59,6 @@ public class TaRoomOrderController extends BaseController {
59 59
     @Autowired
60 60
     public ImageUtils imageUtils;
61 61
 
62
-    @Value("${amap.weather.backImage}")
63
-    private String backImage;
64
-
65 62
     /**
66 63
      * 分页查询列表
67 64
      * @param pageNum
@@ -116,10 +113,11 @@ public class TaRoomOrderController extends BaseController {
116 113
 //            return ResponseBean.error("民宿不存在或者状态异常", ResponseBean.ERROR_ILLEGAL_PARAMS);
117 114
 //        }
118 115
 
119
-        // 地区暂时是南京市秦淮区
120
-        AMapWeather weather = weatherUtil.getWeather("320104");
121
-        AMapWeather.Live live = weather.getLives().get(0);
122
-        String image = imageUtils.renderWeatherPic(live, String.format(backImage, "晴"));
116
+        // 地区暂时是南京市
117
+        AMapWeather weather = weatherUtil.getWeather("320100");
118
+        AMapWeather.Live liveWeather = weather.getLives().get(0);
119
+        String backgroundUrl = weatherUtil.getBackgroundImage(liveWeather.getWeather());
120
+        String image = imageUtils.renderWeatherPic(liveWeather, backgroundUrl);
123 121
 
124 122
         taRoomOrder.setHotelId(taRoom.getHotelId());
125 123
         taRoomOrder.setSharePerson(getCurrentPerson().getPersonId());
@@ -179,8 +177,9 @@ public class TaRoomOrderController extends BaseController {
179 177
     @GetMapping("/test-weather")
180 178
     public ResponseBean testWeather() throws Exception {
181 179
         AMapWeather weather = weatherUtil.getWeather("320105");
182
-
183
-        String image = imageUtils.renderWeatherPic(weather.getLives().get(0), "https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/weather/background_%E6%99%B4.png");
180
+        AMapWeather.Live liveWeather = weather.getLives().get(0);
181
+        String backgroundUrl = weatherUtil.getBackgroundImage(liveWeather.getWeather());
182
+        String image = imageUtils.renderWeatherPic(liveWeather, backgroundUrl);
184 183
 
185 184
         return ResponseBean.success(image);
186 185
     }

+ 26
- 20
src/main/java/com/yunzhi/shigongli/controller/TaSaveController.java Visa fil

@@ -10,6 +10,7 @@ import com.yunzhi.shigongli.entity.TaLike;
10 10
 import com.yunzhi.shigongli.entity.TaSave;
11 11
 import com.yunzhi.shigongli.service.ITaResourceService;
12 12
 import com.yunzhi.shigongli.service.ITaSaveService;
13
+import com.yunzhi.shigongli.vo.SavedVO;
13 14
 import io.swagger.annotations.Api;
14 15
 import io.swagger.annotations.ApiOperation;
15 16
 import io.swagger.annotations.ApiParam;
@@ -42,25 +43,23 @@ public class TaSaveController extends BaseController {
42 43
     @Autowired
43 44
     public ITaResourceService iTaResourceService;
44 45
 
45
-//
46
-//    /**
47
-//     * 分页查询列表
48
-//     * @param pageNum
49
-//     * @param pageSize
50
-//     * @return
51
-//     */
52
-//    @RequestMapping(value="/admin/save",method= RequestMethod.GET)
53
-//    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
54
-//    public ResponseBean taLikeList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
-//									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
56
-//
57
-//		    IPage<TaSave> pg = new Page<>(pageNum, pageSize);
58
-//            QueryWrapper<TaSave> queryWrapper = new QueryWrapper<>();
59
-//            queryWrapper.orderByDesc("create_date");
60
-//
61
-//            IPage<TaSave> result = iTaSaveService.page(pg, queryWrapper);
62
-//            return ResponseBean.success(result);
63
-//    }
46
+
47
+    /**
48
+     * 分页查询列表
49
+     * @param pageNum
50
+     * @param pageSize
51
+     * @return
52
+     */
53
+    @RequestMapping(value="/wx/save",method= RequestMethod.GET)
54
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
55
+    public ResponseBean taLikeList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
+                                   @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+                                   @ApiParam("定位地址") @RequestParam(value ="location") String location) throws Exception{
58
+
59
+        IPage<SavedVO> pg = new Page<>(pageNum, pageSize);
60
+        IPage<SavedVO> result = iTaSaveService.getPageBy(pg, getCurrentPerson().getPersonId(), location);
61
+        return ResponseBean.success(result);
62
+    }
64 63
 
65 64
     /**
66 65
      * 保存对象
@@ -70,10 +69,17 @@ public class TaSaveController extends BaseController {
70 69
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
71 70
     public ResponseBean taLikeAdd(@ApiParam("对象类型") @PathVariable String targetType,
72 71
                                   @ApiParam("对象ID") @PathVariable String targetId) throws Exception{
72
+
73
+        String personId = getCurrentPerson().getPersonId();
74
+        TaSave origin = iTaSaveService.getByTarget(targetType, targetId, personId);
75
+        if (null != origin) {
76
+            return ResponseBean.success(origin);
77
+        }
78
+
73 79
         TaSave taSave = new TaSave();
74 80
         taSave.setTargetType(targetType);
75 81
         taSave.setTargetId(targetId);
76
-        taSave.setPersonId(getCurrentPerson().getPersonId());
82
+        taSave.setPersonId(personId);
77 83
         taSave.setCreateDate(LocalDateTime.now());
78 84
 
79 85
         if (iTaSaveService.save(taSave)){

+ 5
- 0
src/main/java/com/yunzhi/shigongli/entity/TaFeedback.java Visa fil

@@ -1,6 +1,7 @@
1 1
 package com.yunzhi.shigongli.entity;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import java.time.LocalDateTime;
6 7
 import java.io.Serializable;
@@ -45,4 +46,8 @@ public class TaFeedback implements Serializable {
45 46
     @ApiModelProperty(value = "读取时间")
46 47
     private LocalDateTime readDate;
47 48
 
49
+    @ApiModelProperty(value = "手机号码")
50
+    @TableField(exist = false)
51
+    private String phone;
52
+
48 53
 }

+ 3
- 0
src/main/java/com/yunzhi/shigongli/entity/TaVerifyTarget.java Visa fil

@@ -67,6 +67,9 @@ public class TaVerifyTarget implements Serializable {
67 67
     @ApiModelProperty(value = "子单号")
68 68
     private String subOrderId;
69 69
 
70
+    @ApiModelProperty(value = "所属商户")
71
+    private String shopId;
72
+
70 73
     @ApiModelProperty(value = "所属客户")
71 74
     private String personId;
72 75
 

+ 7
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaFeedbackMapper.java Visa fil

@@ -1,8 +1,12 @@
1 1
 package com.yunzhi.shigongli.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaFeedback;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
8
+
9
+import java.time.LocalDateTime;
6 10
 
7 11
 /**
8 12
  * <p>
@@ -15,4 +19,7 @@ import org.apache.ibatis.annotations.Mapper;
15 19
 @Mapper
16 20
 public interface TaFeedbackMapper extends BaseMapper<TaFeedback> {
17 21
 
22
+    TaFeedback getProfileById(Integer id);
23
+
24
+    IPage<TaFeedback> getProfilePage(IPage<TaFeedback> pg, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
18 25
 }

+ 6
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaOrderSubMapper.java Visa fil

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.yunzhi.shigongli.entity.TaOrderSub;
5 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6 6
 import com.yunzhi.shigongli.vo.MineOrder;
7
+import com.yunzhi.shigongli.vo.OrderSubListVO;
7 8
 import org.apache.ibatis.annotations.Mapper;
8 9
 import org.apache.ibatis.annotations.Param;
9 10
 import org.apache.ibatis.annotations.Select;
@@ -46,4 +47,9 @@ public interface TaOrderSubMapper extends BaseMapper<TaOrderSub> {
46 47
 
47 48
 
48 49
     MineOrder getSingleOrderSubOf(@Param("personId") String personId, @Param("targetType") String targetType, @Param("subOrderId") Integer subOrderId);
50
+
51
+    IPage<OrderSubListVO> getAdminPagedBy(IPage<OrderSubListVO> pg,
52
+                                          @Param("shopName") String shopName,
53
+                                          @Param("description") String description,
54
+                                          @Param("createDate") LocalDateTime createDate);
49 55
 }

+ 7
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaSaveMapper.java Visa fil

@@ -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.TaSave;
6
+import com.yunzhi.shigongli.vo.SavedVO;
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,8 @@ import org.apache.ibatis.annotations.Mapper;
15 18
 @Mapper
16 19
 public interface TaSaveMapper extends BaseMapper<TaSave> {
17 20
 
21
+    IPage<SavedVO> getPageBy(IPage<SavedVO> pg,
22
+                             @Param("personId") String personId,
23
+                             @Param("location") String location,
24
+                             @Param("targetShopPackage") String targetShopPackage);
18 25
 }

+ 6
- 0
src/main/java/com/yunzhi/shigongli/service/ITaFeedbackService.java Visa fil

@@ -1,7 +1,10 @@
1 1
 package com.yunzhi.shigongli.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.yunzhi.shigongli.entity.TaFeedback;
4 5
 
6
+import java.time.LocalDateTime;
7
+
5 8
 
6 9
 /**
7 10
  * <p>
@@ -13,4 +16,7 @@ import com.yunzhi.shigongli.entity.TaFeedback;
13 16
  */
14 17
 public interface ITaFeedbackService extends IBaseService<TaFeedback> {
15 18
 
19
+    TaFeedback getProfileById(Integer id);
20
+
21
+    IPage<TaFeedback> getProfilePage(IPage<TaFeedback> pg, LocalDateTime startDate, LocalDateTime endDate);
16 22
 }

+ 3
- 0
src/main/java/com/yunzhi/shigongli/service/ITaOrderSubService.java Visa fil

@@ -7,6 +7,7 @@ import com.yunzhi.shigongli.entity.TaOrderSub;
7 7
 import com.yunzhi.shigongli.entity.TaPerson;
8 8
 import com.yunzhi.shigongli.vo.MineOrder;
9 9
 import com.yunzhi.shigongli.vo.MineOrderSummary;
10
+import com.yunzhi.shigongli.vo.OrderSubListVO;
10 11
 
11 12
 import java.time.LocalDateTime;
12 13
 import java.util.List;
@@ -34,4 +35,6 @@ public interface ITaOrderSubService extends IBaseService<TaOrderSub> {
34 35
     Integer getTotalCharges(String targetType, String targetId, LocalDateTime start, LocalDateTime end);
35 36
 
36 37
     MineOrder getSingleOrderSubOf(TaPerson taPerson, Integer subOrderId);
38
+
39
+    IPage<OrderSubListVO> getAdminPagedBy(IPage<OrderSubListVO> pg, String shopName, String description, LocalDateTime createDate);
37 40
 }

+ 5
- 0
src/main/java/com/yunzhi/shigongli/service/ITaSaveService.java Visa fil

@@ -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.TaSave;
5
+import com.yunzhi.shigongli.vo.SavedVO;
4 6
 
5 7
 
6 8
 /**
@@ -16,4 +18,7 @@ public interface ITaSaveService extends IBaseService<TaSave> {
16 18
     boolean removeBy(String targetType, String targetId, String personId);
17 19
 
18 20
     TaSave getByTarget(String targetType, String targetId, String personId);
21
+
22
+    IPage<SavedVO> getPageBy(IPage<SavedVO> pg, String personId, String location);
23
+
19 24
 }

+ 12
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaFeedbackServiceImpl.java Visa fil

@@ -1,11 +1,14 @@
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.TaFeedback;
4 5
 import com.yunzhi.shigongli.mapper.TaFeedbackMapper;
5 6
 import com.yunzhi.shigongli.service.ITaFeedbackService;
6 7
 
7 8
 import org.springframework.stereotype.Service;
8 9
 
10
+import java.time.LocalDateTime;
11
+
9 12
 /**
10 13
  * <p>
11 14
  * 意见反馈 服务实现类
@@ -17,4 +20,13 @@ import org.springframework.stereotype.Service;
17 20
 @Service
18 21
 public class TaFeedbackServiceImpl extends BaseServiceImpl<TaFeedbackMapper, TaFeedback> implements ITaFeedbackService {
19 22
 
23
+    @Override
24
+    public TaFeedback getProfileById(Integer id) {
25
+        return baseMapper.getProfileById(id);
26
+    }
27
+
28
+    @Override
29
+    public IPage<TaFeedback> getProfilePage(IPage<TaFeedback> pg, LocalDateTime startDate, LocalDateTime endDate) {
30
+        return baseMapper.getProfilePage(pg, startDate, endDate);
31
+    }
20 32
 }

+ 1
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaOrderPayServiceImpl.java Visa fil

@@ -147,6 +147,7 @@ public class TaOrderPayServiceImpl extends BaseServiceImpl<TaOrderPayMapper, TaO
147 147
                 taVerifyTarget.setOrderDate(item.getCreateDate());
148 148
                 taVerifyTarget.setOrderId(item.getOrderId());
149 149
                 taVerifyTarget.setSubOrderId(item.getSubOrderId());
150
+                taVerifyTarget.setShopId(item.getShopId());
150 151
                 taVerifyTarget.setPersonId(taPerson.getPersonId());
151 152
                 taVerifyTarget.setIsVerified(false);
152 153
                 taVerifyTarget.setIsConfirmVerified(false);

+ 6
- 6
src/main/java/com/yunzhi/shigongli/service/impl/TaOrderSubServiceImpl.java Visa fil

@@ -9,6 +9,7 @@ import com.yunzhi.shigongli.service.ITaOrderSubService;
9 9
 
10 10
 import com.yunzhi.shigongli.vo.MineOrder;
11 11
 import com.yunzhi.shigongli.vo.MineOrderSummary;
12
+import com.yunzhi.shigongli.vo.OrderSubListVO;
12 13
 import org.springframework.beans.factory.annotation.Autowired;
13 14
 import org.springframework.stereotype.Service;
14 15
 import org.springframework.transaction.annotation.Transactional;
@@ -105,12 +106,6 @@ public class TaOrderSubServiceImpl extends BaseServiceImpl<TaOrderSubMapper, TaO
105 106
 
106 107
     @Override
107 108
     public IPage<MineOrder> getOrderSubListOf(IPage<MineOrder> pg, TaPerson taPerson, Integer status, String orderId, Integer isVerified) {
108
-        if (null != isVerified && isVerified > 0) {
109
-            isVerified = 1;
110
-        } else {
111
-            isVerified = null;
112
-        }
113
-
114 109
         return baseMapper.getOrderSubListOf(pg, taPerson.getPersonId(), Constants.TARGET_SHOP, status, orderId, isVerified);
115 110
     }
116 111
 
@@ -145,6 +140,11 @@ public class TaOrderSubServiceImpl extends BaseServiceImpl<TaOrderSubMapper, TaO
145 140
         return baseMapper.getSingleOrderSubOf(taPerson.getPersonId(), Constants.TARGET_SHOP, subOrderId);
146 141
     }
147 142
 
143
+    @Override
144
+    public IPage<OrderSubListVO> getAdminPagedBy(IPage<OrderSubListVO> pg, String shopName, String description, LocalDateTime createDate) {
145
+        return baseMapper.getAdminPagedBy(pg, shopName, description, createDate);
146
+    }
147
+
148 148
     /**
149 149
      * 商铺抽成入账户
150 150
      * @param shopId

+ 9
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaSaveServiceImpl.java Visa fil

@@ -1,9 +1,12 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.yunzhi.shigongli.common.Constants;
4 6
 import com.yunzhi.shigongli.entity.TaSave;
5 7
 import com.yunzhi.shigongli.mapper.TaSaveMapper;
6 8
 import com.yunzhi.shigongli.service.ITaSaveService;
9
+import com.yunzhi.shigongli.vo.SavedVO;
7 10
 import org.springframework.stereotype.Service;
8 11
 
9 12
 /**
@@ -34,4 +37,10 @@ public class TaSaveServiceImpl extends BaseServiceImpl<TaSaveMapper, TaSave> imp
34 37
         queryWrapper.eq(TaSave::getPersonId, personId);
35 38
         return getOne(queryWrapper);
36 39
     }
40
+
41
+    @Override
42
+    public IPage<SavedVO> getPageBy(IPage<SavedVO> pg, String personId, String location) {
43
+        return baseMapper.getPageBy(pg, personId, location, Constants.TARGET_SHOP_PACKAGE);
44
+    }
45
+
37 46
 }

+ 27
- 0
src/main/java/com/yunzhi/shigongli/vo/OrderSubListVO.java Visa fil

@@ -0,0 +1,27 @@
1
+package com.yunzhi.shigongli.vo;
2
+
3
+
4
+import com.yunzhi.shigongli.entity.TaOrderSub;
5
+import io.swagger.annotations.ApiModel;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.Data;
8
+
9
+@ApiModel(description = "订单内容")
10
+@Data
11
+public class OrderSubListVO extends TaOrderSub {
12
+
13
+    @ApiModelProperty("所属商家")
14
+    private String shopName;
15
+
16
+    @ApiModelProperty("图片")
17
+    private String poster;
18
+
19
+    @ApiModelProperty("用户ID")
20
+    private String personId;
21
+
22
+    @ApiModelProperty("用户昵称")
23
+    private String nickName;
24
+
25
+    @ApiModelProperty("用户手机")
26
+    private String phone;
27
+}

+ 50
- 0
src/main/java/com/yunzhi/shigongli/vo/SavedVO.java Visa fil

@@ -0,0 +1,50 @@
1
+package com.yunzhi.shigongli.vo;
2
+
3
+import com.yunzhi.shigongli.entity.TaResource;
4
+import io.swagger.annotations.ApiModel;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import lombok.Data;
7
+
8
+import java.time.LocalDateTime;
9
+
10
+
11
+@ApiModel(description = "收藏内容")
12
+@Data
13
+public class SavedVO extends TaResource {
14
+
15
+    @ApiModelProperty(value = "收藏ID")
16
+    private Integer saveId;
17
+
18
+    @ApiModelProperty(value = "收藏时间")
19
+    private LocalDateTime saveDate;
20
+
21
+    @ApiModelProperty(value = "口味评分")
22
+    private Float sweetScore;
23
+
24
+    @ApiModelProperty(value = "环境评分")
25
+    private Float environmentScore;
26
+
27
+    @ApiModelProperty(value = "服务评分")
28
+    private Float serviceScore;
29
+
30
+    @ApiModelProperty(value = "门市价格")
31
+    private Integer standardPrice;
32
+
33
+    @ApiModelProperty(value = "实际价格")
34
+    private Integer actualPrice;
35
+
36
+    @ApiModelProperty(value = "返现金额")
37
+    private Integer cashback;
38
+
39
+    @ApiModelProperty(value = "距离/米")
40
+    private Integer distance;
41
+
42
+    @ApiModelProperty(value = "商铺ID")
43
+    private String shopId;
44
+
45
+    @ApiModelProperty(value = "区域名称")
46
+    private String areaName;
47
+
48
+    @ApiModelProperty(value = "父级区域名称")
49
+    private String areaPName;
50
+}

+ 1
- 1
src/main/resources/application.yml Visa fil

@@ -67,7 +67,7 @@ weixin:
67 67
 amap:
68 68
   weather:
69 69
     api: https://restapi.amap.com/v3/weather/weatherInfo?key=3be0a9567a794d2690d378476f057a6f&city=%s&extensions=base&output=JSON
70
-    backImage: https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/weather/background_%s.png
70
+    backImage: https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/weather/%s.png
71 71
 
72 72
 sysBiz:
73 73
   miniapp:

+ 26
- 0
src/main/resources/mapper/TaFeedbackMapper.xml Visa fil

@@ -2,4 +2,30 @@
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.TaFeedbackMapper">
4 4
 
5
+    <select id="getProfileById" resultType="com.yunzhi.shigongli.entity.TaFeedback">
6
+        SELECT
7
+            t.*,
8
+            s.phone
9
+        FROM
10
+            ta_feedback t
11
+                INNER JOIN ta_person s ON s.person_id = t.person_id
12
+        WHERE
13
+            t.feedback_id = #{id}
14
+    </select>
15
+    <select id="getProfilePage" resultType="com.yunzhi.shigongli.entity.TaFeedback">
16
+        SELECT
17
+            t.*,
18
+            s.phone
19
+        FROM
20
+            ta_feedback t
21
+                INNER JOIN ta_person s ON s.person_id = t.person_id
22
+        WHERE 1 = 1
23
+          <if test="startDate != null">
24
+              AND t.create_date &gt;= #{startDate}
25
+          </if>
26
+          <if test="endDate != null">
27
+              AND t.create_date &lt;= #{endDate}
28
+          </if>
29
+        ORDER BY t.create_date DESC
30
+    </select>
5 31
 </mapper>

+ 28
- 3
src/main/resources/mapper/TaOrderSubMapper.xml Visa fil

@@ -60,9 +60,6 @@
60 60
           <if test="isVerified != null">
61 61
               AND t.is_verified = #{isVerified}
62 62
           </if>
63
-          <if test="isVerified == null">
64
-              AND (t.is_verified = 0 OR t.is_verified IS NULL)
65
-          </if>
66 63
           <if test="status == null">
67 64
               AND t.`status` &gt; - 1
68 65
           </if>
@@ -122,4 +119,32 @@
122 119
             AND s.person_id = #{personId}
123 120
             AND s.`status` &gt; - 1
124 121
     </select>
122
+    <select id="getAdminPagedBy" resultType="com.yunzhi.shigongli.vo.OrderSubListVO">
123
+        SELECT
124
+            t.*,
125
+            n.shop_name,
126
+            m.poster,
127
+            s.order_id,
128
+            p.nick_name,
129
+            p.phone
130
+        FROM
131
+            ta_order_sub t
132
+                INNER JOIN ta_order s ON s.order_id = t.order_id
133
+                INNER JOIN ta_shop_package m ON m.package_id = t.package_id
134
+                INNER JOIN ta_shop n ON n.shop_id = m.shop_id
135
+                INNER JOIN ta_person p ON p.person_id = s.person_id
136
+        WHERE
137
+            s.`status` &gt; - 1
138
+          <if test="shopName != null and shopName != ''">
139
+              AND n.shop_name LIKE CONCAT( '%', #{shopName}, '%' )
140
+          </if>
141
+          <if test="description != null and description != ''">
142
+              AND t.description LIKE CONCAT( '%', #{description}, '%' )
143
+          </if>
144
+          <if test="createDate != null">
145
+              AND t.create_date &gt;= #{createDate}
146
+          </if>
147
+        ORDER BY
148
+            t.create_date DESC
149
+    </select>
125 150
 </mapper>

+ 61
- 0
src/main/resources/mapper/TaSaveMapper.xml Visa fil

@@ -2,4 +2,65 @@
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.TaSaveMapper">
4 4
 
5
+    <select id="getPageBy" resultType="com.yunzhi.shigongli.vo.SavedVO">
6
+        SELECT *
7
+        FROM (
8
+                 SELECT t.save_id,
9
+                        t.create_date                                       AS save_date,
10
+                        t.person_id,
11
+                        s.*,
12
+                        0                                                   AS sweet_score,
13
+                        0                                                   AS environment_score,
14
+                        0                                                   AS service_score,
15
+                        0                                                   AS standard_price,
16
+                        0                                                   AS actual_price,
17
+                        0                                                   AS cashback,
18
+                        fn_distance(CONCAT(s.lng, ',', s.lat), #{location}) AS distance,
19
+                        NULL                                                AS shop_id,
20
+                        m.area_name,
21
+                        n.area_name                                         AS area_p_name
22
+                 FROM ta_save t
23
+                          INNER JOIN ta_resource s ON s.target_type = t.target_type
24
+                     AND s.target_id = t.target_id
25
+                          LEFT JOIN td_city m ON m.area_id = s.city_id
26
+                          LEFT JOIN td_city n ON n.area_id = m.area_p_id
27
+                 WHERE t.person_id = #{personId}
28
+                 UNION
29
+                 SELECT a.save_id,
30
+                        a.create_date                            AS save_date,
31
+                        a.person_id,
32
+                        NULL                                     AS resource_no,
33
+                        a.target_type,
34
+                        a.target_id,
35
+                        0                                        AS like_num,
36
+                        0                                        AS pv_num,
37
+                        0                                        AS uv_num,
38
+                        b.poster,
39
+                        b.description                            AS title,
40
+                        SUBSTRING_INDEX(c.locaton, ',', 1) - 0   AS lng,
41
+                        SUBSTRING_INDEX(c.locaton, ',', - 1) - 0 AS lat,
42
+                        c.average_price,
43
+                        c.weight,
44
+                        0                                        AS save_num,
45
+                        c.city_id,
46
+                        b.`status`,
47
+                        c.sweet_score,
48
+                        c.environment_score,
49
+                        c.service_score,
50
+                        b.standard_price,
51
+                        b.actual_price,
52
+                        b.cashback,
53
+                        fn_distance(c.locaton, #{location})      AS distance,
54
+                        c.shop_id,
55
+                        d.area_name,
56
+                        e.area_name                              AS area_p_name
57
+                 FROM ta_save a
58
+                          INNER JOIN ta_shop_package b ON b.package_id = a.target_id
59
+                          INNER JOIN ta_shop c ON c.shop_id = b.shop_id
60
+                          LEFT JOIN td_city d ON d.area_id = c.city_id
61
+                          LEFT JOIN td_city e ON e.area_id = d.area_p_id
62
+                 WHERE a.person_id = #{personId}
63
+                   AND a.target_type = #{targetShopPackage}
64
+             ) tab ORDER BY tab.weight DESC, tab.save_date DESC
65
+    </select>
5 66
 </mapper>

+ 2
- 3
src/main/resources/mapper/TaVerifyTargetMapper.xml Visa fil

@@ -8,15 +8,14 @@
8 8
             s.phone
9 9
         FROM
10 10
             ta_verify_target t
11
-                INNER JOIN ta_person s ON s.person_id = t.person_id
12
-                INNER JOIN ta_order_sub m ON m.package_id = t.target_id
11
+            INNER JOIN ta_person s ON s.person_id = t.person_id
13 12
         WHERE
14 13
             t.`status` &gt; - 1
15 14
           <if test="personId != null and personId != ''">
16 15
               AND s.person_id = #{personId}
17 16
           </if>
18 17
           <if test="shopId != null and shopId != ''">
19
-              AND m.shop_id = #{shopId}
18
+              AND t.shop_id = #{shopId}
20 19
           </if>
21 20
           <if test="phone != null and phone != ''">
22 21
             AND s.phone = #{phone}