Administrator
2018-12-10 94c29daf7cb722635c1735e8d8bd403105e999d8
Merge remote-tracking branch 'origin/master'

Conflicts:
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsGroupServiceImpl.java
14个文件已修改
9个文件已添加
496 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/aspect/SignValidateAspect.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/DynamicRecommendAdminController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5ShareController.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/DynamicRecommendController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/web/WebGoodsClassController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/AccountDetailHongBaoMapMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/share/UserShareGoodsGroupMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/AccountDetails.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/HongBao.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/AccountDetailHongBaoMap.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/HongBaoManageException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/money/AccountDetailHongBaoMapMapper.xml 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/share/UserShareGoodsGroupMapper.xml 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/AccountDetailsHongBaoMapServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsGroupServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/AccountDetailsHongBaoMapService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/HongBaoManageService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserShareGoodsGroupService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/druid.properties 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/MyBatisProduce.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/aspect/SignValidateAspect.java
@@ -38,7 +38,7 @@
        KEY = Constant.systemCommonConfig.getSignKey();
    }
    @Around(EDP)
//    @Around(EDP)
    public Object testAround(ProceedingJoinPoint joinPoint) throws IOException {
        Object[] args = joinPoint.getArgs();
        PrintWriter out = null;
fanli/src/main/java/com/yeshi/fanli/controller/admin/DynamicRecommendAdminController.java
@@ -15,6 +15,8 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.entity.bus.recommend.DynamicRecommend;
import com.yeshi.fanli.entity.bus.recommend.MaskKey;
@@ -23,7 +25,6 @@
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.exception.HongBaoManageException;
import com.yeshi.fanli.service.MaskKeyService;
import com.yeshi.fanli.service.inter.goods.RecommendDetailsService;
import com.yeshi.fanli.service.inter.goods.RecommendReplyService;
@@ -35,8 +36,6 @@
import com.yeshi.fanli.util.GsonUtil;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import net.sf.json.JSONObject;
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5ShareController.java
New file
@@ -0,0 +1,50 @@
package com.yeshi.fanli.controller.apph5;
import java.io.PrintWriter;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
@Controller
@RequestMapping("api/apph5/v1/share")
public class AppH5ShareController {
    @Resource
    private UserShareGoodsGroupService userShareGoodsGroupService;
    /**
     * 分享商品
     * @param callback
     * @param shareId  分享id
     * @param source   来源
     * @param out
     */
    @RequestMapping(value = "record")
    public void query(String callback, Long shareId, String source, PrintWriter out) {
        try {
            if (shareId == null) {
                out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("传递参数不正确")));
                return;
            }
            userShareGoodsGroupService.updateBrowseRecord(shareId, 1);
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("更新成功")));
        } catch (UserShareGoodsRecordException e) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getMsg())));
        } catch (Exception e) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("更新失败")));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/DynamicRecommendController.java
