diff --git a/boyue-admin/src/main/resources/application.yml b/boyue-admin/src/main/resources/application.yml index 6a64fec..1e232e5 100644 --- a/boyue-admin/src/main/resources/application.yml +++ b/boyue-admin/src/main/resources/application.yml @@ -21,7 +21,7 @@ boyue: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 9799 + port: 19696 servlet: # 应用的访问路径 context-path: / diff --git a/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/controller/UserFeedbackController.java b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/controller/UserFeedbackController.java new file mode 100644 index 0000000..2f5d5fa --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/controller/UserFeedbackController.java @@ -0,0 +1,151 @@ +package com.boyue.hasfj.controller; + +import java.util.List; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.boyue.common.annotation.Log; +import com.boyue.common.core.controller.BaseController; +import com.boyue.common.core.domain.AjaxResult; +import com.boyue.common.enums.BusinessType; +import com.boyue.hasfj.domain.UserFeedback; +import com.boyue.hasfj.service.IUserFeedbackService; +import com.boyue.common.utils.poi.ExcelUtil; +import com.boyue.common.core.page.TableDataInfo; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.ModelAttribute; + +/** + * 用户留言Controller + * + * @author boyue + * @date 2025-07-04 + */ +@RestController +@RequestMapping("/hasfj/feedback") +@Tag(name = "【用户留言】管理") +public class UserFeedbackController extends BaseController +{ + @Autowired + private IUserFeedbackService userFeedbackService; + + /** + * 查询用户留言列表 + */ + @Operation(summary = "查询用户留言列表") + @PreAuthorize("@ss.hasPermi('hasfj:feedback:list')") + @GetMapping("/list") + public TableDataInfo list(UserFeedback userFeedback) + { + startPage(); + List list = userFeedbackService.selectUserFeedbackList(userFeedback); + return getDataTable(list); + } + + /** + * 导出用户留言列表 + */ + @Operation(summary = "导出用户留言列表") + @PreAuthorize("@ss.hasPermi('hasfj:feedback:export')") + @Log(title = "用户留言", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, UserFeedback userFeedback) + { + List list = userFeedbackService.selectUserFeedbackList(userFeedback); + ExcelUtil util = new ExcelUtil(UserFeedback.class); + util.exportExcel(response, list, "用户留言数据"); + } + + /** + * 获取用户留言详细信息 + */ + @Operation(summary = "获取用户留言详细信息") + @PreAuthorize("@ss.hasPermi('hasfj:feedback:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(userFeedbackService.selectUserFeedbackById(id)); + } + + /** + * 新增用户留言 + */ + @Operation(summary = "新增用户留言") + @PreAuthorize("@ss.hasPermi('hasfj:feedback:add')") + @Log(title = "用户留言", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody UserFeedback userFeedback) + { + userFeedbackService.insertUserFeedback(userFeedback); + return success(userFeedback); + } + + /** + * 修改用户留言 + */ + @Operation(summary = "修改用户留言") + @PreAuthorize("@ss.hasPermi('hasfj:feedback:edit')") + @Log(title = "用户留言", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody UserFeedback userFeedback) + { + return toAjax(userFeedbackService.updateUserFeedback(userFeedback)); + } + + /** + * 删除用户留言 + */ + @Operation(summary = "删除用户留言") + @PreAuthorize("@ss.hasPermi('hasfj:feedback:remove')") + @Log(title = "用户留言", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable( name = "ids" ) Long[] ids) + { + return toAjax(userFeedbackService.deleteUserFeedbackByIds(ids)); + } + + /** + * 用户前端 + * 前端用户留言提交 + */ + @Operation(summary = "前端用户留言提交") + @Log(title = "用户留言", businessType = BusinessType.INSERT) + @PostMapping("/user/submit") + public AjaxResult useradd(@RequestBody UserFeedback userFeedback) + { + userFeedbackService.insertUserFeedback(userFeedback); + return success(userFeedback); + } + + /** + * 用户前端 + * 获取用户留言编号 + */ + @Operation(summary = "获取用户留言编号") + @GetMapping(value = "/user/getById/{id}") + public AjaxResult getUserFeedbackById(@PathVariable("id") Long id) + { + return success(userFeedbackService.selectUserFeedbackById(id)); + } + + /** + * 用户前端 + * 通过留言编号、姓名、身份证号、手机号获取用户留言详情 + */ + @Operation(summary = "通过留言编号、姓名、身份证号、手机号获取用户留言详情") + @GetMapping(value = "/user/queryDetail") + public AjaxResult getUserFeedbackDetail(@ModelAttribute UserFeedback userFeedback) + { + List list = userFeedbackService.selectUserFeedbackList(userFeedback); + return success(list.isEmpty() ? null : list.get(0)); + } +} diff --git a/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/domain/UserFeedback.java b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/domain/UserFeedback.java new file mode 100644 index 0000000..cb0f04f --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/domain/UserFeedback.java @@ -0,0 +1,235 @@ +package com.boyue.hasfj.domain; + +import java.util.Date; + +import com.boyue.common.core.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.boyue.common.annotation.Excel; + +/** + * 用户留言对象 user_feedback + * + * @author boyue + * @date 2025-07-04 + */ +@Schema(description = "用户留言对象") +public class UserFeedback extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 主键ID */ + @Schema(title = "主键ID") + @Excel(name = "主键ID") + private Long id; + + /** 留言查询编号,用于用户查询 */ + @Schema(title = "留言查询编号,用于用户查询") + @Excel(name = "留言查询编号,用于用户查询") + private String feedbackNo; + + /** 有问题的法律条例或案例 */ + @Schema(title = "有问题的法律条例或案例") + @Excel(name = "有问题的法律条例或案例") + private String legalArticle; + + /** 问题描述 */ + @Schema(title = "问题描述") + @Excel(name = "问题描述") + private String issueDescription; + + /** 用户姓名 */ + @Schema(title = "用户姓名") + @Excel(name = "用户姓名") + private String userName; + + /** 手机号 */ + @Schema(title = "手机号") + @Excel(name = "手机号") + private String phoneNumber; + + /** 身份证号 */ + @Schema(title = "身份证号") + @Excel(name = "身份证号") + private String idCardNumber; + + /** 联系方式类型:1-手机号,2-身份证号,3-姓名 */ + @Schema(title = "联系方式类型:1-手机号,2-身份证号,3-姓名") + @Excel(name = "联系方式类型:1-手机号,2-身份证号,3-姓名") + private Long contactInfoType; + + /** 留言状态:0-待处理,1-已回复,2-已关闭 */ + @Schema(title = "留言状态:0-待处理,1-已回复,2-已关闭") + @Excel(name = "留言状态:0-待处理,1-已回复,2-已关闭") + private Long status; + + /** 管理员回复内容 */ + @Schema(title = "管理员回复内容") + @Excel(name = "管理员回复内容") + private String adminReplyContent; + + /** 管理员回复时间 */ + @Schema(title = "管理员回复时间") + @Excel(name = "管理员回复时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date adminReplyTime; + + /** 回复的管理员ID */ + @Schema(title = "回复的管理员ID") + @Excel(name = "回复的管理员ID") + private Long adminId; + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + + public void setFeedbackNo(String feedbackNo) + { + this.feedbackNo = feedbackNo; + } + + public String getFeedbackNo() + { + return feedbackNo; + } + + + public void setLegalArticle(String legalArticle) + { + this.legalArticle = legalArticle; + } + + public String getLegalArticle() + { + return legalArticle; + } + + + public void setIssueDescription(String issueDescription) + { + this.issueDescription = issueDescription; + } + + public String getIssueDescription() + { + return issueDescription; + } + + + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + + + public void setPhoneNumber(String phoneNumber) + { + this.phoneNumber = phoneNumber; + } + + public String getPhoneNumber() + { + return phoneNumber; + } + + + public void setIdCardNumber(String idCardNumber) + { + this.idCardNumber = idCardNumber; + } + + public String getIdCardNumber() + { + return idCardNumber; + } + + + public void setContactInfoType(Long contactInfoType) + { + this.contactInfoType = contactInfoType; + } + + public Long getContactInfoType() + { + return contactInfoType; + } + + + public void setStatus(Long status) + { + this.status = status; + } + + public Long getStatus() + { + return status; + } + + + public void setAdminReplyContent(String adminReplyContent) + { + this.adminReplyContent = adminReplyContent; + } + + public String getAdminReplyContent() + { + return adminReplyContent; + } + + + public void setAdminReplyTime(Date adminReplyTime) + { + this.adminReplyTime = adminReplyTime; + } + + public Date getAdminReplyTime() + { + return adminReplyTime; + } + + + public void setAdminId(Long adminId) + { + this.adminId = adminId; + } + + public Long getAdminId() + { + return adminId; + } + + + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("feedbackNo", getFeedbackNo()) + .append("legalArticle", getLegalArticle()) + .append("issueDescription", getIssueDescription()) + .append("userName", getUserName()) + .append("phoneNumber", getPhoneNumber()) + .append("idCardNumber", getIdCardNumber()) + .append("contactInfoType", getContactInfoType()) + .append("status", getStatus()) + .append("createTime", getCreateTime()) + .append("adminReplyContent", getAdminReplyContent()) + .append("adminReplyTime", getAdminReplyTime()) + .append("adminId", getAdminId()) + .toString(); + } +} diff --git a/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/mapper/UserFeedbackMapper.java b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/mapper/UserFeedbackMapper.java new file mode 100644 index 0000000..f43a626 --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/mapper/UserFeedbackMapper.java @@ -0,0 +1,61 @@ +package com.boyue.hasfj.mapper; + +import java.util.List; +import com.boyue.hasfj.domain.UserFeedback; + +/** + * 用户留言Mapper接口 + * + * @author boyue + * @date 2025-07-04 + */ +public interface UserFeedbackMapper +{ + /** + * 查询用户留言 + * + * @param id 用户留言主键 + * @return 用户留言 + */ + public UserFeedback selectUserFeedbackById(Long id); + + /** + * 查询用户留言列表 + * + * @param userFeedback 用户留言 + * @return 用户留言集合 + */ + public List selectUserFeedbackList(UserFeedback userFeedback); + + /** + * 新增用户留言 + * + * @param userFeedback 用户留言 + * @return 结果 + */ + public int insertUserFeedback(UserFeedback userFeedback); + + /** + * 修改用户留言 + * + * @param userFeedback 用户留言 + * @return 结果 + */ + public int updateUserFeedback(UserFeedback userFeedback); + + /** + * 删除用户留言 + * + * @param id 用户留言主键 + * @return 结果 + */ + public int deleteUserFeedbackById(Long id); + + /** + * 批量删除用户留言 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteUserFeedbackByIds(Long[] ids); +} diff --git a/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/service/IUserFeedbackService.java b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/service/IUserFeedbackService.java new file mode 100644 index 0000000..0fe6242 --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/service/IUserFeedbackService.java @@ -0,0 +1,69 @@ +package com.boyue.hasfj.service; + +import java.util.List; +import com.boyue.hasfj.domain.UserFeedback; + +/** + * 用户留言Service接口 + * + * @author boyue + * @date 2025-07-04 + */ +public interface IUserFeedbackService +{ + /** + * 查询用户留言 + * + * @param id 用户留言主键 + * @return 用户留言 + */ + public UserFeedback selectUserFeedbackById(Long id); + + /** + * 查询用户留言列表 + * + * @param userFeedback 用户留言 + * @return 用户留言集合 + */ + public List selectUserFeedbackList(UserFeedback userFeedback); + + /** + * 新增用户留言 + * + * @param userFeedback 用户留言 + * @return 结果 + */ + public int insertUserFeedback(UserFeedback userFeedback); + + /** + * 修改用户留言 + * + * @param userFeedback 用户留言 + * @return 结果 + */ + public int updateUserFeedback(UserFeedback userFeedback); + + /** + * 批量删除用户留言 + * + * @param ids 需要删除的用户留言主键集合 + * @return 结果 + */ + public int deleteUserFeedbackByIds(Long[] ids); + + /** + * 删除用户留言信息 + * + * @param id 用户留言主键 + * @return 结果 + */ + public int deleteUserFeedbackById(Long id); + + /** + * 查询用户留言 + * + * @param feedbackNo 留言查询编号 + * @return 用户留言 + */ + public UserFeedback selectUserFeedbackByFeedbackNo(String feedbackNo); +} diff --git a/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/service/impl/UserFeedbackServiceImpl.java b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/service/impl/UserFeedbackServiceImpl.java new file mode 100644 index 0000000..c1594ad --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/java/com/boyue/hasfj/service/impl/UserFeedbackServiceImpl.java @@ -0,0 +1,130 @@ +package com.boyue.hasfj.service.impl; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import com.boyue.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.boyue.hasfj.mapper.UserFeedbackMapper; +import com.boyue.hasfj.domain.UserFeedback; +import com.boyue.hasfj.service.IUserFeedbackService; + +/** + * 用户留言Service业务层处理 + * + * @author boyue + * @date 2025-07-04 + */ +@Service +public class UserFeedbackServiceImpl implements IUserFeedbackService +{ + @Autowired + private UserFeedbackMapper userFeedbackMapper; + + /** + * 查询用户留言 + * + * @param id 用户留言主键 + * @return 用户留言 + */ + @Override + public UserFeedback selectUserFeedbackById(Long id) + { + return userFeedbackMapper.selectUserFeedbackById(id); + } + + /** + * 查询用户留言列表 + * + * @param userFeedback 用户留言 + * @return 用户留言 + */ + @Override + public List selectUserFeedbackList(UserFeedback userFeedback) + { + return userFeedbackMapper.selectUserFeedbackList(userFeedback); + } + + /** + * 新增用户留言 + * + * @param userFeedback 用户留言 + * @return 结果 + */ + @Override + public int insertUserFeedback(UserFeedback userFeedback) + { + userFeedback.setCreateTime(DateUtils.getNowDate()); + // 自动生成留言查询编号 + if (userFeedback.getFeedbackNo() == null || userFeedback.getFeedbackNo().isEmpty()) { + String feedbackNo = "YHLY-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")); + userFeedback.setFeedbackNo(feedbackNo); + } + // 根据回复内容设置留言状态 + if (userFeedback.getAdminReplyContent() == null || userFeedback.getAdminReplyContent().isEmpty()) { + userFeedback.setStatus(0L); // 待处理 + } else { + userFeedback.setStatus(1L); // 已回复 + } + return userFeedbackMapper.insertUserFeedback(userFeedback); + } + + /** + * 修改用户留言 + * + * @param userFeedback 用户留言 + * @return 结果 + */ + @Override + public int updateUserFeedback(UserFeedback userFeedback) + { + userFeedback.setAdminReplyTime(DateUtils.getNowDate()); + // 根据回复内容设置留言状态 + if (userFeedback.getAdminReplyContent() == null || userFeedback.getAdminReplyContent().isEmpty()) { + userFeedback.setStatus(0L); // 待处理 + } else { + userFeedback.setStatus(1L); // 已回复 + } + return userFeedbackMapper.updateUserFeedback(userFeedback); + } + + /** + * 批量删除用户留言 + * + * @param ids 需要删除的用户留言主键 + * @return 结果 + */ + @Override + public int deleteUserFeedbackByIds(Long[] ids) + { + return userFeedbackMapper.deleteUserFeedbackByIds(ids); + } + + /** + * 删除用户留言信息 + * + * @param id 用户留言主键 + * @return 结果 + */ + @Override + public int deleteUserFeedbackById(Long id) + { + return userFeedbackMapper.deleteUserFeedbackById(id); + } + + /** + * 查询用户留言 + * + * @param feedbackNo 留言查询编号 + * @return 用户留言 + */ + @Override + public UserFeedback selectUserFeedbackByFeedbackNo(String feedbackNo) + { + UserFeedback userFeedback = new UserFeedback(); + userFeedback.setFeedbackNo(feedbackNo); + List list = userFeedbackMapper.selectUserFeedbackList(userFeedback); + return list.isEmpty() ? null : list.get(0); + } +} diff --git a/boyue-models/boyue-hasfj/src/main/resources/mapper/hasfj/UserFeedbackMapper.xml b/boyue-models/boyue-hasfj/src/main/resources/mapper/hasfj/UserFeedbackMapper.xml new file mode 100644 index 0000000..9cfee02 --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/resources/mapper/hasfj/UserFeedbackMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + select + uf.id, + uf.feedback_no, + uf.legal_article, + uf.issue_description, + uf.user_name, + uf.phone_number, + uf.id_card_number, + uf.contact_info_type, + uf.status, + uf.create_time, + uf.admin_reply_content, + uf.admin_reply_time, + uf.admin_id + from user_feedback uf + + + + + + + + insert into user_feedback + + feedback_no, + legal_article, + issue_description, + user_name, + phone_number, + id_card_number, + contact_info_type, + status, + create_time, + admin_reply_content, + admin_reply_time, + admin_id, + + + #{feedbackNo}, + #{legalArticle}, + #{issueDescription}, + #{userName}, + #{phoneNumber}, + #{idCardNumber}, + #{contactInfoType}, + #{status}, + #{createTime}, + #{adminReplyContent}, + #{adminReplyTime}, + #{adminId}, + + + + + update user_feedback + + feedback_no = #{feedbackNo}, + legal_article = #{legalArticle}, + issue_description = #{issueDescription}, + user_name = #{userName}, + phone_number = #{phoneNumber}, + id_card_number = #{idCardNumber}, + contact_info_type = #{contactInfoType}, + status = #{status}, + create_time = #{createTime}, + admin_reply_content = #{adminReplyContent}, + admin_reply_time = #{adminReplyTime}, + admin_id = #{adminId}, + + where user_feedback.id = #{id} + + + + delete from user_feedback where id = #{id} + + + + delete from user_feedback where id in + + #{id} + + + \ No newline at end of file diff --git a/boyue-models/boyue-hasfj/src/main/resources/templates/error/404.html b/boyue-models/boyue-hasfj/src/main/resources/templates/error/404.html new file mode 100644 index 0000000..974d400 --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/resources/templates/error/404.html @@ -0,0 +1,12 @@ + + + + + + 404 Not Found + + +

