新增预警页面

This commit is contained in:
2025-12-13 19:13:49 +08:00
parent 00aaf8f54a
commit b209e7d727
25 changed files with 3946 additions and 1292 deletions

View File

@@ -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.ErpCategoryFlow;
/**
* erp_category_flowDAO接口
* @author gaoxq
* @version 2025-12-13
*/
@MyBatisDao(dataSourceName="work")
public interface ErpCategoryFlowDao extends CrudDao<ErpCategoryFlow> {
}

View File

@@ -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.ErpIncExpRatio;
/**
* 支出占比DAO接口
* @author gaoxq
* @version 2025-12-13
*/
@MyBatisDao(dataSourceName="work")
public interface ErpIncExpRatioDao extends CrudDao<ErpIncExpRatio> {
}

View File

@@ -0,0 +1,72 @@
package com.jeesite.modules.erp.entity;
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 lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable;
/**
* erp_category_flowEntity
*
* @author gaoxq
* @version 2025-12-13
*/
@EqualsAndHashCode(callSuper = true)
@Table(name = "erp_category_flow_view", alias = "a", label = "用途信息", columns = {
@Column(name = "cycle_type", attrName = "cycleType", label = "cycle_type"),
@Column(name = "category_name", attrName = "categoryName", label = "分类名称", queryType = QueryType.LIKE),
@Column(name = "stat_date", attrName = "statDate", label = "stat_date"),
@Column(name = "this_income", attrName = "thisIncome", label = "this_income"),
@Column(name = "prev_income", attrName = "prevIncome", label = "prev_income"),
@Column(name = "income_mom", attrName = "incomeMom", label = "income_mom", isUpdateForce = true),
@Column(name = "this_expense", attrName = "thisExpense", label = "this_expense"),
@Column(name = "prev_expense", attrName = "prevExpense", label = "prev_expense"),
@Column(name = "expense_mom", attrName = "expenseMom", label = "expense_mom", isUpdateForce = true),
}, orderBy = "a.stat_date"
)
@Data
public class ErpCategoryFlow extends DataEntity<ErpCategoryFlow> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private String cycleType; // cycle_type
private String categoryName; // 分类名称
private String statDate; // 交易日期
private Double thisIncome; // 本期收入
private Double prevIncome; // 上期收入
private Double incomeMom; // 收入环比
private Double thisExpense; // 本期支出
private Double prevExpense; // 上期支出
private Double expenseMom; // 支出环比
public ErpCategoryFlow() {
this(null);
}
public ErpCategoryFlow(String id) {
super(id);
}
public String getStatDate_gte() {
return sqlMap.getWhere().getValue("stat_date", QueryType.GTE);
}
public void setStatDate_gte(String statDate) {
sqlMap.getWhere().and("stat_date", QueryType.GTE, statDate);
}
public String getStatDate_lte() {
return sqlMap.getWhere().getValue("stat_date", QueryType.LTE);
}
public void setStatDate_lte(String statDate) {
sqlMap.getWhere().and("stat_date", QueryType.LTE, statDate);
}
}

View File

@@ -0,0 +1,68 @@
package com.jeesite.modules.erp.entity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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 lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable;
/**
* 支出占比Entity
*
* @author gaoxq
* @version 2025-12-13
*/
@EqualsAndHashCode(callSuper = true)
@Table(name = "erp_inc_exp_ratio_view", alias = "a", label = "支出占比信息", columns = {
@Column(name = "cycle_type", attrName = "cycleType", label = "cycle_type"),
@Column(name = "stat_date", attrName = "statDate", label = "stat_date"),
@Column(name = "income_amount", attrName = "incomeAmount", label = "income_amount", isUpdateForce = true),
@Column(name = "expense_amount", attrName = "expenseAmount", label = "expense_amount", isUpdateForce = true),
@Column(name = "expense_ratio", attrName = "expenseRatio", label = "expense_ratio"),
}, orderBy = "a.stat_date"
)
@Data
public class ErpIncExpRatio extends DataEntity<ErpIncExpRatio> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private String cycleType; // cycle_type
private String statDate; // 日期
private Double incomeAmount; // 收入
private Double expenseAmount; // 支出
private Double expenseRatio; // 占比
public ErpIncExpRatio() {
this(null);
}
public ErpIncExpRatio(String id) {
super(id);
}
public String getStatDate_gte() {
return sqlMap.getWhere().getValue("stat_date", QueryType.GTE);
}
public void setStatDate_gte(String statDate) {
sqlMap.getWhere().and("stat_date", QueryType.GTE, statDate);
}
public String getStatDate_lte() {
return sqlMap.getWhere().getValue("stat_date", QueryType.LTE);
}
public void setStatDate_lte(String statDate) {
sqlMap.getWhere().and("stat_date", QueryType.LTE, statDate);
}
}

