张延森 3 years ago
parent
commit
09f51ea68d
39 changed files with 352 additions and 66 deletions
  1. 1
    1
      pom.xml
  2. 2
    0
      src/main/java/com/yunzhi/shigongli/common/Constants.java
  3. 36
    0
      src/main/java/com/yunzhi/shigongli/common/WxUtils.java
  4. 1
    1
      src/main/java/com/yunzhi/shigongli/controller/TaOrderController.java
  5. 3
    0
      src/main/java/com/yunzhi/shigongli/controller/TaRoomController.java
  6. 3
    2
      src/main/java/com/yunzhi/shigongli/controller/TaShopController.java
  7. 1
    0
      src/main/java/com/yunzhi/shigongli/controller/TaTouristController.java
  8. 8
    0
      src/main/java/com/yunzhi/shigongli/controller/TaVerifyTargetController.java
  9. 2
    0
      src/main/java/com/yunzhi/shigongli/controller/TdCityController.java
  10. 3
    0
      src/main/java/com/yunzhi/shigongli/entity/TaResource.java
  11. 6
    0
      src/main/java/com/yunzhi/shigongli/entity/TaRoom.java
  12. 3
    0
      src/main/java/com/yunzhi/shigongli/entity/TaShop.java
  13. 5
    2
      src/main/java/com/yunzhi/shigongli/entity/TaShopPackage.java
  14. 3
    0
      src/main/java/com/yunzhi/shigongli/entity/TaVerifyTarget.java
  15. 1
    1
      src/main/java/com/yunzhi/shigongli/entity/TrPersonClick.java
  16. 10
    17
      src/main/java/com/yunzhi/shigongli/event/SendMessageTask.java
  17. 21
    0
      src/main/java/com/yunzhi/shigongli/event/VerifyResultEvent.java
  18. 4
    3
      src/main/java/com/yunzhi/shigongli/event/listener/PaySuccessEventListener.java
  19. 24
    0
      src/main/java/com/yunzhi/shigongli/event/listener/VerifyResultEventListener.java
  20. 5
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaOrderPayMapper.java
  21. 5
    0
      src/main/java/com/yunzhi/shigongli/mapper/TaVerifyTargetMapper.java
  22. 2
    0
      src/main/java/com/yunzhi/shigongli/service/ITaOrderPayService.java
  23. 2
    0
      src/main/java/com/yunzhi/shigongli/service/ITaVerifyTargetService.java
  24. 6
    23
      src/main/java/com/yunzhi/shigongli/service/impl/TaHotelWorkerServiceImpl.java
  25. 68
    6
      src/main/java/com/yunzhi/shigongli/service/impl/TaOrderPayServiceImpl.java
  26. 1
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaShopServiceImpl.java
  27. 1
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaTouristServiceImpl.java
  28. 59
    0
      src/main/java/com/yunzhi/shigongli/service/impl/TaVerifyTargetServiceImpl.java
  29. 9
    1
      src/main/java/com/yunzhi/shigongli/vo/ShopPackageVO.java
  30. 0
    4
      src/main/resources/application-dev.yml
  31. 18
    0
      src/main/resources/application-prod.yml
  32. 3
    3
      src/main/resources/application.yml
  33. 0
    0
      src/main/resources/logback.xml.bak
  34. 18
    0
      src/main/resources/mapper/TaOrderPayMapper.xml
  35. 1
    1
      src/main/resources/mapper/TaOrderSubMapper.xml
  36. 1
    0
      src/main/resources/mapper/TaSaveMapper.xml
  37. 1
    0
      src/main/resources/mapper/TaShopPackageMapper.xml
  38. 4
    1
      src/main/resources/mapper/TaTargetQuotaMapper.xml
  39. 11
    0
      src/main/resources/mapper/TaVerifyTargetMapper.xml

+ 1
- 1
pom.xml View File

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.yunzhi</groupId>
12 12
 	<artifactId>shigongli</artifactId>
13
-	<version>2.0.0</version>
13
+	<version>2.0.1</version>
14 14
 	<name>shigongli</name>
15 15
 	<description>Shi Gong Li</description>
16 16
 

+ 2
- 0
src/main/java/com/yunzhi/shigongli/common/Constants.java View File

@@ -72,4 +72,6 @@ public class Constants {
72 72
     // 小程序消息模板
73 73
     public final static String TPL_MESSAGE_HOTEL_CHECK_IN = "hotel_check_in";       // 民宿入住消息
74 74
     public final static String TPL_MESSAGE_HOTEL_CHECK_OUT = "hotel_check_out";     // 民宿离店消息
75
+    public final static String TPL_MESSAGE_SHOP_PAY_SUCCESS = "shop_pay_success";   // 商铺下单成功通知
76
+    public final static String TPL_MESSAGE_SHOP_VERIFY_RESULT = "shop_verify_result";   // 商铺下单成功通知
75 77
 }

+ 36
- 0
src/main/java/com/yunzhi/shigongli/common/WxUtils.java View File

@@ -3,6 +3,7 @@ package com.yunzhi.shigongli.common;
3 3
 import cn.binarywang.wx.miniapp.api.WxMaService;
4 4
 import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
5 5
 import cn.binarywang.wx.miniapp.bean.WxMaCodeLineColor;
6
+import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
6 7
 import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
7 8
 import com.github.binarywang.wxpay.config.WxPayConfig;
8 9
 import com.github.binarywang.wxpay.constant.WxPayConstants;
@@ -10,9 +11,15 @@ import com.github.binarywang.wxpay.service.WxPayService;
10 11
 import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
11 12
 import com.yunzhi.shigongli.config.WeixinConfig;
12 13
 import lombok.Data;
14
+import lombok.extern.slf4j.Slf4j;
15
+import me.chanjar.weixin.common.error.WxErrorException;
13 16
 import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.scheduling.annotation.Async;
14 18
 import org.springframework.stereotype.Component;
15 19
 
20
+import java.util.List;
21
+
22
+@Slf4j
16 23
 @Component
