From 41155cf9f52cf65d37ea947032891b5fbd87a40b Mon Sep 17 00:00:00 2001 From: YIN Date: Wed, 31 Dec 2025 11:14:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E7=BA=A7=E8=81=94=E5=8A=A8=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E3=80=81=E7=BA=BF=E7=B4=A2=E4=BA=BA=E5=91=98=E6=A0=B8?= =?UTF-8?q?=E6=9F=A5=E3=80=81=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/ShowFileController.java | 2 +- .../common/core/enums/ReportLogTypeEnum.java | 107 +++++++++++ .../org/dromara/common/core/utils/Helper.java | 2 +- .../org/dromara/common/sms/util/SmsUtils.java | 6 +- .../controller/BizReportInfoController.java | 19 ++ .../controller/BizReportLogController.java | 105 +++++++++++ .../controller/BizReportPersonController.java | 10 +- .../dromara/biz/controller/RPAController.java | 9 +- .../org/dromara/biz/domain/BizReportLog.java | 88 +++++++++ .../dromara/biz/domain/BizReportPerson.java | 8 + .../dromara/biz/domain/BizReportReceiver.java | 34 ++++ .../dromara/biz/domain/bo/BizReportLogBo.java | 87 +++++++++ .../biz/domain/bo/BizReportPersonBo.java | 8 + .../biz/domain/bo/BizReportReceiverBo.java | 35 ++++ .../biz/domain/vo/BizReportInfoVo.java | 10 +- .../dromara/biz/domain/vo/BizReportLogVo.java | 107 +++++++++++ .../biz/domain/vo/BizReportPersonVo.java | 8 + .../biz/domain/vo/BizReportReceiverVo.java | 40 ++++ .../biz/mapper/BizReportLogMapper.java | 15 ++ .../biz/service/IBizReportInfoService.java | 17 ++ .../biz/service/IBizReportLogService.java | 79 ++++++++ .../impl/BizReportInfoServiceImpl.java | 139 +++++++++++++- .../service/impl/BizReportLogServiceImpl.java | 177 ++++++++++++++++++ .../impl/BizReportPersonServiceImpl.java | 40 +++- .../impl/BizReportReceiverServiceImpl.java | 12 ++ .../impl/BizReportReplyServiceImpl.java | 6 + .../controller/system/SysAreaController.java | 113 +++++++++++ .../controller/system/SysDeptController.java | 7 + .../system/SysDictDataController.java | 1 - .../system/SysDictTreeController.java | 112 +++++++++++ .../org/dromara/system/domain/SysArea.java | 121 ++++++++++++ .../dromara/system/domain/SysDictTree.java | 71 +++++++ .../dromara/system/domain/bo/SysAreaBo.java | 126 +++++++++++++ .../system/domain/bo/SysDictTreeBo.java | 70 +++++++ .../dromara/system/domain/bo/SysUserBo.java | 4 + .../dromara/system/domain/vo/SysAreaVo.java | 147 +++++++++++++++ .../system/domain/vo/SysDictTreeVo.java | 86 +++++++++ .../dromara/system/domain/vo/SysUserVo.java | 4 + .../dromara/system/mapper/SysAreaMapper.java | 15 ++ .../system/mapper/SysDictTreeMapper.java | 15 ++ .../system/service/ISysAreaService.java | 68 +++++++ .../system/service/ISysDictTreeService.java | 68 +++++++ .../system/service/ISysUserService.java | 2 +- .../service/impl/SysAreaServiceImpl.java | 146 +++++++++++++++ .../service/impl/SysDictTreeServiceImpl.java | 136 ++++++++++++++ .../service/impl/SysUserServiceImpl.java | 4 +- .../mapper/biz/BizReportLogMapper.xml | 7 + .../resources/mapper/system/SysAreaMapper.xml | 7 + .../mapper/system/SysDictTreeMapper.xml | 7 + 49 files changed, 2478 insertions(+), 29 deletions(-) create mode 100644 ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/enums/ReportLogTypeEnum.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportLogController.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportLog.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportLogBo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportLogVo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportLogMapper.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportLogService.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportLogServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysAreaController.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictTreeController.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysArea.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictTree.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysAreaBo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTreeBo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysAreaVo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTreeVo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysAreaMapper.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictTreeMapper.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysAreaService.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysDictTreeService.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysAreaServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTreeServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/biz/BizReportLogMapper.xml create mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysAreaMapper.xml create mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTreeMapper.xml diff --git a/ruoyi-admin/src/main/java/org/dromara/web/controller/ShowFileController.java b/ruoyi-admin/src/main/java/org/dromara/web/controller/ShowFileController.java index 18e714c..81ae93a 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/controller/ShowFileController.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/controller/ShowFileController.java @@ -50,7 +50,7 @@ public class ShowFileController { //源文件路径 String sourcePath = filePath; //pdf文件路径 - String pdfPath = "D:/ruoyi/uploadPath/pdf/";; + String pdfPath = "E:/uploadPath/pdf/";; //获取文件后缀判断是否转换pdf int index = filePath.lastIndexOf("."); String fileType = filePath.substring(index + 1); diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/enums/ReportLogTypeEnum.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/enums/ReportLogTypeEnum.java new file mode 100644 index 0000000..56498f8 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/enums/ReportLogTypeEnum.java @@ -0,0 +1,107 @@ +package org.dromara.common.core.enums; + +import cn.hutool.core.util.StrUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.dromara.common.core.utils.StringUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 业务状态枚举 + * + * @author may + */ +@Getter +@AllArgsConstructor +public enum ReportLogTypeEnum { + + /** + * 新增 + */ + CREATE("1", "新增"), + /** + * 修改 + */ + EDIT("2", "修改"), + + /** + * 退回 + */ + BACK("3", "退回"), + + /** + * 签收 + */ + SIGN("4", "签收"), + + /** + * 反馈 + */ + REPLY("5", "反馈"), + + /** + * 转发 + */ + FORWARD("6", "转发"), + + /** + * 二次下发 + */ + RESEND("7", "二次下发"), + + /** + * 核查线索人员 + */ + EXAMINE_PERSON("8", "核查线索人员"), + + /** + * 删除 + */ + DELETE("9", "删除"); + + + /** + * 状态 + */ + private final String status; + + /** + * 描述 + */ + private final String desc; + + private static final Map STATUS_MAP = Arrays.stream(ReportLogTypeEnum.values()) + .collect(Collectors.toConcurrentMap(ReportLogTypeEnum::getStatus, Function.identity())); + + /** + * 根据状态获取对应的 BusinessStatusEnum 枚举 + * + * @param status 业务状态码 + * @return 对应的 BusinessStatusEnum 枚举,如果找不到则返回 null + */ + public static ReportLogTypeEnum getByStatus(String status) { + // 使用 STATUS_MAP 获取对应的枚举,若找不到则返回 null + return STATUS_MAP.get(status); + } + + /** + * 根据状态获取对应的业务状态描述信息 + * + * @param status 业务状态码 + * @return 返回业务状态描述,若状态码为空或未找到对应的枚举,返回空字符串 + */ + public static String findByStatus(String status) { + if (StringUtils.isBlank(status)) { + return StrUtil.EMPTY; + } + ReportLogTypeEnum statusEnum = STATUS_MAP.get(status); + return (statusEnum != null) ? statusEnum.getDesc() : StrUtil.EMPTY; + } + + +} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/Helper.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/Helper.java index 927345b..e7ba225 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/Helper.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/Helper.java @@ -108,7 +108,7 @@ public class Helper { Pattern p1 = null; Pattern p2 = null; Matcher m = null; - p1 = Pattern.compile("^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})?$"); + p1 = Pattern.compile("^((1[3-9]{1})+\\d{8})?$"); p2 = Pattern.compile("^(0[0-9]{2,3}\\-)?([1-9][0-9]{6,7})$"); if("0".equals(checkType)){ System.out.println(phoneNum.length()); diff --git a/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/util/SmsUtils.java b/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/util/SmsUtils.java index 76b1ed4..d59c8e2 100644 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/util/SmsUtils.java +++ b/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/util/SmsUtils.java @@ -26,7 +26,7 @@ public class SmsUtils { public static String sendSingleSms(String typeService, String authUserCode, String authPass, String phone, String content, String sendTime){ try { URL url = new URL("http://10.128.1.96:8089/smsWebService/services/smsService?wsdl"); - QName qname = new QName("http://ws.service.shanli.com/", + QName qname = new QName("http://webServiceInterface.shanli.cn/", "sendSingleSMS"); Service service = new Service(); Call call = (Call) service.createCall(); @@ -39,10 +39,10 @@ public class SmsUtils { // call.addParameter("name", XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("phone", XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("content", XMLType.XSD_STRING, ParameterMode.IN); - call.addParameter("subCode", XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("sendTime", XMLType.XSD_STRING, ParameterMode.IN); + call.addParameter("subCode", XMLType.XSD_STRING, ParameterMode.IN); Object[] obj = new String[]{ authUserCode, authPass, typeService, phone, - content, "", sendTime }; + content, sendTime, "" }; log.info("发送参数: {}", JSONUtil.toJsonStr(obj)); return (String) call.invoke(obj); } catch (Exception e) { diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportInfoController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportInfoController.java index f1dccda..8adf581 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportInfoController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportInfoController.java @@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.*; import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.biz.domain.bo.BizReportReceiverBo; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.utils.Helper; import org.dromara.common.satoken.utils.LoginHelper; @@ -144,4 +145,22 @@ public class BizReportInfoController extends BaseController { public R back(@Validated(EditGroup.class) @RequestBody BizReportInfoBo bo) { return toAjax(bizReportInfoService.back(bo)); } + + /** + * 获取下一个期号 + */ + @GetMapping("/nextQH") + public R nextQH(BizReportInfoBo bo) { + return R.ok("操作成功", bizReportInfoService.nextQH(bo)); + } + + /** + * 重新下发报送信息 + */ + @Log(title = "报送信息下发", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PostMapping("/resend") + public R resend(@Validated(EditGroup.class) @RequestBody BizReportReceiverBo bo) { + return toAjax(bizReportInfoService.resend(bo)); + } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportLogController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportLogController.java new file mode 100644 index 0000000..f134677 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportLogController.java @@ -0,0 +1,105 @@ +package org.dromara.biz.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.biz.domain.vo.BizReportLogVo; +import org.dromara.biz.domain.bo.BizReportLogBo; +import org.dromara.biz.service.IBizReportLogService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 报送操作日志 + * + * @author ruansee + * @date 2025-12-30 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/biz/reportLog") +public class BizReportLogController extends BaseController { + + private final IBizReportLogService bizReportLogService; + + /** + * 查询报送操作日志列表 + */ + @SaCheckPermission("biz:reportLog:list") + @GetMapping("/list") + public TableDataInfo list(BizReportLogBo bo, PageQuery pageQuery) { + return bizReportLogService.queryPageList(bo, pageQuery); + } + + /** + * 导出报送操作日志列表 + */ + @SaCheckPermission("biz:reportLog:export") + @Log(title = "报送操作日志", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(BizReportLogBo bo, HttpServletResponse response) { + List list = bizReportLogService.queryList(bo); + ExcelUtil.exportExcel(list, "报送操作日志", BizReportLogVo.class, response); + } + + /** + * 获取报送操作日志详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("biz:reportLog:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(bizReportLogService.queryById(id)); + } + + /** + * 新增报送操作日志 + */ + @SaCheckPermission("biz:reportLog:add") + @Log(title = "报送操作日志", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody BizReportLogBo bo) { + return toAjax(bizReportLogService.insertByBo(bo)); + } + + /** + * 修改报送操作日志 + */ + @SaCheckPermission("biz:reportLog:edit") + @Log(title = "报送操作日志", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody BizReportLogBo bo) { + return toAjax(bizReportLogService.updateByBo(bo)); + } + + /** + * 删除报送操作日志 + * + * @param ids 主键串 + */ + @SaCheckPermission("biz:reportLog:remove") + @Log(title = "报送操作日志", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(bizReportLogService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportPersonController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportPersonController.java index 3f401e8..6c68acc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportPersonController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportPersonController.java @@ -36,6 +36,14 @@ public class BizReportPersonController extends BaseController { private final IBizReportPersonService bizReportPersonService; + /** + * 查询报送关联人员列表 + */ + @GetMapping("/history") + public R> history(BizReportPersonBo bo) { + return R.ok(bizReportPersonService.queryList(bo)); + } + /** * 查询报送关联人员列表 */ @@ -82,7 +90,7 @@ public class BizReportPersonController extends BaseController { /** * 修改报送关联人员 */ - @SaCheckPermission("biz:reportPerson:edit") +// @SaCheckPermission("biz:reportPerson:edit") @Log(title = "报送关联人员", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/RPAController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/RPAController.java index 629bc03..4ed85dd 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/RPAController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/RPAController.java @@ -1,6 +1,7 @@ package org.dromara.biz.controller; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaIgnore; import cn.hutool.core.util.ObjectUtil; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.NotEmpty; @@ -43,6 +44,7 @@ import java.util.List; * @date 2025-12-15 */ @Validated +@SaIgnore @RequiredArgsConstructor @RestController @RequestMapping("/rpa") @@ -57,11 +59,10 @@ public class RPAController extends BaseController { /** - * 新增通知公告 + * 测试短信 */ - @RepeatSubmit() - @PostMapping("/smstest") - public R smstest(@Validated(AddGroup.class) @RequestBody BizIcdsNoticeBo bo) { + @GetMapping("/smstest") + public R smstest() { return R.ok(SmsUtils.sendSMS("18655101696", "您有一条新的报送信息待处理,请前往查看")); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportLog.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportLog.java new file mode 100644 index 0000000..dc2ce7a --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportLog.java @@ -0,0 +1,88 @@ +package org.dromara.biz.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 报送操作日志对象 biz_report_log + * + * @author ruansee + * @date 2025-12-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("biz_report_log") +public class BizReportLog extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId(value = "id") + private Long id; + + /** + * 报送信息ID + */ + private Long reportId; + + /** + * 操作类型(新增、修改、退回、签收、反馈、转发、作废) + */ + private String type; + + /** + * 操作用户ID + */ + private Long userId; + + /** + * 操作用户名称 + */ + private String userName; + + /** + * 警号 + */ + private String policeNum; + + /** + * 操作单位ID + */ + private String deptId; + + /** + * 操作单位名称 + */ + private String deptName; + + /** + * 操作时间 + */ + private Date optime; + + /** + * 操作IP + */ + private String opip; + + /** + * 关联ID + */ + private String relationId; + + /** + * 操作的简要描述,例如退回原因等 + */ + private String remark; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportPerson.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportPerson.java index 49525ea..64471dd 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportPerson.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportPerson.java @@ -294,6 +294,10 @@ public class BizReportPerson extends BaseEntity { */ private String szdlx; + /** + * 所在地行政区划ID + */ + private String szdxzqhid; /** * 所在地行政区划 */ @@ -399,5 +403,9 @@ public class BizReportPerson extends BaseEntity { */ private String sfgp; + /** + * 是否核查 + */ + private Integer sfhc; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReceiver.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReceiver.java index 2b5195e..9dadddc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReceiver.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReceiver.java @@ -84,4 +84,38 @@ public class BizReportReceiver extends BaseEntity { */ private Boolean isFeedback; + /** + * 下发单位ID + */ + private String sendDeptId; + + /** + * 下发单位名称 + */ + private String sendDeptName; + + /** + * 是否下发 + */ + private Long isResend; + + /** + * 下发时间 + */ + private Date resendTime; + + /** + * 下发内容 + */ + private String resendContent; + + /** + * 下发用户ID + */ + private Long resendUserId; + + /** + * 下发用户名称 + */ + private String resendUserName; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportLogBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportLogBo.java new file mode 100644 index 0000000..c6ebc6d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportLogBo.java @@ -0,0 +1,87 @@ +package org.dromara.biz.domain.bo; + +import org.dromara.biz.domain.BizReportLog; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 报送操作日志业务对象 biz_report_log + * + * @author ruansee + * @date 2025-12-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = BizReportLog.class, reverseConvertGenerate = false) +public class BizReportLogBo extends BaseEntity { + + /** + * ID + */ + @NotNull(message = "ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 报送信息ID + */ + private Long reportId; + + /** + * 操作类型(新增、修改、退回、签收、反馈、转发、作废) + */ + private String type; + + /** + * 操作用户ID + */ + private Long userId; + + /** + * 操作用户名称 + */ + private String userName; + + /** + * 警号 + */ + private String policeNum; + + /** + * 操作单位ID + */ + private String deptId; + + /** + * 操作单位名称 + */ + private String deptName; + + /** + * 操作时间 + */ + private Date optime; + + /** + * 操作IP + */ + private String opip; + + /** + * 关联ID + */ + private String relationId; + + /** + * 操作的简要描述,例如退回原因等 + */ + private String remark; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportPersonBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportPersonBo.java index 14aff72..3549784 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportPersonBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportPersonBo.java @@ -293,6 +293,10 @@ public class BizReportPersonBo extends BaseEntity { */ private String szdlx; + /** + * 所在地行政区划ID + */ + private String szdxzqhid; /** * 所在地行政区划 */ @@ -398,5 +402,9 @@ public class BizReportPersonBo extends BaseEntity { */ private String sfgp; + /** + * 是否核查 + */ + private Integer sfhc; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportReceiverBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportReceiverBo.java index bbf580a..b18718d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportReceiverBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizReportReceiverBo.java @@ -83,5 +83,40 @@ public class BizReportReceiverBo extends BaseEntity { */ private Boolean isFeedback; + /** + * 下发单位ID + */ + private String sendDeptId; + /** + * 下发单位名称 + */ + private String sendDeptName; + + /** + * 是否下发 + */ + private Long isResend; + + /** + * 下发时间 + */ + private Date resendTime; + + /** + * 下发内容 + */ + private String resendContent; + + /** + * 下发用户ID + */ + private Long resendUserId; + + /** + * 下发用户名称 + */ + private String resendUserName; + + private BizReportInfoBo reportInfo; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportInfoVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportInfoVo.java index 8de3d05..2f61b30 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportInfoVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportInfoVo.java @@ -2,12 +2,9 @@ package org.dromara.biz.domain.vo; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; -import org.dromara.biz.domain.BizReportFile; -import org.dromara.biz.domain.BizReportInfo; +import org.dromara.biz.domain.*; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; -import org.dromara.biz.domain.BizReportPerson; -import org.dromara.biz.domain.BizReportReceiver; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; import io.github.linpeilie.annotations.AutoMapper; @@ -193,4 +190,9 @@ public class BizReportInfoVo implements Serializable { * 关联线索人员列表 */ private List personList; + + /** + * 关联日志列表 + */ + private List logList; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportLogVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportLogVo.java new file mode 100644 index 0000000..5ae6daa --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportLogVo.java @@ -0,0 +1,107 @@ +package org.dromara.biz.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.biz.domain.BizReportLog; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 报送操作日志视图对象 biz_report_log + * + * @author ruansee + * @date 2025-12-30 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BizReportLog.class) +public class BizReportLogVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ExcelProperty(value = "ID") + private Long id; + + /** + * 报送信息ID + */ + @ExcelProperty(value = "报送信息ID") + private Long reportId; + + /** + * 操作类型(新增、修改、退回、签收、反馈、转发、作废) + */ + @ExcelProperty(value = "操作类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "新=增、修改、退回、签收、反馈、转发、作废") + private String type; + + /** + * 操作用户ID + */ + @ExcelProperty(value = "操作用户ID") + private Long userId; + + /** + * 操作用户名称 + */ + @ExcelProperty(value = "操作用户名称") + private String userName; + + /** + * 警号 + */ + @ExcelProperty(value = "警号") + private String policeNum; + + /** + * 操作单位ID + */ + @ExcelProperty(value = "操作单位ID") + private String deptId; + + /** + * 操作单位名称 + */ + @ExcelProperty(value = "操作单位名称") + private String deptName; + + /** + * 操作时间 + */ + @ExcelProperty(value = "操作时间") + private Date optime; + + /** + * 操作IP + */ + @ExcelProperty(value = "操作IP") + private String opip; + + /** + * 关联ID + */ + @ExcelProperty(value = "关联ID") + private String relationId; + + /** + * 操作的简要描述,例如退回原因等 + */ + @ExcelProperty(value = "操作的简要描述,例如退回原因等") + private String remark; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportPersonVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportPersonVo.java index a9b5ef9..33dd36f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportPersonVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportPersonVo.java @@ -354,6 +354,10 @@ public class BizReportPersonVo implements Serializable { @ExcelProperty(value = "所在地类型") private String szdlx; + /** + * 所在地行政区划ID + */ + private String szdxzqhid; /** * 所在地行政区划 */ @@ -480,5 +484,9 @@ public class BizReportPersonVo implements Serializable { @ExcelProperty(value = "是否购票") private String sfgp; + /** + * 是否核查 + */ + private Integer sfhc; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReceiverVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReceiverVo.java index a1efbfe..b681e2f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReceiverVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReceiverVo.java @@ -102,5 +102,45 @@ public class BizReportReceiverVo implements Serializable { @ExcelProperty(value = "是否反馈") private Boolean isFeedback; + /** + * 下发单位ID + */ + @ExcelProperty(value = "下发单位ID") + private String sendDeptId; + + /** + * 下发单位名称 + */ + @ExcelProperty(value = "下发单位名称") + private String sendDeptName; + /** + * 是否下发 + */ + @ExcelProperty(value = "是否下发") + private Long isResend; + + /** + * 下发时间 + */ + @ExcelProperty(value = "下发时间") + private Date resendTime; + + /** + * 下发内容 + */ + @ExcelProperty(value = "下发内容") + private String resendContent; + + /** + * 下发用户ID + */ + @ExcelProperty(value = "下发用户ID") + private Long resendUserId; + + /** + * 下发用户名称 + */ + @ExcelProperty(value = "下发用户名称") + private String resendUserName; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportLogMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportLogMapper.java new file mode 100644 index 0000000..4b7a0d6 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportLogMapper.java @@ -0,0 +1,15 @@ +package org.dromara.biz.mapper; + +import org.dromara.biz.domain.BizReportLog; +import org.dromara.biz.domain.vo.BizReportLogVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 报送操作日志Mapper接口 + * + * @author ruansee + * @date 2025-12-30 + */ +public interface BizReportLogMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportInfoService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportInfoService.java index 8dae2f4..9c503aa 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportInfoService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportInfoService.java @@ -1,5 +1,6 @@ package org.dromara.biz.service; +import org.dromara.biz.domain.bo.BizReportReceiverBo; import org.dromara.biz.domain.vo.BizReportInfoVo; import org.dromara.biz.domain.bo.BizReportInfoBo; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -73,4 +74,20 @@ public interface IBizReportInfoService { * @return 是否修改成功 */ Boolean back(BizReportInfoBo bo); + + /** + * 获取下一个期号 + * + * @param bo 报送信息 + * @return 下一个期号 + */ + public String nextQH(BizReportInfoBo bo); + + /** + * 重新下发报送信息 + * + * @param bo 报送信息 + * @return 是否下发成功 + */ + Boolean resend(BizReportReceiverBo bo); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportLogService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportLogService.java new file mode 100644 index 0000000..f2cdf3a --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportLogService.java @@ -0,0 +1,79 @@ +package org.dromara.biz.service; + +import jakarta.servlet.http.HttpServletRequest; +import org.dromara.biz.domain.vo.BizReportLogVo; +import org.dromara.biz.domain.bo.BizReportLogBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 报送操作日志Service接口 + * + * @author ruansee + * @date 2025-12-30 + */ +public interface IBizReportLogService { + + /** + * 查询报送操作日志 + * + * @param id 主键 + * @return 报送操作日志 + */ + BizReportLogVo queryById(Long id); + + /** + * 分页查询报送操作日志列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 报送操作日志分页列表 + */ + TableDataInfo queryPageList(BizReportLogBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的报送操作日志列表 + * + * @param bo 查询条件 + * @return 报送操作日志列表 + */ + List queryList(BizReportLogBo bo); + + /** + * 新增报送操作日志 + * + * @param bo 报送操作日志 + * @return 是否新增成功 + */ + Boolean insertByBo(BizReportLogBo bo); + + /** + * 修改报送操作日志 + * + * @param bo 报送操作日志 + * @return 是否修改成功 + */ + Boolean updateByBo(BizReportLogBo bo); + + /** + * 校验并批量删除报送操作日志信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 保存操作日志 + * @param reportId 报送信息ID + * @param type 操作类型 + * @param relationId 关联ID + * @param remark 备注 + * @return 返回是否成功 + */ + Boolean saveLog(Long reportId, String type, String relationId, String remark); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportInfoServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportInfoServiceImpl.java index 4c72be0..5d32db0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportInfoServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportInfoServiceImpl.java @@ -1,16 +1,16 @@ package org.dromara.biz.service.impl; -import org.dromara.biz.domain.BizReportFile; -import org.dromara.biz.domain.BizReportPerson; -import org.dromara.biz.domain.BizReportReceiver; +import org.dromara.biz.domain.*; +import org.dromara.biz.domain.bo.BizReportReceiverBo; import org.dromara.biz.domain.vo.BizReportReceiverVo; -import org.dromara.biz.mapper.BizReportFileMapper; -import org.dromara.biz.mapper.BizReportPersonMapper; -import org.dromara.biz.mapper.BizReportReceiverMapper; +import org.dromara.biz.mapper.*; +import org.dromara.biz.service.IBizReportLogService; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.enums.ReportInfoStatusEnum; +import org.dromara.common.core.enums.ReportLogTypeEnum; import org.dromara.common.core.utils.Helper; import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StreamUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.PageQuery; @@ -19,18 +19,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import org.dromara.common.satoken.utils.LoginHelper; +import org.dromara.common.sms.util.SmsUtils; import org.dromara.common.sse.dto.SseMessageDto; import org.dromara.common.sse.utils.SseMessageUtils; import org.dromara.system.domain.SysDept; import org.dromara.system.domain.bo.SysUserBo; +import org.dromara.system.domain.vo.SysUserVo; import org.dromara.system.mapper.SysDeptMapper; import org.dromara.system.mapper.SysUserMapper; import org.dromara.system.service.ISysUserService; import org.springframework.stereotype.Service; import org.dromara.biz.domain.bo.BizReportInfoBo; import org.dromara.biz.domain.vo.BizReportInfoVo; -import org.dromara.biz.domain.BizReportInfo; -import org.dromara.biz.mapper.BizReportInfoMapper; import org.dromara.biz.service.IBizReportInfoService; import java.util.*; @@ -55,12 +55,16 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { private final BizReportPersonMapper personMapper; + private final BizReportLogMapper logMapper; + private final SysDeptMapper deptMapper; private final ISysUserService userService; private final ScheduledExecutorService scheduledExecutorService; + private final IBizReportLogService logService; + /** * 查询报送信息 * @@ -92,6 +96,12 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { List persons = personMapper.selectList(lqwp); info.setPersonList(persons); + LambdaQueryWrapper lqwl = Wrappers.lambdaQuery(); + lqwl.orderByAsc(BizReportLog::getOptime); + lqwl.eq(BizReportLog::getReportId, id); + List logs = logMapper.selectList(lqwl); + info.setLogList(logs); + return info; } @@ -191,6 +201,9 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { if (flag) { bo.setId(add.getId()); + // 添加日志 + logService.saveLog(add.getId(), ReportLogTypeEnum.CREATE.getStatus(), "", "新增记录"); + // 插入接收单位表 if(bo.getReceiverDeptIds()!=null && bo.getReceiverDeptIds().length>0){ for (String deptId : bo.getReceiverDeptIds()) { @@ -198,6 +211,8 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { receiver.setReportId(bo.getId()); receiver.setDeptId(deptId); receiver.setDeptName(deptMapper.selectVoById(deptId).getDeptName()); + receiver.setSendDeptId(user.getDeptId()); + receiver.setSendDeptName(deptMapper.selectVoById(user.getDeptId()).getDeptName()); receiverMapper.insert(receiver); } }else{ @@ -208,6 +223,8 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { receiver.setReportId(bo.getId()); receiver.setDeptId(sjdept); receiver.setDeptName(deptMapper.selectVoById(sjdept).getDeptName()); + receiver.setSendDeptId(user.getDeptId()); + receiver.setSendDeptName(deptMapper.selectVoById(user.getDeptId()).getDeptName()); bo.setReceiverDeptIds(new String[]{ sjdept }); receiverMapper.insert(receiver); @@ -247,7 +264,9 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { if(bo.getReceiverDeptIds()!=null && bo.getReceiverDeptIds().length>0){ SysUserBo userBo = new SysUserBo(); userBo.setDeptIds(bo.getReceiverDeptIds()); - List userIds = userService.selectUserIdList(userBo); + List list = userService.selectUserIdList(userBo); + List userIds = StreamUtils.toList(list, SysUserVo::getUserId); + scheduledExecutorService.schedule(() -> { SseMessageDto dto = new SseMessageDto(); dto.setMessage("您有新的待办信息,请前往查看!"); @@ -255,6 +274,13 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { dto.setUserIds(userIds); SseMessageUtils.publishMessage(dto); }, 5, TimeUnit.SECONDS); + + for (SysUserVo userVo : list) { + String phone = Helper.NStr(userVo.getPhonenumber()); + if (Helper.validPhoneNum("0", phone)){ + SmsUtils.sendSMS(phone, "您有一条新的报送信息待处理,请前往查看"); + } + } } } return flag; @@ -276,6 +302,9 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { boolean flag = baseMapper.updateById(update) > 0; if (flag){ + // 添加日志 + logService.saveLog(update.getId(), ReportLogTypeEnum.EDIT.getStatus(), "", "修改记录"); + // 插入接收单位表 List dbDeptIds = new ArrayList<>(); if (bo.getReceiverDepts()!=null) { @@ -299,6 +328,8 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { receiver.setReportId(bo.getId()); receiver.setDeptId(deptId); receiver.setDeptName(deptMapper.selectVoById(deptId).getDeptName()); + receiver.setSendDeptId(user.getDeptId()); + receiver.setSendDeptName(deptMapper.selectVoById(user.getDeptId()).getDeptName()); receiverMapper.insert(receiver); } } @@ -384,8 +415,98 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { boolean flag = baseMapper.updateById(update) > 0; if (flag){ + // 添加日志 + logService.saveLog(update.getId(), ReportLogTypeEnum.BACK.getStatus(), "", "退回记录"); } return flag; } + + + /** + * 获取下一个期号 + * + * @param bo 报送信息 + * @return 下一个期号 + */ + @Override + public String nextQH(BizReportInfoBo bo) { + LoginUser user = LoginHelper.getLoginUser(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getCategoryId() != null, BizReportInfo::getCategoryId, bo.getCategoryId()); + lqw.eq(BizReportInfo::getReportDeptId, user.getDeptId()); + lqw.between(BizReportInfo::getReportTime , "", ""); + + int count = Helper.FInt(baseMapper.selectCount(lqw)); + String result = String.format("%0" + 4 + "d", count+1); + return result; + } + + + /** + * 重新下发报送信息 + * + * @param bo 报送信息 + * @return 是否下发成功 + */ + @Override + public Boolean resend(BizReportReceiverBo bo) { + LoginUser user = LoginHelper.getLoginUser(); + BizReportReceiver update = new BizReportReceiver(); // MapstructUtils.convert(bo, BizReportReceiver.class); + update.setId(bo.getId()); + update.setIsResend(1L); + update.setResendTime(new Date()); + update.setResendUserId(user.getUserId()); + update.setResendUserName(user.getNickname()); + update.setResendContent(bo.getResendContent()); + boolean flag = receiverMapper.updateById(update) > 0; + + if (flag){ + // 添加日志 + logService.saveLog(bo.getReportId(), ReportLogTypeEnum.RESEND.getStatus(), bo.getId().toString(), "二次下发"); + + BizReportInfo reportInfo = new BizReportInfo(); // MapstructUtils.convert(bo.getReportInfo(), BizReportInfo.class); + reportInfo.setStatus(ReportInfoStatusEnum.WAITING_SIGN.getStatus()); + reportInfo.setId(bo.getReportId()); + baseMapper.updateById(reportInfo); + + // 插入新的接收单位表 + if(bo.getReportInfo().getReceiverDeptIds()!=null && bo.getReportInfo().getReceiverDeptIds().length>0){ + for (String deptId : bo.getReportInfo().getReceiverDeptIds()) { + BizReportReceiver receiver = new BizReportReceiver(); + receiver.setReportId(bo.getReportId()); + receiver.setDeptId(deptId); + receiver.setDeptName(deptMapper.selectVoById(deptId).getDeptName()); + receiver.setSendDeptId(user.getDeptId()); + receiver.setSendDeptName(deptMapper.selectVoById(user.getDeptId()).getDeptName()); + receiverMapper.insert(receiver); + } + } + + // 发送待办消息提醒 + if(bo.getReportInfo().getReceiverDeptIds()!=null && bo.getReportInfo().getReceiverDeptIds().length>0){ + SysUserBo userBo = new SysUserBo(); + userBo.setDeptIds(bo.getReportInfo().getReceiverDeptIds()); + List list = userService.selectUserIdList(userBo); + List userIds = StreamUtils.toList(list, SysUserVo::getUserId); + + scheduledExecutorService.schedule(() -> { + SseMessageDto dto = new SseMessageDto(); + dto.setMessage("您有新的待办信息,请前往查看!"); + dto.setType("todo"); + dto.setUserIds(userIds); + SseMessageUtils.publishMessage(dto); + }, 5, TimeUnit.SECONDS); + + for (SysUserVo userVo : list) { + String phone = Helper.NStr(userVo.getPhonenumber()); + if (Helper.validPhoneNum("0", phone)){ + SmsUtils.sendSMS(phone, "您有一条新的报送信息待处理,请前往查看"); + } + } + } + } + + return flag; + } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportLogServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportLogServiceImpl.java new file mode 100644 index 0000000..ed73aea --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportLogServiceImpl.java @@ -0,0 +1,177 @@ +package org.dromara.biz.service.impl; + +import jakarta.servlet.http.HttpServletRequest; +import org.dromara.common.core.domain.model.LoginUser; +import org.dromara.common.core.utils.Helper; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.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.dromara.common.satoken.utils.LoginHelper; +import org.springframework.stereotype.Service; +import org.dromara.biz.domain.bo.BizReportLogBo; +import org.dromara.biz.domain.vo.BizReportLogVo; +import org.dromara.biz.domain.BizReportLog; +import org.dromara.biz.mapper.BizReportLogMapper; +import org.dromara.biz.service.IBizReportLogService; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 报送操作日志Service业务层处理 + * + * @author ruansee + * @date 2025-12-30 + */ +@RequiredArgsConstructor +@Service +public class BizReportLogServiceImpl implements IBizReportLogService { + + private final BizReportLogMapper baseMapper; + + /** + * 查询报送操作日志 + * + * @param id 主键 + * @return 报送操作日志 + */ + @Override + public BizReportLogVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询报送操作日志列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 报送操作日志分页列表 + */ + @Override + public TableDataInfo queryPageList(BizReportLogBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的报送操作日志列表 + * + * @param bo 查询条件 + * @return 报送操作日志列表 + */ + @Override + public List queryList(BizReportLogBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BizReportLogBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(BizReportLog::getId); + lqw.eq(bo.getReportId() != null, BizReportLog::getReportId, bo.getReportId()); + lqw.eq(StringUtils.isNotBlank(bo.getType()), BizReportLog::getType, bo.getType()); + lqw.eq(bo.getUserId() != null, BizReportLog::getUserId, bo.getUserId()); + lqw.like(StringUtils.isNotBlank(bo.getUserName()), BizReportLog::getUserName, bo.getUserName()); + lqw.eq(StringUtils.isNotBlank(bo.getPoliceNum()), BizReportLog::getPoliceNum, bo.getPoliceNum()); + lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), BizReportLog::getDeptId, bo.getDeptId()); + lqw.like(StringUtils.isNotBlank(bo.getDeptName()), BizReportLog::getDeptName, bo.getDeptName()); + lqw.eq(bo.getOptime() != null, BizReportLog::getOptime, bo.getOptime()); + lqw.eq(StringUtils.isNotBlank(bo.getOpip()), BizReportLog::getOpip, bo.getOpip()); + lqw.eq(StringUtils.isNotBlank(bo.getRelationId()), BizReportLog::getRelationId, bo.getRelationId()); + return lqw; + } + + /** + * 新增报送操作日志 + * + * @param bo 报送操作日志 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(BizReportLogBo bo) { + BizReportLog add = MapstructUtils.convert(bo, BizReportLog.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + + /** + * 保存操作日志 + * @param reportId 报送信息ID + * @param type 操作类型 + * @param relationId 关联ID + * @param remark 备注 + * @return 返回是否成功 + */ + @Override + public Boolean saveLog(Long reportId, String type, String relationId, String remark) { + LoginUser user = LoginHelper.getLoginUser(); + + BizReportLog log = new BizReportLog(); + log.setReportId(reportId); + log.setDeptId(user.getDeptId()); + log.setDeptName(user.getDeptName()); +// log.setOpip(Helper.getIP(request)); + log.setOptime(new Date()); + log.setRemark(remark); + log.setRelationId(relationId); + log.setType(type); + log.setPoliceNum(user.getUsername()); + log.setUserName(user.getNickname()); + log.setUserId(user.getUserId()); + + boolean flag = baseMapper.insert(log) > 0; + if (flag) { + + } + return flag; + } + + /** + * 修改报送操作日志 + * + * @param bo 报送操作日志 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(BizReportLogBo bo) { + BizReportLog update = MapstructUtils.convert(bo, BizReportLog.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(BizReportLog entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除报送操作日志信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportPersonServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportPersonServiceImpl.java index 84db954..f3718fc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportPersonServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportPersonServiceImpl.java @@ -1,5 +1,8 @@ package org.dromara.biz.service.impl; +import org.dromara.biz.service.IBizReportLogService; +import org.dromara.common.core.domain.model.LoginUser; +import org.dromara.common.core.enums.ReportLogTypeEnum; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -8,6 +11,7 @@ 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.dromara.common.satoken.utils.LoginHelper; import org.springframework.stereotype.Service; import org.dromara.biz.domain.bo.BizReportPersonBo; import org.dromara.biz.domain.vo.BizReportPersonVo; @@ -15,6 +19,7 @@ import org.dromara.biz.domain.BizReportPerson; import org.dromara.biz.mapper.BizReportPersonMapper; import org.dromara.biz.service.IBizReportPersonService; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.Collection; @@ -30,6 +35,7 @@ import java.util.Collection; public class BizReportPersonServiceImpl implements IBizReportPersonService { private final BizReportPersonMapper baseMapper; + private final IBizReportLogService logService; /** * 查询报送关联人员 @@ -71,7 +77,7 @@ public class BizReportPersonServiceImpl implements IBizReportPersonService { private LambdaQueryWrapper buildQueryWrapper(BizReportPersonBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.orderByAsc(BizReportPerson::getId); + lqw.orderByDesc(BizReportPerson::getGxsj); lqw.eq(bo.getReportId() != null, BizReportPerson::getReportId, bo.getReportId()); lqw.eq(StringUtils.isNotBlank(bo.getXm()), BizReportPerson::getXm, bo.getXm()); lqw.eq(StringUtils.isNotBlank(bo.getZjlx()), BizReportPerson::getZjlx, bo.getZjlx()); @@ -146,6 +152,7 @@ public class BizReportPersonServiceImpl implements IBizReportPersonService { lqw.eq(StringUtils.isNotBlank(bo.getFxpg()), BizReportPerson::getFxpg, bo.getFxpg()); lqw.eq(StringUtils.isNotBlank(bo.getFjxs()), BizReportPerson::getFjxs, bo.getFjxs()); lqw.eq(StringUtils.isNotBlank(bo.getSfgp()), BizReportPerson::getSfgp, bo.getSfgp()); + lqw.eq(bo.getSfhc()!=null && !bo.getSfhc().toString().equals(""), BizReportPerson::getSfhc, bo.getSfhc()); return lqw; } @@ -157,7 +164,22 @@ public class BizReportPersonServiceImpl implements IBizReportPersonService { */ @Override public Boolean insertByBo(BizReportPersonBo bo) { + LoginUser user = LoginHelper.getLoginUser(); + BizReportPerson add = MapstructUtils.convert(bo, BizReportPerson.class); + add.setCjsj(new Date()); + add.setCjrid(user.getUserId()); + add.setCjrjh(user.getUsername()); + add.setCjrxm(user.getNickname()); + add.setCjrjgdwdm(user.getDeptId()); + add.setCjrjgdw(user.getDeptName()); + add.setGxsj(new Date()); + add.setGxrid(user.getUserId()); + add.setGxrjh(user.getUsername()); + add.setGxrxm(user.getNickname()); + add.setGxrjgdwdm(user.getDeptId()); + add.setGxrjgdw(user.getDeptName()); + validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { @@ -174,9 +196,23 @@ public class BizReportPersonServiceImpl implements IBizReportPersonService { */ @Override public Boolean updateByBo(BizReportPersonBo bo) { + LoginUser user = LoginHelper.getLoginUser(); BizReportPerson update = MapstructUtils.convert(bo, BizReportPerson.class); + update.setSfhc(1); + update.setGxsj(new Date()); + update.setGxrid(user.getUserId()); + update.setGxrjh(user.getUsername()); + update.setGxrxm(user.getNickname()); + update.setGxrjgdwdm(user.getDeptId()); + update.setGxrjgdw(user.getDeptName()); validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0; + boolean flag = baseMapper.updateById(update) > 0; + if (flag){ + + // 添加日志 + logService.saveLog(bo.getReportId(), ReportLogTypeEnum.EXAMINE_PERSON.getStatus(), bo.getId().toString(), "核查线索人员"); + } + return flag; } /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReceiverServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReceiverServiceImpl.java index bd9aa11..efa8533 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReceiverServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReceiverServiceImpl.java @@ -3,8 +3,10 @@ package org.dromara.biz.service.impl; import org.dromara.biz.domain.BizReportInfo; import org.dromara.biz.domain.BizReportReply; import org.dromara.biz.mapper.BizReportInfoMapper; +import org.dromara.biz.service.IBizReportLogService; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.enums.ReportInfoStatusEnum; +import org.dromara.common.core.enums.ReportLogTypeEnum; import org.dromara.common.core.utils.Helper; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -40,6 +42,8 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService { private final BizReportReceiverMapper baseMapper; private final BizReportInfoMapper reportInfoMapper; + private final IBizReportLogService logService; + /** * 查询报送记录接收单位 * @@ -93,6 +97,11 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService { lqw.eq(StringUtils.isNotBlank(bo.getOldUserId()), BizReportReceiver::getOldUserId, bo.getOldUserId()); lqw.eq(bo.getOldReportId() != null, BizReportReceiver::getOldReportId, bo.getOldReportId()); lqw.eq(bo.getIsFeedback() != null, BizReportReceiver::getIsFeedback, bo.getIsFeedback()); + lqw.eq(bo.getIsResend() != null, BizReportReceiver::getIsResend, bo.getIsResend()); + lqw.eq(bo.getResendTime() != null, BizReportReceiver::getResendTime, bo.getResendTime()); + lqw.eq(StringUtils.isNotBlank(bo.getResendContent()), BizReportReceiver::getResendContent, bo.getResendContent()); + lqw.eq(bo.getResendUserId() != null, BizReportReceiver::getResendUserId, bo.getResendUserId()); + lqw.like(StringUtils.isNotBlank(bo.getResendUserName()), BizReportReceiver::getResendUserName, bo.getResendUserName()); return lqw; } @@ -177,6 +186,9 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService { int flag = baseMapper.updateById(update); if (flag > 0){ + // 添加日志 + logService.saveLog(bo.getReportId(), ReportLogTypeEnum.SIGN.getStatus(), bo.getId().toString(), "签收"); + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); lqw.eq(BizReportReceiver::getReportId, bo.getReportId()); lqw.eq(BizReportReceiver::getIsSign, 0); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReplyServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReplyServiceImpl.java index bde0f5d..95aec1a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReplyServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportReplyServiceImpl.java @@ -6,8 +6,10 @@ import org.dromara.biz.domain.bo.BizReportReceiverBo; import org.dromara.biz.domain.vo.BizReportReceiverVo; import org.dromara.biz.mapper.BizReportInfoMapper; import org.dromara.biz.mapper.BizReportReceiverMapper; +import org.dromara.biz.service.IBizReportLogService; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.enums.ReportInfoStatusEnum; +import org.dromara.common.core.enums.ReportLogTypeEnum; import org.dromara.common.core.utils.Helper; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -42,6 +44,7 @@ public class BizReportReplyServiceImpl implements IBizReportReplyService { private final BizReportReplyMapper baseMapper; private final BizReportReceiverMapper receiverMapper; private final BizReportInfoMapper reportInfoMapper; + private final IBizReportLogService logService; /** * 查询报送记录反馈 @@ -109,6 +112,9 @@ public class BizReportReplyServiceImpl implements IBizReportReplyService { if (flag) { bo.setId(add.getId()); + // 添加日志 + logService.saveLog(bo.getReportId(), ReportLogTypeEnum.REPLY.getStatus(), bo.getId().toString(), "反馈"); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByAsc(BizReportReceiver::getId); lqw.eq(bo.getReportId() != null, BizReportReceiver::getReportId, bo.getReportId()); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysAreaController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysAreaController.java new file mode 100644 index 0000000..e2a398d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysAreaController.java @@ -0,0 +1,113 @@ +package org.dromara.system.controller.system; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.system.domain.vo.SysAreaVo; +import org.dromara.system.domain.bo.SysAreaBo; +import org.dromara.system.service.ISysAreaService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 行政区划 + * + * @author ruansee + * @date 2025-12-30 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/area") +public class SysAreaController extends BaseController { + + private final ISysAreaService sysAreaService; + + /** + * 查询行政区划列表 + */ + @GetMapping("/alllist") + public R> alllist(SysAreaBo bo) { + return R.ok(sysAreaService.queryList(bo)); + } + + /** + * 查询行政区划列表 + */ + @SaCheckPermission("system:area:list") + @GetMapping("/list") + public TableDataInfo list(SysAreaBo bo, PageQuery pageQuery) { + return sysAreaService.queryPageList(bo, pageQuery); + } + + /** + * 导出行政区划列表 + */ + @SaCheckPermission("system:area:export") + @Log(title = "行政区划", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysAreaBo bo, HttpServletResponse response) { + List list = sysAreaService.queryList(bo); + ExcelUtil.exportExcel(list, "行政区划", SysAreaVo.class, response); + } + + /** + * 获取行政区划详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:area:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable String id) { + return R.ok(sysAreaService.queryById(id)); + } + + /** + * 新增行政区划 + */ + @SaCheckPermission("system:area:add") + @Log(title = "行政区划", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysAreaBo bo) { + return toAjax(sysAreaService.insertByBo(bo)); + } + + /** + * 修改行政区划 + */ + @SaCheckPermission("system:area:edit") + @Log(title = "行政区划", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysAreaBo bo) { + return toAjax(sysAreaService.updateByBo(bo)); + } + + /** + * 删除行政区划 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:area:remove") + @Log(title = "行政区划", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable String[] ids) { + return toAjax(sysAreaService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java index cc06be0..21cdccc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDeptController.java @@ -32,6 +32,13 @@ public class SysDeptController extends BaseController { private final ISysDeptService deptService; private final ISysPostService postService; + + @GetMapping("/group/alllist") + public R> alllist(SysDeptBo dept) { + List depts = deptService.selectDeptList(dept); + return R.ok(depts); + } + /** * 获取部门列表 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictDataController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictDataController.java index f9389d6..88c351b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictDataController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictDataController.java @@ -64,7 +64,6 @@ public class SysDictDataController extends BaseController { return R.ok(result); } - /** * 查询字典数据列表 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictTreeController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictTreeController.java new file mode 100644 index 0000000..7e22405 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysDictTreeController.java @@ -0,0 +1,112 @@ +package org.dromara.system.controller.system; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.system.domain.vo.SysDictTreeVo; +import org.dromara.system.domain.bo.SysDictTreeBo; +import org.dromara.system.service.ISysDictTreeService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 字典 + * + * @author ruansee + * @date 2025-12-29 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/dictTree") +public class SysDictTreeController extends BaseController { + + private final ISysDictTreeService sysDictTreeService; + + /** + * 查询字典列表 + */ + @GetMapping("/alllist") + public R> list(SysDictTreeBo bo) { + return R.ok( sysDictTreeService.queryList(bo)); + } + + /** + * 查询字典列表 + */ + @GetMapping("/list") + public TableDataInfo list(SysDictTreeBo bo, PageQuery pageQuery) { + return sysDictTreeService.queryPageList(bo, pageQuery); + } + + /** + * 导出字典列表 + */ + @SaCheckPermission("system:dictTree:export") + @Log(title = "字典", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysDictTreeBo bo, HttpServletResponse response) { + List list = sysDictTreeService.queryList(bo); + ExcelUtil.exportExcel(list, "字典", SysDictTreeVo.class, response); + } + + /** + * 获取字典详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:dictTree:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(sysDictTreeService.queryById(id)); + } + + /** + * 新增字典 + */ + @SaCheckPermission("system:dictTree:add") + @Log(title = "字典", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysDictTreeBo bo) { + return toAjax(sysDictTreeService.insertByBo(bo)); + } + + /** + * 修改字典 + */ + @SaCheckPermission("system:dictTree:edit") + @Log(title = "字典", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysDictTreeBo bo) { + return toAjax(sysDictTreeService.updateByBo(bo)); + } + + /** + * 删除字典 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:dictTree:remove") + @Log(title = "字典", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(sysDictTreeService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysArea.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysArea.java new file mode 100644 index 0000000..d72cffe --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysArea.java @@ -0,0 +1,121 @@ +package org.dromara.system.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 行政区划对象 sys_area + * + * @author ruansee + * @date 2025-12-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_area") +public class SysArea extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 地址编码 + */ + @TableId(value = "id") + private String id; + + /** + * 地区名称 + */ + private String name; + + /** + * 地区全称 + */ + private String fullName; + + /** + * 父级ID + */ + private String parentId; + + /** + * 首字母 + */ + private String spell; + + /** + * 类型:1是省会,2直辖市,3港澳台,4其它 + */ + private Long areaType; + + /** + * 同级下排序 + */ + private Long orderNo; + + /** + * 0全国、1省、2市区、3郊县、4街道、5居委会 + */ + private Long areaLevel; + + /** + * 备注 + */ + private String remark; + + /** + * 城乡分类代码 + */ + private String villageType; + + /** + * 所属国家名 + */ + private String nation; + + /** + * 所属省名称 + */ + private String province; + + /** + * 所属市名称 + */ + private String city; + + /** + * 所属区县名称 + */ + private String county; + + /** + * 所属街道名称 + */ + private String town; + + /** + * 经度 + */ + private String lng; + + /** + * 纬度 + */ + private String lat; + + /** + * 来源地图,百度1,高德2 + */ + private Long mapType; + + /** + * 是否有下级(1 是 0 否) + */ + private String isHaveChild; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictTree.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictTree.java new file mode 100644 index 0000000..5ab87a4 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysDictTree.java @@ -0,0 +1,71 @@ +package org.dromara.system.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 字典对象 sys_dict_tree + * + * @author ruansee + * @date 2025-12-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_dict_tree") +public class SysDictTree extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId(value = "id") + private Long id; + + /** + * 类型 + */ + private String type; + + /** + * 父ID + */ + private Long parentId; + + /** + * 名称 + */ + private String name; + + /** + * 父级名称 + */ + private String parentName; + + /** + * 值 + */ + private String value; + + /** + * 排序 + */ + private Long sort; + + /** + * 状态 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysAreaBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysAreaBo.java new file mode 100644 index 0000000..02feaf8 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysAreaBo.java @@ -0,0 +1,126 @@ +package org.dromara.system.domain.bo; + +import org.dromara.system.domain.SysArea; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 行政区划业务对象 sys_area + * + * @author ruansee + * @date 2025-12-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysArea.class, reverseConvertGenerate = false) +public class SysAreaBo extends BaseEntity { + + /** + * 地址编码 + */ + @NotBlank(message = "地址编码不能为空", groups = { EditGroup.class }) + private String id; + + /** + * 地区名称 + */ + @NotBlank(message = "地区名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String name; + + /** + * 地区全称 + */ + private String fullName; + + /** + * 父级ID + */ + @NotBlank(message = "父级ID不能为空", groups = { AddGroup.class, EditGroup.class }) + private String parentId; + + /** + * 首字母 + */ + @NotBlank(message = "首字母不能为空", groups = { AddGroup.class, EditGroup.class }) + private String spell; + + /** + * 类型:1是省会,2直辖市,3港澳台,4其它 + */ + @NotNull(message = "类型:1是省会,2直辖市,3港澳台,4其它不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long areaType; + + /** + * 同级下排序 + */ + @NotNull(message = "同级下排序不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long orderNo; + + /** + * 0全国、1省、2市区、3郊县、4街道、5居委会 + */ + @NotNull(message = "0全国、1省、2市区、3郊县、4街道、5居委会不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long areaLevel; + + /** + * 备注 + */ + private String remark; + + /** + * 城乡分类代码 + */ + private String villageType; + + /** + * 所属国家名 + */ + private String nation; + + /** + * 所属省名称 + */ + private String province; + + /** + * 所属市名称 + */ + private String city; + + /** + * 所属区县名称 + */ + private String county; + + /** + * 所属街道名称 + */ + private String town; + + /** + * 经度 + */ + private String lng; + + /** + * 纬度 + */ + private String lat; + + /** + * 来源地图,百度1,高德2 + */ + private Long mapType; + + /** + * 是否有下级(1 是 0 否) + */ + private String isHaveChild; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTreeBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTreeBo.java new file mode 100644 index 0000000..005797c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysDictTreeBo.java @@ -0,0 +1,70 @@ +package org.dromara.system.domain.bo; + +import org.dromara.system.domain.SysDictTree; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 字典业务对象 sys_dict_tree + * + * @author ruansee + * @date 2025-12-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysDictTree.class, reverseConvertGenerate = false) +public class SysDictTreeBo extends BaseEntity { + + /** + * ID + */ + @NotNull(message = "ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 类型 + */ + private String type; + + /** + * 父ID + */ + private Long parentId; + + /** + * 名称 + */ + private String name; + + /** + * 父级名称 + */ + private String parentName; + + /** + * 值 + */ + private String value; + + /** + * 排序 + */ + private Long sort; + + /** + * 状态 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysUserBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysUserBo.java index 48b73b9..7afadc9 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysUserBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysUserBo.java @@ -66,6 +66,10 @@ public class SysUserBo extends BaseEntity { @Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") private String email; + /** + * 固定电话 + */ + private String telephone; /** * 手机号码 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysAreaVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysAreaVo.java new file mode 100644 index 0000000..8593d8d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysAreaVo.java @@ -0,0 +1,147 @@ +package org.dromara.system.domain.vo; + +import org.dromara.system.domain.SysArea; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 行政区划视图对象 sys_area + * + * @author ruansee + * @date 2025-12-30 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysArea.class) +public class SysAreaVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 地址编码 + */ + @ExcelProperty(value = "地址编码") + private String id; + + /** + * 地区名称 + */ + @ExcelProperty(value = "地区名称") + private String name; + + /** + * 地区全称 + */ + @ExcelProperty(value = "地区全称") + private String fullName; + + /** + * 父级ID + */ + @ExcelProperty(value = "父级ID") + private String parentId; + + /** + * 首字母 + */ + @ExcelProperty(value = "首字母") + private String spell; + + /** + * 类型:1是省会,2直辖市,3港澳台,4其它 + */ + @ExcelProperty(value = "类型:1是省会,2直辖市,3港澳台,4其它") + private Long areaType; + + /** + * 同级下排序 + */ + @ExcelProperty(value = "同级下排序") + private Long orderNo; + + /** + * 0全国、1省、2市区、3郊县、4街道、5居委会 + */ + @ExcelProperty(value = "0全国、1省、2市区、3郊县、4街道、5居委会") + private Long areaLevel; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 城乡分类代码 + */ + @ExcelProperty(value = "城乡分类代码") + private String villageType; + + /** + * 所属国家名 + */ + @ExcelProperty(value = "所属国家名") + private String nation; + + /** + * 所属省名称 + */ + @ExcelProperty(value = "所属省名称") + private String province; + + /** + * 所属市名称 + */ + @ExcelProperty(value = "所属市名称") + private String city; + + /** + * 所属区县名称 + */ + @ExcelProperty(value = "所属区县名称") + private String county; + + /** + * 所属街道名称 + */ + @ExcelProperty(value = "所属街道名称") + private String town; + + /** + * 经度 + */ + @ExcelProperty(value = "经度") + private String lng; + + /** + * 纬度 + */ + @ExcelProperty(value = "纬度") + private String lat; + + /** + * 来源地图,百度1,高德2 + */ + @ExcelProperty(value = "来源地图,百度1,高德2") + private Long mapType; + + /** + * 是否有下级(1 是 0 否) + */ + @ExcelProperty(value = "是否有下级", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=,是=,0=,否=") + private String isHaveChild; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTreeVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTreeVo.java new file mode 100644 index 0000000..3979e5f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTreeVo.java @@ -0,0 +1,86 @@ +package org.dromara.system.domain.vo; + +import org.dromara.system.domain.SysDictTree; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 字典视图对象 sys_dict_tree + * + * @author ruansee + * @date 2025-12-29 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysDictTree.class) +public class SysDictTreeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ExcelProperty(value = "ID") + private Long id; + + /** + * 类型 + */ + @ExcelProperty(value = "类型") + private String type; + + /** + * 父ID + */ + @ExcelProperty(value = "父ID") + private Long parentId; + + /** + * 名称 + */ + @ExcelProperty(value = "名称") + private String name; + + /** + * 父级名称 + */ + @ExcelProperty(value = "父级名称") + private String parentName; + + /** + * 值 + */ + @ExcelProperty(value = "值") + private String value; + + /** + * 排序 + */ + @ExcelProperty(value = "排序") + private Long sort; + + /** + * 状态 + */ + @ExcelProperty(value = "状态") + private String status; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java index 2c7888b..47700cc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserVo.java @@ -68,6 +68,10 @@ public class SysUserVo implements Serializable { @Sensitive(strategy = SensitiveStrategy.EMAIL, perms = "system:user:edit") private String email; + /** + * 固定电话 + */ + private String telephone; /** * 手机号码 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysAreaMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysAreaMapper.java new file mode 100644 index 0000000..9d2dba1 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysAreaMapper.java @@ -0,0 +1,15 @@ +package org.dromara.system.mapper; + +import org.dromara.system.domain.SysArea; +import org.dromara.system.domain.vo.SysAreaVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 行政区划Mapper接口 + * + * @author ruansee + * @date 2025-12-30 + */ +public interface SysAreaMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictTreeMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictTreeMapper.java new file mode 100644 index 0000000..790238f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysDictTreeMapper.java @@ -0,0 +1,15 @@ +package org.dromara.system.mapper; + +import org.dromara.system.domain.SysDictTree; +import org.dromara.system.domain.vo.SysDictTreeVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 字典Mapper接口 + * + * @author ruansee + * @date 2025-12-29 + */ +public interface SysDictTreeMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysAreaService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysAreaService.java new file mode 100644 index 0000000..ef7687e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysAreaService.java @@ -0,0 +1,68 @@ +package org.dromara.system.service; + +import org.dromara.system.domain.vo.SysAreaVo; +import org.dromara.system.domain.bo.SysAreaBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 行政区划Service接口 + * + * @author ruansee + * @date 2025-12-30 + */ +public interface ISysAreaService { + + /** + * 查询行政区划 + * + * @param id 主键 + * @return 行政区划 + */ + SysAreaVo queryById(String id); + + /** + * 分页查询行政区划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 行政区划分页列表 + */ + TableDataInfo queryPageList(SysAreaBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的行政区划列表 + * + * @param bo 查询条件 + * @return 行政区划列表 + */ + List queryList(SysAreaBo bo); + + /** + * 新增行政区划 + * + * @param bo 行政区划 + * @return 是否新增成功 + */ + Boolean insertByBo(SysAreaBo bo); + + /** + * 修改行政区划 + * + * @param bo 行政区划 + * @return 是否修改成功 + */ + Boolean updateByBo(SysAreaBo bo); + + /** + * 校验并批量删除行政区划信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysDictTreeService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysDictTreeService.java new file mode 100644 index 0000000..f5aaf35 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysDictTreeService.java @@ -0,0 +1,68 @@ +package org.dromara.system.service; + +import org.dromara.system.domain.vo.SysDictTreeVo; +import org.dromara.system.domain.bo.SysDictTreeBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 字典Service接口 + * + * @author ruansee + * @date 2025-12-29 + */ +public interface ISysDictTreeService { + + /** + * 查询字典 + * + * @param id 主键 + * @return 字典 + */ + SysDictTreeVo queryById(Long id); + + /** + * 分页查询字典列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 字典分页列表 + */ + TableDataInfo queryPageList(SysDictTreeBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的字典列表 + * + * @param bo 查询条件 + * @return 字典列表 + */ + List queryList(SysDictTreeBo bo); + + /** + * 新增字典 + * + * @param bo 字典 + * @return 是否新增成功 + */ + Boolean insertByBo(SysDictTreeBo bo); + + /** + * 修改字典 + * + * @param bo 字典 + * @return 是否修改成功 + */ + Boolean updateByBo(SysDictTreeBo bo); + + /** + * 校验并批量删除字典信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java index 8a9c50c..04e3a66 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java @@ -26,7 +26,7 @@ public interface ISysUserService { */ List selectUserExportList(SysUserBo user); - List selectUserIdList(SysUserBo user); + List selectUserIdList(SysUserBo user); /** * 根据条件分页查询已分配用户角色列表 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysAreaServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysAreaServiceImpl.java new file mode 100644 index 0000000..57dcfba --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysAreaServiceImpl.java @@ -0,0 +1,146 @@ +package org.dromara.system.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.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 org.dromara.system.domain.bo.SysAreaBo; +import org.dromara.system.domain.vo.SysAreaVo; +import org.dromara.system.domain.SysArea; +import org.dromara.system.mapper.SysAreaMapper; +import org.dromara.system.service.ISysAreaService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 行政区划Service业务层处理 + * + * @author ruansee + * @date 2025-12-30 + */ +@RequiredArgsConstructor +@Service +public class SysAreaServiceImpl implements ISysAreaService { + + private final SysAreaMapper baseMapper; + + /** + * 查询行政区划 + * + * @param id 主键 + * @return 行政区划 + */ + @Override + public SysAreaVo queryById(String id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询行政区划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 行政区划分页列表 + */ + @Override + public TableDataInfo queryPageList(SysAreaBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的行政区划列表 + * + * @param bo 查询条件 + * @return 行政区划列表 + */ + @Override + public List queryList(SysAreaBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysAreaBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(SysArea::getId); + lqw.like(StringUtils.isNotBlank(bo.getName()), SysArea::getName, bo.getName()); + lqw.like(StringUtils.isNotBlank(bo.getFullName()), SysArea::getFullName, bo.getFullName()); + lqw.eq(StringUtils.isNotBlank(bo.getParentId()), SysArea::getParentId, bo.getParentId()); + lqw.eq(StringUtils.isNotBlank(bo.getSpell()), SysArea::getSpell, bo.getSpell()); + lqw.eq(bo.getAreaType() != null, SysArea::getAreaType, bo.getAreaType()); + lqw.eq(bo.getOrderNo() != null, SysArea::getOrderNo, bo.getOrderNo()); + lqw.eq(bo.getAreaLevel() != null, SysArea::getAreaLevel, bo.getAreaLevel()); + lqw.eq(StringUtils.isNotBlank(bo.getVillageType()), SysArea::getVillageType, bo.getVillageType()); + lqw.eq(StringUtils.isNotBlank(bo.getNation()), SysArea::getNation, bo.getNation()); + lqw.eq(StringUtils.isNotBlank(bo.getProvince()), SysArea::getProvince, bo.getProvince()); + lqw.eq(StringUtils.isNotBlank(bo.getCity()), SysArea::getCity, bo.getCity()); + lqw.eq(StringUtils.isNotBlank(bo.getCounty()), SysArea::getCounty, bo.getCounty()); + lqw.eq(StringUtils.isNotBlank(bo.getTown()), SysArea::getTown, bo.getTown()); + lqw.eq(StringUtils.isNotBlank(bo.getLng()), SysArea::getLng, bo.getLng()); + lqw.eq(StringUtils.isNotBlank(bo.getLat()), SysArea::getLat, bo.getLat()); + lqw.eq(bo.getMapType() != null, SysArea::getMapType, bo.getMapType()); + lqw.eq(StringUtils.isNotBlank(bo.getIsHaveChild()), SysArea::getIsHaveChild, bo.getIsHaveChild()); + return lqw; + } + + /** + * 新增行政区划 + * + * @param bo 行政区划 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(SysAreaBo bo) { + SysArea add = MapstructUtils.convert(bo, SysArea.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改行政区划 + * + * @param bo 行政区划 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(SysAreaBo bo) { + SysArea update = MapstructUtils.convert(bo, SysArea.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysArea entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除行政区划信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTreeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTreeServiceImpl.java new file mode 100644 index 0000000..dfb0c48 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDictTreeServiceImpl.java @@ -0,0 +1,136 @@ +package org.dromara.system.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.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 org.dromara.system.domain.bo.SysDictTreeBo; +import org.dromara.system.domain.vo.SysDictTreeVo; +import org.dromara.system.domain.SysDictTree; +import org.dromara.system.mapper.SysDictTreeMapper; +import org.dromara.system.service.ISysDictTreeService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 字典Service业务层处理 + * + * @author ruansee + * @date 2025-12-29 + */ +@RequiredArgsConstructor +@Service +public class SysDictTreeServiceImpl implements ISysDictTreeService { + + private final SysDictTreeMapper baseMapper; + + /** + * 查询字典 + * + * @param id 主键 + * @return 字典 + */ + @Override + public SysDictTreeVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询字典列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 字典分页列表 + */ + @Override + public TableDataInfo queryPageList(SysDictTreeBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的字典列表 + * + * @param bo 查询条件 + * @return 字典列表 + */ + @Override + public List queryList(SysDictTreeBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysDictTreeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(SysDictTree::getId); + lqw.eq(StringUtils.isNotBlank(bo.getType()), SysDictTree::getType, bo.getType()); + lqw.eq(bo.getParentId() != null, SysDictTree::getParentId, bo.getParentId()); + lqw.like(StringUtils.isNotBlank(bo.getName()), SysDictTree::getName, bo.getName()); + lqw.like(StringUtils.isNotBlank(bo.getParentName()), SysDictTree::getParentName, bo.getParentName()); + lqw.eq(StringUtils.isNotBlank(bo.getValue()), SysDictTree::getValue, bo.getValue()); + lqw.eq(bo.getSort() != null, SysDictTree::getSort, bo.getSort()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictTree::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增字典 + * + * @param bo 字典 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(SysDictTreeBo bo) { + SysDictTree add = MapstructUtils.convert(bo, SysDictTree.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改字典 + * + * @param bo 字典 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(SysDictTreeBo bo) { + SysDictTree update = MapstructUtils.convert(bo, SysDictTree.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysDictTree entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除字典信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java index c713e41..9cde6cd 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java @@ -81,7 +81,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService { * @return 用户信息集合信息 */ @Override - public List selectUserIdList(SysUserBo user) { + public List selectUserIdList(SysUserBo user) { QueryWrapper wrapper = Wrappers.query(); wrapper.eq("u.del_flag", SystemConstants.NORMAL) .and(ObjectUtil.isNotNull(user.getDeptIds()) && user.getDeptIds().length>0 , w -> { @@ -93,7 +93,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService { }) .orderByAsc("u.user_id"); List list = baseMapper.selectUserList(wrapper); - return StreamUtils.toList(list, SysUserVo::getUserId); + return list; } private Wrapper buildQueryWrapper(SysUserBo user) { diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/biz/BizReportLogMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/biz/BizReportLogMapper.xml new file mode 100644 index 0000000..8d387b8 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/biz/BizReportLogMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysAreaMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysAreaMapper.xml new file mode 100644 index 0000000..a7e7f0c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysAreaMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTreeMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTreeMapper.xml new file mode 100644 index 0000000..e7e4fb2 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTreeMapper.xml @@ -0,0 +1,7 @@ + + + + +