Browse Source

feat:[试验管理]表单编号

master
15881625488@163.com 3 months ago
parent
commit
765396824f
4 changed files with 137 additions and 8 deletions
  1. +35
    -4
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java
  2. +32
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java
  3. +35
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPlanServiceImpl.java
  4. +35
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreServiceImpl.java

+ 35
- 4
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormApplyServiceImpl.java View File

@ -8,26 +8,27 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.*; import com.hxhq.business.domain.*;
import com.hxhq.business.dto.study.StudyFormApplyListDto; import com.hxhq.business.dto.study.StudyFormApplyListDto;
import com.hxhq.business.enums.NormalEnum; import com.hxhq.business.enums.NormalEnum;
import com.hxhq.business.enums.SnTypeEnum;
import com.hxhq.business.enums.study.StudyFormApplyBdztEnum; import com.hxhq.business.enums.study.StudyFormApplyBdztEnum;
import com.hxhq.business.enums.zykgl.JcgjlxEnum; import com.hxhq.business.enums.zykgl.JcgjlxEnum;
import com.hxhq.business.enums.zykgl.JcmcysEnum; import com.hxhq.business.enums.zykgl.JcmcysEnum;
import com.hxhq.business.form.study.*; import com.hxhq.business.form.study.*;
import com.hxhq.business.form.study.StudyFormApplySearchForm; import com.hxhq.business.form.study.StudyFormApplySearchForm;
import com.hxhq.business.service.IStudyFormApplyJcgjService;
import com.hxhq.business.service.IStudyFormApplyQmxxService;
import com.hxhq.business.service.*;
import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.JctUtil;
import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.business.utils.ObjectCompareUtil;
import com.hxhq.business.utils.lang.StudyFormUtil; import com.hxhq.business.utils.lang.StudyFormUtil;
import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.api.domain.SysDept;
import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.api.domain.SysUser;
import com.hxhq.system.service.ISysDeptService;
import com.hxhq.system.service.ISysUserService; import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.StudyFormApplyMapper; import com.hxhq.business.mapper.StudyFormApplyMapper;
import com.hxhq.business.domain.StudyFormApply; import com.hxhq.business.domain.StudyFormApply;
import com.hxhq.business.service.IStudyFormApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/** /**
@ -45,6 +46,14 @@ public class StudyFormApplyServiceImpl extends ServiceImpl
private IStudyFormApplyQmxxService studyFormApplyQmxxService; private IStudyFormApplyQmxxService studyFormApplyQmxxService;
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired
private ISnGenService snGenService;
@Autowired
private ITemplateService templateService;
@Autowired
private IStudyService studyService;
@Autowired
private ISysDeptService sysDeptService;
/** /**
* 查询试验-申请单列表 * 查询试验-申请单列表
@ -275,6 +284,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl
} else { } else {
studyFormApply.setBdzt(StudyFormApplyBdztEnum.tbz.getValue()); studyFormApply.setBdzt(StudyFormApplyBdztEnum.tbz.getValue());
studyFormApply.setUserId(qmr.getUserId()); studyFormApply.setUserId(qmr.getUserId());
studyFormApply.setBdbh(getSn(studyFormApply));
studyFormApply.setUserMc(qmr.getNickName()); studyFormApply.setUserMc(qmr.getNickName());
studyFormApply.setUserMcEn(qmr.getUserName()); studyFormApply.setUserMcEn(qmr.getUserName());
this.save(studyFormApply); this.save(studyFormApply);
@ -303,6 +313,7 @@ public class StudyFormApplyServiceImpl extends ServiceImpl
if (studyFormApply.getId() == null) { if (studyFormApply.getId() == null) {
studyFormApply.setUserId(qmr.getUserId()); studyFormApply.setUserId(qmr.getUserId());
studyFormApply.setUserMc(SecurityUtils.getNickName()); studyFormApply.setUserMc(SecurityUtils.getNickName());
studyFormApply.setBdbh(getSn(studyFormApply));
} }
studyFormApply.setBdzt(StudyFormApplyBdztEnum.ytj.getValue()); studyFormApply.setBdzt(StudyFormApplyBdztEnum.ytj.getValue());
studyFormApply.setTjsj(new Date()); studyFormApply.setTjsj(new Date());
@ -575,5 +586,25 @@ public class StudyFormApplyServiceImpl extends ServiceImpl
// baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl()); // baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl());
} }
/**
* 生成编号
* @param studyFormApply
* @return
*/
public String getSn(StudyFormApply studyFormApply){
Study study=studyService.getById(studyFormApply.getStudyId());
if(study==null){
throw new ServiceException("试验不存在或已删除");
}
Template template=templateService.getById(studyFormApply.getTemplateId());
if(template==null){
throw new ServiceException("模板不存在或已删除");
}
SysDept dep=sysDeptService.selectDeptById(template.getDeptId());
if(dep==null){
throw new ServiceException("学科不存在或已删除");
}
// MB+表单名缩写(底层模板名称)+版本号+试验编号+学科缩写+流水号
return "MB"+template.getShowSn()+study.getSn()+dep.getAbbr()+snGenService.getNewSn(SnTypeEnum.ybbd.getValue());
}
} }

