Browse Source

fix: [代码规范]

master
memorylkf 2 months ago
parent
commit
3a6e709f7f
9 changed files with 74 additions and 106 deletions
  1. +1
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java
  2. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/systemlog/SystemLogSearchForm.java
  3. +1
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java
  4. +1
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java
  5. +4
    -20
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java
  6. +3
    -15
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectUserServiceImpl.java
  7. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SystemLogServiceImpl.java
  8. +2
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java

+ 1
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SystemLogController.java View File

@ -1,16 +1,14 @@
package com.hxhq.business.controller;
import java.util.Arrays;
import java.util.List;
import com.hxhq.business.form.systemLog.SystemLogSearchForm;
import com.hxhq.business.form.systemlog.SystemLogSearchForm;
import com.hxhq.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.hxhq.business.domain.SystemLog;
import com.hxhq.business.service.ISystemLogService;
import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo;

hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/systemLog/SystemLogSearchForm.java → hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/systemlog/SystemLogSearchForm.java View File

@ -1,4 +1,4 @@
package com.hxhq.business.form.systemLog;
package com.hxhq.business.form.systemlog;
/**
* @author memory

+ 1
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISystemLogService.java View File

@ -5,10 +5,8 @@ import java.util.List;
import com.hxhq.business.domain.StudyJcgj;
import com.hxhq.business.domain.SystemLog;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hxhq.business.enums.zykgl.JcgjlxEnum;
import com.hxhq.business.enums.zykgl.JcmcysEnum;
import com.hxhq.business.form.common.SignForm;
import com.hxhq.business.form.systemLog.SystemLogSearchForm;
import com.hxhq.business.form.systemlog.SystemLogSearchForm;
/**
* 系统日志Service接口

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

@ -307,7 +307,6 @@ public class StudyServiceImpl extends ServiceImpl implements
jcgj.setQmrId(SecurityUtils.getUserId());
jcgj.setQmrMc(SecurityUtils.getNickName());
jcgj.setQmrMcEn(SecurityUtils.getUsername());
// jcgj.setRemark(sign.getRemark());
}
jcgjList.add(jcgj);
}
@ -679,7 +678,7 @@ public class StudyServiceImpl extends ServiceImpl implements
}
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void autoGh() {
QueryWrapper<Study> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status",StudyStatusEnum.gd.getValue());

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

@ -113,13 +113,9 @@ public class StudySubjectServiceImpl extends ServiceImpl
@Transactional(rollbackFor = Exception.class)
public void saveInfo(StudySubjectSaveForm form) {
Study study = studyService.getById(form.getStudyId());
if(study==null){
throw new ServiceException("试验不存在");
}
if(study==null){ String notExists = "试验不存在"; throw new ServiceException(notExists); }
//传入的学科信息
List<StudySubject> itemList = form.getSubjectList();
//已经设置的学科信息
List<StudySubject> oldList = getListByStudyId(form.getStudyId());
List<StudySubject> deleteList = new ArrayList<>();
@ -131,13 +127,11 @@ public class StudySubjectServiceImpl extends ServiceImpl
List<String> deleteNameList = new ArrayList<>();
List<String> deleteNameEnList = new ArrayList<>();
for(StudySubject item : itemList){
List<StudySubject> exists = oldList.stream().filter(o->o.getDeptId().equals(item.getDeptId())).collect(Collectors.toList());
if(exists.size()==0){
item.setStudyId(form.getStudyId());
addList.add(item);
addNameList.add(item.getLeaderName());
addNameEnList.add(item.getLeaderNameEn());
}else{
@ -150,7 +144,6 @@ public class StudySubjectServiceImpl extends ServiceImpl
}
}
}
for(StudySubject old : oldList){
if(itemList.stream().filter(o->o.getDeptId().equals(old.getDeptId())).collect(Collectors.toList()).size()==0){
deleteList.add(old);
@ -158,7 +151,6 @@ public class StudySubjectServiceImpl extends ServiceImpl
deleteNameEnList.add(old.getLeaderNameEn());
}
}
if(deleteList.size()>0){
//已有表单的学科不能删除(预填+填报)
List<StudyListDto> formCountList = baseMapper.queryFormCountList(deleteList.stream().map(o->o.getId()).collect(Collectors.toList()));
@ -169,10 +161,7 @@ public class StudySubjectServiceImpl extends ServiceImpl
}
}
}
if(StringUtils.isBlank(form.getSign().getQmrmm())){
return;
}
if(StringUtils.isBlank(form.getSign().getQmrmm())){ return; }
studyService.checkPassword(form.getSign());
if(deleteList.size()>0){
removeBatchByIds(deleteList);
@ -180,7 +169,6 @@ public class StudySubjectServiceImpl extends ServiceImpl
studySubjectUserService.deleteByStudySubjectId(study,del.getId(),form.getSign());
}
}
if(addList.size()>0){
saveBatch(addList);
}
@ -191,14 +179,10 @@ public class StudySubjectServiceImpl extends ServiceImpl
Map<String, String> formData = new LinkedHashMap<>();
Map<String, String> formDataEn = new LinkedHashMap<>();
if(addNameList.size()>0){
formData.put("新增人员", String.join(",",addNameList));
// formDataEn.put("Add Person", String.join(",",addNameEnList));
formDataEn.put("Add Person", String.join(",",addNameList));
formData.put("新增人员", String.join(",",addNameList)); formDataEn.put("Add Person", String.join(",",addNameList));
}
if(deleteNameList.size()>0){
formData.put("删除人员", String.join(",",deleteNameList));
// formDataEn.put("Remove Person", String.join(",",deleteNameEnList));
formDataEn.put("Remove Person", String.join(",",deleteNameList));
formData.put("删除人员", String.join(",",deleteNameList)); formDataEn.put("Remove Person", String.join(",",deleteNameList));
}
form.getSign().setQmyy(study.getType().equals(StudyTypeEnum.sy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.fsy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.mjy.getValue())?"人员变更":"");
form.getSign().setQmyyEn(study.getType().equals(StudyTypeEnum.sy.getValue())?"Change of Person":study.getType().equals(StudyTypeEnum.fsy.getValue())?"Change of Person":study.getType().equals(StudyTypeEnum.mjy.getValue())?"Change of Person":"");

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

@ -58,14 +58,9 @@ public class StudySubjectUserServiceImpl extends ServiceImpl
@Transactional(rollbackFor = Exception.class)
public void saveInfo(StudySubjectUserSaveForm form) {
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId());
if(studySubject==null){
throw new ServiceException("试验学科不存在");
}
if(studySubject==null){ String subjectNotExists = "试验学科不存在"; throw new ServiceException(subjectNotExists); }
Study study = studyService.getById(studySubject.getStudyId());
if(studySubject==null){
throw new ServiceException("试验不存在");
}
if(studySubject==null){ String studyNotExists = "试验不存在"; throw new ServiceException(studyNotExists); }
//传入的成员信息
List<StudySubjectUser> itemList = form.getSubjectUserList();
//已经设置的学科信息
@ -100,7 +95,6 @@ public class StudySubjectUserServiceImpl extends ServiceImpl
}
}
}
for(StudySubjectUser old : oldList){
if(itemList.stream().filter(o->o.getUserId().equals(old.getUserId())).collect(Collectors.toList()).size()==0){
deleteList.add(old);
@ -114,9 +108,7 @@ public class StudySubjectUserServiceImpl extends ServiceImpl
throw new ServiceException(name+"已创建过表单,无法取消勾选");
}
}
if(StringUtils.isBlank(form.getSign().getQmrmm())){
return;
}
if(StringUtils.isBlank(form.getSign().getQmrmm())){ return; }
studyService.checkPassword(form.getSign());
if(addList.size()>0){
saveBatch(addList);
@ -127,18 +119,15 @@ public class StudySubjectUserServiceImpl extends ServiceImpl
if(deleteList.size()>0){
removeBatchByIds(deleteList);
}
if(deleteNameList.size()>0 || addNameList.size()>0){
Map<String, String> formData = new LinkedHashMap<>();
Map<String, String> formDataEn = new LinkedHashMap<>();
if(addNameList.size()>0){
formData.put("新增人员", String.join(",",addNameList));
// formDataEn.put("Add Person", String.join(",",addNameEnList));
formDataEn.put("Add Person", String.join(",",addNameList));
}
if(deleteNameList.size()>0){
formData.put("删除人员", String.join(",",deleteNameList));
// formDataEn.put("Remove Person", String.join(",",deleteNameEnList));
formDataEn.put("Remove Person", String.join(",",deleteNameList));
}
form.getSign().setQmyy(study.getType().equals(StudyTypeEnum.sy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.fsy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.mjy.getValue())?"人员变更":"");
@ -159,7 +148,6 @@ public class StudySubjectUserServiceImpl extends ServiceImpl
Map<String, String> formData = new LinkedHashMap<>();
Map<String, String> formDataEn = new LinkedHashMap<>();
formData.put("删除人员", String.join(",",deleteNameList));
// formDataEn.put("Remove Person", String.join(",",deleteNameEnList));
formDataEn.put("Remove Person", String.join(",",deleteNameList));
sign.setQmyy(study.getType().equals(StudyTypeEnum.sy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.fsy.getValue())?"人员变更":study.getType().equals(StudyTypeEnum.mjy.getValue())?"人员变更":"");

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

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.StudyJcgj;
import com.hxhq.business.form.common.SignForm;
import com.hxhq.business.form.systemLog.SystemLogSearchForm;
import com.hxhq.business.form.systemlog.SystemLogSearchForm;
import com.hxhq.common.core.utils.DateUtils;
import com.hxhq.common.core.utils.StringUtils;
import org.springframework.stereotype.Service;

+ 2
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysDictDataServiceImpl.java View File

@ -30,7 +30,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService
@Override
public List<SysDictData> selectDictDataList(SysDictData dictData)
{
if(dictData.getDictType().contains(",")) {
String split = ",";
if(dictData.getDictType().contains(split)) {
List<SysDictData> sysDictDataList = new ArrayList<>();
String[] dictTypeList = dictData.getDictType().split(",");
for (String dictType : dictTypeList) {

Loading…
Cancel
Save