| @@ -11,6 +11,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.mapper.WxMerchantMapper; | import com.iformall.mapper.WxMerchantMapper; | ||||
| import com.iformall.service.QrCodeService; | import com.iformall.service.QrCodeService; | ||||
| import com.iformall.utils.Constant; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -46,7 +47,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @GetMapping("/updateQrCode") | @GetMapping("/updateQrCode") | ||||
| public void updateQrCode(String p)throws ServletException, IOException { | public void updateQrCode(String p)throws ServletException, IOException { | ||||
| if("xlldxx".equals(p)) { | if("xlldxx".equals(p)) { | ||||
| String pageUrl = "pages/index/index"; | |||||
| String pageUrl = Constant.mainPageUrl; | |||||
| List<WxMerchant> list = wxMerchantMapper.findQrcodeEmptyList(); | List<WxMerchant> list = wxMerchantMapper.findQrcodeEmptyList(); | ||||
| logger.info("updateQrCode.count:"+list.size()); | logger.info("updateQrCode.count:"+list.size()); | ||||
| @@ -55,7 +56,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.uploadQrcode(merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情"); | |||||
| ResultData resultData = qrCodeService.uploadQrcode(merchant, 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"); | ||||
| @@ -72,7 +73,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @GetMapping("/updateCouponQrCode") | @GetMapping("/updateCouponQrCode") | ||||
| public void updateCouponQrCode(String p)throws ServletException, IOException { | public void updateCouponQrCode(String p)throws ServletException, IOException { | ||||
| if("xlldxx".equals(p)){ | if("xlldxx".equals(p)){ | ||||
| String pageUrl = "pages/index/index"; | |||||
| String pageUrl = Constant.mainPageUrl; | |||||
| List<WxCouponChannel> list = wxCouponChannelMapper.findQrcodeEmptyList(); | List<WxCouponChannel> list = wxCouponChannelMapper.findQrcodeEmptyList(); | ||||
| logger.info("updateCouponQrCode.count:"+list.size()); | logger.info("updateCouponQrCode.count:"+list.size()); | ||||
| @@ -81,7 +82,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.uploadQrcode(couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| ResultData resultData = qrCodeService.uploadQrcode(couponChannel,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"); | ||||
| @@ -122,7 +123,7 @@ public class WxAppinfoController extends BaseController { | |||||
| } | } | ||||
| try { | try { | ||||
| qrCodeService.exportQrcode(request, response, | qrCodeService.exportQrcode(request, response, | ||||
| getTenantId(), type, pageUrl, sceneParam, | |||||
| getTenantInfo(), type, pageUrl, sceneParam, | |||||
| withText, text1, text2, | withText, text1, text2, | ||||
| name); | name); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -131,7 +131,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.uploadQrcode(wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情"); | |||||
| ResultData resultQrCode = qrCodeService.uploadQrcode(wxMerchant,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"); | ||||
| @@ -32,10 +32,10 @@ public class WxChartDataController extends BaseController { | |||||
| "chart=45 卡营销数据:" + | "chart=45 卡营销数据:" + | ||||
| "saleHistory销售金额历史 paymentHistory核销历史 saleCardCount售出卡数量 tranCount转增数量 subsidyCount补贴金额"+ | "saleHistory销售金额历史 paymentHistory核销历史 saleCardCount售出卡数量 tranCount转增数量 subsidyCount补贴金额"+ | ||||
| "--------------------------------------" + | "--------------------------------------" + | ||||
| "chart=46 卷营销数据:" + | |||||
| "orderCountList卷购买数量历史 paymentCountList卷核销数量 priceCouponSaleCountList有价卷销售数量历史 " + | |||||
| "priceCouponPaymentCountList有价卷核销数量历史 sumPriceSaleMoney有价券销售总额 sumPricePayMent有价卷核销总额 " + | |||||
| "sumSubsidyMoney商场补贴金额 priceCouponCancelCount有价卷退款数量 priceCouponSaleCountListTotal有价券售出数量"+ | |||||
| "chart=46 券营销数据:" + | |||||
| "orderCountList券购买数量历史 paymentCountList券核销数量 priceCouponSaleCountList有价券销售数量历史 " + | |||||
| "priceCouponPaymentCountList有价券核销数量历史 sumPriceSaleMoney有价券销售总额 sumPricePayMent有价券核销总额 " + | |||||
| "sumSubsidyMoney商场补贴金额 priceCouponCancelCount有价券退款数量 priceCouponSaleCountListTotal有价券售出数量"+ | |||||
| "--------------------------------------" + | "--------------------------------------" + | ||||
| "chart=47 砍价营销数据:" + | "chart=47 砍价营销数据:" + | ||||
| "pressSendHistory砍价发起历史 pressSuccHistory砍价成功历史 pressPaymentHistory砍价核销历史 " + | "pressSendHistory砍价发起历史 pressSuccHistory砍价成功历史 pressPaymentHistory砍价核销历史 " + | ||||
| @@ -51,12 +51,12 @@ public class WxChartDataController extends BaseController { | |||||
| "ysje 应收金额 ssje 实收金额 zjsjl收缴率 rent*租赁收缴率 property*物业收缴率 deposit*押金收缴率 other*其他费用收缴率" + | "ysje 应收金额 ssje 实收金额 zjsjl收缴率 rent*租赁收缴率 property*物业收缴率 deposit*押金收缴率 other*其他费用收缴率" + | ||||
| "rentOwe 租赁总额 propertyOwe物业总额 otherOwe其他总额 depositOwe押金总额 totalOwe欠缴总额"+ | "rentOwe 租赁总额 propertyOwe物业总额 otherOwe其他总额 depositOwe押金总额 totalOwe欠缴总额"+ | ||||
| "--------------------------------------"+ | "--------------------------------------"+ | ||||
| "chart=51首页场景发卷:" + | |||||
| "carStopHistory停车发卷 couponVerifyHistory核销发卷 orderHistory交易发卷 micropayHistory收银台发卷 merchantHistory商户发券"+ | |||||
| "chart=51首页场景发券:" + | |||||
| "carStopHistory停车发券 couponVerifyHistory核销发券 orderHistory交易发券 micropayHistory收银台发券 merchantHistory商户发券"+ | |||||
| "--------------------------------------"+ | "--------------------------------------"+ | ||||
| "chart=52营销数据:" + | "chart=52营销数据:" + | ||||
| "当前”券交易数据“替换为”营销数据“:cardHistory卡营销历史 pressSendHistory砍价营销历史 groupHistory拼团营销历史 couponHistory卷营销历史," + | |||||
| "卡、卷、砍价、拼团走势以及右边的数据总览,对应原来 营销系统->卡、卷、砍价、拼团营销数据" + | |||||
| "当前”券交易数据“替换为”营销数据“:cardHistory卡营销历史 pressSendHistory砍价营销历史 groupHistory拼团营销历史 couponHistory券营销历史," + | |||||
| "卡、券、砍价、拼团走势以及右边的数据总览,对应原来 营销系统->卡、券、砍价、拼团营销数据" + | |||||
| "--------------------------------------" + | "--------------------------------------" + | ||||
| "触达用户=数据总览的活跃用户数据" + "------------------------------" + | "触达用户=数据总览的活跃用户数据" + "------------------------------" + | ||||
| "chart=48拼团营销数据:拼团成功次数successList verifyList核销量 拼团发起次数groupCount 拼团成功successCount 参与拼团人次peopleCount" + | "chart=48拼团营销数据:拼团成功次数successList verifyList核销量 拼团发起次数groupCount 拼团成功successCount 参与拼团人次peopleCount" + | ||||
| @@ -82,7 +82,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.uploadQrcode(couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(couponChannel,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,6 +5,7 @@ import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.service.QrCodeService; | import com.iformall.service.QrCodeService; | ||||
| import com.iformall.utils.ImgUtil; | import com.iformall.utils.ImgUtil; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -36,6 +37,11 @@ public class UploadController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private QrCodeService qrCodeService; | private QrCodeService qrCodeService; | ||||
| private String getFileName(TenantEntity tenantEntity, String fileName) { | |||||
| fileName = tenantEntity.getTenantId() + "/" + fileName; | |||||
| return fileName; | |||||
| } | |||||
| /** | /** | ||||
| * 上传文件 | * 上传文件 | ||||
| * | * | ||||
| @@ -49,6 +55,8 @@ public class UploadController extends BaseController { | |||||
| public ResultData awsfileUpload(@RequestParam("file") MultipartFile multiReq) throws Exception { | public ResultData awsfileUpload(@RequestParam("file") MultipartFile multiReq) throws Exception { | ||||
| logger.info("[" + getIpAddr() + "] UploadController::awsfileUpload"); | logger.info("[" + getIpAddr() + "] UploadController::awsfileUpload"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| ObjectMetadata metadata = new ObjectMetadata(); | ObjectMetadata metadata = new ObjectMetadata(); | ||||
| metadata.setContentType(multiReq.getContentType()); | metadata.setContentType(multiReq.getContentType()); | ||||
| metadata.setContentLength(multiReq.getSize()); | metadata.setContentLength(multiReq.getSize()); | ||||
| @@ -56,13 +64,14 @@ public class UploadController extends BaseController { | |||||
| String fileName = UUID.randomUUID().toString(); | String fileName = UUID.randomUUID().toString(); | ||||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | ||||
| if (dot >= 0) { | if (dot >= 0) { | ||||
| fileName = getTenantId() + "/" + fileName + multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||||
| String fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||||
| } else { | } else { | ||||
| fileName = getTenantId() + "/" + fileName; | |||||
| fileName = getFileName(tenantEntity, fileName); | |||||
| } | } | ||||
| System.out.println(fileName); | System.out.println(fileName); | ||||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, getTenantId()); | |||||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, getTenantInfo()); | |||||
| return data; | return data; | ||||
| } | } | ||||
| @@ -77,63 +86,64 @@ public class UploadController extends BaseController { | |||||
| @PostMapping(value = "/awsImgUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | @PostMapping(value = "/awsImgUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | ||||
| @ApiOperation("上传图片") | @ApiOperation("上传图片") | ||||
| @SystemControllerLog(description = "上传图片") | @SystemControllerLog(description = "上传图片") | ||||
| public ResultData awsImgUpload(@RequestParam("file") MultipartFile multiReq) { | |||||
| public ResultData awsImgUpload(@RequestParam("file") MultipartFile multiReq) throws Exception{ | |||||
| logger.info("[" + getIpAddr() + "] UploadController::awsImgUpload"); | logger.info("[" + getIpAddr() + "] UploadController::awsImgUpload"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| long size = multiReq.getSize(); | long size = multiReq.getSize(); | ||||
| final long length = 2097152; | final long length = 2097152; | ||||
| if (size > length) { | if (size > length) { | ||||
| return new ResultData(ErrorCode.PICTURE_SIZE_EXCEED); | return new ResultData(ErrorCode.PICTURE_SIZE_EXCEED); | ||||
| } | } | ||||
| String fileName = UUID.randomUUID().toString(); | String fileName = UUID.randomUUID().toString(); | ||||
| String tempFileName = fileName; | |||||
| String tempFileName = fileName; | |||||
| String fileFormat = ""; | String fileFormat = ""; | ||||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | ||||
| if (dot >= 0) { | if (dot >= 0) { | ||||
| fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | ||||
| fileName = getTenantId() + "/" + fileName + fileFormat; | |||||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||||
| } else { | } else { | ||||
| fileName = getTenantId() + "/" + fileName; | |||||
| fileName = getFileName(tenantEntity, fileName); | |||||
| } | } | ||||
| System.out.println(fileName); | |||||
| try { | try { | ||||
| FileOutputStream fos = null; | |||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | |||||
| if (StringUtils.isNotBlank(imgFormat)) { | |||||
| String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; | |||||
| BufferedInputStream fs = null; | |||||
| File localFile = new File(localImgFileName); | |||||
| fos = new FileOutputStream(localFile); | |||||
| fs = (BufferedInputStream) multiReq.getInputStream(); | |||||
| byte[] buffer = new byte[1024]; | |||||
| int len = 0; | |||||
| while ((len = fs.read(buffer)) != -1) { | |||||
| fos.write(buffer, 0, len); | |||||
| } | |||||
| fos.close(); | |||||
| fs.close(); | |||||
| logger.info("local file: " + localImgFileName); | |||||
| File newFile = ImgUtil.thinImage(localImgFileName, localNewImgFileName, imgFormat); | |||||
| logger.info("local new file: " + localNewImgFileName); | |||||
| // 删除本地缓存 | |||||
| localFile.delete(); | |||||
| ObjectMetadata metadata = new ObjectMetadata(); | |||||
| metadata.setContentType(multiReq.getContentType()); | |||||
| metadata.setContentLength(newFile.length()); | |||||
| ResultData data = qrCodeService.awsUpload(new FileInputStream(newFile), metadata, fileName, getTenantId()); | |||||
| // 删除本地缓存 | |||||
| newFile.delete(); | |||||
| return data; | |||||
| } else { | |||||
| ObjectMetadata metadata = new ObjectMetadata(); | |||||
| metadata.setContentType(multiReq.getContentType()); | |||||
| metadata.setContentLength(size); | |||||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, getTenantId()); | |||||
| return data; | |||||
| } | |||||
| FileOutputStream fos = null; | |||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | |||||
| if(StringUtils.isNotBlank(imgFormat)) { | |||||
| String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; | |||||
| BufferedInputStream fs = null; | |||||
| File localFile = new File(localImgFileName); | |||||
| fos = new FileOutputStream(localFile); | |||||
| fs = (BufferedInputStream) multiReq.getInputStream(); | |||||
| byte[] buffer = new byte[1024]; | |||||
| int len = 0; | |||||
| while ((len = fs.read(buffer)) != -1) { | |||||
| fos.write(buffer, 0, len); | |||||
| } | |||||
| fos.close(); | |||||
| fs.close(); | |||||
| logger.info("local file: " + localImgFileName); | |||||
| File newFile = ImgUtil.thinImage(localImgFileName, localNewImgFileName, imgFormat); | |||||
| logger.info("local new file: " + localNewImgFileName); | |||||
| // 删除本地缓存 | |||||
| localFile.delete(); | |||||
| ObjectMetadata metadata = new ObjectMetadata(); | |||||
| metadata.setContentType(multiReq.getContentType()); | |||||
| metadata.setContentLength(newFile.length()); | |||||
| ResultData data = qrCodeService.awsUpload(new FileInputStream(newFile), metadata, fileName, tenantEntity); | |||||
| // 删除本地缓存 | |||||
| newFile.delete(); | |||||
| return data; | |||||
| } else { | |||||
| ObjectMetadata metadata = new ObjectMetadata(); | |||||
| metadata.setContentType(multiReq.getContentType()); | |||||
| metadata.setContentLength(size); | |||||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||||
| return data; | |||||
| } | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | ||||
| @@ -150,13 +160,14 @@ public class UploadController extends BaseController { | |||||
| @PostMapping(value = "/awsFilesUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | @PostMapping(value = "/awsFilesUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | ||||
| @ApiOperation("多文件上传") | @ApiOperation("多文件上传") | ||||
| @SystemControllerLog(description = "多文件上传") | @SystemControllerLog(description = "多文件上传") | ||||
| public ResultData awsFilesUpload(@RequestParam("files") MultipartFile[] files) throws Exception { | |||||
| public ResultData awsFilesUpload(@RequestParam("files") MultipartFile[] files) throws Exception{ | |||||
| logger.info("[" + getIpAddr() + "] UploadController::awsFilesUpload"); | logger.info("[" + getIpAddr() + "] UploadController::awsFilesUpload"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| if (files.length > 0) { | |||||
| if(files.length > 0){ | |||||
| ResultData data = new ResultData(); | ResultData data = new ResultData(); | ||||
| List<Map<String, String>> dataList = new ArrayList<Map<String, String>>(); | |||||
| for (MultipartFile multipartFile : files) { | |||||
| List<Map<String,String>> dataList = new ArrayList<Map<String,String>>(); | |||||
| for(MultipartFile multipartFile: files) { | |||||
| Map<String, String> map = new HashMap<>(); | Map<String, String> map = new HashMap<>(); | ||||
| ObjectMetadata metadata = new ObjectMetadata(); | ObjectMetadata metadata = new ObjectMetadata(); | ||||
| @@ -171,14 +182,15 @@ public class UploadController extends BaseController { | |||||
| String fileName = UUID.randomUUID().toString(); | String fileName = UUID.randomUUID().toString(); | ||||
| int dot = multipartFile.getOriginalFilename().lastIndexOf('.'); | int dot = multipartFile.getOriginalFilename().lastIndexOf('.'); | ||||
| if (dot >= 0) { | if (dot >= 0) { | ||||
| fileName = getTenantId() + "/" + fileName + multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length()); | |||||
| String fileFormat = multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length());; | |||||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||||
| } else { | } else { | ||||
| fileName = getTenantId() + "/" + fileName; | |||||
| fileName = getFileName(tenantEntity, fileName); | |||||
| } | } | ||||
| ResultData data1 = qrCodeService.awsUpload(multipartFile.getInputStream(), metadata, fileName, getTenantId()); | |||||
| if (data1.code == ResultData.SUCCESS) { | |||||
| Map _data = (Map) data1.data; | |||||
| ResultData data1 = qrCodeService.awsUpload(multipartFile.getInputStream(), metadata, fileName, getTenantInfo()); | |||||
| if(data1.code == ResultData.SUCCESS) { | |||||
| Map _data = (Map)data1.data; | |||||
| map.put("url", (String) _data.get("url")); | map.put("url", (String) _data.get("url")); | ||||
| dataList.add(map); | dataList.add(map); | ||||
| } else { | } else { | ||||
| @@ -205,7 +217,7 @@ public class UploadController extends BaseController { | |||||
| */ | */ | ||||
| @PostMapping(value = "/cimgUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | @PostMapping(value = "/cimgUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | ||||
| @ApiOperation("内部接口-C端上传图片文件") | @ApiOperation("内部接口-C端上传图片文件") | ||||
| public ResultData cimgUpload(@RequestParam("file") MultipartFile multiReq) throws Exception { | |||||
| public ResultData cimgUpload(@RequestParam("file") MultipartFile multiReq) throws Exception{ | |||||
| logger.info("[" + getIpAddr() + "] UploadController::cimgUpload"); | logger.info("[" + getIpAddr() + "] UploadController::cimgUpload"); | ||||
| ObjectMetadata metadata = new ObjectMetadata(); | ObjectMetadata metadata = new ObjectMetadata(); | ||||
| @@ -214,7 +226,9 @@ public class UploadController extends BaseController { | |||||
| String fileName = multiReq.getOriginalFilename(); | String fileName = multiReq.getOriginalFilename(); | ||||
| fileName = "cimg/" + fileName; | fileName = "cimg/" + fileName; | ||||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, "cimg"); | |||||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, new TenantEntity() {{ | |||||
| setTenantId("cimg"); | |||||
| }}); | |||||
| return data; | return data; | ||||
| } | } | ||||
| @@ -13,11 +13,14 @@ import com.amazonaws.services.s3.model.CannedAccessControlList; | |||||
| import com.amazonaws.services.s3.model.ObjectMetadata; | import com.amazonaws.services.s3.model.ObjectMetadata; | ||||
| import com.amazonaws.services.s3.model.PutObjectRequest; | import com.amazonaws.services.s3.model.PutObjectRequest; | ||||
| import com.iformall.domain.po.MallResource; | import com.iformall.domain.po.MallResource; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.service.MallResourceService; | import com.iformall.service.MallResourceService; | ||||
| import com.iformall.shiro.UserSession; | import com.iformall.shiro.UserSession; | ||||
| import com.iformall.ueditor.define.BaseState; | import com.iformall.ueditor.define.BaseState; | ||||
| import com.iformall.ueditor.define.State; | import com.iformall.ueditor.define.State; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.shiro.SecurityUtils; | import org.apache.shiro.SecurityUtils; | ||||
| import org.apache.shiro.session.Session; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| @@ -38,6 +41,11 @@ public class Uploader { | |||||
| private MallResourceService mallResourceService = null; | private MallResourceService mallResourceService = null; | ||||
| private AmazonS3 s3 = null; | private AmazonS3 s3 = null; | ||||
| private String getFileName(TenantEntity tenantEntity, String fileName) { | |||||
| fileName = tenantEntity.getTenantId() + "/" + fileName; | |||||
| return fileName; | |||||
| } | |||||
| public Uploader(HttpServletRequest request, Map<String, Object> conf, MallResourceService mallResourceService) { | public Uploader(HttpServletRequest request, Map<String, Object> conf, MallResourceService mallResourceService) { | ||||
| this.request = request; | this.request = request; | ||||
| this.conf = conf; | this.conf = conf; | ||||
| @@ -67,14 +75,22 @@ public class Uploader { | |||||
| this.conf); | this.conf); | ||||
| } else { | } else { | ||||
| MultipartFile multiReq= ((MultipartHttpServletRequest) this.request).getFile("upfile"); | MultipartFile multiReq= ((MultipartHttpServletRequest) this.request).getFile("upfile"); | ||||
| String tenantId = (String)SecurityUtils.getSubject().getSession().getAttribute(UserSession.tenantId); | |||||
| Session session = SecurityUtils.getSubject().getSession(); | |||||
| String tenantId = (String)session.getAttribute(UserSession.tenantId); | |||||
| TenantEntity tenantEntity = new TenantEntity(){{ | |||||
| setTenantId(tenantId); | |||||
| }}; | |||||
| if (StringUtils.isBlank(tenantId)) { | |||||
| logger.error("TENANT is null"); | |||||
| } | |||||
| String fileName = UUID.randomUUID().toString(); | String fileName = UUID.randomUUID().toString(); | ||||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | ||||
| if (dot >= 0) { | if (dot >= 0) { | ||||
| fileName = tenantId + "/" + fileName + multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||||
| String fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||||
| } else { | } else { | ||||
| fileName = tenantId + "/" + fileName; | |||||
| fileName = getFileName(tenantEntity, fileName); | |||||
| } | } | ||||
| state = state = new BaseState(true); | state = state = new BaseState(true); | ||||
| @@ -97,7 +113,7 @@ public class Uploader { | |||||
| state.putInfo("url", url.toString()); | state.putInfo("url", url.toString()); | ||||
| MallResource mr = new MallResource(); | MallResource mr = new MallResource(); | ||||
| mr.setTenantId(tenantId); | |||||
| mr.updateTenantInfo(tenantEntity); | |||||
| mr.setBucket(conf.get("bucketName").toString()); | mr.setBucket(conf.get("bucketName").toString()); | ||||
| mr.setS3Key(fileName); | mr.setS3Key(fileName); | ||||
| mr.setUrl(url.toString()); | mr.setUrl(url.toString()); | ||||
| @@ -204,7 +204,7 @@ public class WxCoupon extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "过滤可投放0不过滤 1过滤", name = "filterCanPut") | @io.swagger.annotations.ApiModelProperty(value = "过滤可投放0不过滤 1过滤", name = "filterCanPut") | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer filterCanPut; | private Integer filterCanPut; | ||||
| //审批模板id 卷、卡、拼团、砍价 | |||||
| //审批模板id 券、卡、拼团、砍价 | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long couponModelId; | private Long couponModelId; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -65,7 +65,7 @@ public class WxCouponChannel extends TenantEntity { | |||||
| private String qrCode; | private String qrCode; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="卷状态 0:可投放 1:作废",name="couponStatus") | |||||
| @io.swagger.annotations.ApiModelProperty(value="券状态 0:可投放 1:作废",name="couponStatus") | |||||
| private Integer couponStatus; | private Integer couponStatus; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -91,7 +91,7 @@ public class WxCouponSend extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected Integer merchantRemain; | protected Integer merchantRemain; | ||||
| /**发卷所属商户名**/ | |||||
| /**发券所属商户名**/ | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String merchantName; | private String merchantName; | ||||
| /** | /** | ||||
| @@ -105,7 +105,7 @@ public class WxCouponSend extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | ||||
| private String title; | private String title; | ||||
| @io.swagger.annotations.ApiModelProperty(value="2:停车发券 3:核销发券 4: B端刷卡发券 5:商户发卷 6:定时发券 7:商户发券",name="sendType") | |||||
| @io.swagger.annotations.ApiModelProperty(value="2:停车发券 3:核销发券 4: B端刷卡发券 5:商户发券 6:定时发券 7:商户发券",name="sendType") | |||||
| private Integer sendType; | private Integer sendType; | ||||
| @io.swagger.annotations.ApiModelProperty(value="发券条件",name="condition") | @io.swagger.annotations.ApiModelProperty(value="发券条件",name="condition") | ||||
| private String conditions; | private String conditions; | ||||
| @@ -25,7 +25,7 @@ public class WxFlowConfig extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板名称",name="name") | @io.swagger.annotations.ApiModelProperty(value="模板名称",name="name") | ||||
| private String name; | private String name; | ||||
| @io.swagger.annotations.ApiModelProperty(value="流程类型1合同审批2账单审批3终止合同4有价卷上架",name="type") | |||||
| @io.swagger.annotations.ApiModelProperty(value="流程类型1合同审批2账单审批3终止合同4有价券上架",name="type") | |||||
| private Integer type; | private Integer type; | ||||
| @io.swagger.annotations.ApiModelProperty(value="排序",name="sort") | @io.swagger.annotations.ApiModelProperty(value="排序",name="sort") | ||||
| @@ -42,7 +42,7 @@ public class WxFlowModel extends TenantEntity { | |||||
| private String flowId; | private String flowId; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="流程类型4商铺签约5多径签约6商铺终止7多径终止8账单变更9有价卷上架",name="flowType") | |||||
| @io.swagger.annotations.ApiModelProperty(value="流程类型4商铺签约5多径签约6商铺终止7多径终止8账单变更9有价券上架",name="flowType") | |||||
| private Integer flowType; | private Integer flowType; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -150,7 +150,7 @@ public class WxMerchant extends TenantEntity { | |||||
| private String phone; | private String phone; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value = "卷名称", name = "couponName") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "券名称", name = "couponName") | |||||
| private String couponName; | private String couponName; | ||||
| public String getShopsStr() { | public String getShopsStr() { | ||||
| @@ -26,7 +26,7 @@ public class WxCouponSendVo extends WxCouponSend implements Serializable{ | |||||
| @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | ||||
| private Integer inventory; | private Integer inventory; | ||||
| /**发卷所属商户名**/ | |||||
| /**发券所属商户名**/ | |||||
| private String merchantName; | private String merchantName; | ||||
| private Date sendDate ; | private Date sendDate ; | ||||
| @@ -51,7 +51,7 @@ public enum EnumChart { | |||||
| HYHYD(44, "会员活跃度"), | HYHYD(44, "会员活跃度"), | ||||
| SALE_CARD(45, "卡营销数据"), | SALE_CARD(45, "卡营销数据"), | ||||
| SALE_COUPON(46, "卷营销数据"), | |||||
| SALE_COUPON(46, "券营销数据"), | |||||
| SALE_PRESS(47, "砍价营销数据"), | SALE_PRESS(47, "砍价营销数据"), | ||||
| SALE_GROUP(48, "拼团营销数据"), | SALE_GROUP(48, "拼团营销数据"), | ||||
| @@ -5,7 +5,7 @@ package com.iformall.enums; | |||||
| */ | */ | ||||
| public enum EnumCouponSendSendType { | public enum EnumCouponSendSendType { | ||||
| // -1: 未知 0:精准发券 1:主动(保留) 2:停车发券 3:核销发券 4: B端刷卡发券 5:商户发卷 6:定时发券 7:商户发券 8:会员生日券 | |||||
| // -1: 未知 0:精准发券 1:主动(保留) 2:停车发券 3:核销发券 4: B端刷卡发券 5:商户发券 6:定时发券 7:商户发券 8:会员生日券 | |||||
| UNKNOWN(-1, "未知"), | UNKNOWN(-1, "未知"), | ||||
| INJECT(0, "精准发券"), | INJECT(0, "精准发券"), | ||||
| ACTIVE(1, "主动(保留)"), | ACTIVE(1, "主动(保留)"), | ||||
| @@ -12,7 +12,7 @@ public enum EnumMailMsgModel { | |||||
| MAIL_ASSIGNEE_NODIFY(14, "代办通知"), | MAIL_ASSIGNEE_NODIFY(14, "代办通知"), | ||||
| MAIL_REJECT_NODIFY(15, "驳回通知"), | MAIL_REJECT_NODIFY(15, "驳回通知"), | ||||
| //卷 | |||||
| //券 | |||||
| MAIL_C_PASS_NODIFY(24, "审批通过通知"), | MAIL_C_PASS_NODIFY(24, "审批通过通知"), | ||||
| MAIL_C_APPLY_NODIFY(25, "审批通知"), | MAIL_C_APPLY_NODIFY(25, "审批通知"), | ||||
| MAIL_C_ASSIGNEE_NODIFY(26, "代办通知"), | MAIL_C_ASSIGNEE_NODIFY(26, "代办通知"), | ||||
| @@ -25,7 +25,7 @@ public enum EnumMsgModel { | |||||
| TIME_LIMIT_CAMPAIGN_JOIN_SUCCESS(17, "限时活动报名成功"), | TIME_LIMIT_CAMPAIGN_JOIN_SUCCESS(17, "限时活动报名成功"), | ||||
| TIME_LIMIT_CAMPAIGN_NOTIFY(18, "限时活动参与提醒"), | TIME_LIMIT_CAMPAIGN_NOTIFY(18, "限时活动参与提醒"), | ||||
| //卷 | |||||
| //券 | |||||
| FLOW_C_ASSIGNEE_NODIFY(19, "待办通知"), | FLOW_C_ASSIGNEE_NODIFY(19, "待办通知"), | ||||
| FLOW_C_APPLY_NODIFY(20, "审批通知"), | FLOW_C_APPLY_NODIFY(20, "审批通知"), | ||||
| FLOW_C_PASS_NODIFY(21, "通过审批通知"), | FLOW_C_PASS_NODIFY(21, "通过审批通知"), | ||||
| @@ -48,7 +48,7 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| String findSubsidyMoney(WxCoupon wxCoupon); | String findSubsidyMoney(WxCoupon wxCoupon); | ||||
| //-------卷-------- | |||||
| //-------券-------- | |||||
| List<WxCouponStatisVo> findCouponOrderCount(WxCoupon wxCoupon); | List<WxCouponStatisVo> findCouponOrderCount(WxCoupon wxCoupon); | ||||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||||
| import com.amazonaws.services.s3.model.ObjectMetadata; | import com.amazonaws.services.s3.model.ObjectMetadata; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | import org.springframework.web.bind.annotation.RequestBody; | ||||
| @@ -13,14 +14,14 @@ import java.util.Map; | |||||
| @Service | @Service | ||||
| public interface QrCodeService { | public interface QrCodeService { | ||||
| void downQrCode(String tenantId,HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> params) throws MallinkException; | |||||
| void downQrCode(TenantEntity tenantEntity, HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> params) throws MallinkException; | |||||
| ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | ||||
| String tenantId, int type, String pageUrl, String sceneParam, | |||||
| TenantEntity tenantEntity, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | int withText, String text1, String text2, | ||||
| String name); | String name); | ||||
| ResultData uploadQrcode(String tenantId, int type, String pageUrl, String sceneParam, | |||||
| ResultData uploadQrcode(TenantEntity tenantEntity, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | int withText, String text1, String text2, | ||||
| String name); | String name); | ||||
| ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId); | |||||
| ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, TenantEntity tenantEntity); | |||||
| } | } | ||||
| @@ -33,7 +33,7 @@ public interface WxCouponChannelService { | |||||
| /** | /** | ||||
| * 查询商户的卷信息 | |||||
| * 查询商户的券信息 | |||||
| * @param record | * @param record | ||||
| * @param pageIndex | * @param pageIndex | ||||
| * @param pageSize | * @param pageSize | ||||
| @@ -31,7 +31,7 @@ public interface WxCouponService { | |||||
| PageInfo<WxCouponStatisVo> findCountData(WxCoupon record, Integer pageNum, Integer pageSize); | PageInfo<WxCouponStatisVo> findCountData(WxCoupon record, Integer pageNum, Integer pageSize); | ||||
| /** | /** | ||||
| * 卷列表,包括统计 | |||||
| * 券列表,包括统计 | |||||
| * @param record | * @param record | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @@ -110,45 +110,45 @@ public interface WxCouponService { | |||||
| */ | */ | ||||
| String findSubsidyMoney(WxCoupon wxCoupon); | String findSubsidyMoney(WxCoupon wxCoupon); | ||||
| //----------------卷-------------- | |||||
| //----------------券-------------- | |||||
| /** | /** | ||||
| * 卷发放数量 | |||||
| * 券发放数量 | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| //List<WxCoupon> findCouponSendCount(WxCoupon wxCoupon); | //List<WxCoupon> findCouponSendCount(WxCoupon wxCoupon); | ||||
| /** | /** | ||||
| * 卷购买数量 | |||||
| * 券购买数量 | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxCouponStatisVo> findCouponOrderCount(WxCoupon wxCoupon); | List<WxCouponStatisVo> findCouponOrderCount(WxCoupon wxCoupon); | ||||
| /** | /** | ||||
| * 卷领取数量 | |||||
| * 券领取数量 | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| //List<WxCoupon> findCouponGetCount(WxCoupon wxCoupon); | //List<WxCoupon> findCouponGetCount(WxCoupon wxCoupon); | ||||
| /** | /** | ||||
| * 卷核销数量 | |||||
| * 券核销数量 | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxCouponStatisVo> findCouponPaymentCount(WxCoupon wxCoupon); | List<WxCouponStatisVo> findCouponPaymentCount(WxCoupon wxCoupon); | ||||
| /** | /** | ||||
| * 有价卷销售数量 | |||||
| * 有价券销售数量 | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxCouponStatisVo> priceCouponSaleCount(WxCoupon wxCoupon); | List<WxCouponStatisVo> priceCouponSaleCount(WxCoupon wxCoupon); | ||||
| /** | /** | ||||
| * 有价卷核销数量 | |||||
| * 有价券核销数量 | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxCouponStatisVo> priceCouponPaymentCount(WxCoupon wxCoupon); | List<WxCouponStatisVo> priceCouponPaymentCount(WxCoupon wxCoupon); | ||||
| /** | /** | ||||
| * 有价卷退款数量 | |||||
| * 有价券退款数量 | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| Long priceCouponCancelCount(WxCoupon wxCoupon); | Long priceCouponCancelCount(WxCoupon wxCoupon); | ||||
| @@ -17,6 +17,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.config.AwsProperty; | import com.iformall.config.AwsProperty; | ||||
| import com.iformall.domain.po.MallResource; | import com.iformall.domain.po.MallResource; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.MallResourceService; | import com.iformall.service.MallResourceService; | ||||
| @@ -59,7 +60,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| private AmazonS3 s3 = null; | private AmazonS3 s3 = null; | ||||
| @Override | @Override | ||||
| public ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId) { | |||||
| public ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, TenantEntity tenantEntity) { | |||||
| ResultData data = new ResultData(); | ResultData data = new ResultData(); | ||||
| try { | try { | ||||
| if(s3 == null) { | if(s3 == null) { | ||||
| @@ -86,7 +87,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| logger.info(url.toString()); | logger.info(url.toString()); | ||||
| MallResource mr = new MallResource(); | MallResource mr = new MallResource(); | ||||
| mr.setTenantId(tenantId); | |||||
| mr.updateTenantInfo(tenantEntity); | |||||
| mr.setBucket(awsProperty.getBucketName()); | mr.setBucket(awsProperty.getBucketName()); | ||||
| mr.setS3Key(fileName); | mr.setS3Key(fileName); | ||||
| mr.setUrl(url.toString()); | mr.setUrl(url.toString()); | ||||
| @@ -125,7 +126,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void downQrCode(String tenantId,HttpServletRequest request, HttpServletResponse response, Map<String, Object> params) throws MallinkException { | |||||
| public void downQrCode(TenantEntity tenantEntity, HttpServletRequest request, HttpServletResponse response, Map<String, Object> params) throws MallinkException { | |||||
| String name = (String) params.get("name"); | String name = (String) params.get("name"); | ||||
| String pageUrl = (String) params.get("pageUrl"); | String pageUrl = (String) params.get("pageUrl"); | ||||
| String sceneParam = (String) params.get("sceneParam"); | String sceneParam = (String) params.get("sceneParam"); | ||||
| @@ -149,7 +150,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| } | } | ||||
| try { | try { | ||||
| exportQrcode(request, response, | exportQrcode(request, response, | ||||
| tenantId, type, pageUrl, sceneParam, | |||||
| tenantEntity, type, pageUrl, sceneParam, | |||||
| withText, text1, text2, | withText, text1, text2, | ||||
| name); | name); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -160,12 +161,12 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| @Override | @Override | ||||
| public ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | public ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | ||||
| String tenantId, int type, String pageUrl, String sceneParam, | |||||
| TenantEntity tenantEntity, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | int withText, String text1, String text2, | ||||
| String name) { | 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(tenantEntity.getTenantId()); | |||||
| boolean autoColor = false; | boolean autoColor = false; | ||||
| boolean isHyaline = true; | boolean isHyaline = true; | ||||
| WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | ||||
| @@ -222,12 +223,12 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public ResultData uploadQrcode(String tenantId, int type, String pageUrl, String sceneParam, | |||||
| public ResultData uploadQrcode(TenantEntity tenantEntity, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | int withText, String text1, String text2, | ||||
| String name) { | 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(tenantEntity.getTenantId()); | |||||
| boolean autoColor = false; | boolean autoColor = false; | ||||
| boolean isHyaline = true; | boolean isHyaline = true; | ||||
| WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | ||||
| @@ -286,12 +287,13 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| String fn = UUID.randomUUID().toString(); | String fn = UUID.randomUUID().toString(); | ||||
| int dot = fileName.lastIndexOf('.'); | int dot = fileName.lastIndexOf('.'); | ||||
| if (dot >= 0) { | if (dot >= 0) { | ||||
| fn = tenantId + "/" + fn + dest.getName().substring(dot, dest.getName().length()); | |||||
| String fileFormat = dest.getName().substring(dot, dest.getName().length()); | |||||
| fn = getFileName(tenantEntity, fn + fileFormat); | |||||
| } else { | } else { | ||||
| fn = tenantId + "/" + fn; | |||||
| fn = getFileName(tenantEntity, fn); | |||||
| } | } | ||||
| ResultData data = awsUpload(new FileInputStream(dest), metadata, fn, tenantId); | |||||
| ResultData data = awsUpload(new FileInputStream(dest), metadata, fn, tenantEntity); | |||||
| org.apache.commons.io.FileUtils.forceDelete(dest); | org.apache.commons.io.FileUtils.forceDelete(dest); | ||||
| return data; | return data; | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -300,6 +302,11 @@ public class QrCodeServiceImpl implements QrCodeService { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| private String getFileName(TenantEntity tenantEntity, String fn) { | |||||
| fn = tenantEntity.getTenantId() + "/" + fn; | |||||
| return fn; | |||||
| } | |||||
| private void copyFileToDest(int withText, String text1, String text2, String destPath1, File dest, File codeFile) throws IOException { | private void copyFileToDest(int withText, String text1, String text2, String destPath1, File dest, File codeFile) throws IOException { | ||||
| if (withText == 1) { | if (withText == 1) { | ||||
| File dest1 = new File(destPath1); | File dest1 = new File(destPath1); | ||||
| @@ -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.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon,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"); | ||||
| @@ -2306,7 +2306,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| result.put("sumPriceSaleMoney",wxCouponService.findSumPriceSaleMoney(wxCoupon)); | result.put("sumPriceSaleMoney",wxCouponService.findSumPriceSaleMoney(wxCoupon)); | ||||
| result.put("sumPricePayMent",wxCouponService.findSumPricePayMent(wxCoupon)); | result.put("sumPricePayMent",wxCouponService.findSumPricePayMent(wxCoupon)); | ||||
| result.put("sumSubsidyMoney",wxCouponService.findSumSubsidyMoney(wxCoupon)); | result.put("sumSubsidyMoney",wxCouponService.findSumSubsidyMoney(wxCoupon)); | ||||
| result.put("priceCouponCancelCount",priceCouponCancelCount);//有价卷退款数量 | |||||
| result.put("priceCouponCancelCount",priceCouponCancelCount);//有价券退款数量 | |||||
| //有价券售出数量 | //有价券售出数量 | ||||
| int total = 0; | int total = 0; | ||||
| @@ -2913,7 +2913,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| } | } | ||||
| datamap.put("groupHistory",countHistoryMap); | datamap.put("groupHistory",countHistoryMap); | ||||
| //卷数据 | |||||
| //券数据 | |||||
| wxCouponStatisVoList = wxCouponService.findCouponOrderCount(couponQuery); | wxCouponStatisVoList = wxCouponService.findCouponOrderCount(couponQuery); | ||||
| countHistoryMap = getDateMap(startDate,endDate); | countHistoryMap = getDateMap(startDate,endDate); | ||||
| for (WxCouponStatisVo coupon:wxCouponStatisVoList){ | for (WxCouponStatisVo coupon:wxCouponStatisVoList){ | ||||
| @@ -128,7 +128,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| } | } | ||||
| /** | /** | ||||
| * 清除c端首页卷列表缓存 | |||||
| * 清除c端首页券列表缓存 | |||||
| * @param tenantId | * @param tenantId | ||||
| */ | */ | ||||
| public void clearCache(String tenantId){ | public void clearCache(String tenantId){ | ||||
| @@ -289,7 +289,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.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon,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"); | ||||
| @@ -444,7 +444,7 @@ import java.util.stream.Collectors; | |||||
| /** | /** | ||||
| * 清除c端首页卷列表缓存 | |||||
| * 清除c端首页券列表缓存 | |||||
| * @param tenantId | * @param tenantId | ||||
| */ | */ | ||||
| public void clearCache(String tenantId){ | public void clearCache(String tenantId){ | ||||
| @@ -333,7 +333,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| } | } | ||||
| /** | /** | ||||
| * 清除c端首页卷列表缓存 | |||||
| * 清除c端首页券列表缓存 | |||||
| * @param tenantId | * @param tenantId | ||||
| */ | */ | ||||
| public void clearCache(String tenantId){ | public void clearCache(String tenantId){ | ||||
| @@ -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.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon,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.uploadQrcode(wxCoupon.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(wxCoupon,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"); | ||||