17 24
 public class WxUtils {
18 25
     private static WxMaService service;
@@ -69,4 +76,33 @@ public class WxUtils {
69 76
         private WxMaCodeLineColor lineColor;
70 77
         private boolean isHyaline;
71 78
     }
79
+
80
+    /**
81
+     * 发送订阅消息
82
+     * @param templateId
83
+     * @param openid
84
+     * @param page
85
+     * @param dataList
86
+     * @throws Exception
87
+     */
88
+    @Async
89
+    public void sendMessage(String templateId, String openid, String page, List<WxMaSubscribeMessage.Data> dataList) throws Exception {
90
+        WxMaSubscribeMessage wxMaSubscribeMessage = WxMaSubscribeMessage
91
+                .builder()
92
+                .templateId(templateId)
93
+                .toUser(openid)
94
+                .page(page)
95
+                .data(dataList)
96
+                .build();
97
+
98
+        try {
99
+            service.getMsgService().sendSubscribeMsg(wxMaSubscribeMessage);
100
+        } catch (Exception e) {
101
+            e.printStackTrace();
102
+
103
+            // 再发送一次
104
+            Thread.sleep(1000);
105
+            service.getMsgService().sendSubscribeMsg(wxMaSubscribeMessage);
106
+        }
107
+    }
72 108
 }

+ 1
- 1
src/main/java/com/yunzhi/shigongli/controller/TaOrderController.java View File

