diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjOptionController.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjOptionController.java index a4818c1..52da338 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjOptionController.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjOptionController.java @@ -89,4 +89,7 @@ public class CjOptionController extends BaseController return toAjax(cjOptionService.deleteCjOptionByIds(ids)); } + + + } diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwIndexConfigController.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwIndexConfigController.java new file mode 100644 index 0000000..d389807 --- /dev/null +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwIndexConfigController.java @@ -0,0 +1,115 @@ +package com.ruoyi.dw.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.utils.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.dw.domain.DwIndexConfig; +import com.ruoyi.dw.service.IDwIndexConfigService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 调查问卷统计展示Controller + * + * @author sunyg + * @date 2025-06-27 + */ +@RestController +@RequestMapping("/dw/config") +public class DwIndexConfigController extends BaseController +{ + @Autowired + private IDwIndexConfigService dwIndexConfigService; + + /** + * 查询调查问卷统计展示列表 + */ + @GetMapping("/list") + public TableDataInfo list(DwIndexConfig dwIndexConfig) + { + startPage(); + List list = dwIndexConfigService.selectDwIndexConfigList(dwIndexConfig); + return getDataTable(list); + } + + /** + * 导出调查问卷统计展示列表 + */ + @Log(title = "调查问卷统计展示", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DwIndexConfig dwIndexConfig) + { + List list = dwIndexConfigService.selectDwIndexConfigList(dwIndexConfig); + ExcelUtil util = new ExcelUtil(DwIndexConfig.class); + util.exportExcel(response, list, "调查问卷统计展示数据"); + } + + /** + * 获取调查问卷统计展示详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dwIndexConfigService.selectDwIndexConfigById(id)); + } + + /** + * 新增调查问卷统计展示 + */ + @Log(title = "调查问卷统计展示", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DwIndexConfig dwIndexConfig) + { + if (StringUtils.isEmpty(dwIndexConfig.getQuestionId())){ + return AjaxResult.error("请先选择展示调查问题"); + } + String[] question_ids = dwIndexConfig.getQuestionId().split(","); + if (question_ids.length > 1 && dwIndexConfig.getIndexType() == 0){ + return AjaxResult.error("饼状图只能选择一个问题"); + } + return toAjax(dwIndexConfigService.insertDwIndexConfig(dwIndexConfig)); + } + + /** + * 修改调查问卷统计展示 + */ + @Log(title = "调查问卷统计展示", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DwIndexConfig dwIndexConfig) + { + if (StringUtils.isEmpty(dwIndexConfig.getQuestionId())){ + return AjaxResult.error("请先选择展示调查问题"); + } + String[] question_ids = dwIndexConfig.getQuestionId().split(","); + if (question_ids.length > 1 && dwIndexConfig.getIndexType() == 0){ + return AjaxResult.error("饼状图只能选择一个问题"); + } + return toAjax(dwIndexConfigService.updateDwIndexConfig(dwIndexConfig)); + } + + /** + * 删除调查问卷统计展示 + */ + @Log(title = "调查问卷统计展示", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dwIndexConfigService.deleteDwIndexConfigByIds(ids)); + } + +} diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwInfoController.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwInfoController.java index 1bb19fb..d5d792b 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwInfoController.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwInfoController.java @@ -10,6 +10,7 @@ import com.ruoyi.dw.domain.DwInfo; import com.ruoyi.dw.service.IDwInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -99,4 +100,6 @@ public class DwInfoController extends BaseController { return toAjax(dwInfoService.deleteDwInfoByIds(ids)); } + + } diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java index 6b66b53..8026285 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java @@ -10,6 +10,7 @@ import com.ruoyi.dw.domain.DwQuestion; import com.ruoyi.dw.service.IDwQuestionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -88,4 +89,10 @@ public class DwQuestionController extends BaseController { return toAjax(dwQuestionService.deleteDwQuestionByIds(ids)); } + + + + public AjaxResult importData(MultipartFile file, int infoId) throws Exception{ + return AjaxResult.success(); + } } diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/DwIndexConfig.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/DwIndexConfig.java new file mode 100644 index 0000000..db39bb3 --- /dev/null +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/DwIndexConfig.java @@ -0,0 +1,105 @@ +package com.ruoyi.dw.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 调查问卷统计展示对象 dw_index_config + * + * @author sunyg + * @date 2025-06-27 + */ +public class DwIndexConfig extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 展位名称 */ + @Excel(name = "展位名称") + private String indexName; + + /** 问题id多个逗号隔开 */ + @Excel(name = "问题id多个逗号隔开") + private String questionId; + + /** 调查问卷id */ + @Excel(name = "调查问卷id") + private Long infoId; + + /** + * 展现形式 + * 0-饼状图,2-柱状图,3-折线图 + * */ + @Excel(name = "展现形式") + private Long indexType; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setIndexName(String indexName) + { + this.indexName = indexName; + } + + public String getIndexName() + { + return indexName; + } + + public void setQuestionId(String questionId) + { + this.questionId = questionId; + } + + public String getQuestionId() + { + return questionId; + } + + public void setInfoId(Long infoId) + { + this.infoId = infoId; + } + + public Long getInfoId() + { + return infoId; + } + + public void setIndexType(Long indexType) + { + this.indexType = indexType; + } + + public Long getIndexType() + { + return indexType; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("indexName", getIndexName()) + .append("questionId", getQuestionId()) + .append("infoId", getInfoId()) + .append("indexType", getIndexType()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/mapper/DwIndexConfigMapper.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/mapper/DwIndexConfigMapper.java new file mode 100644 index 0000000..a7b7481 --- /dev/null +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/mapper/DwIndexConfigMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.dw.mapper; + +import java.util.List; +import com.ruoyi.dw.domain.DwIndexConfig; + +/** + * 调查问卷统计展示Mapper接口 + * + * @author sunyg + * @date 2025-06-27 + */ +public interface DwIndexConfigMapper +{ + /** + * 查询调查问卷统计展示 + * + * @param id 调查问卷统计展示主键 + * @return 调查问卷统计展示 + */ + public DwIndexConfig selectDwIndexConfigById(Long id); + + /** + * 查询调查问卷统计展示列表 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 调查问卷统计展示集合 + */ + public List selectDwIndexConfigList(DwIndexConfig dwIndexConfig); + + /** + * 新增调查问卷统计展示 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 结果 + */ + public int insertDwIndexConfig(DwIndexConfig dwIndexConfig); + + /** + * 修改调查问卷统计展示 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 结果 + */ + public int updateDwIndexConfig(DwIndexConfig dwIndexConfig); + + /** + * 删除调查问卷统计展示 + * + * @param id 调查问卷统计展示主键 + * @return 结果 + */ + public int deleteDwIndexConfigById(Long id); + + /** + * 批量删除调查问卷统计展示 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDwIndexConfigByIds(Long[] ids); +} diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwIndexConfigService.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwIndexConfigService.java new file mode 100644 index 0000000..488a8b9 --- /dev/null +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwIndexConfigService.java @@ -0,0 +1,61 @@ +package com.ruoyi.dw.service; + +import java.util.List; +import com.ruoyi.dw.domain.DwIndexConfig; + +/** + * 调查问卷统计展示Service接口 + * + * @author sunyg + * @date 2025-06-27 + */ +public interface IDwIndexConfigService +{ + /** + * 查询调查问卷统计展示 + * + * @param id 调查问卷统计展示主键 + * @return 调查问卷统计展示 + */ + public DwIndexConfig selectDwIndexConfigById(Long id); + + /** + * 查询调查问卷统计展示列表 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 调查问卷统计展示集合 + */ + public List selectDwIndexConfigList(DwIndexConfig dwIndexConfig); + + /** + * 新增调查问卷统计展示 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 结果 + */ + public int insertDwIndexConfig(DwIndexConfig dwIndexConfig); + + /** + * 修改调查问卷统计展示 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 结果 + */ + public int updateDwIndexConfig(DwIndexConfig dwIndexConfig); + + /** + * 批量删除调查问卷统计展示 + * + * @param ids 需要删除的调查问卷统计展示主键集合 + * @return 结果 + */ + public int deleteDwIndexConfigByIds(Long[] ids); + + /** + * 删除调查问卷统计展示信息 + * + * @param id 调查问卷统计展示主键 + * @return 结果 + */ + public int deleteDwIndexConfigById(Long id); +} diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwQuestionService.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwQuestionService.java index b3f7863..5f3eb5f 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwQuestionService.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwQuestionService.java @@ -58,4 +58,12 @@ public interface IDwQuestionService * @return 结果 */ public int deleteDwQuestionById(Long id); + + /** + * + * 导入调查问卷 + * @param dwQuestionList + * @return + */ + public int importDwQuestion(List dwQuestionList); } diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwIndexConfigServiceImpl.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwIndexConfigServiceImpl.java new file mode 100644 index 0000000..8faa6b0 --- /dev/null +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwIndexConfigServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.dw.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.dw.mapper.DwIndexConfigMapper; +import com.ruoyi.dw.domain.DwIndexConfig; +import com.ruoyi.dw.service.IDwIndexConfigService; + +/** + * 调查问卷统计展示Service业务层处理 + * + * @author sunyg + * @date 2025-06-27 + */ +@Service +public class DwIndexConfigServiceImpl implements IDwIndexConfigService +{ + @Autowired + private DwIndexConfigMapper dwIndexConfigMapper; + + /** + * 查询调查问卷统计展示 + * + * @param id 调查问卷统计展示主键 + * @return 调查问卷统计展示 + */ + @Override + public DwIndexConfig selectDwIndexConfigById(Long id) + { + return dwIndexConfigMapper.selectDwIndexConfigById(id); + } + + /** + * 查询调查问卷统计展示列表 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 调查问卷统计展示 + */ + @Override + public List selectDwIndexConfigList(DwIndexConfig dwIndexConfig) + { + return dwIndexConfigMapper.selectDwIndexConfigList(dwIndexConfig); + } + + /** + * 新增调查问卷统计展示 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 结果 + */ + @Override + public int insertDwIndexConfig(DwIndexConfig dwIndexConfig) + { + dwIndexConfig.setCreateTime(DateUtils.getNowDate()); + return dwIndexConfigMapper.insertDwIndexConfig(dwIndexConfig); + } + + /** + * 修改调查问卷统计展示 + * + * @param dwIndexConfig 调查问卷统计展示 + * @return 结果 + */ + @Override + public int updateDwIndexConfig(DwIndexConfig dwIndexConfig) + { + dwIndexConfig.setUpdateTime(DateUtils.getNowDate()); + return dwIndexConfigMapper.updateDwIndexConfig(dwIndexConfig); + } + + /** + * 批量删除调查问卷统计展示 + * + * @param ids 需要删除的调查问卷统计展示主键 + * @return 结果 + */ + @Override + public int deleteDwIndexConfigByIds(Long[] ids) + { + return dwIndexConfigMapper.deleteDwIndexConfigByIds(ids); + } + + /** + * 删除调查问卷统计展示信息 + * + * @param id 调查问卷统计展示主键 + * @return 结果 + */ + @Override + public int deleteDwIndexConfigById(Long id) + { + return dwIndexConfigMapper.deleteDwIndexConfigById(id); + } +} diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java index 02b6cf9..7583791 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java @@ -90,4 +90,11 @@ public class DwQuestionServiceImpl implements IDwQuestionService { return dwQuestionMapper.deleteDwQuestionById(id); } + + @Override + public int importDwQuestion(List dwQuestionList) { + + return 0; + } + } diff --git a/ruoyi-dw/src/main/resources/mapper/dw/DwIndexConfigMapper.xml b/ruoyi-dw/src/main/resources/mapper/dw/DwIndexConfigMapper.xml new file mode 100644 index 0000000..15ebf97 --- /dev/null +++ b/ruoyi-dw/src/main/resources/mapper/dw/DwIndexConfigMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + select id, index_name, question_id, info_id, index_type, create_by, create_time, update_by, update_time, remark from dw_index_config + + + + + + + + insert into dw_index_config + + index_name, + question_id, + info_id, + index_type, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{indexName}, + #{questionId}, + #{infoId}, + #{indexType}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update dw_index_config + + index_name = #{indexName}, + question_id = #{questionId}, + info_id = #{infoId}, + index_type = #{indexType}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from dw_index_config where id = #{id} + + + + delete from dw_index_config where id in + + #{id} + + + \ No newline at end of file