张延森 2 years ago
parent
commit
6c2b999b72

+ 1
- 1
src/main/java/com/yunzhi/marketing/broker/controller/BkNoticeController.java View File

@@ -62,7 +62,7 @@ public class BkNoticeController extends BaseController {
62 62
         IPage<BkNotice> pg = new Page<>(pageNum, pageSize);
63 63
         QueryWrapper<BkNotice> queryWrapper = new QueryWrapper<>();
64 64
         queryWrapper.eq(!StringUtils.isEmpty(noticeType), "notice_type", noticeType);
65
-        queryWrapper.eq("wx".equals(client) && mine, "person_id", getPersonId(request));
65
+        queryWrapper.eq("wx".equals(client) && null != mine && mine, "person_id", getPersonId(request));
66 66
         queryWrapper.gt("status", CommConstant.STATUS_DELETE);
67 67
 
68 68
         if ("admin".equals(client)) {

+ 1
- 3
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java View File

@@ -814,9 +814,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
814 814
             taRecommendCustomerVO.setCustomerVisit(customerVisit);
815 815
         }
816 816
 
817
-        LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
818
-        channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,id);
819
-        ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
817
+        ChannelCustomer customer = channelCustomerMapper.getMoreInfoById(null, id);
820 818
         if (null != customer) {
821 819
             taRecommendCustomerVO.setChannelCustomer(customer);
822 820
         }

+ 2
- 2
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java View File

@@ -160,9 +160,9 @@ public class ChannelCustomerController extends BaseController {
160 160
      */
161 161
     @ApiOperation(value = "森哥看这里-wx-驻场确认结佣", notes = "森哥看这里-wx-驻场确认结佣")
162 162
     @RequestMapping(value="/{plat}/marking/{bizType}",method= RequestMethod.PUT)
163
-    public ResponseBean commissionCustomer(@RequestParam String bizType,
163
+    public ResponseBean commissionCustomer(@PathVariable String bizType,
164 164
                                            @RequestBody MarkingSignatoryCustomerDTO params) throws Exception {
165
-        List<String> whiteList = Arrays.asList("commission", "signatory");
165
+        List<String> whiteList = Arrays.asList("commission", "signatory", "all-payment");
166 166
         if (!whiteList.contains(bizType)) {
167 167
             return ResponseBean.error("404接口不存在", ResponseBean.ERROR_ILLEGAL_PARAMS);
168 168
         }

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/MarkingSignatoryCustomerDTO.java View File

@@ -36,4 +36,7 @@ public class MarkingSignatoryCustomerDTO implements Serializable {
36 36
 
37 37
     /** 待结算佣金 **/
38 38
     private Integer unsettledCommission;
39
+
40
+    /** 本次结佣 **/
41
+    private Integer currentCommission;
39 42
 }

+ 1
- 1
src/main/java/com/yunzhi/marketing/xlk/mapper/ChannelCustomerMapper.java View File

@@ -57,7 +57,7 @@ public interface ChannelCustomerMapper extends BaseMapper<ChannelCustomer> {
57 57
 
58 58
     List<CustomerDetailVO> getSuccessCustomerDetail(@Param("params") StatisticsDTO statisticsDTo);
59 59
 
60
-    ChannelCustomer getMoreInfoById(String id);
60
+    ChannelCustomer getMoreInfoById(@Param("channelCustomerId") String channelCustomerId, @Param("customerId") String customerId);
61 61
 
62 62
     List<ChannelCustomer> getRecommendedOrExpired(@Param("buildingId") String buildingId,@Param("phone") String phone);
63 63
 }

+ 4
- 4
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java View File

@@ -511,7 +511,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
511 511
 
512 512
     @Override
513 513
     public ChannelCustomer getMoreInfoById(String id) {
514
-        return channelCustomerMapper.getMoreInfoById(id);
514
+        return channelCustomerMapper.getMoreInfoById(id, null);
515 515
     }
516 516
 
517 517
     @Override
@@ -608,7 +608,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
608 608
         customer.setTotalCommission(intIfNvl(params.getTotalCommission()));
609 609
 
610 610
         Integer settledCommission = intIfNvl(bkAccountRecordMapper.getTotalChargesBy(customer.getChannelCustomerId(), bizType));
611
-        settledCommission += intIfNvl(params.getSettledCommission()); // 最新的需要加上本次结算佣金
611
+        settledCommission += intIfNvl(params.getCurrentCommission()); // 最新的需要加上本次结算佣金
612 612
         recommendPerson.setSettledCommission(intIfNvl(recommendPerson.getSettledCommission()) -
613 613
                 intIfNvl(customer.getSettledCommission()) +
614 614
                 settledCommission);
@@ -621,7 +621,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
621 621
         // 生成佣金记录
622 622
         BkAccountRecord bkAccountRecord = bkAccountRecordMapper.getRecordBy(customer.getChannelCustomerId(), bizType);
623 623
         if (bkAccountRecord != null) {
624
-            bkAccountRecord.setCharges(params.getSettledCommission());
624
+            bkAccountRecord.setCharges(params.getCurrentCommission());
625 625
             bkAccountRecordMapper.updateById(bkAccountRecord);
626 626
         } else {
627 627
             bkAccountRecord = new BkAccountRecord();
@@ -630,7 +630,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
630 630
             bkAccountRecord.setBuildingId(taBuilding.getBuildingId());
631 631
             bkAccountRecord.setBuildingName(StringUtils.ifNull(taBuilding.getName(), taBuilding.getBuildingName()));
632 632
             bkAccountRecord.setCustomerName(customer.getName());
633
-            bkAccountRecord.setCharges(intIfNvl(params.getSettledCommission()));
633
+            bkAccountRecord.setCharges(intIfNvl(params.getCurrentCommission()));
634 634
             bkAccountRecord.setChargeType(1);
635 635
             bkAccountRecord.setChargeCode(bizType);
636 636
             bkAccountRecord.setStatus(CommConstant.STATUS_NORMAL);

+ 7
- 2
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml View File

@@ -192,8 +192,13 @@
192 192
             xlk_channel_customer t
193 193
                 LEFT JOIN ta_channel s ON t.channel_id = s.channel_id
194 194
             LEFT JOIN ta_person m ON m.person_id = t.recommend_person
195
-        WHERE
196
-            t.channel_customer_id = #{id}
195
+        WHERE 1 = 1
196
+             <if test="channelCustomerId != null and channelCustomerId != ''">
197
+                 AND t.channel_customer_id = #{channelCustomerId}
198
+            </if>
199
+            <if test="customerId != null and customerId != ''">
200
+                AND t.customer_id = #{customerId}
201
+            </if>
197 202
     </select>
198 203
     <select id="getRecommendedOrExpired" resultType="com.yunzhi.marketing.xlk.entity.ChannelCustomer">
199 204
         SELECT