问卷修改
This commit is contained in:
parent
ceaff119cc
commit
578bbd54f1
@ -42,6 +42,11 @@ public class AgencyController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/selectAgencyList")
|
||||
public AjaxResult agencyList(Agency agency) {
|
||||
return AjaxResult.success(agencyService.selectAgencyList(agency));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出机构信息列表
|
||||
*/
|
||||
|
||||
@ -8,6 +8,7 @@ import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -65,7 +66,7 @@ public class QuestionInfoController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('system:question:add')")
|
||||
@Log(title = "问卷基本信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QuestionInfo questionInfo) {
|
||||
public AjaxResult add(@RequestBody QuestionVO questionInfo) {
|
||||
return toAjax(questionInfoService.insertQuestionInfo(questionInfo));
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ public interface QuestionInfoMapper {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 问卷基本信息
|
||||
*/
|
||||
public QuestionInfo selectQuestionInfoById(Long id);
|
||||
QuestionInfo selectQuestionInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询问卷基本信息列表
|
||||
@ -26,7 +26,7 @@ public interface QuestionInfoMapper {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 问卷基本信息集合
|
||||
*/
|
||||
public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 新增问卷基本信息
|
||||
@ -34,7 +34,7 @@ public interface QuestionInfoMapper {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQuestionInfo(QuestionInfo questionInfo);
|
||||
int insertQuestionInfo(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 修改问卷基本信息
|
||||
@ -42,7 +42,7 @@ public interface QuestionInfoMapper {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 删除问卷基本信息
|
||||
@ -50,7 +50,7 @@ public interface QuestionInfoMapper {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoById(Long id);
|
||||
int deleteQuestionInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除问卷基本信息
|
||||
@ -58,5 +58,5 @@ public interface QuestionInfoMapper {
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoByIds(Long[] ids);
|
||||
int deleteQuestionInfoByIds(Long[] ids);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.manage.service.questioninfo;
|
||||
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -18,7 +19,7 @@ public interface IQuestionInfoService {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 问卷基本信息
|
||||
*/
|
||||
public QuestionInfo selectQuestionInfoById(Long id);
|
||||
QuestionInfo selectQuestionInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询问卷基本信息列表
|
||||
@ -26,7 +27,7 @@ public interface IQuestionInfoService {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 问卷基本信息集合
|
||||
*/
|
||||
public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 新增问卷基本信息
|
||||
@ -34,7 +35,7 @@ public interface IQuestionInfoService {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQuestionInfo(QuestionInfo questionInfo);
|
||||
int insertQuestionInfo(QuestionVO questionInfo);
|
||||
|
||||
/**
|
||||
* 修改问卷基本信息
|
||||
@ -42,7 +43,7 @@ public interface IQuestionInfoService {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 批量删除问卷基本信息
|
||||
@ -50,7 +51,7 @@ public interface IQuestionInfoService {
|
||||
* @param ids 需要删除的问卷基本信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoByIds(Long[] ids);
|
||||
int deleteQuestionInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除问卷基本信息信息
|
||||
@ -58,5 +59,5 @@ public interface IQuestionInfoService {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoById(Long id);
|
||||
int deleteQuestionInfoById(Long id);
|
||||
}
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package com.xinelu.manage.service.questioninfo.impl;
|
||||
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -20,12 +23,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
|
||||
@Resource
|
||||
private QuestionInfoMapper questionInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询问卷基本信息
|
||||
*
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 问卷基本信息
|
||||
*/
|
||||
|
||||
@Override
|
||||
public QuestionInfo selectQuestionInfoById(Long id) {
|
||||
return questionInfoMapper.selectQuestionInfoById(id);
|
||||
@ -45,11 +43,17 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
|
||||
/**
|
||||
* 新增问卷基本信息
|
||||
*
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @param question 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertQuestionInfo(QuestionInfo questionInfo) {
|
||||
public int insertQuestionInfo(QuestionVO question) {
|
||||
QuestionInfo questionInfo = new QuestionInfo();
|
||||
BeanUtils.copyBeanProp(questionInfo,question);
|
||||
int i = questionInfoMapper.insertQuestionInfo(questionInfo);
|
||||
|
||||
List<QuestionSubjectVO> questionSubjectList = question.getQuestionSubjectList();
|
||||
|
||||
questionInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return questionInfoMapper.insertQuestionInfo(questionInfo);
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
package com.xinelu.manage.vo.questionInfo;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO;
|
||||
import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 问卷基本信息VO
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-28
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class QuestionVO extends QuestionInfo {
|
||||
|
||||
private List<QuestionSubjectVO> questionSubjectList;
|
||||
|
||||
private List<QuestionSubjectOptionVO> questionSubjectOptionList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.xinelu.manage.vo.questionsubject;
|
||||
|
||||
import com.xinelu.manage.domain.questionsubject.QuestionSubject;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 问卷题目信息对象 question_subject
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class QuestionSubjectVO extends QuestionSubject {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xinelu.manage.vo.questionsubjectoption;
|
||||
|
||||
import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 问卷题目选项答案对象 question_subject_option
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QuestionSubjectOptionVO extends QuestionSubjectOption {
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user