From 2de5b51e079f5f3f66030c572993811e9445d448 Mon Sep 17 00:00:00 2001 From: gaoxq <376340421@qq.com> Date: Wed, 10 Dec 2025 00:08:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=84=E8=AD=A6=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeesite/modules/app/utils/DateUtils.java | 55 ------ .../com/jeesite/modules/app/utils/vDate.java | 52 ++++++ .../modules/erp/dao/ErpSummaryAllDao.java | 15 ++ .../modules/erp/entity/ErpSummaryAll.java | 83 +++++++++ .../erp/service/ErpSummaryAllService.java | 135 +++++++++++++++ .../erp/web/ErpSummaryAllController.java | 157 ++++++++++++++++++ .../mappings/modules/erp/ErpSummaryAllDao.xml | 15 ++ .../dataReport/erp/components/ChartLine.vue | 63 +++---- .../dataReport/erp/components/ChartPie.vue | 17 +- .../biz/views/biz/dataReport/erp/index.vue | 109 ++++++++++-- web-vue/packages/erp/api/erp/summaryAll.ts | 53 ++++++ 11 files changed, 638 insertions(+), 116 deletions(-) create mode 100644 web-api/src/main/java/com/jeesite/modules/erp/dao/ErpSummaryAllDao.java create mode 100644 web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java create mode 100644 web-api/src/main/java/com/jeesite/modules/erp/service/ErpSummaryAllService.java create mode 100644 web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java create mode 100644 web-api/src/main/resources/mappings/modules/erp/ErpSummaryAllDao.xml create mode 100644 web-vue/packages/erp/api/erp/summaryAll.ts diff --git a/web-api/src/main/java/com/jeesite/modules/app/utils/DateUtils.java b/web-api/src/main/java/com/jeesite/modules/app/utils/DateUtils.java index da912a16..044bc668 100644 --- a/web-api/src/main/java/com/jeesite/modules/app/utils/DateUtils.java +++ b/web-api/src/main/java/com/jeesite/modules/app/utils/DateUtils.java @@ -7,60 +7,5 @@ import java.util.Date; public class DateUtils { - // 日期格式化器(线程安全,复用提升性能) - private static final DateTimeFormatter DAY_FORMATTER = DateTimeFormatter.ISO_LOCAL_DATE; // yyyy-MM-dd - private static final DateTimeFormatter MONTH_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM"); // yyyy-MM - private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd"); - - public static String calculateStartCycleCode(String cycleType) { - // 默认使用当前日期计算,留参便于测试时指定日期 - return calculateStartCycleCode(cycleType, LocalDate.now()); - } - - /** - * 重载方法:支持指定基准日期计算起始cycleCode(便于测试) - * - * @param cycleType 周期类型(D:日, M:月, Q:季度, Y:年) - * @param baseDate 基准日期(以此日期为起点计算时间范围) - * @return 起始cycleCode(符合对应格式),未识别类型返回null - */ - public static String calculateStartCycleCode(String cycleType, LocalDate baseDate) { - if (baseDate == null) { - throw new IllegalArgumentException("基准日期不能为null"); - } - if (cycleType == null) { - return null; - } - - return switch (cycleType) { - case "D" -> - // 日:最近30天,格式 yyyy-MM-dd - baseDate.minusDays(30).format(DAY_FORMATTER); - case "M" -> - // 月:最近1年,格式 yyyy-MM - baseDate.minusYears(1).format(MONTH_FORMATTER); - case "Q" -> - // 季度:最近3年,格式 yyyy-Qx - getQuarterCycleCode(baseDate.minusYears(3)); - case "Y" -> - // 年:最近6年,格式 yyyy - String.valueOf(baseDate.minusYears(6).getYear()); - default -> - // 未识别的周期类型,返回null - null; - }; - } - - /** - * 计算指定日期对应的季度cycleCode(格式:yyyy-Qx) - * - * @param date 日期 - * @return 季度cycleCode(如2023-Q3) - */ - private static String getQuarterCycleCode(LocalDate date) { - int month = date.getMonthValue(); // 1-12月 - int quarter = (month - 1) / 3 + 1; - return String.format("%d-Q%d", date.getYear(), quarter); - } } diff --git a/web-api/src/main/java/com/jeesite/modules/app/utils/vDate.java b/web-api/src/main/java/com/jeesite/modules/app/utils/vDate.java index 48311c7d..5094fcf2 100644 --- a/web-api/src/main/java/com/jeesite/modules/app/utils/vDate.java +++ b/web-api/src/main/java/com/jeesite/modules/app/utils/vDate.java @@ -111,4 +111,56 @@ public class vDate { result.append(seconds).append("秒"); return result.toString(); } + + + public static String calculateStartCycleCode(String cycleType) { + // 默认使用当前日期计算,留参便于测试时指定日期 + return calculateStartCycleCode(cycleType, LocalDate.now()); + } + + /** + * 重载方法:支持指定基准日期计算起始cycleCode(便于测试) + * + * @param cycleType 周期类型(D:日, M:月, Q:季度, Y:年) + * @param baseDate 基准日期(以此日期为起点计算时间范围) + * @return 起始cycleCode(符合对应格式),未识别类型返回null + */ + public static String calculateStartCycleCode(String cycleType, LocalDate baseDate) { + if (baseDate == null) { + throw new IllegalArgumentException("基准日期不能为null"); + } + if (cycleType == null) { + return null; + } + + return switch (cycleType) { + case "D" -> + // 日:最近30天,格式 yyyy-MM-dd + baseDate.minusDays(30).format(DAY_FORMATTER); + case "M" -> + // 月:最近1年,格式 yyyy-MM + baseDate.minusYears(1).format(MONTH_FORMATTER); + case "Q" -> + // 季度:最近3年,格式 yyyy-Qx + getQuarterCycleCode(baseDate.minusYears(3)); + case "Y" -> + // 年:最近6年,格式 yyyy + String.valueOf(baseDate.minusYears(6).getYear()); + default -> + // 未识别的周期类型,返回null + null; + }; + } + + /** + * 计算指定日期对应的季度cycleCode(格式:yyyy-Qx) + * + * @param date 日期 + * @return 季度cycleCode(如2023-Q3) + */ + private static String getQuarterCycleCode(LocalDate date) { + int month = date.getMonthValue(); // 1-12月 + int quarter = (month - 1) / 3 + 1; + return String.format("%d-Q%d", date.getYear(), quarter); + } } diff --git a/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpSummaryAllDao.java b/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpSummaryAllDao.java new file mode 100644 index 00000000..9a95d38c --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpSummaryAllDao.java @@ -0,0 +1,15 @@ +package com.jeesite.modules.erp.dao; + +import com.jeesite.common.dao.CrudDao; +import com.jeesite.common.mybatis.annotation.MyBatisDao; +import com.jeesite.modules.erp.entity.ErpSummaryAll; + +/** + * 汇总信息DAO接口 + * @author gaoxq + * @version 2025-12-09 + */ +@MyBatisDao(dataSourceName="work") +public interface ErpSummaryAllDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java new file mode 100644 index 00000000..ee409d1f --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java @@ -0,0 +1,83 @@ +package com.jeesite.modules.erp.entity; + +import java.io.Serializable; +import java.util.Date; + +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 2025-12-09 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "erp_summary_all", alias = "a", label = "汇总信息信息", columns = { + @Column(name = "create_time", attrName = "createTime", label = "记录时间", isQuery = false, isUpdateForce = true), + @Column(name = "id", attrName = "id", label = "主键ID", isPK = true), + @Column(name = "c_date", attrName = "cdate", label = "汇总日期"), + @Column(name = "c_type", attrName = "ctype", label = "交易类型", isQuery = false), + @Column(name = "this_value", attrName = "thisValue", label = "当期金额", isQuery = false, isUpdateForce = true), + @Column(name = "prev_value", attrName = "prevValue", label = "上期金额", isQuery = false, isUpdateForce = true), + @Column(name = "mom_rate", attrName = "momRate", label = "环比", isQuery = false, isUpdateForce = true), + @Column(name = "f_cycle", attrName = "fcycle", label = "周期类型"), +}, orderBy = "a.c_date" +) +@Data +public class ErpSummaryAll extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private Date createTime; // 记录时间 + private String cdate; // 汇总日期 + private String ctype; // 交易类型 + private Double thisValue; // 当期金额 + private Double prevValue; // 上期金额 + private Double momRate; // 环比 + private String fcycle; // 周期类型 + + @ExcelFields({ + @ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"), + @ExcelField(title = "主键ID", attrName = "id", align = Align.CENTER, sort = 20), + @ExcelField(title = "汇总日期", attrName = "cdate", align = Align.CENTER, sort = 30, dataFormat = "yyyy-MM-dd"), + @ExcelField(title = "交易类型", attrName = "ctype", dictType = "transaction_type", align = Align.CENTER, sort = 40), + @ExcelField(title = "当期金额", attrName = "thisValue", align = Align.CENTER, sort = 50), + @ExcelField(title = "上期金额", attrName = "prevValue", align = Align.CENTER, sort = 60), + @ExcelField(title = "环比", attrName = "momRate", align = Align.CENTER, sort = 70), + @ExcelField(title = "周期类型", attrName = "fcycle", dictType = "report_cycle", align = Align.CENTER, sort = 80), + }) + public ErpSummaryAll() { + this(null); + } + + public ErpSummaryAll(String id) { + super(id); + } + + public String getCdate_gte() { + return sqlMap.getWhere().getValue("c_date", QueryType.GTE); + } + + public void setCdate_gte(String cdate) { + sqlMap.getWhere().and("c_date", QueryType.GTE, cdate); + } + + public String getCdate_lte() { + return sqlMap.getWhere().getValue("c_date", QueryType.LTE); + } + + public void setCdate_lte(String cdate) { + sqlMap.getWhere().and("c_date", QueryType.LTE, cdate); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/service/ErpSummaryAllService.java b/web-api/src/main/java/com/jeesite/modules/erp/service/ErpSummaryAllService.java new file mode 100644 index 00000000..e7476130 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/service/ErpSummaryAllService.java @@ -0,0 +1,135 @@ +package com.jeesite.modules.erp.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.erp.entity.ErpSummaryAll; +import com.jeesite.modules.erp.dao.ErpSummaryAllDao; +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 2025-12-09 + */ +@Service +public class ErpSummaryAllService extends CrudService { + + /** + * 获取单条数据 + * @param erpSummaryAll 主键 + */ + @Override + public ErpSummaryAll get(ErpSummaryAll erpSummaryAll) { + return super.get(erpSummaryAll); + } + + /** + * 查询分页数据 + * @param erpSummaryAll 查询条件 + * @param erpSummaryAll page 分页对象 + */ + @Override + public Page findPage(ErpSummaryAll erpSummaryAll) { + return super.findPage(erpSummaryAll); + } + + /** + * 查询列表数据 + * @param erpSummaryAll 查询条件 + */ + @Override + public List findList(ErpSummaryAll erpSummaryAll) { + return super.findList(erpSummaryAll); + } + + /** + * 保存数据(插入或更新) + * @param erpSummaryAll 数据对象 + */ + @Override + @Transactional + public void save(ErpSummaryAll erpSummaryAll) { + super.save(erpSummaryAll); + } + + /** + * 导入数据 + * @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(ErpSummaryAll.class); + for (ErpSummaryAll erpSummaryAll : list) { + try{ + ValidatorUtils.validateWithException(erpSummaryAll); + this.save(erpSummaryAll); + successNum++; + successMsg.append("
" + successNum + "、编号 " + erpSummaryAll.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + erpSummaryAll.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 erpSummaryAll 数据对象 + */ + @Override + @Transactional + public void updateStatus(ErpSummaryAll erpSummaryAll) { + super.updateStatus(erpSummaryAll); + } + + /** + * 删除数据 + * @param erpSummaryAll 数据对象 + */ + @Override + @Transactional + public void delete(ErpSummaryAll erpSummaryAll) { + erpSummaryAll.sqlMap().markIdDelete(); // 逻辑删除时标记ID值 + super.delete(erpSummaryAll); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java new file mode 100644 index 00000000..92c1b1a3 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java @@ -0,0 +1,157 @@ +package com.jeesite.modules.erp.web; + +import java.util.List; + +import com.jeesite.modules.app.utils.vDate; +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.erp.entity.ErpSummaryAll; +import com.jeesite.modules.erp.service.ErpSummaryAllService; + +/** + * 汇总信息Controller + * + * @author gaoxq + * @version 2025-12-09 + */ +@Controller +@RequestMapping(value = "${adminPath}/erp/summaryAll") +public class ErpSummaryAllController extends BaseController { + + private final ErpSummaryAllService erpSummaryAllService; + + public ErpSummaryAllController(ErpSummaryAllService erpSummaryAllService) { + this.erpSummaryAllService = erpSummaryAllService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public ErpSummaryAll get(String id, boolean isNewRecord) { + return erpSummaryAllService.get(id, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("erp:summaryAll:view") + @RequestMapping(value = {"list", ""}) + public String list(ErpSummaryAll erpSummaryAll, Model model) { + model.addAttribute("erpSummaryAll", erpSummaryAll); + return "modules/erp/erpSummaryAllList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("erp:summaryAll:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(ErpSummaryAll erpSummaryAll, HttpServletRequest request, HttpServletResponse response) { + erpSummaryAll.setPage(new Page<>(request, response)); + Page page = erpSummaryAllService.findPage(erpSummaryAll); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("erp:summaryAll:view") + @RequestMapping(value = "form") + public String form(ErpSummaryAll erpSummaryAll, Model model) { + model.addAttribute("erpSummaryAll", erpSummaryAll); + return "modules/erp/erpSummaryAllForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("erp:summaryAll:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated ErpSummaryAll erpSummaryAll) { + erpSummaryAllService.save(erpSummaryAll); + return renderResult(Global.TRUE, text("保存汇总信息成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("erp:summaryAll:view") + @RequestMapping(value = "exportData") + public void exportData(ErpSummaryAll erpSummaryAll, HttpServletResponse response) { + List list = erpSummaryAllService.findList(erpSummaryAll); + String fileName = "汇总信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try (ExcelExport ee = new ExcelExport("汇总信息", ErpSummaryAll.class)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("erp:summaryAll:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + ErpSummaryAll erpSummaryAll = new ErpSummaryAll(); + List list = ListUtils.newArrayList(erpSummaryAll); + String fileName = "汇总信息模板.xlsx"; + try (ExcelExport ee = new ExcelExport("汇总信息", ErpSummaryAll.class, Type.IMPORT)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("erp:summaryAll:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = erpSummaryAllService.importData(file); + return renderResult(Global.TRUE, "posfull:" + message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:" + ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("erp:summaryAll:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(ErpSummaryAll erpSummaryAll) { + erpSummaryAllService.delete(erpSummaryAll); + return renderResult(Global.TRUE, text("删除汇总信息成功!")); + } + + + @RequestMapping(value = "listAll") + @ResponseBody + public List listAll(ErpSummaryAll erpSummaryAll) { + erpSummaryAll.setCdate_gte(vDate.calculateStartCycleCode(erpSummaryAll.getFcycle())); + return erpSummaryAllService.findList(erpSummaryAll); + } + +} \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/erp/ErpSummaryAllDao.xml b/web-api/src/main/resources/mappings/modules/erp/ErpSummaryAllDao.xml new file mode 100644 index 00000000..7dae3f77 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/erp/ErpSummaryAllDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLine.vue b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLine.vue index d75c3a17..4226396d 100644 --- a/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLine.vue +++ b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLine.vue @@ -1,19 +1,22 @@ +.main-container { + height: 90vh; + background-color: #e6f7ff; + overflow: auto; + padding: 2px; + box-sizing: border-box; + overflow-x: hidden; + + &::-webkit-scrollbar { + width: 4px; + height: 4px; + } + &::-webkit-scrollbar-track { + background: #f1f8ff; + border-radius: 4px; + } + &::-webkit-scrollbar-thumb { + background: #b3d9f2; + border-radius: 4px; + &:hover { + background: #8fc5e8; + } + } + + scrollbar-width: thin; + scrollbar-color: #b3d9f2 #f1f8ff; +} + +// 左右两列布局:限制高度 + 底部间距 +.two-column-layout { + display: flex; + gap: 4px; // 两列水平间距 + margin-bottom: 4px; // 与下方折线图的垂直间距(核心:缩小间距) +} + +// 列通用样式 +.column { + flex: 1; // 两列等分宽度 + height: 100%; + display: flex; + flex-direction: column; +} + +.left-column { + // 可选自定义样式 +} + +.right-column { + // 可选自定义样式 +} + +// 折线图容器:控制宽度 + 高度 +.chart-line-wrapper { + width: 100%; // 撑满容器宽度(避免过宽) + margin-top: 0; // 覆盖默认间距 + box-sizing: border-box; +} + +// 卡片样式(优化适配列布局) +.content-card { + width: 100%; + height: 100%; + margin: 0; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.08); + display: flex; + flex-direction: column; + + .column-content { + flex: 1; + padding: 4px 0; + overflow: auto; + } +} + +// 长内容样式(测试用) +.long-content { + padding: 10px 0; +} + \ No newline at end of file diff --git a/web-vue/packages/erp/api/erp/summaryAll.ts b/web-vue/packages/erp/api/erp/summaryAll.ts new file mode 100644 index 00000000..6b36f572 --- /dev/null +++ b/web-vue/packages/erp/api/erp/summaryAll.ts @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2013-Now http://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 ErpSummaryAll extends BasicModel { + createTime?: string; // 记录时间 + cdate?: string; // 汇总日期 + ctype: string; // 交易类型 + thisValue?: number; // 当期金额 + prevValue?: number; // 上期金额 + momRate?: number; // 环比 + fcycle: string; // 周期类型 +} + +export const erpSummaryAllList = (params?: ErpSummaryAll | any) => + defHttp.get({ url: adminPath + '/erp/summaryAll/list', params }); + +export const erpSummaryAllListAll = (params?: ErpSummaryAll | any) => + defHttp.get({ url: adminPath + '/erp/summaryAll/listAll', params }); + +export const erpSummaryAllListData = (params?: ErpSummaryAll | any) => + defHttp.post>({ url: adminPath + '/erp/summaryAll/listData', params }); + +export const erpSummaryAllForm = (params?: ErpSummaryAll | any) => + defHttp.get({ url: adminPath + '/erp/summaryAll/form', params }); + +export const erpSummaryAllSave = (params?: any, data?: ErpSummaryAll | any) => + defHttp.postJson({ url: adminPath + '/erp/summaryAll/save', params, data }); + +export const erpSummaryAllImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/erp/summaryAll/importData', + onUploadProgress, + }, + params, + ); + +export const erpSummaryAllDelete = (params?: ErpSummaryAll | any) => + defHttp.get({ url: adminPath + '/erp/summaryAll/delete', params });