From 1c23d47c352ef57bbd4a59e00d4d5b4585853f1e Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 15 十月 2020 09:53:25 +0800
Subject: [PATCH] 拼多多搜索bug
---
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java | 1096 ++++++++++++++++++++++++++++++--------------------------
1 files changed, 585 insertions(+), 511 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
index aaaad95..2f67d5d 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
@@ -10,6 +10,8 @@
import javax.annotation.Resource;
+import com.yeshi.fanli.entity.SystemEnum;
+import com.yeshi.fanli.util.*;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
@@ -31,28 +33,19 @@
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
-import com.yeshi.fanli.entity.bus.user.WeiXinUser;
-import com.yeshi.fanli.entity.system.BusinessSystem;
-import com.yeshi.fanli.exception.user.ThreeSaleException;
import com.yeshi.fanli.exception.user.UserInfoException;
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.money.extract.BindingAccountService;
-import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
+import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
-import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
-import com.yeshi.fanli.service.inter.user.UserRankService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.tb.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
-import com.yeshi.fanli.util.Constant;
-import com.yeshi.fanli.util.StringUtil;
-import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.account.UserUtil;
-import com.yeshi.fanli.util.wx.WXLoginUtil;
+import com.yeshi.fanli.util.user.UserLevelUtil;
import com.yeshi.fanli.vo.user.UserInfoVO;
import net.coobird.thumbnailator.Thumbnails;
@@ -60,600 +53,681 @@
@Service
public class UserInfoServiceImpl implements UserInfoService {
- @Resource(name = "taskExecutor")
- private TaskExecutor executor;
+ @Resource(name = "taskExecutor")
+ private TaskExecutor executor;
- @Resource
- private UserInfoService userInfoService;
+ @Resource
+ private ThreeSaleSerivce threeSaleSerivce;
- @Resource
- private ConfigService configService;
+ @Resource
+ private UserInfoMapper userInfoMapper;
- @Resource
- private ThreeSaleSerivce threeSaleSerivce;
+ @Resource
+ private BindingAccountMapper bindingAccountMapper;
- @Resource
- private UserInfoMapper userInfoMapper;
+ @Resource
+ private PayInfoMapper payInfoMapper;
- @Resource
- private BindingAccountMapper bindingAccountMapper;
+ @Resource
+ private UserShareGoodsHistoryMapper userShareGoodsHistoryMapper;
- @Resource
- private PayInfoMapper payInfoMapper;
+ @Resource
+ private ScanHistoryMapper scanHistoryMapper;
- @Resource
- private UserShareGoodsHistoryMapper userShareGoodsHistoryMapper;
+ @Resource
+ private HongBaoV2CountService hongBaoV2CountService;
- @Resource
- private ScanHistoryMapper scanHistoryMapper;
+ @Lazy
+ @Resource
+ private CommonOrderCountService commonOrderCountService;
- @Resource
- private ShareMapper shareMapper;
+ @Resource
+ private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
- @Resource
- private HongBaoV2CountService hongBaoV2CountService;
+ @Resource
+ private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
- @Resource
- private UserRankService userRankService;
+ @Resource
+ private SpreadUserImgService spreadUserImgService;
- @Resource
- private UserActiveLogService userActiveLogService;
+ @Lazy
+ @Resource
+ private IntegralDetailService integralDetailService;
- @Resource
- private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
+ @Lazy
+ @Resource
+ private UserInfoModifyRecordService userInfoModifyRecordService;
- @Resource
- private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
+ @Resource
+ private RedisManager redisManager;
- @Resource
- private SpreadUserImgService spreadUserImgService;
- @Resource
- private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
+ public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, SystemEnum sysetm) {
+ List<UserInfo> list = null;
+ if (loginType == 1) {
+ list = userInfoMapper.listBySystemAndTaoBaoOpenId(sysetm, openid);
+ } else {
+ list = userInfoMapper.listBySystemAndWXUnionId(sysetm, openid);
+ }
- @Resource
- private BindingAccountService bindingAccountService;
+ if (list != null)
+ for (int i = 0; i < list.size(); i++) {
+ if (list.get(i).getState() == UserInfo.STATE_DELETE
+ || list.get(i).getState() == UserInfo.STATE_DELETE_OUT_OF_DATE) {
+ list.remove(i);
+ i--;
+ }
+ }
- @Lazy
- @Resource
- private UserInfoModifyRecordService userInfoModifyRecordService;
+ if (list != null && list.size() > 0) {
+ return list.get(0);
+ }
+ return null;
+ }
- public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
- List<UserInfo> list = null;
- if (loginType == 1) {
- list = userInfoMapper.listByAppIdAndTaoBaoOpenId(appid, openid);
- } else {
- list = userInfoMapper.listByAppIdAndWXUnionId(appid, openid);
- }
+ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
+ public UserInfo addUser(UserInfo form, SystemEnum sysetm) {
+ try {
+ LogHelper.test("鐢ㄦ埛鐨勬敞鍐屼俊鎭�:" + new Gson().toJson(form));
+ form.setCreatetime(new Date().getTime());
+ form.setRank(0);
+ String openId = form.getLoginType() == Constant.TAOBAO ? form.getOpenid() : form.getWxUnionId();
+ UserInfo find = getUserByLoginTypeAndOpenId(form.getLoginType(), openId, sysetm);
+ if (find != null) {
+ return find;
+ }
+ boolean create = createUser(form, sysetm);
+ if (!create) {
+ return null;
+ }
+ int loginType = form.getLoginType();
+ // 寤虹殑鍋囩敤鎴枫�傘��
+ if (loginType == -1) {
+ return form;
+ }
- if (list != null)
- for (int i = 0; i < list.size(); i++) {
- if (list.get(i).getState() == UserInfo.STATE_DELETE
- || list.get(i).getState() == UserInfo.STATE_DELETE_OUT_OF_DATE) {
- list.remove(i);
- i--;
- }
- }
+ LogHelper.userInfo("娣诲姞鐢ㄦ埛:" + form);
+ if (form.getLoginType() == Constant.WEIXIN) {
+ ThreadUtil.run(new Runnable() {
+ public void run() {
+ UserInfo temp = userInfoMapper.selectByPrimaryKey(form.getId());
+ COSManager cosManager = COSManager.getInstance();
+ InputStream inputStream = HttpUtil.getAsInputStream(temp.getPortrait());
+ String uploadFile = cosManager.uploadFile(inputStream, FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString()).getUrl();
+ UserInfo updateTemp = new UserInfo(temp.getId());
+ updateTemp.setPortrait(uploadFile);
+ userInfoMapper.updateByPrimaryKeySelective(updateTemp);
+ }
+ });
+ }
+ } catch (Exception e) {
+ try {
+ LogHelper.errorDetailInfo(e);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ return null;
+ }
+ return form;
+ }
- if (list != null && list.size() > 0) {
- return list.get(0);
- }
- return null;
- }
+ @Transactional
+ public boolean createUser(UserInfo form, SystemEnum sysetm) {
+ long maxUid = userInfoMapper.getMaxUid();
+ long dd = (long) (Math.random() * 100);
+ if (dd == 0) {
+ dd = 1;
+ }
+ long bid = maxUid;
+ long id = bid + dd;
- @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
- public UserInfo addUser(UserInfo form, String appid) {
- try {
- LogHelper.test("鐢ㄦ埛鐨勬敞鍐屼俊鎭�:" + new Gson().toJson(form));
- form.setCreatetime(new Date().getTime());
- form.setRank(0);
- String openId = form.getLoginType() == Constant.TAOBAO ? form.getOpenid() : form.getWxUnionId();
- UserInfo find = getUserByLoginTypeAndOpenId(form.getLoginType(), openId, Constant.APPID);
- if (find != null) {
- return find;
- }
- boolean create = createUser(form, appid);
- if (!create) {
- return null;
- }
- int loginType = form.getLoginType();
- // 寤虹殑鍋囩敤鎴枫�傘��
- if (loginType == -1) {
- return form;
- }
+ form.setId(id);
+ form.setSystem(sysetm);
+ userInfoMapper.insertSelective(form);
+ return true;
+ }
- LogHelper.userInfo("娣诲姞鐢ㄦ埛:" + form);
- if (form.getLoginType() == Constant.WEIXIN) {
- ThreadUtil.run(new Runnable() {
- public void run() {
- UserInfo temp = userInfoMapper.selectByPrimaryKey(form.getId());
- COSManager cosManager = COSManager.getInstance();
- InputStream inputStream = HttpUtil.getAsInputStream(temp.getPortrait());
- String uploadFile = cosManager.uploadFile(inputStream, UUID.randomUUID().toString()).getUrl();
- UserInfo updateTemp = new UserInfo(temp.getId());
- updateTemp.setPortrait(uploadFile);
- userInfoMapper.updateByPrimaryKeySelective(updateTemp);
- }
- });
- }
- } catch (Exception e) {
- try {
- LogHelper.errorDetailInfo(e);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- return null;
- }
- return form;
- }
+ public UserInfo getUserById(long uid) {
+ UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
+ if (user.getState() != null && user.getState() != UserInfo.STATE_NORMAL)
+ return null;
+ if (user != null) {
+ user.setRankIcon(UserUtil.getRankIcon(user.getRank()));
+ user.setRankNamePicture(UserUtil.getRankNamePicture(user.getRank()));
+ }
+ return user;
+ }
- public boolean createUser(UserInfo form, String appid) {
+ @Transactional
+ public void update(UserInfo user) {
+ userInfoMapper.updateByPrimaryKeySelective(user);
+ }
- long maxUid = userInfoMapper.getMaxUid();
+ public long getUserCount() {
+ return userInfoMapper.countAvaiableUser();
+ }
- long dd = (long) (Math.random() * 100);
- if (dd == 0) {
- dd = 1;
- }
- long bid = maxUid;
- long id = bid + dd;
- form.setId(id);
- form.setAppId(appid);
- userInfoMapper.insertSelective(form);
- return true;
- }
+ @Transactional
+ public void unBindUserInfo(UserInfo user, int type) {
+ if (type == Constant.TAOBAO) {
+ user.setOpenid("");
+ user.setTbName("");
+ user.setTbPic("");
+ if (!StringUtil.isNullOrEmpty(user.getWxOpenId())) {
+ user.setLoginType(Constant.WEIXIN);
+ user.setNickName(user.getWxName());
+ user.setPortrait(user.getWxPic());
+ }
+ } else if (type == Constant.WEIXIN) {
+ user.setWxName("");
+ user.setWxOpenId("");
+ user.setWxUnionId("");
+ user.setWxPic("");
+ if (!StringUtil.isNullOrEmpty(user.getOpenid())) {
+ user.setLoginType(Constant.TAOBAO);
+ user.setNickName(user.getTbName());
+ user.setPortrait(user.getTbPic());
+ }
+ }
+ userInfoMapper.updateByPrimaryKeySelective(user);
+ }
- public UserInfo getUserById(long uid) {
- UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
- if (user.getState() != null && user.getState() != UserInfo.STATE_NORMAL)
- return null;
- if (user != null) {
- user.setRankIcon(UserUtil.getRankIcon(user.getRank()));
- user.setRankNamePicture(UserUtil.getRankNamePicture(user.getRank()));
- }
- return user;
- }
+ @Transactional
+ public void addMoney(UserInfo userInfo, BigDecimal money) {
+ userInfoMapper.addHongBaoByUid(userInfo.getId(), money);
+ }
- @Transactional
- public void update(UserInfo user) {
- userInfoMapper.updateByPrimaryKeySelective(user);
- }
+ @Override
+ public void updateLoginInfo(UserInfo user) {
+ UserInfo update = new UserInfo(user.getId());
+ update.setLastLoginIp(user.getLastLoginIp());
+ update.setLastLoginTime(user.getLastLoginTime());
+ userInfoMapper.updateByPrimaryKeySelective(update);
+ }
- public long getUserCount() {
- return userInfoMapper.countAvaiableUser();
- }
+ @Override
+ public void cleanPassword(long id) {
+ userInfoMapper.cleanPassword(id);
+ }
- @Transactional
- public boolean inviteWXUserInfo(String code, UserInfo inviter) {
- WeiXinUser weiXinUser = WXLoginUtil.getWeiXinWYUser(code);
- if (weiXinUser == null) {
- return false;
- }
- String wxUnionId = weiXinUser.getUnionid();
- UserInfo find = getUserByLoginTypeAndOpenId(Constant.WEIXIN, wxUnionId, Constant.APPID);
+ @Override
+ public BigDecimal getNewPeopleHB(Long id) {
+ return userInfoMapper.getNewPeopleHB(id);
+ }
- if (find == null) {
- find = new UserInfo();
- find.setAppId(Constant.APPID);
- find.setWxUnionId(weiXinUser.getUnionid());
- String wxHeadImg = COSManager.getInstance()
- .uploadFile(HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
- Constant.WXHEADURL + UUID.randomUUID().toString())
- .getUrl();
- find.setPortrait(wxHeadImg);
- find.setWxPic(wxHeadImg);
- find.setNickName(weiXinUser.getNickname());
- find.setWxName(weiXinUser.getNickname());
- find.setLoginType(Constant.WEIXIN);
- find.setRank(0);
- find.setWxOpenId(weiXinUser.getOpenid());
- BusinessSystem system = new BusinessSystem(Constant.FANLI);
- system.setPlatform(1);
- find.setSystem(system);
- }
+ @Override
+ public UserInfo getUserByIdWithMybatis(long uid) {
+ UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
+ return UserUtil.filterForClientUser(user);
+ }
- try {
- threeSaleSerivce.bind(find, inviter);
- return true;
- } catch (ThreeSaleException e) {
- e.printStackTrace();
- return false;
- }
- }
- @Transactional
- public void unBindUserInfo(UserInfo user, int type) {
- if (type == Constant.TAOBAO) {
- user.setOpenid("");
- user.setTbName("");
- user.setTbPic("");
- if (!StringUtil.isNullOrEmpty(user.getWxOpenId())) {
- user.setLoginType(Constant.WEIXIN);
- user.setNickName(user.getWxName());
- user.setPortrait(user.getWxPic());
- }
- } else if (type == Constant.WEIXIN) {
- user.setWxName("");
- user.setWxOpenId("");
- user.setWxUnionId("");
- user.setWxPic("");
- if (!StringUtil.isNullOrEmpty(user.getOpenid())) {
- user.setLoginType(Constant.TAOBAO);
- user.setNickName(user.getTbName());
- user.setPortrait(user.getTbPic());
- }
- }
- userInfoMapper.updateByPrimaryKeySelective(user);
- }
+ @Override
+ public long countInfo(Integer userState, String key, Integer keyType, String userRank, Integer days,
+ String startTime, String endTime, Integer userType, String level, Integer activeCode,SystemEnum system) {
+ return userInfoMapper.countInfo(userState, key, keyType, userRank, days, startTime, endTime, userType, level, activeCode,system);
+ }
- @Transactional
- public void addMoney(UserInfo userInfo, BigDecimal money) {
- userInfoMapper.addHongBaoByUid(userInfo.getId(), money);
- }
+ @Override
+ public List<UserInfoVO> queryInfo(long start, int count, Integer userState, String key, Integer keyType,
+ String userRank, Integer days, String startTime, String endTime, Integer userType, String level, Integer activeCode,SystemEnum system) {
- @Override
- public void updateLoginInfo(UserInfo user) {
- UserInfo update = new UserInfo(user.getId());
- update.setLastLoginIp(user.getLastLoginIp());
- update.setLastLoginTime(user.getLastLoginTime());
- userInfoMapper.updateByPrimaryKeySelective(update);
- }
+ List<UserInfoVO> userList = userInfoMapper.queryInfo(start, count, userState, key, keyType, userRank, days,
+ startTime, endTime, userType, level, activeCode,system);
- @Override
- public void cleanPassword(long id) {
- userInfoMapper.cleanPassword(id);
- }
+ if (userList == null || userList.size() == 0) {
+ return null;
+ }
- @Override
- public BigDecimal getNewPeopleHB(Long id) {
- return userInfoMapper.getNewPeopleHB(id);
- }
+ for (UserInfoVO userInfoVO : userList) {
+ Long uid = userInfoVO.getId();
+ String rankName = userInfoVO.getRankName();
+ if (rankName == null || rankName.trim().length() == 0) {
+ userInfoVO.setRankName("闈掗摐");
+ userInfoVO.setRankPicture("http://img.flqapp.com/resource/rank/rank_picture_new_1.png");
+ }
- @Override
- public UserInfo getUserByIdWithMybatis(long uid) {
- UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
- return UserUtil.filterForClientUser(user);
- }
+ String userLevel = userInfoVO.getUserLevel();
+ if (!StringUtil.isNullOrEmpty(userLevel)) {
+ userInfoVO.setUserLevel(UserLevelUtil.getByEnumName(userLevel).getName());
+ }
+ // 绱鎻愮幇
+ userInfoVO.setTotalExtract(payInfoMapper.sumMoneyByUid(uid));
- @Override
- public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
- String startTime, String endTime) {
- return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime);
- }
+ // 绱璁㈠崟鏁伴噺
+ userInfoVO.setTotalOrder(commonOrderCountService.countHistoryOrderNum(uid));
- @Override
- public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
- String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode) {
+ // 绱鍏戞崲閲戝竵
+ userInfoVO.setTotalGoldCoinUsed(Math.abs(integralDetailService.sumUseGoldCoin(uid)));
- List<UserInfoVO> userList = userInfoMapper.query(start, count, userState, key, keyType, userRank, days,
- startTime, endTime, orderField, orderMode);
+ // 閭�璇蜂汉
+ UserInfo boss = threeSaleSerivce.getBoss(uid);
+ if (boss == null) {
+ userInfoVO.setBossName("");
+ } else {
+ userInfoVO.setBossName("閭�璇蜂汉锛�" + boss.getNickName());
+ }
+
+ // 寰俊鍙�
+ String wxId = userInfoVO.getWxId();
+ if (StringUtil.isNullOrEmpty(wxId)) {
+ userInfoVO.setWxId("");
+ } else {
+ userInfoVO.setWxId("寰俊鍙�:" + wxId);
+ }
+ }
+
+ return userList;
+ }
+
+ @Override
+ public List<UserInfo> listBySystemAndWXUnionId(SystemEnum system, String unionId) {
+ return userInfoMapper.listBySystemAndWXUnionId(system, unionId);
+ }
+
+ @Override
+ public List<UserInfo> listBySystemAndTaoBaoOpenId(SystemEnum system, String openId) {
+ return userInfoMapper.listBySystemAndTaoBaoOpenId(system, openId);
+ }
+
+ @Override
+ public List<UserInfo> listBySystemAndPhone(SystemEnum system, String phone) {
+ return userInfoMapper.listBySystemAndPhone(system, phone);
+ }
+
+ @Override
+ public SystemEnum getUserSystem(Long uid) {
+ String value = redisManager.getCommonString(RedisKeyEnum.getRedisKey(RedisKeyEnum.userSystem, uid + ""));
+ if (!StringUtil.isNullOrEmpty(value)) {
+ return SystemEnum.valueOf(value);
+ }
+ UserInfo user = selectByPKey(uid);
+ if (user != null) {
+ //淇濆瓨1澶�
+ redisManager.cacheCommonString(RedisKeyEnum.getRedisKey(RedisKeyEnum.userSystem, uid + ""), user.getSystem().name(), 60 * 60 * 24);
+ return user.getSystem();
+ }
+ return null;
+ }
+
+
+ @Override
+ public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
+ String startTime, String endTime, Integer userType, String level, Integer activeCode,SystemEnum system) {
+ return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime, userType, level, activeCode,system);
+ }
+
+ @Override
+ public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
+ String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,
+ Integer userType, String level, Integer activeCode,SystemEnum system) {
+
+ List<UserInfoVO> userList = userInfoMapper.query(start, count, userState, key, keyType, userRank, days,
+ startTime, endTime, orderField, orderMode, userType, level, activeCode,system);
+
+ if (userList == null || userList.size() == 0) {
+ return null;
+ }
+
+ for (UserInfoVO userInfoVO : userList) {
+ // 鏁版嵁鍔犲伐澶勭悊
+ convertUserInfoVOData(userInfoVO);
+ }
+
+ return userList;
+ }
+
+ public void convertUserInfoVOData(UserInfoVO userInfoVO) {
+ String rankName = userInfoVO.getRankName();
+ if (rankName == null || rankName.trim().length() == 0) {
+ userInfoVO.setRankName("闈掗摐");
+ userInfoVO.setRankPicture("http://img.flqapp.com/resource/rank/rank_picture_new_1.png");
+ }
+
+ String f_alipayAccount = userInfoVO.getAlipayAccountInvalid();
+ if (f_alipayAccount != null && f_alipayAccount.trim().length() > 0) {
+ userInfoVO.setAlipayAccountState(1);
+ }
+
+ String f_phone = userInfoVO.getPhoneInvalid();
+ if (f_phone != null && f_phone.trim().length() > 0) {
+ userInfoVO.setPhoneState(1);
+ }
+
+ String f_taobaoUid = userInfoVO.getTaobaoUidInvalid();
+ if (f_taobaoUid != null && f_taobaoUid.trim().length() > 0) {
+ userInfoVO.setTaobaoUidState(1);
+ }
+
+ String f_wxUnionId = userInfoVO.getWxUnionIdInvalid();
+ if (f_wxUnionId != null && f_wxUnionId.trim().length() > 0) {
+ userInfoVO.setWxUnionIdState(1);
+ }
+
+ // 鏈�杩戠櫥褰曟椂闂�
+ Long lastLoginTime = userInfoVO.getLastLoginTime();
+ if (lastLoginTime != null && lastLoginTime == 0) {
+ userInfoVO.setLastLoginTime(null);
+ }
- if (userList == null || userList.size() == 0) {
- return null;
- }
+ // 鏄剧ず鐢ㄦ埛寰俊 娣樺疂 鑰佺増鏈瓨鍦�
+ String wxUnionId = userInfoVO.getWxUnionId();
+ if (wxUnionId == null || wxUnionId.trim().length() == 0) {
+ userInfoVO.setWxName(null);
+ }
- for (UserInfoVO userInfoVO : userList) {
- // 鏁版嵁鍔犲伐澶勭悊
- convertUserInfoVOData(userInfoVO);
- }
+ // 鏄惁缁戝畾鏀粯瀹濓紙璐拱 + 鍒嗕韩鏉冮檺锛�
+ String taoBaoUid = userInfoVO.getTaoBaoUid();
+ String tbSpecialId = userInfoVO.getTbSpecialId();
+ String tbRelationId = userInfoVO.getTbRelationId();
+ if (StringUtil.isNullOrEmpty(taoBaoUid) || StringUtil.isNullOrEmpty(tbSpecialId)
+ || StringUtil.isNullOrEmpty(tbRelationId)) {
+ userInfoVO.setTbName(null);
+ userInfoVO.setTaoBaoUid(null);
+ }
- return userList;
- }
+ Long uid = userInfoVO.getId();
+ /* 缁戝畾鏀舵璐﹀彿淇℃伅 */
+ List<BindingAccount> account = bindingAccountMapper.selectByUid(uid);
+ if (account != null && account.size() > 0) {
+ BindingAccount bindingAccount = account.get(0);
+ Integer type = bindingAccount.getType();
+ if (type != null && type == 1) {
+ // 鏀粯瀹�
+ userInfoVO.setAccountAlipay(bindingAccount.getAccount());
+ userInfoVO.setAccountName(bindingAccount.getName());
+ userInfoVO.setAccountBindId(bindingAccount.getId());
- public void convertUserInfoVOData(UserInfoVO userInfoVO) {
- String rankName = userInfoVO.getRankName();
- if (rankName == null || rankName.trim().length() == 0) {
- userInfoVO.setRankName("闈掗摐");
- userInfoVO.setRankPicture("http://img.flqapp.com/resource/rank/rank_picture_new_1.png");
- }
+ } else if (type != null && type == 2) {
+ // 寰俊
+ userInfoVO.setAccountWX(bindingAccount.getAccount());
+ userInfoVO.setAccountNameWX(bindingAccount.getName());
+ userInfoVO.setAccountBindIdWX(bindingAccount.getId());
+ }
+ }
- String f_alipayAccount = userInfoVO.getAlipayAccountInvalid();
- if (f_alipayAccount != null && f_alipayAccount.trim().length() > 0) {
- userInfoVO.setAlipayAccountState(1);
- }
+ // 鏈�杩戜竴娆′笅鍗曟椂闂�
+ Date lastOrderTime = hongBaoV2CountService.getLastHongBaoTime(uid);
+ if (lastOrderTime != null && lastOrderTime.getTime() != 0) {
+ userInfoVO.setLastOrderTime(lastOrderTime.getTime());
+ }
- String f_phone = userInfoVO.getPhoneInvalid();
- if (f_phone != null && f_phone.trim().length() > 0) {
- userInfoVO.setPhoneState(1);
- }
+ // 浠婃棩鎬昏鍗�
+ long todayOrder = hongBaoV2CountService.countValidNumberByUid(uid, 1);
+ userInfoVO.setTodayOrder(todayOrder);
- String f_taobaoUid = userInfoVO.getTaobaoUidInvalid();
- if (f_taobaoUid != null && f_taobaoUid.trim().length() > 0) {
- userInfoVO.setTaobaoUidState(1);
- }
+ // 鏈鍙栫孩鍖� 寰呭叆璐﹂噾棰�
+ BigDecimal unaccountedMoney = hongBaoV2CountService.countWillGetMoneyByUid(uid);
+ if (unaccountedMoney == null) {
+ unaccountedMoney = new BigDecimal(0);
+ }
+ userInfoVO.setUnaccountedMoney(unaccountedMoney.toString());
- String f_wxUnionId = userInfoVO.getWxUnionIdInvalid();
- if (f_wxUnionId != null && f_wxUnionId.trim().length() > 0) {
- userInfoVO.setWxUnionIdState(1);
- }
+ // 鍘嗗彶鎬绘敹鐩�
+ BigDecimal totalMoneyHistory = hongBaoV2CountService.countMoneyByUidAndState(uid, 3);
+ if (totalMoneyHistory == null) {
+ totalMoneyHistory = new BigDecimal(0);
+ }
+ userInfoVO.setTotalMoneyHistory(totalMoneyHistory.toString());
- // 鏈�杩戠櫥褰曟椂闂�
- Long lastLoginTime = userInfoVO.getLastLoginTime();
- if (lastLoginTime != null && lastLoginTime == 0) {
- userInfoVO.setLastLoginTime(null);
- }
+ // 鏀粯瀹濊处鍙� 绱杞处鎬婚噾棰�
+ double totalMoney = payInfoMapper.sumMoneyByUid(uid);
+ userInfoVO.setTotalMoney(totalMoney);
- // 鏄剧ず鐢ㄦ埛寰俊 娣樺疂 鑰佺増鏈瓨鍦�
- String wxUnionId = userInfoVO.getWxUnionId();
- if (wxUnionId == null || wxUnionId.trim().length() == 0) {
- userInfoVO.setWxName(null);
- }
+ // 绱鎻愮幇 (鏆傛湭璁″叆寰俊)
+ userInfoVO.setTotalExtract(totalMoney);
- // 鏄惁缁戝畾鏀粯瀹濓紙璐拱 + 鍒嗕韩鏉冮檺锛�
- String taoBaoUid = userInfoVO.getTaoBaoUid();
- String tbSpecialId = userInfoVO.getTbSpecialId();
- String tbRelationId = userInfoVO.getTbRelationId();
- if (StringUtil.isNullOrEmpty(taoBaoUid) || StringUtil.isNullOrEmpty(tbSpecialId)
- || StringUtil.isNullOrEmpty(tbRelationId)) {
- userInfoVO.setTbName(null);
- userInfoVO.setTaoBaoUid(null);
- }
+ // 缁熻鍒嗕韩涓暟
+ long countUserShares = userShareGoodsHistoryMapper.countUserShares(uid);
+ userInfoVO.setCountUserShares(countUserShares);
- Long uid = userInfoVO.getId();
- /* 缁戝畾鏀舵璐﹀彿淇℃伅 */
- List<BindingAccount> account = bindingAccountMapper.selectByUid(uid);
- if (account != null && account.size() > 0) {
- BindingAccount bindingAccount = account.get(0);
- Integer type = bindingAccount.getType();
- if (type != null && type == 1) {
- // 鏀粯瀹�
- userInfoVO.setAccountAlipay(bindingAccount.getAccount());
- userInfoVO.setAccountName(bindingAccount.getName());
- userInfoVO.setAccountBindId(bindingAccount.getId());
+ // 缁熻娴忚瓒宠抗
+ long countScanHistory = scanHistoryMapper.countUserScanHistory(uid);
+ userInfoVO.setCountScanHistory(countScanHistory);
- } else if (type != null && type == 2) {
- // 寰俊
- userInfoVO.setAccountWX(bindingAccount.getAccount());
- userInfoVO.setAccountNameWX(bindingAccount.getName());
- userInfoVO.setAccountBindIdWX(bindingAccount.getId());
- }
- }
+ // 涓�搴﹂槦鍛樻暟閲�
+ //int firstTeamCount = shareMapper.myFirstTeamCount(uid + "");
+ //userInfoVO.setCountLevelOne(firstTeamCount);
- // 鏈�杩戜竴娆′笅鍗曟椂闂�
- Date lastOrderTime = hongBaoV2CountService.getLastHongBaoTime(uid);
- if (lastOrderTime != null && lastOrderTime.getTime() != 0) {
- userInfoVO.setLastOrderTime(lastOrderTime.getTime());
- }
+ // 浜屽害闃熷憳鏁伴噺
+ //int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
+ //userInfoVO.setCountLevelTwo(secondTeamCount);
- // 浠婃棩鎬昏鍗�
- long todayOrder = hongBaoV2CountService.countValidNumberByUid(uid, 1);
- userInfoVO.setTodayOrder(todayOrder);
+ String userLevel = userInfoVO.getUserLevel();
+ if (!StringUtil.isNullOrEmpty(userLevel)) {
+ userInfoVO.setUserLevel(UserLevelUtil.getByEnumName(userLevel).getName());
+ }
- // 鏈鍙栫孩鍖� 寰呭叆璐﹂噾棰�
- BigDecimal unaccountedMoney = hongBaoV2CountService.countWillGetMoneyByUid(uid);
- if (unaccountedMoney == null) {
- unaccountedMoney = new BigDecimal(0);
- }
- userInfoVO.setUnaccountedMoney(unaccountedMoney.toString());
+ String inviteCode = userInfoVO.getInviteCode();
+ if (!StringUtil.isNullOrEmpty(inviteCode)) {
+ userInfoVO.setInviteCode("宸叉縺娲�");
+ } else {
+ userInfoVO.setInviteCode("鏈縺娲�");
+ }
+ }
- // 鍘嗗彶鎬绘敹鐩�
- BigDecimal totalMoneyHistory = hongBaoV2CountService.countMoneyByUidAndState(uid, 3);
- if (totalMoneyHistory == null) {
- totalMoneyHistory = new BigDecimal(0);
- }
- userInfoVO.setTotalMoneyHistory(totalMoneyHistory.toString());
+ @Override
+ public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime) {
+ return userInfoMapper.querySumMoney(key, userType, days, startTime, endTime);
+ }
- // 鏀粯瀹濊处鍙� 绱杞处鎬婚噾棰�
- double totalMoney = payInfoMapper.sumMoneyByUid(uid);
- userInfoVO.setTotalMoney(totalMoney);
+ @Override
+ public UserInfo selectByPKey(Long id) {
+ return userInfoMapper.selectByPrimaryKey(id);
+ }
- // 绱鎻愮幇 (鏆傛湭璁″叆寰俊)
- userInfoVO.setTotalExtract(totalMoney);
+ @Override
+ public int updateByPrimaryKeySelective(UserInfo record) {
+ return userInfoMapper.updateByPrimaryKeySelective(record);
+ }
- // 缁熻鍒嗕韩涓暟
- long countUserShares = userShareGoodsHistoryMapper.countUserShares(uid);
- userInfoVO.setCountUserShares(countUserShares);
+ @Override
+ @Transactional
+ public void deleteBindInfo(UserInfo user, int type) {
+ if (type == 1) {
+ user.setOpenid("");
+ user.setTbName("");
+ user.setTbPic("");
+ if (!StringUtil.isNullOrEmpty(user.getWxOpenId())) {
+ user.setLoginType(Constant.WEIXIN);
+ user.setNickName(user.getWxName());
+ user.setPortrait(user.getWxPic());
+ }
+ } else if (type == 2) {
+ user.setWxName("");
+ user.setWxOpenId("");
+ user.setWxUnionId("");
+ user.setWxPic("");
+ if (!StringUtil.isNullOrEmpty(user.getOpenid())) {
+ user.setLoginType(Constant.TAOBAO);
+ user.setNickName(user.getTbName());
+ user.setPortrait(user.getTbPic());
+ }
+ } else if (type == 3) {
+ user.setPhone("");
+ }
- // 缁熻娴忚瓒宠抗
- long countScanHistory = scanHistoryMapper.countUserScanHistory(uid);
- userInfoVO.setCountScanHistory(countScanHistory);
+ userInfoMapper.updateByPrimaryKeySelective(user);
+ }
- // 涓�搴﹂槦鍛樻暟閲�
- int firstTeamCount = shareMapper.myFirstTeamCount(uid + "");
- userInfoVO.setCountLevelOne(firstTeamCount);
+ @Override
+ public List<Long> longTimeNoLogin(int daysNum, List<Long> list) {
+ return userInfoMapper.longTimeNoLogin(daysNum, list);
+ }
- // 浜屽害闃熷憳鏁伴噺
- int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
- userInfoVO.setCountLevelTwo(secondTeamCount);
- }
+ /**
+ * 鏍规嵁鐢佃瘽鍙风爜銆侀個璇风爜鑾峰彇閭�璇风敤鎴�
+ *
+ * @param inviteCode
+ * @return
+ */
+ @Override
+ public UserInfo getUserInfoByInviteCode(String inviteCode) {
+ return userInfoMapper.getUserInfoByInviteCode(inviteCode);
+ }
- @Override
- public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime) {
- return userInfoMapper.querySumMoney(key, userType, days, startTime, endTime);
- }
+ @Override
+ public UserInfo getEffectiveUserInfoByPhone(String phone, SystemEnum system) {
+ return userInfoMapper.getEffectiveUserInfoByPhone(phone, system);
+ }
- @Override
- public UserInfo selectByPKey(Long id) {
- return userInfoMapper.selectByPrimaryKey(id);
- }
+ @Override
+ public UserInfo getEffectiveUserInfoByWXUnionId(String unionId, SystemEnum system) {
+ return userInfoMapper.getEffectiveUserInfoByWXUnionId(unionId, system);
+ }
- @Override
- public int updateByPrimaryKeySelective(UserInfo record) {
- return userInfoMapper.updateByPrimaryKeySelective(record);
- }
+ @Override
+ public UserInfo getEffectiveUserInfoByOpenId(String openId, SystemEnum sysetm) {
+ return userInfoMapper.getEffectiveUserInfoByOpenId(openId,sysetm);
+ }
- @Override
- @Transactional
- public void deleteBindInfo(UserInfo user, int type) {
- if (type == 1) {
- user.setOpenid("");
- user.setTbName("");
- user.setTbPic("");
- if (!StringUtil.isNullOrEmpty(user.getWxOpenId())) {
- user.setLoginType(Constant.WEIXIN);
- user.setNickName(user.getWxName());
- user.setPortrait(user.getWxPic());
- }
- } else if (type == 2) {
- user.setWxName("");
- user.setWxOpenId("");
- user.setWxUnionId("");
- user.setWxPic("");
- if (!StringUtil.isNullOrEmpty(user.getOpenid())) {
- user.setLoginType(Constant.TAOBAO);
- user.setNickName(user.getTbName());
- user.setPortrait(user.getTbPic());
- }
- } else if (type == 3) {
- user.setPhone("");
- }
+ @Override
+ public UserInfo getUserInfo(Long uid) throws UserInfoException {
+ if (uid == null) {
+ throw new UserInfoException(1, "璇锋眰鍙傛暟涓虹┖");
+ }
- userInfoMapper.updateByPrimaryKeySelective(user);
- }
+ UserInfo userInfo = userInfoMapper.selectByPrimaryKey(uid);
+ if (userInfo == null) {
+ throw new UserInfoException(1, "鐢ㄦ埛涓嶅瓨鍦�");
+ }
- @Override
- public List<Long> longTimeNoLogin(int daysNum, List<Long> list) {
- return userInfoMapper.longTimeNoLogin(daysNum, list);
- }
+ if (userInfo.getState() == UserInfo.STATE_FORBIDDEN) {
+ throw new UserInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
+ }
- /**
- * 鏍规嵁鐢佃瘽鍙风爜銆侀個璇风爜鑾峰彇閭�璇风敤鎴�
- *
- * @param phone
- * @param inviteCode
- * @return
- */
- @Override
- public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode) {
- return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
- }
+ if (userInfo.getState() == UserInfo.STATE_DELETE || userInfo.getState() == UserInfo.STATE_DELETE_OUT_OF_DATE) {
+ throw new UserInfoException(Constant.CODE_FORBIDDEN_USER, "甯愭埛宸茶鍒犻櫎锛岃閲嶆柊鐧诲綍");
+ }
- @Override
- public UserInfo getEffectiveUserInfoByPhone(String phone) {
- return userInfoMapper.getEffectiveUserInfoByPhone(phone);
- }
+ // 娣樺疂鏄电О 缁勭粐
+ boolean clearOpenid = true;
+ UserExtraTaoBaoInfo extraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
+ if (extraTaoBaoInfo != null) {
+ String specialId = extraTaoBaoInfo.getSpecialId();
+ String relationId = extraTaoBaoInfo.getRelationId();
+ String taoBaoNickName = extraTaoBaoInfo.getTaoBaoNickName();
- @Override
- public UserInfo getEffectiveUserInfoByWXUnionId(String unionId) {
- return userInfoMapper.getEffectiveUserInfoByWXUnionId(unionId);
- }
+ if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) {
+ clearOpenid = false;
+ userInfo.setOpenid(extraTaoBaoInfo.getTaoBaoUid());
- @Override
- public UserInfo getUserInfo(Long uid) throws UserInfoException {
- if (uid == null) {
- throw new UserInfoException(1, "璇锋眰鍙傛暟涓虹┖");
- }
+ if (!StringUtil.isNullOrEmpty(taoBaoNickName)) {
+ userInfo.setTbName(taoBaoNickName);
+ } else {
+ String taoBaoUserNick = taoBaoUnionAuthRecordService.getTaoBaoUserNick(uid);
+ if (!StringUtil.isNullOrEmpty(taoBaoUserNick)) {
+ userInfo.setTbName(taoBaoUserNick);
+ }
+ }
+ }
+ }
- UserInfo userInfo = userInfoMapper.selectByPrimaryKey(uid);
- if (userInfo == null) {
- throw new UserInfoException(1, "鐢ㄦ埛涓嶅瓨鍦�");
- }
+ if (clearOpenid) {
+ userInfo.setOpenid(null);
+ }
- if (userInfo.getState() == UserInfo.STATE_FORBIDDEN) {
- throw new UserInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
- }
+ return userInfo;
+ }
- if (userInfo.getState() == UserInfo.STATE_DELETE || userInfo.getState() == UserInfo.STATE_DELETE_OUT_OF_DATE) {
- throw new UserInfoException(Constant.CODE_FORBIDDEN_USER, "甯愭埛宸茶鍒犻櫎锛岃閲嶆柊鐧诲綍");
- }
+ @Override
+ public BigDecimal getBalance(Long uid) {
+ UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
+ if (user != null)
+ return user.getMyHongBao();
+ return null;
+ }
- // 娣樺疂鏄电О 缁勭粐
- boolean clearOpenid = true;
- UserExtraTaoBaoInfo extraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
- if (extraTaoBaoInfo != null) {
- String specialId = extraTaoBaoInfo.getSpecialId();
- String relationId = extraTaoBaoInfo.getRelationId();
- String taoBaoNickName = extraTaoBaoInfo.getTaoBaoNickName();
+ @Override
+ public void uploadPortrait(MultipartFile file, Long uid) throws UserInfoException, IOException {
- if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) {
- clearOpenid = false;
- userInfo.setOpenid(extraTaoBaoInfo.getTaoBaoUid());
+ UserInfo userInfo = userInfoMapper.selectByPrimaryKey(uid);
+ if (userInfo == null) {
+ throw new UserInfoException(1, "鐢ㄦ埛涓嶅瓨鍦�");
+ }
- if (!StringUtil.isNullOrEmpty(taoBaoNickName)) {
- userInfo.setTbName(taoBaoNickName);
- } else {
- String taoBaoUserNick = taoBaoUnionAuthRecordService.getTaoBaoUserNick(uid);
- if (!StringUtil.isNullOrEmpty(taoBaoUserNick)) {
- userInfo.setTbName(taoBaoUserNick);
- }
- }
- }
- }
+ // 璋锋瓕鍘嬬缉鍥剧墖
+ String targetPath = FileUtil.getCacheDir() + "/uploadPortrait_" + uid + "_" + System.currentTimeMillis()
+ + ".jpg";
+ Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
- if (clearOpenid) {
- userInfo.setOpenid(null);
- }
+ // 鎵ц涓婁紶
+ String filePath = FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString().replace("-", "") + ".jpg";
+ String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
- return userInfo;
- }
+ // 鍒犻櫎鏈湴鍥剧墖
+ if (new File(targetPath).exists()) {
+ new File(targetPath).delete();
+ }
- @Override
- public BigDecimal getBalance(Long uid) {
- UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
- if (user != null)
- return user.getMyHongBao();
- return null;
- }
+ // 鍘熷ご鍍�
+ String portrait = userInfo.getPortrait();
- @Override
- public void uploadPortrait(MultipartFile file, Long uid) throws UserInfoException, IOException {
+ // 鏇存柊淇℃伅
+ userInfo.setPortrait(fileLink);
+ userInfoMapper.updateByPrimaryKeySelective(userInfo);
- UserInfo userInfo = userInfoMapper.selectByPrimaryKey(uid);
- if (userInfo == null) {
- throw new UserInfoException(1, "鐢ㄦ埛涓嶅瓨鍦�");
- }
+ // 鍒犻櫎鍘熷ご鍍�
+ if (!StringUtil.isNullOrEmpty(portrait)) {
+ COSManager.getInstance().deleteFile(portrait);
+ }
- // 璋锋瓕鍘嬬缉鍥剧墖
- String targetPath = FileUtil.getCacheDir() + "/uploadPortrait_" + uid + "_" + System.currentTimeMillis()
- + ".jpg";
- Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
+ userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.portrait, fileLink);
- // 鎵ц涓婁紶
- String filePath = "/img/user/" + UUID.randomUUID().toString().replace("-", "") + ".jpg";
- String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ // 鍒犻櫎鍒嗕韩澶村儚淇℃伅
+ spreadUserImgService.deleteImgUrl(uid);
+ } catch (Exception e) {
+ try {
+ LogHelper.errorDetailInfo(e);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ });
+ }
- // 鍒犻櫎鏈湴鍥剧墖
- if (new File(targetPath).exists()) {
- new File(targetPath).delete();
- }
+ @Override
+ public void saveUserInfo(String nickName, Long uid) throws UserInfoException {
+ UserInfo userInfo = userInfoMapper.selectByPrimaryKey(uid);
+ if (userInfo == null) {
+ throw new UserInfoException(1, "鐢ㄦ埛涓嶅瓨鍦�");
+ }
- // 鍘熷ご鍍�
- String portrait = userInfo.getPortrait();
+ userInfo.setNickName(nickName);
+ userInfoMapper.updateByPrimaryKeySelective(userInfo);
+ }
- // 鏇存柊淇℃伅
- userInfo.setPortrait(fileLink);
- userInfoMapper.updateByPrimaryKeySelective(userInfo);
+ @Override
+ public List<UserInfo> getAutoExtractUser(int start, int count, BigDecimal minSurplus, String beganDate,
+ String endDate) {
+ return userInfoMapper.getAutoExtractUser(start, count, minSurplus, beganDate, endDate);
+ }
- // 鍒犻櫎鍘熷ご鍍�
- if (!StringUtil.isNullOrEmpty(portrait) && portrait.contains("/img/user/")) {
- COSManager.getInstance().deleteFile(portrait);
- }
+ @Override
+ public List<UserInfo> listByType(int type, int page, int count) {
+ return userInfoMapper.listByType(type, (page - 1) * count, count);
+ }
- userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.portrait, fileLink);
+ @Override
+ public long countByType(int type) {
+ return userInfoMapper.countByType(type);
+ }
- executor.execute(new Runnable() {
- @Override
- public void run() {
- try {
- // 鍒犻櫎鍒嗕韩澶村儚淇℃伅
- spreadUserImgService.deleteImgUrl(uid);
- } catch (Exception e) {
- try {
- LogHelper.errorDetailInfo(e);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
- }
- });
- }
+ @Override
+ public List<UserInfo> getAutoExtractUserTo1212(int start, int count) {
+ return userInfoMapper.getAutoExtractUserTo1212(start, count);
+ }
- @Override
- public void saveUserInfo(String nickName, Long uid) throws UserInfoException {
- UserInfo userInfo = userInfoMapper.selectByPrimaryKey(uid);
- if (userInfo == null) {
- throw new UserInfoException(1, "鐢ㄦ埛涓嶅瓨鍦�");
- }
+ @Override
+ public UserInfo selectAvailableByPrimaryKey(Long uid) {
+ return userInfoMapper.selectAvailableByPrimaryKey(uid);
+ }
- userInfo.setNickName(nickName);
- userInfoMapper.updateByPrimaryKeySelective(userInfo);
- }
-
-
- @Override
- public List<Long> getAutoExtractUserIds(int start, int count, BigDecimal minSurplus) {
- return userInfoMapper.getAutoExtractUserIds(start, count, minSurplus);
- }
}
--
Gitblit v1.8.0