package com.ruoyi.system.controller; | |||||
import cn.dev33.satoken.annotation.SaIgnore; | |||||
import com.ruoyi.system.service.ZsEmailService; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestParam; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
@RestController | |||||
@RequestMapping("/system/zsEmail") | |||||
public class ZsEmailController { | |||||
@Autowired | |||||
private ZsEmailService emailService; | |||||
/** | |||||
* 站点模块 调用发送邮箱接口 | |||||
* @param receiveEmail 接收邮箱 | |||||
* @param title 标题 | |||||
* @param context 内容 | |||||
*/ | |||||
@SaIgnore | |||||
@GetMapping("/sendEmailWeb") | |||||
public void sendEmailWeb(@RequestParam("receiveEmail") String receiveEmail, | |||||
@RequestParam("title")String title, | |||||
@RequestParam("context")String context) { | |||||
//发送邮件 | |||||
emailService.sendEmail(receiveEmail,title,context); | |||||
} | |||||
} |
package com.ruoyi.system.controller; | |||||
import java.util.List; | |||||
import java.util.Arrays; | |||||
import java.util.concurrent.TimeUnit; | |||||
import lombok.RequiredArgsConstructor; | |||||
import javax.servlet.http.HttpServletResponse; | |||||
import javax.validation.constraints.*; | |||||
import cn.dev33.satoken.annotation.SaCheckPermission; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import org.springframework.validation.annotation.Validated; | |||||
import com.ruoyi.common.annotation.RepeatSubmit; | |||||
import com.ruoyi.common.annotation.Log; | |||||
import com.ruoyi.common.core.controller.BaseController; | |||||
import com.ruoyi.common.core.domain.PageQuery; | |||||
import com.ruoyi.common.core.domain.R; | |||||
import com.ruoyi.common.core.validate.AddGroup; | |||||
import com.ruoyi.common.core.validate.EditGroup; | |||||
import com.ruoyi.common.core.validate.QueryGroup; | |||||
import com.ruoyi.common.enums.BusinessType; | |||||
import com.ruoyi.common.utils.poi.ExcelUtil; | |||||
import com.ruoyi.system.domain.vo.ZsMessagesVo; | |||||
import com.ruoyi.system.domain.bo.ZsMessagesBo; | |||||
import com.ruoyi.system.service.IZsMessagesService; | |||||
import com.ruoyi.common.core.page.TableDataInfo; | |||||
/** | |||||
* 站点留言 | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-06 | |||||
*/ | |||||
@Validated | |||||
@RequiredArgsConstructor | |||||
@RestController | |||||
@RequestMapping("/system/messages") | |||||
public class ZsMessagesController extends BaseController { | |||||
private final IZsMessagesService iZsMessagesService; | |||||
/** | |||||
* 查询站点留言列表 | |||||
*/ | |||||
@SaCheckPermission("system:messages:list") | |||||
@GetMapping("/list") | |||||
public TableDataInfo<ZsMessagesVo> list(ZsMessagesBo bo, PageQuery pageQuery) { | |||||
return iZsMessagesService.queryPageList(bo, pageQuery); | |||||
} | |||||
/** | |||||
* 导出站点留言列表 | |||||
*/ | |||||
@SaCheckPermission("system:messages:export") | |||||
@Log(title = "站点留言", businessType = BusinessType.EXPORT) | |||||
@PostMapping("/export") | |||||
public void export(ZsMessagesBo bo, HttpServletResponse response) { | |||||
List<ZsMessagesVo> list = iZsMessagesService.queryList(bo); | |||||
ExcelUtil.exportExcel(list, "站点留言", ZsMessagesVo.class, response); | |||||
} | |||||
/** | |||||
* 获取站点留言详细信息 | |||||
* | |||||
* @param id 主键 | |||||
*/ | |||||
@SaCheckPermission("system:messages:query") | |||||
@GetMapping("/{id}") | |||||
public R<ZsMessagesVo> getInfo(@NotNull(message = "主键不能为空") | |||||
@PathVariable Long id) { | |||||
return R.ok(iZsMessagesService.queryById(id)); | |||||
} | |||||
/** | |||||
* 新增站点留言 | |||||
*/ | |||||
@SaCheckPermission("system:messages:add") | |||||
@Log(title = "站点留言", businessType = BusinessType.INSERT) | |||||
@RepeatSubmit() | |||||
@PostMapping() | |||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ZsMessagesBo bo) { | |||||
return toAjax(iZsMessagesService.insertByBo(bo)); | |||||
} | |||||
/** | |||||
* 修改站点留言 | |||||
*/ | |||||
@SaCheckPermission("system:messages:edit") | |||||
@Log(title = "站点留言", businessType = BusinessType.UPDATE) | |||||
@RepeatSubmit() | |||||
@PutMapping() | |||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ZsMessagesBo bo) { | |||||
return toAjax(iZsMessagesService.updateByBo(bo)); | |||||
} | |||||
/** | |||||
* 删除站点留言 | |||||
* | |||||
* @param ids 主键串 | |||||
*/ | |||||
@SaCheckPermission("system:messages:remove") | |||||
@Log(title = "站点留言", businessType = BusinessType.DELETE) | |||||
@DeleteMapping("/{ids}") | |||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") | |||||
@PathVariable Long[] ids) { | |||||
return toAjax(iZsMessagesService.deleteWithValidByIds(Arrays.asList(ids), true)); | |||||
} | |||||
} |
package com.ruoyi.system.controller; | |||||
import java.util.List; | |||||
import java.util.Arrays; | |||||
import java.util.concurrent.TimeUnit; | |||||
import lombok.RequiredArgsConstructor; | |||||
import javax.servlet.http.HttpServletResponse; | |||||
import javax.validation.constraints.*; | |||||
import cn.dev33.satoken.annotation.SaCheckPermission; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import org.springframework.validation.annotation.Validated; | |||||
import com.ruoyi.common.annotation.RepeatSubmit; | |||||
import com.ruoyi.common.annotation.Log; | |||||
import com.ruoyi.common.core.controller.BaseController; | |||||
import com.ruoyi.common.core.domain.PageQuery; | |||||
import com.ruoyi.common.core.domain.R; | |||||
import com.ruoyi.common.core.validate.AddGroup; | |||||
import com.ruoyi.common.core.validate.EditGroup; | |||||
import com.ruoyi.common.core.validate.QueryGroup; | |||||
import com.ruoyi.common.enums.BusinessType; | |||||
import com.ruoyi.common.utils.poi.ExcelUtil; | |||||
import com.ruoyi.system.domain.vo.ZsOperationSmtpVo; | |||||
import com.ruoyi.system.domain.bo.ZsOperationSmtpBo; | |||||
import com.ruoyi.system.service.IZsOperationSmtpService; | |||||
import com.ruoyi.common.core.page.TableDataInfo; | |||||
/** | |||||
* 邮件配置 | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-09 | |||||
*/ | |||||
@Validated | |||||
@RequiredArgsConstructor | |||||
@RestController | |||||
@RequestMapping("/system/operationSmtp") | |||||
public class ZsOperationSmtpController extends BaseController { | |||||
private final IZsOperationSmtpService iZsOperationSmtpService; | |||||
/** | |||||
* 查询邮件配置列表 | |||||
*/ | |||||
@SaCheckPermission("system:operationSmtp:list") | |||||
@GetMapping("/list") | |||||
public TableDataInfo<ZsOperationSmtpVo> list(ZsOperationSmtpBo bo, PageQuery pageQuery) { | |||||
return iZsOperationSmtpService.queryPageList(bo, pageQuery); | |||||
} | |||||
/** | |||||
* 导出邮件配置列表 | |||||
*/ | |||||
@SaCheckPermission("system:operationSmtp:export") | |||||
@Log(title = "邮件配置", businessType = BusinessType.EXPORT) | |||||
@PostMapping("/export") | |||||
public void export(ZsOperationSmtpBo bo, HttpServletResponse response) { | |||||
List<ZsOperationSmtpVo> list = iZsOperationSmtpService.queryList(bo); | |||||
ExcelUtil.exportExcel(list, "邮件配置", ZsOperationSmtpVo.class, response); | |||||
} | |||||
/** | |||||
* 获取邮件配置详细信息 | |||||
* | |||||
* @param id 主键 | |||||
*/ | |||||
@SaCheckPermission("system:operationSmtp:query") | |||||
@GetMapping("/{id}") | |||||
public R<ZsOperationSmtpVo> getInfo(@NotNull(message = "主键不能为空") | |||||
@PathVariable Long id) { | |||||
return R.ok(iZsOperationSmtpService.queryById(id)); | |||||
} | |||||
/** | |||||
* 新增邮件配置 | |||||
*/ | |||||
@SaCheckPermission("system:operationSmtp:add") | |||||
@Log(title = "邮件配置", businessType = BusinessType.INSERT) | |||||
@RepeatSubmit() | |||||
@PostMapping() | |||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ZsOperationSmtpBo bo) { | |||||
return toAjax(iZsOperationSmtpService.insertByBo(bo)); | |||||
} | |||||
/** | |||||
* 修改邮件配置 | |||||
*/ | |||||
@SaCheckPermission("system:operationSmtp:edit") | |||||
@Log(title = "邮件配置", businessType = BusinessType.UPDATE) | |||||
@RepeatSubmit() | |||||
@PutMapping() | |||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ZsOperationSmtpBo bo) { | |||||
return toAjax(iZsOperationSmtpService.updateByBo(bo)); | |||||
} | |||||
/** | |||||
* 删除邮件配置 | |||||
* | |||||
* @param ids 主键串 | |||||
*/ | |||||
@SaCheckPermission("system:operationSmtp:remove") | |||||
@Log(title = "邮件配置", businessType = BusinessType.DELETE) | |||||
@DeleteMapping("/{ids}") | |||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") | |||||
@PathVariable Long[] ids) { | |||||
return toAjax(iZsOperationSmtpService.deleteWithValidByIds(Arrays.asList(ids), true)); | |||||
} | |||||
} |
* 站点产品分类管理 | * 站点产品分类管理 | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-05-06 | |||||
*/ | */ | ||||
@Validated | @Validated | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor |
* 站点产品管理 | * 站点产品管理 | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Validated | @Validated | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor |
package com.ruoyi.system.controller; | |||||
import cn.dev33.satoken.annotation.SaIgnore; | |||||
import com.ruoyi.system.service.ZsStatisticsService; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestParam; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.servlet.http.HttpServletRequest; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
@Validated | |||||
@RestController | |||||
@RequestMapping("/system/statistics") | |||||
public class ZsStatisticsController { | |||||
@Autowired | |||||
private ZsStatisticsService zsStatisticsService; | |||||
/** | |||||
* 查询产品信息 | |||||
* @param request | |||||
* @param websiteCode 网站编码 | |||||
* @return | |||||
*/ | |||||
@SaIgnore | |||||
@GetMapping("/productInfo") | |||||
public List<Map> query1(HttpServletRequest request, @RequestParam("website_code") String websiteCode) { | |||||
//获取语言 | |||||
String languageCode = request.getHeader("language_code"); | |||||
return zsStatisticsService.getProductJson(websiteCode,languageCode); | |||||
} | |||||
@SaIgnore | |||||
@GetMapping("/productCategoryInfo") | |||||
public List<Map> getProductCategoryJson(HttpServletRequest request, @RequestParam("website_code") String websiteCode) { | |||||
//获取语言 | |||||
String languageCode = request.getHeader("language_code"); | |||||
return zsStatisticsService.getProductCategoryJson(websiteCode,languageCode); | |||||
} | |||||
@SaIgnore | |||||
@GetMapping("/productPurposeInfo") | |||||
public List<Map> getProductPurposeJson(HttpServletRequest request, @RequestParam("website_code") String websiteCode) { | |||||
//获取语言 | |||||
String languageCode = request.getHeader("language_code"); | |||||
return zsStatisticsService.getProductPurposeJson(websiteCode,languageCode); | |||||
} | |||||
@SaIgnore | |||||
@GetMapping("/productDetailInfo") | |||||
public List<Map> getProductDetailJson(HttpServletRequest request, @RequestParam("website_code") String websiteCode) { | |||||
//获取语言 | |||||
String languageCode = request.getHeader("language_code"); | |||||
return zsStatisticsService.getProductDetailJson(websiteCode,languageCode); | |||||
} | |||||
@SaIgnore | |||||
@GetMapping("/fAQInfo") | |||||
public List<Map> getFAQJson(HttpServletRequest request, @RequestParam("website_code") String websiteCode) { | |||||
//获取语言 | |||||
String languageCode = request.getHeader("language_code"); | |||||
return zsStatisticsService.getFAQJson(websiteCode,languageCode); | |||||
} | |||||
} | |||||
/** | /** | ||||
* 站点信息 | * 站点信息 | ||||
* | * | ||||
* @author ruoyi | |||||
* @date 2025-04-28 | |||||
* @author 王强 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Validated | @Validated | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor |
package com.ruoyi.system.domain; | |||||
import com.baomidou.mybatisplus.annotation.*; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import java.util.Date; | |||||
import com.ruoyi.common.core.domain.BaseEntity; | |||||
/** | |||||
* 站点留言对象 zs_messages | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-06 | |||||
*/ | |||||
@Data | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@TableName("zs_messages") | |||||
public class ZsMessages extends BaseEntity { | |||||
private static final long serialVersionUID=1L; | |||||
/** | |||||
* 主键ID | |||||
*/ | |||||
@TableId(value = "id") | |||||
private Long id; | |||||
/** | |||||
* 网站ID | |||||
*/ | |||||
private Long websiteId; | |||||
/** | |||||
* 留言者姓名 | |||||
*/ | |||||
private String username; | |||||
/** | |||||
* 留言者邮箱 | |||||
*/ | |||||
private String email; | |||||
/** | |||||
* 留言内容 | |||||
*/ | |||||
private String content; | |||||
/** | |||||
* 用户IP | |||||
*/ | |||||
private String ipAddress; | |||||
/** | |||||
* 留言时间 | |||||
*/ | |||||
private Date createdAt; | |||||
/** | |||||
* 审核状态 | |||||
*/ | |||||
private Integer status; | |||||
/** | |||||
* 管理员回复内容 | |||||
*/ | |||||
private String adminReply; | |||||
/** | |||||
* 管理员回复时间 | |||||
*/ | |||||
private Date adminReplyAt; | |||||
} |
* 站点产品管理对象 zs_product | * 站点产品管理对象 zs_product | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Data | @Data | ||||
@EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
*/ | */ | ||||
private String seoDescripetion; | private String seoDescripetion; | ||||
/** | /** | ||||
* 是否启用 | |||||
* 是否启用 | |||||
*/ | */ | ||||
private String isDisabled; | private String isDisabled; | ||||
/** | /** | ||||
* 是否推荐 | * 是否推荐 | ||||
*/ | */ | ||||
private String isRecommend; | private String isRecommend; | ||||
/** | |||||
* 标签 | |||||
*/ | |||||
private String tag; | |||||
} | } |
* 站点产品分类管理对象 zs_product_category | * 站点产品分类管理对象 zs_product_category | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-05-06 | |||||
*/ | */ | ||||
@Data | @Data | ||||
@EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
* 分类描述 | * 分类描述 | ||||
*/ | */ | ||||
private String descripetion; | private String descripetion; | ||||
/** | |||||
* 亮点 | |||||
*/ | |||||
private String features; | |||||
/** | /** | ||||
* 栏目封面 | * 栏目封面 | ||||
*/ | */ |
/** | /** | ||||
* 站点信息对象 zs_website | * 站点信息对象 zs_website | ||||
* | * | ||||
* @author ruoyi | |||||
* @date 2025-04-28 | |||||
* @author 王强 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Data | @Data | ||||
@EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
*/ | */ | ||||
private String record; | private String record; | ||||
/** | /** | ||||
* 版本号 | |||||
* 版权信息 | |||||
*/ | */ | ||||
@Version | |||||
private String version; | |||||
private String copyrightInfo; | |||||
/** | /** | ||||
* 邮箱 | * 邮箱 | ||||
*/ | */ | ||||
* 统计编码 | * 统计编码 | ||||
*/ | */ | ||||
private String statisticsCode; | private String statisticsCode; | ||||
/** | |||||
* 网站编码 | |||||
*/ | |||||
private String code; | |||||
} | } |
package com.ruoyi.system.domain.bo; | |||||
import com.ruoyi.common.core.validate.AddGroup; | |||||
import com.ruoyi.common.core.validate.EditGroup; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import javax.validation.constraints.*; | |||||
import java.util.Date; | |||||
import java.util.Date; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import com.ruoyi.common.core.domain.BaseEntity; | |||||
/** | |||||
* 站点留言业务对象 zs_messages | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-06 | |||||
*/ | |||||
@Data | |||||
@EqualsAndHashCode(callSuper = true) | |||||
public class ZsMessagesBo extends BaseEntity { | |||||
/** | |||||
* 主键ID | |||||
*/ | |||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) | |||||
private Long id; | |||||
/** | |||||
* 网站ID | |||||
*/ | |||||
@NotNull(message = "网站ID不能为空", groups = { AddGroup.class, EditGroup.class }) | |||||
private Long websiteId; | |||||
/** | |||||
* 留言者姓名 | |||||
*/ | |||||
private String username; | |||||
/** | |||||
* 留言者邮箱 | |||||
*/ | |||||
private String email; | |||||
/** | |||||
* 留言内容 | |||||
*/ | |||||
private String content; | |||||
/** | |||||
* 用户IP | |||||
*/ | |||||
private String ipAddress; | |||||
/** | |||||
* 留言时间 | |||||
*/ | |||||
private Date createdAt; | |||||
/** | |||||
* 审核状态 | |||||
*/ | |||||
private Integer status; | |||||
/** | |||||
* 管理员回复内容 | |||||
*/ | |||||
private String adminReply; | |||||
/** | |||||
* 管理员回复时间 | |||||
*/ | |||||
private Date adminReplyAt; | |||||
} |
* 站点产品管理业务对象 zs_product | * 站点产品管理业务对象 zs_product | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Data | @Data | ||||
private String seoDescripetion; | private String seoDescripetion; | ||||
/** | /** | ||||
* 是否启用 | |||||
* 是否启用 | |||||
*/ | */ | ||||
private String isDisabled; | private String isDisabled; | ||||
*/ | */ | ||||
private String isRecommend; | private String isRecommend; | ||||
/** | |||||
* 标签 | |||||
*/ | |||||
private String tag; | |||||
} | } |
* 站点产品分类管理业务对象 zs_product_category | * 站点产品分类管理业务对象 zs_product_category | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-05-06 | |||||
*/ | */ | ||||
@Data | @Data | ||||
*/ | */ | ||||
private String descripetion; | private String descripetion; | ||||
/** | |||||
* 亮点 | |||||
*/ | |||||
private String features; | |||||
/** | /** | ||||
* 栏目封面 | * 栏目封面 | ||||
*/ | */ |
package com.ruoyi.system.domain.bo; | |||||
public class ZsStatisticsBo { | |||||
} |
/** | /** | ||||
* 站点信息业务对象 zs_website | * 站点信息业务对象 zs_website | ||||
* | * | ||||
* @author ruoyi | |||||
* @date 2025-04-28 | |||||
* @author 王强 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Data | @Data | ||||
private String record; | private String record; | ||||
/** | /** | ||||
* 版本号 | |||||
* 版权信息 | |||||
*/ | */ | ||||
private String version; | |||||
private String copyrightInfo; | |||||
/** | /** | ||||
* 邮箱 | * 邮箱 | ||||
*/ | */ | ||||
private String statisticsCode; | private String statisticsCode; | ||||
/** | |||||
* 网站编码 | |||||
*/ | |||||
@NotBlank(message = "网站编码不能为空", groups = { AddGroup.class, EditGroup.class }) | |||||
private String code; | |||||
} | } |
package com.ruoyi.system.domain.vo; | |||||
import java.util.Date; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | |||||
import com.alibaba.excel.annotation.ExcelProperty; | |||||
import com.ruoyi.common.annotation.ExcelDictFormat; | |||||
import com.ruoyi.common.convert.ExcelDictConvert; | |||||
import lombok.Data; | |||||
import java.util.Date; | |||||
/** | |||||
* 站点留言视图对象 zs_messages | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-06 | |||||
*/ | |||||
@Data | |||||
@ExcelIgnoreUnannotated | |||||
public class ZsMessagesVo { | |||||
private static final long serialVersionUID = 1L; | |||||
/** | |||||
* 主键ID | |||||
*/ | |||||
@ExcelProperty(value = "主键ID") | |||||
private Long id; | |||||
/** | |||||
* 网站ID | |||||
*/ | |||||
@ExcelProperty(value = "网站ID") | |||||
private Long websiteId; | |||||
/** | |||||
* 留言者姓名 | |||||
*/ | |||||
@ExcelProperty(value = "留言者姓名") | |||||
private String username; | |||||
/** | |||||
* 留言者邮箱 | |||||
*/ | |||||
@ExcelProperty(value = "留言者邮箱") | |||||
private String email; | |||||
/** | |||||
* 留言内容 | |||||
*/ | |||||
@ExcelProperty(value = "留言内容") | |||||
private String content; | |||||
/** | |||||
* 用户IP | |||||
*/ | |||||
@ExcelProperty(value = "用户IP") | |||||
private String ipAddress; | |||||
/** | |||||
* 留言时间 | |||||
*/ | |||||
@ExcelProperty(value = "留言时间") | |||||
private Date createdAt; | |||||
/** | |||||
* 审核状态 | |||||
*/ | |||||
@ExcelProperty(value = "审核状态", converter = ExcelDictConvert.class) | |||||
@ExcelDictFormat(dictType = "zs_faq_status") | |||||
private Integer status; | |||||
/** | |||||
* 管理员回复内容 | |||||
*/ | |||||
@ExcelProperty(value = "管理员回复内容") | |||||
private String adminReply; | |||||
/** | |||||
* 管理员回复时间 | |||||
*/ | |||||
@ExcelProperty(value = "管理员回复时间") | |||||
private Date adminReplyAt; | |||||
/** | |||||
* 创建时间 | |||||
*/ | |||||
@ExcelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
/** | |||||
* 修改时间 | |||||
*/ | |||||
@ExcelProperty(value = "修改时间") | |||||
private Date updateTime; | |||||
/** | |||||
* 创建人 | |||||
*/ | |||||
@ExcelProperty(value = "创建人") | |||||
private String createBy; | |||||
/** | |||||
* 修改人 | |||||
*/ | |||||
@ExcelProperty(value = "修改人") | |||||
private String updateBy; | |||||
} |
* 站点产品分类管理视图对象 zs_product_category | * 站点产品分类管理视图对象 zs_product_category | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-05-06 | |||||
*/ | */ | ||||
@Data | @Data | ||||
@ExcelIgnoreUnannotated | @ExcelIgnoreUnannotated | ||||
@ExcelProperty(value = "分类描述") | @ExcelProperty(value = "分类描述") | ||||
private String descripetion; | private String descripetion; | ||||
/** | |||||
* 亮点 | |||||
*/ | |||||
@ExcelProperty(value = "亮点") | |||||
private String features; | |||||
/** | /** | ||||
* 栏目封面 | * 栏目封面 | ||||
*/ | */ |
* 站点产品管理视图对象 zs_product | * 站点产品管理视图对象 zs_product | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Data | @Data | ||||
@ExcelIgnoreUnannotated | @ExcelIgnoreUnannotated | ||||
private String seoDescripetion; | private String seoDescripetion; | ||||
/** | /** | ||||
* 是否启用 | |||||
* 是否启用 | |||||
*/ | */ | ||||
@ExcelProperty(value = "是否启用", converter = ExcelDictConvert.class) | |||||
@ExcelProperty(value = "是否启用 ", converter = ExcelDictConvert.class) | |||||
@ExcelDictFormat(dictType = "zs_is_disabled") | @ExcelDictFormat(dictType = "zs_is_disabled") | ||||
private String isDisabled; | private String isDisabled; | ||||
@ExcelDictFormat(dictType = "zs_recommend") | @ExcelDictFormat(dictType = "zs_recommend") | ||||
private String isRecommend; | private String isRecommend; | ||||
/** | |||||
* 标签 | |||||
*/ | |||||
@ExcelProperty(value = "标签") | |||||
private String tag; | |||||
/** | /** | ||||
* 创建时间 | * 创建时间 | ||||
*/ | */ |
package com.ruoyi.system.domain.vo; | |||||
public class ZsStatisticsVo { | |||||
} |
/** | /** | ||||
* 站点信息视图对象 zs_website | * 站点信息视图对象 zs_website | ||||
* | * | ||||
* @author ruoyi | |||||
* @date 2025-04-28 | |||||
* @author 王强 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@Data | @Data | ||||
@ExcelIgnoreUnannotated | @ExcelIgnoreUnannotated | ||||
private String record; | private String record; | ||||
/** | /** | ||||
* 版本号 | |||||
* 版权信息 | |||||
*/ | */ | ||||
@ExcelProperty(value = "版本号") | |||||
private String version; | |||||
@ExcelProperty(value = "版权信息") | |||||
private String copyrightInfo; | |||||
/** | /** | ||||
* 邮箱 | * 邮箱 | ||||
@ExcelProperty(value = "统计编码") | @ExcelProperty(value = "统计编码") | ||||
private String statisticsCode; | private String statisticsCode; | ||||
/** | |||||
* 网站编码 | |||||
*/ | |||||
@ExcelProperty(value = "网站编码") | |||||
private String code; | |||||
/** | /** | ||||
* 创建时间 | * 创建时间 | ||||
*/ | */ |
package com.ruoyi.system.mapper; | |||||
import com.ruoyi.system.domain.ZsMessages; | |||||
import com.ruoyi.system.domain.vo.ZsMessagesVo; | |||||
import com.ruoyi.common.core.mapper.BaseMapperPlus; | |||||
/** | |||||
* 站点留言Mapper接口 | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-06 | |||||
*/ | |||||
public interface ZsMessagesMapper extends BaseMapperPlus<ZsMessagesMapper, ZsMessages, ZsMessagesVo> { | |||||
} |
* 站点产品分类管理Mapper接口 | * 站点产品分类管理Mapper接口 | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-05-06 | |||||
*/ | */ | ||||
public interface ZsProductCategoryMapper extends BaseMapperPlus<ZsProductCategoryMapper, ZsProductCategory, ZsProductCategoryVo> { | public interface ZsProductCategoryMapper extends BaseMapperPlus<ZsProductCategoryMapper, ZsProductCategory, ZsProductCategoryVo> { | ||||
import com.ruoyi.system.domain.ZsProduct; | import com.ruoyi.system.domain.ZsProduct; | ||||
import com.ruoyi.system.domain.vo.ZsProductVo; | import com.ruoyi.system.domain.vo.ZsProductVo; | ||||
import com.ruoyi.common.core.mapper.BaseMapperPlus; | import com.ruoyi.common.core.mapper.BaseMapperPlus; | ||||
import org.apache.ibatis.annotations.Param; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
/** | /** | ||||
* 站点产品管理Mapper接口 | * 站点产品管理Mapper接口 | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
public interface ZsProductMapper extends BaseMapperPlus<ZsProductMapper, ZsProduct, ZsProductVo> { | public interface ZsProductMapper extends BaseMapperPlus<ZsProductMapper, ZsProduct, ZsProductVo> { | ||||
List<Map> getProductAndCategoryInfo(@Param("website_id")Long websiteId, | |||||
@Param("language_code")String languageCode); | |||||
} | } |
/** | /** | ||||
* 站点信息Mapper接口 | * 站点信息Mapper接口 | ||||
* | * | ||||
* @author ruoyi | |||||
* @date 2025-04-28 | |||||
* @author 王强 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
public interface ZsWebsiteMapper extends BaseMapperPlus<ZsWebsiteMapper, ZsWebsite, ZsWebsiteVo> { | public interface ZsWebsiteMapper extends BaseMapperPlus<ZsWebsiteMapper, ZsWebsite, ZsWebsiteVo> { | ||||
package com.ruoyi.system.service; | |||||
import com.ruoyi.system.domain.ZsMessages; | |||||
import com.ruoyi.system.domain.vo.ZsMessagesVo; | |||||
import com.ruoyi.system.domain.bo.ZsMessagesBo; | |||||
import com.ruoyi.common.core.page.TableDataInfo; | |||||
import com.ruoyi.common.core.domain.PageQuery; | |||||
import java.util.Collection; | |||||
import java.util.List; | |||||
/** | |||||
* 站点留言Service接口 | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-06 | |||||
*/ | |||||
public interface IZsMessagesService { | |||||
/** | |||||
* 查询站点留言 | |||||
*/ | |||||
ZsMessagesVo queryById(Long id); | |||||
/** | |||||
* 查询站点留言列表 | |||||
*/ | |||||
TableDataInfo<ZsMessagesVo> queryPageList(ZsMessagesBo bo, PageQuery pageQuery); | |||||
/** | |||||
* 查询站点留言列表 | |||||
*/ | |||||
List<ZsMessagesVo> queryList(ZsMessagesBo bo); | |||||
/** | |||||
* 新增站点留言 | |||||
*/ | |||||
Boolean insertByBo(ZsMessagesBo bo); | |||||
/** | |||||
* 修改站点留言 | |||||
*/ | |||||
Boolean updateByBo(ZsMessagesBo bo); | |||||
/** | |||||
* 校验并批量删除站点留言信息 | |||||
*/ | |||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | |||||
} |
package com.ruoyi.system.service; | |||||
public interface ZsEmailService { | |||||
void sendEmail(String receiveEmail,String title,String context); | |||||
} |
package com.ruoyi.system.service; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
public interface ZsStatisticsService { | |||||
List<Map> getProductJson(String code, String languageCode); | |||||
List<Map> getProductCategoryJson(String code, String languageCode); | |||||
List<Map> getProductPurposeJson(String code, String languageCode); | |||||
List<Map> getProductDetailJson(String code, String languageCode); | |||||
List<Map> getFAQJson(String code, String languageCode); | |||||
} |
package com.ruoyi.system.service.impl; | |||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
import com.ruoyi.system.domain.ZsOperationSendconfig; | |||||
import com.ruoyi.system.mapper.ZsOperationSendconfigMapper; | |||||
import com.ruoyi.system.service.ZsEmailService; | |||||
import com.ruoyi.system.utils.EmailUtils; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import java.util.List; | |||||
@Service | |||||
@Slf4j | |||||
public class ZsEmailServiceImpl implements ZsEmailService { | |||||
@Autowired | |||||
private ZsOperationSendconfigMapper zsOperationSendconfigMapper; | |||||
@Autowired | |||||
private EmailUtils emailUtils; | |||||
@Override | |||||
public void sendEmail(String receiveEmail,String title,String context) { | |||||
QueryWrapper<ZsOperationSendconfig> sendWrapper= new QueryWrapper<>(); | |||||
sendWrapper.eq("module",1);//站点模块 | |||||
sendWrapper.eq("code",0);//邮箱方式 | |||||
//根据预警编码 查询出对应的预警信息接收地址 | |||||
List<ZsOperationSendconfig> zsOperationSendconfigList = zsOperationSendconfigMapper.selectList(sendWrapper); | |||||
if (zsOperationSendconfigList!=null&&zsOperationSendconfigList.size()>0) { | |||||
for (ZsOperationSendconfig zsOperationSendconfig : zsOperationSendconfigList) { | |||||
emailUtils.sendMailByTransport(zsOperationSendconfig.getSendEmail(),receiveEmail,title,context,zsOperationSendconfig.getSmtpId()); | |||||
} | |||||
} | |||||
} | |||||
} |
package com.ruoyi.system.service.impl; | |||||
import cn.hutool.core.bean.BeanUtil; | |||||
import com.ruoyi.common.utils.StringUtils; | |||||
import com.ruoyi.common.core.page.TableDataInfo; | |||||
import com.ruoyi.common.core.domain.PageQuery; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import lombok.RequiredArgsConstructor; | |||||
import org.springframework.stereotype.Service; | |||||
import com.ruoyi.system.domain.bo.ZsMessagesBo; | |||||
import com.ruoyi.system.domain.vo.ZsMessagesVo; | |||||
import com.ruoyi.system.domain.ZsMessages; | |||||
import com.ruoyi.system.mapper.ZsMessagesMapper; | |||||
import com.ruoyi.system.service.IZsMessagesService; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.Collection; | |||||
/** | |||||
* 站点留言Service业务层处理 | |||||
* | |||||
* @author 王强 | |||||
* @date 2025-05-06 | |||||
*/ | |||||
@RequiredArgsConstructor | |||||
@Service | |||||
public class ZsMessagesServiceImpl implements IZsMessagesService { | |||||
private final ZsMessagesMapper baseMapper; | |||||
/** | |||||
* 查询站点留言 | |||||
*/ | |||||
@Override | |||||
public ZsMessagesVo queryById(Long id){ | |||||
return baseMapper.selectVoById(id); | |||||
} | |||||
/** | |||||
* 查询站点留言列表 | |||||
*/ | |||||
@Override | |||||
public TableDataInfo<ZsMessagesVo> queryPageList(ZsMessagesBo bo, PageQuery pageQuery) { | |||||
LambdaQueryWrapper<ZsMessages> lqw = buildQueryWrapper(bo); | |||||
Page<ZsMessagesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | |||||
return TableDataInfo.build(result); | |||||
} | |||||
/** | |||||
* 查询站点留言列表 | |||||
*/ | |||||
@Override | |||||
public List<ZsMessagesVo> queryList(ZsMessagesBo bo) { | |||||
LambdaQueryWrapper<ZsMessages> lqw = buildQueryWrapper(bo); | |||||
return baseMapper.selectVoList(lqw); | |||||
} | |||||
private LambdaQueryWrapper<ZsMessages> buildQueryWrapper(ZsMessagesBo bo) { | |||||
Map<String, Object> params = bo.getParams(); | |||||
LambdaQueryWrapper<ZsMessages> lqw = Wrappers.lambdaQuery(); | |||||
lqw.between(params.get("beginCreatedAt") != null && params.get("endCreatedAt") != null, | |||||
ZsMessages::getCreatedAt ,params.get("beginCreatedAt"), params.get("endCreatedAt")); | |||||
lqw.eq(bo.getStatus() != null, ZsMessages::getStatus, bo.getStatus()); | |||||
lqw.between(params.get("beginAdminReplyAt") != null && params.get("endAdminReplyAt") != null, | |||||
ZsMessages::getAdminReplyAt ,params.get("beginAdminReplyAt"), params.get("endAdminReplyAt")); | |||||
return lqw; | |||||
} | |||||
/** | |||||
* 新增站点留言 | |||||
*/ | |||||
@Override | |||||
public Boolean insertByBo(ZsMessagesBo bo) { | |||||
ZsMessages add = BeanUtil.toBean(bo, ZsMessages.class); | |||||
validEntityBeforeSave(add); | |||||
boolean flag = baseMapper.insert(add) > 0; | |||||
if (flag) { | |||||
bo.setId(add.getId()); | |||||
} | |||||
return flag; | |||||
} | |||||
/** | |||||
* 修改站点留言 | |||||
*/ | |||||
@Override | |||||
public Boolean updateByBo(ZsMessagesBo bo) { | |||||
ZsMessages update = BeanUtil.toBean(bo, ZsMessages.class); | |||||
validEntityBeforeSave(update); | |||||
return baseMapper.updateById(update) > 0; | |||||
} | |||||
/** | |||||
* 保存前的数据校验 | |||||
*/ | |||||
private void validEntityBeforeSave(ZsMessages entity){ | |||||
//TODO 做一些数据校验,如唯一约束 | |||||
} | |||||
/** | |||||
* 批量删除站点留言 | |||||
*/ | |||||
@Override | |||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | |||||
if(isValid){ | |||||
//TODO 做一些业务上的校验,判断是否需要校验 | |||||
} | |||||
return baseMapper.deleteBatchIds(ids) > 0; | |||||
} | |||||
} |
* 站点产品分类管理Service业务层处理 | * 站点产品分类管理Service业务层处理 | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-05-06 | |||||
*/ | */ | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
@Service | @Service |
* 站点产品管理Service业务层处理 | * 站点产品管理Service业务层处理 | ||||
* | * | ||||
* @author 王强 | * @author 王强 | ||||
* @date 2025-04-29 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
@Service | @Service | ||||
LambdaQueryWrapper<ZsProduct> lqw = Wrappers.lambdaQuery(); | LambdaQueryWrapper<ZsProduct> lqw = Wrappers.lambdaQuery(); | ||||
lqw.like(StringUtils.isNotBlank(bo.getWebsiteName()), ZsProduct::getWebsiteName, bo.getWebsiteName()); | lqw.like(StringUtils.isNotBlank(bo.getWebsiteName()), ZsProduct::getWebsiteName, bo.getWebsiteName()); | ||||
lqw.eq(StringUtils.isNotBlank(bo.getLanguageCode()), ZsProduct::getLanguageCode, bo.getLanguageCode()); | lqw.eq(StringUtils.isNotBlank(bo.getLanguageCode()), ZsProduct::getLanguageCode, bo.getLanguageCode()); | ||||
lqw.eq(bo.getCategoryId() != null, ZsProduct::getCategoryId, bo.getCategoryId()); | |||||
lqw.like(StringUtils.isNotBlank(bo.getName()), ZsProduct::getName, bo.getName()); | lqw.like(StringUtils.isNotBlank(bo.getName()), ZsProduct::getName, bo.getName()); | ||||
lqw.eq(StringUtils.isNotBlank(bo.getIsDisabled()), ZsProduct::getIsDisabled, bo.getIsDisabled()); | lqw.eq(StringUtils.isNotBlank(bo.getIsDisabled()), ZsProduct::getIsDisabled, bo.getIsDisabled()); | ||||
return lqw; | return lqw; |
package com.ruoyi.system.service.impl; | |||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
import com.ruoyi.system.domain.ZsProduct; | |||||
import com.ruoyi.system.domain.ZsProductCategory; | |||||
import com.ruoyi.system.domain.ZsPurpose; | |||||
import com.ruoyi.system.domain.ZsWebsite; | |||||
import com.ruoyi.system.domain.vo.SysOssVo; | |||||
import com.ruoyi.system.mapper.ZsProductCategoryMapper; | |||||
import com.ruoyi.system.mapper.ZsProductMapper; | |||||
import com.ruoyi.system.mapper.ZsPurposeMapper; | |||||
import com.ruoyi.system.mapper.ZsWebsiteMapper; | |||||
import com.ruoyi.system.service.ISysOssService; | |||||
import com.ruoyi.system.service.ZsStatisticsService; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import java.util.ArrayList; | |||||
import java.util.HashMap; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
@Slf4j | |||||
@Service | |||||
public class ZsStatisticsServiceImpl implements ZsStatisticsService { | |||||
@Autowired | |||||
private ZsWebsiteMapper zsWebsiteMapper; | |||||
@Autowired | |||||
private ZsProductMapper zsProductMapper; | |||||
@Autowired | |||||
private ZsProductCategoryMapper zsProductCategoryMapper; | |||||
@Autowired | |||||
private ZsPurposeMapper zsPurposeMapper; | |||||
@Autowired | |||||
private ISysOssService iSysOssService; | |||||
@Override | |||||
public List<Map> getProductJson(String code,String languageCode) { | |||||
List<Map> reList = new ArrayList(); | |||||
Long webSiteId = getWebSiteId(code,languageCode); | |||||
if (webSiteId!=null) { | |||||
List<Map> productList = zsProductMapper.getProductAndCategoryInfo(webSiteId,languageCode); | |||||
if (productList!=null&&productList.size()>0) { | |||||
for (int i=0;i<productList.size();i++) { | |||||
Map productMap = productList.get(i); | |||||
String purposeIds = (String)productMap.get("purpose_ids"); | |||||
if (StringUtils.isNotBlank(purposeIds)) { | |||||
String[] purposeIdsArr = purposeIds.split(","); | |||||
QueryWrapper<ZsPurpose> zsPurposeQueryWrapper = new QueryWrapper<>(); | |||||
zsPurposeQueryWrapper.select("name"); | |||||
zsPurposeQueryWrapper.in("id",purposeIdsArr); | |||||
List<ZsPurpose> zsPurposes = zsPurposeMapper.selectList(zsPurposeQueryWrapper); | |||||
List<String> purposeNames = new ArrayList(); | |||||
if (zsPurposes!=null&&zsPurposes.size()>0) { | |||||
for (ZsPurpose zsPurpose:zsPurposes) { | |||||
purposeNames.add(zsPurpose.getName()); | |||||
} | |||||
} | |||||
SysOssVo sysOssVo = iSysOssService.getById(Long.valueOf((String)productMap.get("cover"))); | |||||
Map reMap = new HashMap(); | |||||
reMap.put("id",i); | |||||
reMap.put("name",productMap.get("product_name")); | |||||
reMap.put("category",productMap.get("category_name")); | |||||
reMap.put("usage",purposeNames); | |||||
reMap.put("capacities",productMap.get("tag")); | |||||
reMap.put("image",sysOssVo.getUrl()); | |||||
reMap.put("description",productMap.get("descripetion1")); | |||||
reList.add(reMap); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
return reList; | |||||
} | |||||
//产品分类 | |||||
@Override | |||||
public List<Map> getProductCategoryJson(String code, String languageCode) { | |||||
List<Map> reList = new ArrayList(); | |||||
Long webSiteId = getWebSiteId(code,languageCode); | |||||
if (webSiteId!=null) { | |||||
QueryWrapper<ZsProductCategory> queryWrapper = new QueryWrapper<>(); | |||||
queryWrapper.eq("language_code",languageCode); | |||||
queryWrapper.eq("website_id",webSiteId); | |||||
List<ZsProductCategory> lists = zsProductCategoryMapper.selectList(queryWrapper); | |||||
if (lists!=null&&lists.size()>0) { | |||||
for (ZsProductCategory zsProductCategory:lists) { | |||||
Map map = new HashMap(); | |||||
map.put("id",zsProductCategory.getId()); | |||||
map.put("title",zsProductCategory.getName()); | |||||
map.put("description",zsProductCategory.getDescripetion()); | |||||
map.put("features",zsProductCategory.getFeatures()); | |||||
String imageUrl = ""; | |||||
if (zsProductCategory.getCover()!=null) { | |||||
SysOssVo sysOssVo = iSysOssService.getById(Long.valueOf(zsProductCategory.getCover())); | |||||
imageUrl = sysOssVo.getUrl(); | |||||
} | |||||
map.put("image",imageUrl); | |||||
map.put("link",zsProductCategory.getBlankUrl()); | |||||
reList.add(map); | |||||
} | |||||
} | |||||
} | |||||
return reList; | |||||
} | |||||
//产品用途 | |||||
@Override | |||||
public List<Map> getProductPurposeJson(String code, String languageCode) { | |||||
List<Map> reList = new ArrayList(); | |||||
Long webSiteId = getWebSiteId(code,languageCode); | |||||
if (webSiteId!=null) { | |||||
QueryWrapper<ZsPurpose> queryWrapper = new QueryWrapper<>(); | |||||
queryWrapper.eq("language_code",languageCode); | |||||
queryWrapper.eq("website_id",webSiteId); | |||||
List<ZsPurpose> lists = zsPurposeMapper.selectList(queryWrapper); | |||||
if (lists!=null&&lists.size()>0) { | |||||
for (ZsPurpose zsPurpose:lists) { | |||||
Map map = new HashMap(); | |||||
map.put("id",zsPurpose.getId()); | |||||
map.put("title",zsPurpose.getName()); | |||||
map.put("description",zsPurpose.getDescripetion()); | |||||
reList.add(map); | |||||
} | |||||
} | |||||
} | |||||
return reList; | |||||
} | |||||
//产品详情 | |||||
@Override | |||||
public List<Map> getProductDetailJson(String code, String languageCode) { | |||||
List<Map> reList = new ArrayList(); | |||||
Long webSiteId = getWebSiteId(code,languageCode); | |||||
if (webSiteId!=null) { | |||||
QueryWrapper<ZsProduct> queryWrapper = new QueryWrapper<>(); | |||||
queryWrapper.eq("language_code",languageCode); | |||||
queryWrapper.eq("website_id",webSiteId); | |||||
List<ZsProduct> lists = zsProductMapper.selectList(queryWrapper); | |||||
if (lists!=null&&lists.size()>0) { | |||||
for (ZsProduct zsProduct:lists) { | |||||
Map map = new HashMap(); | |||||
map.put("id",zsProduct.getId()); | |||||
map.put("name",zsProduct.getName()); | |||||
List<String> purposeNames = new ArrayList(); | |||||
ZsProductCategory zsProductCategory= zsProductCategoryMapper.selectById(zsProduct.getCategoryId()); | |||||
map.put("category",zsProductCategory.getName()); | |||||
String purposeIds = zsProduct.getPurposeIds(); | |||||
if (StringUtils.isNotBlank(purposeIds)) { | |||||
String[] purposeIdsArr = purposeIds.split(","); | |||||
QueryWrapper<ZsPurpose> zsPurposeQueryWrapper = new QueryWrapper<>(); | |||||
zsPurposeQueryWrapper.select("name"); | |||||
zsPurposeQueryWrapper.in("id", purposeIdsArr); | |||||
List<ZsPurpose> zsPurposes = zsPurposeMapper.selectList(zsPurposeQueryWrapper); | |||||
if (zsPurposes != null && zsPurposes.size() > 0) { | |||||
for (ZsPurpose zsPurpose : zsPurposes) { | |||||
purposeNames.add(zsPurpose.getName()); | |||||
} | |||||
} | |||||
} | |||||
map.put("usage",purposeNames); | |||||
map.put("capacities",zsProduct.getTag()); | |||||
//封面 | |||||
String imageUrl = ""; | |||||
if (zsProduct.getCover()!=null) { | |||||
SysOssVo sysOssVo = iSysOssService.getById(Long.valueOf(zsProduct.getCover())); | |||||
imageUrl = sysOssVo.getUrl(); | |||||
} | |||||
map.put("image",imageUrl); | |||||
//图片集合 | |||||
List<Long> ids = new ArrayList(); | |||||
if (zsProduct.getGalleryList()!=null&&zsProduct.getGalleryList().length()>0) { | |||||
String[] gallerys = zsProduct.getGalleryList().split(","); | |||||
for (String galleryId:gallerys) { | |||||
ids.add(Long.parseLong(galleryId)); | |||||
} | |||||
} | |||||
List<SysOssVo> sysOssVos = iSysOssService.listByIds(ids); | |||||
List<String> galleryList = new ArrayList(); | |||||
if (sysOssVos!=null&&sysOssVos.size()>0) { | |||||
for (SysOssVo sysOssVo1:sysOssVos) { | |||||
galleryList.add(sysOssVo1.getUrl()); | |||||
} | |||||
} | |||||
map.put("gallery",galleryList); | |||||
// map.put("summary",); | |||||
map.put("description1",zsProduct.getDescripetion1()); | |||||
map.put("description2",zsProduct.getDescripetion2()); | |||||
reList.add(map); | |||||
} | |||||
} | |||||
} | |||||
return reList; | |||||
} | |||||
//FAQ留言信息 | |||||
@Override | |||||
public List<Map> getFAQJson(String code, String languageCode) { | |||||
return null; | |||||
} | |||||
public Long getWebSiteId(String code,String languageCode) { | |||||
Long webSiteId = null; | |||||
//根据网站编码和语言查询 | |||||
QueryWrapper<ZsWebsite> zsWebsiteQueryWrapper = new QueryWrapper<>(); | |||||
zsWebsiteQueryWrapper.eq("language_code",languageCode); | |||||
zsWebsiteQueryWrapper.eq("code",code); | |||||
List<ZsWebsite> websites = zsWebsiteMapper.selectList(zsWebsiteQueryWrapper); | |||||
if (websites!=null&&websites.size()>0) { | |||||
ZsWebsite zsWebsite = websites.get(0); | |||||
webSiteId = zsWebsite.getId(); | |||||
} | |||||
return webSiteId; | |||||
} | |||||
} |
/** | /** | ||||
* 站点信息Service业务层处理 | * 站点信息Service业务层处理 | ||||
* | * | ||||
* @author ruoyi | |||||
* @date 2025-04-28 | |||||
* @author 王强 | |||||
* @date 2025-04-30 | |||||
*/ | */ | ||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
@Service | @Service | ||||
LambdaQueryWrapper<ZsWebsite> lqw = Wrappers.lambdaQuery(); | LambdaQueryWrapper<ZsWebsite> lqw = Wrappers.lambdaQuery(); | ||||
lqw.eq(StringUtils.isNotBlank(bo.getLanguageCode()), ZsWebsite::getLanguageCode, bo.getLanguageCode()); | lqw.eq(StringUtils.isNotBlank(bo.getLanguageCode()), ZsWebsite::getLanguageCode, bo.getLanguageCode()); | ||||
lqw.like(StringUtils.isNotBlank(bo.getSiteName()), ZsWebsite::getSiteName, bo.getSiteName()); | lqw.like(StringUtils.isNotBlank(bo.getSiteName()), ZsWebsite::getSiteName, bo.getSiteName()); | ||||
lqw.like(StringUtils.isNotBlank(bo.getCode()), ZsWebsite::getCode, bo.getCode()); | |||||
return lqw; | return lqw; | ||||
} | } | ||||
<?xml version="1.0" encoding="UTF-8" ?> | |||||
<!DOCTYPE mapper | |||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.ruoyi.system.mapper.ZsMessagesMapper"> | |||||
<resultMap type="com.ruoyi.system.domain.ZsMessages" id="ZsMessagesResult"> | |||||
<result property="id" column="id"/> | |||||
<result property="websiteId" column="website_id"/> | |||||
<result property="username" column="username"/> | |||||
<result property="email" column="email"/> | |||||
<result property="content" column="content"/> | |||||
<result property="ipAddress" column="ip_address"/> | |||||
<result property="createdAt" column="created_at"/> | |||||
<result property="status" column="status"/> | |||||
<result property="adminReply" column="admin_reply"/> | |||||
<result property="adminReplyAt" column="admin_reply_at"/> | |||||
<result property="createTime" column="create_time"/> | |||||
<result property="updateTime" column="update_time"/> | |||||
<result property="createBy" column="create_by"/> | |||||
<result property="updateBy" column="update_by"/> | |||||
</resultMap> | |||||
</mapper> |
<result property="level" column="level"/> | <result property="level" column="level"/> | ||||
<result property="name" column="name"/> | <result property="name" column="name"/> | ||||
<result property="descripetion" column="descripetion"/> | <result property="descripetion" column="descripetion"/> | ||||
<result property="features" column="features"/> | |||||
<result property="cover" column="cover"/> | <result property="cover" column="cover"/> | ||||
<result property="blankUrl" column="blank_url"/> | <result property="blankUrl" column="blank_url"/> | ||||
<result property="sort" column="sort"/> | <result property="sort" column="sort"/> |
<result property="isDisabled" column="is_disabled"/> | <result property="isDisabled" column="is_disabled"/> | ||||
<result property="platformIds" column="platform_ids"/> | <result property="platformIds" column="platform_ids"/> | ||||
<result property="isRecommend" column="is_recommend"/> | <result property="isRecommend" column="is_recommend"/> | ||||
<result property="tag" column="tag"/> | |||||
<result property="createTime" column="create_time"/> | <result property="createTime" column="create_time"/> | ||||
<result property="updateTime" column="update_time"/> | <result property="updateTime" column="update_time"/> | ||||
<result property="createBy" column="create_by"/> | <result property="createBy" column="create_by"/> | ||||
<result property="updateBy" column="update_by"/> | <result property="updateBy" column="update_by"/> | ||||
</resultMap> | </resultMap> | ||||
<select id="getProductAndCategoryInfo" resultType="java.util.Map"> | |||||
SELECT | |||||
p.NAME AS product_name, | |||||
c.NAME AS category_name, | |||||
p.purpose_ids, | |||||
p.tag, | |||||
p.cover, | |||||
p.descripetion1 | |||||
FROM | |||||
zs_product p | |||||
INNER JOIN zs_product_category c ON p.category_id = c.id | |||||
WHERE | |||||
p.website_id = #{website_id} | |||||
AND p.language_code = #{language_code} | |||||
AND c.website_id = #{website_id} | |||||
AND c.language_code = #{language_code} | |||||
</select> | |||||
</mapper> | </mapper> |
<result property="siteName" column="site_name"/> | <result property="siteName" column="site_name"/> | ||||
<result property="slogan" column="slogan"/> | <result property="slogan" column="slogan"/> | ||||
<result property="logo" column="logo"/> | <result property="logo" column="logo"/> | ||||
<result property="iconFav" column="iconFav"/> | |||||
<result property="icon" column="icon"/> | |||||
<result property="record" column="record"/> | <result property="record" column="record"/> | ||||
<result property="version" column="version"/> | |||||
<result property="copyrightInfo" column="copyright_info"/> | |||||
<result property="email" column="email"/> | <result property="email" column="email"/> | ||||
<result property="seoTitle" column="seo_title"/> | <result property="seoTitle" column="seo_title"/> | ||||
<result property="seoKeyword" column="seo_keyword"/> | <result property="seoKeyword" column="seo_keyword"/> | ||||
<result property="robotsRule" column="robots_rule"/> | <result property="robotsRule" column="robots_rule"/> | ||||
<result property="sitemapGule" column="sitemap_gule"/> | <result property="sitemapGule" column="sitemap_gule"/> | ||||
<result property="statisticsCode" column="statistics_code"/> | <result property="statisticsCode" column="statistics_code"/> | ||||
<result property="code" column="code"/> | |||||
<result property="createTime" column="create_time"/> | <result property="createTime" column="create_time"/> | ||||
<result property="updateTime" column="update_time"/> | <result property="updateTime" column="update_time"/> | ||||
<result property="createBy" column="create_by"/> | <result property="createBy" column="create_by"/> |