| @@ -1,41 +0,0 @@ | |||||
| package com.iformall.service; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumAppPlat; | |||||
| import com.iformall.enums.EnumPayVersion; | |||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.enums.EnumProject; | |||||
| import com.iformall.exception.MallinkException; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| import java.util.Map; | |||||
| @Service | |||||
| public interface QrCodeService { | |||||
| void downQrCode(TenantEntity tenantEntity, HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> params,EnumAppPlat plat) throws MallinkException; | |||||
| ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | |||||
| TenantEntity tenantEntity, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | |||||
| String name, EnumAppPlat plat); | |||||
| ResultData uploadQrcode(TenantEntity tenantEntity, int type, String pageUrl, String sceneParam, | |||||
| int withText, String text1, String text2, | |||||
| String name,EnumAppPlat plat); | |||||
| /** | |||||
| * 生成无限二维码 | |||||
| * @param project | |||||
| * @param plat | |||||
| * @param pageUrl | |||||
| * @param sceneParam | |||||
| * @param name | |||||
| * @param plat | |||||
| * @return | |||||
| */ | |||||
| ResultData uploadQrcode(EnumProject project,EnumAppPlat plat,String pageUrl, String sceneParam,String name); | |||||
| } | |||||
| @@ -9,7 +9,6 @@ import com.iformall.enums.EnumAppPlat; | |||||
| import com.iformall.enums.EnumProject; | import com.iformall.enums.EnumProject; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.UserBasicQrcodeMapper; | import com.iformall.mapper.UserBasicQrcodeMapper; | ||||
| import com.iformall.service.QrCodeService; | |||||
| import com.iformall.service.UserBasicQrcodeService; | import com.iformall.service.UserBasicQrcodeService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
| @@ -30,8 +29,6 @@ public class UserBasicQrcodeServiceImpl implements UserBasicQrcodeService { | |||||
| @Autowired | @Autowired | ||||
| UserBasicQrcodeMapper userBasicQrcodeMapper; | UserBasicQrcodeMapper userBasicQrcodeMapper; | ||||
| @Autowired | |||||
| protected QrCodeService qrCodeService; | |||||
| @Override | @Override | ||||
| public String getQrCode(Long userId, Integer projectType, Integer platType) { | public String getQrCode(Long userId, Integer projectType, Integer platType) { | ||||
| @@ -48,21 +45,7 @@ public class UserBasicQrcodeServiceImpl implements UserBasicQrcodeService { | |||||
| String pageUrl = Constant.sharePageUrl; | String pageUrl = Constant.sharePageUrl; | ||||
| String param = "t:in_u:"+userId; | String param = "t:in_u:"+userId; | ||||
| String name = project.getCode() + "-" + plat.getCode() + "-" + userId.toString(); | String name = project.getCode() + "-" + plat.getCode() + "-" + userId.toString(); | ||||
| ResultData resultData = qrCodeService.uploadQrcode(project, plat, pageUrl, param, name); | |||||
| if(ResultData.SUCCESS == resultData.code){ | |||||
| Map<String, String> map = (Map) resultData.data; | |||||
| String pathUrl = map.get("url"); | |||||
| if(StringUtils.isBlank(pathUrl)){ | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| qrcode.setId(idWorker.nextId()); | |||||
| qrcode.setQrcode(pathUrl); | |||||
| userBasicQrcodeMapper.insert(qrcode); | |||||
| return pathUrl; | |||||
| }else{ | |||||
| throw new MallinkException(resultData.code ,resultData.message); | |||||
| } | |||||
| return name; | |||||
| } | } | ||||
| } | } | ||||
| @@ -15,7 +15,6 @@ import com.iformall.mapper.WxActivityMapper; | |||||
| import com.iformall.mapper.WxCampaignMapper; | import com.iformall.mapper.WxCampaignMapper; | ||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.mapper.WxQuestionOneselfMapper; | import com.iformall.mapper.WxQuestionOneselfMapper; | ||||
| import com.iformall.service.QrCodeService; | |||||
| import com.iformall.service.WxCampaignService; | import com.iformall.service.WxCampaignService; | ||||
| import com.iformall.service.WxCouponChannelService; | import com.iformall.service.WxCouponChannelService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -48,9 +47,6 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||||
| WxCouponChannelMapper wxCouponChannelMapper; | WxCouponChannelMapper wxCouponChannelMapper; | ||||
| @Autowired | |||||
| QrCodeService qrCodeService; | |||||
| @Autowired | @Autowired | ||||
| WxActivityMapper wxActivityMapper; | WxActivityMapper wxActivityMapper; | ||||
| @@ -15,7 +15,6 @@ import com.iformall.enums.*; | |||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.mapper.WxCouponMapper; | import com.iformall.mapper.WxCouponMapper; | ||||
| import com.iformall.mapper.WxTopicMapper; | import com.iformall.mapper.WxTopicMapper; | ||||
| import com.iformall.service.QrCodeService; | |||||
| import com.iformall.service.WxCouponChannelService; | import com.iformall.service.WxCouponChannelService; | ||||
| import com.iformall.service.WxTopicService; | import com.iformall.service.WxTopicService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -46,9 +45,6 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponChannelMapper wxCouponChannelMapper; | private WxCouponChannelMapper wxCouponChannelMapper; | ||||
| @Autowired | |||||
| private QrCodeService qrCodeService; | |||||
| @Autowired | @Autowired | ||||
| private WxCouponChannelService wxCouponChannelService; | private WxCouponChannelService wxCouponChannelService; | ||||