新增前端vue
This commit is contained in:
@@ -51,8 +51,6 @@ public class vDate {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static String dsValue() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
// 格式化日期为yyyymmdd
|
||||
@@ -136,13 +134,13 @@ public class vDate {
|
||||
return switch (cycleType) {
|
||||
case "D" ->
|
||||
// 日:最近30天,格式 yyyy-MM-dd
|
||||
baseDate.minusDays(30).format(DAY_FORMATTER);
|
||||
baseDate.minusDays(14).format(DAY_FORMATTER);
|
||||
case "M" ->
|
||||
// 月:最近1年,格式 yyyy-MM
|
||||
baseDate.minusYears(1).format(MONTH_FORMATTER);
|
||||
case "Q" ->
|
||||
// 季度:最近3年,格式 yyyy-Qx
|
||||
getQuarterCycleCode(baseDate.minusYears(3));
|
||||
getQuarterCycleCode(baseDate.minusYears(2));
|
||||
case "Y" ->
|
||||
// 年:最近6年,格式 yyyy
|
||||
String.valueOf(baseDate.minusYears(6).getYear());
|
||||
|
||||
@@ -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.ErpExpInc;
|
||||
|
||||
/**
|
||||
* 收支信息DAO接口
|
||||
* @author gaoxq
|
||||
* @version 2025-12-10
|
||||
*/
|
||||
@MyBatisDao(dataSourceName="work")
|
||||
public interface ErpExpIncDao extends CrudDao<ErpExpInc> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.jeesite.modules.erp.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.Size;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 收支信息Entity
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2025-12-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name = "erp_exp_inc", alias = "a", label = "收支信息信息", columns = {
|
||||
@Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdateForce = true),
|
||||
@Column(name = "id", attrName = "id", label = "主键ID", isPK = true),
|
||||
@Column(name = "account_name", attrName = "accountName", label = "account_name", queryType = QueryType.LIKE),
|
||||
@Column(name = "stat_date", attrName = "statDate", label = "stat_date"),
|
||||
@Column(name = "cycle_type", attrName = "cycleType", label = "cycle_type"),
|
||||
@Column(name = "income_amount", attrName = "incomeAmount", label = "income_amount", isUpdateForce = true),
|
||||
@Column(name = "expense_amount", attrName = "expenseAmount", label = "expense_amount", isUpdateForce = true),
|
||||
}, orderBy = "a.stat_date"
|
||||
)
|
||||
@Data
|
||||
public class ErpExpInc extends DataEntity<ErpExpInc> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Date createTime; // 记录时间
|
||||
private String accountName; // account_name
|
||||
private String statDate; // stat_date
|
||||
private String cycleType; // cycle_type
|
||||
private Double incomeAmount; // income_amount
|
||||
private Double expenseAmount; // expense_amount
|
||||
|
||||
public ErpExpInc() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ErpExpInc(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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import java.io.Serial;
|
||||
@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 = "c_type", attrName = "ctype", label = "交易类型"),
|
||||
@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),
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
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.ErpExpInc;
|
||||
import com.jeesite.modules.erp.dao.ErpExpIncDao;
|
||||
|
||||
/**
|
||||
* 收支信息Service
|
||||
* @author gaoxq
|
||||
* @version 2025-12-10
|
||||
*/
|
||||
@Service
|
||||
public class ErpExpIncService extends CrudService<ErpExpIncDao, ErpExpInc> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param erpExpInc 主键
|
||||
*/
|
||||
@Override
|
||||
public ErpExpInc get(ErpExpInc erpExpInc) {
|
||||
return super.get(erpExpInc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param erpExpInc 查询条件
|
||||
* @param erpExpInc page 分页对象
|
||||
*/
|
||||
@Override
|
||||
public Page<ErpExpInc> findPage(ErpExpInc erpExpInc) {
|
||||
return super.findPage(erpExpInc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param erpExpInc 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<ErpExpInc> findList(ErpExpInc erpExpInc) {
|
||||
return super.findList(erpExpInc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param erpExpInc 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(ErpExpInc erpExpInc) {
|
||||
super.save(erpExpInc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param erpExpInc 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateStatus(ErpExpInc erpExpInc) {
|
||||
super.updateStatus(erpExpInc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param erpExpInc 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(ErpExpInc erpExpInc) {
|
||||
super.delete(erpExpInc);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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.ErpExpInc;
|
||||
import com.jeesite.modules.erp.service.ErpExpIncService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收支信息Controller
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2025-12-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/erp/expInc")
|
||||
public class ErpExpIncController extends BaseController {
|
||||
|
||||
private final ErpExpIncService erpExpIncService;
|
||||
|
||||
public ErpExpIncController(ErpExpIncService erpExpIncService) {
|
||||
this.erpExpIncService = erpExpIncService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public ErpExpInc get(String id, boolean isNewRecord) {
|
||||
return erpExpIncService.get(id, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("erp:expInc:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(ErpExpInc erpExpInc, Model model) {
|
||||
model.addAttribute("erpExpInc", erpExpInc);
|
||||
return "modules/erp/erpExpIncList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("erp:expInc:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<ErpExpInc> listData(ErpExpInc erpExpInc, HttpServletRequest request, HttpServletResponse response) {
|
||||
erpExpInc.setPage(new Page<>(request, response));
|
||||
Page<ErpExpInc> page = erpExpIncService.findPage(erpExpInc);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("erp:expInc:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(ErpExpInc erpExpInc, Model model) {
|
||||
model.addAttribute("erpExpInc", erpExpInc);
|
||||
return "modules/erp/erpExpIncForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("erp:expInc:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated ErpExpInc erpExpInc) {
|
||||
erpExpIncService.save(erpExpInc);
|
||||
return renderResult(Global.TRUE, text("保存收支信息成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("erp:expInc:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(ErpExpInc erpExpInc) {
|
||||
erpExpIncService.delete(erpExpInc);
|
||||
return renderResult(Global.TRUE, text("删除收支信息成功!"));
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "listAll")
|
||||
@ResponseBody
|
||||
public List<ErpExpInc> listAll(ErpExpInc erpExpInc) {
|
||||
erpExpInc.setStatDate_gte(vDate.calculateStartCycleCode(erpExpInc.getCycleType()));
|
||||
return erpExpIncService.findList(erpExpInc);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jeesite.modules.erp.dao.ErpExpIncDao">
|
||||
|
||||
<!-- 查询数据
|
||||
<select id="findList" resultType="ErpExpInc">
|
||||
SELECT ${sqlMap.column.toSql()}
|
||||
FROM ${sqlMap.table.toSql()}
|
||||
<where>
|
||||
${sqlMap.where.toSql()}
|
||||
</where>
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select> -->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user