@@ -138,7 +138,7 @@ public class TaOrderController extends BaseController {
138 138
     public ResponseBean taOrderDelete(@ApiParam("订单ID") @PathVariable String id,
139 139
                                    HttpServletRequest request) throws Exception{
140 140
         TaOrder taOrder = iTaOrderService.getById(id);
141
-        if (null == taOrder || Constants.STATUS_DELETED != taOrder.getStatus()) {
141
+        if (null == taOrder || Constants.STATUS_DELETED == taOrder.getStatus()) {
142 142
             return ResponseBean.error("订单不存在", ResponseBean.ERROR_ILLEGAL_PARAMS);
143 143
         }
144 144
 

+ 3
- 0
src/main/java/com/yunzhi/shigongli/controller/TaRoomController.java View File

@@ -23,6 +23,7 @@ import com.yunzhi.shigongli.entity.TaRoom;
23 23
 import org.springframework.web.bind.annotation.RestController;
24 24
 
25 25
 import javax.servlet.http.HttpServletResponse;
26
+import java.time.LocalDateTime;
26 27
 
27 28
 /**
28 29
  * <p>
@@ -94,6 +95,8 @@ public class TaRoomController extends BaseController {
94 95
     public ResponseBean taRoomAdd(@ApiParam(value = "客户端", allowableValues = "wx,admin") @PathVariable String plat,
95 96
                                   @ApiParam("保存内容") @RequestBody TaRoom taRoom) throws Exception{
96 97
 
98
+        taRoom.setCreateDate(LocalDateTime.now());
99
+
97 100
         if (iTaRoomService.save(taRoom)){
98 101
             return ResponseBean.success(taRoom);
99 102
         }else {

+ 3
- 2
src/main/java/com/yunzhi/shigongli/controller/TaShopController.java View File

@@ -164,6 +164,7 @@ public class TaShopController extends BaseController {
164 164
             ResourceFieldVO resourceVO = iTaShopService.copyProperties(taShop);
165 165
             TaResource taResource = taResourceService.getByTarget(Constants.TARGET_SHOP, id);
166 166
             BeanUtils.copyProperties(resourceVO, taResource);
167
+            taResource.setTargetName(taShop.getShopName());
167 168
 
168 169
             taResourceService.updateById(taResource);
169 170
             return ResponseBean.success(iTaShopService.getById(id));
@@ -304,10 +305,10 @@ public class TaShopController extends BaseController {
304 305
             return ResponseBean.error("请先进行人员身份绑定", ResponseBean.ERROR_ILLEGAL_PARAMS);
305 306
         }
306 307
 
307
-        // 获取所有的民宿信息
308
+        // 获取所有的商铺信息
308 309
         List<TaShop> shopList = iTaShopService.getListByPerson(taPerson);
309 310
         if (null == shopList || shopList.size() < 1) {
310
-            return ResponseBean.error("数据异常, 未找到关联民宿", ResponseBean.ERROR_UNAVAILABLE);
311
+            return ResponseBean.error("数据异常, 未找到关联商铺", ResponseBean.ERROR_UNAVAILABLE);
311 312
         }
312 313
 
313 314
         Map<String, Object> result = new HashMap<>();

+ 1
- 0
src/main/java/com/yunzhi/shigongli/controller/TaTouristController.java View File

@@ -160,6 +160,7 @@ public class TaTouristController extends BaseController {
160 160
             ResourceFieldVO resourceVO = iTaTouristService.copyProperties(taTourist);
161 161
             TaResource taResource = taResourceService.getByTarget(Constants.TARGET_TOURIST, id);
162 162
             BeanUtils.copyProperties(resourceVO, taResource);
163
+            taResource.setTargetName(taTourist.getTouristName());
163 164
             taResourceService.updateById(taResource);
164 165
 
165 166
             return ResponseBean.success(iTaTouristService.getById(id));

+ 8
- 0
src/main/java/com/yunzhi/shigongli/controller/TaVerifyTargetController.java View File

@@ -8,6 +8,7 @@ import com.yunzhi.shigongli.common.Constants;
8 8
 import com.yunzhi.shigongli.common.ResponseBean;
9 9
 import com.yunzhi.shigongli.common.StringUtils;
10 10
 import com.yunzhi.shigongli.entity.*;
11
+import com.yunzhi.shigongli.event.VerifyResultEvent;
11 12
 import com.yunzhi.shigongli.service.*;
12 13
 import com.yunzhi.shigongli.vo.VerifyTargetVO;
13 14
 import io.swagger.annotations.Api;
@@ -16,6 +17,7 @@ import io.swagger.annotations.ApiParam;
16 17
 import org.slf4j.Logger;
17 18
 import org.slf4j.LoggerFactory;
18 19
 import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.context.ApplicationEventPublisher;
19 21
 import org.springframework.web.bind.annotation.*;
20 22
 
21 23
 import java.time.LocalDateTime;
@@ -49,6 +51,9 @@ public class TaVerifyTargetController extends BaseController {
49 51
     @Autowired
50 52
     public ITaShopWorkerService shopWorkerService;
51 53
 
54
+    @Autowired
55
+    ApplicationEventPublisher eventPublisher;
56
+
52 57
     /**
53 58
      * 分页查询列表
54 59
      * @param pageNum
@@ -117,6 +122,9 @@ public class TaVerifyTargetController extends BaseController {
117 122
             iTaOrderSubService.validation(taPerson, taOrder, taOrderSub);
118 123
         }
119 124
 
125
+        //
126
+        eventPublisher.publishEvent(new VerifyResultEvent(this, taVerifyTarget));
127
+
120 128
         return ResponseBean.success("核销成功");
121 129
     }
122 130
 

+ 2
- 0
src/main/java/com/yunzhi/shigongli/controller/TdCityController.java View File

@@ -52,11 +52,13 @@ public class TdCityController extends BaseController {
52 52
     public ResponseBean tdCityList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53 53
                                    @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
54 54
                                    @ApiParam("父级分类") @RequestParam(value ="areaPId", required = false) String areaPId,
55
+                                   @ApiParam("等级") @RequestParam(value ="areaLevel", defaultValue = "3") String areaLevel,
55 56
                                    @ApiParam("名称") @RequestParam(value ="areaName", required = false) String areaName) throws Exception{
56 57
 
57 58
         IPage<TdCity> pg = new Page<>(pageNum, pageSize);
58 59
         QueryWrapper<TdCity> queryWrapper = new QueryWrapper<>();
59 60
         queryWrapper.eq(!StringUtils.isEmpty(areaPId),"area_p_id", areaPId);
61
+        queryWrapper.eq(!StringUtils.isEmpty(areaLevel),"area_level", areaLevel);
60 62
         queryWrapper.like(!StringUtils.isEmpty(areaName), "area_name","%"+areaName+"%");
61 63
         queryWrapper.orderByAsc("area_id");
62 64
 

+ 3
- 0
src/main/java/com/yunzhi/shigongli/entity/TaResource.java View File

@@ -38,6 +38,9 @@ public class TaResource implements Serializable {
38 38
     @ApiModelProperty(value = "访问对象ID")
39 39
     private String targetId;
40 40
 
41
+    @ApiModelProperty(value = "访问对象ID")
42
+    private String targetName;
43
+
41 44
     @ApiModelProperty(value = "点赞数")
42 45
     private Integer likeNum;
43 46
 

+ 6
- 0
src/main/java/com/yunzhi/shigongli/entity/TaRoom.java View File

@@ -42,12 +42,18 @@ public class TaRoom implements Serializable {
42 42
     @ApiModelProperty(value = "定位")
43 43
     private String location;
44 44
 
45
+    @ApiModelProperty(value = "位置名称")
46
+    private String locName;
47
+
45 48
     @ApiModelProperty(value = "地址")
46 49
     private String address;
47 50
 
48 51
     @ApiModelProperty(value = "停车场定位")
49 52
     private String parkingLocation;
50 53
 
54
+    @ApiModelProperty(value = "停车场定位")
55
+    private String pkLocName;
56
+
51 57
     @ApiModelProperty(value = "停车场位置")
52 58
     private String parkingAddress;
53 59
 

+ 3
- 0
src/main/java/com/yunzhi/shigongli/entity/TaShop.java View File

@@ -74,6 +74,9 @@ public class TaShop implements Serializable {
74 74
     @ApiModelProperty(value = "服务评分")
75 75
     private BigDecimal serviceScore;
76 76
 
77
+    @ApiModelProperty(value = "权重")
78
+    private Integer weight;
79
+
77 80
     @ApiModelProperty(value = "状态")
78 81
     private Integer status;
79 82
 

+ 5
- 2
src/main/java/com/yunzhi/shigongli/entity/TaShopPackage.java View File

@@ -42,8 +42,11 @@ public class TaShopPackage implements Serializable {
42 42
     @ApiModelProperty(value = "描述")
43 43
     private String description;
44 44
 
45
-    @ApiModelProperty(value = "适用人数")
46
-    private Integer personNum;
45
+    @ApiModelProperty(value = "适用最少人数")
46
+    private Integer minPerson;
47
+
48
+    @ApiModelProperty(value = "适用最多人数")
49
+    private Integer maxPerson;
47 50
 
48 51
     @ApiModelProperty(value = "主图")
49 52
     private String poster;

+ 3
- 0
src/main/java/com/yunzhi/shigongli/entity/TaVerifyTarget.java View File

@@ -52,6 +52,9 @@ public class TaVerifyTarget implements Serializable {
52 52
     @ApiModelProperty(value = "返现金额/单位分")
53 53
     private Integer cashback;
54 54
 
55
+    @ApiModelProperty(value = "抽成金额/单位分")
56
+    private Integer commissionCharge;
57
+
55 58
     @ApiModelProperty(value = "发放时间")
56 59
     private LocalDateTime createDate;
57 60
 

+ 1
- 1
src/main/java/com/yunzhi/shigongli/entity/TrPersonClick.java View File

@@ -41,7 +41,7 @@ public class TrPersonClick implements Serializable {
41 41
     private String eventType;
42 42
 
43 43
     @ApiModelProperty(value = "内容对象")
44
-    private Integer eventParams;
44
+    private String eventParams;
45 45
 
46 46
     @ApiModelProperty(value = "创建日期")
47 47
     private LocalDateTime createDate;

+ 10
- 17
src/main/java/com/yunzhi/shigongli/event/SendMessageTask.java View File

@@ -1,7 +1,6 @@
1 1
 package com.yunzhi.shigongli.event;
2 2
 
3 3
 
4
-import cn.binarywang.wx.miniapp.api.WxMaService;
5 4
 import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
6 5
 import com.yunzhi.shigongli.common.Constants;
7 6
 import com.yunzhi.shigongli.common.DateUtils;
@@ -10,7 +9,6 @@ import com.yunzhi.shigongli.entity.TaMiniappMessageTpl;
10 9
 import com.yunzhi.shigongli.mapper.TaMiniappMessageTplMapper;
11 10
 import com.yunzhi.shigongli.service.ITaRoomOrderService;
12 11
 import lombok.extern.slf4j.Slf4j;
13
-import me.chanjar.weixin.common.error.WxErrorException;
14 12
 import org.springframework.beans.factory.annotation.Autowired;
15 13
 import org.springframework.scheduling.annotation.Scheduled;
16 14
 import org.springframework.stereotype.Component;
@@ -54,8 +52,8 @@ public class SendMessageTask {
54 52
             return ;
55 53
         }
56 54
 
55
+        String templateId = messageTpl.getTemplateId();
57 56
         String remark = "请记得带好您的随身物品";
58
-        WxMaService maService = wxUtils.getService();
59 57
 
60 58
         for (Map<String, Object> item : list) {
61 59
             List<WxMaSubscribeMessage.Data> dataList = new ArrayList<>();
@@ -66,22 +64,17 @@ public class SendMessageTask {
66 64
             String hotelId = item.get("hotelId").toString();
67 65
             String page = messageTpl.getPage() + "&id=" + hotelId;
68 66
 
69
-            WxMaSubscribeMessage wxMaSubscribeMessage = WxMaSubscribeMessage
70
-                    .builder()
71
-                    .templateId(messageTpl.getTemplateId())
72
-                    .toUser(openid)
73
-                    .page(page)
74
-                    .data(dataList)
75
-                    .build();
76
-
77 67
             try {
78
-                maService.getMsgService().sendSubscribeMsg(wxMaSubscribeMessage);
79
-                Thread.sleep(1000);
80
-            } catch (WxErrorException e) {
81
-                log.error("发送退房消息失败: {}", e.getMessage());
82
-                e.printStackTrace();
83
-            } catch (InterruptedException e) {
68
+                wxUtils.sendMessage(templateId, openid, page, dataList);
69
+            } catch (Exception e) {
84 70
                 e.printStackTrace();
71
+                log.error("发送离店消息给游客失败: {}", e.getMessage());
72
+            } finally {
73
+                try {
74
+                    Thread.sleep(1000);
75
+                } catch (InterruptedException e) {
76
+                    e.printStackTrace();
77
+                }
85 78
             }
86 79
         }
87 80
 

+ 21
- 0
src/main/java/com/yunzhi/shigongli/event/VerifyResultEvent.java View File

@@ -0,0 +1,21 @@
1
+package com.yunzhi.shigongli.event;
2
+
3
+import com.yunzhi.shigongli.entity.TaVerifyTarget;
4
+import org.springframework.context.ApplicationEvent;
5
+
6
+/**
7
+ * 核销结果
8
+ */
9
+public class VerifyResultEvent extends ApplicationEvent {
10
+
11
+    TaVerifyTarget taVerifyTarget;
12
+
13
+    public VerifyResultEvent(Object source, TaVerifyTarget taVerifyTarget) {
14
+        super(source);
15
+        this.taVerifyTarget = taVerifyTarget;
16
+    }
17
+
18
+    public TaVerifyTarget getTaVerifyTarget() {
19
+        return taVerifyTarget;
20
+    }
21
+}

+ 4
- 3
src/main/java/com/yunzhi/shigongli/event/listener/PaySuccessEventListener.java View File

@@ -1,7 +1,7 @@
1 1
 package com.yunzhi.shigongli.event.listener;
2 2
 
3 3
 import com.yunzhi.shigongli.event.PaySuccessEvent;
4
-import com.yunzhi.shigongli.service.ITaPersonAccountService;
4
+import com.yunzhi.shigongli.service.ITaOrderPayService;
5 5
 import org.springframework.beans.factory.annotation.Autowired;
6 6
 import org.springframework.context.ApplicationListener;
7 7
 import org.springframework.stereotype.Component;
@@ -9,12 +9,13 @@ import org.springframework.stereotype.Component;
9 9
 @Component
10 10
 public class PaySuccessEventListener implements ApplicationListener<PaySuccessEvent> {
11 11
     @Autowired
12
-    ITaPersonAccountService personAccountService;
12
+    ITaOrderPayService iTaOrderPayService;
13 13
 
14 14
     @Override
15 15
     public void onApplicationEvent(PaySuccessEvent evt) {
16 16
         try {
17
-            // do nothing
17
+            // 发送消息给商家
18
+            iTaOrderPayService.sendPaySuccessNotifyToShop(evt.getTaOrderPay());
18 19
         } catch (Exception e) {
19 20
             e.printStackTrace();
20 21
         }

+ 24
- 0
src/main/java/com/yunzhi/shigongli/event/listener/VerifyResultEventListener.java View File

@@ -0,0 +1,24 @@
1
+package com.yunzhi.shigongli.event.listener;
2
+
3
+import com.yunzhi.shigongli.event.VerifyResultEvent;
4
+import com.yunzhi.shigongli.service.ITaVerifyTargetService;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.context.ApplicationListener;
7
+import org.springframework.stereotype.Component;
8
+
9
+@Component
10
+public class VerifyResultEventListener implements ApplicationListener<VerifyResultEvent> {
11
+
12
+    @Autowired
13
+    ITaVerifyTargetService iTaVerifyTargetService;
14
+
15
+    @Override
16
+    public void onApplicationEvent(VerifyResultEvent event) {
17
+        try {
18
+            // 发送消息给商家
19
+            iTaVerifyTargetService.sendVerifyResultNotifyToShop(event.getTaVerifyTarget());
20
+        } catch (Exception e) {
21
+            e.printStackTrace();
22
+        }
23
+    }
24
+}

+ 5
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaOrderPayMapper.java View File

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 import org.apache.ibatis.annotations.Mapper;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
8
+import java.util.List;
9
+import java.util.Map;
10
+
8 11
 /**
9 12
  * <p>
10 13
  * 订单支付 Mapper 接口
@@ -21,4 +24,6 @@ public interface TaOrderPayMapper extends BaseMapper<TaOrderPay> {
21 24
     TaOrderPay getLastPayedRowByOrder(@Param("orderId") String orderId);
22 25
 
23 26
     TaOrderPay getLastRowByOrderSub(@Param("orderId") String orderId, @Param("subOrderId") String subOrderId);
27
+
28
+    List<Map<String, Object>> getShopWorkerBy(@Param("orderId") String orderId, @Param("subOrderId") String subOrderId);
24 29
 }

+ 5
- 0
src/main/java/com/yunzhi/shigongli/mapper/TaVerifyTargetMapper.java View File

@@ -7,6 +7,9 @@ import com.yunzhi.shigongli.vo.VerifyTargetVO;
7 7
 import org.apache.ibatis.annotations.Mapper;
8 8
 import org.apache.ibatis.annotations.Param;
9 9
 
10
+import java.util.List;
11
+import java.util.Map;
12
+
10 13
 /**
11 14
  * <p>
12 15
  * 核销内容表 Mapper 接口
@@ -27,4 +30,6 @@ public interface TaVerifyTargetMapper extends BaseMapper<TaVerifyTarget> {
27 30
     int existsNo(@Param("verifyNo") String verifyNo);
28 31
 
29 32
     int getCountBy(@Param("orderId") String orderId, @Param("subOrderId") String subOrderId, @Param("isVerified") Integer isVerified);
33
+
34
+    List<String> getShopWorkerBy(@Param("shopId") String shopId);
30 35
 }

+ 2
- 0
src/main/java/com/yunzhi/shigongli/service/ITaOrderPayService.java View File

@@ -30,4 +30,6 @@ public interface ITaOrderPayService extends IBaseService<TaOrderPay> {
30 30
     void refundOrder(TaPerson person, TaOrder taOrder, Integer totalCashback) throws Exception;
31 31
 
32 32
     WxPayMpOrderResult prePay(TaPerson person, TaOrder taOrder, TaOrderSub taOrderSub) throws Exception;
33
+
34
+    void sendPaySuccessNotifyToShop(TaOrderPay taOrderPay);
33 35
 }

+ 2
- 0
src/main/java/com/yunzhi/shigongli/service/ITaVerifyTargetService.java View File

@@ -22,4 +22,6 @@ public interface ITaVerifyTargetService extends IBaseService<TaVerifyTarget> {
22 22
     boolean removeBy(String orderId, String subOrderId);
23 23
 
24 24
     void verify(TaVerifyTarget taVerifyTarget) throws Exception;
25
+
26
+    void sendVerifyResultNotifyToShop(TaVerifyTarget taVerifyTarget);
25 27
 }

+ 6
- 23
src/main/java/com/yunzhi/shigongli/service/impl/TaHotelWorkerServiceImpl.java View File

@@ -96,29 +96,26 @@ public class TaHotelWorkerServiceImpl extends BaseServiceImpl<TaHotelWorkerMappe
96 96
         dataList.add(new WxMaSubscribeMessage.Data("thing6", hotelName));
97 97
         dataList.add(new WxMaSubscribeMessage.Data("date2", taRoomOrder.getStartDate()));
98 98
 
99
+        String templateId = messageTpl.getTemplateId();
99 100
         String page = messageTpl.getPage()
100 101
                 + "?roomId=" + taRoom.getRoomId()
102
+                + "&hotelId=" + taRoom.getHotelId()
101 103
                 + "&roomName=" + StringUtils.encodeURIComponent(taRoom.getRoomName());
102 104
 
103 105
         // 暂时先发送给所有店主, 1s 发送一个
104 106
         for (TaHotelWorker worker : workerList) {
105 107
             String toUser = taPersonMapper.getOpenid(worker.getPersonId());
106 108
             try {
107
-                sendMaSubscribeMessage(toUser, dataList, page, messageTpl.getTemplateId());
108 109
 
109
-                Thread.sleep(1000);
110
+                wxUtils.sendMessage(templateId, toUser, page, dataList);
110 111
             } catch (Exception e) {
111 112
                 log.error("发送订阅消息给店主失败: {}", e.getMessage());
112 113
                 e.printStackTrace();
113
-
114
-                // 再发一次
114
+            } finally {
115 115
                 try {
116
-                    sendMaSubscribeMessage(toUser, dataList, page, messageTpl.getTemplateId());
117
-
118 116
                     Thread.sleep(1000);
119
-                } catch (Exception e1) {
120
-                    log.error("发送订阅消息给店主失败: {}", e1.getMessage());
121
-                    e1.printStackTrace();
117
+                } catch (InterruptedException e) {
118
+                    e.printStackTrace();
122 119
                 }
123 120
             }
124 121
         }
@@ -133,18 +130,4 @@ public class TaHotelWorkerServiceImpl extends BaseServiceImpl<TaHotelWorkerMappe
133 130
         return list(queryWrapper);
134 131
     }
135 132
 
136
-
137
-    private void sendMaSubscribeMessage(String toUser, List<WxMaSubscribeMessage.Data> message, String page, String templateId) throws WxErrorException {
138
-        WxMaService maService = wxUtils.getService();
139
-        WxMaSubscribeMessage wxMaSubscribeMessage = WxMaSubscribeMessage
140
-                .builder()
141
-                .templateId(templateId)
142
-                .toUser(toUser)
143
-                .page(page)
144
-                .data(message)
145
-                .build();
146
-
147
-        maService.getMsgService().sendSubscribeMsg(wxMaSubscribeMessage);
148
-    }
149
-
150 133
 }

+ 68
- 6
src/main/java/com/yunzhi/shigongli/service/impl/TaOrderPayServiceImpl.java View File

@@ -1,13 +1,12 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3
+import cn.binarywang.wx.miniapp.api.WxMaService;
4
+import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
3 5
 import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
4 6
 import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult;
5 7
 import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
6 8
 import com.github.binarywang.wxpay.constant.WxPayConstants;
7
-import com.yunzhi.shigongli.common.Constants;
8
-import com.yunzhi.shigongli.common.DateUtils;
9
-import com.yunzhi.shigongli.common.StringUtils;
10
-import com.yunzhi.shigongli.common.WxPayUtils;
9
+import com.yunzhi.shigongli.common.*;
11 10
 import com.yunzhi.shigongli.entity.*;
12 11
 import com.yunzhi.shigongli.event.PaySuccessEvent;
13 12
 import com.yunzhi.shigongli.event.RefundSuccessEvent;
@@ -15,8 +14,10 @@ import com.yunzhi.shigongli.mapper.*;
15 14
 import com.yunzhi.shigongli.service.ITaOrderPayService;
16 15
 
17 16
 import lombok.extern.slf4j.Slf4j;
17
+import me.chanjar.weixin.common.error.WxErrorException;
18 18
 import org.springframework.beans.factory.annotation.Autowired;
19 19
 import org.springframework.context.ApplicationEventPublisher;
20
+import org.springframework.scheduling.annotation.Async;
20 21
 import org.springframework.stereotype.Service;
21 22
 import org.springframework.transaction.annotation.Propagation;
22 23
 import org.springframework.transaction.annotation.Transactional;
@@ -24,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
24 25
 import java.time.LocalDateTime;
25 26
 import java.util.ArrayList;
26 27
 import java.util.List;
28
+import java.util.Map;
27 29
 
28 30
 /**
29 31
  * <p>
@@ -76,6 +78,12 @@ public class TaOrderPayServiceImpl extends BaseServiceImpl<TaOrderPayMapper, TaO
76 78
     @Autowired
77 79
     TaShopAccountLogMapper shopAccountLogMapper;
78 80
 
81
+    @Autowired
82
+    TaMiniappMessageTplMapper messageTplMapper;
83
+
84
+    @Autowired
85
+    WxUtils wxUtils;
86
+
79 87
     /**
80 88
      * 支付回调
81 89
      * @param notifyResult
@@ -194,6 +202,9 @@ public class TaOrderPayServiceImpl extends BaseServiceImpl<TaOrderPayMapper, TaO
194 202
         }
195 203
 
196 204
         Integer cashback = orderSubList.stream().mapToInt(TaOrderSub::getCashback).reduce(Integer::sum).getAsInt();
205
+        if (cashback <= 0) {
206
+            return ;
207
+        }
197 208
 
198 209
         TaOrderPay orderPay = null != taOrder ? createByOrder(taOrder) : createByOrderSub(taOrderSub, taPerson);
199 210
         orderPay.setDescription("返现");
@@ -233,9 +244,10 @@ public class TaOrderPayServiceImpl extends BaseServiceImpl<TaOrderPayMapper, TaO
233 244
                 taVerifyTarget.setTargetId(item.getPackageId());
234 245
                 taVerifyTarget.setDescription(shopPackage.getDescription());
235 246
                 taVerifyTarget.setPoster(shopPackage.getPoster());
236
-                taVerifyTarget.setActualPrice(shopPackage.getActualPrice());
247
+                taVerifyTarget.setActualPrice(item.getUnitPrice());
237 248
                 taVerifyTarget.setStandPrice(shopPackage.getStandardPrice());
238
-                taVerifyTarget.setCashback(shopPackage.getCashback());
249
+                taVerifyTarget.setCashback(item.getCashback() / item.getAmount());
250
+                taVerifyTarget.setCommissionCharge(item.getCommissionCharge() / item.getAmount());
239 251
                 taVerifyTarget.setCreateDate(now);
240 252
                 taVerifyTarget.setExpireDate(shopPackage.getEndTime());
241 253
                 taVerifyTarget.setOrderDate(item.getCreateDate());
@@ -409,6 +421,56 @@ public class TaOrderPayServiceImpl extends BaseServiceImpl<TaOrderPayMapper, TaO
409 421
         return wxPayUtils.createOrder(person, orderPay);
410 422
     }
411 423
 
424
+    /**
425
+     * 支付成功消息
426
+     * @param taOrderPay
427
+     */
428
+    @Async
429
+    @Override
430
+    public void sendPaySuccessNotifyToShop(TaOrderPay taOrderPay) {
431
+        try {
432
+            // 消息模板
433
+            TaMiniappMessageTpl messageTpl = messageTplMapper.selectByType(Constants.TPL_MESSAGE_SHOP_PAY_SUCCESS);
434
+            if (null == messageTpl) {
435
+                return ;
436
+            }
437
+
438
+            String templateId = messageTpl.getTemplateId();
439
+            String page = messageTpl.getPage();
440
+
441
+            String orderId = taOrderPay.getOrderId();
442
+            String subOrderId = taOrderPay.getSubOrderId();
443
+
444
+            List<Map<String, Object>> list = orderPayMapper.getShopWorkerBy(orderId, subOrderId);
445
+            if (null == list || list.size() == 0) return;
446
+
447
+            for (Map<String, Object> item : list) {
448
+                String openId = item.get("openid").toString();
449
+                if (StringUtils.isEmpty(openId)) continue;
450
+
451
+                List<WxMaSubscribeMessage.Data> dataList = new ArrayList<>();
452
+                dataList.add(new WxMaSubscribeMessage.Data("character_string7", orderId));
453
+                dataList.add(new WxMaSubscribeMessage.Data("thing13", "您有一个十公里订单,客人期待与你的见面哦"));
454
+
455
+                try {
456
+                   wxUtils.sendMessage(templateId, openId, page, dataList);
457
+                } catch (Exception e) {
458
+                    e.printStackTrace();
459
+                    log.error("发送订单消息失败: {}", e.getMessage());
460
+                } finally {
461
+                    try {
462
+                        Thread.sleep(1000);
463
+                    } catch (InterruptedException e) {
464
+                        e.printStackTrace();
465
+                    }
466
+                }
467
+            }
468
+
469
+        } catch (Exception e) {
470
+            e.printStackTrace();
471
+        }
472
+    }
473
+
412 474
     private TaOrderPay createByOrder(TaOrder taOrder) throws Exception {
413 475
         // 发给微信的订单号为  订单ID-01 这种
414 476
         Integer no = taSequenceMapper.nextval(taOrder.getOrderId());

+ 1
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaShopServiceImpl.java View File

@@ -81,6 +81,7 @@ public class TaShopServiceImpl extends BaseServiceImpl<TaShopMapper, TaShop> imp
81 81
         BeanUtils.copyProperties(taShop, taResource);
82 82
         taResource.setTargetType(Constants.TARGET_SHOP);
83 83
         taResource.setTargetId(taShop.getShopId());
84
+        taResource.setTargetName(taShop.getShopName());
84 85
         taResource.setLikeNum(taShop.getLikeNum());
85 86
         if (!StringUtils.isEmpty(taShop.getLocaton())) {
86 87
             String[] loc = taShop.getLocaton().split(",");

+ 1
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaTouristServiceImpl.java View File

@@ -79,6 +79,7 @@ public class TaTouristServiceImpl extends BaseServiceImpl<TaTouristMapper, TaTou
79 79
         BeanUtils.copyProperties(taTourist, taResource);
80 80
         taResource.setTargetType(Constants.TARGET_TOURIST);
81 81
         taResource.setTargetId(taTourist.getTouristId());
82
+        taResource.setTargetName(taTourist.getTouristName());
82 83
         if (!StringUtils.isEmpty(taTourist.getLocaton())) {
83 84
             String[] loc = taTourist.getLocaton().split(",");
84 85
             taResource.setLng(loc[0].trim());

+ 59
- 0
src/main/java/com/yunzhi/shigongli/service/impl/TaVerifyTargetServiceImpl.java View File

@@ -1,20 +1,27 @@
1 1
 package com.yunzhi.shigongli.service.impl;
2 2
 
3
+import cn.binarywang.wx.miniapp.api.WxMaService;
4
+import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
3 5
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
4 6
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 7
 import com.yunzhi.shigongli.common.Constants;
6 8
 import com.yunzhi.shigongli.common.StringUtils;
9
+import com.yunzhi.shigongli.common.WxUtils;
7 10
 import com.yunzhi.shigongli.entity.*;
8 11
 import com.yunzhi.shigongli.mapper.*;
9 12
 import com.yunzhi.shigongli.service.ITaVerifyTargetService;
10 13
 import com.yunzhi.shigongli.vo.VerifyTargetVO;
14
+import lombok.extern.slf4j.Slf4j;
11 15
 import org.springframework.beans.factory.annotation.Autowired;
12 16
 import org.springframework.jdbc.object.UpdatableSqlQuery;
17
+import org.springframework.scheduling.annotation.Async;
13 18
 import org.springframework.stereotype.Service;
14 19
 import org.springframework.transaction.annotation.Transactional;
15 20
 
16 21
 import java.time.LocalDateTime;
22
+import java.util.ArrayList;
17 23
 import java.util.List;
24
+import java.util.Map;
18 25
 
19 26
 /**
20 27
  * <p>
@@ -24,6 +31,7 @@ import java.util.List;
24 31
  * @author yansen
25 32
  * @since 2021-08-17
26 33
  */
34
+@Slf4j
27 35
 @Service
28 36
 public class TaVerifyTargetServiceImpl extends BaseServiceImpl<TaVerifyTargetMapper, TaVerifyTarget> implements ITaVerifyTargetService {
29 37
 
@@ -48,6 +56,12 @@ public class TaVerifyTargetServiceImpl extends BaseServiceImpl<TaVerifyTargetMap
48 56
     @Autowired
49 57
     TaHotelAccountLogMapper hotelAccountLogMapper;
50 58
 
59
+    @Autowired
60
+    TaMiniappMessageTplMapper messageTplMapper;
61
+
62
+    @Autowired
63
+    WxUtils wxUtils;
64
+
51 65
     @Override
52 66
     public IPage<VerifyTargetVO> getWxPagedBy(IPage<VerifyTargetVO> pg, String personId, String shopId, String phone, Integer isVerified) {
53 67
         return baseMapper.getWxPagedBy(pg, personId, shopId, phone, isVerified);
@@ -79,4 +93,49 @@ public class TaVerifyTargetServiceImpl extends BaseServiceImpl<TaVerifyTargetMap
79 93
         }
80 94
     }
81 95
 
96
+    @Async
97
+    @Override
98
+    public void sendVerifyResultNotifyToShop(TaVerifyTarget taVerifyTarget) {
99
+        try {
100
+            // 消息模板
101
+            TaMiniappMessageTpl messageTpl = messageTplMapper.selectByType(Constants.TPL_MESSAGE_SHOP_VERIFY_RESULT);
102
+            if (null == messageTpl) {
103
+                return ;
104
+            }
105
+
106
+            String templateId = messageTpl.getTemplateId();
107
+            String page = messageTpl.getPage();
108
+
109
+            String orderId = taVerifyTarget.getOrderId();
110
+            String shopId = taVerifyTarget.getShopId();
111
+
112
+            List<String> list = baseMapper.getShopWorkerBy(shopId);
113
+            if (null == list || list.size() == 0) return;
114
+
115
+            for (String openId : list) {
116
+                if (StringUtils.isEmpty(openId)) continue;
117
+
118
+                List<WxMaSubscribeMessage.Data> dataList = new ArrayList<>();
119
+                dataList.add(new WxMaSubscribeMessage.Data("character_string1", orderId));
120
+                dataList.add(new WxMaSubscribeMessage.Data("thing5", "您有新的十公里订单已核销,请注意查收"));
121
+
122
+                try {
123
+                    wxUtils.sendMessage(templateId, openId, page, dataList);
124
+                } catch (Exception e) {
125
+                    e.printStackTrace();
126
+                    log.error("发送订单核销消息失败: {}", e.getMessage());
127
+                } finally {
128
+                    try {
129
+                        Thread.sleep(1000);
130
+                    } catch (InterruptedException e) {
131
+                        e.printStackTrace();
132
+                    }
133
+                }
134
+            }
135
+
136
+        } catch (Exception e) {
137
+            e.printStackTrace();
138
+        }
139
+    }
140
+
82 141
 }

+ 9
- 1
src/main/java/com/yunzhi/shigongli/vo/ShopPackageVO.java View File

@@ -41,10 +41,18 @@ public class ShopPackageVO {
41 41
     @ApiModelProperty(value = "描述")
42 42
     private String description;
43 43
 
44
+    @ExcelIgnore
45
+    @ApiModelProperty(value = "最小适用人数")
46
+    private Integer minPerson;
47
+
48
+    @ExcelIgnore
49
+    @ApiModelProperty(value = "最大适用人数")
50
+    private Integer maxPerson;
51
+
44 52
     @ExcelProperty(value = "适用人数", index = 2)
45 53
     @ColumnWidth(20)
46 54
     @ApiModelProperty(value = "适用人数")
47
-    private Integer personNum;
55
+    private String personNum;
48 56
 
49 57
     @ExcelIgnore
50 58
     @ApiModelProperty(value = "主图")

+ 0
- 4
src/main/resources/application-dev.yml View File

@@ -14,7 +14,3 @@ logging:
14 14
   level:
15 15
     root: info
16 16
     springfox: info
17
-
18
-weixin:
19
-  pay:
20
-    keyPath: E:/work/shigongli/v2/service/cert/apiclient_cert.p12

+ 18
- 0
src/main/resources/application-prod.yml View File

@@ -10,3 +10,21 @@ spring:
10 10
     url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/shigongli-v2?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
11 11
     username: shigongli
12 12
     password: shigongli@123
13
+
14
+
15
+weixin:
16
+  miniapp:
17
+    appid: wx06a7372d48d56843
18
+    secret: ead0c7b1dd40ce828b1fd9bf18183584
19
+    token:
20
+    aesKey:
21
+    msgDataFormat: JSON
22
+  pay:
23
+    appId: wx06a7372d48d56843
24
+    mchId: 1612121997
25
+    mchKey: fUbYPldU5bUCYRl97vMv69JQujsJ8dj5
26
+    subAppId:
27
+    subMchId:
28
+    keyPath: /opt/yunzhi/sgl-v2/cert/apiclient_cert.p12
29
+    notifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/order
30
+    refundNotifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/refund

+ 3
- 3
src/main/resources/application.yml View File

@@ -59,9 +59,9 @@ weixin:
59 59
     mchKey: fUbYPldU5bUCYRl97vMv69JQujsJ8dj5
60 60
     subAppId:
61 61
     subMchId:
62
-    keyPath: /yunpan/shigongli/cert/apiclient_cert.p12
63
-    notifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/order
64
-    refundNotifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/refund
62
+    keyPath: E:/work/shigongli/v2/service/cert/apiclient_cert.p12
63
+    notifyUrl: https://sgl-v2-test.njyunzhi.com/api/wxpay/notify/order
64
+    refundNotifyUrl: https://sgl-v2-test.njyunzhi.com/api/wxpay/notify/refund
65 65
 
66 66
 ## 高德地图
67 67
 amap:

src/main/resources/logback.xml → src/main/resources/logback.xml.bak View File


+ 18
- 0
src/main/resources/mapper/TaOrderPayMapper.xml View File

@@ -42,4 +42,22 @@
42 42
             t.create_date DESC
43 43
             LIMIT 1
44 44
     </select>
45
+    <select id="getShopWorkerBy" resultType="java.util.Map">
46
+        SELECT DISTINCT
47
+            t.shop_id,
48
+            p.openid
49
+        FROM
50
+            ta_order_sub t
51
+                INNER JOIN ta_shop_worker s ON s.shop_id = t.shop_id
52
+                INNER JOIN ta_person p ON p.person_id = s.person_id
53
+        WHERE
54
+            t.order_id = #{orderId}
55
+          <if test="subOrderId != null and subOrderId != ''">
56
+              AND t.sub_order_id = #{subOrderId}
57
+          </if>
58
+          AND t.`status` = 1
59
+          AND s.`status` = 1
60
+          AND p.`status` = 1
61
+    </select>
62
+
45 63
 </mapper>

+ 1
- 1
src/main/resources/mapper/TaOrderSubMapper.xml View File

@@ -173,7 +173,7 @@
173 173
             t.shop_id,
174 174
             s.shop_name,
175 175
             t.description,
176
-            sum( t.charges ) AS charges,
176
+            sum( IF( t.`status` = 0, 0 , t.charges) ) AS charges,
177 177
             sum( t.amount ) AS amount,
178 178
             sum( t.cashback ) AS cashback,
179 179
             sum( IF ( t.is_verified = 1, t.charges - t.commission_charge - t.cashback, 0 ) ) AS verfied_charge,

+ 1
- 0
src/main/resources/mapper/TaSaveMapper.xml View File

@@ -32,6 +32,7 @@
32 32
                         NULL                                     AS resource_no,
33 33
                         a.target_type,
34 34
                         a.target_id,
35
+                        '' as target_name,
35 36
                         0                                        AS like_num,
36 37
                         0                                        AS pv_num,
37 38
                         0                                        AS uv_num,

+ 1
- 0
src/main/resources/mapper/TaShopPackageMapper.xml View File

@@ -10,6 +10,7 @@
10 10
     <sql id="queryShopPackage">
11 11
         SELECT
12 12
             t.*,
13
+            concat(t.min_person, '-', t.max_person) as person_num,
13 14
             m.shop_name,
14 15
             s.traffic_rate,
15 16
             s.platform_rate,

+ 4
- 1
src/main/resources/mapper/TaTargetQuotaMapper.xml View File

@@ -67,7 +67,10 @@
67 67
                 ) AS is_saved
68 68
             FROM
69 69
                 ta_resource t
70
-            WHERE LOWER(t.title) like LOWER(CONCAT('%', #{word}, '%'))
70
+            WHERE (
71
+                LOWER(t.title) like LOWER(CONCAT('%', #{word}, '%'))
72
+                OR LOWER(t.target_name) like LOWER(CONCAT('%', #{word}, '%'))
73
+                    )
71 74
               <if test="targetType != null and targetType != ''">
72 75
                   AND t.target_type = #{targetType}
73 76
               </if>

+ 11
- 0
src/main/resources/mapper/TaVerifyTargetMapper.xml View File

@@ -49,4 +49,15 @@
49 49
         </if>
50 50
             AND t.`status` &gt; - 1
51 51
     </select>
52
+    <select id="getShopWorkerBy" resultType="java.lang.String">
53
+        SELECT
54
+            s.openid
55
+        FROM
56
+            ta_shop_worker t
57
+                INNER JOIN ta_person s ON s.person_id = t.person_id
58
+        WHERE
59
+            t.shop_id = #{shopId}
60
+          AND t.`status` = 1
61
+          AND s.`status` = 1
62
+    </select>
52 63
 </mapper>