Browse Source

feat: [试验管理] 稽查轨迹修改

master
memorylkf 2 months ago
parent
commit
a6b42c5716
6 changed files with 114 additions and 18 deletions
  1. +13
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java
  2. +12
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyDrugController.java
  3. +12
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyNonTrialController.java
  4. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java
  5. +3
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Study.java
  6. +73
    -14
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java

+ 13
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java View File

@ -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();
}

+ 12
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyDrugController.java View File

@ -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();
}

+ 12
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyNonTrialController.java View File

@ -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();
}

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java View File

@ -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();
}

+ 3
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Study.java View File

@ -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() {

+ 73
- 14
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java View File

@ -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<String, String> formData = new LinkedHashMap<>();
Map<String, String> 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<String, String> formData = new LinkedHashMap<>();
Map<String, String> 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<String, String> formData = new LinkedHashMap<>();
Map<String, String> 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<String, String> formData = new LinkedHashMap<>();
Map<String, String> 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<String, String> formData = new LinkedHashMap<>();
Map<String, String> 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<String, String> formData = new LinkedHashMap<>();
Map<String, String> 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

Loading…
Cancel
Save