|
|
|
@ -1,15 +1,26 @@ |
|
|
|
package com.hxhq.business.service.impl; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.hxhq.business.dto.study.StudyFormPreListDto; |
|
|
|
import com.hxhq.business.enums.NormalEnum; |
|
|
|
import com.hxhq.business.enums.study.StudyFormPreBdztEnum; |
|
|
|
import com.hxhq.business.enums.study.StudyFormPreFzrshztEnum; |
|
|
|
import com.hxhq.business.enums.zykgl.JcgjlxEnum; |
|
|
|
import com.hxhq.business.enums.zykgl.JcmcysEnum; |
|
|
|
import com.hxhq.business.form.study.StudyFormPreAuditForm; |
|
|
|
import com.hxhq.business.form.study.StudyFormPreSearchForm; |
|
|
|
import com.hxhq.business.service.IStudyFormPreJcgjService; |
|
|
|
import com.hxhq.business.service.IStudyFormPreQmxxService; |
|
|
|
import com.hxhq.business.utils.JctUtil; |
|
|
|
import com.hxhq.common.core.utils.StringUtils; |
|
|
|
import com.hxhq.common.security.utils.SecurityUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.hxhq.business.mapper.StudyFormPreMapper; |
|
|
|
import com.hxhq.business.domain.StudyFormPre; |
|
|
|
@ -26,6 +37,11 @@ import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
@Service |
|
|
|
public class StudyFormPreServiceImpl extends ServiceImpl<StudyFormPreMapper, StudyFormPre> implements IStudyFormPreService |
|
|
|
{ |
|
|
|
@Autowired |
|
|
|
private IStudyFormPreJcgjService studyFormPreJcgjService; |
|
|
|
@Autowired |
|
|
|
private IStudyFormPreQmxxService studyFormPreQmxxService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询试验-预填单列表 |
|
|
|
* |
|
|
|
@ -89,7 +105,14 @@ public class StudyFormPreServiceImpl extends ServiceImpl |
|
|
|
studyFormPre.setBdzt(StudyFormPreBdztEnum.tbz.getValue()); |
|
|
|
this.save(studyFormPre); |
|
|
|
} |
|
|
|
//稽查轨迹 todo |
|
|
|
//稽查轨迹 |
|
|
|
Map<String, String> formData = new LinkedHashMap<>(); |
|
|
|
formData.put("签名意义", "制作保存预制表单"); |
|
|
|
formData.put("签名人", SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
studyFormPreJcgjService.saveJcgj(studyFormPre.getId(), JcgjlxEnum.bj.getValue(), "制作保存预制表单", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), SecurityUtils.getUserId(), SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
//签名信息 |
|
|
|
studyFormPreQmxxService.saveQmxx(studyFormPre.getId(),"制作保存预制表单",SecurityUtils.getUserId(),SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -116,8 +139,14 @@ public class StudyFormPreServiceImpl extends ServiceImpl |
|
|
|
studyFormPre.setBdzt(StudyFormPreBdztEnum.ytj.getValue()); |
|
|
|
this.save(studyFormPre); |
|
|
|
} |
|
|
|
//稽查轨迹 todo |
|
|
|
|
|
|
|
//稽查轨迹 |
|
|
|
Map<String, String> formData = new LinkedHashMap<>(); |
|
|
|
formData.put("备注", studyFormPre.getRemark()); |
|
|
|
formData.put("签名意义", "制作提交预制表单"); |
|
|
|
formData.put("签名人", SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
studyFormPreJcgjService.saveJcgj(studyFormPre.getId(), JcgjlxEnum.lc.getValue(), "制作提交预制表单", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), SecurityUtils.getUserId(), SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
//签名信息 |
|
|
|
studyFormPreQmxxService.saveQmxx(studyFormPre.getId(),"制作提交预制表单",SecurityUtils.getUserId(),SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -133,10 +162,29 @@ public class StudyFormPreServiceImpl extends ServiceImpl |
|
|
|
if(!studyFormPreOld.getBdzt().equals(StudyFormPreBdztEnum.ytj.getValue())){ |
|
|
|
throw new SecurityException("不是填报状态,不能审核"); |
|
|
|
} |
|
|
|
studyFormPreOld.setBdzt(StudyFormPreBdztEnum.ytg.getValue()); |
|
|
|
this.updateById(studyFormPreOld); |
|
|
|
//稽查轨迹 todo |
|
|
|
|
|
|
|
//负责人审核 |
|
|
|
if(studyFormPreOld.getFzrshzt().equals(StudyFormPreFzrshztEnum.shz.getValue())){ |
|
|
|
studyFormPreOld.setBdzt(StudyFormPreBdztEnum.ytg.getValue()); |
|
|
|
studyFormPreOld.setFzrshzt(StudyFormPreFzrshztEnum.ysh.getValue()); |
|
|
|
}else{ |
|
|
|
//权限审核 |
|
|
|
if(studyFormPreOld.getFzrsh().equals(NormalEnum.yes.getValue())){ |
|
|
|
//是否需要负责人审核 |
|
|
|
studyFormPreOld.setFzrshzt(StudyFormPreFzrshztEnum.shz.getValue()); |
|
|
|
}else{ |
|
|
|
studyFormPreOld.setBdzt(StudyFormPreBdztEnum.ytg.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
this.updateById(studyFormPreOld); |
|
|
|
//稽查轨迹 |
|
|
|
Map<String, String> formData = new LinkedHashMap<>(); |
|
|
|
formData.put("备注", form.getReason()); |
|
|
|
formData.put("签名意义", "审核通过"); |
|
|
|
formData.put("签名人", SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
studyFormPreJcgjService.saveJcgj(studyFormPreOld.getId(), JcgjlxEnum.lc.getValue(), "审核通过", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), SecurityUtils.getUserId(), SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
//签名信息 |
|
|
|
studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(),"审核通过",SecurityUtils.getUserId(),SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -154,7 +202,43 @@ public class StudyFormPreServiceImpl extends ServiceImpl |
|
|
|
} |
|
|
|
studyFormPreOld.setBdzt(StudyFormPreBdztEnum.tbz.getValue()); |
|
|
|
this.updateById(studyFormPreOld); |
|
|
|
//稽查轨迹 todo |
|
|
|
//稽查轨迹 |
|
|
|
Map<String, String> formData = new LinkedHashMap<>(); |
|
|
|
formData.put("备注", form.getReason()); |
|
|
|
formData.put("签名意义", "审核拒绝"); |
|
|
|
formData.put("签名人", SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
studyFormPreJcgjService.saveJcgj(studyFormPreOld.getId(), JcgjlxEnum.lc.getValue(), "审核拒绝", JcmcysEnum.red.getValue(), JctUtil.formatStr(formData), SecurityUtils.getUserId(), SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
//签名信息 |
|
|
|
studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(),"审核拒绝",SecurityUtils.getUserId(),SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 填报 |
|
|
|
* @param form |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void tb(StudyFormPreAuditForm form){ |
|
|
|
StudyFormPre studyFormPreOld=this.getById(form.getId()); |
|
|
|
if(studyFormPreOld==null){ |
|
|
|
throw new SecurityException("信息不存在或已删除"); |
|
|
|
} |
|
|
|
if(!studyFormPreOld.getBdzt().equals(StudyFormPreBdztEnum.ytg.getValue())){ |
|
|
|
throw new SecurityException("不是已通过状态,不能填报"); |
|
|
|
} |
|
|
|
if(!studyFormPreOld.getTbzt().equals(NormalEnum.no.getValue())){ |
|
|
|
throw new SecurityException("已经填报"); |
|
|
|
} |
|
|
|
//新增填报表单 todo |
|
|
|
studyFormPreOld.setTbzt(NormalEnum.yes.getValue()); |
|
|
|
this.updateById(studyFormPreOld); |
|
|
|
//稽查轨迹 |
|
|
|
Map<String, String> formData = new LinkedHashMap<>(); |
|
|
|
formData.put("备注", form.getReason()); |
|
|
|
formData.put("签名意义", "创建记录"); |
|
|
|
formData.put("签名人", SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
studyFormPreJcgjService.saveJcgj(studyFormPreOld.getId(), JcgjlxEnum.lc.getValue(), "创建记录", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), SecurityUtils.getUserId(), SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
//签名信息 |
|
|
|
studyFormPreQmxxService.saveQmxx(studyFormPreOld.getId(),"创建记录",SecurityUtils.getUserId(),SecurityUtils.getLoginUser().getSysUser().getNickName()); |
|
|
|
} |
|
|
|
|
|
|
|
} |