404 页面未找到

+

您访问的页面不存在。

+ + \ No newline at end of file diff --git a/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/case_list.html b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/case_list.html new file mode 100644 index 0000000..404be6c --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/case_list.html @@ -0,0 +1,12 @@ + + + + + + 典型案例列表 + + +

典型案例列表页面

+

这里将显示典型案例列表内容。

+ + \ No newline at end of file diff --git a/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/form_list.html b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/form_list.html new file mode 100644 index 0000000..dfa0229 --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/form_list.html @@ -0,0 +1,12 @@ + + + + + + 表单下载列表 + + +

表单下载列表页面

+

这里将显示表单下载列表内容。

+ + \ No newline at end of file diff --git a/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/index.html b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/index.html new file mode 100644 index 0000000..8e071f5 --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/index.html @@ -0,0 +1,12 @@ + + + + + + 淮安市司法局首页 + + +

淮安市司法局首页

+

这里是首页内容。

+ + \ No newline at end of file diff --git a/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/law_list.html b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/law_list.html new file mode 100644 index 0000000..ba8fb36 --- /dev/null +++ b/boyue-models/boyue-hasfj/src/main/resources/templates/hasfj/law_list.html @@ -0,0 +1,12 @@ + + + + + + 法律规定列表 + + +

法律规定列表页面

+

这里将显示法律规定列表内容。

+ + \ No newline at end of file