| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyExtraService userMoneyExtraService;
|
| | |
|
| | | |
| | | |
| | | @RequestMapping(value = "testimg")
|
| | | public void testImg(HttpServletRequest request, PrintWriter out) {
|
| | | long startTime = System.currentTimeMillis();
|
| | |
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
| | |
| | | }
|
| | | data.put("moduleState", mySettings);
|
| | |
|
| | | int tailor = 0;
|
| | | int welfareCenterNews = 0;
|
| | | String invitCode = null;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | |
| | | }
|
| | | // vip邀请码优先
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
|
| | | tailor = 1;
|
| | | invitCode = userInfoExtra.getInviteCodeVip();
|
| | | } else if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tailor = 2;
|
| | | invitCode = userInfoExtra.getInviteCode();
|
| | | }
|
| | |
|
| | |
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin()))
|
| | | userInfo.setWeiXin(userInfoExtra.getWeiXin());
|
| | | }
|
| | | |
| | | data.put("erCode", userInfoExtra.getErCode());
|
| | | }
|
| | | // 1.6.5 之后返回 微信号提示
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | |
| | | data.put("redPackLock", verifyForbid);
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(invitCode)) {
|
| | | // 2.0.6 返回邀请人
|
| | | if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | String bossName = "";
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null && threeSale.getBoss() != null) {
|
| | | bossName = threeSale.getBoss().getNickName();
|
| | | }
|
| | | data.put("bossName", bossName);
|
| | | |
| | | if(tailor == 2) {
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | if (firstTeam >= 2) {
|
| | | data.put("tailor", true);
|
| | | }
|
| | | } else {
|
| | | data.put("tailor", false);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | final UserInfo uuser = userInfo;
|
| | |
| | | */
|
| | | @RequestMapping(value = "saveInfo")
|
| | | public void saveInfo(AcceptData acceptData, String nickName, String weiXin, Integer sex, Long uid,
|
| | | String inviteCode, PrintWriter out) {
|
| | | String inviteCode, MultipartFile qrCodeFile, PrintWriter out) {
|
| | | try {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | // 二维码
|
| | | if (qrCodeFile != null) {
|
| | | userInfoExtraService.uploadERCode(qrCodeFile, uid);
|
| | | }
|
| | | |
| | | |
| | | |
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | */
|
| | | @RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
|
| | | public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
|
| | | JSONObject bossData = getBossInfo(acceptData, uid, threeSaleSerivce.getMyBoss(uid));
|
| | | JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
|
| | | JSONObject resultData = new JSONObject();
|
| | |
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 获取用户信息
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getBossInfo", method = RequestMethod.POST)
|
| | | public void getBossInfo(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
|
| | | out.print(JsonUtil.loadTrueResult(bossData));
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 上级信息组织
|
| | | *
|
| | | * @param acceptData
|
| | |
| | | * @param threeSale
|
| | | * @return
|
| | | */
|
| | | private JSONObject getBossInfo(AcceptData acceptData, long uid, ThreeSale threeSale) {
|
| | | private JSONObject getBossInfo(long uid, ThreeSale threeSale) {
|
| | | JSONObject bossData = new JSONObject();
|
| | | if (threeSale != null && threeSale.getBoss() != null) {
|
| | | UserInfo boss = threeSale.getBoss();
|
| | |
| | | out.print(JsonUtil.loadFalseResult("邀请信息获取失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.UserInviteUtil;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackDetailVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackGiveVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackWinInviteVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackWinProgressVO;
|
| | |
|
| | |
| | | data.put("extractMax", redPackConfigService.getValueByKey("extract_money_max"));
|
| | | data.put("extractBanlenMin", redPackConfigService.getValueByKey("extract_banlen_min"));
|
| | | data.put("extractDesc", "注:3个工作日内完成审核,红包提现成功后将会进入到余额。");
|
| | |
|
| | | data.put("giveTotal", redPackGiveRecordService.countGiveList(uid));
|
| | | data.put("useLink", redPackConfigService.getValueByKey("use_link"));
|
| | | data.put("winLink", redPackConfigService.getValueByKey("invite_win_redpack_link"));
|
| | |
|
| | | data.put("todayWin", todayWin.setScale(2).toString());
|
| | | data.put("yesterdayWin", yesterdayWin.setScale(2).toString());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @RequestMapping(value = "getGiveList", method = RequestMethod.POST)
|
| | | public void getGiveList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (page == null || page <= 0) |
| | | page = 1;
|
| | | |
| | | try {
|
| | | List<RedPackGiveVO> list = redPackGiveRecordService.getGiveList(page, Constant.PAGE_SIZE, uid);
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | Gson gson = gsonBuilder.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy.MM.dd HH:mm").create();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", gson.toJson(list));
|
| | | data.put("count", redPackGiveRecordService.countGiveList(uid));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 转换红包为真实金钱
|
| | | *
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.order.ESOrder;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.ESOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.OrderCountVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserCustomSettingsService userCustomSettingsService;
|
| | | |
| | | @Resource
|
| | | private ESOrderService esOrderService;
|
| | |
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 订单列表
|
| | | *
|
| | |
| | | Integer dateType, Integer goodsType, String source, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (page == null || page < 1)
|
| | | page = 1;
|
| | | |
| | | // 搜索内容、订单号
|
| | | if (!StringUtil.isNullOrEmpty(orderNo) && VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | searchOrder(orderNo, page, uid, out);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 搜索订单
|
| | | * @param key
|
| | | * @param out
|
| | | */
|
| | | private void searchOrder(String key, Integer page, Long uid, PrintWriter out) {
|
| | | try {
|
| | | long count = 0;
|
| | | List<CommonOrderVO> list = null;
|
| | | List<ESOrder> listES = esOrderService.multiMatchQuery(key, uid.toString());
|
| | | if (listES.size() != 0) {
|
| | | list = commonOrderService.searchOrderByUid(page, Constant.PAGE_SIZE, uid, listES);
|
| | | count = commonOrderService.countSearchOrderByUid(uid, listES);
|
| | | }
|
| | | if (list == null) {
|
| | | list = new ArrayList<>();
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("result_list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询失败"));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | @Param("start") long start, @Param("count") int count);
|
| | |
|
| | | /**
|
| | | * 统计总金币
|
| | | * @param uid
|
| | | * @return
|
| | | * 更新金币失效
|
| | | */
|
| | | long getTotalGoldCoinByUid(@Param("uid") Long uid);
|
| | | void invalidGoldCoin();
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.ESOrder;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.OrderCountVO;
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | long count24HValidOrderByUid(@Param("uid") Long uid, @Param("minTime") Date minTime);
|
| | | |
| | | |
| | | /**
|
| | | * 搜索订单
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | List<CommonOrderVO> searchOrderByUid(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
|
| | | @Param("list")List<ESOrder> list);
|
| | |
|
| | | |
| | | /**
|
| | | * 搜索订单
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | long countSearchOrderByUid(@Param("uid") Long uid, @Param("list")List<ESOrder> list);
|
| | |
|
| | | } |
| | |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.redpack.RedPackGiveRecord; |
| | | import com.yeshi.fanli.vo.redpack.RedPackGiveVO; |
| | | |
| | | public interface RedPackGiveRecordMapper extends BaseMapper<RedPackGiveRecord> { |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<RedPackGiveRecord> overdueList(@Param("count") int count); |
| | | |
| | | |
| | | /** |
| | | * 查询用户赠送记录 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<RedPackGiveVO> getGiveList(@Param("start") long start, @Param("count") int count, @Param("uid") long uid); |
| | | |
| | | |
| | | long countGiveList(@Param("uid") long uid); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 查询该类型生成口令 |
| | | * @param identify |
| | | * @param type |
| | | * @return |
| | | */ |
| | | TokenRecord getByTypeAndIdentify(@Param("type")String type, @Param("identify")String identify); |
| | | |
| | | |
| | | /** |
| | | * 口令失效 |
| | | * @param token |
| | | * @return |
| | |
| | | @Column(name = "uie_active_time")
|
| | | private Date activeTime;
|
| | |
|
| | | // 二维码
|
| | | @Column(name = "uie_ercode")
|
| | | private String erCode;
|
| | | |
| | | // 创建时间
|
| | | @Column(name = "uie_create_time")
|
| | | private Date createTime;
|
| | |
| | | this.inviteCodeVip = inviteCodeVip;
|
| | | }
|
| | |
|
| | | public String getErCode() {
|
| | | return erCode;
|
| | | }
|
| | |
|
| | | public void setErCode(String erCode) {
|
| | | this.erCode = erCode;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Column(name = "ir_update_time")
|
| | | private Date updateTime;
|
| | | |
| | | @Column(name = "ir_end_time")
|
| | | private Date endTime; // 失效时间
|
| | | |
| | |
|
| | | @Expose
|
| | | private String taskName; // 任务名称
|
| | |
| | | public void setTaskId(Long taskId) {
|
| | | this.taskId = taskId;
|
| | | }
|
| | |
|
| | | public Date getEndTime() {
|
| | | return endTime;
|
| | | }
|
| | |
|
| | | public void setEndTime(Date endTime) {
|
| | | this.endTime = endTime;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | /**
|
| | | * 红包赠送记录
|
| | | *
|
| | |
| | | @Column(name = "rpgr_give_uid")
|
| | | private Long giveUid;
|
| | | // 赠送时间
|
| | | @Expose
|
| | | @Column(name = "rpgr_give_time")
|
| | | private Date giveTime;
|
| | | // 赠送结束时间
|
| | | @Column(name = "rpgr_end_time")
|
| | | private Date endTime;
|
| | | // 领取uid
|
| | | @Expose
|
| | | @Column(name = "rpgr_receive_uid")
|
| | | private Long receiveUid;
|
| | | // 领取时间
|
| | | @Expose
|
| | | @Column(name = "rpgr_receive_time")
|
| | | private Date receiveTime;
|
| | | // 状态:0初始 1已领取 2已退回
|
| | | @Expose
|
| | | @Column(name = "rpgr_state")
|
| | | private Integer state;
|
| | |
|
| | |
| | | <result column="ir_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="ir_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ir_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ir_end_time" property="endTime" jdbcType="TIMESTAMP"/>
|
| | | |
| | | <result column="taskName" property="taskName" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ir_id,ir_cid,ir_task_id,ir_uid,ir_gold_coin,ir_state,ir_create_time,ir_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_integral_task_record where ir_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_integral_task_record where ir_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_integral_task_record |
| | | (ir_id,ir_cid,ir_task_id,ir_uid,ir_gold_coin,ir_state,ir_create_time,ir_update_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{cid,jdbcType=BIGINT},#{taskId,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{goldCoin,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_integral_task_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ir_id,</if> |
| | | <if test="cid != null">ir_cid,</if> |
| | | <if test="taskId != null">ir_task_id,</if> |
| | | <if test="uid != null">ir_uid,</if> |
| | | <if test="goldCoin != null">ir_gold_coin,</if> |
| | | <if test="state != null">ir_state,</if> |
| | | <if test="createTime != null">ir_create_time,</if> |
| | | <if test="updateTime != null">ir_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="cid != null">#{cid,jdbcType=BIGINT},</if> |
| | | <if test="taskId != null">#{taskId,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="state != null">#{state,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.integral.IntegralTaskRecord">update |
| | | yeshi_ec_integral_task_record set ir_cid = |
| | | #{cid,jdbcType=BIGINT},ir_task_id = #{taskId,jdbcType=BIGINT},ir_uid = |
| | | #{uid,jdbcType=BIGINT},ir_gold_coin = |
| | | #{goldCoin,jdbcType=INTEGER},ir_state = |
| | | #{state,jdbcType=INTEGER},ir_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},ir_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where ir_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord"> |
| | | update yeshi_ec_integral_task_record |
| | | <set> |
| | | <if test="cid != null">ir_cid=#{cid,jdbcType=BIGINT},</if> |
| | | <if test="taskId != null">ir_task_id=#{taskId,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">ir_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goldCoin != null">ir_gold_coin=#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="state != null">ir_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">ir_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ir_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where ir_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <sql id="Base_Column_List">ir_id,ir_cid,ir_task_id,ir_uid,ir_gold_coin,ir_state,ir_create_time,ir_update_time,ir_end_time</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_integral_task_record where ir_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_integral_task_record where ir_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_record (ir_id,ir_cid,ir_task_id,ir_uid,ir_gold_coin,ir_state,ir_create_time,ir_update_time,ir_end_time) values (#{id,jdbcType=BIGINT},#{cid,jdbcType=BIGINT},#{taskId,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{goldCoin,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_record
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">ir_id,</if>
|
| | | <if test="cid != null">ir_cid,</if>
|
| | | <if test="taskId != null">ir_task_id,</if>
|
| | | <if test="uid != null">ir_uid,</if>
|
| | | <if test="goldCoin != null">ir_gold_coin,</if>
|
| | | <if test="state != null">ir_state,</if>
|
| | | <if test="createTime != null">ir_create_time,</if>
|
| | | <if test="updateTime != null">ir_update_time,</if>
|
| | | <if test="endTime != null">ir_end_time,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="cid != null">#{cid,jdbcType=BIGINT},</if>
|
| | | <if test="taskId != null">#{taskId,jdbcType=BIGINT},</if>
|
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord">update yeshi_ec_integral_task_record set ir_cid = #{cid,jdbcType=BIGINT},ir_task_id = #{taskId,jdbcType=BIGINT},ir_uid = #{uid,jdbcType=BIGINT},ir_gold_coin = #{goldCoin,jdbcType=INTEGER},ir_state = #{state,jdbcType=INTEGER},ir_create_time = #{createTime,jdbcType=TIMESTAMP},ir_update_time = #{updateTime,jdbcType=TIMESTAMP},ir_end_time = #{endTime,jdbcType=TIMESTAMP} where ir_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord">update yeshi_ec_integral_task_record
|
| | | <set>
|
| | | <if test="cid != null">ir_cid=#{cid,jdbcType=BIGINT},</if>
|
| | | <if test="taskId != null">ir_task_id=#{taskId,jdbcType=BIGINT},</if>
|
| | | <if test="uid != null">ir_uid=#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="goldCoin != null">ir_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="state != null">ir_state=#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">ir_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">ir_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="endTime != null">ir_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where ir_id = #{id,jdbcType=BIGINT}
|
| | | </update> |
| | | |
| | | |
| | | <update id="updateReceived" parameterType="Long"> |
| | |
| | | yeshi_ec_integral_task_record SET ir_state = 1,ir_update_time = NOW() |
| | | WHERE ir_state = 0 AND ir_uid = #{uid} |
| | | </update> |
| | | |
| | | <update id="invalidGoldCoin">
|
| | | UPDATE yeshi_ec_integral_task_record SET ir_state = 2 |
| | | WHERE ir_end_time <![CDATA[<]]> NOW() AND ir_state = 0
|
| | | </update> |
| | | |
| | | <select id="listNotReceived" resultMap="BaseResultMap"> |
| | | SELECT tc.`tc_name` AS |
| | |
| | | <if test="maxTime!=null">
|
| | | and #{maxTime}>ir_create_time
|
| | | </if>
|
| | | </select>
|
| | | |
| | | <select id="getTotalGoldCoinByUid" resultType="Long">
|
| | | select IFNULL(SUM(ir_gold_coin),0) from yeshi_ec_integral_task_record |
| | | where ir_uid=#{uid}
|
| | | </select>
|
| | |
|
| | | </mapper> |
| | |
| | | DATE_SUB(NOW(), INTERVAL 1 DAY) GROUP BY |
| | | co.`co_order_no`,co.`co_source_type`)A |
| | | </select> |
| | | |
| | | <select id="searchOrderByUid" resultMap="ResultMap"> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, hb.hb_state AS hongBaoState, hb.`hb_type` AS hongBaoType, |
| | | MAX(hb.`hb_get_time`) AS accountTime, MAX(hb.`hb_pre_get_time`) AS preAccountTime, <include refid="Order_Column_List" /> |
| | | FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT <include refid="Hongbao_Column_List" /> 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 |
| | | <foreach collection="list" item="esOrder" open=" and (" close=")" separator=" or "> |
| | | (co.co_trade_id=#{esOrder.tradeId} AND co.co_source_type = #{esOrder.platform}) |
| | | </foreach> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` |
| | | ORDER BY co.co_third_create_time DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countSearchOrderByUid" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN (SELECT <include refid="Hongbao_Column_List" /> |
| | | 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 |
| | | <foreach collection="list" item="esOrder" open=" and (" close=")" separator=" or "> |
| | | (co.co_trade_id=#{esOrder.tradeId} AND co.co_source_type = #{esOrder.platform}) |
| | | </foreach> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="rpgr_receive_time" property="receiveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="rpgr_state" property="state" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="VOResultMap" type="com.yeshi.fanli.vo.redpack.RedPackGiveVO"> |
| | | <id column="rpgr_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="rpgr_money" property="amount" jdbcType="DECIMAL"/> |
| | | <result column="rpgr_give_uid" property="giveUid" jdbcType="BIGINT"/> |
| | | <result column="rpgr_give_time" property="giveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="rpgr_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="rpgr_receive_uid" property="receiveUid" jdbcType="BIGINT"/> |
| | | <result column="rpgr_receive_time" property="receiveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="rpgr_state" property="state" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">rpgr_id,rpgr_money,rpgr_give_uid,rpgr_give_time,rpgr_end_time,rpgr_receive_uid,rpgr_receive_time,rpgr_state</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_red_pack_give_record where rpgr_id = #{id,jdbcType=BIGINT} |
| | |
| | | LIMIT #{count} |
| | | </select> |
| | | |
| | | <select id="getGiveList" resultMap="VOResultMap"> |
| | | SELECT * FROM yeshi_ec_red_pack_give_record |
| | | WHERE rpgr_give_uid = #{uid} |
| | | ORDER BY rpgr_id DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countGiveList" resultType="Long"> |
| | | SELECT IFNULL(COUNT(rpgr_id),0) FROM yeshi_ec_red_pack_give_record |
| | | WHERE rpgr_give_uid = #{uid} |
| | | </select> |
| | | </mapper> |
| | |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getByTypeAndIdentify" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_token_record |
| | | WHERE tr_identify = #{identify} AND tr_type = #{type} |
| | | ORDER BY tr_create_time DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="overdueList" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_token_record |
| | | WHERE tr_state = 0 AND tr_end_time IS NOT NULL AND tr_end_time <![CDATA[<]]> NOW() |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER" /> |
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" /> |
| | | <result column="uie_ercode" property="erCode" jdbcType="VARCHAR" /> |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" /> |
| | | <result column="uie_auto_extract" property="autoExtract" |
| | | jdbcType="BOOLEAN" /> |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER" /> |
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" /> |
| | | <result column="uie_ercode" property="erCode" jdbcType="VARCHAR" /> |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" /> |
| | | <result column="uie_auto_extract" property="autoExtract" |
| | | jdbcType="BOOLEAN" /> |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER" /> |
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" /> |
| | | <result column="uie_ercode" property="erCode" jdbcType="VARCHAR" /> |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" /> |
| | | <result column="uie_auto_extract" property="autoExtract" |
| | | jdbcType="BOOLEAN" /> |
| | |
| | | <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,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip |
| | | <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,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <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,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip) |
| | | (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,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode) |
| | | 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},#{closeTimeExtract,jdbcType=TIMESTAMP},#{activeTime,jdbcType=TIMESTAMP},#{mark,jdbcType=VARCHAR},#{inviteCodeVip,jdbcType=VARCHAR}) |
| | | (#{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},#{closeTimeExtract,jdbcType=TIMESTAMP},#{activeTime,jdbcType=TIMESTAMP},#{mark,jdbcType=VARCHAR},#{inviteCodeVip,jdbcType=VARCHAR},#{erCode,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <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="erCode != null">uie_ercode,</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="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sex != null">#{sex,jdbcType=INTEGER},</if> |
| | | <if test="weiXin != null">#{weiXin,jdbcType=VARCHAR},</if> |
| | | <if test="erCode != null">#{erCode,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> |
| | |
| | | #{synchNavbar,jdbcType=VARCHAR},uie_first_login_time = |
| | | #{firstLoginTime,jdbcType=TIMESTAMP},uie_sex = |
| | | #{sex,jdbcType=INTEGER},uie_weixin = |
| | | #{weiXin,jdbcType=VARCHAR},uie_gold_coin = |
| | | #{weiXin,jdbcType=VARCHAR},uie_ercode = |
| | | #{erCode,jdbcType=VARCHAR},uie_gold_coin = |
| | | #{goldCoin,jdbcType=INTEGER},uie_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},uie_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP},uie_auto_extract = |
| | |
| | | </if> |
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if> |
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if> |
| | | <if test="erCode != null">uie_ercode=#{erCode,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> |
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if> |
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if> |
| | | <if test="erCode != null">uie_ercode=#{erCode,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> |
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
|
| | | import com.yeshi.fanli.entity.order.ESOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | |
| | | public long count24HValidOrderByUid(Long uid, Date minTime) {
|
| | | return commonOrderMapper.count24HValidOrderByUid(uid, minTime);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public long countSearchOrderByUid(Long uid, List<ESOrder> list) {
|
| | | return commonOrderMapper.countSearchOrderByUid(uid, list);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<CommonOrderVO> searchOrderByUid (int page, int size, Long uid, List<ESOrder> list) throws Exception {
|
| | | List<CommonOrderVO> listVO = commonOrderMapper.searchOrderByUid((page-1) * size, size, uid, list);
|
| | |
|
| | | // 订单信息为空
|
| | | if (listVO == null || listVO.size() == 0) {
|
| | | listVO = new ArrayList<CommonOrderVO>();
|
| | | return listVO;
|
| | | }
|
| | |
|
| | | // 商品信息
|
| | | List<CommonOrderVO> listGoods = commonOrderMapper.listOrderGoodsInfo(listVO);
|
| | | // 订单商品为空
|
| | | if (listGoods == null || listGoods.size() == 0) {
|
| | | return listVO;
|
| | | }
|
| | |
|
| | | // 数据加工重新组织
|
| | | orderVOFactoryNew(listVO, listGoods, uid);
|
| | | |
| | | return listVO;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 订单信息加工
|
| | | * |
| | | * @param acceptData
|
| | | * @param listOrder
|
| | | * @param listGoods
|
| | | * @param uid
|
| | | */
|
| | | private void orderVOFactoryNew(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) throws Exception {
|
| | | List<String> listTB = new ArrayList<String>();
|
| | | List<String> listJD = new ArrayList<String>();
|
| | | List<String> listPDD = new ArrayList<String>();
|
| | | for (CommonOrderVO commonOrderVO : listOrder) {
|
| | | Integer sourceType = commonOrderVO.getSourceType();
|
| | | if (sourceType == null) {
|
| | | continue;
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | listTB.add(commonOrderVO.getOrderNo());
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) {
|
| | | listJD.add(commonOrderVO.getOrderNo());
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
|
| | | listPDD.add(commonOrderVO.getOrderNo());
|
| | | }
|
| | | }
|
| | |
|
| | | List<UserSystemCouponRecord> listRecordTB = null;
|
| | | if (listTB.size() > 0) {
|
| | | listRecordTB = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_TAOBAO, listTB);
|
| | | }
|
| | |
|
| | | List<UserSystemCouponRecord> listRecordJD = null;
|
| | | if (listJD.size() > 0) {
|
| | | listRecordJD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_JD, listJD);
|
| | | }
|
| | |
|
| | | List<UserSystemCouponRecord> listRecordPDD = null;
|
| | | if (listPDD.size() > 0) {
|
| | | listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD);
|
| | | }
|
| | |
|
| | | // 需要查询是否为VIP的用户ID,只有邀请订单才需要查询
|
| | | List<Long> needSelectVIPUidList = new ArrayList<>();
|
| | |
|
| | | for (CommonOrderVO order : listOrder) {
|
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI
|
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI
|
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI)
|
| | | needSelectVIPUidList.add(Long.parseLong(order.getUserId()));
|
| | | }
|
| | | Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList);
|
| | |
|
| | | // 设置是否为vip订单
|
| | | for (CommonOrderVO order : listOrder) {
|
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI
|
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI
|
| | | || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) {
|
| | | if (vipUserMap.get(Long.parseLong(order.getUserId())) != null
|
| | | && vipUserMap.get(Long.parseLong(order.getUserId())) == true)
|
| | | order.setVipOrder(true);
|
| | | else
|
| | | order.setVipOrder(false);
|
| | | } else
|
| | | order.setVipOrder(false);
|
| | |
|
| | | if (order.isVipOrder())
|
| | | order.setVipOrderDesc("订单来源:由超级会员的粉丝产生");
|
| | | }
|
| | |
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd");
|
| | | // 2019.8.1开始返回维权信息
|
| | | Date august = TimeUtil.parse("2019-08-01");
|
| | |
|
| | | // 当前用户是否VIP
|
| | | boolean vip = userVIPInfoService.isVIP(uid);
|
| | | // 是否存在奖励券
|
| | | boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid);
|
| | |
|
| | | for (CommonOrderVO order : listOrder) {
|
| | | String orderNo = order.getOrderNo();
|
| | | Integer sourceType = order.getSourceType();
|
| | |
|
| | | // 商品信息组合
|
| | | for (CommonOrderVO commonOrder : listGoods) {
|
| | | CommonOrderGoods goods = commonOrder.getCommonOrderGoods();
|
| | | if (goods == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (sourceType.equals(commonOrder.getSourceType()) && orderNo.equals(commonOrder.getOrderNo())) {
|
| | | CommonOrderGoodsVO commonGoodsVO = new CommonOrderGoodsVO();
|
| | | PropertyUtils.copyProperties(commonGoodsVO, goods);
|
| | | commonGoodsVO.setGoodsType(sourceType);
|
| | |
|
| | | // 淘宝商品图片处理
|
| | | String picture = commonGoodsVO.getPicture();
|
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO && !StringUtil.isNullOrEmpty(picture)
|
| | | && !picture.contains("320x320")) {
|
| | | commonGoodsVO.setPicture(TbImgUtil.getTBSize320Img(picture));
|
| | | }
|
| | |
|
| | | // 购买数量
|
| | | commonGoodsVO.setActualCount(commonOrder.getTotalCount() + "件");
|
| | |
|
| | | // 实付款
|
| | | BigDecimal totalSettlement = commonOrder.getTotalSettlement();
|
| | | if (totalSettlement == null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) {
|
| | | totalSettlement = commonOrder.getTotalPayment();
|
| | | }
|
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement);
|
| | |
|
| | | Integer hongBaoType = order.getHongBaoType();
|
| | | // 邀请订单信息保护
|
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | Map<String, String> titleMap = new HashMap<String, String>();
|
| | | titleMap.put("content", "为保障用户隐私,商品信息已隐藏!");
|
| | | titleMap.put("fontColor", "#888888");
|
| | | titleMap.put("bottomColor", "#E9E9E9");
|
| | | commonGoodsVO.setTitle(null);
|
| | | commonGoodsVO.setGoodsTitle(titleMap);
|
| | | }
|
| | |
|
| | | // 订单类型为空时 已商品类为准
|
| | | Integer orderType = order.getOrderType();
|
| | | if (orderType == null) {
|
| | | String shopType = commonGoodsVO.getShopType();
|
| | | if (CommonOrderGoodsVO.TYPE_TAOBAO.equalsIgnoreCase(shopType)) {
|
| | | order.setOrderType(1);
|
| | | } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) {
|
| | | order.setOrderType(2);
|
| | | }
|
| | | }
|
| | |
|
| | | order.getListOrderGoods().add(commonGoodsVO);
|
| | | }
|
| | | }
|
| | |
|
| | | Date thirdCreateTime = order.getThirdCreateTime();
|
| | | if (thirdCreateTime != null) {
|
| | | order.setDownTime("下单时间:" + format.format(thirdCreateTime));
|
| | | order.setObtainTime(thirdCreateTime.getTime());
|
| | | }
|
| | |
|
| | | Date settleTime = order.getSettleTime();
|
| | | if (settleTime != null) {
|
| | | order.setReceiveTime("收货时间:" + format.format(settleTime));
|
| | | }
|
| | |
|
| | | // 订单类型
|
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | Integer orderType = order.getOrderType();
|
| | | if (orderType == null)
|
| | | order.setOrderType(1);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) {
|
| | | order.setOrderType(3);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
|
| | | order.setOrderType(4);
|
| | | }
|
| | |
|
| | | /* 订单状态 转换处理 */
|
| | | String orderStateContent = "";
|
| | | Map<String, String> orderStateMap = new HashMap<String, String>();
|
| | | // 订单状态
|
| | | Integer orderState = order.getState();
|
| | | // 红包状态
|
| | | Integer hongBaoState = order.getHongBaoState();
|
| | |
|
| | | Integer stateWholeOrder = order.getStateWholeOrder();
|
| | | if (CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO == stateWholeOrder) {
|
| | | // 整个订单部分失效:判断真实状态 订单、红包
|
| | | CommonOrderVO buFenOrder = commonOrderMapper.getBuFenOrderState(uid, order.getOrderNo());
|
| | | if (buFenOrder != null) {
|
| | | // 有效的订单状态
|
| | | orderState = buFenOrder.getState();
|
| | | // 有效的红包状态
|
| | | hongBaoState = buFenOrder.getHongBaoState();
|
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal hongBao = order.getHongBao();
|
| | | if (hongBao == null) {
|
| | | hongBao = new BigDecimal(0);
|
| | | }
|
| | |
|
| | | if (CommonOrder.STATE_FK == orderState) {
|
| | | orderStateContent = "已付款";
|
| | | } else if (CommonOrder.STATE_JS == orderState) {
|
| | | orderStateContent = "已收货";
|
| | | } else if (CommonOrder.STATE_SX == orderState) {
|
| | | orderStateContent = "未付款/已退款";
|
| | | } else if (CommonOrder.STATE_WQ == orderState) {
|
| | | orderStateContent = "已售后";
|
| | | if (sourceType != null && sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | /* 订单维权 判断是否全部维权 */
|
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(order.getOrderNo(), "维权成功");
|
| | |
|
| | | boolean isPart = false;// 默认失效
|
| | | BigDecimal weiQuanMoney = getWeiQuanMoney(listWQ, sourceType, uid);
|
| | | if (settleTime != null && august != null && settleTime.getTime() > august.getTime()) {
|
| | | orderStateContent = "售后成功";
|
| | | WeiQuanInfo weiQuanInfo = new WeiQuanInfo();
|
| | | weiQuanInfo.setOldHongBao("¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | weiQuanInfo
|
| | | .setWqHongBao("售后:-¥" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney);
|
| | | order.setWeiQuanInfo(weiQuanInfo);
|
| | | }
|
| | | }
|
| | | }
|
| | | orderStateMap.put("content", orderStateContent);
|
| | | orderStateMap.put("fontColor", "#666666");
|
| | | order.setOrderState(orderStateMap);
|
| | |
|
| | | String hongbaoInfo = "";
|
| | | // 订单标识
|
| | | List<String> signList = new ArrayList<String>();
|
| | | /* 订单返利类型 转换 */
|
| | | Integer hongBaoType = order.getHongBaoType();
|
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) {
|
| | | // 自购
|
| | | hongbaoInfo = "返利";
|
| | | order.setOrderOrigin("1");
|
| | | order.setHongBaoTypePic(CommonOrder.TYPE_FANLI);
|
| | | signList.add(CommonOrder.TYPE_FANLI);
|
| | | } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) {
|
| | | // 分享
|
| | | hongbaoInfo = "奖金";
|
| | | order.setOrderOrigin("2");
|
| | | order.setHongBaoTypePic(CommonOrder.TYPE_SHARE);
|
| | | signList.add(CommonOrder.TYPE_SHARE);
|
| | |
|
| | | } else if (HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | // 下级的分享订单: 显示邀请
|
| | | hongbaoInfo = "奖金";
|
| | | order.setOrderOrigin("3");
|
| | | order.setHongBaoTypePic(CommonOrder.TYPE_INVITE);
|
| | | signList.add(CommonOrder.TYPE_INVITE);
|
| | |
|
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType) {
|
| | | // 邀请订单
|
| | | hongbaoInfo = "奖金";
|
| | | order.setOrderOrigin("3");
|
| | | order.setHongBaoTypePic(CommonOrder.TYPE_INVITE);
|
| | | signList.add(CommonOrder.TYPE_INVITE);
|
| | |
|
| | | // 超级会员补贴信息
|
| | | InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid,
|
| | | order.getOrderNo(), sourceType);
|
| | | if (orderSubsidy != null) {
|
| | | ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
|
| | | subsidyInfo.setContent("(补贴¥" + orderSubsidy.getMoney() + ")");
|
| | | if (orderSubsidy.getState() == InviteOrderSubsidy.STATE_SUBSIDIZED) {
|
| | | subsidyInfo.setColor("#E5005C");
|
| | | } else {
|
| | | subsidyInfo.setColor("#888888");
|
| | | }
|
| | | order.setSubsidy(subsidyInfo);
|
| | |
|
| | | // 解释信息(问号)
|
| | | List<String> subsidyList = new ArrayList<String>();
|
| | | subsidyList.add("额外补贴能否获得由系统算法自动判断,人为无法干涉;");
|
| | | subsidyList.add("额外补贴到账时间以及金额请以实际到账为准;");
|
| | | subsidyList.add("额外补贴产生后将会在消息-资金消息中提醒你。");
|
| | | order.setSubsidyList(subsidyList);
|
| | | }
|
| | | }
|
| | | order.setSignList(signList);
|
| | |
|
| | | String hongBaoDate = null;
|
| | | String hongBaoState_Str = "";
|
| | | String hongbaoInfoFontColor = "#E5005C";
|
| | |
|
| | | /* 红包状态 转换 */
|
| | | String stateContent = "";
|
| | | String stateFontColor = "#E5005C";
|
| | | Integer orderHongBaoState = null;
|
| | |
|
| | | if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) {
|
| | | orderHongBaoState = 1;
|
| | | stateContent = "未到账";
|
| | | hongBaoState_Str = "预估";
|
| | |
|
| | | Date preAccountTime = order.getPreAccountTime();
|
| | | if (preAccountTime != null) {
|
| | | hongBaoDate = "预计到账时间:" + formatday.format(preAccountTime);
|
| | | }
|
| | |
|
| | | } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | orderHongBaoState = 3;
|
| | | stateContent = "已到账";
|
| | |
|
| | | Date accountTime = order.getAccountTime();
|
| | | if (accountTime != null) {
|
| | | hongBaoDate = "到账时间:" + formatday.format(accountTime);
|
| | | }
|
| | |
|
| | | } else if (HongBaoV2.STATE_BUFENSHIXIAO == hongBaoState) {
|
| | | stateContent = "部分失效";
|
| | | orderHongBaoState = 3;
|
| | | Date accountTime = order.getAccountTime();
|
| | | if (accountTime != null) {
|
| | | hongBaoDate = "到账时间:" + formatday.format(accountTime);
|
| | | }
|
| | |
|
| | | } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) {
|
| | | orderHongBaoState = 4;
|
| | | stateContent = "已失效";
|
| | | hongbaoInfoFontColor = "#888888";
|
| | | }
|
| | | order.setHongBaoState(orderHongBaoState);
|
| | | order.setHongBaoDate(hongBaoDate);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(order.getStateDesc())) {
|
| | | stateContent = stateContent + "-" + order.getStateDesc();
|
| | | }
|
| | |
|
| | | Map<String, String> stateMap = new HashMap<String, String>();
|
| | | stateMap.put("content", stateContent);
|
| | | stateMap.put("fontColor", stateFontColor);
|
| | | order.setAccountState(stateMap);
|
| | |
|
| | | hongbaoInfo = hongBaoState_Str + hongbaoInfo;
|
| | |
|
| | | Map<String, String> hongBaoMap = new HashMap<String, String>();
|
| | | hongBaoMap.put("content", hongbaoInfo + " ¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | hongBaoMap.put("fontColor", hongbaoInfoFontColor);
|
| | | order.setHongBaoInfo(hongBaoMap);
|
| | |
|
| | | // 显示返利、免单详情
|
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType) {
|
| | | // 奖励订单、免单 使用记录
|
| | | if (sourceType == null) {
|
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, null, uid, vip);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, uid, vip);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) {
|
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, uid, vip);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
|
| | | couponFactoryNew(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, uid, vip);
|
| | | }
|
| | | }
|
| | |
|
| | | // 分享、邀请 隐藏订单号
|
| | | if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType || HongBaoV2.TYPE_YAOQING == hongBaoType
|
| | | || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 订单: 免单标识 奖励标识
|
| | | * |
| | | * @param order
|
| | | * @param hasRewardCoupon
|
| | | * @param hongBaoState
|
| | | * @param list
|
| | | * @param signList
|
| | | */
|
| | | private void couponFactoryNew(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState, Integer hongBaoType,
|
| | | List<UserSystemCouponRecord> list, Long uid, boolean vip) throws Exception {
|
| | | // 是否免单商品
|
| | | boolean freeOrder = false;
|
| | | // 是否奖励成功
|
| | | boolean rewardSuccess = false;
|
| | | if (list != null && list.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : list) {
|
| | | int goodSource = couponRecord.getGoodSource();
|
| | | if (goodSource == 0)
|
| | | goodSource = 1;
|
| | |
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo()) && goodSource == order.getSourceType()) {
|
| | | Integer state = couponRecord.getState();
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType)
|
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | rewardSuccess = true;
|
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
|
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)
|
| | | || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) {
|
| | |
|
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) {
|
| | | // 免单中
|
| | | freeOrder = true;
|
| | | order.getSignList().add(PIC_FREE_ON);
|
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | // 免单成功
|
| | | freeOrder = true;
|
| | | order.getSignList().add(PIC_FREE_SUCCEED);
|
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state
|
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) {
|
| | | // 规则不匹配、退款
|
| | | freeOrder = true;
|
| | | order.getSignList().add(PIC_FREE_FAIL);
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 免单详情
|
| | | if (freeOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | rewardStyleVO.setContent("免单详情 >");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | jumpLink.put("goodsType", order.getSourceType() + "");
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 1); // 页面跳转
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | |
|
| | | // 已使用奖励券
|
| | | if (rewardSuccess) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | | rewardStyleVO.setContent("已使用奖励券 >");
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | jumpLink.put("goodsType", order.getSourceType() + "");
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 1); // 1 常规跳转页面
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | | rewardMap.put("jump", jump);
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | |
|
| | | // 是否可使用奖励券
|
| | | if (!rewardSuccess && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType
|
| | | && HongBaoV2.STATE_YILINGQU == hongBaoState && !vip && CommonOrder.STATE_WQ != order.getState()) {
|
| | | // 下单时间
|
| | | Date thirdCreateTime = order.getThirdCreateTime();
|
| | | // 到账时间
|
| | | Date accountTime = order.getAccountTime();
|
| | | if (thirdCreateTime == null || accountTime == null)
|
| | | return;
|
| | |
|
| | | // 下单日期是否是符合上线日期
|
| | | long downOrderTime = thirdCreateTime.getTime();
|
| | | long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
|
| | | if (downOrderTime > limitDate) {
|
| | | // 2.1 开始新版
|
| | | rewardCounponLimitTime(order, accountTime);
|
| | | } else if (hasRewardCoupon) {
|
| | | // 在2.1新版上线之前订单-存在则显示奖励券可使用
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | | rewardStyleVO.setContent("使用奖励券");
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | jumpLink.put("goodsType", order.getSourceType() + "");
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 2); // 弹框
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
|
| | |
| | | import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | |
| | | import com.yeshi.fanli.util.factory.RedPackDetailFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackGiveVO;
|
| | |
|
| | | @Service
|
| | | public class RedPackGiveRecordServiceImpl implements RedPackGiveRecordService {
|
| | |
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | |
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Override
|
| | | public RedPackGiveRecord selectByPrimaryKey(Long id) {
|
| | |
| | | return giveRecord;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<RedPackGiveVO> getGiveList(int page, int pageSzie, Long uid) {
|
| | | List<RedPackGiveVO> list = redPackGiveRecordMapper.getGiveList((page-1)*pageSzie, pageSzie, uid);
|
| | | if (list == null) {
|
| | | list = new ArrayList<RedPackGiveVO>();
|
| | | }
|
| | | |
| | | if (list.isEmpty()) {
|
| | | return list;
|
| | | }
|
| | | |
| | | String tips = redPackConfigService.getValueByKey("give_tips");
|
| | | String appLink = redPackConfigService.getValueByKey("app_down_link");
|
| | | String projectChineseName = Constant.systemCommonConfig.getProjectChineseName();
|
| | |
|
| | | for (RedPackGiveVO record: list) {
|
| | | Long receiveUid = record.getReceiveUid();
|
| | | if (receiveUid != null) {
|
| | | UserInfo userInfo = userInfoService.selectByPKey(receiveUid);
|
| | | record.setReceiveName(userInfo.getNickName());
|
| | | record.setReceivePortrait(userInfo.getPortrait());
|
| | | record.setReceiveTip("领取了你的红包");
|
| | | }
|
| | | TokenRecord token = tokenRecordService.getByTypeAndIdentify(TokenTypeEnum.redPack.name(), |
| | | record.getId().toString());
|
| | | |
| | | String desc = tips;
|
| | | while (desc.contains("{APP名称}")) {
|
| | | desc = desc.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | desc = desc.replace("{口令}", token.getToken()).replace("{下载链接}", appLink).replace("{面额}", record.getAmount().setScale(2).toString());
|
| | | record.setDesc(desc);
|
| | | }
|
| | | |
| | | return list;
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countGiveList(Long uid) {
|
| | | return redPackGiveRecordMapper.countGiveList(uid);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | public TokenRecord getNearByTypeAndIdentify(String type, String identify) {
|
| | | return tokenRecordMapper.getNearByTypeAndIdentify(type, identify);
|
| | | }
|
| | | |
| | | @Override
|
| | | public TokenRecord getByTypeAndIdentify(String type, String identify) {
|
| | | return tokenRecordMapper.getByTypeAndIdentify(type, identify);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | |
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.FileUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | | import net.coobird.thumbnailator.Thumbnails;
|
| | |
|
| | | @Service
|
| | | public class UserInfoExtraServiceImpl implements UserInfoExtraService {
|
| | |
| | | new Gson().toJson(new UserInfoUpdateMQMsg(uid, UserInfoUpdateTypeEnum.inviteCode, inviteCodeVip, new Date())));
|
| | | producer.send(message);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void uploadERCode(MultipartFile file, Long uid) {
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra == null)
|
| | | return;
|
| | | |
| | | // 压缩
|
| | | String targetPath = FileUtil.getCacheDir() + "/erCode_" + uid + "_" + System.currentTimeMillis()+ ".jpg";
|
| | | try {
|
| | | Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
|
| | | } catch (IOException e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | return;
|
| | | }
|
| | | |
| | | // 执行上传
|
| | | String filePath = "/img/user/erCode/" + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
|
| | | |
| | | // 删除本地图片
|
| | | if (new File(targetPath).exists()) {
|
| | | new File(targetPath).delete();
|
| | | }
|
| | |
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(extra.getId());
|
| | | update.setErCode(fileLink);
|
| | | userInfoExtraMapper.updateByPrimaryKeySelective(update);
|
| | |
|
| | | // 原二维码
|
| | | if (!StringUtil.isNullOrEmpty(extra.getErCode())) {
|
| | | COSManager.getInstance().deleteFile(extra.getErCode());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.integral.IntegralTaskRecordMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.IntegralTaskMQMsg;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherRewardIntegralDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.integral.IntegralDetail;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralTaskClassService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralTaskService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | | public class IntegralTaskRecordServiceImpl implements IntegralTaskRecordService {
|
| | |
| | | return integralTaskRecordMapper.countFinished(uid, cid, dateType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void invalidGoldCoin() {
|
| | | integralTaskRecordMapper.invalidGoldCoin();
|
| | | }
|
| | | |
| | | @Override
|
| | | public void finishedTask(long uid, long cid, long taskId, int goldCoin) {
|
| | | IntegralTaskRecord taskRecord = new IntegralTaskRecord();
|
| | |
| | |
|
| | | // 已领取
|
| | | Integer state = record.getState();
|
| | | if (state != null && state == 1)
|
| | | if (state != null && state != 0)
|
| | | continue;
|
| | |
|
| | | if (addDetail(uid, record))
|
| | |
| | | if (record.getCid() == null || record.getTaskId() == null || record.getGoldCoin() == null
|
| | | || record.getState() == null || record.getUid() == null)
|
| | | throw new IntegralTaskRecordException(2, "数据不完成");
|
| | |
|
| | | Date date = new Date();
|
| | | if (record.getCreateTime() == null)
|
| | | record.setCreateTime(new Date());
|
| | | record.setCreateTime(date);
|
| | |
|
| | | if (record.getUpdateTime() == null)
|
| | | record.setUpdateTime(new Date());
|
| | | record.setUpdateTime(date);
|
| | | |
| | | // 设置有效期
|
| | | record.setEndTime(DateUtil.plusDayDate(Constant.GOLD_COIN_VALID_DAYS, date));
|
| | | integralTaskRecordMapper.insertSelective(record);
|
| | | long count = integralTaskRecordMapper.getTotalGoldCoinByUid(record.getUid());
|
| | | if (count >= 200) {// 大于200发送消息
|
| | | IntegralTaskMQMsg msg = new IntegralTaskMQMsg(record.getUid(), count, new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.integralTaskFinish,
|
| | | msg);
|
| | | producer.send(message);
|
| | | }
|
| | | |
| | | // long count = integralTaskRecordMapper.getTotalGoldCoinByUid(record.getUid());
|
| | | // if (count >= 200) {// 大于200发送消息
|
| | | // IntegralTaskMQMsg msg = new IntegralTaskMQMsg(record.getUid(), count, new Date());
|
| | | // Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.integralTaskFinish,
|
| | | // msg);
|
| | | // producer.send(message);
|
| | | // }
|
| | |
|
| | | return record;
|
| | | }
|
| | |
| | | return integralTaskRecordMapper.listByUidAndTaskId(uid, taskId, (page - 1) * count, count);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long getTotalGoldCoinByUid(Long uid) {
|
| | | return integralTaskRecordMapper.getTotalGoldCoinByUid(uid);
|
| | | }
|
| | |
|
| | | @Async()
|
| | | @Override
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.ESOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | |
| | | */
|
| | | public OrderCountVO getOrderCount(Long uid, Integer day, Integer source);
|
| | |
|
| | | /**
|
| | | * 搜索订单信息
|
| | | * @param page
|
| | | * @param size
|
| | | * @param uid
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public List<CommonOrderVO> searchOrderByUid(int page, int size, Long uid, List<ESOrder> list) throws Exception;
|
| | |
|
| | | public long countSearchOrderByUid(Long uid, List<ESOrder> list);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.redpack;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackGiveVO;
|
| | |
|
| | | public interface RedPackGiveRecordService {
|
| | |
|
| | |
| | | */
|
| | | public void overdueByPrimaryKey(Long id) throws Exception;
|
| | |
|
| | | /**
|
| | | * 查询赠送记录
|
| | | * @param page
|
| | | * @param pageSzie
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<RedPackGiveVO> getGiveList(int page, int pageSzie, Long uid);
|
| | |
|
| | | public long countGiveList(Long uid);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void invalidByCoupon(Long id);
|
| | |
|
| | | /**
|
| | | * 根据类型查询
|
| | | * @param type
|
| | | * @param identify
|
| | | * @return
|
| | | */
|
| | | public TokenRecord getByTypeAndIdentify(String type, String identify);
|
| | |
|
| | | }
|
| | |
| | | import java.util.Date;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | * @param goldCoin
|
| | | */
|
| | | public void addGoldCoinByUid(Long uid, Integer goldCoin);
|
| | |
|
| | |
|
| | | /**
|
| | | * 上传二维码
|
| | | * @param file
|
| | | * @param uid
|
| | | */
|
| | | public void uploadERCode(MultipartFile file, Long uid);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public List<IntegralTaskRecord> getSign7DaysRecord(long uid, Long cid);
|
| | |
|
| | | /**
|
| | | * 统计总金币
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long getTotalGoldCoinByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 推广红包折算金币
|
| | |
| | | */
|
| | | public void taoLiJinExchange(Long uid, Integer addGoldCoin, BigDecimal tlj);
|
| | |
|
| | | /**
|
| | | * 金币过期
|
| | | */
|
| | | public void invalidGoldCoin();
|
| | |
|
| | | }
|
| | |
| | | public static final int TOKEN_DAYS = 1;
|
| | | // 赠送有效期-天
|
| | | public static final int GIVE_DAYS = 1;
|
| | | // 金币有效天数
|
| | | public static final int GOLD_COIN_VALID_DAYS = 30;
|
| | |
|
| | |
|
| | | // 微信自动提现金额
|
| | |
| | | else
|
| | | return false;
|
| | | }
|
| | | |
| | | public static boolean greaterThan_2_0_6(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 53))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 74)))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static boolean smallerThan_1_5_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
|