From a6b42c5716080947c09c396b15fb1560155570de Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 29 Jan 2026 14:52:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[=E8=AF=95=E9=AA=8C=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=20=E7=A8=BD=E6=9F=A5=E8=BD=A8=E8=BF=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/controller/StudyController.java | 13 ++++ .../business/controller/StudyDrugController.java | 12 +++ .../controller/StudyNonTrialController.java | 12 +++ .../business/controller/TemplateController.java | 2 +- .../main/java/com/hxhq/business/domain/Study.java | 6 +- .../business/service/impl/StudyServiceImpl.java | 87 ++++++++++++++++++---- 6 files changed, 114 insertions(+), 18 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java index d5ad051..0e9d969 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java @@ -16,6 +16,7 @@ import com.hxhq.business.form.common.SignForm; import com.hxhq.business.form.study.StudySaveForm; import com.hxhq.business.form.study.StudySearchForm; import com.hxhq.business.service.IStudyJcgjService; +import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; @@ -270,6 +271,9 @@ public class StudyController extends BaseController if(study.getId()==null || study.getId().longValue()<=0 || StringUtils.isBlank(sign.getStartDate()) || StringUtils.isBlank(sign.getEndDate())){ return AjaxResult.error("参数有误"); } + if(sign.getEndDate().compareTo(DateUtils.getDate())<0){ + return AjaxResult.error("借阅结束时间不能小于今天"); + } studyService.jy(form); return AjaxResult.success(); } @@ -367,6 +371,15 @@ public class StudyController extends BaseController if(study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue()) && StringUtils.isBlank(sign.getRemark())){ return AjaxResult.error("原因不能为空"); } + if(study.getBorrowStatus().equals(StudyBorrowStatusEnum.jyz.getValue())){ + if(StringUtils.isBlank(sign.getStartDate()) || StringUtils.isBlank(sign.getEndDate())){ + return AjaxResult.error("日期参数有误"); + } + if(sign.getEndDate().compareTo(DateUtils.getDate())<0){ + return AjaxResult.error("借阅结束时间不能小于今天"); + } + } + studyService.doJy(form); return AjaxResult.success(); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyDrugController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyDrugController.java index be37bff..66e856a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyDrugController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyDrugController.java @@ -12,6 +12,7 @@ import com.hxhq.business.form.study.StudySaveForm; import com.hxhq.business.form.study.StudySearchForm; import com.hxhq.business.service.IStudyJcgjService; import com.hxhq.business.service.IStudyService; +import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.core.web.controller.BaseController; import com.hxhq.common.core.web.domain.AjaxResult; @@ -271,6 +272,9 @@ public class StudyDrugController extends BaseController if(study.getId()==null || study.getId().longValue()<=0 || StringUtils.isBlank(sign.getStartDate()) || StringUtils.isBlank(sign.getEndDate())){ return AjaxResult.error("参数有误"); } + if(sign.getEndDate().compareTo(DateUtils.getDate())<0){ + return AjaxResult.error("借阅结束时间不能小于今天"); + } studyService.jy(form); return AjaxResult.success(); } @@ -368,6 +372,14 @@ public class StudyDrugController extends BaseController if(study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue()) && StringUtils.isBlank(sign.getRemark())){ return AjaxResult.error("原因不能为空"); } + if(study.getBorrowStatus().equals(StudyBorrowStatusEnum.jyz.getValue())){ + if(StringUtils.isBlank(sign.getStartDate()) || StringUtils.isBlank(sign.getEndDate())){ + return AjaxResult.error("日期参数有误"); + } + if(sign.getEndDate().compareTo(DateUtils.getDate())<0){ + return AjaxResult.error("借阅结束时间不能小于今天"); + } + } studyService.doJy(form); return AjaxResult.success(); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyNonTrialController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyNonTrialController.java index b9148c2..27ca6fa 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyNonTrialController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyNonTrialController.java @@ -12,6 +12,7 @@ import com.hxhq.business.form.study.StudySaveForm; import com.hxhq.business.form.study.StudySearchForm; import com.hxhq.business.service.IStudyJcgjService; import com.hxhq.business.service.IStudyService; +import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.core.web.controller.BaseController; import com.hxhq.common.core.web.domain.AjaxResult; @@ -270,6 +271,9 @@ public class StudyNonTrialController extends BaseController if(study.getId()==null || study.getId().longValue()<=0 || StringUtils.isBlank(sign.getStartDate()) || StringUtils.isBlank(sign.getEndDate())){ return AjaxResult.error("参数有误"); } + if(sign.getEndDate().compareTo(DateUtils.getDate())<0){ + return AjaxResult.error("借阅结束时间不能小于今天"); + } studyService.jy(form); return AjaxResult.success(); } @@ -367,6 +371,14 @@ public class StudyNonTrialController extends BaseController if(study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue()) && StringUtils.isBlank(sign.getRemark())){ return AjaxResult.error("原因不能为空"); } + if(study.getBorrowStatus().equals(StudyBorrowStatusEnum.jyz.getValue())){ + if(StringUtils.isBlank(sign.getStartDate()) || StringUtils.isBlank(sign.getEndDate())){ + return AjaxResult.error("日期参数有误"); + } + if(sign.getEndDate().compareTo(DateUtils.getDate())<0){ + return AjaxResult.error("借阅结束时间不能小于今天"); + } + } studyService.doJy(form); return AjaxResult.success(); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java index c91f143..5579ddd 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java @@ -54,7 +54,7 @@ public class TemplateController extends BaseController @PostMapping("/save") public AjaxResult save(@RequestBody Template template) { - template.setShowSn("MB"+PinyinUtil.getFirstLetter(template.getName(),"").toUpperCase()+"V1.0"); + template.setShowSn("MB-"+PinyinUtil.getFirstLetter(template.getName(),"").toUpperCase()+"V01"); templateService.saveOrUpdate(template); return AjaxResult.success(); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Study.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Study.java index cb08f81..fba1740 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Study.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Study.java @@ -23,11 +23,11 @@ public class Study extends MpBaseEntity private Integer type; /** 试验编号 */ - @Compare(name = "试验编号",nameEn = "Number") + @Compare(name = "编号",nameEn = "Number") private String sn; /** 试验名称 */ - @Compare(name = "试验名称",nameEn = "Name") + @Compare(name = "名称",nameEn = "Name") private String name; /** 负责人id */ @@ -61,7 +61,7 @@ public class Study extends MpBaseEntity @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date gdApplyTime; - @Compare(name = "试验简述",nameEn = "Description") + @Compare(name = "简述",nameEn = "Description") private String remark; public Integer getType() { 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 edd4c32..54788ae 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 @@ -3,6 +3,8 @@ package com.hxhq.business.service.impl; import java.util.*; import java.util.stream.Collectors; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.MjyJcgj; @@ -203,7 +205,7 @@ public class StudyServiceImpl extends ServiceImpl implements Map formData = new LinkedHashMap<>(); Map formDataEn = new LinkedHashMap<>(); formData.put("暂存人", SecurityUtils.getNickName()); - formDataEn.put("Save User", SecurityUtils.getUsername()); + formDataEn.put("Save By", SecurityUtils.getNickName()); sign.setQmyy(study.getType().equals(StudyTypeEnum.sy.getValue())?"暂存":study.getType().equals(StudyTypeEnum.fsy.getValue())?"暂存":study.getType().equals(StudyTypeEnum.mjy.getValue())?"暂存":""); sign.setQmyyEn(study.getType().equals(StudyTypeEnum.sy.getValue())?"Save":study.getType().equals(StudyTypeEnum.fsy.getValue())?"Save":study.getType().equals(StudyTypeEnum.mjy.getValue())?"Save":""); studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, JcmcysEnum.blue,JctUtil.formatStr(formData),JctUtil.formatStr(formDataEn),sign); @@ -232,9 +234,9 @@ public class StudyServiceImpl extends ServiceImpl implements Map formData = new LinkedHashMap<>(); Map formDataEn = new LinkedHashMap<>(); formData.put("新增人员", study.getLeaderName()); - formDataEn.put("Add Person", study.getLeaderNameEn()); + formDataEn.put("Add Person", study.getLeaderName()); formData.put("删除人员", old.getLeaderName()); - formDataEn.put("Remove Person", old.getLeaderNameEn()); + formDataEn.put("Remove Person", old.getLeaderName()); sign.setQmyy(study.getType().equals(StudyTypeEnum.sy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.fsy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.mjy.getValue())?"人员变更":""); sign.setQmyyEn(study.getType().equals(StudyTypeEnum.sy.getValue())?"Change of Person":study.getType().equals(StudyTypeEnum.fsy.getValue())?"Change of Person":study.getType().equals(StudyTypeEnum.mjy.getValue())?"Change of Person":""); if(study.getStatus().equals(StudyStatusEnum.cg.getValue())){ @@ -247,10 +249,10 @@ public class StudyServiceImpl extends ServiceImpl implements Map formData = new LinkedHashMap<>(); Map formDataEn = new LinkedHashMap<>(); formData.put("暂存人", SecurityUtils.getNickName()); - formDataEn.put("Save User", SecurityUtils.getUsername()); + formDataEn.put("Save By", SecurityUtils.getNickName()); sign.setQmyy(study.getType().equals(StudyTypeEnum.sy.getValue())?"暂存":study.getType().equals(StudyTypeEnum.fsy.getValue())?"暂存":study.getType().equals(StudyTypeEnum.mjy.getValue())?"暂存":""); sign.setQmyyEn(study.getType().equals(StudyTypeEnum.sy.getValue())?"Save":study.getType().equals(StudyTypeEnum.fsy.getValue())?"Save":study.getType().equals(StudyTypeEnum.mjy.getValue())?"Save":""); - studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, JcmcysEnum.blue,JctUtil.formatStr(formDataEn),JctUtil.formatStr(formDataEn),sign); + studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, JcmcysEnum.blue,JctUtil.formatStr(formData),JctUtil.formatStr(formDataEn),sign); }else { checkPassword(sign); if(old.getStatus().equals(StudyStatusEnum.cg.getValue())){ @@ -281,13 +283,30 @@ public class StudyServiceImpl extends ServiceImpl implements jcgj.setJcmc("修改试验"); jcgj.setJcmcEn("Change of Information"); jcgj.setJcmcys(JcmcysEnum.orange.getValue()); - jcgj.setJcnr(fieldChange.toString()); - jcgj.setJcnrEn(fieldChange.toEnString()); + + String jcnr = fieldChange.toString(); + String jcnrEn = fieldChange.toEnString(); + JSONArray nr = JSONArray.parseArray(jcnr); + JSONArray nrEn = JSONArray.parseArray(jcnrEn); + if(StringUtils.isNoneBlank(sign.getRemark())){ + JSONObject yy = new JSONObject(); + yy.put("name","原因"); + yy.put("value",sign.getRemark()); + nr.add(yy); + + JSONObject yyEn = new JSONObject(); + yyEn.put("name","Reason"); + yyEn.put("value",sign.getRemark()); + nrEn.add(yyEn); + } + + jcgj.setJcnr(JSONObject.toJSONString(nr)); + jcgj.setJcnrEn(JSONObject.toJSONString(nrEn)); if(study.getStatus().equals(StudyStatusEnum.syz.getValue())){ jcgj.setQmrId(SecurityUtils.getUserId()); jcgj.setQmrMc(SecurityUtils.getNickName()); jcgj.setQmrMcEn(SecurityUtils.getUsername()); - jcgj.setRemark(sign.getRemark()); +// jcgj.setRemark(sign.getRemark()); } jcgjList.add(jcgj); } @@ -527,12 +546,25 @@ public class StudyServiceImpl extends ServiceImpl implements updateById(info); sign.setQmyy(study.getStatus().equals(StudyStatusEnum.ysd.getValue())?"拒绝归档":"同意归档"); sign.setQmyyEn(study.getStatus().equals(StudyStatusEnum.ysd.getValue())?"Reject Archiving":"Approve Archiving"); - studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, study.getStatus().equals(StudyStatusEnum.ysd.getValue())?JcmcysEnum.red:JcmcysEnum.blue,null,null,sign); archiveLogService.saveInfo(ArchiveLogTypeEnum.sy,StudyTypeEnum.getEnumByValue(info.getType()),info.getId(),info.getName(),info.getSn(),info.getLeaderName(),study.getStatus().equals(StudyStatusEnum.ysd.getValue())?"拒绝归档":"同意归档"); - String title = StudyTypeEnum.getEnumByValue(info.getType()).getText()+"【"+info.getName()+"("+info.getSn()+")】提交的申请归档已"+sign.getQmyy()+(study.getStatus().equals(StudyStatusEnum.ysd.getValue())?(",原因:"+sign.getRemark()):""); noticeService.save(title,info.getLeader(),getNoticeUrl(info)); + + String jcnr = null; + String jcnrEn = null; + if(StringUtils.isNoneBlank(sign.getRemark())){ + Map formData = new LinkedHashMap<>(); + Map formDataEn = new LinkedHashMap<>(); + formData.put("原因", sign.getRemark()); + formDataEn.put("Reason", sign.getRemark()); + + jcnr = JctUtil.formatStr(formData); + jcnrEn = JctUtil.formatStr(formDataEn); + + sign.setRemark(null); + } + studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, study.getStatus().equals(StudyStatusEnum.ysd.getValue())?JcmcysEnum.red:JcmcysEnum.blue,jcnr,jcnrEn,sign); } private String getNoticeUrl(Study study){ @@ -557,12 +589,26 @@ public class StudyServiceImpl extends ServiceImpl implements updateById(info); sign.setQmyy(study.getStatus().equals(StudyStatusEnum.gd.getValue())?"拒绝解档":"同意解档"); sign.setQmyyEn(study.getStatus().equals(StudyStatusEnum.gd.getValue())?"Reject De-archiving":"Approve De-archiving"); - studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, study.getStatus().equals(StudyStatusEnum.gd.getValue())?JcmcysEnum.red:JcmcysEnum.blue,null,null,sign); archiveLogService.saveInfo(ArchiveLogTypeEnum.sy,StudyTypeEnum.getEnumByValue(info.getType()),info.getId(),info.getName(),info.getSn(),info.getLeaderName(),study.getStatus().equals(StudyStatusEnum.gd.getValue())?"拒绝解档":"同意解档"); - String title = StudyTypeEnum.getEnumByValue(info.getType()).getText()+"【"+info.getName()+"("+info.getSn()+")】提交的申请解档已"+sign.getQmyy()+(study.getStatus().equals(StudyStatusEnum.gd.getValue())?(",原因:"+sign.getRemark()):""); noticeService.save(title,info.getLeader(),getNoticeUrl(info)); + + String jcnr = null; + String jcnrEn = null; + if(StringUtils.isNoneBlank(sign.getRemark())){ + Map formData = new LinkedHashMap<>(); + Map formDataEn = new LinkedHashMap<>(); + formData.put("原因", sign.getRemark()); + formDataEn.put("Reason", sign.getRemark()); + + jcnr = JctUtil.formatStr(formData); + jcnrEn = JctUtil.formatStr(formDataEn); + + sign.setRemark(null); + } + + studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, study.getStatus().equals(StudyStatusEnum.gd.getValue())?JcmcysEnum.red:JcmcysEnum.blue,jcnr,jcnrEn,sign); } @Override @@ -584,12 +630,25 @@ public class StudyServiceImpl extends ServiceImpl implements updateById(info); sign.setQmyy(study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue())?"拒绝借阅":"同意借阅"); sign.setQmyyEn(study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue())?"Reject Check-out":"Approve Check-out"); - studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue())?JcmcysEnum.red:JcmcysEnum.blue,null,null,sign); archiveLogService.saveInfo(ArchiveLogTypeEnum.sy,StudyTypeEnum.getEnumByValue(info.getType()),info.getId(),info.getName(),info.getSn(),info.getLeaderName(),study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue())?"拒绝借阅":"同意借阅"); - String title = StudyTypeEnum.getEnumByValue(info.getType()).getText()+"【"+info.getName()+"("+info.getSn()+")】提交的申请借阅已"+sign.getQmyy()+(study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue())?(",原因:"+sign.getRemark()):""); noticeService.save(title,info.getLeader(),getNoticeUrl(info)); + + String jcnr = null; + String jcnrEn = null; + if(StringUtils.isNoneBlank(sign.getRemark())){ + Map formData = new LinkedHashMap<>(); + Map formDataEn = new LinkedHashMap<>(); + formData.put("原因", sign.getRemark()); + formDataEn.put("Reason", sign.getRemark()); + + jcnr = JctUtil.formatStr(formData); + jcnrEn = JctUtil.formatStr(formDataEn); + + sign.setRemark(null); + } + studyJcgjService.saveInfo(study.getId(), JcgjlxEnum.lc, study.getBorrowStatus().equals(StudyBorrowStatusEnum.wjy.getValue())?JcmcysEnum.red:JcmcysEnum.blue,jcnr,jcnrEn,sign); } @Override