@@ -46,6 +46,8 @@
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/v1/dynamic")
public class DynamicRecommendController {
fanli/src/main/java/com/yeshi/fanli/controller/web/WebGoodsClassController.java
@@ -6,22 +6,20 @@
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.taobao.TaoBaoCoupon;
import com.yeshi.fanli.exception.HongBaoManageException;
import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
import com.yeshi.fanli.util.Utils;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/web/v1/class")
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/AccountDetailHongBaoMapMapper.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.dao.mybatis.money;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.money.AccountDetailHongBaoMap;
public interface AccountDetailHongBaoMapMapper extends BaseMapper<AccountDetailHongBaoMap> {
    /**
     * 根据HongBaoId获取对象
     *
     * @param hongBaoId
     * @return
     */
    AccountDetailHongBaoMap selectByHongBaoId(Long hongBaoId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/share/UserShareGoodsGroupMapper.java
@@ -29,6 +29,13 @@
    
    
    /**
     * 批量选择更新
     * @param list
     * @return
     */
    int updateBatchSelective(List<UserShareGoodsGroup> list);
    /**
     * 查询分享商品
     * @param recordId
     * @return
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/AccountDetails.java
@@ -24,6 +24,13 @@
@org.yeshi.utils.mybatis.Table("yeshi_ec_account_details")
public class AccountDetails {
    public AccountDetails(Long id) {
        this.id = id;
    }
    public AccountDetails() {
    }
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/HongBao.java
@@ -147,6 +147,14 @@
    @org.yeshi.utils.mybatis.Column(name = "urank")
    private Integer urank;
    public HongBao() {
    }
    public HongBao(Long id) {
        this.id = id;
    }
    @org.yeshi.utils.mybatis.Column(name = "hasChild")
    private Boolean hasChild;
@@ -156,15 +164,9 @@
    @org.yeshi.utils.mybatis.Column(name = "balance_time")
    @Column(name = "balance_time")
    private Date balanceTime;
    @Transient // 分享邀请金额总额
    private BigDecimal ShareAndInviteMoney;
    public HongBao() {
    }
    private BigDecimal ShareAndInviteMoney;
    public HongBao(UserInfo userInfo, BigDecimal money, String param, int type, int state, long createtime,
            long preGettime, long getTime, String getIp, String beizhu) {
fanli/src/main/java/com/yeshi/fanli/entity/money/AccountDetailHongBaoMap.java
New file
@@ -0,0 +1,70 @@
package com.yeshi.fanli.entity.money;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.bus.user.AccountDetails;
import com.yeshi.fanli.entity.bus.user.HongBao;
/**
 * 账户明细与红包映射记录
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_account_details_hongbao_map")
public class AccountDetailHongBaoMap {
    @Column(name = "ahm_id")
    private Long id;
    @Column(name = "ahm_hongbao_id")
    private HongBao hongBao;
    @Column(name = "ahm_account_details_id")
    private AccountDetails accountDetails;
    @Column(name = "ahm_createtime")
    private Date createTime;
    @Column(name = "ahm_updatetime")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public HongBao getHongBao() {
        return hongBao;
    }
    public void setHongBao(HongBao hongBao) {
        this.hongBao = hongBao;
    }
    public AccountDetails getAccountDetails() {
        return accountDetails;
    }
    public void setAccountDetails(AccountDetails accountDetails) {
        this.accountDetails = accountDetails;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/HongBaoManageException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception;
public class HongBaoManageException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public HongBaoManageException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public HongBaoManageException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/money/AccountDetailHongBaoMapMapper.xml
New file
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.money.AccountDetailHongBaoMapMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.money.AccountDetailHongBaoMap">
        <id column="ahm_id" property="id" jdbcType="BIGINT" />
        <result column="ahm_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <result column="ahm_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
        <association property="hongBao" column="ahm_hongbao_id"
            javaType="com.yeshi.fanli.entity.bus.user.HongBao">
            <id column="ahm_hongbao_id" property="id" jdbcType="BIGINT" />
        </association>
        <association property="accountDetails" column="ahm_account_details_id"
            javaType="com.yeshi.fanli.entity.bus.user.AccountDetails">
            <id column="ahm_account_details_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">ahm_id,ahm_hongbao_id,ahm_account_details_id,ahm_createtime,ahm_updatetime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_account_details_hongbao_map where ahm_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByHongBaoId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_account_details_hongbao_map where ahm_hongbao_id =#{0}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_account_details_hongbao_map where ahm_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.money.AccountDetailHongBaoMap"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_account_details_hongbao_map
        (ahm_id,ahm_hongbao_id,ahm_account_details_id,ahm_createtime,ahm_updatetime)
        values
        (#{id,jdbcType=BIGINT},#{hongBao.id,jdbcType=BIGINT},#{accountDetails.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.money.AccountDetailHongBaoMap"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_account_details_hongbao_map
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">ahm_id,</if>
            <if test="hongBao != null">ahm_hongbao_id,</if>
            <if test="accountDetails != null">ahm_account_details_id,</if>
            <if test="createTime != null">ahm_createtime,</if>
            <if test="updateTime != null">ahm_updatetime,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="hongBao != null">#{hongBao.id,jdbcType=BIGINT},</if>
            <if test="accountDetails != null">#{accountDetails.id,jdbcType=BIGINT},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.money.AccountDetailHongBaoMap">update yeshi_ec_account_details_hongbao_map set
        ahm_hongbao_id = #{hongBao.id,jdbcType=BIGINT},ahm_account_details_id
        =
        #{accountDetails.id,jdbcType=BIGINT},ahm_createtime =
        #{createTime,jdbcType=TIMESTAMP},ahm_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where ahm_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.money.AccountDetailHongBaoMap">
        update yeshi_ec_account_details_hongbao_map
        <set>
            <if test="hongBao != null">ahm_hongbao_id=#{hongBao.id,jdbcType=BIGINT},</if>
            <if test="accountDetails != null">ahm_account_details_id=#{accountDetails.id,jdbcType=BIGINT},
            </if>
            <if test="createTime != null">ahm_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">ahm_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where ahm_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/share/UserShareGoodsGroupMapper.xml
@@ -88,6 +88,53 @@
          </foreach>
  </insert>
  
  <update id="updateBatchSelective" parameterType="java.util.List">
        update yeshi_ec_share_goods_group
        <trim prefix="set" suffixOverrides=",">
             <trim prefix="gu_today_browse =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                        <if test="item.todayBrowse !=null">
                     when gu_id=#{item.id} then #{item.todayBrowse}
                     </if>
                </foreach>
            </trim>
            <trim prefix="gu_total_browse =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                        <if test="item.totalBrowse !=null">
                     when gu_id=#{item.id} then #{item.totalBrowse}
                     </if>
                </foreach>
            </trim>
             <trim prefix="gu_total_order =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                        <if test="item.totalOrder !=null">
                     when gu_id=#{item.id} then #{item.totalOrder}
                     </if>
                </foreach>
            </trim>
             <trim prefix="gu_total_money =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                        <if test="item.totalMoney !=null">
                     when gu_id=#{item.id} then #{item.totalMoney}
                     </if>
                </foreach>
            </trim>
            <trim prefix="gu_browse_time =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                        <if test="item.browseTime !=null">
                     when gu_id=#{item.id} then #{item.browseTime}
                     </if>
                </foreach>
            </trim>
        </trim>
        where gu_id in
        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
            #{item.id,jdbcType=BIGINT}
        </foreach>
     </update>
   <select id="listByRecordId" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_share_goods_group  tg
     LEFT JOIN  `yeshi_ec_common_goods` cg ON tg.`gu_common_goods_id` = cg.`cg_id`
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/AccountDetailsHongBaoMapServiceImpl.java
New file
@@ -0,0 +1,50 @@
package com.yeshi.fanli.service.impl.hongbao;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.money.AccountDetailHongBaoMapMapper;
import com.yeshi.fanli.entity.bus.user.AccountDetails;
import com.yeshi.fanli.entity.bus.user.HongBao;
import com.yeshi.fanli.entity.money.AccountDetailHongBaoMap;
import com.yeshi.fanli.service.inter.hongbao.AccountDetailsHongBaoMapService;
@Service
public class AccountDetailsHongBaoMapServiceImpl implements AccountDetailsHongBaoMapService {
    @Resource
    private AccountDetailHongBaoMapMapper accountDetailHongBaoMapMapper;
    @Transactional
    @Override
    public void saveAccountDetailsHongBaoMap(Long hongBaoId, Long accountDetailsId) {
        if (hongBaoId == null || accountDetailsId == null)
            return;
        // 保存账户明细与红包的关系
        AccountDetailHongBaoMap map = new AccountDetailHongBaoMap();
        map.setAccountDetails(new AccountDetails(accountDetailsId));
        map.setCreateTime(new Date());
        map.setHongBao(new HongBao(hongBaoId));
        map.setUpdateTime(new Date());
        AccountDetailHongBaoMap oldMap = accountDetailHongBaoMapMapper.selectByHongBaoId(hongBaoId);
        if (oldMap == null) {
            accountDetailHongBaoMapMapper.insertSelective(map);
        }
    }
    @Transactional
    @Override
    public void saveAccountDetailsHongBaoMap(List<Long> hongBaoIdList, Long accountDetailsId) {
        if (hongBaoIdList != null)
            for (Long hongBaoId : hongBaoIdList)
                saveAccountDetailsHongBaoMap(hongBaoId, accountDetailsId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -45,6 +45,7 @@
import com.yeshi.fanli.exception.OrderItemException;
import com.yeshi.fanli.exception.TaoBaoWeiQuanException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.hongbao.AccountDetailsHongBaoMapService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
@@ -136,9 +137,12 @@
    @Resource
    private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private AccountDetailsHongBaoMapService accountDetailsHongBaoMapService;
    @Override
    public void processOrder(Map<String, List<TaoBaoOrder>> orders) {
@@ -421,7 +425,7 @@
            orderMapper.updateByPrimaryKeySelective(updateOrder);
            Order order = oldOrder;
            // 订单返利比例
            BigDecimal  rate = hongBaoManageService.getFanLiRate();
            BigDecimal rate = hongBaoManageService.getFanLiRate();
            // 查找是否存在红包
            List<HongBao> hongBaoList = hongBaoMapper.selectByOid(order.getId());
@@ -504,6 +508,9 @@
                AccountDetails accountDetails = AccountDetailsFactory.create("+" + hb.getMoney(),
                        AccountDetailsFactory.FANLI, orderItem, null, hb.getUserInfo());
                accountDetailsMapper.insertSelective(accountDetails);
                // 添加资金明细与红包的映射关系
                accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hb.getId(), accountDetails.getId());
                // 维权扣款(2018-08-05后开始实行)
                if (hb.getBalanceTime() != null
@@ -600,6 +607,8 @@
        // 查询UID的邀请赚订单
        List<HongBao> hongBaoList = hongBaoMapper.selectCanBalanceHongBaoByChildHongBaoAndUid(uid);
        List<Long> hbIdList = new ArrayList<>();
        BigDecimal money = new BigDecimal(0);
        // 需要判断退款的订单号
        Set<String> drawBackOrders = new HashSet<String>();
@@ -607,7 +616,7 @@
            hongBao = filterWeiQuanINGHongBao(hongBao);
            if (hongBao == null)
                continue;
            hongBao = hongBaoMapper.selectByPrimaryKeyForUpdate(hongBao.getId());
            if (hongBao.getState() == HongBao.STATE_BUKELINGQU || hongBao.getState() == HongBao.STATE_KELINGQU) {
                money = money.add(hongBao.getMoney());
@@ -616,6 +625,8 @@
                updateHongBao.setGetTime(System.currentTimeMillis());
                updateHongBao.setState(HongBao.STATE_YILINGQU);
                hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
                // 添加到红包返利记录集合
                hbIdList.add(hongBao.getId());
                // 2018-08-05 过后的订单才处理维权
                Date balanceTime = null;
                if (hongBao.getParent() != null)
@@ -650,6 +661,8 @@
                updateHongBao.setGetTime(System.currentTimeMillis());
                updateHongBao.setState(HongBao.STATE_YILINGQU);
                hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
                // 添加到红包返利记录集合
                hbIdList.add(hongBao.getId());
                // 2018-08-05 过后的订单才处理维权
                Date balanceTime = null;
                if (hongBao.getParent() != null)
@@ -679,7 +692,6 @@
        if (hbList != null && hbList.size() > 0)
            totalHongBaoList.addAll(hbList);
        for (HongBao hb : totalHongBaoList) {
            if (hb.getState() == HongBao.STATE_BUKELINGQU || hb.getState() == HongBao.STATE_KELINGQU) {
                hb = filterWeiQuanINGHongBao(hb);
@@ -691,6 +703,8 @@
                updateHongBao.setGetTime(System.currentTimeMillis());
                updateHongBao.setState(HongBao.STATE_YILINGQU);
                hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
                // 添加到红包返利记录集合
                hbIdList.add(hb.getId());
                if (!StringUtil.isNullOrEmpty(hb.getOrderId()))
                    drawBackOrders.add(hb.getOrderId());
            }
@@ -706,6 +720,10 @@
            AccountDetails accountDetails = AccountDetailsFactory.create("+" + money, AccountDetailsFactory.TICHENG,
                    null, null, new UserInfo(uid));
            accountDetailsMapper.insertSelective(accountDetails);
            // 记录返利红包与资金详情的对应关系
            // 添加到红包返利记录集合
            accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hbIdList, accountDetails.getId());
            // 发送推送
            try {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/.gitignore
New file
@@ -0,0 +1 @@
/UserShareGoodsGroupServiceImpl.java
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsGroupServiceImpl.java
@@ -244,8 +244,10 @@
                if (!StringUtil.isNullOrEmpty(pictUrl) && !pictUrl.contains("320x320")) {
                    commonGoods.setPicture(TbImgUtil.getTBSize320Img(pictUrl));
                }
                String json = gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion, null));
                String json = gson
                        .toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion, fcRate));
                dataObject.put("groupId", userShareGoodsGroup.getId());
                dataObject.put("goods", json);
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/AccountDetailsHongBaoMapService.java
New file
@@ -0,0 +1,28 @@
package com.yeshi.fanli.service.inter.hongbao;
import java.util.List;
/**
 * 红包ID与账户明细的资金对应
 *
 * @author Administrator
 *
 */
public interface AccountDetailsHongBaoMapService {
    /**
     * 保存红包与资金明细的关系
     *
     * @param hongBaoId
     * @param accountDetailsId
     */
    public void saveAccountDetailsHongBaoMap(Long hongBaoId, Long accountDetailsId);
    /**
     * 保存红包与资金明细的关系
     *
     * @param hongBaoIdList
     * @param accountDetailsId
     */
    public void saveAccountDetailsHongBaoMap(List<Long> hongBaoIdList, Long accountDetailsId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/HongBaoManageService.java
@@ -7,7 +7,6 @@
import org.springframework.cache.annotation.CacheEvict;
import com.yeshi.fanli.entity.bus.user.HongBaoManage;
import com.yeshi.fanli.exception.HongBaoManageException;
public interface HongBaoManageService {
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserShareGoodsGroupService.java
@@ -56,7 +56,7 @@
     * @param count 数量
     * @throws UserShareGoodsRecordException
     */
    public void updateBrowseRecord(Long uid, Long auctionId, int count) throws UserShareGoodsRecordException;
    public void updateBrowseRecord(Long shareId, int count) throws UserShareGoodsRecordException;
    /**
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -42,7 +42,6 @@
    public final static String HB_STATEEXCEPTION = "红包状态异常";
    public final static String HB_NOEXIST = "红包不存在";
    public static final int MR_COUNT = 2;
    public static final String HONGBAO_GOODS_PROPORTION = "hongbao_goods_proportion";
    public final static String BA_EXIST = "该类型账户已存在";
    public final static String BA_SUCCESS = "创建成功";
fanli/src/main/resource/druid.properties
@@ -1,8 +1,8 @@
druid.driverClassName=com.mysql.jdbc.Driver
#本地测试
#druid.url=jdbc:mysql://127.0.0.1:3306/ec_quan
#druid.username=root
#druid.password=hexiaohui
druid.url=jdbc:mysql://192.168.1.122:3306/ec_quan
druid.username=root
druid.password=hexiaohui
druid.url=jdbc:mysql://192.168.1.253:3306/ec_quan
@@ -43,4 +43,4 @@
druid.testOnReturn=false
druid.poolPreparedStatements=false
druid.maxPoolPreparedStatementPerConnectionSize=20
druid.filters=stat,wall
druid.filters=stat,wall
fanli/src/test/java/org/fanli/MyBatisProduce.java
New file
@@ -0,0 +1,16 @@
package org.fanli;
import org.junit.Test;
import org.yeshi.utils.mybatis.MyBatisMapperUtil;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
public class MyBatisProduce {
    @Test
    public void test3() {
        MyBatisMapperUtil.createMapper(UserShareGoodsRecord.class);
    }
}