Browse Source

feat:[试验管理][预填表单]编辑,新增

master
15881625488@163.com 1 week ago
parent
commit
3c689b16c3
1 changed files with 18 additions and 8 deletions
  1. +18
    -8
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreServiceImpl.java

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

@ -1,5 +1,6 @@
package com.hxhq.business.service.impl; package com.hxhq.business.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -92,15 +93,24 @@ public class StudyFormPreServiceImpl extends ServiceImpl
*/ */
@Override @Override
public void tj(StudyFormPre studyFormPre){ public void tj(StudyFormPre studyFormPre){
StudyFormPre studyFormPreOld=this.getById(studyFormPre.getId());
if(studyFormPreOld==null){
throw new SecurityException("信息不存在或已删除");
}
if(SecurityUtils.getUserId().equals(studyFormPreOld.getUserId())){
throw new SecurityException("只能操作自己的表单");
if(studyFormPre.getId()!=null){
StudyFormPre studyFormPreOld=this.getById(studyFormPre.getId());
if(studyFormPreOld==null){
throw new SecurityException("信息不存在或已删除");
}
if(SecurityUtils.getUserId().equals(studyFormPreOld.getUserId())){
throw new SecurityException("只能操作自己的表单");
}
studyFormPre.setBdzt(StudyFormPreBdztEnum.ytj.getValue());
studyFormPre.setTjsj(new Date());
this.updateById(studyFormPre);
}else{
studyFormPre.setUserId(SecurityUtils.getUserId());
studyFormPre.setTjsj(new Date());
studyFormPre.setUserMc(SecurityUtils.getLoginUser().getSysUser().getNickName());
studyFormPre.setBdzt(StudyFormPreBdztEnum.ytj.getValue());
this.save(studyFormPre);
} }
studyFormPre.setBdzt(StudyFormPreBdztEnum.ytj.getValue());
this.updateById(studyFormPre);
//稽查轨迹 todo //稽查轨迹 todo
} }

Loading…
Cancel
Save