Merge remote-tracking branch 'origin/master'
Conflicts:
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsGroupServiceImpl.java
| | |
| | | KEY = Constant.systemCommonConfig.getSignKey();
|
| | | }
|
| | |
|
| | | @Around(EDP)
|
| | | // @Around(EDP)
|
| | | public Object testAround(ProceedingJoinPoint joinPoint) throws IOException {
|
| | | Object[] args = joinPoint.getArgs();
|
| | | PrintWriter out = null;
|
| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
|
New file |
| | |
| | | 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();
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | 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 {
|
| | |
| | |
|
| | | 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")
|
New file |
| | |
| | | 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); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 批量选择更新 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int updateBatchSelective(List<UserShareGoodsGroup> list); |
| | | |
| | | /** |
| | | * 查询分享商品 |
| | | * @param recordId |
| | | * @return |
| | |
| | | @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")
|
| | |
| | | @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;
|
| | |
|
| | |
| | | @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) {
|
New file |
| | |
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?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> |
| | |
| | | </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` |
New file |
| | |
| | | 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);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsHongBaoMapService accountDetailsHongBaoMapService;
|
| | |
|
| | | @Override
|
| | | public void processOrder(Map<String, List<TaoBaoOrder>> orders) {
|
| | |
| | | orderMapper.updateByPrimaryKeySelective(updateOrder);
|
| | | Order order = oldOrder;
|
| | | // 订单返利比例
|
| | | BigDecimal rate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal rate = hongBaoManageService.getFanLiRate();
|
| | |
|
| | | // 查找是否存在红包
|
| | | List<HongBao> hongBaoList = hongBaoMapper.selectByOid(order.getId());
|
| | |
| | | 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
|
| | |
| | | // 查询UID的邀请赚订单
|
| | | List<HongBao> hongBaoList = hongBaoMapper.selectCanBalanceHongBaoByChildHongBaoAndUid(uid);
|
| | |
|
| | | List<Long> hbIdList = new ArrayList<>();
|
| | |
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | // 需要判断退款的订单号
|
| | | Set<String> drawBackOrders = new HashSet<String>();
|
| | |
| | | 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());
|
| | |
| | | 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)
|
| | |
| | | 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)
|
| | |
| | | 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);
|
| | |
| | | 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());
|
| | | }
|
| | |
| | | AccountDetails accountDetails = AccountDetailsFactory.create("+" + money, AccountDetailsFactory.TICHENG,
|
| | | null, null, new UserInfo(uid));
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | | // 记录返利红包与资金详情的对应关系
|
| | |
|
| | | // 添加到红包返利记录集合
|
| | | accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hbIdList, accountDetails.getId());
|
| | |
|
| | | // 发送推送
|
| | | try {
|
New file |
| | |
| | | /UserShareGoodsGroupServiceImpl.java |
| | |
| | | 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);
|
New file |
| | |
| | | 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);
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.cache.annotation.CacheEvict;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoManage;
|
| | | import com.yeshi.fanli.exception.HongBaoManageException;
|
| | |
|
| | | public interface HongBaoManageService {
|
| | |
|
| | |
| | | * @param count 数量
|
| | | * @throws UserShareGoodsRecordException
|
| | | */
|
| | | public void updateBrowseRecord(Long uid, Long auctionId, int count) throws UserShareGoodsRecordException;
|
| | | public void updateBrowseRecord(Long shareId, int count) throws UserShareGoodsRecordException;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | 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 = "创建成功";
|
| | |
| | | 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
|
| | |
| | | druid.testOnReturn=false
|
| | | druid.poolPreparedStatements=false
|
| | | druid.maxPoolPreparedStatementPerConnectionSize=20
|
| | | druid.filters=stat,wall |
| | | druid.filters=stat,wall |
New file |
| | |
| | | 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);
|
| | | }
|
| | |
|
| | | }
|