+ 32
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java View File

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.*; import com.hxhq.business.domain.*;
import com.hxhq.business.dto.study.StudyFormFillListDto; import com.hxhq.business.dto.study.StudyFormFillListDto;
import com.hxhq.business.enums.NormalEnum; import com.hxhq.business.enums.NormalEnum;
import com.hxhq.business.enums.SnTypeEnum;
import com.hxhq.business.enums.study.StudyFormFillBdztEnum; import com.hxhq.business.enums.study.StudyFormFillBdztEnum;
import com.hxhq.business.enums.template.ProductEnum; import com.hxhq.business.enums.template.ProductEnum;
import com.hxhq.business.enums.zykgl.JcgjlxEnum; import com.hxhq.business.enums.zykgl.JcgjlxEnum;
@ -21,7 +22,9 @@ import com.hxhq.business.utils.lang.StudyFormUtil;
import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.api.domain.SysDept;
import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.api.domain.SysUser;
import com.hxhq.system.service.ISysDeptService;
import com.hxhq.system.service.ISysUserService; import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -48,6 +51,12 @@ public class StudyFormFillServiceImpl extends ServiceImpl
private ITemplateService templateService; private ITemplateService templateService;
@Autowired @Autowired
private ISjService sjService; private ISjService sjService;
@Autowired
private ISnGenService snGenService;
@Autowired
private IStudyService studyService;
@Autowired
private ISysDeptService sysDeptService;
/** /**
* 查询试验-填报单列表 * 查询试验-填报单列表
@ -285,6 +294,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
} else { } else {
studyFormFill.setBdzt(StudyFormFillBdztEnum.tbz.getValue()); studyFormFill.setBdzt(StudyFormFillBdztEnum.tbz.getValue());
studyFormFill.setUserId(SecurityUtils.getUserId()); studyFormFill.setUserId(SecurityUtils.getUserId());
studyFormFill.setBdbh(getSn(studyFormFill));
studyFormFill.setStartDate(new Date()); studyFormFill.setStartDate(new Date());
studyFormFill.setUserMc(SecurityUtils.getNickName()); studyFormFill.setUserMc(SecurityUtils.getNickName());
this.save(studyFormFill); this.save(studyFormFill);
@ -340,6 +350,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
studyFormFill.setUserId(SecurityUtils.getUserId()); studyFormFill.setUserId(SecurityUtils.getUserId());
studyFormFill.setUserMc(SecurityUtils.getNickName()); studyFormFill.setUserMc(SecurityUtils.getNickName());
studyFormFill.setSftb(NormalEnum.yes.getValue()); studyFormFill.setSftb(NormalEnum.yes.getValue());
studyFormFill.setBdbh(getSn(studyFormFill));
this.save(studyFormFill); this.save(studyFormFill);
//生成物资 //生成物资
genResource(studyFormFill); genResource(studyFormFill);
@ -638,5 +649,26 @@ public class StudyFormFillServiceImpl extends ServiceImpl
// baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl()); // baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl());
} }
/**
* 生成编号
* @param studyFormFill
* @return
*/
public String getSn(StudyFormFill studyFormFill){
Study study=studyService.getById(studyFormFill.getStudyId());
if(study==null){
throw new ServiceException("试验不存在或已删除");
}
Template template=templateService.getById(studyFormFill.getTemplateId());
if(template==null){
throw new ServiceException("模板不存在或已删除");
}
SysDept dep=sysDeptService.selectDeptById(template.getDeptId());
if(dep==null){
throw new ServiceException("学科不存在或已删除");
}
// MB+表单名缩写(底层模板名称)+版本号+试验编号+学科缩写+流水号+流水号
return "MB"+template.getShowSn()+study.getSn()+dep.getAbbr()+snGenService.getNewSn(SnTypeEnum.ybbd.getValue())+snGenService.getNewSn(SnTypeEnum.ybbd.getValue());
}
} }

