k94314517
2024-07-24 6a475442955b0ffb480facb92f6a23aa325034ec
代码提交
已修改7个文件
148 ■■■■ 文件已修改
server/service/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCaseInfoResponse.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/Constants.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/GetZhongTaiDataServiceImpl.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/CustomerApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/PersonnelApi.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/system/impl/SystemDictDataBizImpl.java
@@ -15,6 +15,7 @@
import com.doumee.service.system.SystemDictService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.DefaultSecurityManager;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -189,29 +190,20 @@
        updWxMiniTokenDo(Constants.WX_APPID_PERSONNEL,Constants.WX_SECRET_PERSONNEL,Constants.WX_TOKEN_PERSONNEL);
    }
    public  void updWxMiniTokenDo(String  appID,String appKey,String token) {
        String appId = queryByCode(Constants.WX_MINI_CONFIG,appID).getCode();
        String appSecret = queryByCode(Constants.WX_MINI_CONFIG,appKey).getCode();
    public  void updWxMiniTokenDo(String  appIdKey,String secretKey,String tokenKey) {
        DefaultSecurityManager securityManager = new DefaultSecurityManager();
        SecurityUtils.setSecurityManager(securityManager);
        String appId = queryByCode(Constants.WX_MINI_CONFIG,appIdKey).getCode();
        String appSecret = queryByCode(Constants.WX_MINI_CONFIG,secretKey).getCode();
        SystemDictData systemDictData = this.queryByCode(Constants.WX_MINI_CONFIG,tokenKey);
        //生成微信token
        String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appId+"&secret="+appSecret;
        String response = HttpsUtil.sendGet(url);
        JSONObject json = JSONObject.parseObject(response);
        SystemDictData systemDictData = queryByCode(Constants.WX_MINI_CONFIG,token);
        systemDictData.setCode(json.getString("access_token"));
        systemDictData.setUpdateTime(new Date());
        updateByIdNew(systemDictData);
          appId = queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_APPID_PERSONNEL).getCode();
          appSecret = queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_APPID_PERSONNEL).getCode();
        //生成微信token
          url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appId+"&secret="+appSecret;
          response = HttpsUtil.sendGet(url);
          json = JSONObject.parseObject(response);
          systemDictData = queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_TOKEN_PERSONNEL);
        systemDictData.setCode(json.getString("access_token"));
        systemDictData.setUpdateTime(new Date());
        updateByIdNew(systemDictData);
        systemDictDataService.updateById(systemDictData);
    }
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCaseInfoResponse.java
@@ -13,8 +13,7 @@
@Data
public class ZTCaseInfoResponse extends ZTImageListResponse implements Serializable {
    private APISpaceCaseVo[] apiSpaceCaseVos;
    private List<String> imageurlList;
    private String caseInfo;
    /**
     * 收藏量
server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -678,8 +678,11 @@
        // 场景码,与前端约定,最终是需要前端解析
        body.put("scene", scene);
        // 正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
        body.put("env_version", "develop");
        body.put("page", page);
        String env_version = "trial";
        body.put("env_version", env_version);
        if(env_version.equals("release")){
            body.put("page", page);
        }
        // 透明,根据你的场景自行设置body参数
        body.put("is_hyaline", true);
        OkHttpClient client = new OkHttpClient().newBuilder().build();
@@ -691,7 +694,7 @@
            Response response = client.newCall(request).execute();
            if (response.isSuccessful()) {
                InputStream inputStream = new ByteArrayInputStream(response.body().bytes());
          /*      ByteArrayOutputStream baos = new ByteArrayOutputStream();
              /* ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    byte[] buffer = new byte[1024];
                    int len = -1;
                    while ((len = inputStream.read(buffer)) != -1) {
server/service/src/main/java/com/doumee/service/business/impl/GetZhongTaiDataServiceImpl.java
@@ -26,10 +26,7 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
/**
 * Created by IntelliJ IDEA.
@@ -283,6 +280,33 @@
        ztContentListRequest.setUserType(ztBaseInfoResponse.getUserType());
        ztContentListRequest.setId(id);
        ZTProductInfoResponse response = zbomZhongTaiService.getProductInfo(ztContentListRequest);
        if(Objects.nonNull(response)){
            List<String> stringList = new ArrayList<String>();
            if (StringUtils.isNotBlank(response.getCoverImage())) {
                stringList.add(response.getCoverImage());
            }
            if(Objects.nonNull(response.getBannerImgList())){
                stringList.addAll(Arrays.asList(response.getBannerImgList()));
            }
            if(StringUtils.isNotBlank(response.getContent())){
                // 添加 富文本 图片
                stringList.addAll(Constants.getImgsFromHtmlText(response.getContent()));
            }
            List<ZTSpaceInfoResponse> ztSpaceInfoResponseList = response.getSpaceList();
            if(CollectionUtils.isNotEmpty(ztSpaceInfoResponseList)){
                for (ZTSpaceInfoResponse ztSpaceInfoResponse:ztSpaceInfoResponseList) {
                    if(StringUtils.isNotBlank(ztSpaceInfoResponse.getSpaceImg())){
                        stringList.add(ztSpaceInfoResponse.getSpaceImg());
                    }
                    if(StringUtils.isNotBlank(ztSpaceInfoResponse.getSpaceContent())){
                        //添加 富文本 图片
                        stringList.addAll(Constants.getImgsFromHtmlText(ztSpaceInfoResponse.getSpaceContent()));
                    }
                }
            }
            response.setImageurlList(stringList);
        }
        return response;
    }
@@ -295,7 +319,25 @@
        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()));
                }
            }
        }
        response.setImageurlList(stringList);
        return response;
    }
@@ -308,6 +350,32 @@
        ztContentListRequest.setUserType(ztBaseInfoResponse.getUserType());
        ztContentListRequest.setId(id);
        ZTProductNewsInfoResponse response = zbomZhongTaiService.getProductNewsInfo(ztContentListRequest);
        if(Objects.nonNull(response)){
            List<String> stringList = new ArrayList<String>();
            if (StringUtils.isNotBlank(response.getCoverImage())) {
                stringList.add(response.getCoverImage());
            }
            if(Objects.nonNull(response.getBannerImgList())){
                stringList.addAll(Arrays.asList(response.getBannerImgList()));
            }
            if(StringUtils.isNotBlank(response.getContent())){
                stringList.addAll(Constants.getImgsFromHtmlText(response.getContent()));
            }
            List<ZTSpaceInfoResponse> ztSpaceInfoResponseList = response.getSpaceList();
            if(CollectionUtils.isNotEmpty(ztSpaceInfoResponseList)){
                for (ZTSpaceInfoResponse ztSpaceInfoResponse:ztSpaceInfoResponseList) {
                    if(StringUtils.isNotBlank(ztSpaceInfoResponse.getSpaceImg())){
                        stringList.add(ztSpaceInfoResponse.getSpaceImg());
                    }
                    if(StringUtils.isNotBlank(ztSpaceInfoResponse.getSpaceContent())){
                        //添加 富文本 图片
                        stringList.addAll(Constants.getImgsFromHtmlText(ztSpaceInfoResponse.getSpaceContent()));
                    }
                }
            }
            response.setImageurlList(stringList);
        }
        return response;
    }
@@ -320,6 +388,16 @@
        ztContentListRequest.setUserType(ztBaseInfoResponse.getUserType());
        ztContentListRequest.setId(id);
        ZTRealcaseInfoResponse response = zbomZhongTaiService.getRealcaseInfo(ztContentListRequest);
        if(Objects.nonNull(response)){
            List<String> stringList = new ArrayList<String>();
            if (StringUtils.isNotBlank(response.getCoverImage())) {
                stringList.add(response.getCoverImage());
            }
            if(Objects.nonNull(response.getContentImgList())){
                stringList.addAll(Arrays.asList(response.getContentImgList()));
            }
            response.setImageurlList(stringList);
        }
        return response;
    }
server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java
@@ -699,7 +699,8 @@
        String url =null;
        //内容分享海报图片
        InputStream mpCode =  Constants.generateWxMiniImgStream(systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG, Constants.WX_TOKEN_CUSTOMER).getCode(),
                "userId="+users.getId()+"&articleId="+param.getArticleId(),
                //"userId="+users.getId()+"&articleId="+param.getArticleId(),
                 param.getArticleId()+"&"+users.getId(),
                param.getPageUrl());//小程序
        InputStream inputStream = GeneratePicUtil.generateShareWithUserImg(
server/web/src/main/java/com/doumee/api/web/CustomerApi.java
@@ -83,6 +83,9 @@
    @Autowired
    private ActionsService actionsService;
    @ApiOperation(value = "客户端小程序登陆", notes = "客户端小程序")
    @GetMapping("/wxLoginCustomer")
    @ApiImplicitParams({
@@ -328,6 +331,7 @@
    @UserLoginRequired
    @LoginRequired
    @ApiOperation(value = "行为内容接口 - 中台", notes = "客户端小程序")
    @GetMapping("/actionDo")
@@ -341,6 +345,7 @@
        return ApiResponse.success("操作成功");
    }
    @UserLoginRequired
    @LoginRequired
    @ApiOperation(value = "定制服务列表", notes = "客户端小程序")
    @GetMapping("/getCustomizedNewsList")
@@ -351,6 +356,7 @@
        return ApiResponse.success("查询成功",newsService.getCustomizedNewsList(Constants.ONE,null,null));
    }
    @UserLoginRequired
    @LoginRequired
    @ApiOperation(value = "定制服务详情", notes = "客户端小程序")
    @GetMapping("/getCustomizedNewsDetail")
@@ -435,6 +441,10 @@
    }
    @UserLoginRequired
    @LoginRequired
    @ApiOperation(value = "产品分页列表 - 中台", notes = "客户端小程序")
server/web/src/main/java/com/doumee/api/web/PersonnelApi.java
@@ -1,5 +1,6 @@
package com.doumee.api.web;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.biz.zbom.ZbomCRMService;
import com.doumee.biz.zbom.model.crm.CrmCustomerListRequest;
import com.doumee.biz.zbom.model.crm.response.CRMBaseResponse;
@@ -60,6 +61,7 @@
    @Autowired
    private GetZhongTaiDataService getZhongTaiDataService;
    @ApiOperation(value = "小程序登陆", notes = "员工端小程序")
    @GetMapping("/loginByWx")
@@ -179,8 +181,15 @@
    }
    @UserLoginRequired
    @ApiOperation(value = "获取内容分享海报", notes = "获取内容分享海报,加小程序码")
    @PostMapping("/getContentShareImg")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true)
    })
    public ApiResponse<String> getContentShareImg(@RequestBody ContentShareImgDto param) {
        return  ApiResponse.success(usersService.getContentShareImg(this.getLoginUserInfo(),param));
    }