Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | | import redis.clients.jedis.Jedis;
|
| | | import redis.clients.jedis.JedisPool;
|
| | |
|
| | | @Controller
|
| | |
| | |
|
| | | @Resource
|
| | | private InviteMaterialService inviteMaterialService;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private DynamicInfoDao dynamicInfoDao;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private JedisPool jedisPool;
|
| | | |
| | |
|
| | | @RequestMapping(value = "testimg")
|
| | | public void testImg(HttpServletRequest request, PrintWriter out) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 插入邀请素材
|
| | | *
|
| | |
| | | public void queryExistsAuctionId(PrintWriter out) {
|
| | | try {
|
| | | List<DynamicInfo> list = dynamicInfoDao.queryExistsAuctionId();
|
| | | for (DynamicInfo dynamicInfo: list) {
|
| | | for (DynamicInfo dynamicInfo : list) {
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | if (imgs == null || imgs.size() == 0) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | boolean update = false;
|
| | | for (GoodsPicture goodsPicture: imgs) {
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
|
| | | if (goods == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | if (goods.getAuctionId() == null) {
|
| | | update = true;
|
| | | goods.setAuctionId(goods.getId());
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (update) {
|
| | | dynamicInfo.setImgs(imgs);
|
| | | dynamicInfoDao.updateGoodInfo(dynamicInfo);
|
| | | }
|
| | | }
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("操作成功"));
|
| | | // JsonUtil.printMode(out, null, JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(list)));
|
| | | // JsonUtil.printMode(out, null,
|
| | | // JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(list)));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @RequestMapping(value = "getWaitingThreadsCount")
|
| | | public void getWaitingThreadsCount(PrintWriter out) {
|
| | | out.print(Constant.waitingThreadSet.size());
|
| | | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "getBinFaRedisKey")
|
| | | public void getPinFaRedisKey(PrintWriter out) {
|
| | | JSONArray array = new JSONArray();
|
| | | Jedis jedis = jedisPool.getResource();
|
| | | try {
|
| | | Set<String> sets = jedis.keys("rs-*");
|
| | | for (Iterator<String> its = sets.iterator(); its.hasNext();)
|
| | | array.add(its.next());
|
| | | } finally {
|
| | | jedisPool.returnResource(jedis);
|
| | | }
|
| | | out.println(array.toString());
|
| | | }
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getSpecialActivities")
|
| | | public void getSpecialActivities(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | public void getSpecialActivities(AcceptData acceptData, Long uid, PrintWriter out, String callback) {
|
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
|
| | | List<Special> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "special_activities",
|
| | | platformCode, Integer.parseInt(acceptData.getVersion()));
|
| | | |
| | |
|
| | | List<Special> list = new ArrayList<Special>();
|
| | | if (listSpecial != null) {
|
| | | list.addAll(listSpecial);
|
| | |
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("special", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | else
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(root));
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.google.gson.stream.JsonReader;
|
| | | import com.google.gson.stream.JsonWriter;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private ExtractService extractService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | /**
|
| | | * 新版资金详情(1.4.9)
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | |
|
| | | BigDecimal balance = userInfoService.getUserById(uid).getMyHongBao();
|
| | | BigDecimal balance = user.getMyHongBao();
|
| | |
|
| | | UserMoneyStatisticVO vo = new UserMoneyStatisticVO();
|
| | | vo.setBalanceMoney(balance);
|
| | |
| | |
|
| | | // 全部未到账
|
| | | minDate = new Date(0);
|
| | | maxDate=new Date(timeStamp);
|
| | | maxDate = new Date(timeStamp);
|
| | | vo.setTotalUnRecievedMoney(hongBaoV2Service.getUnRecievedMoneyWithCreateTime(uid, minDate, maxDate));
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | |
| | | }
|
| | | });
|
| | |
|
| | | // 获取提现中的信息
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | | if (extractingMoney.compareTo(new BigDecimal(0)) > 0)
|
| | | vo.setExtractingMoneyInfo("提现中:¥" + extractingMoney.setScale(2));
|
| | | // 获取是否绑定了微信
|
| | | if (!StringUtil.isNullOrEmpty(user.getWxUnionId())) {
|
| | | vo.setBindingWX(true);
|
| | | } else
|
| | | vo.setBindingWX(false);
|
| | |
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null && extra.getAutoExtract() != null && extra.getAutoExtract() == true)
|
| | | vo.setAutoExtract(true);
|
| | | else
|
| | | vo.setAutoExtract(false);
|
| | |
|
| | | vo.setAutoExtractHelpUrl(configService.get("auto_extract_help_url"));
|
| | | out.print(JsonUtil.loadTrueResult(builder.create().toJson(vo)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 自动提现
|
| | | * |
| | | * @param acceptData
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping("autoExtract")
|
| | | public void autoExtract(AcceptData acceptData, Long uid, Integer type, PrintWriter out) {
|
| | | if (type == null) {
|
| | | out.print(JsonUtil.loadFalseResult("请上传type"));
|
| | | return;
|
| | | }
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用戶未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfoExtra userExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用戶不存在"));
|
| | | return;
|
| | | }
|
| | | if (type == 1)// 开启
|
| | | {
|
| | | if (userExtra.getAutoExtract() == null || userExtra.getAutoExtract() == false) {
|
| | | if (StringUtil.isNullOrEmpty(user.getWxUnionId()))// 尚未綁定微信
|
| | | {
|
| | | out.print(JsonUtil.loadFalseResult("未綁定微信"));
|
| | | return;
|
| | | }
|
| | | // 设置自动提现
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(userExtra.getId());
|
| | | update.setAutoExtract(true);
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(update);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | return;
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | return;
|
| | | }
|
| | | } else {// 关闭
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(userExtra.getId());
|
| | | update.setAutoExtract(false);
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(update);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | * @return
|
| | | */
|
| | | BigDecimal sumToadyApplyByUid(@Param("uid") Long uid, @Param("day") String day);
|
| | | |
| | | /**
|
| | | * 根据用户ID与状态统计资金
|
| | | * @param uid
|
| | | * @param stateList
|
| | | * @return
|
| | | */
|
| | | BigDecimal sumMoneyByUidAndState(@Param("uid") Long uid,@Param("stateList")List<Integer> stateList);
|
| | | } |
| | |
| | | * @return
|
| | | */
|
| | | List<CommonOrder> listBySourceTypeAndTradeId(@Param("sourceType") int sourceType, @Param("tradeId") String tradeId);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 根据来源和交易ID获取订单列表
|
| | | * |
| | | * @param sourceType
|
| | | * @param tradeIdList
|
| | | * @return
|
| | | */
|
| | | List<CommonOrder> listBySourceTypeAndTradeIdList(@Param("sourceType") int sourceType, @Param("tradeIdList") List<String> tradeIdList);
|
| | | |
| | | |
| | | List<CommonOrder> listBySourceTypeAndTradeIdList(@Param("sourceType") int sourceType,
|
| | | @Param("tradeIdList") List<String> tradeIdList);
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | List<CommonOrder> listBySourceTypeAndStateAndThirdCrateTime(@Param("sourceType") int sourceType,
|
| | | @Param("state") Integer state, @Param("minTime") Long minTime, @Param("maxTime") Long maxTime,
|
| | | @Param("start") long start, @Param("count") int count);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 根据订单号查询
|
| | | * |
| | | * @param orderNO
|
| | | * @return
|
| | | */
|
| | | List<CommonOrder> getByOrderNo(@Param("uid") Long uid, @Param("orderNo") String orderNo);
|
| | |
|
| | | |
| | | /**
|
| | | * 根据用户ID查询
|
| | | * @param uid
|
| | | * @param stateList
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<CommonOrder> listByUid(@Param("uid")Long uid,@Param("stateList") List<Integer> stateList,@Param("start") long start,@Param("count") int count);
|
| | |
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dto.order;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | |
|
| | | public class CommonOrderAddResultDTO {
|
| | |
|
| | | public final static int TYPE_ADD = 1;
|
| | | public final static int TYPE_UPDATE = 2;
|
| | | public final static int TYPE_NOUPDATE = 3;
|
| | |
|
| | | private CommonOrder commonOrder;
|
| | | private int type;
|
| | |
|
| | | public CommonOrderAddResultDTO() {
|
| | |
|
| | | }
|
| | |
|
| | | public CommonOrderAddResultDTO(CommonOrder commonOrder, int type) {
|
| | | this.commonOrder = commonOrder;
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public CommonOrder getCommonOrder() {
|
| | | return commonOrder;
|
| | | }
|
| | |
|
| | | public void setCommonOrder(CommonOrder commonOrder) {
|
| | | this.commonOrder = commonOrder;
|
| | | }
|
| | |
|
| | | public int getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(int type) {
|
| | | this.type = type;
|
| | | }
|
| | | }
|
| | |
| | | @Column(name = "uie_gold_coin")
|
| | | private Integer goldCoin;
|
| | |
|
| | | //是否微信自動提現
|
| | | @Column(name = "uie_auto_extract")
|
| | | private Boolean autoExtract;
|
| | | |
| | | |
| | | // 创建时间
|
| | | @Column(name = "uie_create_time")
|
| | | private Date createTime;
|
| | |
| | | public void setGoldCoin(Integer goldCoin) {
|
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | | |
| | |
|
| | | public Boolean getAutoExtract() {
|
| | | return autoExtract;
|
| | | }
|
| | |
|
| | | public void setAutoExtract(Boolean autoExtract) {
|
| | | this.autoExtract = autoExtract;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.TLJLogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | |
| | | AND FROM_UNIXTIME(t.extractTime/1000,'%Y-%m-%d') = #{day}
|
| | | </select>
|
| | |
|
| | | |
| | | <select id="sumMoneyByUidAndState" resultType="java.math.BigDecimal">
|
| | | SELECT IFNULL(SUM(t.`money`),0) FROM yeshi_ec_extract t
|
| | | WHERE t.`uid` = #{uid}
|
| | | <if test="stateList!=null">
|
| | | <foreach collection="stateList" item="state" open="and (" close=")" separator=" or ">
|
| | | `state`=#{state}
|
| | | </foreach>
|
| | | </if>
|
| | | </select>
|
| | | |
| | | |
| | | </mapper> |
| | |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_order where mo_uid = #{uid,jdbcType=BIGINT} and |
| | | mo_order_id=#{orderId} |
| | | mo_order_id=#{orderId} order by mo_id desc limit 1 |
| | | </select> |
| | | <select id="listByOrderId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | |
| | | <result column="hb_id" property="hongbaoId" jdbcType="BIGINT" />
|
| | |
|
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" />
|
| | | |
| | |
|
| | | <association property="userInfo" column="co_uid"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
|
| | |
|
| | |
| | | resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.BaseResultMap" />
|
| | |
|
| | | </resultMap>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <resultMap id="ThreeResultMap" type="com.yeshi.fanli.vo.order.CommonOrderVO">
|
| | | <id column="co_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="co_order_no" property="orderNo" jdbcType="VARCHAR" />
|
| | |
| | | <result column="userPortrait" property="userPortrait" jdbcType="VARCHAR" />
|
| | | <result column="hb_id" property="hongbaoId" jdbcType="BIGINT" />
|
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" />
|
| | | |
| | | <association property="userInfo" column="co_uid" |
| | | select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey"/>
|
| | | |
| | | <association property="commonOrderGoods" column="co_order_goods_id" |
| | | select="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.selectByPrimaryKey"/>
|
| | |
|
| | | <association property="userInfo" column="co_uid"
|
| | | select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey" />
|
| | |
|
| | | <association property="commonOrderGoods" column="co_order_goods_id"
|
| | | select="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.selectByPrimaryKey" />
|
| | | </resultMap>
|
| | | |
| | |
|
| | | <sql id="Base_Column_List">co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_state_whole_order,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_order_by,co_create_time,co_update_time,co_trade_id
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | |
| | | <select id="selectBySourceTypeAndTradeId" resultMap="BaseResultMap">SELECT *
|
| | | FROM
|
| | | yeshi_ec_common_order co WHERE co.co_source_type=#{sourceType} and
|
| | | co_trade_id=#{tradeId} limit 1
|
| | | co_trade_id=#{tradeId} limit 1
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="listBySourceTypeAndTradeId" resultMap="BaseResultMap">SELECT *
|
| | | FROM
|
| | | yeshi_ec_common_order co WHERE co.co_source_type=#{sourceType} and
|
| | | co_trade_id=#{tradeId}
|
| | | </select>
|
| | | |
| | | |
| | | <select id="listBySourceTypeAndTradeIdList" resultMap="BaseResultMap">SELECT *
|
| | |
|
| | |
|
| | | <select id="listBySourceTypeAndTradeIdList" resultMap="BaseResultMap">
|
| | | SELECT *
|
| | | FROM
|
| | | yeshi_ec_common_order co WHERE co.co_source_type=#{sourceType} |
| | | yeshi_ec_common_order co WHERE
|
| | | co.co_source_type=#{sourceType}
|
| | | <if test="tradeIdList!=null">
|
| | | <foreach collection="tradeIdList" item="tradeId" open=" and (" close=")" separator=" or ">
|
| | | <foreach collection="tradeIdList" item="tradeId" open=" and ("
|
| | | close=")" separator=" or ">
|
| | | co.co_trade_id=#{tradeId}
|
| | | </foreach>
|
| | | </if>
|
| | | </select>
|
| | | |
| | | |
| | | <select id="listBySourceTypeAndStateAndThirdCrateTime" resultMap="BaseResultMap">SELECT *
|
| | |
|
| | |
|
| | | <select id="listBySourceTypeAndStateAndThirdCrateTime"
|
| | | resultMap="BaseResultMap">
|
| | | SELECT *
|
| | | FROM
|
| | | yeshi_ec_common_order co WHERE co.co_source_type=#{sourceType} |
| | | |
| | | yeshi_ec_common_order co WHERE
|
| | | co.co_source_type=#{sourceType}
|
| | |
|
| | | <if test="state!=null">
|
| | | and co_state=#{state}
|
| | | </if>
|
| | | |
| | |
|
| | | <if test="minTime!=null">
|
| | | and UNIX_TIMESTAMP(co_third_create_time)*1000>=#{minTime}
|
| | | </if>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <if test="maxTime!=null">
|
| | | and #{maxTime}> UNIX_TIMESTAMP(co_third_create_time)*1000
|
| | | and #{maxTime}> UNIX_TIMESTAMP(co_third_create_time)*1000
|
| | | </if>
|
| | | |
| | |
|
| | | order by co_id desc
|
| | | limit #{start},#{count}
|
| | | </select>
|
| | | |
| | |
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT}
|
| | |
| | | MAX(co_settle_time) AS co_settle_time, co_order_by, co_create_time,
|
| | | co_update_time
|
| | | </sql>
|
| | | |
| | |
|
| | | <select id="listUserOrder" resultMap="ResultMap">
|
| | | <!-- 查询用户订单 -->
|
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, hb.hb_state AS
|
| | |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if>
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | |
| | |
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY
|
| | | co.co_third_create_time DESC LIMIT ${start},${count}
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="countUserOrder" resultType="java.lang.Long">
|
| | | <!-- 统计用户订单数量 -->
|
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM
|
| | |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if>
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | |
| | |
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A
|
| | | </select>
|
| | | <select id="listOrderGoodsInfo" resultMap="ResultMap"
|
| | |
| | | </foreach>
|
| | | GROUP BY tc.`co_order_no`,tc.`co_order_goods_id`
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="countHistoryOrder" resultType="java.util.HashMap">
|
| | | <!-- 统计历史订单数量 -->
|
| | | SELECT SUM(A.self)AS totalSelf,SUM(A.shared)AS
|
| | |
| | | </if>
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX |
| | | |
| | |
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX
|
| | |
|
| | | UNION ALL
|
| | | |
| | |
|
| | | <!-- 分享订单 -->
|
| | | SELECT 0 AS self,IFNULL(COUNT(ho_id),0) AS shared,0 AS invite FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
|
| | |
| | | = 20 ) hb ON hb.hb_id=ho.`ho_hongbao_id`
|
| | | <!-- 分享订单 -->
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL and hb.hb_state!=4
|
| | | WHERE hb.hb_id IS NOT NULL and hb.hb_state!=4
|
| | | <if test="day != null and day == 1">
|
| | | <!-- 今天 -->
|
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
|
| | |
| | | </if>
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ |
| | | |
| | |
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ
|
| | |
|
| | | UNION ALL
|
| | | |
| | |
|
| | | <!-- 邀请订单 -->
|
| | | SELECT 0 AS self,0 AS shared,IFNULL(COUNT(ho_id),0) AS invite FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
|
| | |
| | | (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR
|
| | | v2.`hb_type` = 21 OR v2.`hb_type` = 22 ) ) hbp ON
|
| | | hbp.hb_pid=ho.`ho_hongbao_id` LEFT JOIN yeshi_ec_common_order co ON
|
| | | co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL and hbp.hb_state!=4
|
| | | co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL and
|
| | | hbp.hb_state!=4
|
| | | <if test="day != null and day == 1">
|
| | | <!-- 今天 -->
|
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW())
|
| | |
| | | </if>
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | |
| | |
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="countByUidAndOrderState" resultType="java.util.HashMap">
|
| | | SELECT SUM(A.valid)AS totalValid, SUM(A.proces)AS
|
| | | totalProces,SUM(A.Invalid)AS totalInvite FROM (
|
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL <![CDATA[AND co.`co_state` <> 3]]>
|
| | | AND (co.`co_state_whole_order` =1 OR co.`co_state_whole_order` = 2)
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX |
| | | |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX
|
| | |
|
| | | UNION ALL
|
| | | |
| | |
|
| | | <!-- 维权订单 -->
|
| | | SELECT 0 AS valid,IFNULL(COUNT(ho_id),0) AS proces,0 AS Invalid FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
|
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state` = 3
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ |
| | | |
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ
|
| | |
|
| | | UNION ALL
|
| | | |
| | |
|
| | | <!-- 失效订单 -->
|
| | | SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(ho_id),0) AS Invalid FROM
|
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
|
| | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state_whole_order` = 3
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A
|
| | | </select>
|
| | | <select id="countBonusOrderNumber" resultType="java.lang.Long">
|
| | |
| | | IS NOT NULL
|
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
|
| | | <if test="day != null and day == 4">AND co.`co_state` = 2</if> <!-- 上月 :统计已收货 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A
|
| | | </select>
|
| | | <sql id="SELECT_HONGBAO_STATE">
|
| | |
| | | userPortrait FROM (SELECT hb.hb_id,hb.hb_uid,hb.`hb_money` AS
|
| | | totalMoney, hb.hb_state AS hongBaoState, hb.`hb_type` AS hongBaoType,
|
| | | hb.`hb_get_time` AS accountTime, hb.`hb_pre_get_time` AS
|
| | | preAccountTime, co.* FROM yeshi_ec_hongbao_order ho LEFT JOIN
|
| | | (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
|
| | | preAccountTime, co.* FROM yeshi_ec_hongbao_order ho LEFT JOIN
|
| | | (SELECT *
|
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
|
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" />
|
| | | <!-- 红包类型 -->
|
| | | <include refid="SELECT_HONGBAO_STATE" />
|
| | | <!-- 红包状态 -->
|
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL
|
| | | <include refid="SELECT_PARAM_ORDER_STATE" />
|
| | | <!-- 订单状态 -->
|
| | |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT
|
| | | JOIN yeshi_ec_user u ON u.id = A.hb_uid
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="listQueryWithNoChild" resultMap="ThreeResultMap">
|
| | | SELECT A.*,u.id AS userId,u.`nick_name` AS userName,u.`portrait` AS
|
| | | userPortrait FROM (SELECT hb.hb_id,hb.hb_uid,hb.`hb_money` AS
|
| | | totalMoney, hb.hb_state AS hongBaoState, hb.`hb_type` AS hongBaoType,
|
| | | hb.`hb_get_time` AS accountTime, hb.`hb_pre_get_time` AS
|
| | | preAccountTime, co.* FROM yeshi_ec_hongbao_order ho LEFT JOIN
|
| | | (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
|
| | | preAccountTime, co.* FROM yeshi_ec_hongbao_order ho LEFT JOIN
|
| | | (SELECT *
|
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
|
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" />
|
| | | <!-- 红包类型 -->
|
| | | <include refid="SELECT_HONGBAO_STATE" />
|
| | | <!-- 红包状态 -->
|
| | | )hb ON hb.hb_id=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order co
|
| | | ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL
|
| | | <include refid="SELECT_PARAM_ORDER_STATE" />
|
| | | <!-- 订单状态 -->
|
| | |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT
|
| | | JOIN yeshi_ec_user u ON u.id = A.hb_uid
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="countQuery" resultType="java.lang.Long">
|
| | | SELECT count(ho.ho_id) FROM yeshi_ec_hongbao_order ho LEFT JOIN
|
| | | (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
|
| | |
| | | <include refid="SELECT_HONGBAO_STATE" />
|
| | | <!-- 红包状态 -->
|
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL
|
| | | <include refid="SELECT_PARAM_ORDER_STATE" />
|
| | | <!-- 订单状态 -->
|
| | | <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]>
|
| | |
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="countQueryWithNoChild" resultType="java.lang.Long">
|
| | | SELECT count(ho.ho_id) FROM yeshi_ec_hongbao_order ho LEFT JOIN
|
| | | (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
|
| | |
| | | <include refid="SELECT_HONGBAO_STATE" />
|
| | | <!-- 红包状态 -->
|
| | | )hb ON hb.hb_id=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL
|
| | | LEFT JOIN yeshi_ec_common_order co
|
| | | ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL
|
| | | <include refid="SELECT_PARAM_ORDER_STATE" />
|
| | | <!-- 订单状态 -->
|
| | | <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]>
|
| | |
| | | <!-- 订单来源 -->
|
| | | <if test="source != null">AND co.co_source_type = #{source}</if>
|
| | | </select>
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | |
|
| | |
|
| | |
|
| | | <select id="getCouponHongbaoByOrderNo" resultMap="ResultMap">
|
| | | SELECT COALESCE(SUM(IF(hb.hb_type=1,hb.`hb_money`,0)),0)AS totalMoney,
|
| | | COALESCE(SUM(IF(hb.hb_type=10,hb.`hb_money`,0)),0)AS couponMoney,
|
| | |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]>
|
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL AND co.co_order_no = #{orderNo} AND co.`co_source_type` = #{sourceType}
|
| | | WHERE hb.hb_id IS NOT NULL AND co.co_order_no = #{orderNo} AND
|
| | | co.`co_source_type` = #{sourceType}
|
| | | <if test="orderState != null">
|
| | | AND co.co_state = #{orderState}
|
| | | <!-- 已收货 -->
|
| | | </if>
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="getByOrderNo" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_common_order co |
| | | SELECT * FROM
|
| | | yeshi_ec_common_order co
|
| | | WHERE co_uid = #{uid} AND co_order_no=#{orderNo}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByUid" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_common_order co
|
| | | WHERE co_uid = #{uid}
|
| | | <if test="stateList!=null">
|
| | | <foreach collection="stateList" separator=" or " open="and ("
|
| | | item="state" close=")">
|
| | | co_state=#{state}
|
| | | </foreach>
|
| | | </if>
|
| | | limit #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | </mapper>
|
| | |
| | | <!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.user.UserInfoExtraMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | | <id column="uie_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="uie_rank_source" property="rankSource" jdbcType="INTEGER"/>
|
| | | <result column="uie_rank_order_num" property="rankOrderNum" jdbcType="INTEGER"/>
|
| | | <result column="uie_rank_update_time" property="rankUpdateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/>
|
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/>
|
| | | <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/>
|
| | | <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/>
|
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER"/>
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR"/>
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER"/>
|
| | | |
| | | <association property="userInfo" column="uie_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | |
| | | <association property="userRank" column="uie_rank_id" javaType="com.yeshi.fanli.entity.bus.user.UserRank">
|
| | | <id column="uie_rank_id" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="VOResultMap" type="com.yeshi.fanli.vo.user.UserInfoExtraVO">
|
| | | <id column="uie_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="uie_rank_source" property="rankSource" jdbcType="INTEGER"/>
|
| | | <result column="uie_rank_order_num" property="rankOrderNum" jdbcType="INTEGER"/>
|
| | | <result column="uie_rank_update_time" property="rankUpdateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/>
|
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/>
|
| | | <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/>
|
| | | <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/>
|
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER"/>
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR"/>
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER"/>
|
| | | |
| | | <association property="userInfo" column="uie_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap"/>
|
| | | |
| | | <association property="userRank" column="uie_rank_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap"/>
|
| | | |
| | | </resultMap>
|
| | | |
| | | <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | | <id column="uie_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="uie_rank_source" property="rankSource" jdbcType="INTEGER"/>
|
| | | <result column="uie_rank_order_num" property="rankOrderNum" jdbcType="INTEGER"/>
|
| | | <result column="uie_rank_update_time" property="rankUpdateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/>
|
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/>
|
| | | <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/>
|
| | | <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/>
|
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER"/>
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR"/>
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER"/>
|
| | | |
| | | <association property="userInfo" column="uie_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | |
| | | <association property="userRank" column="uie_rank_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap"/>
|
| | | </resultMap>
|
| | | |
| | | |
| | | |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time</sql>
|
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}</delete>
|
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{sex,jdbcType=INTEGER},#{weiXin,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">uie_id,</if>
|
| | | <if test="userInfo != null">uie_uid,</if>
|
| | | <if test="userRank != null">uie_rank_id,</if>
|
| | | <if test="rankSource != null">uie_rank_source,</if>
|
| | | <if test="rankOrderNum != null">uie_rank_order_num,</if>
|
| | | <if test="rankUpdateTime != null">uie_rank_update_time,</if>
|
| | | <if test="inviteCode != null">uie_invite_code,</if>
|
| | | <if test="lotteryNewbies != null">uie_lottery_newbies,</if>
|
| | | <if test="couponNews != null">uie_coupon_news,</if>
|
| | | <if test="synchNavbar != null">uie_synch_navbar,</if>
|
| | | <if test="firstLoginTime != null">uie_first_login_time,</if>
|
| | | <if test="sex != null">uie_sex,</if>
|
| | | <if test="weiXin != null">uie_weixin,</if>
|
| | | <if test="goldCoin != null">uie_gold_coin,</if>
|
| | | <if test="createTime != null">uie_create_time,</if>
|
| | | <if test="updateTime != null">uie_update_time,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
|
| | | <if test="userRank != null">#{userRank.id,jdbcType=BIGINT},</if>
|
| | | <if test="rankSource != null">#{rankSource,jdbcType=INTEGER},</if>
|
| | | <if test="rankOrderNum != null">#{rankOrderNum,jdbcType=INTEGER},</if>
|
| | | <if test="rankUpdateTime != null">#{rankUpdateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="inviteCode != null">#{inviteCode,jdbcType=VARCHAR},</if>
|
| | | <if test="lotteryNewbies != null">#{lotteryNewbies,jdbcType=INTEGER},</if>
|
| | | <if test="couponNews != null">#{couponNews,jdbcType=INTEGER},</if>
|
| | | <if test="synchNavbar != null">#{synchNavbar,jdbcType=VARCHAR},</if>
|
| | | <if test="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</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.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra set uie_uid = #{userInfo.id,jdbcType=BIGINT},uie_rank_id = #{userRank.id,jdbcType=BIGINT},uie_rank_source = #{rankSource,jdbcType=INTEGER},uie_rank_order_num = #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = #{couponNews,jdbcType=INTEGER},uie_synch_navbar = #{synchNavbar,jdbcType=VARCHAR},uie_first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},uie_sex = #{sex,jdbcType=INTEGER},uie_weixin = #{weiXin,jdbcType=VARCHAR},uie_gold_coin = #{goldCoin,jdbcType=INTEGER},uie_create_time = #{createTime,jdbcType=TIMESTAMP},uie_update_time = #{updateTime,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra
|
| | | <set>
|
| | | <if test="userInfo != null">uie_uid=#{userInfo.id,jdbcType=BIGINT},</if>
|
| | | <if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if>
|
| | | <if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if>
|
| | | <if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if>
|
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if>
|
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},</if>
|
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
|
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if>
|
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where uie_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateInfoExtraByUid" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | | update yeshi_ec_user_info_extra
|
| | | <set>
|
| | | <if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if>
|
| | | <if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if>
|
| | | <if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if>
|
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if>
|
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},</if>
|
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
|
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if>
|
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where uie_uid = #{userInfo.id,jdbcType=BIGINT}
|
| | | </update>
|
| | | |
| | | |
| | | <select id="getInfoExtraByUid" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_user_info_extra
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | | <id column="uie_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="uie_rank_source" property="rankSource"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_rank_order_num" property="rankOrderNum"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_rank_update_time" property="rankUpdateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_invite_code" property="inviteCode"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="uie_lottery_newbies" property="lotteryNewbies"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_coupon_news" property="couponNews"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_synch_navbar" property="synchNavbar"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="uie_first_login_time" property="firstLoginTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_create_time" property="createTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_update_time" property="updateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER" />
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" />
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="uie_auto_extract" property="autoExtract"
|
| | | jdbcType="BOOLEAN" />
|
| | |
|
| | | <association property="userInfo" column="uie_uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | |
|
| | | <association property="userRank" column="uie_rank_id"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserRank">
|
| | | <id column="uie_rank_id" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="VOResultMap" type="com.yeshi.fanli.vo.user.UserInfoExtraVO">
|
| | | <id column="uie_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="uie_rank_source" property="rankSource"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_rank_order_num" property="rankOrderNum"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_rank_update_time" property="rankUpdateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_invite_code" property="inviteCode"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="uie_lottery_newbies" property="lotteryNewbies"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_coupon_news" property="couponNews"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_synch_navbar" property="synchNavbar"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="uie_first_login_time" property="firstLoginTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_create_time" property="createTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_update_time" property="updateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER" />
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" />
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="uie_auto_extract" property="autoExtract"
|
| | | jdbcType="BOOLEAN" />
|
| | | <association property="userInfo" column="uie_uid"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
|
| | |
|
| | | <association property="userRank" column="uie_rank_id"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap" />
|
| | |
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | | <id column="uie_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="uie_rank_source" property="rankSource"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_rank_order_num" property="rankOrderNum"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_rank_update_time" property="rankUpdateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_invite_code" property="inviteCode"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="uie_lottery_newbies" property="lotteryNewbies"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_coupon_news" property="couponNews"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="uie_synch_navbar" property="synchNavbar"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="uie_first_login_time" property="firstLoginTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_create_time" property="createTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_update_time" property="updateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER" />
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" />
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="uie_auto_extract" property="autoExtract"
|
| | | jdbcType="BOOLEAN" />
|
| | | <association property="userInfo" column="uie_uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | |
|
| | | <association property="userRank" column="uie_rank_id"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap" />
|
| | | </resultMap>
|
| | |
|
| | |
|
| | |
|
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_auto_extract
|
| | | </sql>
|
| | |
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}</delete>
|
| | |
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into
|
| | | yeshi_ec_user_info_extra
|
| | | (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_auto_extract)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{sex,jdbcType=INTEGER},#{weiXin,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{autoExtract,jdbcType=BOOLEAN})
|
| | | </insert>
|
| | |
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_user_info_extra
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">uie_id,</if>
|
| | | <if test="userInfo != null">uie_uid,</if>
|
| | | <if test="userRank != null">uie_rank_id,</if>
|
| | | <if test="rankSource != null">uie_rank_source,</if>
|
| | | <if test="rankOrderNum != null">uie_rank_order_num,</if>
|
| | | <if test="rankUpdateTime != null">uie_rank_update_time,</if>
|
| | | <if test="inviteCode != null">uie_invite_code,</if>
|
| | | <if test="lotteryNewbies != null">uie_lottery_newbies,</if>
|
| | | <if test="couponNews != null">uie_coupon_news,</if>
|
| | | <if test="synchNavbar != null">uie_synch_navbar,</if>
|
| | | <if test="firstLoginTime != null">uie_first_login_time,</if>
|
| | | <if test="sex != null">uie_sex,</if>
|
| | | <if test="weiXin != null">uie_weixin,</if>
|
| | | <if test="goldCoin != null">uie_gold_coin,</if>
|
| | | <if test="createTime != null">uie_create_time,</if>
|
| | | <if test="updateTime != null">uie_update_time,</if>
|
| | | <if test="autoExtract != null">uie_auto_extract,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
|
| | | <if test="userRank != null">#{userRank.id,jdbcType=BIGINT},</if>
|
| | | <if test="rankSource != null">#{rankSource,jdbcType=INTEGER},</if>
|
| | | <if test="rankOrderNum != null">#{rankOrderNum,jdbcType=INTEGER},</if>
|
| | | <if test="rankUpdateTime != null">#{rankUpdateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="inviteCode != null">#{inviteCode,jdbcType=VARCHAR},</if>
|
| | | <if test="lotteryNewbies != null">#{lotteryNewbies,jdbcType=INTEGER},</if>
|
| | | <if test="couponNews != null">#{couponNews,jdbcType=INTEGER},</if>
|
| | | <if test="synchNavbar != null">#{synchNavbar,jdbcType=VARCHAR},</if>
|
| | | <if test="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="autoExtract != null">#{autoExtract,jdbcType=BOOLEAN},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update
|
| | | yeshi_ec_user_info_extra set uie_uid =
|
| | | #{userInfo.id,jdbcType=BIGINT},uie_rank_id =
|
| | | #{userRank.id,jdbcType=BIGINT},uie_rank_source =
|
| | | #{rankSource,jdbcType=INTEGER},uie_rank_order_num =
|
| | | #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time =
|
| | | #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code =
|
| | | #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies =
|
| | | #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news =
|
| | | #{couponNews,jdbcType=INTEGER},uie_synch_navbar =
|
| | | #{synchNavbar,jdbcType=VARCHAR},uie_first_login_time =
|
| | | #{firstLoginTime,jdbcType=TIMESTAMP},uie_sex =
|
| | | #{sex,jdbcType=INTEGER},uie_weixin =
|
| | | #{weiXin,jdbcType=VARCHAR},uie_gold_coin =
|
| | | #{goldCoin,jdbcType=INTEGER},uie_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP},uie_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP},uie_auto_extract =
|
| | | #{autoExtract,jdbcType=BOOLEAN} where uie_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | | update yeshi_ec_user_info_extra
|
| | | <set>
|
| | | <if test="userInfo != null">uie_uid=#{userInfo.id,jdbcType=BIGINT},</if>
|
| | | <if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if>
|
| | | <if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if>
|
| | | <if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if>
|
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if>
|
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},
|
| | | </if>
|
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
|
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if>
|
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if>
|
| | | </set>
|
| | | where uie_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateInfoExtraByUid" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | | update yeshi_ec_user_info_extra
|
| | | <set>
|
| | | <if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if>
|
| | | <if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if>
|
| | | <if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if>
|
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if>
|
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},
|
| | | </if>
|
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
|
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if>
|
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if>
|
| | | </set>
|
| | | where uie_uid = #{userInfo.id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
|
| | |
|
| | | <select id="getInfoExtraByUid" resultMap="BaseResultMap">
|
| | | SELECT * FROM
|
| | | yeshi_ec_user_info_extra
|
| | | WHERE uie_uid = #{uid}
|
| | | </select>
|
| | | |
| | | <select id="getInfoExtraVOByUid" resultMap="VOResultMap">
|
| | | SELECT u.`id`,u.`nick_name`,u.`portrait`,ue.*,rk.*
|
| | | FROM yeshi_ec_user_info_extra ue
|
| | | LEFT JOIN yeshi_ec_user u ON ue.`uie_uid` = u.`id` |
| | | </select>
|
| | |
|
| | | <select id="getInfoExtraVOByUid" resultMap="VOResultMap">
|
| | | SELECT
|
| | | u.`id`,u.`nick_name`,u.`portrait`,ue.*,rk.*
|
| | | FROM
|
| | | yeshi_ec_user_info_extra ue
|
| | | LEFT JOIN yeshi_ec_user u ON ue.`uie_uid` =
|
| | | u.`id`
|
| | | LEFT JOIN yeshi_ec_user_rank rk ON rk.`ur_id` = ue.`uie_rank_id`
|
| | | WHERE u.id = #{uid}
|
| | | </select>
|
| | | |
| | | <select id="countByRankId" parameterType="java.lang.Long" resultType="java.lang.Long" >
|
| | | SELECT IFNULL(COUNT(t.`uie_id`),0) FROM `yeshi_ec_user_info_extra` t |
| | | WHERE t.`uie_rank_id` = #{rankId}
|
| | | </select>
|
| | | |
| | | <select id="gerUserRank" resultMap="AllResultMap">
|
| | | SELECT * FROM yeshi_ec_user_info_extra ue
|
| | | LEFT JOIN yeshi_ec_user_rank rk ON rk.`ur_id` = ue.`uie_rank_id`
|
| | | WHERE u.id
|
| | | = #{uid}
|
| | | </select>
|
| | |
|
| | | <select id="countByRankId" parameterType="java.lang.Long"
|
| | | resultType="java.lang.Long">
|
| | | SELECT IFNULL(COUNT(t.`uie_id`),0) FROM
|
| | | `yeshi_ec_user_info_extra` t
|
| | | WHERE t.`uie_rank_id` = #{rankId}
|
| | | </select>
|
| | |
|
| | | <select id="gerUserRank" resultMap="AllResultMap">
|
| | | SELECT * FROM
|
| | | yeshi_ec_user_info_extra ue
|
| | | LEFT JOIN yeshi_ec_user_rank rk ON
|
| | | rk.`ur_id` = ue.`uie_rank_id`
|
| | | WHERE ue.`uie_uid` = #{uid}
|
| | | </select>
|
| | | </select>
|
| | | </mapper>
|
| | |
| | | }
|
| | |
|
| | |
|
| | | // @Async()
|
| | | @Async()
|
| | | @Override
|
| | | public void firstRebateOrderRewardBoss(Long uid, Long originUid, String beizu) {
|
| | | if (uid == null || originUid == null)
|
| | |
| | | firstOrderReward(uid, originUid, Integer.parseInt(reward), "一", beizu);
|
| | | }
|
| | |
|
| | | // @Async()
|
| | | @Async()
|
| | | @Override
|
| | | public void firstRebateOrderRewardBossSuper(Long uid, Long originUid, String beizu) {
|
| | | if (uid == null || originUid == null)
|
| | |
| | | }
|
| | |
|
| | |
|
| | | // @Async()
|
| | | @Async()
|
| | | @Override
|
| | | public void firstShareOrderReward(Long uid, String beizu) {
|
| | | if(uid == null)
|
| | |
| | | }
|
| | |
|
| | |
|
| | | // @Async()
|
| | | @Async()
|
| | | @Override
|
| | | public void firstSharerOrderRewardBoss(Long uid, Long originUid, String beizu) {
|
| | | if (uid == null || originUid == null)
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.order.CommonOrderAddResultDTO;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public List<CommonOrder> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrders, Long uid) throws CommonOrderException {
|
| | | List<CommonOrder> commonOrderList = new ArrayList<>();
|
| | | public List<CommonOrderAddResultDTO> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrders, Long uid)
|
| | | throws CommonOrderException {
|
| | | List<CommonOrderAddResultDTO> commonOrderList = new ArrayList<>();
|
| | | // 判断所有的订单状态
|
| | | int invalidCount = 0;
|
| | | for (TaoBaoOrder tb : taoBaoOrders) {
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException {
|
| | | List<CommonOrder> commonOrderList = new ArrayList<>();
|
| | | public List<CommonOrderAddResultDTO> addPDDOrder(List<PDDOrder> pddOrderList, Long uid)
|
| | | throws CommonOrderException {
|
| | | List<CommonOrderAddResultDTO> commonOrderList = new ArrayList<>();
|
| | | // 判断所有的订单状态
|
| | | int invalidCount = 0;
|
| | | for (PDDOrder order : pddOrderList) {
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException {
|
| | | List<CommonOrder> commonOrderList = new ArrayList<>();
|
| | | public List<CommonOrderAddResultDTO> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException {
|
| | | List<CommonOrderAddResultDTO> commonOrderList = new ArrayList<>();
|
| | | // 判断所有的订单状态
|
| | | int invalidCount = 0;
|
| | | for (JDOrderItem tb : jdOrder.getOrderItemList()) {
|
| | |
| | | * @param commonOrder
|
| | | */
|
| | | @Transactional
|
| | | private CommonOrder addCommonOrder(CommonOrder commonOrder) throws CommonOrderException {
|
| | | private CommonOrderAddResultDTO addCommonOrder(CommonOrder commonOrder) throws CommonOrderException {
|
| | | // 判断商品是否存在
|
| | | if (commonOrder == null)
|
| | | throw new CommonOrderException(1, "订单为空");
|
| | |
| | | // 插入映射,保证交易ID的完整性
|
| | | commonOrderTradeIdMapMapper.insertSelective(new CommonOrderTradeIdMap(commonOrder.getId(),
|
| | | commonOrder.getTradeId(), new Date(), commonOrder.getSourceType()));
|
| | | return commonOrder;
|
| | | return new CommonOrderAddResultDTO(commonOrder, CommonOrderAddResultDTO.TYPE_ADD);
|
| | | } else {// 修改
|
| | | // 已经结算,已经失效,状态未改变的订单不处理
|
| | | if (oldCommonOrder.getState() == CommonOrder.STATE_JS || oldCommonOrder.getState() == CommonOrder.STATE_SX
|
| | | || oldCommonOrder.getState() == CommonOrder.STATE_WQ
|
| | | || (oldCommonOrder.getState().intValue() == commonOrder.getState())) {
|
| | | return oldCommonOrder;
|
| | | return new CommonOrderAddResultDTO(oldCommonOrder, CommonOrderAddResultDTO.TYPE_NOUPDATE);
|
| | | }
|
| | | // 交易ID一致才修改
|
| | | if (commonOrder.getTradeId() != null
|
| | |
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | updateCommonOrder.setTradeId(commonOrder.getTradeId());
|
| | | commonOrderMapper.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | return commonOrderMapper.selectByPrimaryKey(updateCommonOrder.getId());
|
| | | return new CommonOrderAddResultDTO(commonOrderMapper.selectByPrimaryKey(updateCommonOrder.getId()),
|
| | | CommonOrderAddResultDTO.TYPE_UPDATE);
|
| | | } else
|
| | | return oldCommonOrder;
|
| | | return new CommonOrderAddResultDTO(oldCommonOrder, CommonOrderAddResultDTO.TYPE_NOUPDATE);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return commonOrderMapper.getByOrderNo(uid, orderNO);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonOrder selectLatestValidByUid(Long uid) {
|
| | | List<Integer> stateList = new ArrayList<>();
|
| | | stateList.add(CommonOrder.STATE_FK);
|
| | | stateList.add(CommonOrder.STATE_JS);
|
| | | List<CommonOrder> commonOrderList = commonOrderMapper.listByUid(uid, stateList, 0, 1);
|
| | | if (commonOrderList == null || commonOrderList.size() == 0)
|
| | | return null;
|
| | | return commonOrderList.get(0);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.HongBao;
|
| | | import com.yeshi.fanli.dto.order.CommonOrderAddResultDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.AccountDetailsHongBaoMapService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.jd.JDOrderService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.pdd.PDDOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | |
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.cmq.HongBaoRecieveCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.PlaceOrderCMQManager;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private JDOrderService jdOrderService;
|
| | |
|
| | | @Resource
|
| | | private PDDOrderService pddOrderService;
|
| | |
|
| | | /**
|
| | | * 是否是分享订单
|
| | | * |
| | | * @param order
|
| | | * @return
|
| | | */
|
| | | private boolean isShareOrder(TaoBaoOrder order) {
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | | String pid = String.format("mm_%s_%s_%s", configList.get(0).getAccountId(), order.getSourceMediaId(),
|
| | | order.getAdPositionId());
|
| | | if (!StringUtil.isNullOrEmpty(order.getSpecialId())
|
| | | || pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID)) {// 设置渠道ID当做会员运营ID的位置ID
|
| | | return false;
|
| | | } else if (!StringUtil.isNullOrEmpty(order.getRelationId())) {
|
| | | return true;
|
| | | } else {
|
| | | // 通过红包查询
|
| | | CommonOrder commonOrder = commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO,
|
| | | order.getTradeId());
|
| | |
|
| | | if (commonOrder != null) {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(commonOrder.getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null
|
| | | && hongBaoOrder.getHongBaoV2().getType() == HongBaoV2.TYPE_SHARE_GOODS) {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public synchronized void processOrder(Map<String, List<TaoBaoOrder>> orders) {
|
| | |
| | | orderMapper.updateByPrimaryKeySelective(updateOrder);
|
| | |
|
| | | // 用第一个子订单锁定用户
|
| | | List<CommonOrder> commonOrderList = null;
|
| | | List<CommonOrderAddResultDTO> commonOrderList = null;
|
| | | try {
|
| | | commonOrderList = commonOrderService.addTaoBaoOrder(orderList, uid);
|
| | | hongBaoV2Service.addHongBao(commonOrderList, HongBaoV2.TYPE_ZIGOU);
|
| | | hongBaoV2Service.addHongBao(convertCommonOrder(commonOrderList), HongBaoV2.TYPE_ZIGOU);
|
| | |
|
| | | if (isCommonOrderAllAdd(commonOrderList)) {
|
| | | Order order = new Order();
|
| | | order.setOrderId(orderId);
|
| | | order.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | order.setUserInfo(new UserInfo(uid));
|
| | | try {
|
| | | PlaceOrderCMQManager.getInstance().addPlaceOrderMsg(order);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | } catch (CommonOrderException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "addTaoBaoOrder或addHongBao出错", "订单号:" + orderId);
|
| | |
| | |
|
| | | // 用第一个子订单锁定用户
|
| | | try {
|
| | | List<CommonOrder> commonOrders = commonOrderService.addTaoBaoOrder(orderList, uid);
|
| | | hongBaoV2Service.addHongBao(commonOrders, HongBaoV2.TYPE_SHARE_GOODS);
|
| | | List<CommonOrderAddResultDTO> commonOrders = commonOrderService.addTaoBaoOrder(orderList, uid);
|
| | | hongBaoV2Service.addHongBao(convertCommonOrder(commonOrders), HongBaoV2.TYPE_SHARE_GOODS);
|
| | | if (isCommonOrderAllAdd(commonOrders)) {
|
| | | Order order = new Order();
|
| | | order.setOrderId(orderId);
|
| | | order.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | order.setUserInfo(new UserInfo(uid));
|
| | | try {
|
| | | PlaceOrderCMQManager.getInstance().addPlaceOrderMsg(order);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | } catch (CommonOrderException e) {
|
| | | e.printStackTrace();
|
| | | } catch (HongBaoException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否为分享订单
|
| | | * |
| | | * @param order
|
| | | * @return
|
| | | */
|
| | | private boolean isShareOrder(JDOrder order) {
|
| | | if (order == null || order.getOrderItemList() == null || order.getOrderItemList().size() == 0)
|
| | | return false;
|
| | | Long positionId = order.getOrderItemList().get(0).getPositionId();
|
| | | if (positionId == JDApiUtil.POSITION_SHARE) {// 分享订单
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | List<CommonOrder> commonOrderList = commonOrderService.addJDOrder(jdOrder, uid);
|
| | | hongBaoV2Service.addHongBao(commonOrderList, HongBaoV2.TYPE_ZIGOU);
|
| | | List<CommonOrderAddResultDTO> commonOrderList = commonOrderService.addJDOrder(jdOrder, uid);
|
| | | hongBaoV2Service.addHongBao(convertCommonOrder(commonOrderList), HongBaoV2.TYPE_ZIGOU);
|
| | | if (isCommonOrderAllAdd(commonOrderList)) {
|
| | | Order order = new Order();
|
| | | order.setOrderId(jdOrder.getOrderId() + "");
|
| | | order.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | order.setUserInfo(new UserInfo(uid));
|
| | | try {
|
| | | PlaceOrderCMQManager.getInstance().addPlaceOrderMsg(order);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | } catch (CommonOrderException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + jdOrder.getOrderId());
|
| | |
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processShareJDOrder(JDOrder order, Long uid) {
|
| | | private void processShareJDOrder(JDOrder jdOrder, Long uid) {
|
| | | try {
|
| | | List<CommonOrder> commonOrderList = commonOrderService.addJDOrder(order, uid);
|
| | | hongBaoV2Service.addHongBao(commonOrderList, HongBaoV2.TYPE_SHARE_GOODS);
|
| | | List<CommonOrderAddResultDTO> commonOrderList = commonOrderService.addJDOrder(jdOrder, uid);
|
| | | hongBaoV2Service.addHongBao(convertCommonOrder(commonOrderList), HongBaoV2.TYPE_SHARE_GOODS);
|
| | | if (isCommonOrderAllAdd(commonOrderList)) {
|
| | | Order order = new Order();
|
| | | order.setOrderId(jdOrder.getOrderId() + "");
|
| | | order.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | order.setUserInfo(new UserInfo(uid));
|
| | | try {
|
| | | PlaceOrderCMQManager.getInstance().addPlaceOrderMsg(order);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | } catch (CommonOrderException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + order.getOrderId());
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + jdOrder.getOrderId());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | } catch (HongBaoException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + order.getOrderId());
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + jdOrder.getOrderId());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否是分享赚订单
|
| | | * |
| | | * @param order
|
| | | * @return
|
| | | */
|
| | | private boolean isShareOrder(PDDOrder pddOrder) {
|
| | | String positionId = pddOrder.getpId();
|
| | | if (PinDuoDuoApiUtil.PID_SHARE.equalsIgnoreCase(positionId))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | try {
|
| | | List<PDDOrder> pddOrderList = new ArrayList<>();
|
| | | pddOrderList.add(pddOrder);
|
| | | List<CommonOrder> commonOrderList = commonOrderService.addPDDOrder(pddOrderList, uid);
|
| | | hongBaoV2Service.addHongBao(commonOrderList, HongBaoV2.TYPE_ZIGOU);
|
| | | List<CommonOrderAddResultDTO> commonOrderList = commonOrderService.addPDDOrder(pddOrderList, uid);
|
| | | hongBaoV2Service.addHongBao(convertCommonOrder(commonOrderList), HongBaoV2.TYPE_ZIGOU);
|
| | | if (isCommonOrderAllAdd(commonOrderList)) {
|
| | | Order order = new Order();
|
| | | order.setOrderId(pddOrder.getOrderSn());
|
| | | order.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | order.setUserInfo(new UserInfo(uid));
|
| | | try {
|
| | | PlaceOrderCMQManager.getInstance().addPlaceOrderMsg(order);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | } catch (CommonOrderException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "addPDDOrder或addHongBao出错", "订单号:" + pddOrder.getOrderSn());
|
| | |
| | | * @param uid
|
| | | */
|
| | | @Transactional
|
| | | private void processSharePDDOrder(PDDOrder order, Long uid) {
|
| | | private void processSharePDDOrder(PDDOrder pddOrder, Long uid) {
|
| | | try {
|
| | | List<PDDOrder> pddOrderList = new ArrayList<>();
|
| | | pddOrderList.add(order);
|
| | | List<CommonOrder> commonOrderList = commonOrderService.addPDDOrder(pddOrderList, uid);
|
| | | hongBaoV2Service.addHongBao(commonOrderList, HongBaoV2.TYPE_SHARE_GOODS);
|
| | | pddOrderList.add(pddOrder);
|
| | | List<CommonOrderAddResultDTO> commonOrderList = commonOrderService.addPDDOrder(pddOrderList, uid);
|
| | | hongBaoV2Service.addHongBao(convertCommonOrder(commonOrderList), HongBaoV2.TYPE_SHARE_GOODS);
|
| | | if (isCommonOrderAllAdd(commonOrderList)) {
|
| | | Order order = new Order();
|
| | | order.setOrderId(pddOrder.getOrderSn());
|
| | | order.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | order.setUserInfo(new UserInfo(uid));
|
| | | try {
|
| | | PlaceOrderCMQManager.getInstance().addPlaceOrderMsg(order);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | } catch (CommonOrderException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + order.getOrderId());
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + pddOrder.getOrderId());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | } catch (HongBaoException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + order.getOrderId());
|
| | | LogHelper.errorDetailInfo(e, "addJDOrder或addHongBao出错", "订单号:" + pddOrder.getOrderId());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean isShareOrder(CommonOrder commonOrder) {
|
| | | switch (commonOrder.getSourceType()) {
|
| | | case Constant.SOURCE_TYPE_TAOBAO:
|
| | | return isShareOrder(taoBaoOrderService.selectByTradeId(commonOrder.getTradeId()));
|
| | | case Constant.SOURCE_TYPE_JD:
|
| | | return isShareOrder(jdOrderService.selectDetailByOrderId(Long.parseLong(commonOrder.getOrderNo())));
|
| | | case Constant.SOURCE_TYPE_PDD:
|
| | | return isShareOrder(pddOrderService.selectByOrderSn(commonOrder.getOrderNo()).get(0));
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转为普通订单
|
| | | * |
| | | * @param dtoList
|
| | | * @return
|
| | | */
|
| | | private List<CommonOrder> convertCommonOrder(List<CommonOrderAddResultDTO> dtoList) {
|
| | | List<CommonOrder> commonOrderList = new ArrayList<>();
|
| | | if (dtoList != null)
|
| | | for (CommonOrderAddResultDTO dto : dtoList)
|
| | | commonOrderList.add(dto.getCommonOrder());
|
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否全是增加
|
| | | * |
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | private boolean isCommonOrderAllAdd(List<CommonOrderAddResultDTO> list) {
|
| | | if (list == null || list.size() == 0)
|
| | | return false;
|
| | | int addCount = 0;
|
| | | if (list != null)
|
| | | for (CommonOrderAddResultDTO dto : list) {
|
| | | if (dto.getType() == CommonOrderAddResultDTO.TYPE_ADD)
|
| | | addCount++;
|
| | | }
|
| | | if (addCount == list.size())
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public BigDecimal sumTodayApplyMoney(Long uid,String day) {
|
| | | return extractMapper.sumToadyApplyByUid(uid,day);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal sumVerifyingMoney(Long uid) {
|
| | | List<Integer> stateList=new ArrayList<>();
|
| | | stateList.add(Extract.STATE_NOT_PROCESS);
|
| | | stateList.add(Extract.STATE_PROCESSING);
|
| | | BigDecimal money= extractMapper.sumMoneyByUidAndState(uid, stateList);
|
| | | if(money==null)
|
| | | return new BigDecimal(0);
|
| | | else
|
| | | return money;
|
| | | }
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.order.CommonOrderAddResultDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | |
| | | * 到账状态
|
| | | * @return
|
| | | */
|
| | | public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException;
|
| | | public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
|
| | | throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 统计订单-根据红包类型 自购 邀请 分享
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime, Integer source);
|
| | | public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime,
|
| | | Integer source);
|
| | |
|
| | | /**
|
| | | * 统计订单
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime, Integer source);
|
| | | public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime,
|
| | | Integer source);
|
| | |
|
| | | /**
|
| | | * 统计奖金订单数量、金额
|
| | |
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrder> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrder, Long uid) throws CommonOrderException;
|
| | | public List<CommonOrderAddResultDTO> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrder, Long uid) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 缓存拼多多类普通订单
|
| | |
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException;
|
| | | public List<CommonOrderAddResultDTO> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 缓存京东普通订单
|
| | |
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException;
|
| | | public List<CommonOrderAddResultDTO> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 根据用户ID,订单状态,结算时间统计订单数量
|
| | |
| | | */
|
| | |
|
| | | public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state,
|
| | | Integer type, Integer orderState, String startTime, String endTime, Integer source) throws CommonOrderException;
|
| | | Integer type, Integer orderState, String startTime, String endTime, Integer source)
|
| | | throws CommonOrderException;
|
| | |
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime, Integer source) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 查询订单
|
| | | *
|
| | |
| | | Long maxTime, int page, int pageSize);
|
| | |
|
| | | /**
|
| | | * 查询订单 -根据订单号
|
| | | * 查询订单 -根据订单号
|
| | | * |
| | | * @param uid
|
| | | * @param orderNO
|
| | | * @return
|
| | | */
|
| | | public List<CommonOrder> getByOrderNo(Long uid, String orderNO);
|
| | |
|
| | | /**
|
| | | * 根据用户ID查询最近一条有效的订单
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public CommonOrder selectLatestValidByUid(Long uid);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | |
| | |
|
| | | /**
|
| | | * 处理拼多多订单
|
| | | * |
| | | * @param pddOrder
|
| | | */
|
| | | public void processPDDOrder(PDDOrder pddOrder);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 根据淘宝订单的排序值修复常规订单的排序值
|
| | | * |
| | | * @param orderId
|
| | | */
|
| | | public void repairCommonOrderByByTaoBaoOrder(String orderId);
|
| | |
|
| | | /**
|
| | | * 是否是分享赚订单
|
| | | * |
| | | * @param commonOrder
|
| | | * @return
|
| | | */
|
| | | public boolean isShareOrder(CommonOrder commonOrder);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public BigDecimal sumTodayApplyMoney(Long uid, String day);
|
| | | |
| | | /**
|
| | | * 统计正在审核中的金额
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumVerifyingMoney(Long uid);
|
| | | |
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.money.UserMoneyChangeDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayTransferResultInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.push.PushQueueRecord;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.jd.JDOrderService;
|
| | | import com.yeshi.fanli.service.inter.lable.BoutiqueAutoRuleService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.pdd.PDDOrderService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | |
| | | import com.yeshi.fanli.util.cmq.HongBaoRecieveCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.JDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.PDDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.PlaceOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.ThreeSaleCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.UserMoneyChangeCMQManager;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskRecordService integralTaskRecordService;
|
| | |
|
| | | private static boolean isInited = false;
|
| | |
|
| | | public void onApplicationEvent(ContextRefreshedEvent arg0) {
|
| | |
| | | doPDDOrderJob();// 拼多多订单处理
|
| | | doImportantTaoBaoGoodsUpdateJob();// 淘宝重要商品的信息更新
|
| | | doHongBaoRecieveIntegralGetJob();// 返利到账,金币增加
|
| | | doPlaceOrderIntegralJob();// 下单赠送金币任务
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | private boolean isFirstValidOrder(String orderId, int sourceType, Long uid) {
|
| | | CommonOrder commonOrder = commonOrderService.selectLatestValidByUid(uid);
|
| | | if (commonOrder != null && commonOrder.getOrderNo().equalsIgnoreCase(orderId)
|
| | | && sourceType == commonOrder.getSourceType())
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | // 下单获取金币任务
|
| | | public void doPlaceOrderIntegralJob() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | Map<String, Order> map = PlaceOrderCMQManager.getInstance()
|
| | | .consumeQueueMsg(PlaceOrderCMQManager.QUEUE_INTEGRAL, 16);
|
| | | if (map != null) {
|
| | | // 是否是首单
|
| | | for (Iterator<String> its = map.keySet().iterator(); its.hasNext();) {
|
| | | try {
|
| | | String key = its.next();
|
| | | Order order = map.get(key);
|
| | | // 统计订单下的用户所获得的返利金额
|
| | | List<CommonOrder> list = commonOrderService
|
| | | .listBySourceTypeAndOrderId(order.getOrderType(), order.getOrderId());
|
| | | Map<Long, BigDecimal> hongBaoMoney = new HashMap<>();
|
| | | if (list != null)
|
| | | for (CommonOrder commonOrder : list) {
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderService
|
| | | .selectDetailByCommonOrderId(commonOrder.getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null) {
|
| | | Long mainUid = hongBaoOrder.getHongBaoV2().getUserInfo().getId();
|
| | | if (hongBaoMoney.get(mainUid) == null)
|
| | | hongBaoMoney.put(mainUid, new BigDecimal(0));
|
| | | hongBaoMoney.put(mainUid, hongBaoMoney.get(mainUid)
|
| | | .add(hongBaoOrder.getHongBaoV2().getMoney()));
|
| | | // 查询上级
|
| | | List<HongBaoV2> children = hongBaoV2Service
|
| | | .listChildrenById(hongBaoOrder.getHongBaoV2().getId());
|
| | | if (children != null) {
|
| | | for (HongBaoV2 hongBao : children) {
|
| | | Long uid = hongBao.getUserInfo().getId();
|
| | | if (hongBaoMoney.get(uid) == null)
|
| | | hongBaoMoney.put(uid, new BigDecimal(0));
|
| | | hongBaoMoney.put(uid,
|
| | | hongBaoMoney.get(uid).add(hongBao.getMoney()));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (isFirstValidOrder(order.getOrderId(), order.getOrderType(),
|
| | | order.getUserInfo().getId())) {// 有效的首单
|
| | | if (hongBaoMoney.get(order.getUserInfo().getId()) == null || hongBaoMoney
|
| | | .get(order.getUserInfo().getId()).compareTo(new BigDecimal("0")) <= 0) {
|
| | | // 分享奖金是0
|
| | | integralTaskRecordService.firstShareOrderReward(order.getUserInfo().getId(),
|
| | | null);
|
| | | }
|
| | |
|
| | | // 获取上两级数据
|
| | | UserInfo boss = threeSaleSerivce.getBoss(order.getUserInfo().getId());
|
| | | if (boss != null) {// 判断上级的红包
|
| | | if (hongBaoMoney.get(boss.getId()) == null
|
| | | || hongBaoMoney.get(boss.getId()).compareTo(new BigDecimal("0")) <= 0) {
|
| | | // 补偿金币
|
| | | integralTaskRecordService.firstSharerOrderRewardBoss(boss.getId(),
|
| | | order.getUserInfo().getId(), null);
|
| | | }
|
| | | }
|
| | |
|
| | | } else {// 自购订单
|
| | | UserInfo boss = threeSaleSerivce.getBoss(order.getUserInfo().getId());
|
| | | if (boss != null) {// 判断上级的红包
|
| | | if (hongBaoMoney.get(boss.getId()) == null
|
| | | || hongBaoMoney.get(boss.getId()).compareTo(new BigDecimal("0")) <= 0) {
|
| | | // 补偿金币1级
|
| | | integralTaskRecordService.firstRebateOrderRewardBoss(boss.getId(),
|
| | | order.getUserInfo().getId(), null);
|
| | | }
|
| | | }
|
| | |
|
| | | boss = threeSaleSerivce.getBoss(boss.getId());
|
| | | if (boss != null) {// 判断上级的红包
|
| | | if (hongBaoMoney.get(boss.getId()) == null
|
| | | || hongBaoMoney.get(boss.getId()).compareTo(new BigDecimal("0")) <= 0) {
|
| | | // 补偿金币2级
|
| | | integralTaskRecordService.firstRebateOrderRewardBossSuper(boss.getId(),
|
| | | order.getUserInfo().getId(), null);
|
| | | }
|
| | | }
|
| | | }
|
| | | PlaceOrderCMQManager.getInstance().deleteQueueMsg(PlaceOrderCMQManager.QUEUE_INTEGRAL,
|
| | | key);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | // 抖音广告监控
|
| | | public void doPlaceOrderAdJob() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | Map<String, Order> map = PlaceOrderCMQManager.getInstance()
|
| | | .consumeQueueMsg(PlaceOrderCMQManager.QUEUE_AD, 16);
|
| | | if (map != null) {
|
| | | // 是否是首单
|
| | | for (Iterator<String> its = map.keySet().iterator(); its.hasNext();) {
|
| | | String key = its.next();
|
| | | Order order = map.get(key);
|
| | | if (isFirstValidOrder(order.getOrderId(), order.getOrderType(),
|
| | | order.getUserInfo().getId())) {// 有效的首单
|
| | | // TODO 抖音的数据回调
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.cmq;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.yeshi.utils.CMQUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.qcloud.cmq.Message;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | |
|
| | | public class PlaceOrderCMQManager {
|
| | |
|
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25";
|
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo";
|
| | | private static PlaceOrderCMQManager placeOrderCMQManager;
|
| | | private static CMQUtil cmqUtil;
|
| | |
|
| | | private final static String TOPIC_NAME = "topic_place_order";
|
| | |
|
| | | public static String QUEUE_AD = TOPIC_NAME + "_" + "ad";
|
| | | public static String QUEUE_INTEGRAL = TOPIC_NAME + "_" + "integral";
|
| | |
|
| | | public static String SUBSCRIBE_AD = "ad";
|
| | | public static String SUBSCRIBE_INTEGRAL = "integral";
|
| | |
|
| | | static {
|
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey);
|
| | | // 创建主题,添加订阅
|
| | | cmqUtil.createTopic(TOPIC_NAME);
|
| | | // 用户券订阅
|
| | | String[] subscripts = new String[] { SUBSCRIBE_AD, SUBSCRIBE_INTEGRAL };
|
| | | String[] queues = new String[] { QUEUE_AD, QUEUE_INTEGRAL };
|
| | |
|
| | | for (int i = 0; i < subscripts.length; i++) {
|
| | | String queueName = queues[i];
|
| | | try {
|
| | | cmqUtil.createQueue(queueName);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | try {
|
| | | cmqUtil.subscribeTopic(TOPIC_NAME, subscripts[i], queueName);
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public static PlaceOrderCMQManager getInstance() {
|
| | | if (placeOrderCMQManager == null)
|
| | | placeOrderCMQManager = new PlaceOrderCMQManager();
|
| | | return placeOrderCMQManager;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 下单
|
| | | * |
| | | * @param order(只需要订单号与sourceType)
|
| | | */
|
| | | public void addPlaceOrderMsg(Order order) {
|
| | | if (order == null)
|
| | | return;
|
| | | cmqUtil.publishTopicMessage(TOPIC_NAME, new Gson().toJson(order));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 消费队列消息
|
| | | * |
| | | * @param queueName
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public Map<String, Order> consumeQueueMsg(String queueName, int count) {
|
| | | List<Message> list = cmqUtil.recieveMsg(count, queueName);
|
| | | Map<String, Order> map = new HashMap<>();
|
| | |
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | Order dto = new Gson().fromJson(result, Order.class);
|
| | | map.put(msg.receiptHandle, dto);
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteQueueMsg(String queueName, String receiptHandle) {
|
| | | cmqUtil.deleteMsg(queueName, receiptHandle);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | goodsInfo.setMoneyInfo(moneyInfoVO);
|
| | |
|
| | | // 券信息
|
| | | if (goods.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
|
| | | if (goods.getCouponAmount()!=null&&goods.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
|
| | | // 计算券后价
|
| | | BigDecimal sub = goods.getPrice().subtract(goods.getCouponStartPrice());
|
| | | if (sub.compareTo(BigDecimal.valueOf(0)) >= 0) {
|
| | |
| | | private BigDecimal totalInviteMoney;// 累计邀请奖金
|
| | | private BigDecimal monthUnRecievedMoney;// 本月未到账
|
| | | private BigDecimal totalUnRecievedMoney; // 全部未到账
|
| | | private String extractingMoneyInfo;//提现中的资金信息
|
| | | private boolean bindingWX;//是否绑定了微信
|
| | | private boolean autoExtract;//是否自动提现
|
| | | private String autoExtractHelpUrl;//自动提现帮助链接
|
| | | |
| | |
|
| | | public String getAutoExtractHelpUrl() {
|
| | | return autoExtractHelpUrl;
|
| | | }
|
| | |
|
| | | public void setAutoExtractHelpUrl(String autoExtractHelpUrl) {
|
| | | this.autoExtractHelpUrl = autoExtractHelpUrl;
|
| | | }
|
| | |
|
| | | public String getExtractingMoneyInfo() {
|
| | | return extractingMoneyInfo;
|
| | | }
|
| | |
|
| | | public void setExtractingMoneyInfo(String extractingMoneyInfo) {
|
| | | this.extractingMoneyInfo = extractingMoneyInfo;
|
| | | }
|
| | |
|
| | | public boolean isBindingWX() {
|
| | | return bindingWX;
|
| | | }
|
| | |
|
| | | public void setBindingWX(boolean bindingWX) {
|
| | | this.bindingWX = bindingWX;
|
| | | }
|
| | |
|
| | | public boolean isAutoExtract() {
|
| | | return autoExtract;
|
| | | }
|
| | |
|
| | | public void setAutoExtract(boolean autoExtract) {
|
| | | this.autoExtract = autoExtract;
|
| | | }
|
| | |
|
| | | public BigDecimal getMonthUnRecievedMoney() {
|
| | | return monthUnRecievedMoney;
|