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