+ 35
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPlanServiceImpl.java View File

@ -8,25 +8,26 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.*; import com.hxhq.business.domain.*;
import com.hxhq.business.domain.StudyFormPlan; import com.hxhq.business.domain.StudyFormPlan;
import com.hxhq.business.dto.study.StudyFormPlanListDto; import com.hxhq.business.dto.study.StudyFormPlanListDto;
import com.hxhq.business.enums.SnTypeEnum;
import com.hxhq.business.enums.study.StudyFormPlanBdztEnum; import com.hxhq.business.enums.study.StudyFormPlanBdztEnum;
import com.hxhq.business.enums.zykgl.JcgjlxEnum; import com.hxhq.business.enums.zykgl.JcgjlxEnum;
import com.hxhq.business.enums.zykgl.JcmcysEnum; import com.hxhq.business.enums.zykgl.JcmcysEnum;
import com.hxhq.business.form.study.StudyFormPlanSearchForm; import com.hxhq.business.form.study.StudyFormPlanSearchForm;
import com.hxhq.business.form.study.StudyFormUpdateForm; import com.hxhq.business.form.study.StudyFormUpdateForm;
import com.hxhq.business.service.IStudyFormPlanJcgjService;
import com.hxhq.business.service.IStudyFormPlanQmxxService;
import com.hxhq.business.service.*;
import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.JctUtil;
import com.hxhq.business.utils.ObjectCompareUtil; import com.hxhq.business.utils.ObjectCompareUtil;
import com.hxhq.business.utils.lang.StudyFormUtil; import com.hxhq.business.utils.lang.StudyFormUtil;
import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.api.domain.SysDept;
import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.api.domain.SysUser;
import com.hxhq.system.service.ISysDeptService;
import com.hxhq.system.service.ISysUserService; import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.StudyFormPlanMapper; import com.hxhq.business.mapper.StudyFormPlanMapper;
import com.hxhq.business.service.IStudyFormPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/** /**
@ -43,6 +44,14 @@ public class StudyFormPlanServiceImpl extends ServiceImpl
private IStudyFormPlanQmxxService studyFormPlanQmxxService; private IStudyFormPlanQmxxService studyFormPlanQmxxService;
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired
private ISnGenService snGenService;
@Autowired
private ITemplateService templateService;
@Autowired
private IStudyService studyService;
@Autowired
private ISysDeptService sysDeptService;
/** /**
* 查询试验-填报单列表 * 查询试验-填报单列表
@ -161,6 +170,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl
studyFormPlan.setBdzt(StudyFormPlanBdztEnum.tbz.getValue()); studyFormPlan.setBdzt(StudyFormPlanBdztEnum.tbz.getValue());
studyFormPlan.setUserId(qmr.getUserId()); studyFormPlan.setUserId(qmr.getUserId());
studyFormPlan.setUserMc(qmr.getNickName()); studyFormPlan.setUserMc(qmr.getNickName());
studyFormPlan.setBdbh(getSn(studyFormPlan));
studyFormPlan.setUserMcEn(qmr.getUserName()); studyFormPlan.setUserMcEn(qmr.getUserName());
this.save(studyFormPlan); this.save(studyFormPlan);
//稽查轨迹 //稽查轨迹
@ -188,6 +198,7 @@ public class StudyFormPlanServiceImpl extends ServiceImpl
if (studyFormPlan.getId() == null) { if (studyFormPlan.getId() == null) {
studyFormPlan.setUserId(SecurityUtils.getUserId()); studyFormPlan.setUserId(SecurityUtils.getUserId());
studyFormPlan.setUserMc(SecurityUtils.getNickName()); studyFormPlan.setUserMc(SecurityUtils.getNickName());
studyFormPlan.setBdbh(getSn(studyFormPlan));
} }
studyFormPlan.setBdzt(StudyFormPlanBdztEnum.ytj.getValue()); studyFormPlan.setBdzt(StudyFormPlanBdztEnum.ytj.getValue());
studyFormPlan.setTjsj(new Date()); studyFormPlan.setTjsj(new Date());
@ -405,5 +416,26 @@ public class StudyFormPlanServiceImpl extends ServiceImpl
// baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl()); // baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl());
} }
/**
* 生成编号
* @param studyFormPlan
* @return
*/
public String getSn(StudyFormPlan studyFormPlan){
Study study=studyService.getById(studyFormPlan.getStudyId());
if(study==null){
throw new ServiceException("试验不存在或已删除");
}
Template template=templateService.getById(studyFormPlan.getTemplateId());
if(template==null){
throw new ServiceException("模板不存在或已删除");
}
SysDept dep=sysDeptService.selectDeptById(template.getDeptId());
if(dep==null){
throw new ServiceException("学科不存在或已删除");
}
// MB+表单名缩写(底层模板名称)+版本号+试验编号+学科缩写+流水号
return "MB"+template.getShowSn()+study.getSn()+dep.getAbbr()+snGenService.getNewSn(SnTypeEnum.ybbd.getValue());
}
} }

