yujian
2019-07-12 e2741d692b5d2e382ae3159a131d54a9ca75aa6f
Merge branch 'master' into div
5个文件已修改
43 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinReportMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinReportMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinReportMapper.java
@@ -9,7 +9,7 @@
    
    int deleteByPrimaryKey(String id);
    UserTaoLiJinReport selectByPrimaryKey(String id);
    UserTaoLiJinReport selectByPrimaryKeyStr(String id);
    
    /**
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinReportMapper.xml
@@ -22,10 +22,10 @@
    
  </resultMap>
  <sql id="Base_Column_List">utr_id,utr_unfreeze_amount,utr_unfreeze_num,utr_refund_amount,utr_refund_num,utr_alipay_amount,utr_use_amount,utr_use_num,utr_win_amount,utr_win_num,utr_pre_commission_amount,utr_create_time,utr_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_report where utr_id = #{id,jdbcType=BIGINT}
  <select id="selectByPrimaryKeyStr" resultMap="BaseResultMap" parameterType="java.lang.String">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_report where utr_id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_taolijin_report where utr_id = #{id,jdbcType=BIGINT}</delete>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">delete from yeshi_ec_user_taolijin_report where utr_id = #{id,jdbcType=VARCHAR}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_report (utr_id,utr_unfreeze_amount,utr_unfreeze_num,utr_refund_amount,utr_refund_num,utr_alipay_amount,utr_use_amount,utr_use_num,utr_win_amount,utr_win_num,utr_pre_commission_amount,utr_create_time,utr_update_time) values (#{id,jdbcType=VARCHAR},#{unfreezeAmount,jdbcType=DECIMAL},#{unfreezeNum,jdbcType=INTEGER},#{refundAmount,jdbcType=DECIMAL},#{refundNum,jdbcType=INTEGER},#{alipayAmount,jdbcType=DECIMAL},#{useAmount,jdbcType=DECIMAL},#{useNum,jdbcType=INTEGER},#{winAmount,jdbcType=DECIMAL},#{winNum,jdbcType=INTEGER},#{preCommissionAmount,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_report
    <trim prefix="(" suffix=")" suffixOverrides=",">
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
@@ -407,7 +407,7 @@
        // 15天前过期
        Date date = null;
        try {
            date = DateUtil.reduceDay(15, new Date());
            date = DateUtil.reduceDay(14, new Date());
        } catch (ParseException e) {
            e.printStackTrace();
        }
@@ -423,16 +423,27 @@
        
        BigDecimal total = new BigDecimal(0);
        for (UserTaoLiJinOrigin userTaoLiJinOrigin: list) {
            SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
            String time = sd.format(userTaoLiJinOrigin.getCreateTime());
            BigDecimal moneySurplus = userTaoLiJinOrigin.getMoneySurplus();
            total = MoneyBigDecimalUtil.add(total, moneySurplus);
            String rightsId = null;
            boolean refund = false;
            TaoLiJinOriginEnum originEnum = userTaoLiJinOrigin.getOrigin();
            if (TaoLiJinOriginEnum.refund.equals(originEnum)) {
                refund = true;
                rightsId = userTaoLiJinOrigin.getRightsId();
            }
            UserTaoLiJinOrigin origin = new UserTaoLiJinOrigin();
            origin.setId(userTaoLiJinOrigin.getId());
            origin.setMoneySurplus(new BigDecimal(0));
            origin.setUpdateTime(new Date());
            userTaoLiJinOriginMapper.updateByPrimaryKeySelective(origin);
            
            SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd hh.mm");
            String time = sd.format(userTaoLiJinOrigin.getCreateTime());
            if (origin.getOrigin().equals(TaoLiJinOriginEnum.refund)) {
                String rightsId = userTaoLiJinOrigin.getRightsId();
            if (refund) {
                UserTaoLiJinReport report = userTaoLiJinReportService.selectByPrimaryKey(rightsId);
                Date shareTime = null;
                if (report == null) {
@@ -446,7 +457,7 @@
                content.setState("红包收回");
                content.setSource("于["+ sd.format(shareTime) + "]创建的分享未被领取部分");
                content.setTimeDesc("退回于" + time);
                content.setMoney(userTaoLiJinOrigin.getMoneySurplus());
                content.setMoney(moneySurplus);
                content.setReason("本笔退回推广红包从退回日起至今并未产生分享记录");
                content.setResult("长期未使用收回");
                userOtherMsgNotificationService.taoLiJinMsg(uid, "如有疑问请联系人工客服", content);
@@ -455,16 +466,13 @@
                // 消息
                MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                content.setState("红包收回");
                content.setSource(origin.getOrigin().getDesc());
                content.setSource(originEnum.getDesc());
                content.setTimeDesc("获得于" + time);
                content.setMoney(userTaoLiJinOrigin.getMoneySurplus());
                content.setMoney(moneySurplus);
                content.setReason("本笔推广红包从获得日起至今并未产生分享记录");
                content.setResult("长期未使用收回");
                userOtherMsgNotificationService.taoLiJinMsg(uid, "如有疑问请联系人工客服", content);
            }
            total = MoneyBigDecimalUtil.add(total, userTaoLiJinOrigin.getMoneySurplus());
        }
        
        // 用户剩余淘礼金
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java
@@ -376,8 +376,7 @@
                // 使用成功消息
                try {
                    String beizhu = "未被领取/使用的部分将会退回";
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd hh.mm");
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
                    String time = sd.format(new Date());
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包扣除");
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java
@@ -171,7 +171,7 @@
    
    @Override
    public UserTaoLiJinReport selectByPrimaryKey(String id) {
        return userTaoLiJinReportMapper.selectByPrimaryKey(id);
        return userTaoLiJinReportMapper.selectByPrimaryKeyStr(id);
    }
    
}