| | |
| | | import com.xinquan.common.security.service.TokenService; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.system.api.RemoteUserService; |
| | | import com.xinquan.system.api.domain.AppUser; |
| | | import com.xinquan.system.api.domain.CommissionRule; |
| | | import com.xinquan.system.api.model.LoginUser; |
| | | import com.xinquan.system.domain.CommonQuestion; |
| | |
| | | import com.xinquan.system.utils.ObsUploadUtil; |
| | | import com.xinquan.system.utils.QRCodeUtil; |
| | | import com.xinquan.system.utils.UUIDUtil; |
| | | import com.xinquan.user.api.feign.RemoteAppUserService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ByteArrayResource; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | private RemoteUserService remoteUserService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private RemoteAppUserService remoteAppUserService; |
| | | |
| | | @PostMapping("/getQrCode") |
| | | @ApiOperation(value = "获取客服微信二维码",tags = "获取客服微信二维码") |
| | | public R getQrCode() { |
| | |
| | | Long userId = loginUser.getUserid(); |
| | | String string = userId.toString(); |
| | | CommissionRule one = commissionRuleService.lambdaQuery().one(); |
| | | AppUser data = remoteAppUserService.getUserById(userId).getData(); |
| | | if (data!=null){ |
| | | if (StringUtils.hasLength(data.getQrCode())){ |
| | | one.setQrCode(data.getQrCode()); |
| | | remoteAppUserService.saveQrCode(data); |
| | | return R.ok(one); |
| | | } |
| | | }else{ |
| | | return R.tokenError("登录失效"); |
| | | } |
| | | HashMap<String, String> blueCode = new HashMap<>(); |
| | | blueCode.put("user_id", string); |
| | | System.err.println("APP推广活动页"+string); |
| | | |
| | | String blueS = "https://xq.xqzhihui.com/share/#/pages/register/register?userId="+string; |
| | | |
| | | MyQrCodeUtil.createCodeToFile(blueS); |
| | | BufferedImage blueImage = QRCodeUtil.createImage(blueS); |
| | | MultipartFile blueFile = convert(blueImage, new Date().getTime() + UUIDUtil.getRandomCode(3) + ".PNG"); |
| | | String s = ObsUploadUtil.obsUpload(blueFile); |
| | | one.setQrCode(s); |
| | | data.setQrCode(s); |
| | | remoteAppUserService.saveQrCode(data); |
| | | return R.ok(one); |
| | | } |
| | | |
| | |
| | | System.err.println("推广人id"+userId); |
| | | CommissionRule one = commissionRuleService.lambdaQuery().one(); |
| | | HashMap<String, String> blueCode = new HashMap<>(); |
| | | AppUser data = remoteAppUserService.getUserById(Long.valueOf(userId)).getData(); |
| | | if (data!=null){ |
| | | if (StringUtils.hasLength(data.getQrCode())){ |
| | | one.setQrCode(data.getQrCode()); |
| | | return R.ok(one); |
| | | } |
| | | }else{ |
| | | return R.tokenError("登录失效"); |
| | | } |
| | | blueCode.put("user_id", userId + ""); |
| | | String blueS = "https://xq.xqzhihui.com/share/#/pages/register/register?userId="+userId; |
| | | MyQrCodeUtil.createCodeToFile(blueS); |