| | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Override |
| | | public InviteInfoResponse getInviteInfo(Integer memberId){ |
| | | InviteInfoResponse inviteInfoResponse = new InviteInfoResponse(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成海报图 |
| | | * @param userType |
| | | * @param memberId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public String createShareImg(Integer memberId) throws Exception { |
| | | public String createShareImg(Integer userType,Integer memberId) throws Exception { |
| | | String imgUrl = systemDictDataBiz.queryByCode(Constants.ORDER_SET,Constants.INVITE_IMG_URL).getCode(); |
| | | String suffix = "m_" + memberId; |
| | | if(Constants.equalsInteger(Constants.ONE,userType)){ |
| | | Shop shop = shopMapper.selectById(memberId); |
| | | if(Objects.nonNull(shop) |
| | | && StringUtils.isNotBlank(shop.getPosterImg())){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode(); |
| | | imgUrl = path + shop.getPosterImg(); |
| | | } |
| | | suffix = "s_"+memberId; |
| | | } |
| | | BufferedImage img1 = GeneratePicUtil.transfromToImage(imgUrl,imgUrl.substring(imgUrl.lastIndexOf(".") + 1)); |
| | | if (img1 == null) { |
| | | return imgUrl; |
| | | } |
| | | String url = null; |
| | | String scene = "m_" + memberId; |
| | | String scene = "trial"; |
| | | //内容分享海报图片 |
| | | InputStream mpCode = Constants.generateWxMiniImgStream( |
| | | scene, |
| | |
| | | ALiYunUtil obs = new ALiYunUtil( |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode() |
| | | ,systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_ID).getCode(), systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_KEY).getCode()); |
| | | String shareFolder = systemDictDataBiz.queryByCode(Constants.RESOURCE_PATH, Constants.SHARES_FILE).getCode(); |
| | | String shareFolder = systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHARES_FILE).getCode(); |
| | | String key = DateUtil.getNowShortDate() + "/" + UUID.randomUUID().toString() + ".jpg"; |
| | | String fileName = shareFolder + key; |
| | | if (obs.uploadOnlineObject(inputStream,systemDictDataBiz.queryByCode(Constants.OSS, Constants.BUCKETNAME).getCode(), key,null)) { |
| | | if (obs.uploadOnlineObject(inputStream,systemDictDataBiz.queryByCode(Constants.OSS, Constants.BUCKETNAME).getCode(), fileName,null)) { |
| | | url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() + fileName; |
| | | } |
| | | return url; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String createShopMiniProgramCode(Integer shopId) throws Exception { |
| | | //内容分享海报图片 |
| | | InputStream inputStream = Constants.generateWxMiniImgStream( |
| | | "trial", |
| | | "/page/index/?shopId="+shopId, |
| | | true);//小程序 |
| | | String url = null; |
| | | ALiYunUtil obs = new ALiYunUtil( |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode() |
| | | ,systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_ID).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_KEY).getCode()); |
| | | |
| | | String shareFolder = systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHARES_FILE).getCode(); |
| | | String key = DateUtil.getNowShortDate() + "/" + UUID.randomUUID().toString() + ".jpg"; |
| | | String fileName = shareFolder + key; |
| | | if (obs.uploadOnlineObject(inputStream,systemDictDataBiz.queryByCode(Constants.OSS, Constants.BUCKETNAME).getCode(), fileName,null)) { |
| | | url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() + fileName; |
| | | } |
| | | return url; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Integer create(InviteRecord inviteRecord) { |
| | | inviteRecordMapper.insert(inviteRecord); |