Merge remote-tracking branch 'origin/div' into div
| | |
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.exception.ExtractException;
|
| | | import com.yeshi.fanli.exception.NotExistObjectException;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.push.PushRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | /**
|
| | | *
|
| | |
| | | surplusTime = DateUtil.dateDiff(formattodayTime, formatTime);
|
| | | }
|
| | |
|
| | | String mark = "";
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(extract.getUserInfo().getId());
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getMark())) {
|
| | | mark = "警惕!! " + userInfoExtra.getMark();
|
| | | }
|
| | |
|
| | | data.put("mark",mark);
|
| | | data.put("extract", extract);
|
| | | data.put("beforeMoney", beforeMoney);
|
| | | data.put("surplusTime", surplusTime);
|
| | |
| | | surplusTime = DateUtil.dateDiff(formattodayTime, formatTime);
|
| | | }
|
| | |
|
| | | String mark = "";
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(extract.getUserInfo().getId());
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getMark())) {
|
| | | mark = "警惕!! " + userInfoExtra.getMark();
|
| | | }
|
| | |
|
| | | data.put("mark",mark);
|
| | | data.put("extract", extract);
|
| | | data.put("beforeMoney", beforeMoney);
|
| | | data.put("surplusTime", surplusTime);
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | |
| | |
|
| | | UserInfo find = userInfoService.getUserById(uid);
|
| | | if (find == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该用户!"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户被封禁或不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("解绑成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 修改用户备注
|
| | | * @param callback
|
| | | * @param uid
|
| | | * @param mark
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping("addUserMark")
|
| | | public void addUserMark(String callback, Long uid, String mark, PrintWriter out) {
|
| | | try {
|
| | | if (uid == null || uid <= 0 || StringUtil.isNullOrEmpty(mark))
|
| | | return;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null) |
| | | return;
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | updateExtra.setId(userInfoExtra.getId());
|
| | | updateExtra.setMark(mark);
|
| | | userInfoExtraService.saveUserInfoExtra(updateExtra);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除用户-改变其状态
|
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteUser")
|
| | | public void delete(String callback, String idArray, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | |
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆。")));
|
| | | return;
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | for (Long id: list) {
|
| | | UserInfo user = new UserInfo(id);
|
| | | user.setState(UserInfo.STATE_DELETE);
|
| | | user.setStateDesc(admin.getId()+" " + admin.getName()+ "后台手动删除");
|
| | | userInfoService.updateByPrimaryKeySelective(user);
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 封禁用户ID
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getGoldTop")
|
| | | public void getGoldTop(String callback, Integer pageIndex, Integer pageSize, Integer type,
|
| | | public void getGoldTop(String callback, Integer pageIndex, Integer pageSize, Integer type, String key,
|
| | | PrintWriter out) {
|
| | | if (type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("type不能为空"));
|
| | |
| | | long count = 0;
|
| | | List<UserGoldCoinVO> list = null;
|
| | | if (type == 0) {
|
| | | count = userInfoCountService.countByHasGoldCoin();
|
| | | list = userInfoCountService.listByHasGoldCoin((pageIndex - 1) * pageSize, pageSize);
|
| | | count = userInfoCountService.countByHasGoldCoin(key);
|
| | | list = userInfoCountService.listByHasGoldCoin((pageIndex - 1) * pageSize, pageSize, key);
|
| | | } else if (type == 1 || type == 2) {
|
| | | count = userInfoCountService.countByUserGoldCoin(type);
|
| | | list = userInfoCountService.listByUserGoldCoin((pageIndex - 1) * pageSize, pageSize, type);
|
| | | count = userInfoCountService.countByUserGoldCoin(type, key);
|
| | | list = userInfoCountService.listByUserGoldCoin((pageIndex - 1) * pageSize, pageSize, type, key);
|
| | | }
|
| | |
|
| | | if(list == null)
|
| | |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | List<UserGoldCoinVO> listByUserGoldCoin(@Param("start")long start, @Param("count")int count, @Param("type")int type);
|
| | | List<UserGoldCoinVO> listByUserGoldCoin(@Param("start")long start, @Param("count")int count, @Param("type")int type, @Param("key") String key);
|
| | |
|
| | |
|
| | | long countByUserGoldCoin(@Param("type")int type);
|
| | | long countByUserGoldCoin(@Param("type")int type, @Param("key") String key);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | List<UserGoldCoinVO> listByHasGoldCoin(@Param("start")long start, @Param("count")int count);
|
| | | List<UserGoldCoinVO> listByHasGoldCoin(@Param("start")long start, @Param("count")int count, @Param("key") String key);
|
| | |
|
| | |
|
| | | long countByHasGoldCoin();
|
| | | long countByHasGoldCoin(@Param("key") String key);
|
| | | } |
| | |
| | | this.rankIcon = rankIcon;
|
| | | }
|
| | |
|
| | | // TODO
|
| | | public UserInfo() {
|
| | | openid = "";
|
| | | wxOpenId = "";
|
| | |
| | | @Column(name = "uie_close_time_extract")
|
| | | private Date closeTimeExtract;
|
| | |
|
| | | // 用户标识
|
| | | @Column(name = "uie_mark")
|
| | | private String mark;
|
| | | |
| | | // 创建时间
|
| | | @Column(name = "uie_create_time")
|
| | | private Date createTime;
|
| | |
| | | this.closeTimeExtract = closeTimeExtract;
|
| | | }
|
| | |
|
| | | public String getMark() {
|
| | | return mark;
|
| | | }
|
| | |
|
| | | public void setMark(String mark) {
|
| | | this.mark = mark;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | WHERE 1=1
|
| | | <if test="type == 1">AND d.`td_money`<![CDATA[>]]> 0</if>
|
| | | <if test="type == 2">AND d.`td_money`<![CDATA[<]]> 0</if>
|
| | | <if test="key != null and key !='' ">AND d.`td_uid`LIKE '%${key}%'</if>
|
| | | GROUP BY d.`td_uid`
|
| | | ORDER BY goldCoin <if test="type == 1">DESC</if>
|
| | | LIMIT #{start},#{count}
|
| | |
| | | WHERE 1=1
|
| | | <if test="type == 1">AND d.`td_money`<![CDATA[>]]> 0</if>
|
| | | <if test="type == 2">AND d.`td_money`<![CDATA[<]]> 0</if>
|
| | | <if test="key != null and key !='' ">AND d.`td_uid` LIKE '%${key}%'</if>
|
| | | </select>
|
| | |
|
| | | <select id="listByHasGoldCoin" resultMap="UserGoldCoinMapVO">
|
| | | SELECT IFNULL(t.`uie_gold_coin`,0) AS goldCoin,u.`id`,u.`nick_name`,u.`portrait`
|
| | | FROM `yeshi_ec_user_info_extra` t
|
| | | LEFT JOIN `yeshi_ec_user` u ON t.`uie_uid` = u.`id`
|
| | | WHERE 1=1 <if test="key != null and key !='' ">AND t.`uie_uid`LIKE '%${key}%'</if>
|
| | | ORDER BY t.`uie_gold_coin` DESC
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="countByHasGoldCoin" resultType="Long">
|
| | | SELECT IFNULL(COUNT(t.`uie_id`),0)FROM `yeshi_ec_user_info_extra` t
|
| | | WHERE 1=1 <if test="key != null and key !='' ">AND t.`uie_uid`LIKE '%${key}%'</if>
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | jdbcType="VARCHAR" />
|
| | |
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | |
| | | where u.state=0
|
| | | </select>
|
| | |
|
| | | <select id="getAutoExtractUserIds" resultType="java.lang.Long">
|
| | | SELECT u.`id` FROM `yeshi_ec_user_info_extra` t
|
| | | <select id="getAutoExtractUserIds" 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 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_mark" property="mark" jdbcType="VARCHAR" />
|
| | | <association property="userInfo" column="uie_uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" />
|
| | |
| | | jdbcType="BOOLEAN" />
|
| | |
|
| | | <result column="uie_close_time_extract" property="closeTimeExtract" 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_mark" property="mark" jdbcType="VARCHAR" />
|
| | |
|
| | | <association property="userInfo" column="uie_uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | |
| | |
|
| | |
|
| | |
|
| | | <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
|
| | | <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>
|
| | |
|
| | | <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_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)
|
| | | 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})
|
| | | (#{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})
|
| | | </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="mark != null">uie_mark,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | |
| | | <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="mark != null">#{mark,jdbcType=VARCHAR},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update
|
| | |
| | | #{createTime,jdbcType=TIMESTAMP},uie_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP},uie_auto_extract =
|
| | | #{autoExtract,jdbcType=BOOLEAN},uie_close_time_extract =
|
| | | #{closeTimeExtract,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}
|
| | | #{closeTimeExtract,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">
|
| | | update yeshi_ec_user_info_extra
|
| | |
| | | <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="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where uie_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
| | | <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="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where uie_uid = #{userInfo.id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserGoldCoinVO> listByUserGoldCoin(long start, int count, int type) {
|
| | | return userInfoCountMapper.listByUserGoldCoin(start, count, type);
|
| | | public List<UserGoldCoinVO> listByUserGoldCoin(long start, int count, int type, String key) {
|
| | | return userInfoCountMapper.listByUserGoldCoin(start, count, type, key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByUserGoldCoin(int type) {
|
| | | return userInfoCountMapper.countByUserGoldCoin(type);
|
| | | public long countByUserGoldCoin(int type, String key) {
|
| | | return userInfoCountMapper.countByUserGoldCoin(type, key);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<UserGoldCoinVO> listByHasGoldCoin(long start, int count) {
|
| | | return userInfoCountMapper.listByHasGoldCoin(start, count);
|
| | | public List<UserGoldCoinVO> listByHasGoldCoin(long start, int count, String key) {
|
| | | return userInfoCountMapper.listByHasGoldCoin(start, count, key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByHasGoldCoin() {
|
| | | return userInfoCountMapper.countByHasGoldCoin();
|
| | | public long countByHasGoldCoin(String key) {
|
| | | return userInfoCountMapper.countByHasGoldCoin(key);
|
| | | }
|
| | | }
|
| | |
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<UserGoldCoinVO> listByUserGoldCoin(long start, int count, int type);
|
| | | public List<UserGoldCoinVO> listByUserGoldCoin(long start, int count, int type, String key);
|
| | |
|
| | | public long countByUserGoldCoin(int type);
|
| | | public long countByUserGoldCoin(int type, String key);
|
| | |
|
| | | /**
|
| | | * 统计剩余金币
|
| | |
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<UserGoldCoinVO> listByHasGoldCoin(long start, int count);
|
| | | public List<UserGoldCoinVO> listByHasGoldCoin(long start, int count, String key);
|
| | |
|
| | | public long countByHasGoldCoin();
|
| | | public long countByHasGoldCoin(String key);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.transaction.LocalTransactionChecker;
|
| | | import com.aliyun.openservices.ons.api.transaction.TransactionStatus;
|
| | |
|
| | | @Component
|
| | | public class RocketMQLocalTransactionChecker implements LocalTransactionChecker {
|
| | | public RocketMQLocalTransactionChecker() {
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TransactionStatus check(Message msg) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Action;
|
| | | import com.aliyun.openservices.ons.api.ConsumeContext;
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | |
|
| | | @Component
|
| | | public class RocketMQMessageListener implements MessageListener {
|
| | |
|
| | | public RocketMQMessageListener() {
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | // 剩余金币数量
|
| | | private int goldCoin;
|
| | | // 用户标识
|
| | | private String mark;
|
| | |
|
| | |
|
| | | public String getRankId() {
|
| | |
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | |
|
| | | public String getMark() {
|
| | | return mark;
|
| | | }
|
| | |
|
| | | public void setMark(String mark) {
|
| | | this.mark = mark;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
| | | <bean id="msgListener" class="com.yeshi.fanli.util.rocketmq.RocketMQMessageListener"></bean> <!--Listener 配置 -->
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="consumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
|
| | | <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
|
| | | <prop key="GROUP_ID">GID_DEMO</prop>
|
| | | <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
|
| | | </prop>
|
| | | <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <entry value-ref="msgListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TopicTestMQ" />
|
| | | <property name="expression" value="*" /><!--expression 即 |
| | | Tag,可以设置成具体的 Tag,如 taga||tagb||tagc,也可设置成 *。 * 仅代表订阅所有 Tag,不支持通配 -->
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | <!--更多的订阅添加 entry 节点即可,如下所示 -->
|
| | | <entry value-ref="msgListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TopicTestMQ-Other" /> <!--订阅另外一个 Topic -->
|
| | | <property name="expression" value="taga||tagb" /> <!-- 订阅多个 Tag -->
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | | </beans> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
| | |
|
| | | <bean id="producer" class="com.aliyun.openservices.ons.api.bean.ProducerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <!-- Spring 接入方式支持 Java SDK 支持的所有配置项 -->
|
| | | <property name="properties"> <!--生产者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
|
| | | <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
|
| | | <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
|
| | | </prop>
|
| | | <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
|
| | | </props>
|
| | | </property>
|
| | | </bean>
|
| | | </beans> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <beans xmlns="http://www.springframework.org/schema/beans"
|
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
| | | <!-- 事务消息生产 -->
|
| | | <bean id="localTransactionChecker" class="com.yeshi.fanli.util.rocketmq.RocketMQLocalTransactionChecker"></bean>
|
| | | <bean id="transactionProducer"
|
| | | class="com.aliyun.openservices.ons.api.bean.TransactionProducerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--事务消息生产者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">LTAI4FwmTxVCuzTaoZtDiV8z</prop>
|
| | | <prop key="SecretKey">ixWg90QbYFKP6ae5xpAo2P1qwIyll5</prop>
|
| | | <prop key="GROUP_ID">GID_DEMO</prop>
|
| | | <prop key="NAMESRV_ADDR">http://MQ_INST_1205444665315884_BbaMbxF4.mq-internet-access.mq-internet.aliyuncs.com:80
|
| | | </prop>
|
| | | </props>
|
| | | </property>
|
| | | <property name="localTransactionChecker" ref="localTransactionChecker"></property>
|
| | | </bean>
|
| | | </beans> |
| | |
| | | </array>
|
| | | </property>
|
| | | </bean>
|
| | | |
| | | <import resource="classpath:/rocket/consumer.xml"/>
|
| | | <import resource="classpath:/rocket/producer.xml"/>
|
| | | <import resource="classpath:/rocket/transactionProducer.xml"/>
|
| | |
|
| | | <!--异步定义推荐方式 <task:executor id="executor" pool-size="15" /> <task:scheduler
|
| | | id="scheduler" pool-size="30" /> <task:annotation-driven executor="executor"
|
| | |
| | | <version>0.4.8</version> |
| | | </dependency> |
| | | |
| | | <dependency>
|
| | | <groupId>com.aliyun.openservices</groupId>
|
| | | <artifactId>ons-client</artifactId>
|
| | | <version>1.8.0.Final</version>
|
| | | </dependency>
|
| | |
|
| | | |
| | | </dependencies> |
| | | |