diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/MyPageIndexDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyPageIndexDao.java new file mode 100644 index 0000000..7fa3f44 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyPageIndexDao.java @@ -0,0 +1,15 @@ +package com.jeesite.modules.biz.dao; + +import com.jeesite.common.dao.CrudDao; +import com.jeesite.common.mybatis.annotation.MyBatisDao; +import com.jeesite.modules.biz.entity.MyPageIndex; + +/** + * 指标数据表 DAO 接口 + * @author gaoxq + * @version 2026-03-23 + */ +@MyBatisDao(dataSourceName="work") +public interface MyPageIndexDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/entity/MyPageIndex.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyPageIndex.java new file mode 100644 index 0000000..6d6a1b1 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyPageIndex.java @@ -0,0 +1,100 @@ +package com.jeesite.modules.biz.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.jeesite.common.mybatis.annotation.JoinTable; +import com.jeesite.common.mybatis.annotation.JoinTable.Type; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; + +import com.jeesite.common.entity.DataEntity; +import com.jeesite.common.mybatis.annotation.Column; +import com.jeesite.common.mybatis.annotation.Table; +import com.jeesite.common.mybatis.mapper.query.QueryType; +import com.jeesite.common.utils.excel.annotation.ExcelField; +import com.jeesite.common.utils.excel.annotation.ExcelField.Align; +import com.jeesite.common.utils.excel.annotation.ExcelFields; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 指标数据表 Entity + * + * @author gaoxq + * @version 2026-03-23 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "my_page_index", alias = "a", label = "指标信息", columns = { + @Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdate = false, isUpdateForce = true), + @Column(name = "index_id", attrName = "indexId", label = "唯一标识", isPK = true), + @Column(name = "module", attrName = "module", label = "模块名称"), + @Column(name = "module_code", attrName = "moduleCode", label = "模块编码"), + @Column(name = "title", attrName = "title", label = "说明描述", queryType = QueryType.LIKE), + @Column(name = "value", attrName = "value", label = "数值", isQuery = false, isUpdateForce = true), + @Column(name = "label", attrName = "label", label = "名称"), + @Column(name = "icon_img", attrName = "iconImg", label = "图片路径", isQuery = false), + @Column(name = "icon_filter", attrName = "iconFilter", label = "图标颜色", isQuery = false), + @Column(name = "sort", attrName = "sort", label = "序号", isQuery = false), + @Column(name = "index_code", attrName = "indexCode", label = "指标编号"), +}, orderBy = "a.create_time DESC,index_code,sort " +) +@Data +public class MyPageIndex extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private Date createTime; // 记录时间 + private String indexId; // 唯一标识 + private String module; // 模块名称 + private String moduleCode; // 模块编码 + private String title; // 说明描述 + private Double value; // 数值 + private String label; // 名称 + private String iconImg; // 图片路径 + private String iconFilter; // 图标颜色 + private Integer sort; // 序号 + private String indexCode; // 指标编号 + + @ExcelFields({ + @ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"), + @ExcelField(title = "唯一标识", attrName = "indexId", align = Align.CENTER, sort = 20), + @ExcelField(title = "模块名称", attrName = "module", align = Align.CENTER, sort = 30), + @ExcelField(title = "模块编码", attrName = "moduleCode", align = Align.CENTER, sort = 40), + @ExcelField(title = "说明描述", attrName = "title", align = Align.CENTER, sort = 50), + @ExcelField(title = "数值", attrName = "value", align = Align.CENTER, sort = 60), + @ExcelField(title = "名称", attrName = "label", align = Align.CENTER, sort = 70), + @ExcelField(title = "图片路径", attrName = "iconImg", align = Align.CENTER, sort = 80), + @ExcelField(title = "图标颜色", attrName = "iconFilter", align = Align.CENTER, sort = 90), + @ExcelField(title = "序号", attrName = "sort", align = Align.CENTER, sort = 100), + @ExcelField(title = "指标编号", attrName = "indexCode", align = Align.CENTER, sort = 110), + }) + public MyPageIndex() { + this(null); + } + + public MyPageIndex(String id) { + super(id); + } + + public Date getCreateTime_gte() { + return sqlMap.getWhere().getValue("create_time", QueryType.GTE); + } + + public void setCreateTime_gte(Date createTime) { + sqlMap.getWhere().and("create_time", QueryType.GTE, createTime); + } + + public Date getCreateTime_lte() { + return sqlMap.getWhere().getValue("create_time", QueryType.LTE); + } + + public void setCreateTime_lte(Date createTime) { + sqlMap.getWhere().and("create_time", QueryType.LTE, createTime); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/service/MyPageIndexService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/MyPageIndexService.java new file mode 100644 index 0000000..767eec6 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/MyPageIndexService.java @@ -0,0 +1,134 @@ +package com.jeesite.modules.biz.service; + +import java.util.List; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.jeesite.common.entity.Page; +import com.jeesite.common.service.CrudService; +import com.jeesite.modules.biz.entity.MyPageIndex; +import com.jeesite.modules.biz.dao.MyPageIndexDao; +import com.jeesite.common.service.ServiceException; +import com.jeesite.common.config.Global; +import com.jeesite.common.validator.ValidatorUtils; +import com.jeesite.common.utils.excel.ExcelImport; +import org.springframework.web.multipart.MultipartFile; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; + +/** + * 指标数据表 Service + * @author gaoxq + * @version 2026-03-23 + */ +@Service +public class MyPageIndexService extends CrudService { + + /** + * 获取单条数据 + * @param myPageIndex 主键 + */ + @Override + public MyPageIndex get(MyPageIndex myPageIndex) { + return super.get(myPageIndex); + } + + /** + * 查询分页数据 + * @param myPageIndex 查询条件 + * @param myPageIndex page 分页对象 + */ + @Override + public Page findPage(MyPageIndex myPageIndex) { + return super.findPage(myPageIndex); + } + + /** + * 查询列表数据 + * @param myPageIndex 查询条件 + */ + @Override + public List findList(MyPageIndex myPageIndex) { + return super.findList(myPageIndex); + } + + /** + * 保存数据(插入或更新) + * @param myPageIndex 数据对象 + */ + @Override + @Transactional + public void save(MyPageIndex myPageIndex) { + super.save(myPageIndex); + } + + /** + * 导入数据 + * @param file 导入的数据文件 + */ + @Transactional + public String importData(MultipartFile file) { + if (file == null){ + throw new ServiceException(text("请选择导入的数据文件!")); + } + int successNum = 0; int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + try(ExcelImport ei = new ExcelImport(file, 2, 0)){ + List list = ei.getDataList(MyPageIndex.class); + for (MyPageIndex myPageIndex : list) { + try{ + ValidatorUtils.validateWithException(myPageIndex); + this.save(myPageIndex); + successNum++; + successMsg.append("
" + successNum + "、编号 " + myPageIndex.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + myPageIndex.getId() + " 导入失败:"; + if (e instanceof ConstraintViolationException){ + ConstraintViolationException cve = (ConstraintViolationException)e; + for (ConstraintViolation violation : cve.getConstraintViolations()) { + msg += Global.getText(violation.getMessage()) + " ("+violation.getPropertyPath()+")"; + } + }else{ + msg += e.getMessage(); + } + failureMsg.append(msg); + logger.error(msg, e); + } + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + failureMsg.append(e.getMessage()); + return failureMsg.toString(); + } + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + }else{ + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + /** + * 更新状态 + * @param myPageIndex 数据对象 + */ + @Override + @Transactional + public void updateStatus(MyPageIndex myPageIndex) { + super.updateStatus(myPageIndex); + } + + /** + * 删除数据 + * @param myPageIndex 数据对象 + */ + @Override + @Transactional + public void delete(MyPageIndex myPageIndex) { + super.delete(myPageIndex); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/MyPageIndexController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/MyPageIndexController.java new file mode 100644 index 0000000..7550af3 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/MyPageIndexController.java @@ -0,0 +1,157 @@ +package com.jeesite.modules.biz.web; + +import java.util.List; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.jeesite.common.config.Global; +import com.jeesite.common.collect.ListUtils; +import com.jeesite.common.entity.Page; +import com.jeesite.common.lang.DateUtils; +import com.jeesite.common.utils.excel.ExcelExport; +import com.jeesite.common.utils.excel.annotation.ExcelField.Type; +import org.springframework.web.multipart.MultipartFile; +import com.jeesite.common.web.BaseController; +import com.jeesite.modules.biz.entity.MyPageIndex; +import com.jeesite.modules.biz.service.MyPageIndexService; + +/** + * 指标数据表 Controller + * + * @author gaoxq + * @version 2026-03-23 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/myPageIndex") +public class MyPageIndexController extends BaseController { + + private final MyPageIndexService myPageIndexService; + + public MyPageIndexController(MyPageIndexService myPageIndexService) { + this.myPageIndexService = myPageIndexService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public MyPageIndex get(String indexId, boolean isNewRecord) { + return myPageIndexService.get(indexId, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:myPageIndex:view") + @RequestMapping(value = {"list", ""}) + public String list(MyPageIndex myPageIndex, Model model) { + model.addAttribute("myPageIndex", myPageIndex); + return "modules/biz/myPageIndexList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:myPageIndex:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(MyPageIndex myPageIndex, HttpServletRequest request, HttpServletResponse response) { + myPageIndex.setPage(new Page<>(request, response)); + Page page = myPageIndexService.findPage(myPageIndex); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:myPageIndex:view") + @RequestMapping(value = "form") + public String form(MyPageIndex myPageIndex, Model model) { + model.addAttribute("myPageIndex", myPageIndex); + return "modules/biz/myPageIndexForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:myPageIndex:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated MyPageIndex myPageIndex) { + myPageIndexService.save(myPageIndex); + return renderResult(Global.TRUE, text("保存指标成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("biz:myPageIndex:view") + @RequestMapping(value = "exportData") + public void exportData(MyPageIndex myPageIndex, HttpServletResponse response) { + List list = myPageIndexService.findList(myPageIndex); + String fileName = "指标" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try (ExcelExport ee = new ExcelExport("指标", MyPageIndex.class)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("biz:myPageIndex:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + MyPageIndex myPageIndex = new MyPageIndex(); + List list = ListUtils.newArrayList(myPageIndex); + String fileName = "指标模板.xlsx"; + try (ExcelExport ee = new ExcelExport("指标", MyPageIndex.class, Type.IMPORT)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("biz:myPageIndex:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = myPageIndexService.importData(file); + return renderResult(Global.TRUE, "posfull:" + message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:" + ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:myPageIndex:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(MyPageIndex myPageIndex) { + myPageIndexService.delete(myPageIndex); + return renderResult(Global.TRUE, text("删除指标成功!")); + } + + /** + * 列表数据 + */ + @RequestMapping(value = "listAll") + @ResponseBody + public List listAll(MyPageIndex myPageIndex) { + return myPageIndexService.findList(myPageIndex); + } + +} \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/biz/MyPageIndexDao.xml b/web-api/src/main/resources/mappings/modules/biz/MyPageIndexDao.xml new file mode 100644 index 0000000..009f415 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/MyPageIndexDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-expense.svg b/web-vue/packages/assets/icons/erp-expense.svg new file mode 100644 index 0000000..9197be3 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-expense.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-fencheng.svg b/web-vue/packages/assets/icons/erp-fencheng.svg new file mode 100644 index 0000000..47faa5f --- /dev/null +++ b/web-vue/packages/assets/icons/erp-fencheng.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-income.svg b/web-vue/packages/assets/icons/erp-income.svg new file mode 100644 index 0000000..6a9b3f8 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-income.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-jiaoyizhichu.svg b/web-vue/packages/assets/icons/erp-jiaoyizhichu.svg new file mode 100644 index 0000000..9318e49 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-jiaoyizhichu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-jinglirun.svg b/web-vue/packages/assets/icons/erp-jinglirun.svg new file mode 100644 index 0000000..7d3e878 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-jinglirun.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-lirunfenxi.svg b/web-vue/packages/assets/icons/erp-lirunfenxi.svg new file mode 100644 index 0000000..8836ed0 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-lirunfenxi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-shouru.svg b/web-vue/packages/assets/icons/erp-shouru.svg new file mode 100644 index 0000000..1ea57b7 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-shouru.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-zhichu.svg b/web-vue/packages/assets/icons/erp-zhichu.svg new file mode 100644 index 0000000..24d7197 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-zhichu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/assets/icons/erp-zongshouru.svg b/web-vue/packages/assets/icons/erp-zongshouru.svg new file mode 100644 index 0000000..816a8b7 --- /dev/null +++ b/web-vue/packages/assets/icons/erp-zongshouru.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-vue/packages/biz/api/biz/myPageIndex.ts b/web-vue/packages/biz/api/biz/myPageIndex.ts new file mode 100644 index 0000000..5fcccbd --- /dev/null +++ b/web-vue/packages/biz/api/biz/myPageIndex.ts @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2013-Now https://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. + * @author gaoxq + */ +import { defHttp } from '@jeesite/core/utils/http/axios'; +import { useGlobSetting } from '@jeesite/core/hooks/setting'; +import { BasicModel, Page } from '@jeesite/core/api/model/baseModel'; +import { UploadApiResult } from '@jeesite/core/api/sys/upload'; +import { UploadFileParams } from '@jeesite/types/axios'; +import { AxiosProgressEvent } from 'axios'; + +const { ctxPath, adminPath } = useGlobSetting(); + +export interface MyPageIndex extends BasicModel { + createTime?: string; // 记录时间 + indexId?: string; // 唯一标识 + module: string; // 模块名称 + moduleCode: string; // 模块编码 + title: string; // 说明描述 + value?: number; // 数值 + label?: string; // 名称 + iconImg: string; // 图片路径 + iconFilter?: string; // 图标颜色 + sort: number; // 序号 + indexCode: string; // 指标编号 +} + +export const myPageIndexList = (params?: MyPageIndex | any) => + defHttp.get({ url: adminPath + '/biz/myPageIndex/list', params }); + +export const myPageIndexListAll = (params?: MyPageIndex | any) => + defHttp.get({ url: adminPath + '/biz/myPageIndex/listAll', params }); + +export const myPageIndexListData = (params?: MyPageIndex | any) => + defHttp.post>({ url: adminPath + '/biz/myPageIndex/listData', params }); + +export const myPageIndexForm = (params?: MyPageIndex | any) => + defHttp.get({ url: adminPath + '/biz/myPageIndex/form', params }); + +export const myPageIndexSave = (params?: any, data?: MyPageIndex | any) => + defHttp.postJson({ url: adminPath + '/biz/myPageIndex/save', params, data }); + +export const myPageIndexImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/biz/myPageIndex/importData', + onUploadProgress, + }, + params, + ); + +export const myPageIndexDelete = (params?: MyPageIndex | any) => + defHttp.get({ url: adminPath + '/biz/myPageIndex/delete', params }); diff --git a/web-vue/packages/biz/views/biz/myPageIndex/form.vue b/web-vue/packages/biz/views/biz/myPageIndex/form.vue new file mode 100644 index 0000000..b607217 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myPageIndex/form.vue @@ -0,0 +1,167 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myPageIndex/list.vue b/web-vue/packages/biz/views/biz/myPageIndex/list.vue new file mode 100644 index 0000000..5fc8c20 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myPageIndex/list.vue @@ -0,0 +1,259 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myScreen/index.vue b/web-vue/packages/biz/views/biz/myScreen/index.vue new file mode 100644 index 0000000..02409e3 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myScreen/index.vue @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/web-vue/packages/core/layouts/views/screen/setting/components/Erp.vue b/web-vue/packages/core/layouts/screen/setting/components/Erp.vue similarity index 100% rename from web-vue/packages/core/layouts/views/screen/setting/components/Erp.vue rename to web-vue/packages/core/layouts/screen/setting/components/Erp.vue diff --git a/web-vue/packages/core/layouts/views/screen/setting/components/Home.vue b/web-vue/packages/core/layouts/screen/setting/components/Home.vue similarity index 100% rename from web-vue/packages/core/layouts/views/screen/setting/components/Home.vue rename to web-vue/packages/core/layouts/screen/setting/components/Home.vue diff --git a/web-vue/packages/core/layouts/views/screen/setting/components/Sys.vue b/web-vue/packages/core/layouts/screen/setting/components/Sys.vue similarity index 100% rename from web-vue/packages/core/layouts/views/screen/setting/components/Sys.vue rename to web-vue/packages/core/layouts/screen/setting/components/Sys.vue diff --git a/web-vue/packages/core/layouts/views/screen/setting/components/Work.vue b/web-vue/packages/core/layouts/screen/setting/components/Work.vue similarity index 100% rename from web-vue/packages/core/layouts/views/screen/setting/components/Work.vue rename to web-vue/packages/core/layouts/screen/setting/components/Work.vue diff --git a/web-vue/packages/core/layouts/views/screen/setting/index.vue b/web-vue/packages/core/layouts/screen/setting/index.vue similarity index 100% rename from web-vue/packages/core/layouts/views/screen/setting/index.vue rename to web-vue/packages/core/layouts/screen/setting/index.vue diff --git a/web-vue/packages/core/layouts/views/screen/welcome/Erp/components/ChartTop.vue b/web-vue/packages/core/layouts/screen/welcome/Erp/components/ChartTop.vue similarity index 87% rename from web-vue/packages/core/layouts/views/screen/welcome/Erp/components/ChartTop.vue rename to web-vue/packages/core/layouts/screen/welcome/Erp/components/ChartTop.vue index 9d771ae..f1e8619 100644 --- a/web-vue/packages/core/layouts/views/screen/welcome/Erp/components/ChartTop.vue +++ b/web-vue/packages/core/layouts/screen/welcome/Erp/components/ChartTop.vue @@ -3,11 +3,11 @@
- + />
{{ item.module }}
@@ -22,17 +22,19 @@
-