| @@ -55,7 +55,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @Override | @Override | ||||
| public void run() { | public void run() { | ||||
| String param = merchant.getWeappScene(); | String param = merchant.getWeappScene(); | ||||
| ResultData resultData = qrCodeService.exportQrcode(null, null, merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情", true); | |||||
| ResultData resultData = qrCodeService.uploadQrcode(merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情"); | |||||
| Map<String, String> map = (Map) resultData.data; | Map<String, String> map = (Map) resultData.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -81,7 +81,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @Override | @Override | ||||
| public void run() { | public void run() { | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultData = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||||
| ResultData resultData = qrCodeService.uploadQrcode(couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| Map<String,String> map = (Map)resultData.data; | Map<String,String> map = (Map)resultData.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -124,7 +124,7 @@ public class WxAppinfoController extends BaseController { | |||||
| qrCodeService.exportQrcode(request, response, | qrCodeService.exportQrcode(request, response, | ||||
| getTenantId(), type, pageUrl, sceneParam, | getTenantId(), type, pageUrl, sceneParam, | ||||
| withText, text1, text2, | withText, text1, text2, | ||||
| name,false); | |||||
| name); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| throw new MallinkException(Result.ERROR, "下载异常"); | throw new MallinkException(Result.ERROR, "下载异常"); | ||||
| @@ -138,7 +138,7 @@ public class WxMerchantController extends BaseController { | |||||
| //加载二维码图片 | //加载二维码图片 | ||||
| String pageUrl = "pages/index/index"; | String pageUrl = "pages/index/index"; | ||||
| String param = "t:md:"+resultData.data; | String param = "t:md:"+resultData.data; | ||||
| ResultData resultQrCode = qrCodeService.exportQrcode(null,null,wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); | |||||
| ResultData resultQrCode = qrCodeService.uploadQrcode(wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情"); | |||||
| Map<String,String> map = (Map)resultQrCode.data; | Map<String,String> map = (Map)resultQrCode.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -86,7 +86,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| if(couponChannel!=null){ | if(couponChannel!=null){ | ||||
| String pageUrl = "pages/index/index"; | String pageUrl = "pages/index/index"; | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| Map<String,String> map = (Map)resultDataQ.data; | Map<String,String> map = (Map)resultDataQ.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller.market; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -62,13 +63,16 @@ public class WxFloatingLayerController extends BaseController { | |||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("/update") | |||||
| @PostMapping("/updateStatus") | |||||
| @SystemControllerLog(description = "id更新") | @SystemControllerLog(description = "id更新") | ||||
| public ResultData update(@RequestBody WxFloatingLayer wxFloatingLayer) { | |||||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::update"); | |||||
| public ResultData updateStatus(@RequestBody WxFloatingLayer wxFloatingLayer) { | |||||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::updateStatus"); | |||||
| if (wxFloatingLayer.getId() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | |||||
| } | |||||
| try { | try { | ||||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_TAKE_OFFF.getCode()); | wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_TAKE_OFFF.getCode()); | ||||
| return wxFloatingLayerService.saveOrUpdate(wxFloatingLayer); | |||||
| return wxFloatingLayerService.updateStatus(wxFloatingLayer); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.WxFloatingLayer; | |||||
| import com.iformall.service.WxCuserFloatingLayerService; | import com.iformall.service.WxCuserFloatingLayerService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -30,9 +31,11 @@ public class WxCuserFloatingLayerController extends BaseController { | |||||
| @AuthIgnore | @AuthIgnore | ||||
| @ApiOperation("获取浮层") | @ApiOperation("获取浮层") | ||||
| @GetMapping("/getFloatingLayer") | @GetMapping("/getFloatingLayer") | ||||
| @ApiImplicitParam(name = "openId", value = "openId", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData getAppIcon(String openId) { | |||||
| WxFloatingLayer wxFloatingLayer = wxCuserFloatingLayerService.getFloatingLayer(openId); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "openId", value = "openId", dataType = "String", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true)}) | |||||
| public ResultData getAppIcon(String openId, String appId) { | |||||
| WxFloatingLayer wxFloatingLayer = wxCuserFloatingLayerService.getFloatingLayer(openId, appId); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer); | return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer); | ||||
| } | } | ||||
| @@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMallBuilding") | |||||
| @RequestMapping("/api/wxMallBuilding") | |||||
| public class WxMallBuildingController extends BaseController { | public class WxMallBuildingController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @@ -18,6 +18,9 @@ public interface QrCodeService { | |||||
| ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | ||||
| String tenantId, int type, String pageUrl, String sceneParam, | String tenantId, int type, String pageUrl, String sceneParam, | ||||
| int withText, String text1, String text2, | int withText, String text1, String text2, | ||||
| String name, boolean upload); | |||||
| String name); | |||||
| ResultData uploadQrcode(String tenantId, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | |||||
| String name); | |||||
| ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId); | ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId); | ||||
| } | } | ||||
| @@ -7,6 +7,6 @@ import com.iformall.domain.po.WxFloatingLayer; | |||||
| */ | */ | ||||
| public interface WxCuserFloatingLayerService { | public interface WxCuserFloatingLayerService { | ||||
| WxFloatingLayer getFloatingLayer(String openId); | |||||
| WxFloatingLayer getFloatingLayer(String openId, String appId); | |||||
| } | } | ||||
| @@ -36,4 +36,6 @@ public interface WxFloatingLayerService { | |||||
| ResultData saveOrUpdate(WxFloatingLayer record); | ResultData saveOrUpdate(WxFloatingLayer record); | ||||
| ResultData updateStatus(WxFloatingLayer wxFloatingLayer); | |||||
| } | } | ||||
| @@ -151,7 +151,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| exportQrcode(request, response, | exportQrcode(request, response, | ||||
| tenantId, type, pageUrl, sceneParam, | tenantId, type, pageUrl, sceneParam, | ||||
| withText, text1, text2, | withText, text1, text2, | ||||
| name,false); | |||||
| name); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| throw new MallinkException(Result.ERROR, "下载异常"); | throw new MallinkException(Result.ERROR, "下载异常"); | ||||
| @@ -162,7 +162,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| public ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | public ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | ||||
| String tenantId, int type, String pageUrl, String sceneParam, | String tenantId, int type, String pageUrl, String sceneParam, | ||||
| int withText, String text1, String text2, | int withText, String text1, String text2, | ||||
| String name, boolean upload) { | |||||
| String name) { | |||||
| // type 0 有限二维码, 1 无限制二维码 | // type 0 有限二维码, 1 无限制二维码 | ||||
| // withText 0 不带字 1. 带下面的字,2 带下面的两行字 | // withText 0 不带字 1. 带下面的字,2 带下面的两行字 | ||||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantId); | WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantId); | ||||
| @@ -198,35 +198,73 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| try { | try { | ||||
| if(type == 0) { | if(type == 0) { | ||||
| final File codeFile = wxMaService.getQrcodeService().createQrcode(pathStr, QRCodeUtils.QR_WIDTH); | final File codeFile = wxMaService.getQrcodeService().createQrcode(pathStr, QRCodeUtils.QR_WIDTH); | ||||
| if (withText == 1) { | |||||
| File dest1 = new File(destPath1); | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||||
| QRCodeUtils.graphicsGeneration(dest1, dest, text1); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||||
| } else if (withText == 2) { | |||||
| File dest1 = new File(destPath1); | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||||
| QRCodeUtils.graphicsGeneration2(dest1, dest, text1, text2); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||||
| } else { | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest); | |||||
| } | |||||
| copyFileToDest(withText, text1, text2, destPath1, dest, codeFile); | |||||
| org.apache.commons.io.FileUtils.forceDelete(codeFile); | org.apache.commons.io.FileUtils.forceDelete(codeFile); | ||||
| } else { | } else { | ||||
| final File codeFile = wxMaService.getQrcodeService().createWxaCodeUnlimit(sceneParam, pageUrl, QRCodeUtils.QR_WIDTH, autoColor, color, isHyaline); | final File codeFile = wxMaService.getQrcodeService().createWxaCodeUnlimit(sceneParam, pageUrl, QRCodeUtils.QR_WIDTH, autoColor, color, isHyaline); | ||||
| if (withText == 1) { | |||||
| File dest1 = new File(destPath1); | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||||
| QRCodeUtils.graphicsGeneration(dest1, dest, text1); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||||
| } else if (withText == 2) { | |||||
| File dest1 = new File(destPath1); | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||||
| QRCodeUtils.graphicsGeneration2(dest1, dest, text1, text2); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||||
| } else { | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest); | |||||
| } | |||||
| copyFileToDest(withText, text1, text2, destPath1, dest, codeFile); | |||||
| org.apache.commons.io.FileUtils.forceDelete(codeFile); | |||||
| } | |||||
| } catch (WxErrorException e) { | |||||
| logger.error(e.getMessage()); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| try { | |||||
| downFile(destPath, fileName, response, request); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @Override | |||||
| public ResultData uploadQrcode(String tenantId, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | |||||
| String name) { | |||||
| // type 0 有限二维码, 1 无限制二维码 | |||||
| // withText 0 不带字 1. 带下面的字,2 带下面的两行字 | |||||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantId); | |||||
| boolean autoColor = false; | |||||
| boolean isHyaline = true; | |||||
| WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | |||||
| WxMaService wxMaService; | |||||
| if(isFmOpen) { | |||||
| wxMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appinfo.getAppId()); | |||||
| } else { | |||||
| wxMaService = MaUtil.getWeappService(appinfo); | |||||
| } | |||||
| String pathStr = ""; | |||||
| if (StringUtils.isNotBlank(sceneParam)) { | |||||
| pathStr = pageUrl + "?scene="+sceneParam; | |||||
| } else { | |||||
| pathStr = pageUrl; | |||||
| } | |||||
| String filepath = fmUploadDir; | |||||
| String fileName = name + ".png"; | |||||
| String destPath1 = filepath + "1_" + fileName; | |||||
| String destPath = filepath + fileName; | |||||
| File dest = new File(destPath); | |||||
| File pDest = dest.getParentFile(); | |||||
| if (!pDest.exists()) { | |||||
| pDest.mkdirs(); | |||||
| } | |||||
| try { | |||||
| if(type == 0) { | |||||
| final File codeFile = wxMaService.getQrcodeService().createQrcode(pathStr, QRCodeUtils.QR_WIDTH); | |||||
| copyFileToDest(withText, text1, text2, destPath1, dest, codeFile); | |||||
| org.apache.commons.io.FileUtils.forceDelete(codeFile); | |||||
| } else { | |||||
| final File codeFile = wxMaService.getQrcodeService().createWxaCodeUnlimit(sceneParam, pageUrl, QRCodeUtils.QR_WIDTH, autoColor, color, isHyaline); | |||||
| copyFileToDest(withText, text1, text2, destPath1, dest, codeFile); | |||||
| org.apache.commons.io.FileUtils.forceDelete(codeFile); | org.apache.commons.io.FileUtils.forceDelete(codeFile); | ||||
| } | } | ||||
| @@ -238,34 +276,46 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| try { | try { | ||||
| //上传 | //上传 | ||||
| if (upload){ | |||||
| ObjectMetadata metadata = new ObjectMetadata(); | |||||
| metadata.setContentType("image/jpeg"); | |||||
| metadata.setContentLength(dest.length()); | |||||
| FileOutputStream fos = null; | |||||
| BufferedInputStream fs = null; | |||||
| String fn = UUID.randomUUID().toString(); | |||||
| int dot = fileName.lastIndexOf('.'); | |||||
| if (dot >= 0) { | |||||
| fn = tenantId + "/" + fn + dest.getName().substring(dot, dest.getName().length()); | |||||
| } else { | |||||
| fn = tenantId + "/" + fn; | |||||
| } | |||||
| ResultData data = awsUpload(new FileInputStream(dest), metadata, fn, tenantId); | |||||
| return data; | |||||
| ObjectMetadata metadata = new ObjectMetadata(); | |||||
| metadata.setContentType("image/jpeg"); | |||||
| metadata.setContentLength(dest.length()); | |||||
| FileOutputStream fos = null; | |||||
| BufferedInputStream fs = null; | |||||
| String fn = UUID.randomUUID().toString(); | |||||
| int dot = fileName.lastIndexOf('.'); | |||||
| if (dot >= 0) { | |||||
| fn = tenantId + "/" + fn + dest.getName().substring(dot, dest.getName().length()); | |||||
| } else { | |||||
| fn = tenantId + "/" + fn; | |||||
| } | } | ||||
| downFile(destPath, fileName, response, request); | |||||
| ResultData data = awsUpload(new FileInputStream(dest), metadata, fn, tenantId); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest); | org.apache.commons.io.FileUtils.forceDelete(dest); | ||||
| return data; | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| private void copyFileToDest(int withText, String text1, String text2, String destPath1, File dest, File codeFile) throws IOException { | |||||
| if (withText == 1) { | |||||
| File dest1 = new File(destPath1); | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||||
| QRCodeUtils.graphicsGeneration(dest1, dest, text1); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||||
| } else if (withText == 2) { | |||||
| File dest1 = new File(destPath1); | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||||
| QRCodeUtils.graphicsGeneration2(dest1, dest, text1, text2); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||||
| } else { | |||||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest); | |||||
| } | |||||
| } | |||||
| private void downFile(String filePath, String filename, HttpServletResponse response, HttpServletRequest req) throws IOException { | private void downFile(String filePath, String filename, HttpServletResponse response, HttpServletRequest req) throws IOException { | ||||
| try { | try { | ||||
| response.reset(); | response.reset(); | ||||
| @@ -269,7 +269,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||||
| couponChannel.setId(wxCouponChannel.getId()); | couponChannel.setId(wxCouponChannel.getId()); | ||||
| couponChannel.setType(wxCouponChannel.getType()); | couponChannel.setType(wxCouponChannel.getType()); | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| Map<String,String> map = (Map)resultDataQ.data; | Map<String,String> map = (Map)resultDataQ.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -265,7 +265,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| couponChannel.setId(vo.getId()); | couponChannel.setId(vo.getId()); | ||||
| couponChannel.setType(vo.getType()); | couponChannel.setType(vo.getType()); | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| Map<String,String> map = (Map)resultDataQ.data; | Map<String,String> map = (Map)resultDataQ.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -35,13 +35,15 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| @Override | @Override | ||||
| public WxFloatingLayer getFloatingLayer(String openId) { | |||||
| public WxFloatingLayer getFloatingLayer(String openId, String appId) { | |||||
| //1 查看是否存在用户,用户不存在 直接返回浮层信息 | //1 查看是否存在用户,用户不存在 直接返回浮层信息 | ||||
| WxCUser user = new WxCUser(); | WxCUser user = new WxCUser(); | ||||
| user.setOpenId(openId); | user.setOpenId(openId); | ||||
| user.setAppId(appId); | |||||
| WxCUser byOpenId = wxCUserMapper.findByOpenId(user); | WxCUser byOpenId = wxCUserMapper.findByOpenId(user); | ||||
| String tenantId = byOpenId.getTenantId(); | |||||
| if (byOpenId == null) { | if (byOpenId == null) { | ||||
| return getWxFloatingLayer(); | |||||
| return getWxFloatingLayer(tenantId); | |||||
| } | } | ||||
| //2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 | //2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 | ||||
| WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); | WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); | ||||
| @@ -49,7 +51,7 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| WxCuserFloatingLayer wxCuserFloatingLayer = wxCuserFloatingLayerMapper.selectOne(new QueryWrapper<>(wxCuserFloatingLayerQuery)); | WxCuserFloatingLayer wxCuserFloatingLayer = wxCuserFloatingLayerMapper.selectOne(new QueryWrapper<>(wxCuserFloatingLayerQuery)); | ||||
| if (wxCuserFloatingLayer == null) { | if (wxCuserFloatingLayer == null) { | ||||
| saveCuserFloatingLayer(byOpenId); | saveCuserFloatingLayer(byOpenId); | ||||
| return getWxFloatingLayer(); | |||||
| return getWxFloatingLayer(tenantId); | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -65,8 +67,9 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| wxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); | wxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); | ||||
| } | } | ||||
| public WxFloatingLayer getWxFloatingLayer() { | |||||
| public WxFloatingLayer getWxFloatingLayer(String tenantId) { | |||||
| WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); | WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); | ||||
| wxFloatingLayer.setTenantId(tenantId); | |||||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); | wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); | ||||
| return wxFloatingLayerMapper.selectOne(new QueryWrapper<>(wxFloatingLayer)); | return wxFloatingLayerMapper.selectOne(new QueryWrapper<>(wxFloatingLayer)); | ||||
| } | } | ||||
| @@ -71,4 +71,12 @@ public class WxFloatingLayerServiceImpl implements WxFloatingLayerService { | |||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData updateStatus(WxFloatingLayer wxFloatingLayer) { | |||||
| wxFloatingLayer.setUpdateTime(new Date()); | |||||
| wxFloatingLayerMapper.updateById(wxFloatingLayer); | |||||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||||
| } | |||||
| } | } | ||||
| @@ -317,7 +317,7 @@ public class WxGameServiceImpl implements WxGameService { | |||||
| couponChannel.setId(wxCouponChannel.getId()); | couponChannel.setId(wxCouponChannel.getId()); | ||||
| couponChannel.setType(wxCouponChannel.getType()); | couponChannel.setType(wxCouponChannel.getType()); | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| Map<String,String> map = (Map)resultDataQ.data; | Map<String,String> map = (Map)resultDataQ.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -140,7 +140,7 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| couponChannel.setId(wxCouponChannel.getId()); | couponChannel.setId(wxCouponChannel.getId()); | ||||
| couponChannel.setType(wxCouponChannel.getType()); | couponChannel.setType(wxCouponChannel.getType()); | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| Map<String,String> map = (Map)resultDataQ.data; | Map<String,String> map = (Map)resultDataQ.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -5,9 +5,9 @@ | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | <id column="id" jdbcType="BIGINT" property="id"/> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | ||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | ||||
| <result column="produce_id" jdbcType="VARCHAR" property="produceId"/> | |||||
| <result column="produce_id" jdbcType="BIGINT" property="produceId"/> | |||||
| <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | ||||
| <result column="status" jdbcType="VARCHAR" property="status"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | ||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | ||||
| @@ -58,16 +58,16 @@ | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | <id column="id" jdbcType="BIGINT" property="id"/> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | ||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | ||||
| <result column="produce_id" jdbcType="VARCHAR" property="produceId"/> | |||||
| <result column="produce_id" jdbcType="BIGINT" property="produceId"/> | |||||
| <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | ||||
| <result column="status" jdbcType="VARCHAR" property="status"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | ||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | ||||
| <result column="title" jdbcType="VARCHAR" property="title"/> | <result column="title" jdbcType="VARCHAR" property="title"/> | ||||
| </resultMap> | </resultMap> | ||||
| <sql id="dynamicWhereConditionsVO"> | <sql id="dynamicWhereConditionsVO"> | ||||
| where 1=1 | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and fl.`id` = #{id} | and fl.`id` = #{id} | ||||
| </if> | </if> | ||||