+ 35
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreServiceImpl.java View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.*; import com.hxhq.business.domain.*;
import com.hxhq.business.dto.study.StudyFormPreListDto; import com.hxhq.business.dto.study.StudyFormPreListDto;
import com.hxhq.business.enums.SnTypeEnum;
import com.hxhq.business.enums.study.StudyFormPreBdztEnum; import com.hxhq.business.enums.study.StudyFormPreBdztEnum;
import com.hxhq.business.enums.study.StudyFormPreFzrshztEnum; import com.hxhq.business.enums.study.StudyFormPreFzrshztEnum;
import com.hxhq.business.enums.zykgl.JcgjlxEnum; import com.hxhq.business.enums.zykgl.JcgjlxEnum;
@ -21,7 +22,9 @@ import com.hxhq.business.utils.lang.StudyFormUtil;
import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.api.domain.SysDept;
import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.api.domain.SysUser;
import com.hxhq.system.service.ISysDeptService;
import com.hxhq.system.service.ISysUserService; import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -48,6 +51,14 @@ public class StudyFormPreServiceImpl extends ServiceImpl
private IStudyFormFillQmxxService studyFormFillQmxxService; private IStudyFormFillQmxxService studyFormFillQmxxService;
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired
private ISnGenService snGenService;
@Autowired
private ITemplateService templateService;
@Autowired
private IStudyService studyService;
@Autowired
private ISysDeptService sysDeptService;
/** /**
* 查询试验-预填单列表 * 查询试验-预填单列表
@ -133,7 +144,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl
} }
result = studyFormPreOld; result = studyFormPreOld;
} else { } else {
studyFormPre.setBdbh("todo");
studyFormPre.setBdbh(getSn(studyFormPre));
studyFormPre.setUserId(qmr.getUserId()); studyFormPre.setUserId(qmr.getUserId());
studyFormPre.setUserMc(qmr.getNickName()); studyFormPre.setUserMc(qmr.getNickName());
studyFormPre.setUserMcEn(qmr.getNickName()); studyFormPre.setUserMcEn(qmr.getNickName());
@ -170,6 +181,7 @@ public class StudyFormPreServiceImpl extends ServiceImpl
studyFormPre.setTjsj(new Date()); studyFormPre.setTjsj(new Date());
this.updateById(studyFormPre); this.updateById(studyFormPre);
} else { } else {
studyFormPre.setBdbh(getSn(studyFormPre));
studyFormPre.setUserId(qmr.getUserId()); studyFormPre.setUserId(qmr.getUserId());
studyFormPre.setUserMc(qmr.getNickName()); studyFormPre.setUserMc(qmr.getNickName());
studyFormPre.setUserMcEn(qmr.getUserName()); studyFormPre.setUserMcEn(qmr.getUserName());
@ -500,4 +512,26 @@ public class StudyFormPreServiceImpl extends ServiceImpl
this.updateById(studyFormPreOld); this.updateById(studyFormPreOld);
// baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl()); // baseMapper.updateZdgxjl(form.getId(), form.getZdgxjl());
} }
/**
* 生成编号
* @param studyFormPre
* @return
*/
public String getSn(StudyFormPre studyFormPre){
Study study=studyService.getById(studyFormPre.getStudyId());
if(study==null){
throw new ServiceException("试验不存在或已删除");
}
Template template=templateService.getById(studyFormPre.getTemplateId());
if(template==null){
throw new ServiceException("模板不存在或已删除");
}
SysDept dep=sysDeptService.selectDeptById(template.getDeptId());
if(dep==null){
throw new ServiceException("学科不存在或已删除");
}
// MB+表单名缩写(底层模板名称)+版本号+试验编号+学科缩写+流水号
return "MB"+template.getShowSn()+study.getSn()+dep.getAbbr()+snGenService.getNewSn(SnTypeEnum.ybbd.getValue());
}
} }

Loading…
Cancel
Save