Browse Source

fix:[试验管理][试验方法]

master
HanLong 2 months ago
parent
commit
aa3a8b5d2c
8 changed files with 75 additions and 28 deletions
  1. +14
    -0
      hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysFile.java
  2. +1
    -0
      hxhq-modules/hxhq-file/src/main/java/com/hxhq/file/controller/SysFileController.java
  3. +28
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java
  4. +15
    -13
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java
  5. +5
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjBjForm.java
  6. +6
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjSubpackageForm.java
  7. +5
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java
  8. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java

+ 14
- 0
hxhq-api/hxhq-api-system/src/main/java/com/hxhq/system/api/domain/SysFile.java View File

@ -20,6 +20,11 @@ public class SysFile
*/ */
private String url; private String url;
/**
* 源文件名称
*/
private String originalFileName;
public String getName() public String getName()
{ {
return name; return name;
@ -40,11 +45,20 @@ public class SysFile
this.url = url; this.url = url;
} }
public String getOriginalFileName() {
return originalFileName;
}
public void setOriginalFileName(String originalFileName) {
this.originalFileName = originalFileName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("name", getName()) .append("name", getName())
.append("url", getUrl()) .append("url", getUrl())
.append("originalFileName", getOriginalFileName())
.toString(); .toString();
} }
} }

+ 1
- 0
hxhq-modules/hxhq-file/src/main/java/com/hxhq/file/controller/SysFileController.java View File

@ -39,6 +39,7 @@ public class SysFileController
SysFile sysFile = new SysFile(); SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(url)); sysFile.setName(FileUtils.getName(url));
sysFile.setUrl(url); sysFile.setUrl(url);
sysFile.setOriginalFileName(file.getOriginalFilename());
return R.ok(sysFile); return R.ok(sysFile);
} }
catch (Exception e) catch (Exception e)

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

@ -12,6 +12,7 @@ import com.hxhq.business.form.common.SignForm;
import com.hxhq.business.form.gsp.GspSearchListForm; import com.hxhq.business.form.gsp.GspSearchListForm;
import com.hxhq.business.form.gyzj.SearchForm; import com.hxhq.business.form.gyzj.SearchForm;
import com.hxhq.business.form.sj.SjSearchListForm; import com.hxhq.business.form.sj.SjSearchListForm;
import com.hxhq.business.form.study.StudyCellSearchForm;
import com.hxhq.business.form.yq.YqSearchForm; import com.hxhq.business.form.yq.YqSearchForm;
import com.hxhq.business.form.zcg.ZcgSearchForm; import com.hxhq.business.form.zcg.ZcgSearchForm;
import com.hxhq.business.service.*; import com.hxhq.business.service.*;
@ -64,6 +65,11 @@ public class PublicController extends BaseController {
public IGyzjService gyzjService; public IGyzjService gyzjService;
@Autowired @Autowired
public IGspService gspService; public IGspService gspService;
@Autowired
public ICellService cellService;
@Autowired
public IBacteriaService bacteriaService;
/** /**
* 获取编号 * 获取编号
@ -238,4 +244,26 @@ public class PublicController extends BaseController {
{ {
return AjaxResult.success(templateService.getStepListByTemplateId(templateId,templateSn)); return AjaxResult.success(templateService.getStepListByTemplateId(templateId,templateSn));
} }
/**
* 细胞列表
* @return
*/
@GetMapping("/cellList")
public TableDataInfo getCellList(StudyCellSearchForm form) {
startPage();
List<Cell> cells = cellService.queryStudyList(form);
return getDataTable(cells);
}
/**
* 细菌列表
* @return
*/
@GetMapping("/bacteriaList")
public TableDataInfo getBacteriaList(StudyCellSearchForm form) {
startPage();
List<Bacteria> list = bacteriaService.queryStudyList(form);
return getDataTable(list);
}
} }

+ 15
- 13
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java View File

