Browse Source

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

master
HanLong 5 days ago
parent
commit
aea89c7d52
6 changed files with 209 additions and 25 deletions
  1. +11
    -18
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java
  2. +10
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMethod.java
  3. +91
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyMethodForm.java
  4. +68
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyMethodSearchForm.java
  5. +8
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java
  6. +21
    -5
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java

+ 11
- 18
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java View File

@ -3,8 +3,11 @@ package com.hxhq.business.controller;
import java.util.Arrays;
import java.util.List;
import com.hxhq.business.form.study.StudyMethodForm;
import com.hxhq.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.hxhq.business.domain.StudyMethod;
import com.hxhq.business.service.IStudyMethodService;
@ -21,8 +24,7 @@ import com.hxhq.common.core.web.page.TableDataInfo;
*/
@RestController
@RequestMapping("/business/studyMethod")
public class StudyMethodController extends BaseController
{
public class StudyMethodController extends BaseController {
@Autowired
private IStudyMethodService studyMethodService;
@ -30,10 +32,9 @@ public class StudyMethodController extends BaseController
* 查询试验-试验方法列表
*/
@GetMapping("/list")
public TableDataInfo list(StudyMethod studyMethod)
{
public TableDataInfo list(StudyMethodForm form) {
startPage();
List<StudyMethod> list = studyMethodService.queryList(studyMethod);
List<StudyMethod> list = studyMethodService.queryList(form);
return getDataTable(list);
}
@ -41,8 +42,7 @@ public class StudyMethodController extends BaseController
* 获取试验-试验方法详细信息
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(Long id)
{
public AjaxResult getInfo(Long id) {
return AjaxResult.success(studyMethodService.getById(id));
}
@ -50,17 +50,10 @@ public class StudyMethodController extends BaseController
* 新增试验-试验方法信息
*/
@PostMapping("/save")
public AjaxResult save(@RequestBody StudyMethod studyMethod)
{
return toAjax(studyMethodService.saveOrUpdate(studyMethod));
public AjaxResult save(@RequestBody @Validated StudyMethodForm form) {
form.setQmrId(SecurityUtils.getUserId());
studyMethodService.save(form);
return AjaxResult.success();
}
/**
* 删除试验-试验方法信息
*/
@PostMapping("/delete")
public AjaxResult delete(@RequestBody Long[] ids)
{
return toAjax(studyMethodService.removeByIds(Arrays.asList(ids)));
}
}

+ 10
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMethod.java View File

@ -18,6 +18,9 @@ public class StudyMethod extends MpBaseEntity
/** 所属试验id */
private Long studyId;
/** 所属试验-学科id */
private Long studySubjectId;
/** 方法名称 */
private String ffmc;
@ -81,4 +84,11 @@ public class StudyMethod extends MpBaseEntity
return userMc;
}
public Long getStudySubjectId() {
return studySubjectId;
}
public void setStudySubjectId(Long studySubjectId) {
this.studySubjectId = studySubjectId;
}
}

+ 91
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyMethodForm.java View File

@ -0,0 +1,91 @@
package com.hxhq.business.form.study;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* 试验-试验方法对象
*/
public class StudyMethodForm {
/** 所属试验id */
@NotNull(message = "请选择所属试验")
private Long studyId;
/** 所属试验-学科id */
@NotNull(message = "请选择所属学科")
private Long studySubjectId;
/** 方法名称 */
@NotEmpty(message = "请输入方法名称")
private String ffmc;
/** 方法文件地址 */
@NotEmpty(message = "请上传文件")
private String url;
/** 签名人密码 */
@NotEmpty(message = "请输入签名人密码")
private String qmrmm;
private Long qmrId;
/** 备注 */
private String remark;
public Long getStudyId() {
return studyId;
}
public void setStudyId(Long studyId) {
this.studyId = studyId;
}
public Long getStudySubjectId() {
return studySubjectId;
}
public void setStudySubjectId(Long studySubjectId) {
this.studySubjectId = studySubjectId;
}
public String getFfmc() {
return ffmc;
}
public void setFfmc(String ffmc) {
this.ffmc = ffmc;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getQmrmm() {
return qmrmm;
}
public void setQmrmm(String qmrmm) {
this.qmrmm = qmrmm;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Long getQmrId() {
return qmrId;
}
public void setQmrId(Long qmrId) {
this.qmrId = qmrId;
}
}

+ 68
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/study/StudyMethodSearchForm.java View File

@ -0,0 +1,68 @@
package com.hxhq.business.form.study;
public class StudyMethodSearchForm {
/** 所属试验-学科id */
private Long studySubjectId;
/** 方法名称 */
private String ffmc;
/** 创建人 */
private String createUser;
private String startDate;
private String endDate;
/** 是否已读 0-未读 1-已读 */
private Integer read;
public Long getStudySubjectId() {
return studySubjectId;
}
public void setStudySubjectId(Long studySubjectId) {
this.studySubjectId = studySubjectId;
}
public String getFfmc() {
return ffmc;
}
public void setFfmc(String ffmc) {
this.ffmc = ffmc;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public Integer getRead() {
return read;
}
public void setRead(Integer read) {
this.read = read;
}
}

+ 8
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java View File

@ -3,6 +3,7 @@ package com.hxhq.business.service;
import java.util.List;
import com.hxhq.business.domain.StudyMethod;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hxhq.business.form.study.StudyMethodForm;
/**
* 试验-试验方法Service接口
@ -15,9 +16,14 @@ public interface IStudyMethodService extends IService
/**
* 查询试验-试验方法列表
*
* @param studyMethod 试验-试验方法
* @param form 试验-试验方法
* @return 试验-试验方法集合
*/
public List<StudyMethod> queryList(StudyMethod studyMethod);
public List<StudyMethod> queryList(StudyMethodForm form);
/**
* 上传试验方法
* @param form
*/
void save(StudyMethodForm form);
}

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

@ -3,6 +3,11 @@ package com.hxhq.business.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.form.study.StudyMethodForm;
import com.hxhq.system.api.domain.SysUser;
import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.StudyMethodMapper;
import com.hxhq.business.domain.StudyMethod;
@ -18,17 +23,28 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class StudyMethodServiceImpl extends ServiceImpl<StudyMethodMapper, StudyMethod> implements IStudyMethodService
{
@Autowired
private ISysUserService sysUserService;
/**
* 查询试验-试验方法列表
*
* @param studyMethod 试验-试验方法
* @param form 试验-试验方法
* @return 试验-试验方法
*/
@Override
public List<StudyMethod> queryList(StudyMethod studyMethod)
{
QueryWrapper<StudyMethod> queryWrapper = Wrappers.query();
return this.list(queryWrapper);
public List<StudyMethod> queryList(StudyMethodForm form) {
return null;
}
@Override
public void save(StudyMethodForm form) {
SysUser qmr = sysUserService.selectUserById(form.getQmrId());
// TODO
StudyMethod studyMethod = new StudyMethod();
BeanUtils.copyProperties(form, studyMethod);
this.save(studyMethod);
}
}

Loading…
Cancel
Save