| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.biz.zbom.ZbomZhongTaiService; |
| | | import com.doumee.biz.zbom.model.zhongtai.ZTCatalogListRequest; |
| | | import com.doumee.biz.zbom.model.zhongtai.ZTConstants; |
| | | import com.doumee.biz.zbom.model.zhongtai.ZTContentInfoRequest; |
| | | import com.doumee.biz.zbom.model.zhongtai.ZTContentListRequest; |
| | | import com.doumee.biz.zbom.model.zhongtai.response.*; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.dao.business.IamInterfaceLogMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.UsersMapper; |
| | | import com.doumee.service.business.GetZhongTaiDataService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/7/15 14:12 |
| | | */ |
| | | @Service |
| | | public class GetZhongTaiDataServiceImpl implements GetZhongTaiDataService { |
| | | |
| | | @Autowired |
| | | private ZbomZhongTaiService zbomZhongTaiService; |
| | | |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Autowired |
| | | private UsersMapper usersMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest ztCatalogListRequest){ |
| | | if(Objects.isNull(ztCatalogListRequest) |
| | | || StringUtils.isBlank(ztCatalogListRequest.getCatalogCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.CHANPING) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZIXUN) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.QW_CASE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å类信æ¯é误"); |
| | | } |
| | | return zbomZhongTaiService.getCatalogList(ztCatalogListRequest); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ZTTagInfoResponse> getCataLogTagList(ZTCatalogListRequest ztCatalogListRequest){ |
| | | if(Objects.isNull(ztCatalogListRequest) |
| | | || StringUtils.isBlank(ztCatalogListRequest.getCatalogCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.CHANPING) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZIXUN) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.QW_CASE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å类信æ¯é误"); |
| | | } |
| | | return zbomZhongTaiService.getTagList(ztCatalogListRequest); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åç¶åçº§ç»ææ°æ®å表 |
| | | * å¿è¯´è£
ä¿® zb_deco 产å product_intro èµè®¯product_info å
¨å±æ¡ä¾ whole_case |
| | | * è·åç¶åçº§ç»ææ°æ® |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ZTCatalogInfoResponse> getZTCatalogInfoResponse(ZTCatalogListRequest ztCatalogListRequest){ |
| | | if(Objects.isNull(ztCatalogListRequest) |
| | | || StringUtils.isBlank(ztCatalogListRequest.getCatalogCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.CHANPING) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZIXUN) |
| | | ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.QW_CASE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å类信æ¯é误"); |
| | | } |
| | | List<ZTCatalogInfoResponse> ztCatalogInfoResponseList = zbomZhongTaiService.getCatalogList(ztCatalogListRequest); |
| | | if(CollectionUtils.isNotEmpty(ztCatalogInfoResponseList)){ |
| | | for (ZTCatalogInfoResponse ztCatalogInfoResponse:ztCatalogInfoResponseList) { |
| | | ZTCatalogListRequest ztCatalogTagListRequest = new ZTCatalogListRequest(); |
| | | ztCatalogTagListRequest.setCatalogCode(ztCatalogInfoResponse.getCode()); |
| | | List<ZTTagInfoResponse> ztTagInfoResponseList = zbomZhongTaiService.getTagList(ztCatalogTagListRequest); |
| | | if(CollectionUtils.isNotEmpty(ztCatalogInfoResponseList)){ |
| | | ztCatalogInfoResponse.setChildTagList(ztTagInfoResponseList); |
| | | } |
| | | } |
| | | } |
| | | return ztCatalogInfoResponseList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å
容 åé¡µæ°æ® |
| | | * @param ztContentListRequest |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ZTBasePageResponse<ZTContentListResponse> pageContentList(ZTContentListRequest ztContentListRequest){ |
| | | if(Objects.isNull(ztContentListRequest) |
| | | || Objects.isNull(ztContentListRequest.getPageNum()) |
| | | || Objects.isNull(ztContentListRequest.getPageSize()) |
| | | || StringUtils.isBlank(ztContentListRequest.getCatalogCode()) |
| | | || StringUtils.isBlank(ztContentListRequest.getTagCodes()) |
| | | || StringUtils.isBlank(ztContentListRequest.getQuery()) |
| | | || StringUtils.isBlank(ztContentListRequest.getSortType()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //æ¥è¯¢ ä¸å° |
| | | String token = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,ztContentListRequest.getUserId(),ztContentListRequest.getUserType()); |
| | | ztContentListRequest.setToken(token); |
| | | String catalogCode = ztContentListRequest.getCatalogCode(); |
| | | if(catalogCode.equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU) |
| | | ||catalogCode.equals(ZTConstants.CatalogCode.CHANPING) |
| | | ||catalogCode.equals(ZTConstants.CatalogCode.ZIXUN) |
| | | ||catalogCode.equals(ZTConstants.CatalogCode.QW_CASE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å类信æ¯é误"); |
| | | } |
| | | ZTBasePageResponse<ZTContentListResponse> response = zbomZhongTaiService.pageContentList(ztContentListRequest); |
| | | return response; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ZTContentInfoResponse getContentInfo(String id,String userType,Long userId){ |
| | | //æ¥è¯¢ ä¸å° TOKEN |
| | | String token = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,userId.toString(),userType); |
| | | ZTContentInfoRequest ztContentListRequest = new ZTContentInfoRequest(); |
| | | ztContentListRequest.setToken(token); |
| | | ztContentListRequest.setUserType(userType); |
| | | ztContentListRequest.setId(id); |
| | | ZTContentInfoResponse response = zbomZhongTaiService.getContentInfo(ztContentListRequest); |
| | | return response; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |