From 6cb436904f82b2496293fc1f5f1c9e575c5e2699 Mon Sep 17 00:00:00 2001 From: hshansha Date: Fri, 11 Jul 2025 08:55:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=87=E6=80=BB=E6=80=BB=E8=A1=A8=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kaohe/controller/KhGatherController.java | 165 +++++++++++ .../java/com/ruoyi/kaohe/domain/KhGather.java | 87 ++++++ .../ruoyi/kaohe/mapper/KhGatherMapper.java | 61 ++++ .../ruoyi/kaohe/service/IKhGatherService.java | 61 ++++ .../service/impl/KhGatherServiceImpl.java | 96 +++++++ .../resources/mapper/kaohe/KhGatherMapper.xml | 86 ++++++ ruoyi-ui/src/api/kaohe/gather.js | 44 +++ ruoyi-ui/src/views/kaohe/gather/index.vue | 266 ++++++++++++++++++ 8 files changed, 866 insertions(+) create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhGatherController.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhGather.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhGatherMapper.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhGatherService.java create mode 100644 ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhGatherServiceImpl.java create mode 100644 ruoyi-kaohe/src/main/resources/mapper/kaohe/KhGatherMapper.xml create mode 100644 ruoyi-ui/src/api/kaohe/gather.js create mode 100644 ruoyi-ui/src/views/kaohe/gather/index.vue diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhGatherController.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhGatherController.java new file mode 100644 index 0000000..4453b0d --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhGatherController.java @@ -0,0 +1,165 @@ +package com.ruoyi.kaohe.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +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.kaohe.domain.KhGather; +import com.ruoyi.kaohe.service.IKhGatherService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 生成汇总Controller + * + * @author hs + * @date 2025-07-10 + */ +@RestController +@RequestMapping("/kaohe/gather") +public class KhGatherController extends BaseController +{ + @Autowired + private IKhGatherService khGatherService; + + /** + * 查询生成汇总列表 + */ + @PreAuthorize("@ss.hasPermi('kaohe:gather:list')") + @PostMapping("/generateSum") + public AjaxResult generateSum(JSONObject json) + { + String hz_name = json.getString("title"); + JSONArray data = json.getJSONArray("data"); + //---------------------------------------------------------------------------------------------- + for (int i = 0; i < data.size(); i++) { + JSONObject jsonObject = data.getJSONObject(i); + String type1 = jsonObject.getString("type"); + if(type1.equals("0")){ + JSONArray data1 = jsonObject.getJSONArray("data"); + }else{ + + } + } + + /*{ + "hz_name": "教学单位领导班子考核总分", + "data": [{ + "type": 0, + "title": "二级单位目标管理与绩效考核成绩", + "zb": 0.7, + "data": [{ + "type": 1, + "title": "党建与行政目标任务", + "id": 1, + "zb": 0.1 + }, + { + "type": 1, + "title": "事业发展", + "id": 3, + "zb": 0.9 + } + ] + }, + { + "type": 1, + "title": "民主测评", + "id": 2, + "zb": 0.3 + }, + { + "type": 1, + "title": "创新", + "id": 3 + } + ] +}*/ + return AjaxResult.success(); + } + + + /** + * 查询生成汇总列表 + */ + @PreAuthorize("@ss.hasPermi('kaohe:gather:list')") + @GetMapping("/list") + public TableDataInfo list(KhGather khGather) + { + startPage(); + List list = khGatherService.selectKhGatherList(khGather); + return getDataTable(list); + } + + /** + * 导出生成汇总列表 + */ + @PreAuthorize("@ss.hasPermi('kaohe:gather:export')") + @Log(title = "生成汇总", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, KhGather khGather) + { + List list = khGatherService.selectKhGatherList(khGather); + ExcelUtil util = new ExcelUtil(KhGather.class); + util.exportExcel(response, list, "生成汇总数据"); + } + + /** + * 获取生成汇总详细信息 + */ + @PreAuthorize("@ss.hasPermi('kaohe:gather:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(khGatherService.selectKhGatherById(id)); + } + + /** + * 新增生成汇总 + */ + @PreAuthorize("@ss.hasPermi('kaohe:gather:add')") + @Log(title = "生成汇总", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody KhGather khGather) + { + return toAjax(khGatherService.insertKhGather(khGather)); + } + + /** + * 修改生成汇总 + */ + @PreAuthorize("@ss.hasPermi('kaohe:gather:edit')") + @Log(title = "生成汇总", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody KhGather khGather) + { + return toAjax(khGatherService.updateKhGather(khGather)); + } + + /** + * 删除生成汇总 + */ + @PreAuthorize("@ss.hasPermi('kaohe:gather:remove')") + @Log(title = "生成汇总", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(khGatherService.deleteKhGatherByIds(ids)); + } +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhGather.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhGather.java new file mode 100644 index 0000000..4a90bbd --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhGather.java @@ -0,0 +1,87 @@ +package com.ruoyi.kaohe.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; + +/** + * 生成汇总对象 kh_gather + * + * @author hs + * @date 2025-07-10 + */ +public class KhGather extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 一级标题 */ + @Excel(name = "一级标题") + private String hzName; + + /** 表头 */ + @Excel(name = "表头") + private String tableHeader; + + /** 表数据 */ + @Excel(name = "表数据") + private String tableData; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setHzName(String hzName) + { + this.hzName = hzName; + } + + public String getHzName() + { + return hzName; + } + + public void setTableHeader(String tableHeader) + { + this.tableHeader = tableHeader; + } + + public String getTableHeader() + { + return tableHeader; + } + + public void setTableData(String tableData) + { + this.tableData = tableData; + } + + public String getTableData() + { + return tableData; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("hzName", getHzName()) + .append("tableHeader", getTableHeader()) + .append("tableData", getTableData()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhGatherMapper.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhGatherMapper.java new file mode 100644 index 0000000..f13d0d8 --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/mapper/KhGatherMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.kaohe.mapper; + +import java.util.List; +import com.ruoyi.kaohe.domain.KhGather; + +/** + * 生成汇总Mapper接口 + * + * @author hs + * @date 2025-07-10 + */ +public interface KhGatherMapper +{ + /** + * 查询生成汇总 + * + * @param id 生成汇总主键 + * @return 生成汇总 + */ + public KhGather selectKhGatherById(Long id); + + /** + * 查询生成汇总列表 + * + * @param khGather 生成汇总 + * @return 生成汇总集合 + */ + public List selectKhGatherList(KhGather khGather); + + /** + * 新增生成汇总 + * + * @param khGather 生成汇总 + * @return 结果 + */ + public int insertKhGather(KhGather khGather); + + /** + * 修改生成汇总 + * + * @param khGather 生成汇总 + * @return 结果 + */ + public int updateKhGather(KhGather khGather); + + /** + * 删除生成汇总 + * + * @param id 生成汇总主键 + * @return 结果 + */ + public int deleteKhGatherById(Long id); + + /** + * 批量删除生成汇总 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteKhGatherByIds(Long[] ids); +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhGatherService.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhGatherService.java new file mode 100644 index 0000000..951a3ce --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/IKhGatherService.java @@ -0,0 +1,61 @@ +package com.ruoyi.kaohe.service; + +import java.util.List; +import com.ruoyi.kaohe.domain.KhGather; + +/** + * 生成汇总Service接口 + * + * @author hs + * @date 2025-07-10 + */ +public interface IKhGatherService +{ + /** + * 查询生成汇总 + * + * @param id 生成汇总主键 + * @return 生成汇总 + */ + public KhGather selectKhGatherById(Long id); + + /** + * 查询生成汇总列表 + * + * @param khGather 生成汇总 + * @return 生成汇总集合 + */ + public List selectKhGatherList(KhGather khGather); + + /** + * 新增生成汇总 + * + * @param khGather 生成汇总 + * @return 结果 + */ + public int insertKhGather(KhGather khGather); + + /** + * 修改生成汇总 + * + * @param khGather 生成汇总 + * @return 结果 + */ + public int updateKhGather(KhGather khGather); + + /** + * 批量删除生成汇总 + * + * @param ids 需要删除的生成汇总主键集合 + * @return 结果 + */ + public int deleteKhGatherByIds(Long[] ids); + + /** + * 删除生成汇总信息 + * + * @param id 生成汇总主键 + * @return 结果 + */ + public int deleteKhGatherById(Long id); +} diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhGatherServiceImpl.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhGatherServiceImpl.java new file mode 100644 index 0000000..87f4787 --- /dev/null +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/service/impl/KhGatherServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.kaohe.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.kaohe.mapper.KhGatherMapper; +import com.ruoyi.kaohe.domain.KhGather; +import com.ruoyi.kaohe.service.IKhGatherService; + +/** + * 生成汇总Service业务层处理 + * + * @author hs + * @date 2025-07-10 + */ +@Service +public class KhGatherServiceImpl implements IKhGatherService +{ + @Autowired + private KhGatherMapper khGatherMapper; + + /** + * 查询生成汇总 + * + * @param id 生成汇总主键 + * @return 生成汇总 + */ + @Override + public KhGather selectKhGatherById(Long id) + { + return khGatherMapper.selectKhGatherById(id); + } + + /** + * 查询生成汇总列表 + * + * @param khGather 生成汇总 + * @return 生成汇总 + */ + @Override + public List selectKhGatherList(KhGather khGather) + { + return khGatherMapper.selectKhGatherList(khGather); + } + + /** + * 新增生成汇总 + * + * @param khGather 生成汇总 + * @return 结果 + */ + @Override + public int insertKhGather(KhGather khGather) + { + khGather.setCreateTime(DateUtils.getNowDate()); + return khGatherMapper.insertKhGather(khGather); + } + + /** + * 修改生成汇总 + * + * @param khGather 生成汇总 + * @return 结果 + */ + @Override + public int updateKhGather(KhGather khGather) + { + khGather.setUpdateTime(DateUtils.getNowDate()); + return khGatherMapper.updateKhGather(khGather); + } + + /** + * 批量删除生成汇总 + * + * @param ids 需要删除的生成汇总主键 + * @return 结果 + */ + @Override + public int deleteKhGatherByIds(Long[] ids) + { + return khGatherMapper.deleteKhGatherByIds(ids); + } + + /** + * 删除生成汇总信息 + * + * @param id 生成汇总主键 + * @return 结果 + */ + @Override + public int deleteKhGatherById(Long id) + { + return khGatherMapper.deleteKhGatherById(id); + } +} diff --git a/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhGatherMapper.xml b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhGatherMapper.xml new file mode 100644 index 0000000..568c451 --- /dev/null +++ b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhGatherMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + select id, hz_name, table_header, table_data, create_by, create_time, update_by, update_time, remark from kh_gather + + + + + + + + insert into kh_gather + + hz_name, + table_header, + table_data, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{hzName}, + #{tableHeader}, + #{tableData}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update kh_gather + + hz_name = #{hzName}, + table_header = #{tableHeader}, + table_data = #{tableData}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from kh_gather where id = #{id} + + + + delete from kh_gather where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/kaohe/gather.js b/ruoyi-ui/src/api/kaohe/gather.js new file mode 100644 index 0000000..a2b5f76 --- /dev/null +++ b/ruoyi-ui/src/api/kaohe/gather.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询生成汇总列表 +export function listGather(query) { + return request({ + url: '/kaohe/gather/list', + method: 'get', + params: query + }) +} + +// 查询生成汇总详细 +export function getGather(id) { + return request({ + url: '/kaohe/gather/' + id, + method: 'get' + }) +} + +// 新增生成汇总 +export function addGather(data) { + return request({ + url: '/kaohe/gather', + method: 'post', + data: data + }) +} + +// 修改生成汇总 +export function updateGather(data) { + return request({ + url: '/kaohe/gather', + method: 'put', + data: data + }) +} + +// 删除生成汇总 +export function delGather(id) { + return request({ + url: '/kaohe/gather/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/kaohe/gather/index.vue b/ruoyi-ui/src/views/kaohe/gather/index.vue new file mode 100644 index 0000000..4d48573 --- /dev/null +++ b/ruoyi-ui/src/views/kaohe/gather/index.vue @@ -0,0 +1,266 @@ + + +