| | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | |
| | | @Override |
| | | public InviteInfoResponse getInviteInfo(Integer memberId){ |
| | | InviteInfoResponse inviteInfoResponse = new InviteInfoResponse(); |
| | |
| | | .selectAs(Member::getImgurl,InviteRecord::getImgUrl) |
| | | .leftJoin(Member.class,Member::getId,InviteRecord::getMemberId) |
| | | .eq(InviteRecord::getIsdeleted,Constants.ZERO) |
| | | .eq(InviteRecord::getMemberId,memberId) |
| | | .eq(InviteRecord::getInviteId,memberId) |
| | | .orderByDesc(InviteRecord::getId) |
| | | ); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成海报图 |
| | | * @param userType |
| | | * @param memberId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public String createShareImg(Integer memberId) throws Exception { |
| | | public String createShareImg(Integer userType,Integer memberId,String posterImg) throws Exception { |
| | | String imgUrl = systemDictDataBiz.queryByCode(Constants.ORDER_SET,Constants.INVITE_IMG_URL).getCode(); |
| | | String suffix = "uid_"+ memberId; |
| | | if(Constants.equalsInteger(Constants.ONE,userType)){ |
| | | if(StringUtils.isNotBlank(posterImg)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode(); |
| | | imgUrl = path + posterImg; |
| | | suffix = "sid_"+ memberId; |
| | | } |
| | | } |
| | | BufferedImage img1 = GeneratePicUtil.transfromToImage(imgUrl,imgUrl.substring(imgUrl.lastIndexOf(".") + 1)); |
| | | if (img1 == null) { |
| | | return imgUrl; |
| | | } |
| | | String url = null; |
| | | String scene = "m_" + memberId; |
| | | String url = "/pages/index/index"; |
| | | String scene = suffix; |
| | | //内容分享海报图片 |
| | | InputStream mpCode = Constants.generateWxMiniImgStream( |
| | | scene, |
| | | "", |
| | | url, |
| | | false);//小程序 |
| | | InputStream inputStream = GeneratePicUtil.generateShareWithUserImg( |
| | | img1 |
| | | InputStream inputStream = GeneratePicUtil.generateShopImg( |
| | | imgUrl |
| | | , mpCode); |
| | | 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 key; |
| | | } |
| | | return url; |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String createShopMiniProgramCode(Integer shopId) throws Exception { |
| | | //内容分享海报图片 |
| | | InputStream inputStream = Constants.generateWxMiniImgStream( |
| | | "sid_"+shopId, |
| | | "/pages/index/index", |
| | | 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 key; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Integer create(InviteRecord inviteRecord) { |
| | | inviteRecordMapper.insert(inviteRecord); |