From a62135097b229c58b5345a7ce8adfbcac27cce00 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Tue, 24 Feb 2026 13:06:29 +0800 Subject: [PATCH 01/26] =?UTF-8?q?fix:[=E5=A1=AB=E6=8A=A5=E8=A1=A8=E5=8D=95?= =?UTF-8?q?]=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java index a24a680..328fdcc 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java @@ -23,6 +23,7 @@ public class StudyFormUtil { mapLang.put("存储药剂","存储药剂"); + mapLang.put("字段名","Field Name"); mapLang.put("原值","Old Value"); mapLang.put("新值","New Value"); mapLang.put("原因","Reason"); From 5d5c52b899aa3cf88b3d5a41a1d6388a94ef81fb Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Tue, 24 Feb 2026 15:44:02 +0800 Subject: [PATCH 02/26] =?UTF-8?q?fix:=20[=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20[=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97]=20=E5=8F=AA?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=99=BB=E5=BD=95=E6=88=90=E5=8A=9F=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hxhq/auth/service/SysLoginService.java | 14 +++++++------- .../java/com/hxhq/auth/service/SysPasswordService.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java index 448ff3e..63daf9a 100644 --- a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java +++ b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java @@ -54,28 +54,28 @@ public class SysLoginService // 用户名或密码为空 错误 if (StringUtils.isAnyBlank(username, password)) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户/密码必须填写"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户/密码必须填写"); throw new ServiceException("用户/密码必须填写"); } // 密码如果不在指定范围内 错误 if (password.length() < UserConstants.PASSWORD_MIN_LENGTH || password.length() > UserConstants.PASSWORD_MAX_LENGTH) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户密码不在指定范围"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户密码不在指定范围"); throw new ServiceException("用户密码不在指定范围"); } // 用户名不在指定范围内 错误 if (username.length() < UserConstants.USERNAME_MIN_LENGTH || username.length() > UserConstants.USERNAME_MAX_LENGTH) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户名不在指定范围"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "用户名不在指定范围"); throw new ServiceException("用户名不在指定范围"); } // IP黑名单校验 String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST)); if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) { - recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单"); +// recordLogService.recordLogininfor(username,null, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单"); throw new ServiceException("很遗憾,访问IP已被列入系统黑名单"); } // 查询用户信息 @@ -91,12 +91,12 @@ public class SysLoginService if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); +// recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); } if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); +// recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); throw new ServiceException("对不起,您的账号:" + username + " 已停用"); } passwordService.validate(user, password); @@ -140,7 +140,7 @@ public class SysLoginService public void logout(String loginName) { - recordLogService.recordLogininfor(loginName,null, Constants.LOGOUT, "退出成功"); +// recordLogService.recordLogininfor(loginName,null, Constants.LOGOUT, "退出成功"); } /** diff --git a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java index b0e0210..42daebd 100644 --- a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java +++ b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysPasswordService.java @@ -60,7 +60,7 @@ public class SysPasswordService if (!matches(user, password)) { retryCount = retryCount + 1; - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount)); +// recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount)); redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); throw new ServiceException("用户不存在/密码错误"); } From 11e69a99464761475aff6a1103e01737f24923ab Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Tue, 24 Feb 2026 16:10:02 +0800 Subject: [PATCH 03/26] =?UTF-8?q?fix:=20[=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20[=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97]=20=E5=8F=8C?= =?UTF-8?q?=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hxhq/system/api/domain/SysLogininfor.java | 12 ++++++++++++ .../src/main/java/com/hxhq/auth/service/SysLoginService.java | 4 ++-- .../main/java/com/hxhq/auth/service/SysRecordLogService.java | 3 ++- .../com/hxhq/system/controller/SysLogininforController.java | 2 +- .../src/main/resources/mapper/system/SysLogininforMapper.xml | 7 ++++--- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java index 27f0f3c..71c2ca8 100644 --- a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java +++ b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysLogininfor.java @@ -39,6 +39,10 @@ public class SysLogininfor extends BaseEntity @Excel(name = "描述") private String msg; + /** 描述 */ + @Excel(name = "描述-英文") + private String msgEn; + /** 访问时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @@ -108,6 +112,14 @@ public class SysLogininfor extends BaseEntity this.msg = msg; } + public String getMsgEn() { + return msgEn; + } + + public void setMsgEn(String msgEn) { + this.msgEn = msgEn; + } + public Date getAccessTime() { return accessTime; diff --git a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java index 63daf9a..0c02618 100644 --- a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java +++ b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysLoginService.java @@ -117,7 +117,7 @@ public class SysLoginService } } - recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_SUCCESS, "登录成功"); + recordLogService.recordLogininfor(username,user.getNickName(), Constants.LOGIN_SUCCESS, "登录成功","Login Successful"); recordLoginInfo(user.getUserId()); return userInfo; } @@ -176,6 +176,6 @@ public class SysLoginService { throw new ServiceException(registerResult.getMsg()); } - recordLogService.recordLogininfor(username,null, Constants.REGISTER, "注册成功"); +// recordLogService.recordLogininfor(username,null, Constants.REGISTER, "注册成功"); } } diff --git a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java index b6cc877..3a39a5a 100644 --- a/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java +++ b/hxhq-auth/src/main/java/com/hxhq/auth/service/SysRecordLogService.java @@ -29,13 +29,14 @@ public class SysRecordLogService * @param message 消息内容 * @return */ - public void recordLogininfor(String username,String nickName, String status, String message) + public void recordLogininfor(String username,String nickName, String status, String message, String messageEn) { SysLogininfor logininfor = new SysLogininfor(); logininfor.setUserName(username); logininfor.setNickName(nickName); logininfor.setIpaddr(IpUtils.getIpAddr()); logininfor.setMsg(message); + logininfor.setMsgEn(messageEn); // 日志状态 if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java index 2404b61..0fd5f4f 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java @@ -72,7 +72,7 @@ public class SysLogininforController extends BaseController systemLog.setQmrMc(l.getNickName()); systemLog.setCzlx(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"登录":"Login"); systemLog.setCzsj(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,l.getAccessTime())); - systemLog.setCzxq(l.getMsg()); + systemLog.setCzxq(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?l.getMsg():l.getMsgEn()); logList.add(systemLog); } ExcelUtil util = new ExcelUtil(SystemLog.class); diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml index 43bc1f4..2bcecd2 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -11,16 +11,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - insert into sys_logininfor (user_name,nick_name, status, ipaddr, msg, access_time) - values (#{userName},#{nickName}, #{status}, #{ipaddr}, #{msg}, sysdate()) + insert into sys_logininfor (user_name,nick_name, status, ipaddr, msg, msg_en, access_time) + values (#{userName},#{nickName}, #{status}, #{ipaddr}, #{msg}, #{msgEn}, sysdate()) + \ No newline at end of file From 8bc1fa471b934a0775265303a0af6468ed1ffc86 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Fri, 27 Feb 2026 17:54:07 +0800 Subject: [PATCH 09/26] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?]=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StudyFormFillController.java | 46 ++++++++++++++++++++++ .../com/hxhq/business/utils/lang/GspJcnrUtil.java | 3 ++ .../com/hxhq/business/utils/lang/GyzjJcnrUtil.java | 2 + .../com/hxhq/business/utils/lang/MjyJcnrUtil.java | 3 ++ .../hxhq/business/utils/lang/StudyFormUtil.java | 2 + .../com/hxhq/business/utils/lang/TemplateUtil.java | 2 + .../com/hxhq/business/utils/lang/ZcgJcnrUtil.java | 2 + 7 files changed, 60 insertions(+) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java index dbfa769..04232e0 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java @@ -1,5 +1,6 @@ package com.hxhq.business.controller; +import java.io.File; import java.util.*; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -16,7 +17,10 @@ import com.hxhq.business.form.sj.SjSubpackageForm; import com.hxhq.business.form.study.*; import com.hxhq.business.service.*; import com.hxhq.business.utils.JctUtil; +import com.hxhq.business.utils.StudyFormFillUtil; import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.business.utils.pdf.template.TemplateBaseUtil; +import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.utils.SecurityUtils; @@ -40,6 +44,8 @@ public class StudyFormFillController extends BaseController { @Autowired private IStudyFormFillService studyFormFillService; @Autowired + private IStudyService studyService; + @Autowired private IStudyFormFillJcgjService studyFormFillJcgjService; @Autowired private IStudyFormFillQmxxService studyFormFillQmxxService; @@ -182,6 +188,46 @@ public class StudyFormFillController extends BaseController { return AjaxResult.success(localFilePrefix + PdfExportUtil.export(studyFormFill.getTemplateExportClass(), studyFormFill.getTemplateExportMethod(), studyFormFill, studyFormFillQmxxList, studyFormFillJcgjList, form.getLang(), form.getJcgjlx(), localFilePath)); } + + /** + * 导出 + */ + @RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR) + @GetMapping(value = "/exportByFileUrl") + public AjaxResult exportByFileUrl(StudyFormFillExportForm form) { + StudyFormFill studyFormFill = studyFormFillService.queryInfo(form.getStudyFormFillId()); + Study study = studyService.getById(studyFormFill.getStudyId()); + //稽查轨迹 + QueryWrapper studyFormFillJcgjQueryWrapper = Wrappers.query(); + studyFormFillJcgjQueryWrapper.eq("form_id",studyFormFill.getId()); + if(form.getJcgjlx()!=null&&form.getJcgjlx().intValue()>0){ + Integer jcgjlxExport=999; + if(form.getJcgjlx().intValue()==jcgjlxExport){ + studyFormFillJcgjQueryWrapper.notIn("jcgjlx", JcgjlxEnum.xg.getValue()); + }else{ + studyFormFillJcgjQueryWrapper.eq("jcgjlx",form.getJcgjlx()); + } + } + studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); + List jcgjList=studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper); + //签名信息 + QueryWrapper studyFormFillQmxxQueryWrapper = Wrappers.query(); + studyFormFillQmxxQueryWrapper.eq("form_id",studyFormFill.getId()); + studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); + List qmxxList=studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper); + + String fileUrl =form.getUrl(); + fileUrl = fileUrl.replaceFirst(localFilePrefix, ""); + int indexOf = fileUrl.lastIndexOf("/"); + String path = fileUrl.substring(0, indexOf); + String exportFileName = StudyFormFillUtil.export(form.getVersion(),form.getLang(),study.getName() + "("+study.getSn()+")"+studyFormFill.getBdmc(), + localFilePath + fileUrl, localFilePath + File.separator + path,jcgjList,qmxxList); + + + + return AjaxResult.success(localFilePrefix + path + File.separator + exportFileName); + } + /** * 加签 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java index f313ffa..e921ade 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java @@ -15,6 +15,9 @@ public class GspJcnrUtil { private static final Logger logger = LoggerFactory.getLogger(GspJcnrUtil.class.getName()); private static HashMap mapLang=new HashMap<>(); static { + + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("入库","In Storage"); mapLang.put("未入库","Not in Storage"); mapLang.put("已发放","In Use"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java index 69185ee..c7b45f4 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java @@ -88,6 +88,8 @@ public class GyzjJcnrUtil { mapLang.put("备注","Comment"); mapLang.put("签名人","Signed By"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("申请解档","Apply for De-archiving"); mapLang.put("申请借阅","Apply for Check-out"); mapLang.put("申请归档","Apply for Archiving"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java index 5b1eec2..04ed832 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java @@ -15,6 +15,9 @@ public class MjyJcnrUtil { private static final Logger logger = LoggerFactory.getLogger(MjyJcnrUtil.class.getName()); private static HashMap mapLang=new HashMap<>(); static { + + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("入库","In Storage"); mapLang.put("未入库","Not in Storage"); mapLang.put("已发放","In Use"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java index 328fdcc..f4d7876 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java @@ -17,6 +17,8 @@ public class StudyFormUtil { static { + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("存储","Storage"); mapLang.put("存储条件","Storage Condition"); mapLang.put("存储位置","Storage Location"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java index 7fdac5a..27862a9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java @@ -22,6 +22,8 @@ public class TemplateUtil { mapLang.put("操作步骤","Operation Steps"); mapLang.put("备注","Remarks"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); mapLang.put("试验名称","Study Name"); mapLang.put("试验编号","Study Number"); mapLang.put("方法编号","Method Code"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java index 3944cd7..c4b71df 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java @@ -26,6 +26,8 @@ public class ZcgJcnrUtil { mapLang.put("钥匙1领取人","Key 1 Recipient"); mapLang.put("钥匙2领取人","Key 2 Recipient"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("签名信息","Signature information"); } public static void main(String[] args) { From b2a67a0e29b8d8dcae688f7334c02eb69eb6f716 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Fri, 27 Feb 2026 18:14:22 +0800 Subject: [PATCH 10/26] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?]=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/study/StudyFormFillExportForm.java | 61 +++ .../com/hxhq/business/utils/StudyFormFillUtil.java | 467 +++++++++++++++++++++ 2 files changed, 528 insertions(+) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormFillExportForm.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormFillExportForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormFillExportForm.java new file mode 100644 index 0000000..4517799 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyFormFillExportForm.java @@ -0,0 +1,61 @@ +package com.hxhq.business.form.study; + +/** + * @author tanfei + */ +public class StudyFormFillExportForm { + /** 表单id */ + private Long studyFormFillId; + + /** url */ + private String url; + + /** lang */ + private String lang; + + /** version */ + private String version; + + /** jcgjlx */ + private Integer jcgjlx; + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getLang() { + return lang; + } + + public void setLang(String lang) { + this.lang = lang; + } + + public Integer getJcgjlx() { + return jcgjlx; + } + + public void setJcgjlx(Integer jcgjlx) { + this.jcgjlx = jcgjlx; + } + + public Long getStudyFormFillId() { + return studyFormFillId; + } + + public void setStudyFormFillId(Long studyFormFillId) { + this.studyFormFillId = studyFormFillId; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java new file mode 100644 index 0000000..451bc7b --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java @@ -0,0 +1,467 @@ +package com.hxhq.business.utils; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.hxhq.business.domain.*; +import com.hxhq.business.utils.lang.TemplateUtil; +import com.hxhq.business.utils.pdf.PdfBaseUtil; +import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.common.core.text.Convert; +import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.common.core.utils.StringUtils; +import com.hxhq.common.security.utils.SecurityUtils; +import com.hxhq.system.api.model.LoginUser; +import com.itextpdf.text.*; +import com.itextpdf.text.pdf.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Paths; +import java.util.List; +import java.util.Random; +import java.util.StringJoiner; + +/** + * 试验方法pdf导出 + * + * @author HanLong + */ +@Component +public class StudyFormFillUtil { + + private static final Logger log = LoggerFactory.getLogger(StudyFormFillUtil.class); + public static String language = "zh"; + /** + * 资源映射路径 前缀 + */ + @Value("${file.prefix}") + public String localFilePrefix; + + /** + * 域名或本机访问地址 + */ + @Value("${file.domain}") + public String domain; + + /** + * 上传文件存储在本地的根路径 + */ + @Value("${file.path}") + private String localFilePath; + + /** + * 复制原有PDF的所有页面到新Document中 + */ + private static void copyOriginalPagesToDocument(Document doc, PdfWriter writer, PdfReader reader) throws DocumentException { + int pageCount = reader.getNumberOfPages(); + // 获取直接内容画布 + PdfContentByte canvas = writer.getDirectContent(); + + for (int i = 1; i <= pageCount; i++) { + doc.newPage(); // 新建一页(与原PDF页面一一对应) + // 5.5.11中通过PdfImportedPage导入原有页面 + PdfImportedPage importedPage = writer.getImportedPage(reader, i); + // 将原有页面绘制到新文档的当前页 + canvas.addTemplate(importedPage, 0, 0); + } + } + + /** + * 导出table + * + * @param headerText + * @param fileDir + * @return + */ + public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List jcgjList, List qmxxList) { + language = lang; + Document document = null; + FileOutputStream fos = null; + String filePath = ""; + String fileName = ""; + try { + // 1. 生成文件名 + fileName = generateFileName(); + // 2. 确保目录存在 + File dir = new File(fileDir); + if (!dir.exists()) { + dir.mkdirs(); + } + // 3. 完整文件路径 + filePath = Paths.get(fileDir, fileName).toString(); + // 创建PDF文档 设置文档边距,避免内容遮挡页眉页脚 + // 1. 读取原有PDF,获取页面尺寸(保证新文档与原文档格式一致) + PdfReader srcReader = new PdfReader(srcPdf); + // 取第一页尺寸作为新文档尺寸 + Rectangle pageSize = srcReader.getPageSize(1); + // 2. 初始化Document(iText 5的核心高层类) + document = new Document(pageSize); + fos = new FileOutputStream(filePath); + // 3. 关联PdfWriter,绑定Document和输出流(5.5.11必须先创建Writer再open Document) + PdfWriter writer = PdfWriter.getInstance(document, fos); + // 设置页面事件,每页添加文字页眉 + String sign = "hxhq"; + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + sign = loginUser.getSysUser().getNickName() + " " + DateUtils.getTime(); + } + writer.setPageEvent(new TextHeaderEvent(sign+" "+version, headerText, false)); + // 4. 设置PDF属性 + document.addTitle("华西海圻"); + document.addAuthor("华西海圻"); + document.addCreator("华西海圻"); + document.addCreationDate(); + document.open(); + // 5. 复制原有PDF的所有页面到新Document中 + copyOriginalPagesToDocument(document, writer, srcReader); + // 7. 表格设置到新的一页 + document.newPage(); + addQmxx(document, qmxxList, lang); + addJcgj(document, jcgjList, lang); + } catch (Exception e) { + throw new RuntimeException("生成失败: " + e.getMessage()); + } finally { + if (document != null) { + document.close(); + } + if (fos != null) { + try { + fos.close(); + } catch (IOException e) { + log.error("关闭文件流失败", e); + } + } + } + return fileName; + } + + /** + * 签名信息 + * 申请表单 + * + * @param document + * @param studyFormFillQmxxList + * @throws IOException + * @throws DocumentException + */ + public static void addQmxx(Document document, List studyFormFillQmxxList, String lang) throws IOException, DocumentException { + language = lang; + PdfBaseUtil.addUnderlinedTitle(document, getName("签名信息"), 10, true); + // 9. 表头 + BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); + Font headerFont = new Font(bfChinese, 10, Font.NORMAL); + Font contentFont = new Font(bfChinese, 10, Font.NORMAL); + + // 8. 创建表格 + PdfPTable table = new PdfPTable(4); + table.setWidthPercentage(100); + table.setSpacingBefore(10); + String[] headers = {getName("签名人"), getName("签名意义"), getName("签名时间"), getName("备注原因")}; + for (String header : headers) { + PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); + cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); + cell.setBorderWidth(1); + table.addCell(cell); + } + if (studyFormFillQmxxList.size() > 0) { + int rowNum = 0; + for (StudyFormFillQmxx studyFormFillQmxx : studyFormFillQmxxList) { + // 交替行颜色 + if (rowNum % 2 == 0) { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } else { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } + table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getQmrMc(), contentFont)); + table.addCell(PdfBaseUtil.createCell("en".equals(language) ? studyFormFillQmxx.getQmyyEn() : studyFormFillQmxx.getQmyy(), contentFont)); + table.addCell(PdfBaseUtil.createCell(PdfExportUtil.parseDateToStr(studyFormFillQmxx.getCreateTime()), contentFont)); + table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getRemark(), contentFont)); + rowNum++; + } + } + document.add(table); + } + + /** + * 稽查轨迹 + * 申请表单 + * + * @param document + * @param studyFormFillJcgjList + * @throws IOException + * @throws DocumentException + */ + public static void addJcgj(Document document, List studyFormFillJcgjList, String lang) throws IOException, DocumentException { + language = lang; + PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹"), 10, true); + for (StudyFormFillJcgj jcgj : studyFormFillJcgjList) { + StringJoiner result = new StringJoiner(", "); + if ("en".equals(lang)) { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime()) + " " + jcgj.getJcmcEn(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnrEn())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnrEn()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value") != null ? node.get("value").asText() : ""; + result.add(name + ":" + value); + } + } + } + } else { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime()) + " " + jcgj.getJcmc(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnr())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value") != null ? node.get("value").asText() : ""; + result.add(name + ":" + value); + } + } + } + } + + if (StringUtils.isNoneBlank(jcgj.getRemark())) { + result.add(getName("备注") + ":" + jcgj.getRemark()); + } + if (StringUtils.isNoneBlank(jcgj.getQmrMc())) { + result.add(getName("签名人") + ":" + jcgj.getQmrMc()); + } + PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); + } + } + + + /** + * 获取名称 + * + * @param name + * @return + */ + public static String getName(String name) { + return "en".equals(language) ? TemplateUtil.getEn(name) : name; + } + + + /** + * 创建表格 + */ + private static PdfPCell createCell(String content, Font font) { + PdfPCell cell = new PdfPCell(new Phrase(content, font)); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setVerticalAlignment(Element.ALIGN_MIDDLE); + cell.setPadding(6); + cell.setMinimumHeight(25); + return cell; + } + + + /** + * 生成文件名 + */ + private static String generateFileName() { + Random random = new Random(); + String timestamp = DateUtils.dateTimeNow("yyyyMMddHHmmss"); + return String.format("%s_%s.pdf", timestamp, random.nextInt(1000)); + } + + + /** + * 页面事件处理类 - 每页添加文字页眉 + */ + static class TextHeaderEvent extends PdfPageEventHelper { + private Font footerFont; + private String signText; + private String headerText; + private BaseFont baseFont; + private Boolean showHaderLine = true; + private int totalPages = 0; + private PdfTemplate total; + + public TextHeaderEvent(String signText, String headerText, Boolean showHaderLine) throws Exception { + try { + this.showHaderLine = showHaderLine; + this.signText = signText; + this.headerText = headerText; + // 创建字体(支持中文) + this.baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); + footerFont = new Font(baseFont, 10, Font.NORMAL, BaseColor.GRAY); + } catch (Exception e) { + footerFont = new Font(Font.FontFamily.HELVETICA, 10, Font.NORMAL, BaseColor.GRAY); + } + } + + @Override + public void onOpenDocument(PdfWriter writer, Document document) { + total = writer.getDirectContent().createTemplate(100, 16); + } + + @Override + public void onCloseDocument(PdfWriter writer, Document document) { + totalPages = writer.getPageNumber(); + String totalPagesStr = String.valueOf(totalPages); + + // 重新创建合适宽度的模板 + BaseFont baseFont = footerFont.getBaseFont(); + float actualWidth = baseFont.getWidthPoint(totalPagesStr, footerFont.getSize()); + + total.beginText(); + total.setFontAndSize(baseFont, footerFont.getSize()); + total.setTextMatrix(0, 0); + total.showText(totalPagesStr); + total.endText(); + } + + @Override + public void onEndPage(PdfWriter writer, Document document) { + try { + PdfContentByte cb = writer.getDirectContent(); + + // 获取页面尺寸 + Rectangle pageSize = document.getPageSize(); + float pageWidth = pageSize.getWidth(); + float pageHeight = pageSize.getHeight(); + + // 设置页眉参数 + float topMargin = 15; // 顶部边距 + float fontSize = 12; // 字体大小 + + // 计算文字宽度(用于居中) + float textWidth = baseFont.getWidthPoint(signText, fontSize); + + // 计算居中位置 + float textX = (pageSize.getLeft() + pageSize.getRight()) / 2; + float textY = pageHeight - topMargin; + + // 获取画布 + PdfContentByte canvas = writer.getDirectContent(); + + int currentPage = writer.getPageNumber(); + float y = document.bottom() - 20; + + // 在每一页都重新计算,确保位置准确 + String pageText = signText+ " 第 " + currentPage + " 页 / 共 "; + BaseFont baseFont = footerFont.getBaseFont(); + + // 计算页面文本宽度 + float pageTextWidth = baseFont.getWidthPoint(pageText, footerFont.getSize()); + + // 临时用估计的总页数计算位置(等文档关闭后会被替换) + String tempTotal = String.valueOf(writer.getPageNumber() + 5); // 估计值 + float totalWidth = baseFont.getWidthPoint(tempTotal, footerFont.getSize()); + + // 计算起始位置 + float totalTextWidth = pageTextWidth + totalWidth + + baseFont.getWidthPoint(" 页", footerFont.getSize()); + float startX = (document.getPageSize().getWidth() - totalTextWidth) / 2; + + // 写入当前页信息 + ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, + new Phrase(pageText, footerFont), startX, y, 0); + + // 添加总页数模板 + cb.addTemplate(total, startX + pageTextWidth, y); + + // 写入"页"字 + ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, + new Phrase(" 页", footerFont), startX + pageTextWidth + totalWidth, y, 0); + +// PdfContentByte content = writer.getDirectContentUnder(); // 在水印层添加 +// +// // 设置透明度 +// PdfGState gs = new PdfGState(); +// float opacity = Convert.toFloat("0.3"); +// gs.setFillOpacity(opacity); +// content.setGState(gs); +// +// // 设置字体和颜色 +// content.setColorFill(BaseColor.RED); +// content.setFontAndSize(baseFont, fontSize); +// +// float width = pageSize.getWidth(); +// float height = pageSize.getHeight(); +// +// // 重复铺满水印 +// addRepeatedWatermark(content, width, height, signText); + // 添加页眉文字 + if (StringUtils.isNoneBlank(headerText)) { + PdfContentByte cb2 = writer.getDirectContent(); + ColumnText.showTextAligned(cb2, Element.ALIGN_LEFT, + new Phrase(headerText, footerFont), startX, textY, 0); +// canvas.beginText(); +// canvas.setFontAndSize(baseFont, fontSize); +// canvas.setTextMatrix(textX, textY); +// canvas.showText(headerText); +// canvas.endText(); + if (showHaderLine) { + // 添加页眉分隔线(可选) + addHeaderLine(canvas, pageWidth, textY - 10); + } + } + + + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 添加水印 + * + * @param content + * @param width + * @param height + * @param signText + */ + private void addRepeatedWatermark(PdfContentByte content, float width, float height, String signText) { + // 计算文字尺寸 + float fontSize = Convert.toFloat("10"); + float textWidth = baseFont.getWidthPoint(signText, fontSize) + 50; + float textHeight = baseFont.getAscentPoint(signText, fontSize) - + baseFont.getDescentPoint(signText, fontSize); + + // 计算间距 + float stepX = textWidth + 70; + float stepY = textHeight + 100; + + // 添加重复水印 + Integer two = 2; + for (float x = textWidth / two; x < width; x += stepX) { + for (float y = textHeight / two; y < height; y += stepY) { + content.beginText(); + content.showTextAligned( + Element.ALIGN_CENTER, + signText, + x, + y, + fontSize + ); + content.endText(); + } + } + } + + /** + * 添加页眉线 + * + * @param canvas + * @param pageWidth + * @param yPos + */ + private void addHeaderLine(PdfContentByte canvas, float pageWidth, float yPos) { + canvas.setLineWidth(0.5f); + canvas.lineTo(pageWidth, yPos); + canvas.stroke(); + } + } +} \ No newline at end of file From 36b2fe751f78773cc881764af7388cf6ae129559 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Sat, 28 Feb 2026 11:10:12 +0800 Subject: [PATCH 11/26] =?UTF-8?q?feat:=20[=E6=AD=A5=E9=AA=A4=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E6=AD=A5=E9=AA=A4=E7=BC=96=E5=8F=B7=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hxhq/business/controller/StepController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java index 46eafb6..f319675 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java @@ -3,6 +3,7 @@ package com.hxhq.business.controller; import java.util.Arrays; import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +57,14 @@ public class StepController extends BaseController @RequiresPermissions("business:step:list") public AjaxResult save(@RequestBody Step step) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("sn",step.getSn()); + if(step.getId()!=null){ + queryWrapper.ne("id",step.getId()); + } + if(stepService.count(queryWrapper)>0){ + return AjaxResult.error("编号已存在"); + } return toAjax(stepService.saveOrUpdate(step)); } From b1205e1bde221b9c6085240cd9876d00b03fb96b Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Sat, 28 Feb 2026 11:41:34 +0800 Subject: [PATCH 12/26] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?]=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/controller/GspController.java | 3 +- .../hxhq/business/controller/GyzjController.java | 3 +- .../hxhq/business/controller/MjyController.java | 3 +- .../controller/StudyFormFillController.java | 2 +- .../com/hxhq/business/utils/StudyFormFillUtil.java | 9 ++- .../com/hxhq/business/utils/pdf/PdfBaseUtil.java | 74 ++++++++++++---------- .../hxhq/business/utils/pdf/resource/Dosage.java | 9 +-- .../com/hxhq/business/utils/pdf/resource/Drug.java | 9 +-- .../hxhq/business/utils/pdf/resource/GspPdf.java | 9 +-- 9 files changed, 67 insertions(+), 54 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java index dce1d3b..db5916e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java @@ -58,7 +58,7 @@ public class GspController extends BaseController { */ @RequiresPermissions(value={"business:resource:mjy:xq","business:archive:mjy:xq"}, logical= Logical.OR) @GetMapping(value = "/exportDetail") - public AjaxResult exportDetail(Long id,String lang) { + public AjaxResult exportDetail(Long id,String lang,String version) { GspJcgj gspJcgj = new GspJcgj(); gspJcgj.setGspId(id); List jcgjList = gspJcgjService.queryList(gspJcgj); @@ -72,6 +72,7 @@ public class GspController extends BaseController { tzList, jcgjList, lang, + version, localFilePath)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java index ee429da..f6f80b9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java @@ -114,7 +114,7 @@ public class GyzjController extends BaseController */ @RequiresPermissions(value={"business:resource:gyzj:xq","business:archive:gyzj:xq"}, logical= Logical.OR) @GetMapping(value = "/exportDetail") - public AjaxResult exportDetail(Long id,String lang) { + public AjaxResult exportDetail(Long id,String lang,String version) { GyzjJcgj gyzjJcgj = new GyzjJcgj(); gyzjJcgj.setGyzjId(id); List gyzjJcgjList = gyzjJcgjService.queryList(gyzjJcgj); @@ -128,6 +128,7 @@ public class GyzjController extends BaseController gyzjTzList, gyzjJcgjList, lang, + version, localFilePath)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java index 1e1b3df..09a1312 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java @@ -105,7 +105,7 @@ public class MjyController extends BaseController { */ @RequiresPermissions(value={"business:resource:mjy:xq","business:archive:mjy:xq"}, logical= Logical.OR) @GetMapping(value = "/exportDetail") - public AjaxResult exportDetail(Long id,String lang) { + public AjaxResult exportDetail(Long id,String lang,String version) { MjyJcgj mjyJcgj = new MjyJcgj(); mjyJcgj.setMjyId(id); List mjyJcgjList = mjyJcgjService.queryList(mjyJcgj); @@ -119,6 +119,7 @@ public class MjyController extends BaseController { mjyTzList, mjyJcgjList, lang, + version, localFilePath)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java index 04232e0..4727f70 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java @@ -220,7 +220,7 @@ public class StudyFormFillController extends BaseController { fileUrl = fileUrl.replaceFirst(localFilePrefix, ""); int indexOf = fileUrl.lastIndexOf("/"); String path = fileUrl.substring(0, indexOf); - String exportFileName = StudyFormFillUtil.export(form.getVersion(),form.getLang(),study.getName() + "("+study.getSn()+")"+studyFormFill.getBdmc(), + String exportFileName = StudyFormFillUtil.export(form.getVersion(),form.getLang(),study.getName() + "("+study.getSn()+") "+studyFormFill.getBdmc(), localFilePath + fileUrl, localFilePath + File.separator + path,jcgjList,qmxxList); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java index 451bc7b..3401bea 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java @@ -108,9 +108,9 @@ public class StudyFormFillUtil { String sign = "hxhq"; LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null) { - sign = loginUser.getSysUser().getNickName() + " " + DateUtils.getTime(); + sign = loginUser.getSysUser().getNickName() + " " + DateUtils.getTime(); } - writer.setPageEvent(new TextHeaderEvent(sign+" "+version, headerText, false)); + writer.setPageEvent(new TextHeaderEvent(sign+" "+version+" ", headerText, false)); // 4. 设置PDF属性 document.addTitle("华西海圻"); document.addAuthor("华西海圻"); @@ -395,9 +395,12 @@ public class StudyFormFillUtil { // addRepeatedWatermark(content, width, height, signText); // 添加页眉文字 if (StringUtils.isNoneBlank(headerText)) { + float pageTextWidth1 = baseFont.getWidthPoint(headerText, footerFont.getSize()); + float startX1 = (document.getPageSize().getWidth() - pageTextWidth1) / 2; + PdfContentByte cb2 = writer.getDirectContent(); ColumnText.showTextAligned(cb2, Element.ALIGN_LEFT, - new Phrase(headerText, footerFont), startX, textY, 0); + new Phrase(headerText, footerFont), startX1, textY, 0); // canvas.beginText(); // canvas.setFontAndSize(baseFont, fontSize); // canvas.setTextMatrix(textX, textY); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java index bcdbf9d..516569e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java @@ -234,11 +234,11 @@ public class PdfBaseUtil { private String signText; private String headerText; private BaseFont baseFont; - private Boolean showHaderLine=true; + private Boolean showHaderLine = true; private int totalPages = 0; private PdfTemplate total; - public TextHeaderEvent(String signText, String headerText,Boolean showHaderLine) throws Exception { + public TextHeaderEvent(String signText, String headerText, Boolean showHaderLine) throws Exception { try { this.showHaderLine = showHaderLine; this.signText = signText; @@ -283,14 +283,14 @@ public class PdfBaseUtil { float pageHeight = pageSize.getHeight(); // 设置页眉参数 - float topMargin = 30; // 顶部边距 + float topMargin = 15; // 顶部边距 float fontSize = 12; // 字体大小 // 计算文字宽度(用于居中) float textWidth = baseFont.getWidthPoint(signText, fontSize); // 计算居中位置 - float textX = (pageWidth - textWidth) / 2; + float textX = (pageSize.getLeft() + pageSize.getRight()) / 2; float textY = pageHeight - topMargin; // 获取画布 @@ -300,7 +300,7 @@ public class PdfBaseUtil { float y = document.bottom() - 20; // 在每一页都重新计算,确保位置准确 - String pageText = "第 " + currentPage + " 页 / 共 "; + String pageText = signText+ " 第 " + currentPage + " 页 / 共 "; BaseFont baseFont = footerFont.getBaseFont(); // 计算页面文本宽度 @@ -326,38 +326,43 @@ public class PdfBaseUtil { ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, new Phrase(" 页", footerFont), startX + pageTextWidth + totalWidth, y, 0); - PdfContentByte content = writer.getDirectContentUnder(); // 在水印层添加 - - // 设置透明度 - PdfGState gs = new PdfGState(); - float opacity = Convert.toFloat("0.3"); - gs.setFillOpacity(opacity); - content.setGState(gs); - - // 设置字体和颜色 - content.setColorFill(BaseColor.RED); - content.setFontAndSize(baseFont, fontSize); - - float width = pageSize.getWidth(); - float height = pageSize.getHeight(); - - // 重复铺满水印 - addRepeatedWatermark(content, width, height, signText); - +// PdfContentByte content = writer.getDirectContentUnder(); // 在水印层添加 +// +// // 设置透明度 +// PdfGState gs = new PdfGState(); +// float opacity = Convert.toFloat("0.3"); +// gs.setFillOpacity(opacity); +// content.setGState(gs); +// +// // 设置字体和颜色 +// content.setColorFill(BaseColor.RED); +// content.setFontAndSize(baseFont, fontSize); +// +// float width = pageSize.getWidth(); +// float height = pageSize.getHeight(); +// +// // 重复铺满水印 +// addRepeatedWatermark(content, width, height, signText); // 添加页眉文字 - if(StringUtils.isNoneBlank(headerText)) { - canvas.beginText(); - canvas.setFontAndSize(baseFont, fontSize); - canvas.setTextMatrix(textX, textY); - canvas.showText(headerText); - canvas.endText(); - - if(showHaderLine){ + if (StringUtils.isNoneBlank(headerText)) { + float pageTextWidth1 = baseFont.getWidthPoint(headerText, footerFont.getSize()); + float startX1 = (document.getPageSize().getWidth() - pageTextWidth1) / 2; + + PdfContentByte cb2 = writer.getDirectContent(); + ColumnText.showTextAligned(cb2, Element.ALIGN_LEFT, + new Phrase(headerText, footerFont), startX1, textY, 0); +// canvas.beginText(); +// canvas.setFontAndSize(baseFont, fontSize); +// canvas.setTextMatrix(textX, textY); +// canvas.showText(headerText); +// canvas.endText(); + if (showHaderLine) { // 添加页眉分隔线(可选) addHeaderLine(canvas, pageWidth, textY - 10); } } + } catch (Exception e) { e.printStackTrace(); } @@ -374,7 +379,7 @@ public class PdfBaseUtil { private void addRepeatedWatermark(PdfContentByte content, float width, float height, String signText) { // 计算文字尺寸 float fontSize = Convert.toFloat("10"); - float textWidth = baseFont.getWidthPoint(signText, fontSize)+50; + float textWidth = baseFont.getWidthPoint(signText, fontSize) + 50; float textHeight = baseFont.getAscentPoint(signText, fontSize) - baseFont.getDescentPoint(signText, fontSize); @@ -383,7 +388,7 @@ public class PdfBaseUtil { float stepY = textHeight + 100; // 添加重复水印 - Integer two=2; + Integer two = 2; for (float x = textWidth / two; x < width; x += stepX) { for (float y = textHeight / two; y < height; y += stepY) { content.beginText(); @@ -408,8 +413,7 @@ public class PdfBaseUtil { */ private void addHeaderLine(PdfContentByte canvas, float pageWidth, float yPos) { canvas.setLineWidth(0.5f); - canvas.moveTo(50, yPos); - canvas.lineTo(pageWidth - 50, yPos); + canvas.lineTo(pageWidth, yPos); canvas.stroke(); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java index e418427..bd2dc15 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java @@ -37,7 +37,7 @@ public class Dosage { * @param gyzj * @return */ - public String exportDetail(DetailDto gyzj, List gyzjTzList, List gyzjJcgjList, String lang, String localFilePath) { + public String exportDetail(DetailDto gyzj, List gyzjTzList, List gyzjJcgjList, String lang, String version,String localFilePath) { language=lang; Document document = null; FileOutputStream fos = null; @@ -46,9 +46,9 @@ public class Dosage { String sign = "hxhq"; LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null) { - sign = loginUser.getSysUser().getNickName(); + sign = loginUser.getSysUser().getNickName() +" "+ PdfExportUtil.parseDateToStr(new Date()); } - document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("给药制剂详情"),false); + document = PdfBaseUtil.init(document, fos, filePath, sign +" "+version+" ", getName("给药制剂详情"),false); // 基本信息 PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); Map formData1 = new LinkedHashMap<>(); @@ -113,8 +113,9 @@ public class Dosage { String[] headers = {getName("使用人"),getName("领取/归还人/入库申请人"),getName("发放/接收人"),getName("操作类型"),getName("表单名称"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); cell.setBorderWidth(1); table.addCell(cell); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java index 39dac70..c80ae75 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java @@ -36,7 +36,7 @@ public class Drug { * @param mjy * @return */ - public String exportDetail(DetailDto mjy, List mjyTzList, List mjyJcgjList, String lang, String localFilePath) { + public String exportDetail(DetailDto mjy, List mjyTzList, List mjyJcgjList, String lang,String version, String localFilePath) { language=lang; Document document = null; FileOutputStream fos = null; @@ -45,9 +45,9 @@ public class Drug { String sign = "hxhq" ; LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null) { - sign = loginUser.getSysUser().getNickName(); + sign = loginUser.getSysUser().getNickName()+" "+ PdfExportUtil.parseDateToStr(new Date()); } - document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("麻精药详情"),false); + document = PdfBaseUtil.init(document, fos, filePath, sign +" "+version+" ", getName("麻精药详情"),false); // 基本信息 PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); Map formData1 = new LinkedHashMap<>(); @@ -112,8 +112,9 @@ public class Drug { String[] headers = {getName("使用人"),getName("领取/归还人"),getName("发放/接收人"),getName("操作类型"),getName("表单名称"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); cell.setBorderWidth(1); table.addCell(cell); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java index 212b1b4..145ca05 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/GspPdf.java @@ -38,7 +38,7 @@ public class GspPdf { * @param gsp * @return */ - public String exportDetail(GspDto gsp, List tzList, List jcgjList, String lang, String localFilePath) { + public String exportDetail(GspDto gsp, List tzList, List jcgjList, String lang,String version, String localFilePath) { language=lang; Document document = null; FileOutputStream fos = null; @@ -47,9 +47,9 @@ public class GspPdf { String sign = "hxhq"; LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null) { - sign = loginUser.getSysUser().getNickName(); + sign = loginUser.getSysUser().getNickName()+" "+ PdfExportUtil.parseDateToStr(new Date()); } - document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("给药制剂详情"),false); + document = PdfBaseUtil.init(document, fos, filePath, sign +" "+version+" ", getName("给药制剂详情"),false); // 基本信息 PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); Map formData1 = new LinkedHashMap<>(); @@ -106,8 +106,9 @@ public class GspPdf { String[] headers = {getName("使用人"),getName("领取/归还人/入库申请人"),getName("发放/接收人"),getName("操作类型"),getName("表单名称"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(8); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(BaseColor.WHITE); cell.setBorderWidth(1); table.addCell(cell); } From a09dd826498cb42bad973b0926ba27e02456c0e9 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Sat, 28 Feb 2026 16:30:33 +0800 Subject: [PATCH 13/26] =?UTF-8?q?feat:[=E8=B5=84=E6=BA=90=E5=BA=93?= =?UTF-8?q?=E7=AE=A1=E7=90=86][=E8=AF=95=E5=89=82=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/controller/SjController.java | 37 ++++ .../com/hxhq/business/utils/lang/SjJcnrUtil.java | 167 +++++++++++++++++ .../hxhq/business/utils/pdf/resource/SjPdf.java | 204 +++++++++++++++++++++ 3 files changed, 408 insertions(+) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/SjJcnrUtil.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/SjPdf.java diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java index b2f286f..ac5cf00 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java @@ -16,9 +16,12 @@ import com.hxhq.business.service.ISjTzService; import com.hxhq.business.service.ISjJcgjService; import com.hxhq.business.service.IStudySubjectService; import com.hxhq.business.utils.JctUtil; +import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import com.hxhq.common.core.web.controller.BaseController; @@ -45,6 +48,16 @@ public class SjController extends BaseController @Autowired private ISjTzService sjTzService; + /** + * 上传文件存储在本地的根路径 + */ + @Value("${file.path}") + private String localFilePath; + /** + * 资源映射路径 前缀 + */ + @Value("${file.prefix}") + public String localFilePrefix; /** * 试验物资列表 @@ -70,6 +83,30 @@ public class SjController extends BaseController } /** + * 导出 + */ + @RequiresPermissions(value={"business:resource:sj:xq","business:archive:sj:xq"}, logical= Logical.OR) + @GetMapping(value = "/exportDetail") + public AjaxResult exportDetail(Long id,String lang) { + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(id); + List sjJcgjList = sjJcgjService.queryList(sjJcgj); + + SjTz sjTz = new SjTz(); + sjTz.setSjId(id); + List sjTzList = sjTzService.queryList(sjTz); + return AjaxResult.success(localFilePrefix + PdfExportUtil.export( + "com.hxhq.business.utils.pdf.resource.SjPdf", + "exportDetail", + sjService.getInfo(id), + sjTzList, + sjJcgjList, + lang, + localFilePath)); + } + + + /** * 台账列表 */ @GetMapping("/tzList") diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/SjJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/SjJcnrUtil.java new file mode 100644 index 0000000..f528556 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/SjJcnrUtil.java @@ -0,0 +1,167 @@ +package com.hxhq.business.utils.lang; + +import com.hxhq.business.utils.JctUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author tanfei + */ +public class SjJcnrUtil { + private static final Logger logger = LoggerFactory.getLogger(SjJcnrUtil.class.getName()); + private static HashMap mapLang=new HashMap<>(); + static { + mapLang.put("入库","In Storage"); + mapLang.put("未入库","Not in Storage"); + mapLang.put("已发放","In Use"); + mapLang.put("已锁定","Locked"); + mapLang.put("待归档","Pending Archiving"); + mapLang.put("归档","Archived"); + mapLang.put("待解档","Pending De-archiving"); + mapLang.put("借阅开始时间","Checkout Start Date"); + mapLang.put("借阅结束时间","Checkout End Date"); + mapLang.put("处置","Dispose"); + mapLang.put("处置方式","Dispose Method"); + mapLang.put("处置原因","Reason"); + mapLang.put("处置量","Amount"); + mapLang.put("处置人","Operator"); + mapLang.put("使用","Usage"); + mapLang.put("配制完成","Configuration completed"); + mapLang.put("复核人","Reviewer"); + mapLang.put("监督人","Supervisor"); + mapLang.put("钥匙1领取人","Key 1 User"); + mapLang.put("钥匙2领取人","Key 2 User"); + mapLang.put("发放人","Issuer"); + mapLang.put("发放人2","Issuer 2"); + mapLang.put("出库量","Out Amount"); + mapLang.put("转移条件","Transfer Condition"); + mapLang.put("出库毛重","Check-out Gross Weight"); + mapLang.put("入库毛重","Check-in Gross Weight"); + mapLang.put("使用量","Usage Amount"); + mapLang.put("归还人1","Returner 1"); + mapLang.put("归还人2","Returner 2"); + mapLang.put("库管员1","Warehouse Keeper 1"); + mapLang.put("库管员2","Warehouse Keeper 2"); + mapLang.put("签名人1","Signed By 1"); + mapLang.put("签名人2","Signed By 2"); + mapLang.put("申请备注","Apply Comment"); + mapLang.put("审核备注","Approve Comment"); + mapLang.put("存储条件","Storage Condition"); + mapLang.put("存储位置","Storage Location"); + mapLang.put("有效周期","Validity Period"); + mapLang.put("使用人","User"); + mapLang.put("领取/归还人","Recipient/Returner"); + mapLang.put("发放/接收人","Issuer/Receiver"); + mapLang.put("操作类型","Action"); + mapLang.put("操作量","Amount"); + mapLang.put("备注/原因","Comment/Reason"); + mapLang.put("操作时间","Datetime"); + mapLang.put("名称","Name"); + mapLang.put("编号","ID"); + mapLang.put("浓度/含量/纯度","Concentration/Purity"); + mapLang.put("批号","Batch Num"); + mapLang.put("规格","Specification"); + mapLang.put("库存量","Amount"); + mapLang.put("来源","Source"); + mapLang.put("失效日期","Expiration"); + mapLang.put("配制日期","Formulation Date"); + mapLang.put("制剂状态","Status"); + mapLang.put("所属表单","In Record"); + mapLang.put("表单所属试验","From Study"); + mapLang.put("表单所属人","By User"); + mapLang.put("表单所属部门","Department"); + mapLang.put("基本信息","Information"); + mapLang.put("表单信息","Record Information"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("麻精药台账","Controlled Drug Table"); + mapLang.put("备注","Comment"); + mapLang.put("原因","Reason"); + mapLang.put("签名人","Signed By"); + + + + mapLang.put("申请解档","Apply for De-archiving"); + mapLang.put("申请借阅","Apply for Check-out"); + mapLang.put("申请归档","Apply for Archiving"); + mapLang.put("锁定麻精药","Lock Controlled Drug"); + mapLang.put("解锁麻精药","Unlock Controlled Drug"); + mapLang.put("处置药剂","Dispose Substance"); + mapLang.put("处置容器","Dispose Container"); + mapLang.put("钥匙发放","Issue Key"); + mapLang.put("申请编辑","Apply Edit"); + mapLang.put("同意编辑","Approve Edit"); + mapLang.put("拒绝编辑","Reject Edit"); + mapLang.put("修改库存申请","Apply Change Inventory"); + mapLang.put("同意修改库存","Approve Change Inventory"); + mapLang.put("拒绝修改库存","Reject Change Inventory"); + mapLang.put("归还","Return"); + mapLang.put("领取发放","Distribution"); + mapLang.put("存储","Storage"); + mapLang.put("取出","Take Out"); + mapLang.put("确认归还","Confirm Check-in"); + mapLang.put("到期自动归还","到期自动归还"); + + mapLang.put("表单名称","Preset Name"); + mapLang.put("锁定发放记录","Lock Record"); + mapLang.put("解锁发放记录","Unlock Record"); + mapLang.put("麻精药入库","Controlled Drug Check-in"); + mapLang.put("目的","Purpose"); + mapLang.put("麻精药详情","Controlled Drug Information"); + + mapLang.put("入库位置","Check-in Location"); + mapLang.put("入库条件","Check-in Condition"); + mapLang.put("同意归档","Approve Archiving"); + mapLang.put("拒绝归档","Reject Archiving"); + mapLang.put("同意解档","Approve De-archiving"); + mapLang.put("拒绝解档","Reject De-archiving"); + mapLang.put("同意借阅","Approve Check-out"); + mapLang.put("拒绝借阅","Reject Check-out"); + + } + + public static void main(String[] args) { + Map formData = new LinkedHashMap<>(); + formData.put("申请备注", "1111"); + formData.put("审核备注", "22"); + logger.info(getJcnrEn(formData)); + } + /** + * 获取英文 + * @param qmyy + * @return + */ + public static String getEn(String qmyy) { + return mapLang.get(qmyy); + } + + /** + * 获取稽查内容英文 + * @param map + * @return + */ + public static String getJcnrEn(Map map) { + Map result =new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + result.put(mapLang.get(entry.getKey()),entry.getValue()); + } + return JctUtil.formatStr(result); + } + + /** + * 获取稽查内容英文 + * @param map + * @return + */ + public static Map getMapEn(Map map) { + Map result =new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + result.put(mapLang.get(entry.getKey()),entry.getValue()); + } + return result; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/SjPdf.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/SjPdf.java new file mode 100644 index 0000000..caefb1c --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/SjPdf.java @@ -0,0 +1,204 @@ +package com.hxhq.business.utils.pdf.resource; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.hxhq.business.domain.*; +import com.hxhq.business.dto.gsp.GspDto; +import com.hxhq.business.dto.sj.SjListDto; +import com.hxhq.business.enums.zykgl.ZjztEnum; +import com.hxhq.business.utils.lang.GyzjJcnrUtil; +import com.hxhq.business.utils.lang.SjJcnrUtil; +import com.hxhq.business.utils.pdf.PdfBaseUtil; +import com.hxhq.business.utils.pdf.PdfExportUtil; +import com.hxhq.common.core.utils.StringUtils; +import com.hxhq.common.security.utils.SecurityUtils; +import com.hxhq.system.api.model.LoginUser; +import com.itextpdf.text.*; +import com.itextpdf.text.pdf.BaseFont; +import com.itextpdf.text.pdf.PdfPCell; +import com.itextpdf.text.pdf.PdfPTable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import java.util.*; + +/** + * 试剂pdf导出详情 + * + * @author HanLong + */ +public class SjPdf { + private static final Logger logger = LoggerFactory.getLogger(SjPdf.class.getName()); + public String language="zh"; + /** + * 导出 + * + * @param sj + * @return + */ + public String exportDetail(SjListDto sj, List tzList, List jcgjList, String lang, String localFilePath) { + language=lang; + Document document = null; + FileOutputStream fos = null; + String filePath = PdfBaseUtil.getFilePath(localFilePath,"Sj"); + try { + String sign = "hxhq"; + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + sign = loginUser.getSysUser().getNickName(); + } + document = PdfBaseUtil.init(document, fos, filePath, sign + PdfExportUtil.parseDateToStr(new Date()), getName("给药制剂详情"),false); + // 基本信息 + PdfBaseUtil.addUnderlinedTitle(document, getName("基本信息"), 10, true); + Map formData1 = new LinkedHashMap<>(); + formData1.put(getName("名称"), sj.getMc()); + formData1.put(getName("编号"), sj.getBh()); + formData1.put(getName("批号"), sj.getPh()); + formData1.put(getName("规格"), sj.getGg()); + formData1.put(getName("浓度"), sj.getNd() + sj.getNddw()); + formData1.put(getName("库存量"), sj.getKc() + sj.getKcdw()); + formData1.put(getName("来源"), sj.getLy()); + formData1.put(getName("存储条件"), sj.getCctj()); + formData1.put(getName("存储位置"), sj.getCcwz()); + formData1.put(getName("有效周期"), sj.getYxzq() + sj.getYxzqdw()); + formData1.put(getName("失效日"), PdfExportUtil.parseDateToStr(sj.getSxr())); + formData1.put(getName("配制日期"), PdfExportUtil.parseDateToStr(sj.getPzrq())); + PdfBaseUtil.addFormTableColumns(document, formData1, 2); + // 表单信息 + PdfBaseUtil.addUnderlinedTitle(document, getName("表单信息"), 10, true); + Map formData3 = new LinkedHashMap<>(); + formData3.put(getName("所属表单"), sj.getFormName()); + formData3.put(getName("表单所属试验"), sj.getStudyName()); + formData3.put(getName("表单所属人"), sj.getFormUserName()); + formData3.put(getName("表单所属部门"), sj.getDeptName()); + PdfBaseUtil.addFormTableColumns(document, formData3, 2); + PdfBaseUtil.addUnderlinedTitle(document, getName("试剂台账") , 10, true); + // 台账 + addTz(document, tzList, lang); + PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹") , 10, true); + //稽查轨迹 + addJcgj(document, jcgjList, lang); + logger.info("生成成功:{}", filePath); + } catch (Exception e) { + logger.error("生成失败", e); + throw new RuntimeException("生成失败: " + e.getMessage()); + } finally { + if (document != null) { + document.close(); + } + if (fos != null) { + try { + fos.close(); + } catch (IOException e) { + logger.error("关闭文件流失败", e); + } + } + } + return filePath; + } + + /** + * 台账 + * + * @param document + * @param tzList + * @throws IOException + * @throws DocumentException + */ + public void addTz(Document document, List tzList, String lang) throws IOException, DocumentException { + + // 9. 表头 + BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); + Font headerFont = new Font(bfChinese, 8, Font.NORMAL); + Font contentFont = new Font(bfChinese, 8, Font.NORMAL); + // 8. 创建表格 + PdfPTable table = new PdfPTable(8); + table.setWidthPercentage(100); + String[] headers = {getName("签名人"),getName("操作类型"),getName("操作量"),getName("备注/原因"),getName("操作时间")}; + for (String header : headers) { + PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setPadding(8); + cell.setBorderWidth(1); + table.addCell(cell); + } + int rowNum = 0; + for (SjTz sjTz : tzList) { + // 交替行颜色 + if (rowNum % 2 == 0) { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } else { + table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); + } + table.addCell(PdfBaseUtil.createCell(sjTz.getQmrMc(), contentFont)); + table.addCell(PdfBaseUtil.createCell(sjTz.getQmyy(), contentFont)); + table.addCell(PdfBaseUtil.createCell(sjTz.getCzl() + sjTz.getCzldw(), contentFont)); + table.addCell(PdfBaseUtil.createCell(sjTz.getRemark(), contentFont)); + table.addCell(PdfBaseUtil.createCell(PdfExportUtil.parseDateToStr(sjTz.getCreateTime()), contentFont)); + rowNum++; + } + document.add(table); + } + + /** + * 稽查轨迹 + * + * @param document + * @param jcgjList + * @throws IOException + * @throws DocumentException + */ + public void addJcgj(Document document, List jcgjList, String lang) throws IOException, DocumentException { + for (SjJcgj jcgj : jcgjList) { + StringJoiner result = new StringJoiner(", "); + if ("en".equals(lang)) { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime())+ " " + jcgj.getJcmcEn(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnrEn())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnrEn()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value")!=null? node.get("value").asText():""; + result.add(name + ":" + value); + } + } + } + } else { + PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime())+ " " + jcgj.getJcmc(), 10, false); + if (StringUtils.isNoneBlank(jcgj.getJcnr())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value =node.get("value")!=null? node.get("value").asText():""; + result.add(name + ":" + value); + } + } + } + } + if (StringUtils.isNoneBlank(jcgj.getRemark())) { + result.add(getName("备注")+":" + jcgj.getRemark()); + } + if (StringUtils.isNoneBlank(jcgj.getQmrMc())) { + result.add(getName("签名人")+":" + jcgj.getQmrMc()); + } + PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); + } + } + + /** + * 获取名称 + * @param name + * @return + */ + public String getName(String name){ + return "en".equals(language) ? SjJcnrUtil.getEn(name) : name; + } + + +} From a916b35d26688206781a1451c092b22186ba7fc1 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Mon, 2 Mar 2026 13:40:43 +0800 Subject: [PATCH 14/26] =?UTF-8?q?feat:[=E8=AF=95=E9=AA=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E8=AF=95=E9=AA=8C=E6=96=B9=E6=B3=95]=E7=A8=BD?= =?UTF-8?q?=E6=9F=A5=E8=BD=A8=E8=BF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/domain/StudyMethodJcgj.java | 149 +++++++++++++++++++++ .../business/mapper/StudyMethodJcgjMapper.java | 14 ++ .../business/service/IStudyMethodJcgjService.java | 39 ++++++ .../service/impl/StudyMethodJcgjServiceImpl.java | 63 +++++++++ .../service/impl/StudyMethodServiceImpl.java | 36 ++++- .../resources/mapper/StudyMethodJcgjMapper.xml | 6 + 6 files changed, 303 insertions(+), 4 deletions(-) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMethodJcgj.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodJcgjMapper.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodJcgjService.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java create mode 100644 hxhq-modules/hxhq-system/src/main/resources/mapper/StudyMethodJcgjMapper.xml diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMethodJcgj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMethodJcgj.java new file mode 100644 index 0000000..92d1304 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMethodJcgj.java @@ -0,0 +1,149 @@ +package com.hxhq.business.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.hxhq.common.core.domain.MpBaseEntity; + + +/** + * 试验-试验方法-稽查轨迹对象 t_study_method_jcgj + * + * @author hxhq + * @date 2026-03-02 + */ +@TableName("t_study_method_jcgj") +public class StudyMethodJcgj extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 试验方法id */ + private Long studyMethodId; + + /** 稽查轨迹类型:1:流程;3:编辑 */ + private Integer jcgjlx; + + /** 稽查名称 */ + private String jcmc; + + /** 稽查名称-英文 */ + private String jcmcEn; + + /** 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 */ + private Integer jcmcys; + + /** 稽查内容 */ + private String jcnr; + + /** 稽查内容-英文 */ + private String jcnrEn; + + /** 签名人id */ + private Long qmrId; + + /** 签名人名称 */ + private String qmrMc; + + /** 签名人名称-英文 */ + private String qmrMcEn; + + + public void setStudyMethodId(Long studyMethodId) + { + this.studyMethodId = studyMethodId; + } + + public Long getStudyMethodId() + { + return studyMethodId; + } + + public void setJcgjlx(Integer jcgjlx) + { + this.jcgjlx = jcgjlx; + } + + public Integer getJcgjlx() + { + return jcgjlx; + } + + public void setJcmc(String jcmc) + { + this.jcmc = jcmc; + } + + public String getJcmc() + { + return jcmc; + } + + public void setJcmcEn(String jcmcEn) + { + this.jcmcEn = jcmcEn; + } + + public String getJcmcEn() + { + return jcmcEn; + } + + public void setJcmcys(Integer jcmcys) + { + this.jcmcys = jcmcys; + } + + public Integer getJcmcys() + { + return jcmcys; + } + + public void setJcnr(String jcnr) + { + this.jcnr = jcnr; + } + + public String getJcnr() + { + return jcnr; + } + + public void setJcnrEn(String jcnrEn) + { + this.jcnrEn = jcnrEn; + } + + public String getJcnrEn() + { + return jcnrEn; + } + + public void setQmrId(Long qmrId) + { + this.qmrId = qmrId; + } + + public Long getQmrId() + { + return qmrId; + } + + public void setQmrMc(String qmrMc) + { + this.qmrMc = qmrMc; + } + + public String getQmrMc() + { + return qmrMc; + } + + public void setQmrMcEn(String qmrMcEn) + { + this.qmrMcEn = qmrMcEn; + } + + public String getQmrMcEn() + { + return qmrMcEn; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodJcgjMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodJcgjMapper.java new file mode 100644 index 0000000..598b47d --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMethodJcgjMapper.java @@ -0,0 +1,14 @@ +package com.hxhq.business.mapper; + +import com.hxhq.business.domain.StudyMethodJcgj; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +/** + * 试验-试验方法-稽查轨迹Mapper接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface StudyMethodJcgjMapper extends BaseMapper +{ + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodJcgjService.java new file mode 100644 index 0000000..5c80532 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodJcgjService.java @@ -0,0 +1,39 @@ +package com.hxhq.business.service; + +import java.util.List; + +import com.hxhq.business.domain.Sj; +import com.hxhq.business.domain.StudyMethod; +import com.hxhq.business.domain.StudyMethodJcgj; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.system.api.domain.SysUser; + +/** + * 试验-试验方法-稽查轨迹Service接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface IStudyMethodJcgjService extends IService +{ + /** + * 查询试验-试验方法-稽查轨迹列表 + * + * @param studMethodJcgj 试验-试验方法-稽查轨迹 + * @return 试验-试验方法-稽查轨迹集合 + */ + public List queryList(StudyMethodJcgj studMethodJcgj); + + /** + * 保存稽查轨迹 + * @param studyMethod 试验方法 + * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 + * @param jcmc 稽查名称 + * @param jcmcEn 稽查名称-英文 + * @param jcmcys 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 + * @param jcnr 稽查内容 + * @param jcnrEn 稽查内容-英文 + * @param qmr 签名人信息 + */ + void saveJcgj(StudyMethod studyMethod, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java new file mode 100644 index 0000000..ed0d947 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java @@ -0,0 +1,63 @@ +package com.hxhq.business.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hxhq.business.domain.StudyMethod; +import com.hxhq.business.service.ISystemLogService; +import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.system.api.domain.SysUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.StudyMethodJcgjMapper; +import com.hxhq.business.domain.StudyMethodJcgj; +import com.hxhq.business.service.IStudyMethodJcgjService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 试验-试验方法-稽查轨迹Service业务层处理 + * + * @author hxhq + * @date 2026-03-02 + */ +@Service +public class StudyMethodJcgjServiceImpl extends ServiceImpl implements IStudyMethodJcgjService +{ + + @Autowired + private ISystemLogService systemLogService; + + /** + * 查询试验-试验方法-稽查轨迹列表 + * + * @param studyMethodJcgj 试验-试验方法-稽查轨迹 + * @return 试验-试验方法-稽查轨迹 + */ + @Override + public List queryList(StudyMethodJcgj studyMethodJcgj) + { + QueryWrapper queryWrapper = Wrappers.query(); + return this.list(queryWrapper); + } + + @Override + public void saveJcgj(StudyMethod studyMethod, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr) { + StudyMethodJcgj studyMethodJcgj = new StudyMethodJcgj(); + studyMethodJcgj.setStudyMethodId(studyMethod.getId()); + studyMethodJcgj.setJcgjlx(jcgjlx); + studyMethodJcgj.setJcmc(jcmc); + studyMethodJcgj.setJcmcEn(jcmcEn); + studyMethodJcgj.setJcmcys(jcmcys); + studyMethodJcgj.setJcnr(jcnr); + studyMethodJcgj.setJcnrEn(jcnrEn); + studyMethodJcgj.setQmrId(qmr.getUserId()); + studyMethodJcgj.setQmrMc(qmr.getNickName()); + studyMethodJcgj.setQmrMcEn(qmr.getUserName()); + this.save(studyMethodJcgj); + + systemLogService.saveInfo(studyMethod.getFfmc(), studyMethod.getFfmc(), studyMethodJcgj.getJcmc(), studyMethodJcgj.getJcmcEn(), + studyMethodJcgj.getJcnr(), studyMethodJcgj.getJcnrEn(), studyMethodJcgj.getQmrId(), studyMethodJcgj.getQmrMc(), studyMethodJcgj.getQmrMcEn(), studyMethodJcgj.getRemark()); + } + + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java index ef89e5f..382a87e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java @@ -1,7 +1,9 @@ package com.hxhq.business.service.impl; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import com.alibaba.fastjson2.JSONObject; @@ -15,10 +17,13 @@ import com.hxhq.business.dto.select.DeptUserTreeDto; import com.hxhq.business.enums.NormalEnum; import com.hxhq.business.enums.study.StudyMethodStatusEnum; import com.hxhq.business.enums.study.StudyTypeEnum; +import com.hxhq.business.enums.zykgl.JcgjlxEnum; +import com.hxhq.business.enums.zykgl.JcmcysEnum; import com.hxhq.business.form.study.StudyMethodForm; import com.hxhq.business.form.study.StudyMethodReadForm; import com.hxhq.business.form.study.StudyMethodSearchForm; import com.hxhq.business.service.*; +import com.hxhq.business.utils.JctUtil; import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.web.domain.AjaxResult; import com.hxhq.common.security.utils.SecurityUtils; @@ -54,6 +59,9 @@ public class StudyMethodServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + studyMethodJcgjService.saveJcgj(studyMethod, JcgjlxEnum.lc.getValue(), "上传方法", "Upload Method", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } @@ -170,8 +184,14 @@ public class StudyMethodServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + studyMethodJcgjService.saveJcgj(studyMethod, JcgjlxEnum.lc.getValue(), "阅读方法", "Read Method", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } @Override @@ -224,6 +244,14 @@ public class StudyMethodServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + studyMethodJcgjService.saveJcgj(studyMethod, JcgjlxEnum.lc.getValue(), "关闭方法", "Close Method", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } } diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/StudyMethodJcgjMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/StudyMethodJcgjMapper.xml new file mode 100644 index 0000000..5bee43c --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/StudyMethodJcgjMapper.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file From 230328e4ae204a6d4cb5ee1603296dc4ad3e0ebd Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Mon, 2 Mar 2026 15:00:48 +0800 Subject: [PATCH 15/26] =?UTF-8?q?fix:=20[=E8=AF=95=E9=AA=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E6=9F=A5=E8=AF=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java | 6 +++--- .../java/com/hxhq/business/controller/SystemLogController.java | 4 ++-- .../java/com/hxhq/business/service/impl/StudyServiceImpl.java | 2 +- .../java/com/hxhq/system/controller/SysDictDataController.java | 3 ++- .../com/hxhq/system/controller/SysLogininforController.java | 4 ++-- .../java/com/hxhq/system/controller/SysRoleController.java | 2 +- .../java/com/hxhq/system/controller/SysUserController.java | 2 +- .../java/com/hxhq/system/service/impl/SysMenuServiceImpl.java | 3 ++- .../java/com/hxhq/system/service/impl/SysUserServiceImpl.java | 10 ---------- 9 files changed, 14 insertions(+), 22 deletions(-) diff --git a/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java b/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java index 339886d..523f666 100644 --- a/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java +++ b/hxhq-common/hxhq-common-core/src/main/java/com/hxhq/common/core/utils/poi/ExcelUtil.java @@ -259,7 +259,7 @@ public class ExcelUtil if (Collection.class.isAssignableFrom(field.getType())) { Cell cell = subRow.createCell(column); - cell.setCellValue(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?attr.name():attr.nameEn()); + cell.setCellValue("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?attr.name():attr.nameEn()); cell.setCellStyle(cellStyle); int subFieldSize = subFieldsMap != null ? subFieldsMap.get(field.getName()).size() : 0; if (subFieldSize > 1) @@ -272,7 +272,7 @@ public class ExcelUtil else { Cell cell = subRow.createCell(column++); - cell.setCellValue(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?attr.name():attr.nameEn()); + cell.setCellValue("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?attr.name():attr.nameEn()); cell.setCellStyle(cellStyle); } } @@ -844,7 +844,7 @@ public class ExcelUtil // 创建列 Cell cell = row.createCell(column); // 写入列信息 - cell.setCellValue(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?attr.name():attr.nameEn()); + cell.setCellValue("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?attr.name():attr.nameEn()); setDataValidation(attr, row, column); cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); if (isSubList()) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java index 2d42cd4..040f829 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java @@ -71,9 +71,9 @@ public class SystemLogController extends BaseController List list = systemLogService.queryList(form); for(SystemLog l : list){ l.setCzsj(DateUtils.parseDateToStr(l.getCreateTime()==null?"": DateUtils.YYYY_MM_DD_HH_MM_SS,l.getCreateTime())); - l.setCzlx(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?l.getJcmc():l.getJcmcEn()); + l.setCzlx("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?l.getJcmc():l.getJcmcEn()); String czxq = ""; - if(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")){ + if("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))){ try{ JSONArray jsonArray = JSONArray.parseArray(l.getJcnr()); for(int i=0;i implements queryWrapper.like("s.sn",form.getSn()); } if(StringUtils.isNoneBlank(form.getLeaderName())){ - queryWrapper.like("u.nick_name",form.getLeaderName()); + queryWrapper.like("s.`leader_name`",form.getLeaderName()); } if (StringUtils.isNoneBlank(form.getStartDate())) { queryWrapper.ge("s.create_time", form.getStartDate()); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java index c5b5910..69f9a18 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java @@ -61,7 +61,8 @@ public class SysDictDataController extends BaseController @GetMapping("/list") public TableDataInfo list(SysDictData dictData) { - if(StringUtils.equals(dictData.getDictType(), "business_ccwz")) { + String ccwz = "business_ccwz"; + if(StringUtils.equals(dictData.getDictType(),ccwz)) { YqSearchForm form = new YqSearchForm(); List superiorAndSubordinate = sysDeptService.getSuperiorAndSubordinate(SecurityUtils.getLoginUser().getSysUser().getDeptId()); List deptIdList = superiorAndSubordinate.stream().map(SysDept::getDeptId).collect(Collectors.toList()); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java index 0fd5f4f..0da649d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysLogininforController.java @@ -70,9 +70,9 @@ public class SysLogininforController extends BaseController for(SysLogininfor l:list){ SystemLog systemLog = new SystemLog(); systemLog.setQmrMc(l.getNickName()); - systemLog.setCzlx(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"登录":"Login"); + systemLog.setCzlx("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"登录":"Login"); systemLog.setCzsj(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,l.getAccessTime())); - systemLog.setCzxq(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?l.getMsg():l.getMsgEn()); + systemLog.setCzxq("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?l.getMsg():l.getMsgEn()); logList.add(systemLog); } ExcelUtil util = new ExcelUtil(SystemLog.class); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java index b7bb82e..990c2f6 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysRoleController.java @@ -81,7 +81,7 @@ public class SysRoleController extends BaseController { List list = roleService.selectRoleList(role); for(SysRole l : list){ - l.setStatusText("0".endsWith(l.getStatus())?(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"启用":"Enabled"):(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"禁用":"Disabled")); + l.setStatusText("0".endsWith(l.getStatus())?("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"启用":"Enabled"):("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"禁用":"Disabled")); } ExcelUtil util = new ExcelUtil(SysRole.class); util.exportExcel(response, list, "角色数据"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java index a0ce4a9..34e3509 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java @@ -118,7 +118,7 @@ public class SysUserController extends BaseController exportDto.setDeptName(u.getDept()==null?"":u.getDept().getDeptName()); exportDto.setRoleName(getRoleName(u.getRoles())); - exportDto.setStatus("0".endsWith(u.getStatus())?(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"启用":"Enabled"):(ServletUtils.getRequest().getHeader("lang").equals("zh_CN")?"禁用":"Disabled")); + exportDto.setStatus("0".endsWith(u.getStatus())?("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"启用":"Enabled"):("zh_CN".equals(ServletUtils.getRequest().getHeader("lang"))?"禁用":"Disabled")); userList.add(exportDto); } ExcelUtil util = new ExcelUtil(UserExportDto.class); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java index 0851c13..7ca3cb4 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysMenuServiceImpl.java @@ -635,7 +635,8 @@ public class SysMenuServiceImpl implements ISysMenuService if(menus!=null && menus.size()>0){ SysMenu firstMenu = menus.get(0); urlList.add(firstMenu.getPath()); - if(!firstMenu.getMenuType().equals("C")){ + String menu = "C"; + if(!menu.equals(firstMenu.getMenuType())){ urlList = getChildUrl(urlList,firstMenu.getChildren()); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java index ba75016..35adece 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java @@ -647,9 +647,7 @@ public class SysUserServiceImpl implements ISysUserService private List getModifyLogList(SysUser info, SignForm sign){ SysUser old = selectUserById(info.getUserId()); List oldRoleIdList = roleMapper.selectRoleListByUserId(info.getUserId()); - List list = new ArrayList<>(); - List fieldChanges = ObjectCompareUtil.compareObjects(old, info); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { SystemLog log = getLogInfo(old); @@ -672,7 +670,6 @@ public class SysUserServiceImpl implements ISysUserService log.setJcnrEn("[{\"name\":\"Field\",\"value\":\"Department\"},{\"name\":\"Old Value\",\"value\":\""+oldDept.getDeptName()+"\"},{\"name\":\"New Value\",\"value\":\""+newDept.getDeptName()+"\"}]"); list.add(log); } - //判断菜单修改 Boolean updateRole = false; if(info.getRoleIds().length!=oldRoleIdList.size()){ @@ -687,9 +684,7 @@ public class SysUserServiceImpl implements ISysUserService } if(updateRole){ checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false); - List allRoleList = roleMapper.selectRoleList(new SysRole()); - List oldRoleList = new ArrayList<>(); List newRoleList = new ArrayList<>(); if(info.getRoleIds()!=null && info.getRoleIds().length>0){ @@ -702,10 +697,8 @@ public class SysUserServiceImpl implements ISysUserService oldRoleList.add(allRoleList.stream().filter(o->o.getRoleId().equals(oldRoleId)).collect(Collectors.toList()).get(0)); } } - List oldRoleNameList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); List bghList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); - List addNameList = new ArrayList<>(); List deleteNameList = new ArrayList<>(); for(SysRole newRole : newRoleList){ @@ -714,7 +707,6 @@ public class SysUserServiceImpl implements ISysUserService bghList.add(newRole.getRoleName()); } } - List newMenuIdList = Arrays.asList(info.getRoleIds()); for(SysRole oldRole : oldRoleList){ if(!newMenuIdList.contains(oldRole.getRoleId())){ @@ -722,7 +714,6 @@ public class SysUserServiceImpl implements ISysUserService bghList.remove(oldRole.getRoleName()); } } - if(addNameList.size()>0 || deleteNameList.size()>0){ SystemLog log = getLogInfo(old); log.setJcnr((addNameList.size()>0?("新增角色:"+String.join(",",addNameList)):"")+(deleteNameList.size()>0?(";删除角色:"+String.join(",",deleteNameList)):"")+(StringUtils.isBlank(sign.getRemark())?"":";备注:"+sign.getRemark())); @@ -731,7 +722,6 @@ public class SysUserServiceImpl implements ISysUserService } roleChangeService.saveInfo(info.getUserId(),String.join(",",oldRoleNameList),String.join(",",bghList),sign.getRemark()); } - return list; } From 9a726c65636e402fb82b72a162600d2976c48d10 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Mon, 2 Mar 2026 17:14:47 +0800 Subject: [PATCH 16/26] =?UTF-8?q?feat:[=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E5=AD=98=E5=82=A8=E4=BD=8D=E7=BD=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StorageLocationController.java | 69 +++++++++++++ .../com/hxhq/business/domain/StorageLocation.java | 108 +++++++++++++++++++++ .../business/mapper/StorageLocationMapper.java | 25 +++++ .../business/service/IStorageLocationService.java | 23 +++++ .../service/impl/StorageLocationServiceImpl.java | 49 ++++++++++ .../mapper/business/StorageLocationMapper.xml | 16 +++ 6 files changed, 290 insertions(+) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java create mode 100644 hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java new file mode 100644 index 0000000..c606b62 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java @@ -0,0 +1,69 @@ +package com.hxhq.business.controller; + +import java.util.Arrays; +import java.util.List; + +import com.hxhq.common.security.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.hxhq.business.domain.StorageLocation; +import com.hxhq.business.service.IStorageLocationService; +import com.hxhq.common.core.web.controller.BaseController; +import com.hxhq.common.core.web.domain.AjaxResult; +import com.hxhq.common.core.web.page.TableDataInfo; + + +/** + * 存储位置Controller + * + * @author hxhq + * @date 2026-03-02 + */ +@RestController +@RequestMapping("/business/storageLocation") +public class StorageLocationController extends BaseController +{ + @Autowired + private IStorageLocationService storageLocationService; + + /** + * 查询存储位置列表 + */ + @GetMapping("/list") + @RequiresPermissions("business:storageLocation:list") + public TableDataInfo list(StorageLocation storageLocation) + { + startPage(); + List list = storageLocationService.queryList(storageLocation); + return getDataTable(list); + } + + /** + * 获取存储位置详细信息 + */ + @GetMapping(value = "/info") + public AjaxResult getInfo(Long id) + { + return AjaxResult.success(storageLocationService.getById(id)); + } + + /** + * 新增存储位置信息 + */ + @PostMapping("/save") + @RequiresPermissions("business:storageLocation:add") + public AjaxResult save(@RequestBody StorageLocation storageLocation) + { + return toAjax(storageLocationService.saveOrUpdate(storageLocation)); + } + + /** + * 新增存储位置信息 + */ + @PostMapping("/edit") + @RequiresPermissions("business:storageLocation:edit") + public AjaxResult edit(@RequestBody StorageLocation storageLocation) + { + return toAjax(storageLocationService.saveOrUpdate(storageLocation)); + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java new file mode 100644 index 0000000..b718d51 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java @@ -0,0 +1,108 @@ +package com.hxhq.business.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.hxhq.common.core.domain.MpBaseEntity; + + +/** + * 存储位置对象 t_storage_location + * + * @author hxhq + * @date 2026-03-02 + */ +@TableName("t_storage_location") +public class StorageLocation extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 放置地点 */ + private String location; + + /** 设备名称或编号 */ + private String name; + + /** 放置货架 */ + private String shelfPlacement; + + /** 温层 */ + private String compartment; + + /** 部门id */ + private Long deptId; + + /** 状态 1-禁用 10-启用 */ + private Integer status; + + @TableField(exist = false) + private String deptName; + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public void setLocation(String location) + { + this.location = location; + } + + public String getLocation() + { + return location; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void setShelfPlacement(String shelfPlacement) + { + this.shelfPlacement = shelfPlacement; + } + + public String getShelfPlacement() + { + return shelfPlacement; + } + + public void setCompartment(String compartment) + { + this.compartment = compartment; + } + + public String getCompartment() + { + return compartment; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java new file mode 100644 index 0000000..1c2c553 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java @@ -0,0 +1,25 @@ +package com.hxhq.business.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.hxhq.business.domain.Bacteria; +import com.hxhq.business.domain.StorageLocation; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 存储位置Mapper接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface StorageLocationMapper extends BaseMapper +{ + /** + * 列表 + * @param queryWrapper + * @return + */ + List queryList(@Param("ew") Wrapper queryWrapper); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java new file mode 100644 index 0000000..1d8e4b4 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java @@ -0,0 +1,23 @@ +package com.hxhq.business.service; + +import java.util.List; +import com.hxhq.business.domain.StorageLocation; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 存储位置Service接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface IStorageLocationService extends IService +{ + /** + * 查询存储位置列表 + * + * @param storageLocation 存储位置 + * @return 存储位置集合 + */ + public List queryList(StorageLocation storageLocation); + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java new file mode 100644 index 0000000..182a2c2 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java @@ -0,0 +1,49 @@ +package com.hxhq.business.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; + import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.common.core.utils.StringUtils; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.StorageLocationMapper; +import com.hxhq.business.domain.StorageLocation; +import com.hxhq.business.service.IStorageLocationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 存储位置Service业务层处理 + * + * @author hxhq + * @date 2026-03-02 + */ +@Service +public class StorageLocationServiceImpl extends ServiceImpl implements IStorageLocationService +{ + /** + * 查询存储位置列表 + * + * @param form 存储位置 + * @return 存储位置 + */ + @Override + public List queryList(StorageLocation form) + { + QueryWrapper queryWrapper = Wrappers.query(); + queryWrapper.eq("s.del_flag", 0); + if(StringUtils.isNotEmpty(form.getName())) { + queryWrapper.like("s.name", form.getName()); + } + if(StringUtils.isNotEmpty(form.getLocation())) { + queryWrapper.like("s.location", form.getLocation()); + } + if(StringUtils.isNotEmpty(form.getShelfPlacement())) { + queryWrapper.like("s.shelf_placement", form.getShelfPlacement()); + } + if(form.getStatus() != null) { + queryWrapper.eq("s.status", form.getStatus()); + } + return baseMapper.queryList(queryWrapper); + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml new file mode 100644 index 0000000..a3871ec --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file From 94bb517ca948494e342dadd24386cb8a51be8b73 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Mon, 2 Mar 2026 17:31:18 +0800 Subject: [PATCH 17/26] =?UTF-8?q?feat:[=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E5=AD=98=E5=82=A8=E4=BD=8D=E7=BD=AE=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=99=A8]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StorageLocationController.java | 5 +- .../com/hxhq/business/domain/StorageLocation.java | 11 +++ .../form/yq/StorageLocationSearchForm.java | 92 ++++++++++++++++++++++ .../business/service/IStorageLocationService.java | 5 +- .../service/impl/StorageLocationServiceImpl.java | 9 ++- .../system/controller/SysDictDataController.java | 11 ++- .../mapper/business/StorageLocationMapper.xml | 2 +- 7 files changed, 124 insertions(+), 11 deletions(-) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/StorageLocationSearchForm.java diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java index c606b62..0066d19 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java @@ -3,6 +3,7 @@ package com.hxhq.business.controller; import java.util.Arrays; import java.util.List; +import com.hxhq.business.form.yq.StorageLocationSearchForm; import com.hxhq.common.security.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -31,10 +32,10 @@ public class StorageLocationController extends BaseController */ @GetMapping("/list") @RequiresPermissions("business:storageLocation:list") - public TableDataInfo list(StorageLocation storageLocation) + public TableDataInfo list(StorageLocationSearchForm form) { startPage(); - List list = storageLocationService.queryList(storageLocation); + List list = storageLocationService.queryList(form); return getDataTable(list); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java index b718d51..04ff765 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java @@ -37,6 +37,17 @@ public class StorageLocation extends MpBaseEntity @TableField(exist = false) private String deptName; + @TableField(exist = false) + private String wc; + + public String getWc() { + return wc; + } + + public void setWc(String wc) { + this.wc = wc; + } + public String getDeptName() { return deptName; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/StorageLocationSearchForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/StorageLocationSearchForm.java new file mode 100644 index 0000000..5070203 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/StorageLocationSearchForm.java @@ -0,0 +1,92 @@ +package com.hxhq.business.form.yq; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hxhq.common.core.annotation.Excel; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author hanlong + */ +public class StorageLocationSearchForm { + + /** 放置地点 */ + private String location; + + /** 设备名称或编号 */ + private String name; + + /** 放置货架 */ + private String shelfPlacement; + + /** 温层 */ + private String compartment; + + /** 部门id */ + private Long deptId; + + /** 状态 1-禁用 10-启用 */ + private Integer status; + + private List deptIdList; + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getShelfPlacement() { + return shelfPlacement; + } + + public void setShelfPlacement(String shelfPlacement) { + this.shelfPlacement = shelfPlacement; + } + + public String getCompartment() { + return compartment; + } + + public void setCompartment(String compartment) { + this.compartment = compartment; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public List getDeptIdList() { + return deptIdList; + } + + public void setDeptIdList(List deptIdList) { + this.deptIdList = deptIdList; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java index 1d8e4b4..d71324d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java @@ -3,6 +3,7 @@ package com.hxhq.business.service; import java.util.List; import com.hxhq.business.domain.StorageLocation; import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.business.form.yq.StorageLocationSearchForm; /** * 存储位置Service接口 @@ -15,9 +16,9 @@ public interface IStorageLocationService extends IService /** * 查询存储位置列表 * - * @param storageLocation 存储位置 + * @param form 存储位置 * @return 存储位置集合 */ - public List queryList(StorageLocation storageLocation); + public List queryList(StorageLocationSearchForm form); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java index 182a2c2..0d666af 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java @@ -2,8 +2,10 @@ package com.hxhq.business.service.impl; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; - import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.business.form.yq.StorageLocationSearchForm; +import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.StorageLocationMapper; @@ -27,7 +29,7 @@ public class StorageLocationServiceImpl extends ServiceImpl queryList(StorageLocation form) + public List queryList(StorageLocationSearchForm form) { QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.eq("s.del_flag", 0); @@ -43,6 +45,9 @@ public class StorageLocationServiceImpl extends ServiceImpl superiorAndSubordinate = sysDeptService.getSuperiorAndSubordinate(SecurityUtils.getLoginUser().getSysUser().getDeptId()); List deptIdList = superiorAndSubordinate.stream().map(SysDept::getDeptId).collect(Collectors.toList()); form.setDeptIdList(deptIdList); - form.setCcwz(NormalEnum.yes.getValue()); + form.setStatus(NormalEnum.yes.getValue()); startPage(); - List list = yqService.queryList(form); + List list = storageLocationService.queryList(form); return getDataTable(list); } else { diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml index a3871ec..7f054ca 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + SELECT f.id,f.bdbh,f.bdmc,f.user_mc,f.create_time,f.bdzt,f.bdnr,t.`sn` AS templateSn + FROM `t_study_form_fill` f JOIN `t_template` t ON f.`template_id`=t.`id` + + + + ${ew.sqlSegment} + + + + \ No newline at end of file From c927b5f28ed677ec9d8cff696d8429d4d7eeaf6a Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Thu, 5 Mar 2026 08:43:54 +0800 Subject: [PATCH 19/26] =?UTF-8?q?fix:[=E8=A1=A8=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?]=E6=97=A5=E5=BF=97=E6=97=B6=E9=97=B4=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/IStudyFormApplyJcgjService.java | 6 +- .../service/IStudyFormApplyQmxxService.java | 4 +- .../service/IStudyFormFillJcgjService.java | 4 +- .../service/IStudyFormFillQmxxService.java | 4 +- .../service/IStudyFormPlanJcgjService.java | 6 +- .../service/IStudyFormPlanQmxxService.java | 4 +- .../business/service/IStudyFormPreJcgjService.java | 6 +- .../business/service/IStudyFormPreQmxxService.java | 4 +- .../impl/StudyFormApplyJcgjServiceImpl.java | 12 ++- .../impl/StudyFormApplyQmxxServiceImpl.java | 4 +- .../service/impl/StudyFormApplyServiceImpl.java | 71 ++++++++++-------- .../service/impl/StudyFormFillJcgjServiceImpl.java | 12 ++- .../service/impl/StudyFormFillQmxxServiceImpl.java | 4 +- .../service/impl/StudyFormFillServiceImpl.java | 85 +++++++++++++--------- .../service/impl/StudyFormPlanJcgjServiceImpl.java | 10 ++- .../service/impl/StudyFormPlanQmxxServiceImpl.java | 4 +- .../service/impl/StudyFormPlanServiceImpl.java | 42 ++++++----- .../service/impl/StudyFormPreJcgjServiceImpl.java | 10 ++- .../service/impl/StudyFormPreQmxxServiceImpl.java | 4 +- .../service/impl/StudyFormPreServiceImpl.java | 52 +++++++------ 20 files changed, 222 insertions(+), 126 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java index 01005bf..a9a75bf 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyJcgjService.java @@ -51,6 +51,7 @@ public interface IStudyFormApplyJcgjService extends IService /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormApply 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -60,10 +61,11 @@ public interface IStudyFormApplyJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormApplyJcgj getJcgj(StudyFormApply studyFormApply,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormApplyJcgj getJcgj(Date time,StudyFormApply studyFormApply,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormApply 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -74,6 +76,6 @@ public interface IStudyFormApplyJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormApplyJcgj getJcgj(StudyFormApply studyFormApply, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormApplyJcgj getJcgj(Date time,StudyFormApply studyFormApply, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java index 097af80..ab9b46b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormApplyQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormApplyQmxx; import com.baomidou.mybatisplus.extension.service.IService; @@ -25,10 +26,11 @@ public interface IStudyFormApplyQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java index 6f0fa34..4989887 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillJcgjService.java @@ -57,7 +57,7 @@ public interface IStudyFormFillJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormFillJcgj getJcgj(StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormFillJcgj getJcgj(Date time,StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 @@ -71,6 +71,6 @@ public interface IStudyFormFillJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormFillJcgj getJcgj(StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormFillJcgj getJcgj(Date time,StudyFormFill studyFormFill, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java index 10e2f12..bb6407b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormFillQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormFillQmxx; import com.baomidou.mybatisplus.extension.service.IService; @@ -25,10 +26,11 @@ public interface IStudyFormFillQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java index fed0cd5..898a45c 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanJcgjService.java @@ -48,6 +48,7 @@ public interface IStudyFormPlanJcgjService extends IService /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPlan 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -57,10 +58,11 @@ public interface IStudyFormPlanJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPlanJcgj getJcgj(StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormPlanJcgj getJcgj(Date time,StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPlan 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -71,7 +73,7 @@ public interface IStudyFormPlanJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPlanJcgj getJcgj(StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormPlanJcgj getJcgj(Date time,StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java index b6c05bd..8e8f057 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPlanQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormFillQmxx; @@ -26,10 +27,11 @@ public interface IStudyFormPlanQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java index e1e0456..987d4e3 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreJcgjService.java @@ -47,6 +47,7 @@ public interface IStudyFormPreJcgjService extends IService /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPre 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -56,10 +57,11 @@ public interface IStudyFormPreJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPreJcgj getJcgj(StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); + public StudyFormPreJcgj getJcgj(Date time,StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark); /** * 新增稽查轨迹 + * @param time 时间 * @param studyFormPre 表单 * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 * @param jcmc 稽查名称 @@ -70,7 +72,7 @@ public interface IStudyFormPreJcgjService extends IService * @param remark 备注 * @return */ - public StudyFormPreJcgj getJcgj(StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); + public StudyFormPreJcgj getJcgj(Date time,StudyFormPre studyFormPre, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java index d622766..fc49655 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyFormPreQmxxService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.StudyFormPreQmxx; import com.baomidou.mybatisplus.extension.service.IService; @@ -23,11 +24,12 @@ public interface IStudyFormPreQmxxService extends IService /** * 新增签名信息 + * @param time * @param formId * @param qmyy * @param qmr * @param remark */ - public void saveQmxx(Long formId, String qmyy, SysUser qmr, String remark); + public void saveQmxx(Date time, Long formId, String qmyy, SysUser qmr, String remark); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java index 88cc56d..0024e6e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java @@ -114,6 +114,7 @@ public class StudyFormApplyJcgjServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormApplyJcgj getJcgj(Date time,StudyFormApply studyFormApply, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormApplyJcgj formJcgj = new StudyFormApplyJcgj(); formJcgj.setFormId(studyFormApply.getId()); formJcgj.setFormBh(studyFormApply.getBdbh()); @@ -140,12 +141,16 @@ public class StudyFormApplyJcgjServiceImpl extends ServiceImpl studyFormApplyJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(studyFormApply, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormApply.getRemark())); + studyFormApplyJcgjs.add(studyFormApplyJcgjService.getJcgj(now,studyFormApply, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormApply.getRemark())); } studyFormApplyJcgjService.saveBatchWithLog(studyFormApplyJcgjs); } @@ -309,11 +314,11 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); result = studyFormApply; } //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApply.getId(), "填写并保存记录", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApply.getId(), "填写并保存记录", qmr, studyFormApply.getRemark()); return baseMapper.queryInfo(result.getId()); } @@ -363,6 +368,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApply, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApply.getId(), "填写并提交记录", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApply.getId(), "填写并提交记录", qmr, studyFormApply.getRemark()); } @@ -390,6 +396,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "复核通过", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "复核通过", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -426,6 +433,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "复核拒绝", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "复核拒绝", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -461,6 +469,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), null, qmr, studyFormApply.getRemark(), null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), null, qmr, studyFormApply.getRemark(), now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "已审阅", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "已审阅", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -497,6 +506,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormApply.getRemark()); - studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, studyFormApply.getRemark(), null); + studyFormApplyJcgjService.saveJcgj(studyFormApplyOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, studyFormApply.getRemark(), now); //签名信息 - studyFormApplyQmxxService.saveQmxx(studyFormApplyOld.getId(), "审核拒绝", qmr, studyFormApply.getRemark()); + studyFormApplyQmxxService.saveQmxx(now,studyFormApplyOld.getId(), "审核拒绝", qmr, studyFormApply.getRemark()); //发送通知 Study study = studyService.getById(studyFormApplyOld.getStudyId()); String url = getUrlQz(study, "sqbd"); @@ -576,6 +587,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormFillJcgj getJcgj(Date time,StudyFormFill studyFormFill,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormFillJcgj formJcgj = new StudyFormFillJcgj(); formJcgj.setFormId(studyFormFill.getId()); formJcgj.setFormBh(studyFormFill.getBdbh()); @@ -148,12 +149,16 @@ public class StudyFormFillJcgjServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "废止通过", qmr, form.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "废止通过", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -324,9 +327,9 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "废止拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "废止拒绝", qmr, form.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "废止拒绝", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -362,6 +365,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); } else { studyFormFill.setBdzt(StudyFormFillBdztEnum.tbz.getValue()); studyFormFill.setUserId(SecurityUtils.getUserId()); @@ -432,11 +437,11 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "创建记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "创建记录", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); } return baseMapper.queryInfo(result.getId()); } @@ -448,6 +453,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl0){ studyFormFillJcgjService.saveBatchWithLog(studyFormFillJcgjList); @@ -600,6 +607,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl studyFormFillJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormFillJcgjs.add(studyFormFillJcgjService.getJcgj(studyFormFillOld, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), qmr, studyFormFill.getRemark())); + studyFormFillJcgjs.add(studyFormFillJcgjService.getJcgj(now,studyFormFillOld, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), qmr, studyFormFill.getRemark())); } studyFormFillJcgjService.saveBatchWithLog(studyFormFillJcgjs); } //稽查轨迹 Map formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); } else { studyFormFill.setBdzt(StudyFormFillBdztEnum.ytj.getValue()); studyFormFill.setUserId(SecurityUtils.getUserId()); @@ -649,10 +657,10 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormFillJcgjService.saveJcgj(studyFormFill, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); } //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFill.getId(), "填写并提交记录", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFill.getId(), "填写并提交记录", qmr, studyFormFill.getRemark()); } @@ -700,6 +708,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("生长情况", form.getQmyy()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), form.getQmyy(), JcmcysEnum.orange.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), form.getRemark(), null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), form.getQmyy(), JcmcysEnum.orange.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), form.getRemark(), now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), form.getQmyy(), qmr, form.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), form.getQmyy(), qmr, form.getRemark()); } @@ -730,6 +739,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "复核通过", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "复核通过", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -767,6 +777,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "复核拒绝", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "复核拒绝", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -805,6 +816,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "免复核通过", JcmcysEnum.green.getValue(), null, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "免复核通过", JcmcysEnum.green.getValue(), null, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "免复核通过", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "免复核通过", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -842,6 +854,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormFill.getRemark()); - studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, null); + studyFormFillJcgjService.saveJcgj(studyFormFillOld, JcgjlxEnum.lc.getValue(), "已审阅", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(), null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormFillOld.getId(), "已审阅", qmr, studyFormFill.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormFillOld.getId(), "已审阅", qmr, studyFormFill.getRemark()); //发送通知 Study study = studyService.getById(studyFormFillOld.getStudyId()); String url = getUrlQz(study, "tbbd"); @@ -886,6 +899,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormPlanJcgj getJcgj(Date time,StudyFormPlan studyFormPlan, Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormPlanJcgj formJcgj = new StudyFormPlanJcgj(); formJcgj.setFormId(studyFormPlan.getId()); formJcgj.setFormBh(studyFormPlan.getBdbh()); @@ -140,6 +140,9 @@ public class StudyFormPlanJcgjServiceImpl extends ServiceImpl studyFormPlanJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormPlanJcgjs.add(studyFormPlanJcgjService.getJcgj(studyFormPlan, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPlan.getRemark())); + studyFormPlanJcgjs.add(studyFormPlanJcgjService.getJcgj(now,studyFormPlan, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPlan.getRemark())); } studyFormPlanJcgjService.saveBatchWithLog(studyFormPlanJcgjs); } @@ -181,11 +183,11 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并保存记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); result = studyFormPlan; } //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlan.getId(), "填写并保存记录", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlan.getId(), "填写并保存记录", qmr, studyFormPlan.getRemark()); return baseMapper.queryInfo(result.getId()); } @@ -234,6 +236,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlan, JcgjlxEnum.lc.getValue(), "填写并提交记录", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlan.getId(), "填写并提交记录", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlan.getId(), "填写并提交记录", qmr, studyFormPlan.getRemark()); } @@ -268,6 +271,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核通过", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlanOld.getId(), "复核通过", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlanOld.getId(), "复核通过", qmr, studyFormPlan.getRemark()); //发送通知 Study study = studyService.getById(studyFormPlanOld.getStudyId()); String url = getUrlQz(study, "syxx"); @@ -304,6 +308,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormPlan.getRemark()); - studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormPlanJcgjService.saveJcgj(studyFormPlanOld, JcgjlxEnum.lc.getValue(), "复核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormPlanQmxxService.saveQmxx(studyFormPlanOld.getId(), "复核拒绝", qmr, studyFormPlan.getRemark()); + studyFormPlanQmxxService.saveQmxx(now,studyFormPlanOld.getId(), "复核拒绝", qmr, studyFormPlan.getRemark()); //发送通知 Study study = studyService.getById(studyFormPlanOld.getStudyId()); String url = getUrlQz(study, "syxx"); @@ -340,6 +345,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl jcnr, SysUser qmr, String remark){ + public StudyFormPreJcgj getJcgj(Date time,StudyFormPre studyFormPre,Integer jcgjlx, String jcmc, Integer jcmcys, Map jcnr, SysUser qmr, String remark){ StudyFormPreJcgj formJcgj = new StudyFormPreJcgj(); formJcgj.setFormId(studyFormPre.getId()); formJcgj.setFormBh(studyFormPre.getBdbh()); @@ -141,6 +141,9 @@ public class StudyFormPreJcgjServiceImpl extends ServiceImpl studyFormPreJcgjs = new ArrayList<>(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - studyFormPreJcgjs.add(studyFormPreJcgjService.getJcgj(studyFormPre, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPre.getRemark())); + studyFormPreJcgjs.add(studyFormPreJcgjService.getJcgj(now,studyFormPre, JcgjlxEnum.xg.getValue(), "修改", JcmcysEnum.orange.getValue(), fieldChange.toString(), fieldChange.toEnString(), SecurityUtils.getLoginUser().getSysUser(), studyFormPre.getRemark())); } studyFormPreJcgjService.saveBatchWithLog(studyFormPreJcgjs); } @@ -160,11 +161,11 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPre.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作保存预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作保存预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, now); result = studyFormPre; } //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPre.getId(), "制作保存预制表单", qmr, studyFormPre.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPre.getId(), "制作保存预制表单", qmr, studyFormPre.getRemark()); return baseMapper.queryInfo(result.getId()); } @@ -209,6 +210,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", studyFormPre.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作提交预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPre, JcgjlxEnum.lc.getValue(), "制作提交预制表单", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPre.getId(), "制作提交预制表单", qmr, studyFormPre.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPre.getId(), "制作提交预制表单", qmr, studyFormPre.getRemark()); //发送通知 Study study = studyService.getById(studyFormPre.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -269,6 +271,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("备注", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核通过", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核通过", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "审核通过", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "审核通过", qmr, form.getRemark()); } /** @@ -328,6 +331,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "审核拒绝", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "审核拒绝", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -360,6 +364,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", studyFormPre.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "申请关闭", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "申请关闭", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormFillQmxxService.saveQmxx(studyFormPreOld.getId(), "申请关闭", qmr, studyFormPre.getRemark()); + studyFormFillQmxxService.saveQmxx(now,studyFormPreOld.getId(), "申请关闭", qmr, studyFormPre.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -439,6 +445,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭拒绝", JcmcysEnum.red.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "关闭拒绝", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "关闭拒绝", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -474,6 +481,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); formData.put("原因", form.getRemark()); - studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭同意", JcmcysEnum.green.getValue(), formData, qmr, null, null); + studyFormPreJcgjService.saveJcgj(studyFormPreOld, JcgjlxEnum.lc.getValue(), "关闭同意", JcmcysEnum.green.getValue(), formData, qmr, null, now); //签名信息 - studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(), "关闭同意", qmr, form.getRemark()); + studyFormPreQmxxService.saveQmxx(now,studyFormPreOld.getId(), "关闭同意", qmr, form.getRemark()); //发送通知 Study study = studyService.getById(studyFormPreOld.getStudyId()); String url = getUrlQz(study, "ytbd"); @@ -520,6 +528,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl Date: Thu, 5 Mar 2026 09:14:34 +0800 Subject: [PATCH 20/26] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?]bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StudyFormFillController.java | 58 +++++++++++----------- .../com/hxhq/business/utils/StudyFormFillUtil.java | 6 ++- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java index 4727f70..2524bc8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java @@ -64,6 +64,7 @@ public class StudyFormFillController extends BaseController { /** * 开始配置 + * * @return */ @PostMapping("/startConfiguration") @@ -77,6 +78,7 @@ public class StudyFormFillController extends BaseController { /** * 配置完成 + * * @param form * @return */ @@ -91,6 +93,7 @@ public class StudyFormFillController extends BaseController { /** * 分装 + * * @param form * @return */ @@ -141,26 +144,26 @@ public class StudyFormFillController extends BaseController { */ @GetMapping("/jcgjqmxxList") @RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR) - public AjaxResult jcgjqmxxList(Integer jcgjlx,Long id) { - HashMap map=new HashMap(2); + public AjaxResult jcgjqmxxList(Integer jcgjlx, Long id) { + HashMap map = new HashMap(2); //稽查轨迹 QueryWrapper studyFormFillJcgjQueryWrapper = Wrappers.query(); - studyFormFillJcgjQueryWrapper.eq("form_id",id); - if(jcgjlx!=null&&jcgjlx.intValue()>0){ - Integer jcgjlxExport=999; - if(jcgjlx.intValue()==jcgjlxExport){ + studyFormFillJcgjQueryWrapper.eq("form_id", id); + if (jcgjlx != null && jcgjlx.intValue() > 0) { + Integer jcgjlxExport = 999; + if (jcgjlx.intValue() == jcgjlxExport) { studyFormFillJcgjQueryWrapper.notIn("jcgjlx", JcgjlxEnum.xg.getValue()); - }else{ - studyFormFillJcgjQueryWrapper.eq("jcgjlx",jcgjlx); + } else { + studyFormFillJcgjQueryWrapper.eq("jcgjlx", jcgjlx); } } studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); - map.put("jcgj",studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper)); + map.put("jcgj", studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper)); //签名信息 QueryWrapper studyFormFillQmxxQueryWrapper = Wrappers.query(); - studyFormFillQmxxQueryWrapper.eq("form_id",id); + studyFormFillQmxxQueryWrapper.eq("form_id", id); studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); - map.put("qmxx",studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper)); + map.put("qmxx", studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper)); return AjaxResult.success(map); } @@ -198,31 +201,30 @@ public class StudyFormFillController extends BaseController { StudyFormFill studyFormFill = studyFormFillService.queryInfo(form.getStudyFormFillId()); Study study = studyService.getById(studyFormFill.getStudyId()); //稽查轨迹 - QueryWrapper studyFormFillJcgjQueryWrapper = Wrappers.query(); - studyFormFillJcgjQueryWrapper.eq("form_id",studyFormFill.getId()); - if(form.getJcgjlx()!=null&&form.getJcgjlx().intValue()>0){ - Integer jcgjlxExport=999; - if(form.getJcgjlx().intValue()==jcgjlxExport){ - studyFormFillJcgjQueryWrapper.notIn("jcgjlx", JcgjlxEnum.xg.getValue()); - }else{ - studyFormFillJcgjQueryWrapper.eq("jcgjlx",form.getJcgjlx()); - } + List jcgjList = new ArrayList<>(); + Integer noExport=999; + Boolean jcgj=false; + if (form.getJcgjlx() != null && form.getJcgjlx().intValue() > 0&&!form.getJcgjlx().equals(noExport)) { + QueryWrapper studyFormFillJcgjQueryWrapper = Wrappers.query(); + studyFormFillJcgjQueryWrapper.eq("form_id", studyFormFill.getId()); + studyFormFillJcgjQueryWrapper.eq("jcgjlx", form.getJcgjlx()); + studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); + jcgjList = studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper); + jcgj=true; } - studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); - List jcgjList=studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper); + //签名信息 QueryWrapper studyFormFillQmxxQueryWrapper = Wrappers.query(); - studyFormFillQmxxQueryWrapper.eq("form_id",studyFormFill.getId()); + studyFormFillQmxxQueryWrapper.eq("form_id", studyFormFill.getId()); studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); - List qmxxList=studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper); + List qmxxList = studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper); - String fileUrl =form.getUrl(); + String fileUrl = form.getUrl(); fileUrl = fileUrl.replaceFirst(localFilePrefix, ""); int indexOf = fileUrl.lastIndexOf("/"); String path = fileUrl.substring(0, indexOf); - String exportFileName = StudyFormFillUtil.export(form.getVersion(),form.getLang(),study.getName() + "("+study.getSn()+") "+studyFormFill.getBdmc(), - localFilePath + fileUrl, localFilePath + File.separator + path,jcgjList,qmxxList); - + String exportFileName = StudyFormFillUtil.export(form.getVersion(), form.getLang(), study.getName() + "(" + study.getSn() + ") " + studyFormFill.getBdmc(), + localFilePath + fileUrl, localFilePath + File.separator + path, jcgjList, qmxxList,jcgj); return AjaxResult.success(localFilePrefix + path + File.separator + exportFileName); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java index 3401bea..44f4325 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java @@ -78,7 +78,7 @@ public class StudyFormFillUtil { * @param fileDir * @return */ - public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List jcgjList, List qmxxList) { + public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List jcgjList, List qmxxList,Boolean jcgj) { language = lang; Document document = null; FileOutputStream fos = null; @@ -122,7 +122,9 @@ public class StudyFormFillUtil { // 7. 表格设置到新的一页 document.newPage(); addQmxx(document, qmxxList, lang); - addJcgj(document, jcgjList, lang); + if(jcgj){ + addJcgj(document, jcgjList, lang); + } } catch (Exception e) { throw new RuntimeException("生成失败: " + e.getMessage()); } finally { From 551b79dfce74e122bec027ff07bfcc7d74987df5 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 5 Mar 2026 09:47:06 +0800 Subject: [PATCH 21/26] =?UTF-8?q?feat:=20[=E6=97=A5=E5=BF=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E5=8A=A0=E4=B8=8A=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/service/ISystemLogService.java | 20 +++++++++++++++++++- .../business/service/impl/StudyJcgjServiceImpl.java | 5 ++++- .../business/service/impl/SystemLogServiceImpl.java | 21 ++++++++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java index 9dc14ad..a0c28e0 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.Date; import java.util.List; import com.hxhq.business.domain.Study; @@ -31,8 +32,9 @@ public interface ISystemLogService extends IService * @param jcnr * @param jcnrEn * @param signForm + * @param time */ - void saveStudyInfo(Study study,String jcnr, String jcnrEn, SignForm signForm); + void saveStudyInfo(Study study,String jcnr, String jcnrEn, SignForm signForm,Date time); /** * 试验稽查轨迹-批量 @@ -42,6 +44,22 @@ public interface ISystemLogService extends IService void saveStudyBatch(Study study,List jcgjList); /** + * 普通日志-加上时间 + * @param name + * @param nameEn + * @param jcmc + * @param jcmcEn + * @param jcnr + * @param jcnrEn + * @param qmrid + * @param qmrMc + * @param qmrMcEn + * @param remark + * @param time + */ + void saveInfoWithData(String name, String nameEn, String jcmc, String jcmcEn, String jcnr, String jcnrEn, Long qmrid, String qmrMc, String qmrMcEn, String remark, Date time); + + /** * 普通日志 * @param name * @param nameEn diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyJcgjServiceImpl.java index 049fd45..4534a1c 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -58,6 +59,7 @@ public class StudyJcgjServiceImpl extends ServiceImpl Date: Thu, 5 Mar 2026 10:06:00 +0800 Subject: [PATCH 22/26] =?UTF-8?q?fix:[=E8=A1=A8=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?]=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/service/impl/StudyFormApplyJcgjServiceImpl.java | 11 ++++++----- .../hxhq/business/service/impl/StudyFormApplyServiceImpl.java | 10 ++++------ .../business/service/impl/StudyFormFillJcgjServiceImpl.java | 11 ++++++----- .../hxhq/business/service/impl/StudyFormFillServiceImpl.java | 10 ++++------ .../business/service/impl/StudyFormPlanJcgjServiceImpl.java | 11 ++++++----- .../hxhq/business/service/impl/StudyFormPlanServiceImpl.java | 10 ++++------ .../business/service/impl/StudyFormPreJcgjServiceImpl.java | 11 ++++++----- .../hxhq/business/service/impl/StudyFormPreServiceImpl.java | 10 ++++------ 8 files changed, 40 insertions(+), 44 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java index 0024e6e..749e39b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyJcgjServiceImpl.java @@ -68,8 +68,8 @@ public class StudyFormApplyJcgjServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormApplyJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(),jcgj.getCreateTime()); } } @@ -107,8 +107,8 @@ public class StudyFormApplyJcgjServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormFillJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(),jcgj.getCreateTime()); } } @@ -104,7 +104,8 @@ public class StudyFormFillJcgjServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormPlanJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), jcgj.getCreateTime()); } } @@ -108,8 +108,8 @@ public class StudyFormPlanJcgjServiceImpl extends ServiceImpl jcgjList) { this.saveBatch(jcgjList); for (StudyFormPreJcgj jcgj : jcgjList) { - systemLogService.saveInfo(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(jcgj.getFormBh(), jcgj.getFormBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(),jcgj.getCreateTime()); } } @@ -108,8 +108,8 @@ public class StudyFormPreJcgjServiceImpl extends ServiceImpl Date: Thu, 5 Mar 2026 10:16:39 +0800 Subject: [PATCH 23/26] =?UTF-8?q?feat:[=E6=97=A5=E5=BF=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=E7=A8=BD=E6=9F=A5=E8=BD=A8=E8=BF=B9-=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=97=B6=E9=97=B4=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GspFfjlJcgjServiceImpl.java | 14 ++++++++++---- .../business/service/impl/GspJcgjServiceImpl.java | 22 ++++++++++++++++------ .../service/impl/GspRkjlJcgjServiceImpl.java | 21 +++++++++++++++------ .../business/service/impl/SjJcgjServiceImpl.java | 17 +++++++++++------ .../hxhq/business/service/impl/SjServiceImpl.java | 4 ++++ .../service/impl/StudyMethodJcgjServiceImpl.java | 9 +++++++-- .../service/impl/StudyRoomJcgjServiceImpl.java | 8 ++++++-- .../business/service/impl/YqJcgjServiceImpl.java | 15 +++++++++++---- 8 files changed, 80 insertions(+), 30 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java index fa1d077..794fb71 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -49,6 +50,8 @@ public class GspFfjlJcgjServiceImpl extends ServiceImpl impl @Override public void saveJcgj(Gsp gsp, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr) { + Date date = new Date(); + GspJcgj jcgj = new GspJcgj(); jcgj.setGspId(gsp.getId()); jcgj.setJcgjlx(jcgjlx); @@ -71,29 +74,36 @@ public class GspJcgjServiceImpl extends ServiceImpl impl jcgj.setQmrId(qmr.getUserId()); jcgj.setQmrMc(qmr.getNickName()); jcgj.setQmrMcEn(qmr.getUserName()); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override @Async public void saveBatchWithLog(Gsp gsp, List jcgjList) { + Date date = new Date(); + for (GspJcgj gspJcgj : jcgjList) { + gspJcgj.setCreateTime(date); + } this.saveBatch(jcgjList); for (GspJcgj jcgj : jcgjList) { - systemLogService.saveInfo(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } } @Override @Async public void saveWithLog(Gsp gsp, GspJcgj jcgj) { + Date date = new Date(); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gsp.getBh(), gsp.getBh(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java index 0e5458f..bac3f39 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -46,6 +47,7 @@ public class GspRkjlJcgjServiceImpl extends ServiceImpl jcgjList) { + Date date = new Date(); + for (GspRkjlJcgj gspRkjlJcgj : jcgjList) { + gspRkjlJcgj.setCreateTime(date); + } this.saveBatch(jcgjList); for (GspRkjlJcgj jcgj : jcgjList) { - systemLogService.saveInfo(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } } @Override @Async public void saveWithLog(GspRkjl gspRkjl, GspRkjlJcgj jcgj) { + Date date = new Date(); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(gspRkjl.getMc(), gspRkjl.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java index 228a409..764949d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -58,17 +59,19 @@ public class SjJcgjServiceImpl extends ServiceImpl imple public void saveBatchWithLog(Sj sj, List sjJcgjList) { this.saveBatch(sjJcgjList); for (SjJcgj sjJcgj : sjJcgjList) { - systemLogService.saveInfo(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), - sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark()); + systemLogService.saveInfoWithData(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), + sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark(), sjJcgj.getCreateTime()); } } @Override @Async public void saveWithLog(Sj sj, SjJcgj sjJcgj) { + Date date = new Date(); + sjJcgj.setCreateTime(date); this.save(sjJcgj); - systemLogService.saveInfo(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), - sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark()); + systemLogService.saveInfoWithData(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), + sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark(), date); } @Override @@ -86,10 +89,12 @@ public class SjJcgjServiceImpl extends ServiceImpl imple sjJcgj.setQmrId(sysUser.getUserId()); sjJcgj.setQmrMc(sysUser.getNickName()); sjJcgj.setQmrMcEn(sysUser.getUserName()); + Date date = new Date(); + sjJcgj.setCreateTime(date); this.save(sjJcgj); - systemLogService.saveInfo(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), - sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark()); + systemLogService.saveInfoWithData(sj.getBh(), sj.getBh(), sjJcgj.getJcmc(), sjJcgj.getJcmcEn(), + sjJcgj.getJcnr(), sjJcgj.getJcnrEn(), sjJcgj.getQmrId(), sjJcgj.getQmrMc(), sjJcgj.getQmrMcEn(), sjJcgj.getRemark(), date); } @Override diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java index b69bf04..7209ed7 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java @@ -171,6 +171,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi List sjJcgjList = new ArrayList<>(); //region 稽查轨迹 + Date date = new Date(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { SjJcgj jcgj = new SjJcgj(); jcgj.setSjId(sjOld.getId()); @@ -184,6 +185,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi jcgj.setQmrMc(qmr.getNickName()); jcgj.setQmrMcEn(qmr.getUserName()); jcgj.setRemark(form.getKcbjbz()); + jcgj.setCreateTime(date); sjJcgjList.add(jcgj); } sjJcgjService.saveBatchWithLog(sjOld, sjJcgjList); @@ -592,6 +594,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi updateById(sjOld); List gspJcgjList = new ArrayList<>(); + Date date = new Date(); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { SjJcgj sjJcgj = new SjJcgj(); sjJcgj.setSjId(sjOld.getId()); @@ -605,6 +608,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi sjJcgj.setQmrMc(qmr.getNickName()); sjJcgj.setQmrMcEn(qmr.getUserName()); sjJcgj.setRemark(form.getQmbz()); + sjJcgj.setCreateTime(date); gspJcgjList.add(sjJcgj); } sjJcgjService.saveBatchWithLog(sjOld, gspJcgjList); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java index ed0d947..43373c5 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodJcgjServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -8,6 +9,7 @@ import com.hxhq.business.service.ISystemLogService; import com.hxhq.common.core.utils.DateUtils; import com.hxhq.system.api.domain.SysUser; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.StudyMethodJcgjMapper; import com.hxhq.business.domain.StudyMethodJcgj; @@ -41,7 +43,9 @@ public class StudyMethodJcgjServiceImpl extends ServiceImpl impleme @Override @Async public void saveJcgj(Yq yq, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn) { + Date date = new Date(); SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); YqJcgj jcgj = new YqJcgj(); jcgj.setYqId(yq.getId()); @@ -70,19 +72,24 @@ public class YqJcgjServiceImpl extends ServiceImpl impleme jcgj.setQmrId(sysUser.getUserId()); jcgj.setQmrMc(sysUser.getNickName()); jcgj.setQmrMcEn(sysUser.getUserName()); + jcgj.setCreateTime(date); this.save(jcgj); - systemLogService.saveInfo(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } @Override @Async public void saveBatchWithLog(Yq yq, List jcgjList) { + Date date = new Date(); + for (YqJcgj jcgj : jcgjList) { + jcgj.setCreateTime(date); + } this.saveBatch(jcgjList); for (YqJcgj jcgj : jcgjList) { - systemLogService.saveInfo(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), - jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark()); + systemLogService.saveInfoWithData(yq.getMc(), yq.getMc(), jcgj.getJcmc(), jcgj.getJcmcEn(), + jcgj.getJcnr(), jcgj.getJcnrEn(), jcgj.getQmrId(), jcgj.getQmrMc(), jcgj.getQmrMcEn(), jcgj.getRemark(), date); } } From dad46cb0f30518f85eee5b27f732a8406605b7bb Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 5 Mar 2026 16:16:55 +0800 Subject: [PATCH 24/26] =?UTF-8?q?feat:=20[=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/service/ISystemLogService.java | 3 +- .../business/service/impl/StudyServiceImpl.java | 9 ++++-- .../service/impl/SystemLogServiceImpl.java | 3 +- .../hxhq/system/controller/SysRoleController.java | 16 ++++++---- .../hxhq/system/controller/SysUserController.java | 13 +++++--- .../java/com/hxhq/system/form/RoleSaveForm.java | 36 ++++++++++++++++++++++ .../com/hxhq/system/service/ISysRoleService.java | 13 ++++---- .../com/hxhq/system/service/ISysUserService.java | 8 ++--- .../system/service/impl/SysRoleServiceImpl.java | 33 +++++++++++++++----- .../system/service/impl/SysUserServiceImpl.java | 31 +++++++++++-------- 10 files changed, 119 insertions(+), 46 deletions(-) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java index a0c28e0..43650b9 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java @@ -40,8 +40,9 @@ public interface ISystemLogService extends IService * 试验稽查轨迹-批量 * @param study * @param jcgjList + * @param time */ - void saveStudyBatch(Study study,List jcgjList); + void saveStudyBatch(Study study,List jcgjList,Date time); /** * 普通日志-加上时间 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java index 2357d8d..2ac85d8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java @@ -226,9 +226,10 @@ public class StudyServiceImpl extends ServiceImpl implements checkPermit(old); //获取修改的稽查轨迹 - List jcgjList = getChangeJcgj(old,study,sign); + Date now=new Date(); + List jcgjList = getChangeJcgj(old,study,sign,now); studyJcgjService.saveBatch(jcgjList); - systemLogService.saveStudyBatch(study, jcgjList); + systemLogService.saveStudyBatch(study, jcgjList,now); if(!old.getLeaderName().equals(study.getLeaderName())){ @@ -271,9 +272,10 @@ public class StudyServiceImpl extends ServiceImpl implements * @param old * @param study * @param sign + * @param time * @return */ - private List getChangeJcgj(Study old,Study study,SignForm sign){ + private List getChangeJcgj(Study old,Study study,SignForm sign,Date time){ List jcgjList = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(old, study); if (fieldChanges.size() > 0) { @@ -308,6 +310,7 @@ public class StudyServiceImpl extends ServiceImpl implements jcgj.setQmrMc(SecurityUtils.getNickName()); jcgj.setQmrMcEn(SecurityUtils.getUsername()); } + jcgj.setCreateTime(time); jcgjList.add(jcgj); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java index 77b535e..8da990a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java @@ -76,7 +76,7 @@ public class SystemLogServiceImpl extends ServiceImpl jcgjList) { + public void saveStudyBatch(Study study,List jcgjList,Date time) { List logList = new ArrayList<>(); for(StudyJcgj jcgj : jcgjList){ SystemLog info = new SystemLog(); @@ -90,6 +90,7 @@ public class SystemLogServiceImpl extends ServiceImpl roles = roleService.selectRoleAll(); + roles = roles.stream().filter(o->o.getStatus().equals("0")).collect(Collectors.toList()); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); ajax.put("posts", postService.selectPostAll()); return ajax; @@ -294,8 +297,9 @@ public class SysUserController extends BaseController @RequiresPermissions("system:user:add") @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysUser user) + public AjaxResult add(@Validated @RequestBody UserSaveForm form) { + SysUser user = form.getUser(); deptService.checkDeptDataScope(user.getDeptId()); roleService.checkRoleDataScope(user.getRoleIds()); if (!userService.checkUserNameUnique(user)) @@ -312,7 +316,7 @@ public class SysUserController extends BaseController } user.setCreateBy(SecurityUtils.getUsername()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); - return toAjax(userService.insertUser(user)); + return toAjax(userService.insertUser(form)); } /** @@ -380,12 +384,13 @@ public class SysUserController extends BaseController @RequiresPermissions("system:user:enable") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysUser user) + public AjaxResult changeStatus(@RequestBody UserSaveForm form) { + SysUser user = form.getUser(); userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); user.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(userService.updateUserStatus(user)); + return toAjax(userService.updateUserStatus(form)); } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java new file mode 100644 index 0000000..d0e4e19 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java @@ -0,0 +1,36 @@ +package com.hxhq.system.form; + +import com.hxhq.business.form.common.SignForm; +import com.hxhq.system.api.domain.SysRole; + +/** + * @author memory + */ +public class RoleSaveForm { + + /** + * 用户 + */ + private SysRole role; + + /** + * 签名信息 + */ + private SignForm sign; + + public SysRole getRole() { + return role; + } + + public void setRole(SysRole role) { + this.role = role; + } + + public SignForm getSign() { + return sign; + } + + public void setSign(SignForm sign) { + this.sign = sign; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java index d380c66..3dedf5e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysRoleService.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Set; import com.hxhq.system.api.domain.SysRole; import com.hxhq.system.domain.SysUserRole; +import com.hxhq.system.form.RoleSaveForm; /** * 角色业务层 @@ -108,26 +109,26 @@ public interface ISysRoleService /** * 新增保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ - public int insertRole(SysRole role); + public int insertRole(RoleSaveForm form); /** * 修改保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ - public int updateRole(SysRole role); + public int updateRole(RoleSaveForm form); /** * 修改角色状态 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ - public int updateRoleStatus(SysRole role); + public int updateRoleStatus(RoleSaveForm form); /** * 修改数据权限信息 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java index 48c5f92..4e2304f 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java @@ -112,10 +112,10 @@ public interface ISysUserService /** * 新增用户信息 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ - public int insertUser(SysUser user); + public int insertUser(UserSaveForm form); /** * 注册用户信息 @@ -144,10 +144,10 @@ public interface ISysUserService /** * 修改用户状态 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ - public int updateUserStatus(SysUser user); + public int updateUserStatus(UserSaveForm form); /** * 修改用户基本信息 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java index 14b9bcc..5a10773 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysRoleServiceImpl.java @@ -14,7 +14,9 @@ import com.hxhq.system.domain.SysMenu; import com.hxhq.system.domain.SysRoleDept; import com.hxhq.system.domain.SysRoleMenu; import com.hxhq.system.domain.SysUserRole; +import com.hxhq.system.form.RoleSaveForm; import com.hxhq.system.mapper.*; +import com.hxhq.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -53,6 +55,8 @@ public class SysRoleServiceImpl implements ISysRoleService @Autowired private ISystemLogService systemLogService; + @Autowired + private ISysUserService sysUserService; /** * 根据条件分页查询角色数据 @@ -241,30 +245,34 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 新增保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int insertRole(SysRole role) + public int insertRole(RoleSaveForm form) { + sysUserService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysRole role = form.getRole(); // 新增角色信息 roleMapper.insertRole(role); int row = insertRoleMenu(role); - systemLogService.saveInfo(role.getRoleName(),null,"新增角色","Create Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(role.getRoleName(),null,"新增角色","Create Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } /** * 修改保存角色信息 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int updateRole(SysRole role) + public int updateRole(RoleSaveForm form) { + sysUserService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysRole role = form.getRole(); SysRole old = selectRoleById(role.getRoleId()); List oldMenuList = menuMapper.selectMenuByRoleId(role.getRoleId()); @@ -276,6 +284,9 @@ public class SysRoleServiceImpl implements ISysRoleService List logList = getModifyLogList(role,old,oldMenuList); if(logList.size()>0){ + for(SystemLog systemLog : logList){ + systemLog.setRemark(form.getSign().getRemark()); + } systemLogService.saveBatch(logList); } @@ -285,15 +296,21 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 修改角色状态 * - * @param role 角色信息 + * @param form 角色信息 * @return 结果 */ @Override - public int updateRoleStatus(SysRole role) + public int updateRoleStatus(RoleSaveForm form) { + sysUserService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysRole role = form.getRole(); + String disableStatus = "1"; + if(disableStatus.equals(role.getStatus()) && countUserRoleByRoleId(role.getRoleId()) > 0){ + throw new ServiceException("角色已分配,不能禁用"); + } SysRole info = selectRoleById(role.getRoleId()); int row = roleMapper.updateRole(role); - systemLogService.saveInfo(info.getRoleName(),null,"0".equals(role.getStatus())?"启用角色":"禁用角色","0".equals(role.getStatus())?"Enable Role":"Disable Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(info.getRoleName(),null,"0".equals(role.getStatus())?"启用角色":"禁用角色","0".equals(role.getStatus())?"Enable Role":"Disable Role",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java index 35adece..e2c7931 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java @@ -271,13 +271,15 @@ public class SysUserServiceImpl implements ISysUserService /** * 新增保存用户信息 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int insertUser(SysUser user) + public int insertUser(UserSaveForm form) { + checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysUser user = form.getUser(); // 新增用户信息 int rows = userMapper.insertUser(user); // 新增用户岗位关联 @@ -285,7 +287,7 @@ public class SysUserServiceImpl implements ISysUserService // 新增用户与角色管理 insertUserRole(user); - systemLogService.saveInfo(user.getUserName(),null,"新增用户","Create User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(user.getNickName(),null,"新增用户","Create User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return rows; } @@ -313,6 +315,7 @@ public class SysUserServiceImpl implements ISysUserService { SysUser user = form.getUser(); SignForm sign = form.getSign(); + checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false); List logList = getModifyLogList(user, sign); if(logList.size()>0){ @@ -349,16 +352,18 @@ public class SysUserServiceImpl implements ISysUserService /** * 修改用户状态 * - * @param user 用户信息 + * @param form 用户信息 * @return 结果 */ @Override - public int updateUserStatus(SysUser user) + public int updateUserStatus(UserSaveForm form) { + checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysUser user = form.getUser(); SysUser info = selectUserById(user.getUserId()); int row = userMapper.updateUserStatus(user.getUserId(), user.getStatus()); - systemLogService.saveInfo(info.getUserName(),null,"0".equals(user.getStatus())?"启用用户":"禁用用户","0".equals(user.getStatus())?"Enable User":"Disable User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(info.getNickName(),null,"0".equals(user.getStatus())?"启用用户":"禁用用户","0".equals(user.getStatus())?"Enable User":"Disable User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } @@ -496,7 +501,7 @@ public class SysUserServiceImpl implements ISysUserService // 删除用户与岗位表 userPostMapper.deleteUserPostByUserId(userId); int row = userMapper.deleteUserById(userId); - systemLogService.saveInfo(sysUser.getUserName(),null,"删除用户","Remove User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(sysUser.getNickName(),null,"删除用户","Remove User",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); return row; } @@ -650,13 +655,13 @@ public class SysUserServiceImpl implements ISysUserService List list = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(old, info); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr(fieldChange.toString()); log.setJcnrEn(fieldChange.toEnString()); list.add(log); } if(!info.getStatus().equals(old.getStatus())){ - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr("[{\"name\":\"字段名\",\"value\":\"状态\"},{\"name\":\"原值\",\"value\":\""+("0".equals(old.getStatus())?"启用":"禁用")+"\"},{\"name\":\"新值\",\"value\":\""+("0".equals(info.getStatus())?"启用":"禁用")+"\"}]"); log.setJcnrEn("[{\"name\":\"Field\",\"value\":\"Status\"},{\"name\":\"Old Value\",\"value\":\""+("0".equals(old.getStatus())?"Enabled":"Disabled")+"\"},{\"name\":\"New Value\",\"value\":\""+("0".equals(info.getStatus())?"Enabled":"Disabled")+"\"}]"); list.add(log); @@ -665,7 +670,7 @@ public class SysUserServiceImpl implements ISysUserService SysDept oldDept = deptService.selectDeptById(old.getDeptId()); SysDept newDept = deptService.selectDeptById(info.getDeptId()); - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr("[{\"name\":\"字段名\",\"value\":\"所属部门/学科\"},{\"name\":\"原值\",\"value\":\""+oldDept.getDeptName()+"\"},{\"name\":\"新值\",\"value\":\""+newDept.getDeptName()+"\"}]"); log.setJcnrEn("[{\"name\":\"Field\",\"value\":\"Department\"},{\"name\":\"Old Value\",\"value\":\""+oldDept.getDeptName()+"\"},{\"name\":\"New Value\",\"value\":\""+newDept.getDeptName()+"\"}]"); list.add(log); @@ -683,7 +688,6 @@ public class SysUserServiceImpl implements ISysUserService } } if(updateRole){ - checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false); List allRoleList = roleMapper.selectRoleList(new SysRole()); List oldRoleList = new ArrayList<>(); List newRoleList = new ArrayList<>(); @@ -715,7 +719,7 @@ public class SysUserServiceImpl implements ISysUserService } } if(addNameList.size()>0 || deleteNameList.size()>0){ - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr((addNameList.size()>0?("新增角色:"+String.join(",",addNameList)):"")+(deleteNameList.size()>0?(";删除角色:"+String.join(",",deleteNameList)):"")+(StringUtils.isBlank(sign.getRemark())?"":";备注:"+sign.getRemark())); log.setJcnrEn((addNameList.size()>0?("Add Role:"+String.join(",",addNameList)):"")+(deleteNameList.size()>0?(";Remove Role:"+String.join(",",deleteNameList)):"")+(StringUtils.isBlank(sign.getRemark())?"":";Comment:"+sign.getRemark())); list.add(log); @@ -729,7 +733,7 @@ public class SysUserServiceImpl implements ISysUserService * 获取日志基础信息 * @return */ - private SystemLog getLogInfo(SysUser sysUser){ + private SystemLog getLogInfo(SysUser sysUser,SignForm signForm){ SystemLog log = new SystemLog(); log.setName(sysUser.getNickName()); log.setNameEn(sysUser.getNickName()); @@ -738,6 +742,7 @@ public class SysUserServiceImpl implements ISysUserService log.setQmrId(SecurityUtils.getUserId()); log.setQmrMc(SecurityUtils.getNickName()); log.setQmrMcEn(SecurityUtils.getUsername()); + log.setRemark(signForm.getRemark()); return log; } } From 4c26574ba74eb9ddd6276e8651284012e12f3678 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 5 Mar 2026 18:11:47 +0800 Subject: [PATCH 25/26] =?UTF-8?q?feat:=20[=E5=AD=97=E5=85=B8=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E5=A2=9E=E5=8A=A0=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/system/api/domain/SysDictType.java | 12 ++++- .../system/controller/SysDictDataController.java | 17 +++++--- .../system/controller/SysDictTypeController.java | 19 ++++---- .../com/hxhq/system/form/DictDataSaveForm.java | 38 ++++++++++++++++ .../java/com/hxhq/system/form/DictSaveForm.java | 38 ++++++++++++++++ .../java/com/hxhq/system/form/RoleSaveForm.java | 2 +- .../hxhq/system/service/ISysDictDataService.java | 13 +++--- .../hxhq/system/service/ISysDictTypeService.java | 13 +++--- .../service/impl/SysDictDataServiceImpl.java | 47 ++++++++++++-------- .../service/impl/SysDictTypeServiceImpl.java | 51 ++++++++++++---------- 10 files changed, 180 insertions(+), 70 deletions(-) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictDataSaveForm.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictSaveForm.java diff --git a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java index addf2fd..91225f2 100644 --- a/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java +++ b/hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysDictType.java @@ -86,7 +86,17 @@ public class SysDictType extends BaseEntity { this.status = status; } - + + @Override + public String getRemark() { + return remark; + } + + @Override + public void setRemark(String remark) { + this.remark = remark; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java index 7807a74..38b9eb8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java @@ -13,6 +13,7 @@ import com.hxhq.business.form.yq.YqSearchForm; import com.hxhq.business.service.IStorageLocationService; import com.hxhq.business.service.IYqService; import com.hxhq.system.api.domain.SysDept; +import com.hxhq.system.form.DictDataSaveForm; import com.hxhq.system.service.ISysDeptService; import com.hxhq.system.service.ISysDictDataService; import com.hxhq.system.service.ISysDictTypeService; @@ -119,10 +120,11 @@ public class SysDictDataController extends BaseController */ @Log(title = "字典数据", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictData dict) + public AjaxResult add(@Validated @RequestBody DictDataSaveForm form) { + SysDictData dict = form.getDict(); dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictDataService.insertDictData(dict)); + return toAjax(dictDataService.insertDictData(form)); } /** @@ -130,20 +132,21 @@ public class SysDictDataController extends BaseController */ @Log(title = "字典数据", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictData dict) + public AjaxResult edit(@Validated @RequestBody DictDataSaveForm form) { + SysDictData dict = form.getDict(); dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictDataService.updateDictData(dict)); + return toAjax(dictDataService.updateDictData(form)); } /** * 删除字典类型 */ @Log(title = "字典类型", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictCodes}") - public AjaxResult remove(@PathVariable Long[] dictCodes) + @PostMapping("/delete") + public AjaxResult remove(@RequestBody DictDataSaveForm form) { - dictDataService.deleteDictDataByIds(dictCodes); + dictDataService.deleteDictDataByIds(form); return success(); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java index bfe110a..3a009e1 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictTypeController.java @@ -3,6 +3,7 @@ package com.hxhq.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.hxhq.system.form.DictSaveForm; import com.hxhq.system.service.ISysDictTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -70,14 +71,15 @@ public class SysDictTypeController extends BaseController @RequiresPermissions("system:dict:add") @Log(title = "字典类型", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictType dict) + public AjaxResult add(@Validated @RequestBody DictSaveForm form) { + SysDictType dict = form.getDict(); if (!dictTypeService.checkDictTypeUnique(dict)) { return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.insertDictType(dict)); + return toAjax(dictTypeService.insertDictType(form)); } /** @@ -86,14 +88,15 @@ public class SysDictTypeController extends BaseController @RequiresPermissions("system:dict:edit") @Log(title = "字典类型", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictType dict) + public AjaxResult edit(@Validated @RequestBody DictSaveForm form) { + SysDictType dict = form.getDict(); if (!dictTypeService.checkDictTypeUnique(dict)) { return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.updateDictType(dict)); + return toAjax(dictTypeService.updateDictType(form)); } /** @@ -101,17 +104,17 @@ public class SysDictTypeController extends BaseController */ @RequiresPermissions("system:dict:remove") @Log(title = "字典类型", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictIds}") - public AjaxResult remove(@PathVariable Long[] dictIds) + @PostMapping("/delete") + public AjaxResult remove(@RequestBody DictSaveForm form) { - dictTypeService.deleteDictTypeByIds(dictIds); + dictTypeService.deleteDictTypeByIds(form); return success(); } /** * 刷新字典缓存 */ - @RequiresPermissions("system:dict:remove") + @RequiresPermissions("system:dict:refresh") @Log(title = "字典类型", businessType = BusinessType.CLEAN) @DeleteMapping("/refreshCache") public AjaxResult refreshCache() diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictDataSaveForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictDataSaveForm.java new file mode 100644 index 0000000..f3c4591 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictDataSaveForm.java @@ -0,0 +1,38 @@ +package com.hxhq.system.form; + +import com.hxhq.business.form.common.SignForm; +import com.hxhq.system.api.domain.SysDictData; +import com.hxhq.system.api.domain.SysDictType; + +/** + * @author memory + */ +public class DictDataSaveForm { + + /** + * 字典数据 + */ + private SysDictData dict; + + /** + * 签名信息 + */ + private SignForm sign; + + + public SignForm getSign() { + return sign; + } + + public void setSign(SignForm sign) { + this.sign = sign; + } + + public SysDictData getDict() { + return dict; + } + + public void setDict(SysDictData dict) { + this.dict = dict; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictSaveForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictSaveForm.java new file mode 100644 index 0000000..99fa062 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/DictSaveForm.java @@ -0,0 +1,38 @@ +package com.hxhq.system.form; + +import com.hxhq.business.form.common.SignForm; +import com.hxhq.system.api.domain.SysDictData; +import com.hxhq.system.api.domain.SysDictType; +import com.hxhq.system.api.domain.SysUser; + +/** + * @author memory + */ +public class DictSaveForm { + + /** + * 字典 + */ + private SysDictType dict; + + /** + * 签名信息 + */ + private SignForm sign; + + public SysDictType getDict() { + return dict; + } + + public void setDict(SysDictType dict) { + this.dict = dict; + } + + public SignForm getSign() { + return sign; + } + + public void setSign(SignForm sign) { + this.sign = sign; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java index d0e4e19..45fe5ee 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/form/RoleSaveForm.java @@ -9,7 +9,7 @@ import com.hxhq.system.api.domain.SysRole; public class RoleSaveForm { /** - * 用户 + * 角色 */ private SysRole role; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java index 44d9b6f..71419f2 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictDataService.java @@ -2,6 +2,7 @@ package com.hxhq.system.service; import java.util.List; import com.hxhq.system.api.domain.SysDictData; +import com.hxhq.system.form.DictDataSaveForm; /** * 字典 业务层 @@ -38,23 +39,23 @@ public interface ISysDictDataService /** * 批量删除字典数据信息 * - * @param dictCodes 需要删除的字典数据ID + * @param form 需要删除的字典数据ID */ - public void deleteDictDataByIds(Long[] dictCodes); + public void deleteDictDataByIds(DictDataSaveForm form); /** * 新增保存字典数据信息 * - * @param dictData 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ - public int insertDictData(SysDictData dictData); + public int insertDictData(DictDataSaveForm form); /** * 修改保存字典数据信息 * - * @param dictData 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ - public int updateDictData(SysDictData dictData); + public int updateDictData(DictDataSaveForm form); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java index 78d68d5..b880149 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysDictTypeService.java @@ -3,6 +3,7 @@ package com.hxhq.system.service; import java.util.List; import com.hxhq.system.api.domain.SysDictData; import com.hxhq.system.api.domain.SysDictType; +import com.hxhq.system.form.DictSaveForm; /** * 字典 业务层 @@ -53,9 +54,9 @@ public interface ISysDictTypeService /** * 批量删除字典信息 * - * @param dictIds 需要删除的字典ID + * @param form 需要删除的字典ID */ - public void deleteDictTypeByIds(Long[] dictIds); + public void deleteDictTypeByIds(DictSaveForm form); /** * 加载字典缓存数据 @@ -75,18 +76,18 @@ public interface ISysDictTypeService /** * 新增保存字典类型信息 * - * @param dictType 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ - public int insertDictType(SysDictType dictType); + public int insertDictType(DictSaveForm form); /** * 修改保存字典类型信息 * - * @param dictType 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ - public int updateDictType(SysDictType dictType); + public int updateDictType(DictSaveForm form); /** * 校验字典类型称是否唯一 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java index b13e264..a199319 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java @@ -4,11 +4,14 @@ import java.util.ArrayList; import java.util.List; import com.hxhq.business.domain.SystemLog; +import com.hxhq.business.form.common.SignForm; import com.hxhq.business.service.ISystemLogService; import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.system.api.domain.SysDictType; +import com.hxhq.system.form.DictDataSaveForm; import com.hxhq.system.mapper.SysDictDataMapper; +import com.hxhq.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hxhq.common.security.utils.DictUtils; @@ -28,6 +31,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService @Autowired private ISystemLogService systemLogService; + @Autowired + private ISysUserService userService; /** * 根据条件分页查询字典数据 @@ -81,50 +86,53 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 批量删除字典数据信息 * - * @param dictCodes 需要删除的字典数据ID + * @param form 需要删除的字典数据ID */ @Override - public void deleteDictDataByIds(Long[] dictCodes) + public void deleteDictDataByIds(DictDataSaveForm form) { - for (Long dictCode : dictCodes) - { - SysDictData data = selectDictDataById(dictCode); - dictDataMapper.deleteDictDataById(dictCode); - List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + Long dictCode = form.getDict().getDictCode(); + SysDictData data = selectDictDataById(dictCode); + dictDataMapper.deleteDictDataById(dictCode); + List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); + DictUtils.setDictCache(data.getDictType(), dictDatas); - systemLogService.saveInfo(data.getDictLabel(),null,"删除字典数据","Remove Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); - } + systemLogService.saveInfo(data.getDictLabel(),null,"删除字典数据","Remove Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); } /** * 新增保存字典数据信息 * - * @param data 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ @Override - public int insertDictData(SysDictData data) + public int insertDictData(DictDataSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictData data = form.getDict(); int row = dictDataMapper.insertDictData(data); if (row > 0) { List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); DictUtils.setDictCache(data.getDictType(), dictDatas); } - systemLogService.saveInfo(data.getDictLabel(),null,"新增字典数据","Create Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(data.getDictLabel(),null,"新增字典数据","Create Term Book Data",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } /** * 修改保存字典数据信息 * - * @param data 字典数据信息 + * @param form 字典数据信息 * @return 结果 */ @Override - public int updateDictData(SysDictData data) + public int updateDictData(DictDataSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictData data = form.getDict(); SysDictData oldDict = dictDataMapper.selectDictDataById(data.getDictCode()); int row = dictDataMapper.updateDictData(data); if (row > 0) @@ -133,7 +141,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService DictUtils.setDictCache(data.getDictType(), dictDatas); } - List logList = getModifyLogList(data,oldDict); + List logList = getModifyLogList(data,oldDict,form.getSign()); if(logList.size()>0){ systemLogService.saveBatch(logList); } @@ -146,12 +154,12 @@ public class SysDictDataServiceImpl implements ISysDictDataService * @param old * @return */ - private List getModifyLogList(SysDictData info, SysDictData old){ + private List getModifyLogList(SysDictData info, SysDictData old, SignForm signForm){ List list = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(old, info); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,signForm); log.setJcnr(fieldChange.toString()); log.setJcnrEn(fieldChange.toEnString()); list.add(log); @@ -163,7 +171,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService * 获取日志基础信息 * @return */ - private SystemLog getLogInfo(SysDictData sysDictData){ + private SystemLog getLogInfo(SysDictData sysDictData, SignForm signForm){ SystemLog log = new SystemLog(); log.setName(sysDictData.getDictLabel()); log.setNameEn(sysDictData.getDictLabel()); @@ -172,6 +180,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService log.setQmrId(SecurityUtils.getUserId()); log.setQmrMc(SecurityUtils.getNickName()); log.setQmrMcEn(SecurityUtils.getUsername()); + log.setRemark(signForm.getRemark()); return log; } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java index e68115d..e9f673e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictTypeServiceImpl.java @@ -8,13 +8,16 @@ import java.util.stream.Collectors; import javax.annotation.PostConstruct; import com.hxhq.business.domain.SystemLog; +import com.hxhq.business.form.common.SignForm; import com.hxhq.business.service.ISystemLogService; import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.system.api.domain.SysRole; import com.hxhq.system.domain.SysMenu; +import com.hxhq.system.form.DictSaveForm; import com.hxhq.system.mapper.SysDictDataMapper; import com.hxhq.system.mapper.SysDictTypeMapper; +import com.hxhq.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -42,6 +45,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService @Autowired private ISystemLogService systemLogService; + @Autowired + private ISysUserService userService; /** * 项目启动时,初始化字典到缓存 @@ -125,24 +130,21 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 批量删除字典类型信息 * - * @param dictIds 需要删除的字典ID + * @param form 需要删除的字典ID */ @Override - public void deleteDictTypeByIds(Long[] dictIds) + public void deleteDictTypeByIds(DictSaveForm form) { - for (Long dictId : dictIds) + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + Long dictId = form.getDict().getDictId(); + SysDictType dictType = selectDictTypeById(dictId); + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) { - SysDictType dictType = selectDictTypeById(dictId); - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) - { - throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); - } - dictTypeMapper.deleteDictTypeById(dictId); - DictUtils.removeDictCache(dictType.getDictType()); - - - systemLogService.saveInfo(dictType.getDictName(),null,"删除字典","Remove Term Book",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); } + dictTypeMapper.deleteDictTypeById(dictId); + DictUtils.removeDictCache(dictType.getDictType()); + systemLogService.saveInfo(dictType.getDictName(),null,"删除字典","Remove Term Book",null,null,SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); } /** @@ -182,31 +184,35 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 新增保存字典类型信息 * - * @param dict 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ @Override - public int insertDictType(SysDictType dict) + public int insertDictType(DictSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictType dict = form.getDict(); int row = dictTypeMapper.insertDictType(dict); if (row > 0) { DictUtils.setDictCache(dict.getDictType(), null); } - systemLogService.saveInfo(dict.getDictName(),null,"新增字典","Create Term Book",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),null); + systemLogService.saveInfo(dict.getDictName(),null,"新增字典","Create Term Book",null,null, SecurityUtils.getUserId(),SecurityUtils.getNickName(),SecurityUtils.getUsername(),form.getSign().getRemark()); return row; } /** * 修改保存字典类型信息 * - * @param dict 字典类型信息 + * @param form 字典类型信息 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) - public int updateDictType(SysDictType dict) + public int updateDictType(DictSaveForm form) { + userService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),form.getSign().getQmrmm(),false); + SysDictType dict = form.getDict(); SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); int row = dictTypeMapper.updateDictType(dict); @@ -216,7 +222,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService DictUtils.setDictCache(dict.getDictType(), dictDatas); } - List logList = getModifyLogList(dict,oldDict); + List logList = getModifyLogList(dict,oldDict, form.getSign()); if(logList.size()>0){ systemLogService.saveBatch(logList); } @@ -247,12 +253,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * @param old * @return */ - private List getModifyLogList(SysDictType info, SysDictType old){ + private List getModifyLogList(SysDictType info, SysDictType old, SignForm sign){ List list = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(old, info); for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SystemLog log = getLogInfo(old); + SystemLog log = getLogInfo(old,sign); log.setJcnr(fieldChange.toString()); log.setJcnrEn(fieldChange.toEnString()); list.add(log); @@ -264,7 +270,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * 获取日志基础信息 * @return */ - private SystemLog getLogInfo(SysDictType sysDictType){ + private SystemLog getLogInfo(SysDictType sysDictType,SignForm sign){ SystemLog log = new SystemLog(); log.setName(sysDictType.getDictName()); log.setNameEn(sysDictType.getDictName()); @@ -273,6 +279,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService log.setQmrId(SecurityUtils.getUserId()); log.setQmrMc(SecurityUtils.getNickName()); log.setQmrMcEn(SecurityUtils.getUsername()); + log.setRemark(sign.getRemark()); return log; } } From 9db85e413ae8f9e49fbdfaccffc94fd433fb13d9 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Fri, 6 Mar 2026 10:11:04 +0800 Subject: [PATCH 26/26] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?]=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hxhq/business/enums/template/ProductEnum.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/template/ProductEnum.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/template/ProductEnum.java index 44bf1dc..c63dab3 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/template/ProductEnum.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/template/ProductEnum.java @@ -1,7 +1,7 @@ package com.hxhq.business.enums.template; /** - * 产物:1:试剂;3:给药制剂;5:麻精药;7:无 + * 产物:1:试剂;3:给药制剂;5:麻精药;7:无 9:细菌 11:细胞 * @author tanfei */ public enum ProductEnum { @@ -24,7 +24,17 @@ public enum ProductEnum { /** * 无 */ - none(7, "无"); + none(7, "无"), + + /** + * 细菌 + */ + Bacteria(9, "细菌"), + + /** + * 细胞 + */ + Cell(11, "细胞"); private int value; private String text;