yujian
2020-06-29 3164f689c2a1fe18e2ea7c5f512657305790a3d2
拉新券统计
7个文件已修改
40 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponCountMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/admin/count/DailyCountCoupon.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/count/UserSystemCouponCountServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/count/UserSystemCouponCountService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponCountMapper.java
@@ -125,7 +125,7 @@
     * @param preDay
     * @return
     */
    BigDecimal countFreeMoneyByTypeAndDay(@Param("type") String type, @Param("preDay") String preDay);
    BigDecimal countFreeMoneyByTypeAndDay(@Param("type") String type, @Param("preDay") String preDay, @Param("source") String source);
    
    
    /**
@@ -134,7 +134,7 @@
     * @param preDay
     * @return
     */
    BigDecimal countCouponNumByDay(@Param("type") String type, @Param("preDay") String preDay);
    BigDecimal countCouponNumByDay(@Param("type") String type, @Param("preDay") String preDay, @Param("source") String source);
    
    
    /**
fanli/src/main/java/com/yeshi/fanli/entity/admin/count/DailyCountCoupon.java
@@ -24,7 +24,10 @@
        welfareFreeCouponMoney("福利免单统计金额"), 
        freeCouponGiveNum("赠送免单券统计数量"),
        rebateCouponNum("返利奖励券统计数量"),
        rebateCouponMoney("返利奖励券统计金额");
        rebateCouponMoney("返利奖励券统计金额"),
        pullNewCouponNum("拉新免单券统计数量"),
        pullNewCouponMoney("拉新免单券统计金额");
        private final String desc;
        
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponCountMapper.xml
@@ -278,6 +278,9 @@
     LEFT JOIN `yeshi_ec_hongbao_v2` v2 ON ho.`ho_hongbao_id` = v2.`hb_id`
     WHERE pr.`ucr_state` = 3 AND sp.`sc_type` = #{type} 
           AND TO_DAYS(v2.`hb_get_time`) = TO_DAYS(#{preDay})
           <if test="source != null and source != ''">
            AND c.`usc_source` = #{source}
        </if>
  </select>
  
  <select id="countRebateMoneyByDay" resultType="BigDecimal">
@@ -289,6 +292,9 @@
    SELECT COUNT(c.`usc_id`) FROM yeshi_ec_user_system_coupon c 
      LEFT JOIN yeshi_ec_system_coupon p ON  p.`sc_id`= c.`usc_coupon_id`
    WHERE p.`sc_type` = #{type} AND TO_DAYS(c.`usc_create_time`) = TO_DAYS(#{preDay})
        <if test="source != null and source != ''">
            AND c.`usc_source` = #{source}
        </if>
  </select>
  
  
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponRecordMapper.xml
@@ -71,7 +71,7 @@
      SELECT * FROM  `yeshi_ec_user_system_coupon_record` cd 
      LEFT JOIN `yeshi_ec_user_system_coupon` uc ON uc.`usc_id` = cd.`ucr_user_coupon_id`
    WHERE cd.`ucr_order_no` = #{orderNo}
        <if test="state != null">
        <if test="source != null">
             AND cd.`ucr_good_source` = #{source} 
         </if>
        <if test="state != null">
fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java
@@ -12,6 +12,7 @@
import com.yeshi.fanli.dao.user.count.DailyCountCouponDao;
import com.yeshi.fanli.entity.admin.count.DailyCountCoupon;
import com.yeshi.fanli.entity.admin.count.DailyCountCoupon.DailyCountCouponEnum;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.service.inter.count.DailyCountCouponService;
import com.yeshi.fanli.service.inter.count.UserSystemCouponCountService;
@@ -150,6 +151,10 @@
            total = userSystemCouponCountService.countCouponNumByDay(CouponTypeEnum.rebatePercentCoupon, preDay);
        } else if (DailyCountCouponEnum.rebateCouponMoney == typeEnum) {
            total = userSystemCouponCountService.countRebateMoneyByDay(preDay);
        } else if (DailyCountCouponEnum.pullNewCouponNum == typeEnum) {
            total = userSystemCouponCountService.countCouponNumByDay(CouponTypeEnum.freeCoupon, preDay, UserSystemCoupon.SOURCE_PULL_NEW);
        } else if (DailyCountCouponEnum.pullNewCouponMoney == typeEnum) {
            total = userSystemCouponCountService.countFreeMoneyByTypeAndDay(CouponTypeEnum.freeCoupon, preDay, UserSystemCoupon.SOURCE_PULL_NEW);
        }
        if (total == null) {
fanli/src/main/java/com/yeshi/fanli/service/impl/count/UserSystemCouponCountServiceImpl.java
@@ -268,13 +268,23 @@
    
    @Override
    public BigDecimal countFreeMoneyByTypeAndDay(CouponTypeEnum typeEnum, String preDay){
        return userSystemCouponCountMapper.countFreeMoneyByTypeAndDay(typeEnum.name(), preDay);
        return userSystemCouponCountMapper.countFreeMoneyByTypeAndDay(typeEnum.name(), preDay, null);
    }
    @Override
    public BigDecimal countFreeMoneyByTypeAndDay(CouponTypeEnum typeEnum, String preDay, String source){
        return userSystemCouponCountMapper.countFreeMoneyByTypeAndDay(typeEnum.name(), preDay, source);
    }
    
    
    @Override
    public BigDecimal countCouponNumByDay(CouponTypeEnum typeEnum, String preDay){
        return userSystemCouponCountMapper.countCouponNumByDay(typeEnum.name(), preDay);
        return userSystemCouponCountMapper.countCouponNumByDay(typeEnum.name(), preDay, null);
    }
    @Override
    public BigDecimal countCouponNumByDay(CouponTypeEnum typeEnum, String preDay, String source){
        return userSystemCouponCountMapper.countCouponNumByDay(typeEnum.name(), preDay, source);
    }
    
    @Override
fanli/src/main/java/com/yeshi/fanli/service/inter/count/UserSystemCouponCountService.java
@@ -108,5 +108,9 @@
     * @return
     */
    public long countCouponNum(Long uid, Integer state, Integer activated, List<String> list, List<String> listSource);
    public BigDecimal countCouponNumByDay(CouponTypeEnum typeEnum, String preDay, String source);
    public BigDecimal countFreeMoneyByTypeAndDay(CouponTypeEnum typeEnum, String preDay, String source);
    
}