View File

@@ -28,7 +28,7 @@ import java.io.Serial;
@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 = "周期类型"),
@Column(name = "cycle_type", attrName = "cycleType", label = "周期类型"),
}, orderBy = "a.c_date"
)
@Data
@@ -42,7 +42,7 @@ public class ErpSummaryAll extends DataEntity<ErpSummaryAll> implements Serializ
private Double thisValue; // 当期金额
private Double prevValue; // 上期金额
private Double momRate; // 环比
private String fcycle; // 周期类型
private String cycleType; // 周期类型
@ExcelFields({
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
@@ -52,7 +52,7 @@ public class ErpSummaryAll extends DataEntity<ErpSummaryAll> implements Serializ
@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),
@ExcelField(title = "周期类型", attrName = "cycleType", dictType = "report_cycle", align = Align.CENTER, sort = 80),
})
public ErpSummaryAll() {
this(null);

View File

@@ -0,0 +1,79 @@
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.ErpCategoryFlow;
import com.jeesite.modules.erp.dao.ErpCategoryFlowDao;
/**
* erp_category_flowService
* @author gaoxq
* @version 2025-12-13
*/
@Service
public class ErpCategoryFlowService extends CrudService<ErpCategoryFlowDao, ErpCategoryFlow> {
/**
* 获取单条数据
* @param erpCategoryFlow 主键
*/
@Override
public ErpCategoryFlow get(ErpCategoryFlow erpCategoryFlow) {
return super.get(erpCategoryFlow);
}
/**
* 查询分页数据
* @param erpCategoryFlow 查询条件
* @param erpCategoryFlow page 分页对象
*/
@Override
public Page<ErpCategoryFlow> findPage(ErpCategoryFlow erpCategoryFlow) {
return super.findPage(erpCategoryFlow);
}
/**
* 查询列表数据
* @param erpCategoryFlow 查询条件
*/
@Override
public List<ErpCategoryFlow> findList(ErpCategoryFlow erpCategoryFlow) {
return super.findList(erpCategoryFlow);
}
/**
* 保存数据(插入或更新)
* @param erpCategoryFlow 数据对象
*/
@Override
@Transactional
public void save(ErpCategoryFlow erpCategoryFlow) {
super.save(erpCategoryFlow);
}
/**
* 更新状态
* @param erpCategoryFlow 数据对象
*/
@Override
@Transactional
public void updateStatus(ErpCategoryFlow erpCategoryFlow) {
super.updateStatus(erpCategoryFlow);
}
/**
* 删除数据
* @param erpCategoryFlow 数据对象
*/
@Override
@Transactional
public void delete(ErpCategoryFlow erpCategoryFlow) {
erpCategoryFlow.sqlMap().markIdDelete(); // 逻辑删除时标记ID值
super.delete(erpCategoryFlow);
}
}

View File

@@ -0,0 +1,79 @@
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.ErpIncExpRatio;
import com.jeesite.modules.erp.dao.ErpIncExpRatioDao;
/**
* 支出占比Service
* @author gaoxq
* @version 2025-12-13
*/
@Service
public class ErpIncExpRatioService extends CrudService<ErpIncExpRatioDao, ErpIncExpRatio> {
/**
* 获取单条数据
* @param erpIncExpRatio 主键
*/
@Override
public ErpIncExpRatio get(ErpIncExpRatio erpIncExpRatio) {
return super.get(erpIncExpRatio);
}
/**
* 查询分页数据
* @param erpIncExpRatio 查询条件
* @param erpIncExpRatio page 分页对象
*/
@Override
public Page<ErpIncExpRatio> findPage(ErpIncExpRatio erpIncExpRatio) {
return super.findPage(erpIncExpRatio);
}
/**
* 查询列表数据
* @param erpIncExpRatio 查询条件
*/
@Override
public List<ErpIncExpRatio> findList(ErpIncExpRatio erpIncExpRatio) {
return super.findList(erpIncExpRatio);
}
/**
* 保存数据(插入或更新)
* @param erpIncExpRatio 数据对象
*/
@Override
@Transactional
public void save(ErpIncExpRatio erpIncExpRatio) {
super.save(erpIncExpRatio);
}
/**
* 更新状态
* @param erpIncExpRatio 数据对象
*/
@Override
@Transactional
public void updateStatus(ErpIncExpRatio erpIncExpRatio) {
super.updateStatus(erpIncExpRatio);
}
/**
* 删除数据
* @param erpIncExpRatio 数据对象
*/
@Override
@Transactional
public void delete(ErpIncExpRatio erpIncExpRatio) {
erpIncExpRatio.sqlMap().markIdDelete(); // 逻辑删除时标记ID值
super.delete(erpIncExpRatio);
}
}

View File

@@ -0,0 +1,110 @@
package com.jeesite.modules.erp.web;
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.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.erp.entity.ErpCategoryFlow;
import com.jeesite.modules.erp.service.ErpCategoryFlowService;
import java.util.List;
/**
* erp_category_flowController
*
* @author gaoxq
* @version 2025-12-13
*/
@Controller
@RequestMapping(value = "${adminPath}/erp/categoryFlow")
public class ErpCategoryFlowController extends BaseController {
private final ErpCategoryFlowService erpCategoryFlowService;
public ErpCategoryFlowController(ErpCategoryFlowService erpCategoryFlowService) {
this.erpCategoryFlowService = erpCategoryFlowService;
}
/**
* 获取数据
*/
@ModelAttribute
public ErpCategoryFlow get(Long id, boolean isNewRecord) {
return erpCategoryFlowService.get(id, isNewRecord);
}
/**
* 查询列表
*/
@RequiresPermissions("erp:categoryFlow:view")
@RequestMapping(value = {"list", ""})
public String list(ErpCategoryFlow erpCategoryFlow, Model model) {
model.addAttribute("erpCategoryFlow", erpCategoryFlow);
return "modules/erp/erpCategoryFlowList";
}
/**
* 查询列表数据
*/
@RequiresPermissions("erp:categoryFlow:view")
@RequestMapping(value = "listData")
@ResponseBody
public Page<ErpCategoryFlow> listData(ErpCategoryFlow erpCategoryFlow, HttpServletRequest request, HttpServletResponse response) {
erpCategoryFlow.setPage(new Page<>(request, response));
Page<ErpCategoryFlow> page = erpCategoryFlowService.findPage(erpCategoryFlow);
return page;
}
/**
* 查看编辑表单
*/
@RequiresPermissions("erp:categoryFlow:view")
@RequestMapping(value = "form")
public String form(ErpCategoryFlow erpCategoryFlow, Model model) {
model.addAttribute("erpCategoryFlow", erpCategoryFlow);
return "modules/erp/erpCategoryFlowForm";
}
/**
* 保存数据
*/
@RequiresPermissions("erp:categoryFlow:edit")
@PostMapping(value = "save")
@ResponseBody
public String save(@Validated ErpCategoryFlow erpCategoryFlow) {
erpCategoryFlowService.save(erpCategoryFlow);
return renderResult(Global.TRUE, text("保存用途信息成功!"));
}
/**
* 删除数据
*/
@RequiresPermissions("erp:categoryFlow:edit")
@RequestMapping(value = "delete")
@ResponseBody
public String delete(ErpCategoryFlow erpCategoryFlow) {
erpCategoryFlowService.delete(erpCategoryFlow);
return renderResult(Global.TRUE, text("删除用途信息成功!"));
}
@RequestMapping(value = "listAll")
@ResponseBody
public List<ErpCategoryFlow> listAll(ErpCategoryFlow erpCategoryFlow) {
erpCategoryFlow.setStatDate_gte(vDate.calculateStartCycleCode(erpCategoryFlow.getCycleType()));
return erpCategoryFlowService.findList(erpCategoryFlow);
}
}

View File

@@ -0,0 +1,108 @@
package com.jeesite.modules.erp.web;
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.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.erp.entity.ErpIncExpRatio;
import com.jeesite.modules.erp.service.ErpIncExpRatioService;
import java.util.List;
/**
* 支出占比Controller
*
* @author gaoxq
* @version 2025-12-13
*/
@Controller
@RequestMapping(value = "${adminPath}/erp/incExpRatio")
public class ErpIncExpRatioController extends BaseController {
private final ErpIncExpRatioService erpIncExpRatioService;
public ErpIncExpRatioController(ErpIncExpRatioService erpIncExpRatioService) {
this.erpIncExpRatioService = erpIncExpRatioService;
}
/**
* 获取数据
*/
@ModelAttribute
public ErpIncExpRatio get(Long id, boolean isNewRecord) {
return erpIncExpRatioService.get(id, isNewRecord);
}
/**
* 查询列表
*/
@RequiresPermissions("erp:incExpRatio:view")
@RequestMapping(value = {"list", ""})
public String list(ErpIncExpRatio erpIncExpRatio, Model model) {
model.addAttribute("erpIncExpRatio", erpIncExpRatio);
return "modules/erp/erpIncExpRatioList";
}
/**
* 查询列表数据
*/
@RequiresPermissions("erp:incExpRatio:view")
@RequestMapping(value = "listData")
@ResponseBody
public Page<ErpIncExpRatio> listData(ErpIncExpRatio erpIncExpRatio, HttpServletRequest request, HttpServletResponse response) {
erpIncExpRatio.setPage(new Page<>(request, response));
Page<ErpIncExpRatio> page = erpIncExpRatioService.findPage(erpIncExpRatio);
return page;
}
/**
* 查看编辑表单
*/
@RequiresPermissions("erp:incExpRatio:view")
@RequestMapping(value = "form")
public String form(ErpIncExpRatio erpIncExpRatio, Model model) {
model.addAttribute("erpIncExpRatio", erpIncExpRatio);
return "modules/erp/erpIncExpRatioForm";
}
/**
* 保存数据
*/
@RequiresPermissions("erp:incExpRatio:edit")
@PostMapping(value = "save")
@ResponseBody
public String save(@Validated ErpIncExpRatio erpIncExpRatio) {
erpIncExpRatioService.save(erpIncExpRatio);
return renderResult(Global.TRUE, text("保存支出占比成功!"));
}
/**
* 删除数据
*/
@RequiresPermissions("erp:incExpRatio:edit")
@RequestMapping(value = "delete")
@ResponseBody
public String delete(ErpIncExpRatio erpIncExpRatio) {
erpIncExpRatioService.delete(erpIncExpRatio);
return renderResult(Global.TRUE, text("删除支出占比成功!"));
}
@RequestMapping(value = "listAll")
@ResponseBody
public List<ErpIncExpRatio> listAll(ErpIncExpRatio erpIncExpRatio) {
erpIncExpRatio.setStatDate_gte(vDate.calculateStartCycleCode(erpIncExpRatio.getCycleType()));
return erpIncExpRatioService.findList(erpIncExpRatio);
}
}

View File

@@ -150,7 +150,7 @@ public class ErpSummaryAllController extends BaseController {
@RequestMapping(value = "listAll")
@ResponseBody
public List<ErpSummaryAll> listAll(ErpSummaryAll erpSummaryAll) {
erpSummaryAll.setCdate_gte(vDate.calculateStartCycleCode(erpSummaryAll.getFcycle()));
erpSummaryAll.setCdate_gte(vDate.calculateStartCycleCode(erpSummaryAll.getCycleType()));
return erpSummaryAllService.findList(erpSummaryAll);
}