diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java index 0c11a8c..132682f 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginUser.java @@ -32,8 +32,13 @@ public class LoginUser implements Serializable { */ private Long userId; + /** - * 部门ID + * 所属部门ID + */ + private String workDeptId; + /** + * 管理部门ID */ private String deptId; @@ -43,7 +48,11 @@ public class LoginUser implements Serializable { private String deptCategory; /** - * 部门名 + * 所属部门名 + */ + private String workDeptName; + /** + * 管理部门名 */ private String deptName; diff --git a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java index 652da20..be87317 100644 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java +++ b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java @@ -35,6 +35,8 @@ public class LoginHelper { public static final String TENANT_KEY = "tenantId"; public static final String USER_KEY = "userId"; public static final String USER_NAME_KEY = "userName"; + public static final String WORK_DEPT_KEY = "workDeptId"; + public static final String WORK_DEPT_NAME_KEY = "workDeptName"; public static final String DEPT_KEY = "deptId"; public static final String DEPT_NAME_KEY = "deptName"; public static final String DEPT_CATEGORY_KEY = "deptCategory"; @@ -53,6 +55,8 @@ public class LoginHelper { model.setExtra(TENANT_KEY, loginUser.getTenantId()) .setExtra(USER_KEY, loginUser.getUserId()) .setExtra(USER_NAME_KEY, loginUser.getUsername()) + .setExtra(WORK_DEPT_KEY, loginUser.getWorkDeptId()) + .setExtra(WORK_DEPT_NAME_KEY, loginUser.getWorkDeptName()) .setExtra(DEPT_KEY, loginUser.getDeptId()) .setExtra(DEPT_NAME_KEY, loginUser.getDeptName()) .setExtra(DEPT_CATEGORY_KEY, loginUser.getDeptCategory()) @@ -110,6 +114,19 @@ public class LoginHelper { return Convert.toStr(getExtra(TENANT_KEY)); } + /** + * 获取部门ID + */ + public static String getWorkDeptId() { + return getExtra(WORK_DEPT_KEY).toString(); + } + + /** + * 获取部门名 + */ + public static String getWorkDeptName() { + return Convert.toStr(getExtra(WORK_DEPT_NAME_KEY)); + } /** * 获取部门ID */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizDutyController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizDutyController.java new file mode 100644 index 0000000..d497ef9 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizDutyController.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.BizDutyVo; +import org.dromara.biz.domain.bo.BizDutyBo; +import org.dromara.biz.service.IBizDutyService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 值班信息 + * + * @author ruansee + * @date 2025-11-27 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/biz/duty") +public class BizDutyController extends BaseController { + + private final IBizDutyService bizDutyService; + + /** + * 查询值班信息列表 + */ + @SaCheckPermission("biz:duty:list") + @GetMapping("/list") + public TableDataInfo list(BizDutyBo bo, PageQuery pageQuery) { + return bizDutyService.queryPageList(bo, pageQuery); + } + + /** + * 导出值班信息列表 + */ + @SaCheckPermission("biz:duty:export") + @Log(title = "值班信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(BizDutyBo bo, HttpServletResponse response) { + List list = bizDutyService.queryList(bo); + ExcelUtil.exportExcel(list, "值班信息", BizDutyVo.class, response); + } + + /** + * 获取值班信息详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("biz:duty:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(bizDutyService.queryById(id)); + } + + /** + * 新增值班信息 + */ + @SaCheckPermission("biz:duty:add") + @Log(title = "值班信息", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody BizDutyBo bo) { + return toAjax(bizDutyService.insertByBo(bo)); + } + + /** + * 修改值班信息 + */ + @SaCheckPermission("biz:duty:edit") + @Log(title = "值班信息", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody BizDutyBo bo) { + return toAjax(bizDutyService.updateByBo(bo)); + } + + /** + * 删除值班信息 + * + * @param ids 主键串 + */ + @SaCheckPermission("biz:duty:remove") + @Log(title = "值班信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(bizDutyService.deleteWithValidByIds(List.of(ids), true)); + } +} 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 c0edd55..514a5ed 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 @@ -2,12 +2,14 @@ package org.dromara.biz.controller; import java.util.Date; import java.util.List; +import java.util.Map; import lombok.RequiredArgsConstructor; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.*; import cn.dev33.satoken.annotation.SaCheckPermission; import org.dromara.common.core.domain.model.LoginUser; +import org.dromara.common.core.utils.Helper; import org.dromara.common.satoken.utils.LoginHelper; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; @@ -48,6 +50,26 @@ public class BizReportInfoController extends BaseController { return bizReportInfoService.queryPageList(bo, pageQuery); } + /** + * 查询报送信息列表 + */ + @SaCheckPermission("biz:reportInfo:list") + @GetMapping("/xxcl/list") + public TableDataInfo xxcllist(BizReportInfoBo bo, PageQuery pageQuery) { + bo.setOldTable("xxcl"); + return bizReportInfoService.queryPageList(bo, pageQuery); + } + + /** + * 查询报送信息列表 + */ + @SaCheckPermission("biz:reportInfo:list") + @GetMapping("/xxbs/list") + public TableDataInfo xxbslist(BizReportInfoBo bo, PageQuery pageQuery) { + bo.setOldTable("xxbs"); + return bizReportInfoService.queryPageList(bo, pageQuery); + } + /** * 导出报送信息列表 */ @@ -68,7 +90,12 @@ public class BizReportInfoController extends BaseController { @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { - return R.ok(bizReportInfoService.queryById(id)); + BizReportInfoVo info = bizReportInfoService.queryById(id); + + if (Helper.FInt(info.getOldId())>0 && !Helper.NStr(info.getUrl()).equals("")){ + info.setPdfUrl("/showFile?filePath="+Helper.NStr(info.getUrl())); + } + return R.ok(info); } /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportReceiverController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportReceiverController.java index 4537c36..751195f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportReceiverController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/controller/BizReportReceiverController.java @@ -98,11 +98,8 @@ public class BizReportReceiverController extends BaseController { @Log(title = "报送记录签收", businessType = BusinessType.UPDATE) @PostMapping("/sign") public R sign(@Validated(EditGroup.class) @RequestBody BizReportReceiverBo bo) { - bo.setIsSign(1L); - bo.setSignUserId(LoginHelper.getUserId()); - bo.setSignUserName(LoginHelper.getLoginUser().getNickname()); - bo.setSignTime(new Date()); - return toAjax(bizReportReceiverService.updateByBo(bo)); + + return toAjax(bizReportReceiverService.sign(bo)); } /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizDuty.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizDuty.java new file mode 100644 index 0000000..951fd87 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizDuty.java @@ -0,0 +1,115 @@ +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_duty + * + * @author ruansee + * @date 2025-11-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("biz_duty") +public class BizDuty extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId(value = "id") + private Long id; + + /** + * 值班日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dutyDate; + + /** + * 值班单位ID + */ + private String deptId; + + /** + * 值班单位 + */ + private String deptName; + + /** + * 局领导ID + */ + private Long leaderId; + + /** + * 局领导名称 + */ + private String leaderName; + + /** + * 值班长ID + */ + private Long monitorId; + + /** + * 值班长名称 + */ + private String monitorName; + + /** + * 值班人员ID + */ + private String watchkeeperIds; + + /** + * 值班人员姓名 + */ + private String watchkeeperNames; + + /** + * 值班开始时间 + */ + private Date startTime; + + /** + * 值班结束时间 + */ + private Date endTime; + + /** + * 勤务等级 + */ + private String level; + + /** + * 值班日志 + */ + private String dutyLog; + + /** + * 值班状态 + */ + private String status; + + /** + * 创建用户ID + */ + private Long createUserId; + + /** + * 备注 + */ + private String remark; + + + private Date createTime; +} 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 fef4ea4..2b5195e 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 @@ -13,7 +13,7 @@ import java.io.Serial; * 报送记录接收单位对象 biz_report_receiver * * @author ruansee - * @date 2025-11-21 + * @date 2025-11-28 */ @Data @EqualsAndHashCode(callSuper = true) @@ -47,7 +47,7 @@ public class BizReportReceiver extends BaseEntity { /** * 是否签收 */ - private Long isSign; + private Boolean isSign; /** * 签收时间 @@ -64,5 +64,24 @@ public class BizReportReceiver extends BaseEntity { */ private String signUserName; + /** + * 旧系统ID + */ + private Long oldId; + + /** + * 旧系统用户ID + */ + private String oldUserId; + + /** + * 旧系统报送ID + */ + private Long oldReportId; + + /** + * 是否反馈 + */ + private Boolean isFeedback; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReply.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReply.java index dbcd0e3..945fa2c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReply.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/BizReportReply.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serial; +import java.util.Date; /** * 报送记录反馈对象 biz_report_reply @@ -57,5 +58,6 @@ public class BizReportReply extends BaseEntity { */ private String fileName; + private Date createTime; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizDutyBo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizDutyBo.java new file mode 100644 index 0000000..e145175 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/bo/BizDutyBo.java @@ -0,0 +1,113 @@ +package org.dromara.biz.domain.bo; + +import org.dromara.biz.domain.BizDuty; +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_duty + * + * @author ruansee + * @date 2025-11-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = BizDuty.class, reverseConvertGenerate = false) +public class BizDutyBo extends BaseEntity { + + /** + * ID + */ + @NotNull(message = "ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 值班日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dutyDate; + + /** + * 值班单位ID + */ + private String deptId; + + /** + * 值班单位 + */ + private String deptName; + + /** + * 局领导ID + */ + private Long leaderId; + + /** + * 局领导名称 + */ + private String leaderName; + + /** + * 值班长ID + */ + private Long monitorId; + + /** + * 值班长名称 + */ + private String monitorName; + + /** + * 值班人员ID + */ + private String watchkeeperIds; + + /** + * 值班人员姓名 + */ + private String watchkeeperNames; + + /** + * 值班开始时间 + */ + private Date startTime; + + /** + * 值班结束时间 + */ + private Date endTime; + + /** + * 勤务等级 + */ + private String level; + + /** + * 值班日志 + */ + private String dutyLog; + + /** + * 值班状态 + */ + private String status; + + /** + * 创建用户ID + */ + private Long createUserId; + + /** + * 备注 + */ + private String remark; + + +} 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 933617c..bbf580a 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 @@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; * 报送记录接收单位业务对象 biz_report_receiver * * @author ruansee - * @date 2025-11-21 + * @date 2025-11-28 */ @Data @EqualsAndHashCode(callSuper = true) @@ -46,7 +46,7 @@ public class BizReportReceiverBo extends BaseEntity { /** * 是否签收 */ - private Long isSign; + private Boolean isSign; /** * 签收时间 @@ -63,5 +63,25 @@ public class BizReportReceiverBo extends BaseEntity { */ private String signUserName; + /** + * 旧系统ID + */ + private Long oldId; + + /** + * 旧系统用户ID + */ + private String oldUserId; + + /** + * 旧系统报送ID + */ + private Long oldReportId; + + /** + * 是否反馈 + */ + private Boolean isFeedback; + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizDutyVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizDutyVo.java new file mode 100644 index 0000000..7c5b59c --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizDutyVo.java @@ -0,0 +1,157 @@ +package org.dromara.biz.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.biz.domain.BizDuty; +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 org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.system.domain.SysUser; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 值班信息视图对象 biz_duty + * + * @author ruansee + * @date 2025-11-27 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BizDuty.class) +public class BizDutyVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ExcelProperty(value = "ID") + private Long id; + + /** + * 值班日期 + */ + @ExcelProperty(value = "值班日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dutyDate; + + /** + * 值班单位ID + */ + @ExcelProperty(value = "值班单位ID") + private String deptId; + + /** + * 值班单位 + */ + @ExcelProperty(value = "值班单位") + private String deptName; + + /** + * 局领导ID + */ + @ExcelProperty(value = "局领导ID") + private Long leaderId; + + /** + * 局领导名称 + */ + @ExcelProperty(value = "局领导名称") + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "leaderId") + private String leaderName; + + /** + * 局领导 + */ + private SysUser leader; + + /** + * 值班长ID + */ + @ExcelProperty(value = "值班长ID") + private Long monitorId; + + /** + * 值班长名称 + */ + @ExcelProperty(value = "值班长名称") + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "monitorId") + private String monitorName; + + /** + * 值班长 + */ + private SysUser monitor; + + /** + * 值班人员ID + */ + @ExcelProperty(value = "值班人员ID") + private String watchkeeperIds; + + /** + * 值班人员姓名 + */ + @ExcelProperty(value = "值班人员姓名") + private String watchkeeperNames; + + /** + * 值班人员列表 + */ + private List watchkeeperList; + + /** + * 值班开始时间 + */ + @ExcelProperty(value = "值班开始时间") + private Date startTime; + + /** + * 值班结束时间 + */ + @ExcelProperty(value = "值班结束时间") + private Date endTime; + + /** + * 勤务等级 + */ + @ExcelProperty(value = "勤务等级") + private String level; + + /** + * 值班日志 + */ + @ExcelProperty(value = "值班日志") + private String dutyLog; + + /** + * 值班状态 + */ + @ExcelProperty(value = "值班状态") + private String status; + + /** + * 创建用户ID + */ + @ExcelProperty(value = "创建用户ID") + private Long createUserId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} 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 2ace925..78d6883 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 @@ -181,4 +181,6 @@ public class BizReportInfoVo implements Serializable { * 接收单位ID 新增修改用 */ private String[] receiverDeptIds; + + private String pdfUrl; } 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 d76dffb..a1efbfe 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 @@ -20,7 +20,7 @@ import java.util.Date; * 报送记录接收单位视图对象 biz_report_receiver * * @author ruansee - * @date 2025-11-21 + * @date 2025-11-28 */ @Data @ExcelIgnoreUnannotated @@ -58,7 +58,7 @@ public class BizReportReceiverVo implements Serializable { * 是否签收 */ @ExcelProperty(value = "是否签收") - private Long isSign; + private Boolean isSign; /** * 签收时间 @@ -78,5 +78,29 @@ public class BizReportReceiverVo implements Serializable { @ExcelProperty(value = "签收用户名称") private String signUserName; + /** + * 旧系统ID + */ + @ExcelProperty(value = "旧系统ID") + private Long oldId; + + /** + * 旧系统用户ID + */ + @ExcelProperty(value = "旧系统用户ID") + private String oldUserId; + + /** + * 旧系统报送ID + */ + @ExcelProperty(value = "旧系统报送ID") + private Long oldReportId; + + /** + * 是否反馈 + */ + @ExcelProperty(value = "是否反馈") + private Boolean isFeedback; + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReplyVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReplyVo.java index 1f6b1f1..d0861eb 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReplyVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/domain/vo/BizReportReplyVo.java @@ -7,6 +7,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; +import org.dromara.system.domain.vo.SysUserVo; import java.io.Serial; import java.io.Serializable; @@ -70,5 +71,14 @@ public class BizReportReplyVo implements Serializable { @ExcelProperty(value = "附件名称") private String fileName; - + /** + * 用户信息 + */ + private SysUserVo user; + private Date createTime; + private String userName; + private String nickName; + private String avatar; + private String deptName; + private String deptCategory; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizDutyMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizDutyMapper.java new file mode 100644 index 0000000..2f19250 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizDutyMapper.java @@ -0,0 +1,15 @@ +package org.dromara.biz.mapper; + +import org.dromara.biz.domain.BizDuty; +import org.dromara.biz.domain.vo.BizDutyVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 值班信息Mapper接口 + * + * @author ruansee + * @date 2025-11-27 + */ +public interface BizDutyMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportInfoMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportInfoMapper.java index 9a08eca..fa818cc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportInfoMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportInfoMapper.java @@ -18,12 +18,12 @@ import java.util.List; */ public interface BizReportInfoMapper extends BaseMapperPlus { - @Select("select i.*, c.title as categoryTitle from biz_report_info i left join biz_category c on i.category_id = c.id where i.id = ${id}") + @Select("select * from v_report_info v where id = ${id}") BizReportInfoVo selectBizReportInfoVoById(@Param("id") Long id); - @Select("select i.*, c.title as categoryTitle from biz_report_info i left join biz_category c on i.category_id = c.id ${ew.getCustomSqlSegment}") + @Select("select * from v_report_info v ${ew.getCustomSqlSegment}") List selectBizReportInfoVoList(@Param("ew") Wrapper queryWrapper); - @Select("select i.*, c.title as categoryTitle from biz_report_info i left join biz_category c on i.category_id = c.id ${ew.getCustomSqlSegment}") + @Select("select * from v_report_info v ${ew.getCustomSqlSegment}") Page selectBizReportInfoVoPage(@Param("page") Page page, @Param("ew") Wrapper queryWrapper); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportReplyMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportReplyMapper.java index dc9bc58..6d161be 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportReplyMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/mapper/BizReportReplyMapper.java @@ -1,6 +1,12 @@ package org.dromara.biz.mapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.dromara.biz.domain.BizReportInfo; import org.dromara.biz.domain.BizReportReply; +import org.dromara.biz.domain.vo.BizReportInfoVo; import org.dromara.biz.domain.vo.BizReportReplyVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; @@ -12,4 +18,6 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; */ public interface BizReportReplyMapper extends BaseMapperPlus { + @Select("select * from v_report_reply v ${ew.getCustomSqlSegment}") + Page selectBizReportReplyVoPage(@Param("page") Page page, @Param("ew") Wrapper queryWrapper); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizDutyService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizDutyService.java new file mode 100644 index 0000000..bce9b67 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizDutyService.java @@ -0,0 +1,68 @@ +package org.dromara.biz.service; + +import org.dromara.biz.domain.vo.BizDutyVo; +import org.dromara.biz.domain.bo.BizDutyBo; +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-11-27 + */ +public interface IBizDutyService { + + /** + * 查询值班信息 + * + * @param id 主键 + * @return 值班信息 + */ + BizDutyVo queryById(Long id); + + /** + * 分页查询值班信息列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 值班信息分页列表 + */ + TableDataInfo queryPageList(BizDutyBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的值班信息列表 + * + * @param bo 查询条件 + * @return 值班信息列表 + */ + List queryList(BizDutyBo bo); + + /** + * 新增值班信息 + * + * @param bo 值班信息 + * @return 是否新增成功 + */ + Boolean insertByBo(BizDutyBo bo); + + /** + * 修改值班信息 + * + * @param bo 值班信息 + * @return 是否修改成功 + */ + Boolean updateByBo(BizDutyBo bo); + + /** + * 校验并批量删除值班信息信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportReceiverService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportReceiverService.java index 34ef99d..cbc5212 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportReceiverService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/IBizReportReceiverService.java @@ -65,4 +65,12 @@ public interface IBizReportReceiverService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 签收报送记录接收单位 + * + * @param bo 报送记录接收单位 + * @return 是否修改成功 + */ + Boolean sign(BizReportReceiverBo bo); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizDutyServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizDutyServiceImpl.java new file mode 100644 index 0000000..c908919 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizDutyServiceImpl.java @@ -0,0 +1,188 @@ +package org.dromara.biz.service.impl; + +import org.dromara.biz.domain.BizReportInfo; +import org.dromara.common.core.domain.model.LoginUser; +import org.dromara.common.core.service.DeptService; +import org.dromara.common.core.service.UserService; +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.dromara.system.mapper.SysUserMapper; +import org.springframework.stereotype.Service; +import org.dromara.biz.domain.bo.BizDutyBo; +import org.dromara.biz.domain.vo.BizDutyVo; +import org.dromara.biz.domain.BizDuty; +import org.dromara.biz.mapper.BizDutyMapper; +import org.dromara.biz.service.IBizDutyService; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 值班信息Service业务层处理 + * + * @author ruansee + * @date 2025-11-27 + */ +@RequiredArgsConstructor +@Service +public class BizDutyServiceImpl implements IBizDutyService { + + private final BizDutyMapper baseMapper; + + private final UserService userService; + + private final DeptService deptService; + + private final SysUserMapper userMapper; + + /** + * 查询值班信息 + * + * @param id 主键 + * @return 值班信息 + */ + @Override + public BizDutyVo queryById(Long id){ + BizDutyVo duty = baseMapper.selectVoById(id); + duty.setLeader(userMapper.selectById(duty.getLeaderId())); + duty.setMonitor(userMapper.selectById(duty.getMonitorId())); + duty.setWatchkeeperList(userMapper.selectByIds(convertIds(duty.getWatchkeeperIds()))); + return duty; + } + + List convertIds(String ids){ + List result = new ArrayList<>(); + String[] arr = ids.split(","); + for (String id : + arr) { + result.add(Helper.FLong(id)); + } + return result; + } + + /** + * 分页查询值班信息列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 值班信息分页列表 + */ + @Override + public TableDataInfo queryPageList(BizDutyBo 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(BizDutyBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BizDutyBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(BizDuty::getCreateTime); + lqw.eq(bo.getDutyDate() != null, BizDuty::getDutyDate, bo.getDutyDate()); + lqw.between(params.get("beginDutyDate") != null && params.get("endDutyDate") != null, + BizDuty::getDutyDate ,params.get("beginDutyDate"), params.get("endDutyDate")); + lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), BizDuty::getDeptId, bo.getDeptId()); + lqw.like(StringUtils.isNotBlank(bo.getDeptName()), BizDuty::getDeptName, bo.getDeptName()); + lqw.eq(bo.getLeaderId() != null, BizDuty::getLeaderId, bo.getLeaderId()); + lqw.like(StringUtils.isNotBlank(bo.getLeaderName()), BizDuty::getLeaderName, bo.getLeaderName()); + lqw.eq(bo.getMonitorId() != null, BizDuty::getMonitorId, bo.getMonitorId()); + lqw.like(StringUtils.isNotBlank(bo.getMonitorName()), BizDuty::getMonitorName, bo.getMonitorName()); + lqw.eq(StringUtils.isNotBlank(bo.getWatchkeeperIds()), BizDuty::getWatchkeeperIds, bo.getWatchkeeperIds()); + lqw.like(StringUtils.isNotBlank(bo.getWatchkeeperNames()), BizDuty::getWatchkeeperNames, bo.getWatchkeeperNames()); + lqw.eq(bo.getStartTime() != null, BizDuty::getStartTime, bo.getStartTime()); + lqw.eq(bo.getEndTime() != null, BizDuty::getEndTime, bo.getEndTime()); + lqw.eq(StringUtils.isNotBlank(bo.getLevel()), BizDuty::getLevel, bo.getLevel()); + lqw.eq(StringUtils.isNotBlank(bo.getDutyLog()), BizDuty::getDutyLog, bo.getDutyLog()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BizDuty::getStatus, bo.getStatus()); + lqw.eq(bo.getCreateUserId() != null, BizDuty::getCreateUserId, bo.getCreateUserId()); + return lqw; + } + + /** + * 新增值班信息 + * + * @param bo 值班信息 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(BizDutyBo bo) { + BizDuty add = MapstructUtils.convert(bo, BizDuty.class); + + LoginUser user = LoginHelper.getLoginUser(); + + add.setDeptId(user.getDeptId()); + add.setCreateUserId(user.getUserId()); + add.setLeaderName(userService.selectNicknameById(add.getLeaderId())); + add.setMonitorName(userService.selectNicknameById(add.getMonitorId())); + add.setWatchkeeperNames(userService.selectNicknameByIds(add.getWatchkeeperIds())); + add.setDeptName(user.getDeptName()); + + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改值班信息 + * + * @param bo 值班信息 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(BizDutyBo bo) { + BizDuty update = MapstructUtils.convert(bo, BizDuty.class); + update.setLeaderName(userService.selectNicknameById(update.getLeaderId())); + update.setMonitorName(userService.selectNicknameById(update.getMonitorId())); + update.setWatchkeeperNames(userService.selectNicknameByIds(update.getWatchkeeperIds())); +// update.setDeptName(deptService.selectDeptNameByIds(update.getDeptId())); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(BizDuty 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/BizReportInfoServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/biz/service/impl/BizReportInfoServiceImpl.java index a8a24b8..139a006 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 @@ -5,6 +5,7 @@ import org.dromara.biz.domain.BizReportReceiver; import org.dromara.biz.domain.vo.BizReportReceiverVo; import org.dromara.biz.mapper.BizReportFileMapper; import org.dromara.biz.mapper.BizReportReceiverMapper; +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; @@ -14,6 +15,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.dromara.system.mapper.SysDeptMapper; import org.springframework.stereotype.Service; import org.dromara.biz.domain.bo.BizReportInfoBo; @@ -101,11 +103,12 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByDesc(BizReportInfo::getReportTime); - lqw.eq(StringUtils.isNotBlank(bo.getTitle()), BizReportInfo::getTitle, bo.getTitle()); + lqw.like(StringUtils.isNotBlank(bo.getTitle()), BizReportInfo::getTitle, bo.getTitle()); lqw.eq(bo.getCategoryId() != null, BizReportInfo::getCategoryId, bo.getCategoryId()); lqw.eq(StringUtils.isNotBlank(bo.getChao()), BizReportInfo::getChao, bo.getChao()); lqw.eq(StringUtils.isNotBlank(bo.getLdps()), BizReportInfo::getLdps, bo.getLdps()); lqw.eq(StringUtils.isNotBlank(bo.getQh()), BizReportInfo::getQh, bo.getQh()); + lqw.eq(StringUtils.isNotBlank(bo.getOldTable()), BizReportInfo::getOldTable, bo.getOldTable()); lqw.eq(StringUtils.isNotBlank(bo.getOldType()), BizReportInfo::getOldType, bo.getOldType()); lqw.eq(bo.getOldId() != null, BizReportInfo::getOldId, bo.getOldId()); lqw.eq(StringUtils.isNotBlank(bo.getUrl()), BizReportInfo::getUrl, bo.getUrl()); @@ -121,6 +124,20 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { lqw.like(StringUtils.isNotBlank(bo.getReportDeptName()), BizReportInfo::getReportDeptName, bo.getReportDeptName()); lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BizReportInfo::getStatus, bo.getStatus()); lqw.eq(bo.getUpdateUserId() != null, BizReportInfo::getUpdateUserId, bo.getUpdateUserId()); + + String table = Helper.NStr(bo.getOldTable()); + LoginUser user = LoginHelper.getLoginUser(); + if (table.equals("xxcl")){ + lqw.and(w-> { +// w.eq(user.getDeptId()!=null, BizReportInfo::getReportDeptId, user.getDeptId()); + w.likeRight(BizReportInfo::getReportDeptId, Helper.PrefixDeptid(user.getDeptId())); + w.or(ww->{ + ww.exists("select id from biz_report_receiver where dept_id = '"+ Helper.NStr(user.getDeptId()) +" and report_id = v.id '"); + }); + }); + } else if (table.equals("xxbs")){ + lqw.likeRight(BizReportInfo::getReportDeptId, Helper.PrefixDeptid(user.getDeptId())); + } return lqw; } @@ -139,7 +156,7 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { bo.setId(add.getId()); // 插入接收单位表 - if(bo.getReceiverDeptIds().length>0){ + if(bo.getReceiverDeptIds()!=null && bo.getReceiverDeptIds().length>0){ for (String deptId : bo.getReceiverDeptIds()) { BizReportReceiver receiver = new BizReportReceiver(); receiver.setReportId(bo.getId()); @@ -150,7 +167,7 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { } // 插入附件表 - if (bo.getFiles().size()>0){ + if (bo.getFiles()!=null && bo.getFiles().size()>0){ for (BizReportFile file : bo.getFiles()) { file.setReportId(bo.getId()); fileMapper.insert(file); @@ -177,18 +194,20 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { if (flag){ // 插入接收单位表 List dbDeptIds = new ArrayList<>(); - if (bo.getReceiverDepts().size()>0) { - for (BizReportReceiver receiver : bo.getReceiverDepts()) { - if (!Arrays.asList(bo.getReceiverDeptIds()).contains(receiver.getDeptId())) - receiverMapper.deleteById(receiver.getId()); - dbDeptIds.add(receiver.getDeptId()); + if (bo.getReceiverDepts()!=null) { + if (bo.getReceiverDepts().size() > 0) { + for (BizReportReceiver receiver : bo.getReceiverDepts()) { + if (!Arrays.asList(bo.getReceiverDeptIds()).contains(receiver.getDeptId())) + receiverMapper.deleteById(receiver.getId()); + dbDeptIds.add(receiver.getDeptId()); + } + } else { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(BizReportReceiver::getReportId, bo.getId()); + receiverMapper.delete(lqw); } - }else{ - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.eq(BizReportReceiver::getReportId, bo.getId()); - receiverMapper.delete(lqw); } - if(bo.getReceiverDeptIds().length>0){ + if(bo.getReceiverDeptIds()!=null && bo.getReceiverDeptIds().length>0){ for (String deptId : bo.getReceiverDeptIds()) { if (dbDeptIds.contains(deptId)) continue; else { @@ -202,7 +221,7 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService { } // 插入附件表 - if (bo.getFiles().size()>0){ + if (bo.getFiles()!=null && bo.getFiles().size()>0){ for (BizReportFile file : bo.getFiles()) { if (Helper.FInt(file.getId())>0) continue; 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 8700e13..762c988 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 @@ -1,5 +1,7 @@ package org.dromara.biz.service.impl; +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; @@ -8,6 +10,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.BizReportReceiverBo; import org.dromara.biz.domain.vo.BizReportReceiverVo; @@ -15,6 +18,7 @@ import org.dromara.biz.domain.BizReportReceiver; import org.dromara.biz.mapper.BizReportReceiverMapper; import org.dromara.biz.service.IBizReportReceiverService; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.Collection; @@ -23,7 +27,7 @@ import java.util.Collection; * 报送记录接收单位Service业务层处理 * * @author ruansee - * @date 2025-11-21 + * @date 2025-11-28 */ @RequiredArgsConstructor @Service @@ -73,12 +77,17 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByAsc(BizReportReceiver::getId); lqw.eq(bo.getReportId() != null, BizReportReceiver::getReportId, bo.getReportId()); - lqw.eq(bo.getDeptId() != null, BizReportReceiver::getDeptId, bo.getDeptId()); + lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), BizReportReceiver::getDeptId, bo.getDeptId()); lqw.like(StringUtils.isNotBlank(bo.getDeptName()), BizReportReceiver::getDeptName, bo.getDeptName()); lqw.eq(bo.getIsSign() != null, BizReportReceiver::getIsSign, bo.getIsSign()); - lqw.eq(bo.getSignTime() != null, BizReportReceiver::getSignTime, bo.getSignTime()); + lqw.between(params.get("beginSignTime") != null && params.get("endSignTime") != null, + BizReportReceiver::getSignTime ,params.get("beginSignTime"), params.get("endSignTime")); lqw.eq(bo.getSignUserId() != null, BizReportReceiver::getSignUserId, bo.getSignUserId()); lqw.like(StringUtils.isNotBlank(bo.getSignUserName()), BizReportReceiver::getSignUserName, bo.getSignUserName()); + lqw.eq(bo.getOldId() != null, BizReportReceiver::getOldId, bo.getOldId()); + 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()); return lqw; } @@ -133,4 +142,33 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService { } return baseMapper.deleteByIds(ids) > 0; } + + /** + * 修改报送记录接收单位 + * + * @param bo 报送记录接收单位 + * @return 是否修改成功 + */ + @Override + public Boolean sign(BizReportReceiverBo bo) { + LoginUser user = LoginHelper.getLoginUser(); + if (Helper.FInt(bo.getId()) == 0){ + BizReportReceiverBo sbo = new BizReportReceiverBo(); + sbo.setReportId(bo.getReportId()); + sbo.setDeptId(user.getDeptId()); + LambdaQueryWrapper lqw = buildQueryWrapper(sbo); + List list = baseMapper.selectVoList(lqw); + if (list!=null && list.size()>0){ + BizReportReceiverVo vo = list.get(0); + bo.setId(vo.getId()); + } else return false; + } + bo.setIsSign(true); + bo.setSignUserId(user.getUserId()); + bo.setSignUserName(user.getNickname()); + bo.setSignTime(new Date()); + BizReportReceiver update = MapstructUtils.convert(bo, BizReportReceiver.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 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 a087d4d..8b52a58 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 @@ -1,5 +1,10 @@ package org.dromara.biz.service.impl; +import org.dromara.biz.domain.BizReportReceiver; +import org.dromara.biz.domain.bo.BizReportReceiverBo; +import org.dromara.biz.domain.vo.BizReportReceiverVo; +import org.dromara.biz.mapper.BizReportReceiverMapper; +import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -8,6 +13,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.BizReportReplyBo; import org.dromara.biz.domain.vo.BizReportReplyVo; @@ -30,6 +36,7 @@ import java.util.Collection; public class BizReportReplyServiceImpl implements IBizReportReplyService { private final BizReportReplyMapper baseMapper; + private final BizReportReceiverMapper receiverMapper; /** * 查询报送记录反馈 @@ -52,7 +59,7 @@ public class BizReportReplyServiceImpl implements IBizReportReplyService { @Override public TableDataInfo queryPageList(BizReportReplyBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + Page result = baseMapper.selectBizReportReplyVoPage(pageQuery.build(), lqw); return TableDataInfo.build(result); } @@ -71,7 +78,7 @@ public class BizReportReplyServiceImpl implements IBizReportReplyService { private LambdaQueryWrapper buildQueryWrapper(BizReportReplyBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.orderByAsc(BizReportReply::getId); + lqw.orderByDesc(BizReportReply::getId); lqw.eq(bo.getReportId() != null, BizReportReply::getReportId, bo.getReportId()); lqw.eq(StringUtils.isNotBlank(bo.getContent()), BizReportReply::getContent, bo.getContent()); lqw.eq(bo.getUserId() != null, BizReportReply::getUserId, bo.getUserId()); @@ -89,11 +96,26 @@ public class BizReportReplyServiceImpl implements IBizReportReplyService { */ @Override public Boolean insertByBo(BizReportReplyBo bo) { + LoginUser user = LoginHelper.getLoginUser(); BizReportReply add = MapstructUtils.convert(bo, BizReportReply.class); + add.setUserId(user.getUserId()); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { bo.setId(add.getId()); + + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(BizReportReceiver::getId); + lqw.eq(bo.getReportId() != null, BizReportReceiver::getReportId, bo.getReportId()); + lqw.eq(BizReportReceiver::getDeptId, user.getDeptId()); + List list = receiverMapper.selectVoList(lqw); + if (list!=null && list.size()>0){ + BizReportReceiverVo vo = list.get(0); + BizReportReceiver sbo = new BizReportReceiver(); + sbo.setId(vo.getId()); + sbo.setIsFeedback(true); + receiverMapper.updateById(sbo); + } } return flag; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java index 9e75a4f..9b7fe03 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysUser.java @@ -28,7 +28,11 @@ public class SysUser extends TenantEntity { private Long userId; /** - * 部门ID + * 所属部门ID + */ + private String workDeptId; + /** + * 管理部门ID */ private String deptId; @@ -52,6 +56,10 @@ public class SysUser extends TenantEntity { */ private String email; + /** + * 固定电话 + */ + private String telephone; /** * 手机号码 */ 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 9f34862..2efd414 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 @@ -30,7 +30,11 @@ public class SysUserBo extends BaseEntity { private Long userId; /** - * 部门ID + * 所属部门ID + */ + private String workDeptId; + /** + * 管理部门ID */ private String deptId; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java index 37ec6b7..c737067 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java @@ -82,9 +82,14 @@ public class SysUserExportVo implements Serializable { private Date loginDate; /** - * 部门名称 + * 所属部门名称 */ - @ExcelProperty(value = "部门名称") + @ExcelProperty(value = "所属部门名称") + private String workDeptName; + /** + * 管理部门名称 + */ + @ExcelProperty(value = "管理部门名称") private String deptName; /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserImportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserImportVo.java index fccd0e5..358b771 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserImportVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserImportVo.java @@ -32,7 +32,12 @@ public class SysUserImportVo implements Serializable { /** * 部门ID */ - @ExcelProperty(value = "部门编号") + @ExcelProperty(value = "所属部门编号") + private String workDeptId; + /** + * 部门ID + */ + @ExcelProperty(value = "管理部门编号") private String deptId; /** 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 0140ace..2c7888b 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 @@ -39,7 +39,11 @@ public class SysUserVo implements Serializable { private String tenantId; /** - * 部门ID + * 所属部门ID + */ + private String workDeptId; + /** + * 管理部门ID */ private String deptId; @@ -113,6 +117,11 @@ public class SysUserVo implements Serializable { */ private Date createTime; + /** + * 部门名 + */ + @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "workDeptId") + private String workDeptName; /** * 部门名 */ 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 4fe63d7..30bc250 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 @@ -84,7 +84,12 @@ public class SysUserServiceImpl implements ISysUserService, UserService { .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()) .between(params.get("beginTime") != null && params.get("endTime") != null, "u.create_time", params.get("beginTime"), params.get("endTime")) - .and(ObjectUtil.isNotNull(user.getDeptId()), w -> { + .and(ObjectUtil.isNotNull(user.getWorkDeptId()), w -> { + List deptList = deptMapper.selectListByParentId(user.getWorkDeptId()); + List ids = StreamUtils.toList(deptList, SysDept::getDeptId); + ids.add(user.getWorkDeptId()); + w.in("u.work_dept_id", ids); + }).and(ObjectUtil.isNotNull(user.getDeptId()), w -> { List deptList = deptMapper.selectListByParentId(user.getDeptId()); List ids = StreamUtils.toList(deptList, SysDept::getDeptId); ids.add(user.getDeptId()); diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/biz/BizDutyMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/biz/BizDutyMapper.xml new file mode 100644 index 0000000..ea6e446 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/biz/BizDutyMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index ded6fa8..bc8b497 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -17,7 +17,7 @@ ${ew.getSqlSelect} - u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, + u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u @@ -30,7 +30,7 @@ ${ew.getSqlSelect} - u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, + u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u @@ -38,17 +38,18 @@