| | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.core.web.domain.AjaxResult; |
| | | import com.xinquan.common.log.annotation.Log; |
| | | import com.xinquan.common.log.enums.BusinessType; |
| | | 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() { |
| | |
| | | } |
| | | @GetMapping("/updateKfCode") |
| | | @ApiOperation(value = "修改/新增客服微信", tags = "管理后台-常见问题") |
| | | @Log(title = "【常见问题】修改客服微信", businessType = BusinessType.UPDATE) |
| | | public R<CommonQuestion> updateKfCode(String customerServiceQrCode) { |
| | | CommonQuestion one = commonQuestionService.lambdaQuery() |
| | | .eq(CommonQuestion::getType, 2).one(); |
| | |
| | | } |
| | | @PostMapping("/addCommonQuestion") |
| | | @ApiOperation(value = "新增常见问题", tags = "管理后台-常见问题") |
| | | @Log(title = "【常见问题】新增常见问题", businessType = BusinessType.INSERT) |
| | | |
| | | public R addCommonQuestion(@RequestBody CommonQuestion homeBackgroundMusic) { |
| | | return R.ok(commonQuestionService.save(homeBackgroundMusic)); |
| | | } |
| | |
| | | } |
| | | @PostMapping("/updateCommonQuestion") |
| | | @ApiOperation(value = "修改常见问题", tags = "管理后台-常见问题") |
| | | @Log(title = "【常见问题】修改常见问题", businessType = BusinessType.UPDATE) |
| | | |
| | | public R updateCommonQuestion(@RequestBody CommonQuestion homeBackgroundMusic) { |
| | | return R.ok(commonQuestionService.updateById(homeBackgroundMusic)); |
| | | } |
| | | @PostMapping("/deleteCommonQuestion") |
| | | @ApiOperation(value = "批量删除", tags = "管理后台-常见问题") |
| | | @Log(title = "【常见问题】批量删除常见问题", businessType = BusinessType.DELETE) |
| | | public R deleteCommonQuestion(String ids) { |
| | | return R.ok(commonQuestionService.removeBatchByIds(Arrays.asList(ids.split(",")).stream().map(Long::valueOf).collect(Collectors.toList()))); |
| | | } |
| | |
| | | return R.tokenError("登录失效"); |
| | | } |
| | | 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", userId + ""); |
| | | String blueS = "http://113.45.158.158/share/#/pages/register/register?userId="+userId; |
| | | |
| | | 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); |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | HashMap<String, String> blueCode = new HashMap<>(); |
| | | blueCode.put("url", "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/apkAndroid.apk"); |
| | | String blueS = "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/apkAndroid.apk"; |
| | | MyQrCodeUtil.createCodeToFile(blueS); |
| | | BufferedImage blueImage = QRCodeUtil.createImage(blueS); |
| | | MultipartFile blueFile = convert(blueImage, new Date().getTime() + UUIDUtil.getRandomCode(3) + ".PNG"); |
| | | String s = ObsUploadUtil.obsUpload(blueFile); |
| | | System.err.println(s); |
| | | } |
| | | @PostMapping("/getCommissionRuleShare") |
| | | @ApiOperation(value = "推广活动页",tags = "H5分享") |
| | | public R<CommissionRule> getCommissionRuleShare(String userId) throws Exception { |
| | | 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 = "http://113.45.158.158/share/#/pages/register/register?userId="+userId; |
| | | String blueS = "https://xq.xqzhihui.com/share/#/pages/register/register?userId="+userId; |
| | | MyQrCodeUtil.createCodeToFile(blueS); |
| | | BufferedImage blueImage = QRCodeUtil.createImage(blueS); |
| | | MultipartFile blueFile = convert(blueImage, new Date().getTime() + UUIDUtil.getRandomCode(3) + ".PNG"); |