Browse Source

feat: [删除学科] 错误提示之后再弹出签名

master
memorylkf 3 months ago
parent
commit
e4d110b8b4
4 changed files with 33 additions and 8 deletions
  1. +16
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java
  2. +2
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java
  3. +8
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java
  4. +7
    -7
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectUserServiceImpl.java

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

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.*;
import com.hxhq.business.dto.study.StudyListDto;
import com.hxhq.business.enums.study.StudyStatusEnum;
import com.hxhq.business.form.common.SignForm;
import com.hxhq.business.form.study.StudyFormPreSearchForm;
import com.hxhq.business.form.study.StudySearchForm;
import com.hxhq.business.form.zcg.ZcgSearchForm;
@ -18,6 +19,8 @@ import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo;
import com.hxhq.common.redis.service.RedisService;
import com.hxhq.common.security.annotation.RequiresPermissions;
import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.service.ISysUserService;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
@ -56,6 +59,8 @@ public class PublicController extends BaseController {
private RedisService redisService;
@Autowired
public ISnGenService snGenService;
@Autowired
public ISysUserService sysUserService;
/**
* 获取编号
@ -165,5 +170,16 @@ public class PublicController extends BaseController {
return AjaxResult.success(zcgService.queryList(form));
}
/**
* 判断签名密码
* @param sign
* @return
*/
@PostMapping("/checkPassword")
public AjaxResult checkPassword(@RequestBody SignForm sign) {
sysUserService.checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false);
return AjaxResult.success();
}
}

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

@ -73,8 +73,10 @@ public class StudyController extends BaseController
List<StudyListDto> countList = studyService.queryFormCountList(idList);
if(countList.size()>0){
info.setFormCount(countList.get(0).getFormCount());
info.setFormFinishCount(countList.get(0).getFormFinishCount());
}else{
info.setFormCount(0);
info.setFormFinishCount(0);
}
return AjaxResult.success(info);
}

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

@ -20,6 +20,7 @@ import com.hxhq.business.service.IStudyService;
import com.hxhq.business.service.IStudySubjectUserService;
import com.hxhq.business.utils.JctUtil;
import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
@ -114,7 +115,7 @@ public class StudySubjectServiceImpl extends ServiceImpl
if(study==null){
throw new ServiceException("试验不存在");
}
studyService.checkPassword(form.getSign());
//传入的学科信息
List<StudySubject> itemList = form.getSubjectList();
@ -166,7 +167,13 @@ public class StudySubjectServiceImpl extends ServiceImpl
throw new ServiceException(del.getDeptName()+"下已有表单,不能取消勾选");
}
}
}
if(StringUtils.isBlank(form.getSign().getQmrmm())){
return;
}
studyService.checkPassword(form.getSign());
if(deleteList.size()>0){
removeBatchByIds(deleteList);
for(StudySubject del : deleteList){
studySubjectUserService.deleteByStudySubjectId(study,del.getId(),form.getSign());

+ 7
- 7
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectUserServiceImpl.java View File

@ -108,12 +108,6 @@ public class StudySubjectUserServiceImpl extends ServiceImpl
deleteNameEnList.add(old.getUserNameEn());
}
}
if(addList.size()>0){
saveBatch(addList);
}
if(modifyList.size()>0){
updateBatchById(modifyList);
}
if(deleteList.size()>0){
String name = baseMapper.getHasFormNameList(study.getId(),deleteList.stream().map(o->o.getUserId()).collect(Collectors.toList()));
if(StringUtils.isNoneBlank(name)){
@ -121,9 +115,15 @@ public class StudySubjectUserServiceImpl extends ServiceImpl
}
}
if(StringUtils.isBlank(form.getSign().getQmrmm())){
return ;
return;
}
studyService.checkPassword(form.getSign());
if(addList.size()>0){
saveBatch(addList);
}
if(modifyList.size()>0){
updateBatchById(modifyList);
}
if(deleteList.size()>0){
removeBatchByIds(deleteList);
}

Loading…
Cancel
Save