admin
2020-01-07 6fdcc0c26dd33e87a024a69ed635d9aedb59cad6
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
@@ -49,6 +49,7 @@
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.FilePathEnum;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.account.UserUtil;
@@ -169,7 +170,7 @@
                  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();
                  String uploadFile = cosManager.uploadFile(inputStream, FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString()).getUrl();
                  UserInfo updateTemp = new UserInfo(temp.getId());
                  updateTemp.setPortrait(uploadFile);
                  userInfoMapper.updateByPrimaryKeySelective(updateTemp);
@@ -239,7 +240,7 @@
         find.setWxUnionId(weiXinUser.getUnionid());
         String wxHeadImg = COSManager.getInstance()
               .uploadFile(HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
                     Constant.WXHEADURL + UUID.randomUUID().toString())
                     FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString())
               .getUrl();
         find.setPortrait(wxHeadImg);
         find.setWxPic(wxHeadImg);
@@ -318,16 +319,16 @@
   @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);
         String startTime, String endTime,Integer userType) {
      return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime,userType);
   }
   @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) {
         String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,Integer userType) {
      List<UserInfoVO> userList = userInfoMapper.query(start, count, userState, key, keyType, userRank, days,
            startTime, endTime, orderField, orderMode);
            startTime, endTime, orderField, orderMode,userType);
      if (userList == null || userList.size() == 0) {
         return null;
@@ -515,8 +516,8 @@
    * @return
    */
   @Override
   public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode) {
      return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
   public UserInfo getUserInfoByInviteCode(String inviteCode) {
      return userInfoMapper.getUserInfoByInviteCode(inviteCode);
   }
   @Override
@@ -600,7 +601,7 @@
      Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
      // 执行上传
      String filePath = "/img/user/" + UUID.randomUUID().toString().replace("-", "") + ".jpg";
      String filePath =FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString().replace("-", "") + ".jpg";
      String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
      // 删除本地图片
@@ -616,7 +617,7 @@
      userInfoMapper.updateByPrimaryKeySelective(userInfo);
      // 删除原头像
      if (!StringUtil.isNullOrEmpty(portrait) && portrait.contains("/img/user/")) {
      if (!StringUtil.isNullOrEmpty(portrait)) {
         COSManager.getInstance().deleteFile(portrait);
      }
@@ -671,4 +672,9 @@
      return userInfoMapper.getAutoExtractUserTo1212(start, count);
   }
   @Override
   public UserInfo selectAvailableByPrimaryKey(Long uid) {
      return userInfoMapper.selectAvailableByPrimaryKey(uid);
   }
}