| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 下载提现红包Openid
|
| | | * @param callback
|
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "downAutoExtractTxt")
|
| | | public void downAutoExtractTxt(String callback, HttpServletResponse response, PrintWriter out) {
|
| | | try {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 上传提现红包Excel
|
| | | * @param file
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "uploadExcel", method = RequestMethod.POST)
|
| | | public void uploadExcel(@RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | | if (file == null) {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 预览红包发生人
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "preAutoUser")
|
| | | public void preAutoUser(String callback, Integer pageIndex, Integer pageSize, PrintWriter out) {
|
| | | public void preAutoUser(String callback, Integer pageIndex, PrintWriter out) {
|
| | | try {
|
| | | List<UserInfo> list = extractService.preAutoUser();
|
| | | if (list == null || list.isEmpty()) {
|
| | |
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | Integer pageSize = 100;
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | |
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(userExtra.getId());
|
| | | update.setAutoExtract(false);
|
| | | update.setCloseTimeExtract(new Date());
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(update);
|
| | | } catch (UserInfoExtraException e) {
|
| | |
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<UserInfo> getAutoExtractUserIds(@Param("start") int start, @Param("count") int count, @Param("money") BigDecimal money);
|
| | | List<UserInfo> getAutoExtractUser(@Param("start") int start, @Param("count") int count, @Param("money") BigDecimal money,
|
| | | @Param("beganDate") String beganDate, @Param("endDate") String endDate);
|
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.msg; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum; |
| | | |
| | | public interface MsgMoneyDetailMapper extends BaseMapper<MsgMoneyDetail> { |
| | | |
| | | MsgMoneyDetail selectBySourceIdAndMsgType(@Param("sourceId") Long sourceId, |
| | | @Param("type") MsgTypeMoneyTypeEnum type); |
| | | |
| | | List<MsgMoneyDetail> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | Long countByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 设置消息已读时 |
| | | * |
| | | * @param uid |
| | | */ |
| | | void setMsgReadByUid(Long uid); |
| | | package com.yeshi.fanli.dao.mybatis.msg;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | |
|
| | | public interface MsgMoneyDetailMapper extends BaseMapper<MsgMoneyDetail> {
|
| | |
|
| | | MsgMoneyDetail selectBySourceIdAndMsgType(@Param("sourceId") Long sourceId,
|
| | | @Param("type") MsgTypeMoneyTypeEnum type);
|
| | |
|
| | | List<MsgMoneyDetail> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count);
|
| | |
|
| | | Long countByUid(@Param("uid") Long uid);
|
| | | |
| | | /**
|
| | | * 设置消息已读时
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | void setMsgReadByUid(Long uid);
|
| | | } |
| | |
| | | * @return
|
| | | */
|
| | | void updateGoldCoin(@Param("id")Long id, @Param("goldCoin")Integer goldCoin);
|
| | | |
| | | /**
|
| | | * 开启提现:超过60天关闭
|
| | | * @param days
|
| | | */
|
| | | void updateAutoExtract(@Param("days")Integer days);
|
| | | } |
| | |
| | | @Column(name = "uie_mark")
|
| | | private String mark;
|
| | |
|
| | | // 用户最近活跃时间
|
| | | @Column(name = "uie_active_time")
|
| | | private Date activeTime;
|
| | | |
| | | // 创建时间
|
| | | @Column(name = "uie_create_time")
|
| | | private Date createTime;
|
| | |
| | | this.mark = mark;
|
| | | }
|
| | |
|
| | | public Date getActiveTime() {
|
| | | return activeTime;
|
| | | }
|
| | |
|
| | | public void setActiveTime(Date activeTime) {
|
| | | this.activeTime = activeTime;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankingsService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderService taoBaoOrderService;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | |
|
| | | // 1加,2减
|
| | |
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 自动提现服务端规则,关闭后,第60天系统会自动开启(从关闭日起)
|
| | | */
|
| | | @Scheduled(cron = "0 50 0 * * ? ")
|
| | | public void updateAutoExtract() {
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | userInfoExtraService.updateAutoExtract(60);
|
| | | }
|
| | | }
|
| | |
| | | where u.state=0
|
| | | </select>
|
| | |
|
| | | <select id="getAutoExtractUserIds" resultMap="BaseResultMap">
|
| | | <select id="getAutoExtractUser" resultMap="BaseResultMap">
|
| | | SELECT u.* FROM `yeshi_ec_user_info_extra` t
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
|
| | | WHERE t.`uie_auto_extract` = 1 AND u.`state` = 0 AND u.`my_hongBao` <![CDATA[>=]]> #{money} |
| | | AND u.`wx_open_id` IS NOT NULL AND LENGTH(TRIM(u.`wx_open_id`)) <![CDATA[>]]> 0
|
| | | WHERE t.`uie_auto_extract` = 1 AND t.uie_active_time <![CDATA[>=]]> #{beganDate} AND t.uie_active_time <![CDATA[<]]> #{endDate}
|
| | | AND u.`state` = 0 AND u.`my_hongBao` <![CDATA[>=]]> #{money} |
| | | AND u.`wx_open_id` IS NOT NULL AND LENGTH(TRIM(u.`wx_open_id`)) <![CDATA[>]]> 0
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
| | | <result column="uie_auto_extract" property="autoExtract"
|
| | | jdbcType="BOOLEAN" />
|
| | | <result column="uie_close_time_extract" property="closeTimeExtract" jdbcType="TIMESTAMP" />
|
| | | <result column="uie_active_time" property="activeTime" jdbcType="TIMESTAMP" />
|
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
| | | <association property="userInfo" column="uie_uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | |
| | | jdbcType="BOOLEAN" />
|
| | |
|
| | | <result column="uie_close_time_extract" property="closeTimeExtract" jdbcType="TIMESTAMP" />
|
| | | <result column="uie_active_time" property="activeTime" jdbcType="TIMESTAMP" />
|
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
| | | <association property="userInfo" column="uie_uid"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
|
| | |
| | | jdbcType="BOOLEAN" />
|
| | |
|
| | | <result column="uie_close_time_extract" property="closeTimeExtract" jdbcType="TIMESTAMP" />
|
| | | <result column="uie_active_time" property="activeTime" jdbcType="TIMESTAMP" />
|
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
| | |
|
| | | <association property="userInfo" column="uie_uid"
|
| | |
| | |
|
| | |
|
| | |
|
| | | <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_mark
|
| | | <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
|
| | | </sql>
|
| | |
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | |
| | | <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_mark)
|
| | | (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)
|
| | | 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},#{mark,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})
|
| | | </insert>
|
| | |
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra"
|
| | |
| | | <if test="updateTime != null">uie_update_time,</if>
|
| | | <if test="autoExtract != null">uie_auto_extract,</if>
|
| | | <if test="closeTimeExtract != null">uie_close_time_extract,</if>
|
| | | <if test="activeTime != null">uie_active_time,</if>
|
| | | <if test="mark != null">uie_mark,</if>
|
| | | </trim>
|
| | | values
|
| | |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="autoExtract != null">#{autoExtract,jdbcType=BOOLEAN},</if>
|
| | | <if test="closeTimeExtract != null">#{closeTimeExtract,jdbcType=TIMESTAMP},</if>
|
| | | <if test="activeTime != null">#{activeTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="mark != null">#{mark,jdbcType=VARCHAR},</if>
|
| | | </trim>
|
| | | </insert>
|
| | |
| | | #{createTime,jdbcType=TIMESTAMP},uie_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP},uie_auto_extract =
|
| | | #{autoExtract,jdbcType=BOOLEAN},uie_close_time_extract =
|
| | | #{closeTimeExtract,jdbcType=TIMESTAMP},uie_mark =
|
| | | #{closeTimeExtract,jdbcType=TIMESTAMP},uie_active_time =
|
| | | #{activeTime,jdbcType=TIMESTAMP},uie_mark =
|
| | | #{mark,jdbcType=VARCHAR} where uie_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
| | |
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if>
|
| | | <if test="closeTimeExtract != null">uie_close_time_extract=#{closeTimeExtract,jdbcType=TIMESTAMP},</if>
|
| | | <if test="activeTime != null">uie_active_time=#{activeTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where uie_id = #{id,jdbcType=BIGINT}
|
| | |
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if>
|
| | | <if test="closeTimeExtract != null">uie_close_time_extract=#{closeTimeExtract,jdbcType=TIMESTAMP},</if>
|
| | | <if test="activeTime != null">uie_active_time=#{activeTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where uie_uid = #{userInfo.id,jdbcType=BIGINT}
|
| | |
| | | rk.`ur_id` = ue.`uie_rank_id`
|
| | | WHERE ue.`uie_uid` = #{uid}
|
| | | </select>
|
| | | |
| | | <update id="updateAutoExtract">
|
| | | UPDATE yeshi_ec_user_info_extra SET uie_auto_extract = 1 |
| | | WHERE uie_auto_extract = 0 AND DATEDIFF(NOW(),uie_close_time_extract) <![CDATA[>]]> #{days}
|
| | | </update>
|
| | | </mapper>
|
| | |
| | | int pageSize = 100;
|
| | | int maxSize = 300;
|
| | | Date nowDate = new Date();
|
| | | // 一、自动提现针对的用户群: 前提条件:用户在距今60天到90天内未活跃过的用户
|
| | | String beganDate = DateUtil.reduceDayTostring(90, nowDate);
|
| | | String endDate = DateUtil.reduceDayTostring(60, nowDate);
|
| | | // 条件3:距离上一次成功领取微信红包已经超过了30天时间,可在第31天再次下发;
|
| | | String receivedDate = DateUtil.reduceDayTostring(30, nowDate);
|
| | | // 条件4:距离上一次未成功领取微信红包已经超过了15天时间,可在第16天再次下发;
|
| | |
| | |
|
| | | while (true) {
|
| | | // 查询满足条件 1、2 的uid
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUserIds(page * pageSize, pageSize, minSurplus);
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus, beganDate, endDate);
|
| | | if (listUser == null || listUser.isEmpty())
|
| | | break;
|
| | |
|
| | |
| | | int pageSize = 100;
|
| | | int maxSize = 301; // appId + 实际openid300个
|
| | | Date nowDate = new Date();
|
| | | // 一、自动提现针对的用户群: 前提条件:用户在距今60天到90天内未活跃过的用户
|
| | | String beganDate = DateUtil.reduceDayTostring(90, nowDate);
|
| | | String endDate = DateUtil.reduceDayTostring(60, nowDate);
|
| | | // 条件3:距离上一次成功领取微信红包已经超过了30天时间,可在第31天再次下发;
|
| | | String receivedDate = DateUtil.reduceDayTostring(30, nowDate);
|
| | | // 条件4:距离上一次未成功领取微信红包已经超过了15天时间,可在第16天再次下发;
|
| | |
| | |
|
| | | while (true) {
|
| | | // 查询满足条件 1、2 的uid
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUserIds(page * pageSize, pageSize, minSurplus);
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus, beganDate, endDate);
|
| | | if (listUser == null || listUser.isEmpty())
|
| | | break;
|
| | |
|
| | |
| | |
|
| | | // 状态过滤
|
| | | String statusOld = record.getStatus();
|
| | | if (StringUtil.isNullOrEmpty(statusOld) ||ExtractWeiXinRecord.REFUND.equals(statusOld) |
| | | || ExtractWeiXinRecord.RFUND_ING.equals(statusOld)) |
| | | if (StringUtil.isNullOrEmpty(statusOld) || ExtractWeiXinRecord.REFUND.equals(statusOld) |
| | | || ExtractWeiXinRecord.RECEIVED.equals(statusOld)) |
| | | return;
|
| | |
|
| | | ExtractWeiXinRecord updeteRecord = new ExtractWeiXinRecord();
|
| | |
| | | }
|
| | | }
|
| | | updeteRecord.setStatus(status);
|
| | | |
| | | // 更新红包记录
|
| | | extractWeiXinRecordService.updateByPrimaryKeySelective(updeteRecord);
|
| | |
|
| | | if (!ExtractWeiXinRecord.REFUND.equals(status))
|
| | | return;
|
| | | |
| | | // 资金明细
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extractAutoWXRefund.name() + ":" + record.getId()));
|
| | | detail.setMoney(record.getMoney());
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractAutoWXRefund.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractAutoWXRefund);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(record.getUid()));
|
| | | |
| | | // 资金计算
|
| | | userMoneyService.addUserMoney(record.getUid(), record.getMoney(), detail);
|
| | | if (ExtractWeiXinRecord.RECEIVED.equals(status)) {
|
| | | // 发送消息通知
|
| | | userMoneyMsgNotificationService.extractAuto(record, "已领取-已提现", null, null);
|
| | | } else if (ExtractWeiXinRecord.REFUND.equals(status)) {
|
| | | // 资金明细
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extractAutoWXRefund.name() + ":" + record.getId()));
|
| | | detail.setMoney(record.getMoney());
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractAutoWXRefund.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractAutoWXRefund);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(record.getUid()));
|
| | | |
| | | // 资金计算
|
| | | userMoneyService.addUserMoney(record.getUid(), record.getMoney(), detail);
|
| | | |
| | | // 发送消息通知
|
| | | userMoneyMsgNotificationService.extractAuto(record, "已退回-余额中", null, null);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.extractAutoWX) {
|
| | | if (detail.getMoney() == null || detail.getUser() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | |
| | | MsgMoneyDetail msg = msgMoneyDetailMapper.selectBySourceIdAndMsgType(detail.getExtract().getId(),
|
| | | MsgTypeMoneyTypeEnum.extractAutoWX);
|
| | | if (msg == null) {
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | } else {
|
| | | MsgMoneyDetail update = new MsgMoneyDetail();
|
| | | update.setId(msg.getId());
|
| | | update.setUpdateTime(new Date());
|
| | | update.setRead(false);
|
| | | update.setStateDesc(detail.getStateDesc());
|
| | | msgMoneyDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.user.UserActiveLogMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
|
| | | @Service
|
| | | public class UserActiveLogServiceImpl implements UserActiveLogService {
|
| | |
|
| | | @Resource
|
| | | private UserActiveLogMapper userActiveLogMapper;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Override
|
| | | public void addUserActiveLog(UserActiveLog userActiveLog) {
|
| | |
| | | userActiveLog.setCreateTime(new Date());
|
| | | userActiveLog.setUpdateTime(new Date());
|
| | | userActiveLogMapper.insertSelective(userActiveLog);
|
| | | // 更新最新活跃时间
|
| | | userInfoExtraService.updateActiveTime(userActiveLog.getUid() , new Date());
|
| | | } else if (latestLog != null) {
|
| | | // 如果设备 ,版本,渠道有变化则需要更改
|
| | | String oldIdentify = latestLog.getDevice() + "#" + latestLog.getVersionCode() + "#"
|
| | |
| | | userActiveLog.setCreateTime(new Date());
|
| | | userActiveLog.setUpdateTime(new Date());
|
| | | userActiveLogMapper.insertSelective(userActiveLog);
|
| | | // 更新最新活跃时间
|
| | | userInfoExtraService.updateActiveTime(userActiveLog.getUid() , new Date());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void updateActiveTime(Long uid, Date date) {
|
| | | UserInfoExtra userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(new UserInfo(uid));
|
| | | userInfoExtra.setActiveTime(date);
|
| | | userInfoExtraMapper.updateInfoExtraByUid(userInfoExtra);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public UserInfoExtra getUserInfoExtra(Long uid) {
|
| | | return userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | |
| | | }
|
| | | return inviter;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void updateAutoExtract(Integer days) {
|
| | | userInfoExtraMapper.updateAutoExtract(days);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<UserInfo> getAutoExtractUserIds(int start, int count, BigDecimal minSurplus) {
|
| | | return userInfoMapper.getAutoExtractUserIds(start, count, minSurplus);
|
| | | public List<UserInfo> getAutoExtractUser(int start, int count, BigDecimal minSurplus, String beganDate,String endDate) {
|
| | | return userInfoMapper.getAutoExtractUser(start, count, minSurplus, beganDate, endDate);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | |
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public void activeInviteWX(Long uid, WeiXinUser weiXinUser) throws UserInfoExtraException;
|
| | |
|
| | | /**
|
| | | * 根据用户id更新信息
|
| | | * @param userInfoExtra
|
| | | */
|
| | | public void updateActiveTime(Long uid, Date date);
|
| | | |
| | | /**
|
| | | *开启自动提现: 更新超过期限的
|
| | | * @param days
|
| | | */
|
| | | void updateAutoExtract(@Param("days")Integer days);
|
| | |
|
| | | }
|
| | |
| | | * @param page
|
| | | * @param count
|
| | | */
|
| | | public List<UserInfo> getAutoExtractUserIds(int page, int count, BigDecimal minSurplus);
|
| | | public List<UserInfo> getAutoExtractUser(int page, int count, BigDecimal minSurplus, String beganDate,String endDate);
|
| | |
|
| | | }
|