| | |
| | | // @ApiModelProperty(value = "æ ç¾") |
| | | // private String tagCodes; |
| | | |
| | | @ApiModelProperty(value = "æåºæ¹å¼ NORMAL - é»è®¤ï¼HOT - æçï¼LATEST - ææ°ï¼") |
| | | @ApiModelProperty(value = "æåº é»è®¤ä¸ä¼ ï¼æçgreetï¼ææ°time") |
| | | private String sortType; |
| | | |
| | | @ApiModelProperty(value = "å¤ä¸ªæ ç¾å¯ä¸ç¼ç çå表ï¼å¤ä¸ªæ ç¾å¯ä¸ç¼ç çå表") |
| | |
| | | package com.doumee.biz.zbom.model.zhongtai.response; |
| | | |
| | | import com.doumee.biz.zbom.model.zhongtai.APISpaceCaseVo; |
| | | import com.doumee.dao.business.model.Users; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | |
| | | private List<String> imageurlList; |
| | | |
| | | private Users users; |
| | | |
| | | } |
| | |
| | | // æ£å¼ç为 "release"ï¼ä½éªç为 "trial"ï¼å¼åç为 "develop"ãé»è®¤æ¯æ£å¼çã |
| | | String env_version = "trial"; |
| | | body.put("env_version", env_version); |
| | | if(env_version.equals("release")){ |
| | | if(env_version.equals("release")&&StringUtils.isNotBlank(page)){ |
| | | body.put("page", page); |
| | | } |
| | | // éæï¼æ ¹æ®ä½ çåºæ¯èªè¡è®¾ç½®bodyåæ° |
| | |
| | | @TableField(exist = false) |
| | | private List<Multifile> fileList; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ¥è¯¢åå¸ï¼0=å¦ï¼1=æ¯") |
| | | @TableField(exist = false) |
| | | private Integer isPublish; |
| | | |
| | | @ApiModelProperty(value = "ç´ æç±»å 0æ¨å¹¿èµè®¯ 1å®å¶æå¡", example = "1") |
| | | @ExcelColumn(name="ç´ æç±»å 0æ¨å¹¿èµè®¯ 1å®å¶æå¡") |
| | | private Integer type; |
| | |
| | | |
| | | @ApiModelProperty(value = "纬度", example = "1") |
| | | private BigDecimal latitude; |
| | | |
| | | @ApiModelProperty(value = "æä½äºº", hidden = true) |
| | | private Long userId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.web.reqeust; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/7/25 10:35 |
| | | */ |
| | | @Data |
| | | public class GenerateQRCodeRequest { |
| | | |
| | | @ApiModelProperty(value = "ä¸å¡ç±»åï¼0:产å;1:æ¡ä¾;2:宿¯") |
| | | private Integer businessType; |
| | | |
| | | @ApiModelProperty(value = "ä¸å¡ä¸»é®") |
| | | private String businessId; |
| | | |
| | | @ApiModelProperty(value = "iamç¼ç ") |
| | | private String iamId; |
| | | |
| | | @ApiModelProperty(value = "跳转å°å",hidden = true) |
| | | private String path; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | ZTProductInfoResponse getProductInfo(String id,String userType,Long userId); |
| | | ZTProductInfoResponse getProductInfo(String id,String userType,Long userId,String salesId); |
| | | |
| | | /** |
| | | * ä¸å° - å
¨å±èµè®¯è¯¦æ
|
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | ZTCaseInfoResponse getWholecaseInfo(String id,String userType,Long userId); |
| | | ZTCaseInfoResponse getWholecaseInfo(String id,String userType,Long userId,String salesId); |
| | | |
| | | /** |
| | | * ä¸å° - 产åèµè®¯è¯¦æ
|
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | ZTProductNewsInfoResponse getProductNewsInfo(String id,String userType,Long userId); |
| | | ZTProductNewsInfoResponse getProductNewsInfo(String id,String userType,Long userId,String salesId); |
| | | |
| | | /** |
| | | * ä¸å° - 宿¯æ¡ä¾ |
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | ZTRealcaseInfoResponse getRealcaseInfo(String id,String userType,Long userId); |
| | | ZTRealcaseInfoResponse getRealcaseInfo(String id,String userType,Long userId,String salesId); |
| | | |
| | | /** |
| | | * ä¸å° - æçæ¶è/忬¢å表 |
| | |
| | | import com.doumee.dao.business.model.Users; |
| | | import com.doumee.dao.web.reqeust.ContentShareImgDto; |
| | | import com.doumee.dao.web.reqeust.EditUsersRequest; |
| | | import com.doumee.dao.web.reqeust.GenerateQRCodeRequest; |
| | | import com.doumee.dao.web.reqeust.WxPhoneRequest; |
| | | import com.doumee.dao.web.response.AccountResponse; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | ZTBaseRequst logOff(Long userId,String token); |
| | | |
| | | AccountResponse getWxMiniPhoneLogin(WxPhoneRequest wxPhoneRequest); |
| | | |
| | | InputStream getQrCode(GenerateQRCodeRequest generateQRCodeRequest); |
| | | } |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | Users users = usersMapper.selectById(crmCustomerListRequest.getUserId()); |
| | | crmCustomerListRequest.setUserName(users.getIamUsername()); |
| | | if(StringUtils.isBlank(crmCustomerListRequest.getUserName())){ |
| | | Users users = usersMapper.selectById(crmCustomerListRequest.getUserId()); |
| | | crmCustomerListRequest.setUserName(users.getIamUsername()); |
| | | } |
| | | CRMBaseResponse<List<CRMCustomerListResponse>> crmBaseResponse = zbomCRMService.getCustomerList(crmCustomerListRequest); |
| | | if(Objects.isNull(crmBaseResponse)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"CRMæ¥å£è¯·æ±å¤±è´¥!"); |
| | |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.CustomerUserMapper; |
| | | import com.doumee.dao.business.IamInterfaceLogMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.UsersMapper; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.Users; |
| | | import com.doumee.dao.web.response.ZSZXCatalogResponse; |
| | | import com.doumee.dao.web.response.ZTBaseInfoResponse; |
| | | import com.doumee.service.business.GetZhongTaiDataService; |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private CustomerUserMapper customerUserMapper; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | |
| | | |
| | | |
| | | @Override |
| | | public ZTProductInfoResponse getProductInfo(String id,String userType,Long userId){ |
| | | public ZTProductInfoResponse getProductInfo(String id,String userType,Long userId,String salesId){ |
| | | //æ¥è¯¢ ä¸å° TOKEN |
| | | ZTBaseInfoResponse ztBaseInfoResponse = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,userId,userType); |
| | | ZTContentInfoRequest ztContentListRequest = new ZTContentInfoRequest(); |
| | |
| | | ztContentListRequest.setId(id); |
| | | ZTProductInfoResponse response = zbomZhongTaiService.getProductInfo(ztContentListRequest); |
| | | if(Objects.nonNull(response)){ |
| | | //æ¥è¯¢å¯¼è´ä¿¡æ¯ è¿è¡ä¿¡æ¯ç»å®ä¸è¿å |
| | | if(StringUtils.isNotBlank(salesId)){ |
| | | Users users = usersMapper.selectById(salesId); |
| | | if(Objects.nonNull(users)){ |
| | | MemberServiceImpl.saveCustomerUser(customerUserMapper,users,userId); |
| | | String prefix = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode()) + |
| | | StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.USERS_FILE).getCode()); |
| | | if(StringUtils.isNotBlank(users.getImgurl())){ |
| | | users.setImgurlFull(prefix + users.getImgurl()); |
| | | } |
| | | response.setUsers(users); |
| | | } |
| | | } |
| | | List<String> stringList = new ArrayList<String>(); |
| | | if (StringUtils.isNotBlank(response.getCoverImage())) { |
| | | stringList.add(response.getCoverImage()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ZTCaseInfoResponse getWholecaseInfo(String id,String userType,Long userId){ |
| | | public ZTCaseInfoResponse getWholecaseInfo(String id,String userType,Long userId,String salesId){ |
| | | //æ¥è¯¢ ä¸å° TOKEN |
| | | ZTBaseInfoResponse ztBaseInfoResponse = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,userId,userType); |
| | | ZTContentInfoRequest ztContentListRequest = new ZTContentInfoRequest(); |
| | |
| | | ztContentListRequest.setUserType(ztBaseInfoResponse.getUserType()); |
| | | ztContentListRequest.setId(id); |
| | | ZTCaseInfoResponse response = zbomZhongTaiService.getWholecaseInfo(ztContentListRequest); |
| | | List<String> stringList = new ArrayList<String>(); |
| | | if (StringUtils.isNotBlank(response.getCoverImage())) { |
| | | stringList.add(response.getCoverImage()); |
| | | } |
| | | if(Objects.nonNull(response.getLayoutUlr())){ |
| | | stringList.add(response.getLayoutUlr()); |
| | | } |
| | | APISpaceCaseVo[] apiSpaceCaseVoList = response.getApiSpaceCaseVos(); |
| | | if(Objects.nonNull(apiSpaceCaseVoList)){ |
| | | for (APISpaceCaseVo apiSpaceCaseVo:apiSpaceCaseVoList) { |
| | | if(StringUtils.isNotBlank(apiSpaceCaseVo.getCoverImage())){ |
| | | stringList.add(apiSpaceCaseVo.getCoverImage()); |
| | | } |
| | | if(Objects.nonNull(apiSpaceCaseVo.getImgList())){ |
| | | stringList.addAll(Arrays.asList(apiSpaceCaseVo.getImgList())); |
| | | if(Objects.nonNull(response)){ |
| | | //æ¥è¯¢å¯¼è´ä¿¡æ¯ è¿è¡ä¿¡æ¯ç»å®ä¸è¿å |
| | | if(StringUtils.isNotBlank(salesId)){ |
| | | Users users = usersMapper.selectById(salesId); |
| | | if(Objects.nonNull(users)){ |
| | | MemberServiceImpl.saveCustomerUser(customerUserMapper,users,userId); |
| | | String prefix = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode()) + |
| | | StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.USERS_FILE).getCode()); |
| | | if(StringUtils.isNotBlank(users.getImgurl())){ |
| | | users.setImgurlFull(prefix + users.getImgurl()); |
| | | } |
| | | response.setUsers(users); |
| | | } |
| | | } |
| | | List<String> stringList = new ArrayList<String>(); |
| | | if (StringUtils.isNotBlank(response.getCoverImage())) { |
| | | stringList.add(response.getCoverImage()); |
| | | } |
| | | if(Objects.nonNull(response.getLayoutUlr())){ |
| | | stringList.add(response.getLayoutUlr()); |
| | | } |
| | | APISpaceCaseVo[] apiSpaceCaseVoList = response.getApiSpaceCaseVos(); |
| | | if(Objects.nonNull(apiSpaceCaseVoList)){ |
| | | for (APISpaceCaseVo apiSpaceCaseVo:apiSpaceCaseVoList) { |
| | | if(StringUtils.isNotBlank(apiSpaceCaseVo.getCoverImage())){ |
| | | stringList.add(apiSpaceCaseVo.getCoverImage()); |
| | | } |
| | | if(Objects.nonNull(apiSpaceCaseVo.getImgList())){ |
| | | stringList.addAll(Arrays.asList(apiSpaceCaseVo.getImgList())); |
| | | } |
| | | } |
| | | } |
| | | response.setImageurlList(stringList); |
| | | } |
| | | response.setImageurlList(stringList); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public ZTProductNewsInfoResponse getProductNewsInfo(String id,String userType,Long userId){ |
| | | public ZTProductNewsInfoResponse getProductNewsInfo(String id,String userType,Long userId,String salesId){ |
| | | //æ¥è¯¢ ä¸å° TOKEN |
| | | ZTBaseInfoResponse ztBaseInfoResponse = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,userId,userType); |
| | | ZTContentInfoRequest ztContentListRequest = new ZTContentInfoRequest(); |
| | |
| | | ztContentListRequest.setId(id); |
| | | ZTProductNewsInfoResponse response = zbomZhongTaiService.getProductNewsInfo(ztContentListRequest); |
| | | if(Objects.nonNull(response)){ |
| | | //æ¥è¯¢å¯¼è´ä¿¡æ¯ è¿è¡ä¿¡æ¯ç»å®ä¸è¿å |
| | | if(StringUtils.isNotBlank(salesId)){ |
| | | Users users = usersMapper.selectById(salesId); |
| | | if(Objects.nonNull(users)){ |
| | | MemberServiceImpl.saveCustomerUser(customerUserMapper,users,userId); |
| | | String prefix = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode()) + |
| | | StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.USERS_FILE).getCode()); |
| | | if(StringUtils.isNotBlank(users.getImgurl())){ |
| | | users.setImgurlFull(prefix + users.getImgurl()); |
| | | } |
| | | response.setUsers(users); |
| | | } |
| | | } |
| | | List<String> stringList = new ArrayList<String>(); |
| | | if (StringUtils.isNotBlank(response.getCoverImage())) { |
| | | stringList.add(response.getCoverImage()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ZTRealcaseInfoResponse getRealcaseInfo(String id,String userType,Long userId){ |
| | | public ZTRealcaseInfoResponse getRealcaseInfo(String id,String userType,Long userId,String salesId){ |
| | | //æ¥è¯¢ ä¸å° TOKEN |
| | | ZTBaseInfoResponse ztBaseInfoResponse = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,userId,userType); |
| | | ZTContentInfoRequest ztContentListRequest = new ZTContentInfoRequest(); |
| | |
| | | ztContentListRequest.setId(id); |
| | | ZTRealcaseInfoResponse response = zbomZhongTaiService.getRealcaseInfo(ztContentListRequest); |
| | | if(Objects.nonNull(response)){ |
| | | //æ¥è¯¢å¯¼è´ä¿¡æ¯ è¿è¡ä¿¡æ¯ç»å®ä¸è¿å |
| | | if(StringUtils.isNotBlank(salesId)){ |
| | | Users users = usersMapper.selectById(salesId); |
| | | if(Objects.nonNull(users)){ |
| | | MemberServiceImpl.saveCustomerUser(customerUserMapper,users,userId); |
| | | String prefix = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode()) + |
| | | StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.USERS_FILE).getCode()); |
| | | if(StringUtils.isNotBlank(users.getImgurl())){ |
| | | users.setImgurlFull(prefix + users.getImgurl()); |
| | | } |
| | | response.setUsers(users); |
| | | } |
| | | } |
| | | List<String> stringList = new ArrayList<String>(); |
| | | if (StringUtils.isNotBlank(response.getCoverImage())) { |
| | | stringList.add(response.getCoverImage()); |
| | |
| | | |
| | | |
| | | @Override |
| | | public AccountResponse wxLogin(String code,String iamId){ |
| | | public AccountResponse wxLogin(String code,String userId){ |
| | | try { |
| | | // è·åå¾®ä¿¡æææ°æ® |
| | | WxMaJscode2SessionResult session = WxMiniConfig.wxCustomerService.getUserService().getSessionInfo(code); |
| | |
| | | // String openId = code; |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().eq("OPENID", openId).isNotNull("phone")); |
| | | Users users = new Users(); |
| | | if(StringUtils.isNotBlank(iamId)){ |
| | | users = usersMapper.selectOne(new QueryWrapper<Users>().lambda() |
| | | .eq(Users::getIamId,iamId) |
| | | .last("limit 1") |
| | | ); |
| | | if(StringUtils.isNotBlank(userId)){ |
| | | users = usersMapper.selectById(userId); |
| | | } |
| | | if (member == null) { |
| | | member = new Member(); |
| | |
| | | member.setToken(ztUserGetTokenResponse.getToken()); |
| | | } |
| | | memberMapper.insert(member); |
| | | this.saveCustomerUser(users,member.getId()); |
| | | MemberServiceImpl.saveCustomerUser(customerUserMapper,users,member.getId()); |
| | | }else{ |
| | | ZTUserGetTokenResponse ztUserGetTokenResponse = this.syncZhongTaiUser(member); |
| | | if(!Objects.isNull(ztUserGetTokenResponse)){ |
| | | member.setToken(ztUserGetTokenResponse.getToken()); |
| | | memberMapper.updateById(member); |
| | | } |
| | | this.saveCustomerUser(users,member.getId()); |
| | | MemberServiceImpl.saveCustomerUser(customerUserMapper,users,member.getId()); |
| | | member = this.getMemberInfo(member.getId()); |
| | | } |
| | | String token = JwtTokenUtil.generateTokenForZb(member.getId(),ZTConstants.CUSTOMER, JSONObject.toJSON(member).toString(),redisTemplate); |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"微信ç»å½å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | public void saveCustomerUser(Users users,Long memberId){ |
| | | public static void saveCustomerUser(CustomerUserMapper customerUserMapper,Users users,Long memberId){ |
| | | if(Objects.nonNull(users)&&Objects.nonNull(memberId)) { |
| | | if (customerUserMapper.selectCount(new QueryWrapper<CustomerUser>().lambda() |
| | | .eq(CustomerUser::getIsdeleted, Constants.ZERO) |
| | |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.eq(News::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if(pageWrap.getModel().getIsPublish()!=null && Constants.equalsInteger(pageWrap.getModel().getIsPublish(),Constants.ONE)){ |
| | | queryWrapper.apply(" now() >= t.PUBLISH_DATE "); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.eq(News::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | |
| | | dailyUpdatesResponse.setShareNum( |
| | | actionsMapper.selectCount(new QueryWrapper<Actions>()) |
| | | ); |
| | | dailyUpdatesResponse.setNewsList( |
| | | this.getCustomizedNewsList(Constants.ZERO,Constants.THREE,Constants.ZERO) |
| | | List<News> list = newsMapper.selectList(new QueryWrapper<News>().lambda() |
| | | .eq(News::getIsdeleted,Constants.ZERO) |
| | | .eq(News::getType,Constants.ZERO) |
| | | .eq(News::getStatus,Constants.ZERO) |
| | | .eq(News::getFileType,Constants.ZERO) |
| | | .last( "limit 3" ) |
| | | .orderByDesc(News::getCreateDate) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(list)){ |
| | | List<Long> idList = list.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<Multifile> files = dealMultifileList(idList); |
| | | for(News model : list){ |
| | | setFilelistById(model,files); |
| | | } |
| | | } |
| | | dailyUpdatesResponse.setNewsList(list); |
| | | return dailyUpdatesResponse; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void updateById(Shop shop) { |
| | | shopMapper.updateById(shop); |
| | | usersMapper.update(new UpdateWrapper<Users>().lambda() |
| | | .set(Users::getCardImg,null) |
| | | .isNotNull(Users::getCardImg) |
| | | .eq(Users::getDepartmentId,shop.getId()) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | |
| | | Shop updShop = new Shop(); |
| | | BeanUtils.copyProperties(editShopDTO,updShop); |
| | | shopMapper.updateById(updShop); |
| | | usersMapper.update(new UpdateWrapper<Users>().lambda() |
| | | .set(Users::getCardImg,null) |
| | | .isNotNull(Users::getCardImg) |
| | | .eq(Users::getDepartmentId,shop.getId()) |
| | | ); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.web.reqeust.EditUsersRequest; |
| | | import com.doumee.dao.web.reqeust.ContentShareImgDto; |
| | | import com.doumee.dao.web.reqeust.GenerateQRCodeRequest; |
| | | import com.doumee.dao.web.reqeust.WxPhoneRequest; |
| | | import com.doumee.dao.web.response.AccountResponse; |
| | | import com.doumee.service.business.UsersService; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.interfaces.MPJBaseJoin; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import okhttp3.Response; |
| | | import org.apache.catalina.User; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.InputStream; |
| | | import java.util.*; |
| | | import java.util.concurrent.Callable; |
| | |
| | | |
| | | @Override |
| | | public String getContentShareImg(Users users, ContentShareImgDto param){ |
| | | users = usersMapper.selectById(users.getId()); |
| | | this.getUsersDetail(users); |
| | | if(StringUtils.isBlank(param.getImgurl())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | //å
容å享海æ¥å¾ç |
| | | InputStream mpCode = Constants.generateWxMiniImgStream(systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG, Constants.WX_TOKEN_CUSTOMER).getCode(), |
| | | //"userId="+users.getId()+"&articleId="+param.getArticleId(), |
| | | param.getArticleId()+"&"+users.getId(), |
| | | param.getArticleId()+"_"+users.getId(), |
| | | param.getPageUrl());//å°ç¨åº |
| | | |
| | | InputStream inputStream = GeneratePicUtil.generateShareWithUserImg( |
| | |
| | | String url =null; |
| | | //å
容å享海æ¥å¾ç |
| | | InputStream mpCode = Constants.generateWxMiniImgStream(systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG, Constants.WX_TOKEN_CUSTOMER).getCode(), |
| | | "userId="+users.getId()+"&articleId="+param.getArticleId(), |
| | | param.getArticleId()+"_"+users.getId(), |
| | | param.getPageUrl());//å°ç¨åº |
| | | |
| | | String title = systemDictDataBiz.queryByCode(Constants.WEIXIN_DEFAULT_IMGS, Constants.SHARE_HAIBAO_HEADER_TITLE).getCode(); |
| | |
| | | |
| | | @Override |
| | | public String getUserCard(Users users){ |
| | | users = usersMapper.selectById(users.getId()); |
| | | this.getUsersDetail(users); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.RESOURCE_PATH).getCode(); |
| | | String folder = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.USERS_FILE).getCode(); |
| | | if(StringUtils.isNotBlank(users.getCardImg()) && !StringUtils.equals(users.getCardImg(),"-")){ |
| | |
| | | Shop shop = shopMapper.selectById(users.getDepartmentId()); |
| | | if(Objects.nonNull(shop)){ |
| | | users.setShopName(shop.getName()); |
| | | users.setShopCity(shop.getProvinceName()+shop.getCityName()+shop.getAreaName()); |
| | | if(!(StringUtils.isBlank(shop.getProvinceName())||StringUtils.isBlank(shop.getCityName())||StringUtils.isBlank(shop.getAreaName()))){ |
| | | users.setShopCity(shop.getProvinceName()+shop.getCityName()+shop.getAreaName()); |
| | | } |
| | | if(StringUtils.isNotBlank(shop.getAddress())){ |
| | | users.setShopAddress(shop.getAddress()); |
| | | }else{ |
| | |
| | | return ztBaseRequst; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public InputStream getQrCode(GenerateQRCodeRequest generateQRCodeRequest){ |
| | | if(Objects.isNull(generateQRCodeRequest) |
| | | ||StringUtils.isBlank(generateQRCodeRequest.getIamId()) |
| | | || StringUtils.isBlank(generateQRCodeRequest.getBusinessId()) |
| | | || Objects.isNull(generateQRCodeRequest.getBusinessType())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(generateQRCodeRequest.getBusinessType()<Constants.ZERO || generateQRCodeRequest.getBusinessType() > Constants.THREE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ä¸å¡ç±»åé误"); |
| | | } |
| | | Users users = usersMapper.selectOne(new QueryWrapper<Users>().lambda().eq(Users::getIamId, |
| | | generateQRCodeRequest.getIamId()).last("limit 1")); |
| | | if(Objects.isNull(users)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å工信æ¯"); |
| | | } |
| | | InputStream inputStream = Constants.generateWxMiniImgStream( |
| | | systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG, Constants.WX_TOKEN_CUSTOMER).getCode(), |
| | | generateQRCodeRequest.getBusinessId()+"_"+generateQRCodeRequest.getBusinessType()+"_"+users.getId(), |
| | | null);//å°ç¨åº |
| | | return inputStream; |
| | | // try { |
| | | // ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | | // byte[] buffer = new byte[1024]; |
| | | // int len = -1; |
| | | // while ((len = inputStream.read(buffer)) != -1) { |
| | | // baos.write(buffer, 0, len); |
| | | // } |
| | | // return "data:mediatype;base64," + Base64.getEncoder().encodeToString(baos.toByteArray()); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"äºç»´ç çæå¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | |
| | | private ActionsService actionsService; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "客æ·ç«¯å°ç¨åºç»é", notes = "客æ·ç«¯å°ç¨åº") |
| | | @GetMapping("/wxLoginCustomer") |
| | | @ApiImplicitParams({ |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "id", value = "å
容主é®", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "salesId", value = "导è´ä¸»é®ï¼äºç»´ç å享ï¼", required = false), |
| | | }) |
| | | public ApiResponse<ZTCaseInfoResponse> getWholecaseInfo(@RequestParam String id) { |
| | | ZTCaseInfoResponse ztCaseInfoResponse= getZhongTaiDataService.getWholecaseInfo(id,getUserType(),getMemberId()); |
| | | public ApiResponse<ZTCaseInfoResponse> getWholecaseInfo(@RequestParam String id,String salesId) { |
| | | ZTCaseInfoResponse ztCaseInfoResponse= getZhongTaiDataService.getWholecaseInfo(id,getUserType(),getMemberId(),salesId); |
| | | return ApiResponse.success("æ¥è¯¢æå",ztCaseInfoResponse); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "id", value = "å
容主é®", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "salesId", value = "导è´ä¸»é®ï¼äºç»´ç å享ï¼", required = false), |
| | | }) |
| | | public ApiResponse<ZTProductNewsInfoResponse> getProductNewsInfo(@RequestParam String id) { |
| | | ZTProductNewsInfoResponse ztProductNewsInfoResponse= getZhongTaiDataService.getProductNewsInfo(id,getUserType(),getMemberId()); |
| | | public ApiResponse<ZTProductNewsInfoResponse> getProductNewsInfo(@RequestParam String id,String salesId) { |
| | | ZTProductNewsInfoResponse ztProductNewsInfoResponse= getZhongTaiDataService.getProductNewsInfo(id,getUserType(),getMemberId(),salesId); |
| | | return ApiResponse.success("æ¥è¯¢æå",ztProductNewsInfoResponse); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "id", value = "å
容主é®", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "salesId", value = "导è´ä¸»é®ï¼äºç»´ç å享ï¼", required = false), |
| | | }) |
| | | public ApiResponse<ZTRealcaseInfoResponse> getRealcaseInfo(@RequestParam String id) { |
| | | ZTRealcaseInfoResponse ztRealcaseInfoResponse= getZhongTaiDataService.getRealcaseInfo(id,getUserType(),getMemberId()); |
| | | public ApiResponse<ZTRealcaseInfoResponse> getRealcaseInfo(@RequestParam String id,String salesId) { |
| | | ZTRealcaseInfoResponse ztRealcaseInfoResponse= getZhongTaiDataService.getRealcaseInfo(id,getUserType(),getMemberId(),salesId); |
| | | return ApiResponse.success("æ¥è¯¢æå",ztRealcaseInfoResponse); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @UserLoginRequired |
| | | @LoginRequired |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "id", value = "å
容主é®", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "salesId", value = "导è´ä¸»é®ï¼äºç»´ç å享ï¼", required = false), |
| | | }) |
| | | public ApiResponse<ZTProductInfoResponse> getProductInfo(@RequestParam String id) { |
| | | ZTProductInfoResponse ztProductInfoResponse= getZhongTaiDataService.getProductInfo(id,getUserType(),getMemberId()); |
| | | public ApiResponse<ZTProductInfoResponse> getProductInfo(@RequestParam String id,String salesId) { |
| | | ZTProductInfoResponse ztProductInfoResponse= getZhongTaiDataService.getProductInfo(id,getUserType(),getMemberId(),salesId); |
| | | return ApiResponse.success("æ¥è¯¢æå",ztProductInfoResponse); |
| | | } |
| | | |
| | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.News; |
| | | import com.doumee.dao.web.reqeust.GenerateQRCodeRequest; |
| | | import com.doumee.dao.web.response.DailyUpdatesResponse; |
| | | import com.doumee.dao.web.response.ZSZXCatalogResponse; |
| | | import com.doumee.service.business.GetZhongTaiDataService; |
| | | import com.doumee.service.business.NewsService; |
| | | import com.doumee.service.business.SmsEmailService; |
| | | import com.doumee.service.business.UsersService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | @Autowired |
| | | public GetZhongTaiDataService getZhongTaiDataService; |
| | | |
| | | @Autowired |
| | | public UsersService usersService; |
| | | |
| | | |
| | | @UserLoginRequired |
| | | @LoginRequired |
| | |
| | | public ApiResponse<ZSZXCatalogResponse> getZSZXCatalogs() { |
| | | return ApiResponse.success(getZhongTaiDataService.getZSZXCatalogs(getMemberId(),getUserType())); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<PageData<News>> newsPage (@RequestBody PageWrap<News> pageWrap) { |
| | | pageWrap.getModel().setIsPublish(Constants.ONE); |
| | | return ApiResponse.success(newsService.findPage(pageWrap)); |
| | | } |
| | | |
| | |
| | | public ApiResponse<String> getCrmAuthUrl(@RequestParam Integer type) { |
| | | return ApiResponse.success(zbomCRMService.getCrmGoUrl(this.getLoginUserInfo().getIamUsername(),type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "çæå°ç¨åºç ", notes = "PAD端") |
| | | @PostMapping("/getQrCode") |
| | | public void getQrCode(@RequestBody GenerateQRCodeRequest generateQRCodeRequest, HttpServletResponse response) { |
| | | try{ |
| | | response.setHeader("Cache-Control", "no-store, no-cache"); |
| | | response.setContentType("image/jpeg"); |
| | | InputStream inputStream = usersService.getQrCode(generateQRCodeRequest); |
| | | ImageIO.write(ImageIO.read(inputStream),"png",response.getOutputStream()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.doumee.dao.business.model.Shop; |
| | | import com.doumee.dao.business.model.SmsEmail; |
| | | import com.doumee.dao.business.model.Users; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.web.reqeust.*; |
| | | import com.doumee.dao.web.response.AccountResponse; |
| | | import com.doumee.service.business.*; |
| | | import com.doumee.service.system.SystemDictDataService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | |
| | | @UserLoginRequired |
| | | @LoginRequired |
| | | @ApiOperation(value = "æ´æ°token", notes = "å工端å°ç¨åº") |
| | | @GetMapping("/updateToken") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse updateToken () { |
| | | systemDictDataBiz.updWxMiniToken(); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @UserLoginRequired |
| | | @ApiOperation(value = "è·åå
容å享海æ¥", notes = "è·åå
容å享海æ¥ï¼å å°ç¨åºç ") |