@ -6,22 +6,17 @@ import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hxhq.business.domain.*; import com.hxhq.business.domain.*;
import com.hxhq.business.dto.gsp.GspListDto;
import com.hxhq.business.dto.sj.SjListDto; import com.hxhq.business.dto.sj.SjListDto;
import com.hxhq.business.enums.zykgl.DaztEnum;
import com.hxhq.business.enums.zykgl.JyztEnum; import com.hxhq.business.enums.zykgl.JyztEnum;
import com.hxhq.business.enums.zykgl.ZjztEnum; import com.hxhq.business.enums.zykgl.ZjztEnum;
import com.hxhq.business.form.gsp.GspGdForm;
import com.hxhq.business.form.gsp.GspJyForm;
import com.hxhq.business.form.gsp.GspSearchListForm; import com.hxhq.business.form.gsp.GspSearchListForm;
import com.hxhq.business.form.mjy.GdForm;
import com.hxhq.business.form.sj.*; import com.hxhq.business.form.sj.*;
import com.hxhq.business.service.ISjService; import com.hxhq.business.service.ISjService;
import com.hxhq.business.service.ISjTzService; import com.hxhq.business.service.ISjTzService;
import com.hxhq.business.service.ISjJcgjService; import com.hxhq.business.service.ISjJcgjService;
import com.hxhq.business.service.IStudySubjectService;
import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.annotation.RequiresPermissions;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -49,6 +44,8 @@ public class SjController extends BaseController
@Autowired @Autowired
private ISjTzService sjTzService; private ISjTzService sjTzService;
@Autowired
private IStudySubjectService studySubjectService;
/** /**
* 开始配置 * 开始配置
@ -57,19 +54,20 @@ public class SjController extends BaseController
@PostMapping("/startConfiguration") @PostMapping("/startConfiguration")
public AjaxResult startConfiguration(@RequestBody SjBjForm form) { public AjaxResult startConfiguration(@RequestBody SjBjForm form) {
Sj sj = sjService.getSjByBh(form.getBh()); Sj sj = sjService.getSjByBh(form.getBh());
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId());
if(sj == null) { if(sj == null) {
sj = new Sj(); sj = new Sj();
sj.setBh(form.getBh()); sj.setBh(form.getBh());
sj.setPzrq(new Date()); sj.setPzrq(new Date());
sj.setStudyId(form.getStudyId()); sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId()); sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(form.getDeptId());
sj.setDeptId(studySubject.getDeptId());
sjService.save(sj); sjService.save(sj);
} else { } else {
sj.setPzrq(new Date()); sj.setPzrq(new Date());
sj.setStudyId(form.getStudyId()); sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId()); sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(form.getDeptId());
sj.setDeptId(studySubject.getDeptId());
sjService.updateById(sj); sjService.updateById(sj);
} }
@ -84,6 +82,8 @@ public class SjController extends BaseController
@PostMapping("/configurationCompleted") @PostMapping("/configurationCompleted")
public AjaxResult configurationCompleted(@RequestBody SjBjForm form) { public AjaxResult configurationCompleted(@RequestBody SjBjForm form) {
Sj sj = sjService.getSjByBh(form.getBh()); Sj sj = sjService.getSjByBh(form.getBh());
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId());
if(sj == null) { if(sj == null) {
sj = new Sj(); sj = new Sj();
sj.setBh(form.getBh()); sj.setBh(form.getBh());
@ -91,7 +91,7 @@ public class SjController extends BaseController
sj.setKcdw(form.getKcdw()); sj.setKcdw(form.getKcdw());
sj.setStudyId(form.getStudyId()); sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId()); sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(form.getDeptId());
sj.setDeptId(studySubject.getDeptId());
sj.setNd(form.getNd()); sj.setNd(form.getNd());
sj.setNddw(form.getNddw()); sj.setNddw(form.getNddw());
sj.setZjzt(ZjztEnum.rk.getValue()); sj.setZjzt(ZjztEnum.rk.getValue());
@ -103,7 +103,7 @@ public class SjController extends BaseController
sj.setKcdw(form.getKcdw()); sj.setKcdw(form.getKcdw());
sj.setStudyId(form.getStudyId()); sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId()); sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(form.getDeptId());
sj.setDeptId(studySubject.getDeptId());
sj.setNd(form.getNd()); sj.setNd(form.getNd());
sj.setNddw(form.getNddw()); sj.setNddw(form.getNddw());
sj.setZjzt(ZjztEnum.rk.getValue()); sj.setZjzt(ZjztEnum.rk.getValue());
@ -121,9 +121,11 @@ public class SjController extends BaseController
*/ */
@PostMapping("/subpackage") @PostMapping("/subpackage")
public AjaxResult subpackage(@RequestBody SjSubpackageForm form) { public AjaxResult subpackage(@RequestBody SjSubpackageForm form) {
/*LambdaQueryWrapper<Sj> queryWrapper = new LambdaQueryWrapper<>();
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId());
LambdaQueryWrapper<Sj> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Sj::getParentBh, form.getBh()); queryWrapper.eq(Sj::getParentBh, form.getBh());
sjService.remove(queryWrapper);*/
sjService.remove(queryWrapper);
List<SjSubpackageForm.SjSubpackageItemForm> list = form.getList(); List<SjSubpackageForm.SjSubpackageItemForm> list = form.getList();
List<Sj> sjList = new ArrayList<>(); List<Sj> sjList = new ArrayList<>();
for (SjSubpackageForm.SjSubpackageItemForm sjSubpackageItemForm : list) { for (SjSubpackageForm.SjSubpackageItemForm sjSubpackageItemForm : list) {
@ -134,7 +136,7 @@ public class SjController extends BaseController
sj.setKcdw(sjSubpackageItemForm.getKcdw()); sj.setKcdw(sjSubpackageItemForm.getKcdw());
sj.setStudyId(form.getStudyId()); sj.setStudyId(form.getStudyId());
sj.setStudyFormId(form.getStudyFormId()); sj.setStudyFormId(form.getStudyFormId());
sj.setDeptId(form.getDeptId());
sj.setDeptId(studySubject.getDeptId());
sjList.add(sj); sjList.add(sj);
} }
sjService.saveBatch(sjList); sjService.saveBatch(sjList);

+ 5
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjBjForm.java View File

@ -1,7 +1,6 @@
package com.hxhq.business.form.sj; package com.hxhq.business.form.sj;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.hxhq.common.core.annotation.Compare;
import java.util.Date; import java.util.Date;
@ -56,7 +55,7 @@ public class SjBjForm {
private Long studyFormId; private Long studyFormId;
/** 所属部门/学科 */ /** 所属部门/学科 */
private Long deptId;
private Long studySubjectId;
public Long getStudyId() { public Long getStudyId() {
return studyId; return studyId;
@ -74,12 +73,12 @@ public class SjBjForm {
this.studyFormId = studyFormId; this.studyFormId = studyFormId;
} }
public Long getDeptId() {
return deptId;
public Long getStudySubjectId() {
return studySubjectId;
} }
public void setDeptId(Long deptId) {
this.deptId = deptId;
public void setStudySubjectId(Long studySubjectId) {
this.studySubjectId = studySubjectId;
} }
public Long getId() { public Long getId() {

+ 6
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjSubpackageForm.java View File

@ -10,8 +10,8 @@ public class SjSubpackageForm {
/** 试验表单id */ /** 试验表单id */
private Long studyFormId; private Long studyFormId;
/** 部门id */
private Long deptId;
/** 学科id */
private Long studySubjectId;
/** 母液编号 */ /** 母液编号 */
private String bh; private String bh;
@ -105,11 +105,11 @@ public class SjSubpackageForm {
this.nddw = nddw; this.nddw = nddw;
} }
public Long getDeptId() {
return deptId;
public Long getStudySubjectId() {
return studySubjectId;
} }
public void setDeptId(Long deptId) {
this.deptId = deptId;
public void setStudySubjectId(Long studySubjectId) {
this.studySubjectId = studySubjectId;
} }
} }

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

@ -63,6 +63,9 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
@Autowired @Autowired
private INoticeService noticeService; private INoticeService noticeService;
@Autowired
private IStudySubjectService studySubjectService;
/** /**
* 查询试剂库存列表 * 查询试剂库存列表
* *
@ -640,7 +643,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
Long studyId = studyFormFill.getStudyId(); Long studyId = studyFormFill.getStudyId();
Long studyFormId = studyFormFill.getId(); Long studyFormId = studyFormFill.getId();
Long studySubjectId = studyFormFill.getStudySubjectId();
Long deptId = template.getDeptId();
// 生成/使用 // 生成/使用
String resource = studyFormFill.getResource(); String resource = studyFormFill.getResource();
@ -665,7 +668,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi
sj = new Sj(); sj = new Sj();
sj.setStudyId(studyId); sj.setStudyId(studyId);
sj.setStudyFormId(studyFormId); sj.setStudyFormId(studyFormId);
sj.setDeptId(studySubjectId);
sj.setDeptId(deptId);
sj.setZjzt(ZjztEnum.rk.getValue()); sj.setZjzt(ZjztEnum.rk.getValue());
sj.setJyzt(JyztEnum.wjy.getValue()); sj.setJyzt(JyztEnum.wjy.getValue());
sj.setDeptId(template.getDeptId()); sj.setDeptId(template.getDeptId());

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

@ -156,7 +156,7 @@ public class StudyMethodServiceImpl extends ServiceImpl
} }
//试验学科内部的人+非试验部门内的人 //试验学科内部的人+非试验部门内的人
List<DeptUserTreeDto> depts = sysUserService.selectStudyUser(study.getType().equals(StudyTypeEnum.sy.getValue())?studyId:null,study.getType().equals(StudyTypeEnum.sy.getValue())?studySubjectId:null,study.getType().equals(StudyTypeEnum.fsy.getValue())?study.getDeptId():null,null); List<DeptUserTreeDto> depts = sysUserService.selectStudyUser(study.getType().equals(StudyTypeEnum.sy.getValue())?studyId:null,study.getType().equals(StudyTypeEnum.sy.getValue())?studySubjectId:null,study.getType().equals(StudyTypeEnum.fsy.getValue())?study.getDeptId():null,null);
if(depts.stream().map(o->o.getId()).collect(Collectors.toList()).contains(userId) && !study.getLeader().equals(userId)){
if(depts.stream().map(o->o.getId()).collect(Collectors.toList()).contains(String.valueOf(userId)) && !study.getLeader().equals(userId)){
//排除sd //排除sd
LambdaQueryWrapper<StudyMethodRead> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StudyMethodRead> queryWrapper = new LambdaQueryWrapper<>();

Loading…
Cancel
Save