初始化项目

This commit is contained in:
2026-03-22 14:53:19 +08:00
parent 7888164aff
commit bd55405817
19 changed files with 362 additions and 258 deletions

View File

@@ -1,6 +1,7 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.jeesite.common.entity.DataEntity;
@@ -44,8 +45,8 @@ public class ErpAccount extends DataEntity<ErpAccount> implements Serializable {
private String accountName; // 账户名称
private String accountType; // 账户类型
private String accountCode; // 账户卡号
private Double initialBalance; // 初始余额
private Double currentBalance; // 当前余额
private BigDecimal initialBalance; // 初始余额
private BigDecimal currentBalance; // 当前余额
private String isActive; // 是否激活
private Date updateTime; // 更新时间

View File

@@ -1,6 +1,7 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
@@ -52,7 +53,7 @@ public class ErpAccountTransfer extends DataEntity<ErpAccountTransfer> implement
private String outAccountId; // 转出账号
private String inAccountId; // 转入账号
private String categoryId; // 转账分类
private Double transferAmount; // 转账金额
private BigDecimal transferAmount; // 转账金额
private String transferStatus; // 转账状态
private String remark; // 转账备注

View File

@@ -1,6 +1,7 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
@@ -48,8 +49,8 @@ public class ErpBudgets extends DataEntity<ErpBudgets> implements Serializable {
private String budgetId; // 唯一主键
private String categoryId; // 分类标识
private String budgetMonth; // 预算年月
private Double budgetAmount; // 预算金额
private Double usedAmount; // 使用金额
private BigDecimal budgetAmount; // 预算金额
private BigDecimal usedAmount; // 使用金额
private Double usedRatio; // 预算占比
private Double overAmount; // 超支金额
private Date updateTime; // 更新时间

View File

@@ -3,12 +3,6 @@ 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.NotBlank;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
@@ -59,9 +53,9 @@ public class ErpCategory extends DataEntity<ErpCategory> implements Serializable
@ExcelField(title = "分类标识", attrName = "categoryId", align = Align.CENTER, sort = 20),
@ExcelField(title = "父级名称", attrName = "parentName", align = Align.CENTER, sort = 30),
@ExcelField(title = "分类名称", attrName = "categoryName", align = Align.CENTER, sort = 40),
@ExcelField(title = "分类类型", attrName = "categoryType", align = Align.CENTER, sort = 50),
@ExcelField(title = "分类类型", attrName = "categoryType", dictType = "erp_type", align = Align.CENTER, sort = 50),
@ExcelField(title = "排序序号", attrName = "sortOrder", align = Align.CENTER, sort = 60),
@ExcelField(title = "是否启用", attrName = "isActive", align = Align.CENTER, sort = 70),
@ExcelField(title = "是否启用", attrName = "isActive", dictType = "is_active", align = Align.CENTER, sort = 70),
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 80, dataFormat = "yyyy-MM-dd hh:mm"),
})
public ErpCategory() {

View File

@@ -1,6 +1,7 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
@@ -48,7 +49,7 @@ public class ErpDebtRecords extends DataEntity<ErpDebtRecords> implements Serial
private String recordId; // 唯一标识
private String debtId; // 负债标识
private String accountId; // 账户标识
private Double repayAmount; // 还款金额
private BigDecimal repayAmount; // 还款金额
private Date repayTime; // 还款时间
private String remark; // 备注说明

View File

@@ -1,6 +1,7 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
@@ -49,8 +50,8 @@ public class ErpDebts extends DataEntity<ErpDebts> implements Serializable {
private String debtId; // 唯一标识
private String debtType; // 负债类型
private String debtName; // 对方名称
private Double debtAmount; // 借贷金额
private Double remaining; // 未还金额
private BigDecimal debtAmount; // 借贷金额
private BigDecimal remaining; // 未还金额
private Date endTime; // 结清时间
private String ustatus; // 状态

View File

@@ -1,14 +1,11 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
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;
@@ -37,6 +34,18 @@ import java.io.Serial;
@Column(name = "category_id", attrName = "categoryId", label = "支出分类"),
@Column(name = "amount", attrName = "amount", label = "交易金额", isQuery = false),
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
}, joinTable = {
@JoinTable(type = Type.LEFT_JOIN, entity = ErpAccount.class, alias = "b",
on = "a.account_id = b.account_id", attrName = "this",
columns = {
@Column(name = "account_name", attrName = "accountName", label = "账户名称"),
}),
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "c",
on = "a.category_id = c.category_id", attrName = "this",
columns = {
@Column(name = "parent_name", attrName = "parentName", label = "父级名称"),
@Column(name = "category_name", attrName = "categoryName", label = "分类名称"),
}),
}, orderBy = "a.create_time DESC"
)
@Data
@@ -49,15 +58,22 @@ public class ErpExpense extends DataEntity<ErpExpense> implements Serializable {
private String expenseName; // 支出名称
private String accountId; // 支出账户
private String categoryId; // 支出分类
private Double amount; // 交易金额
private BigDecimal amount; // 交易金额
private Date updateTime; // 更新时间
private String accountName;
private String parentName;
private String categoryName;
@ExcelFields({
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
@ExcelField(title = "唯一标识", attrName = "expenseId", align = Align.CENTER, sort = 20),
@ExcelField(title = "支出名称", attrName = "expenseName", align = Align.CENTER, sort = 30),
@ExcelField(title = "支出账户", attrName = "accountId", align = Align.CENTER, sort = 40),
@ExcelField(title = "支出分类", attrName = "categoryId", align = Align.CENTER, sort = 50),
@ExcelField(title = "支出账户", attrName = "accountName", align = Align.CENTER, sort = 40),
@ExcelField(title = "父级分类", attrName = "parentName", align = Align.CENTER, sort = 50),
@ExcelField(title = "支出分类", attrName = "categoryName", align = Align.CENTER, sort = 50),
@ExcelField(title = "交易金额", attrName = "amount", align = Align.CENTER, sort = 60),
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 70, dataFormat = "yyyy-MM-dd hh:mm"),
})

View File

@@ -1,11 +1,13 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
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 com.jeesite.modules.biz.entity.MyProvince;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
@@ -37,6 +39,18 @@ import java.io.Serial;
@Column(name = "category_id", attrName = "categoryId", label = "收入分类"),
@Column(name = "amount", attrName = "amount", label = "交易金额", isQuery = false),
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
}, joinTable = {
@JoinTable(type = Type.LEFT_JOIN, entity = ErpAccount.class, alias = "b",
on = "a.account_id = b.account_id", attrName = "this",
columns = {
@Column(name = "account_name", attrName = "accountName", label = "账户名称"),
}),
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "c",
on = "a.category_id = c.category_id", attrName = "this",
columns = {
@Column(name = "parent_name", attrName = "parentName", label = "父级名称"),
@Column(name = "category_name", attrName = "categoryName", label = "分类名称"),
}),
}, orderBy = "a.create_time DESC"
)
@Data
@@ -49,15 +63,22 @@ public class ErpIncome extends DataEntity<ErpIncome> implements Serializable {
private String incomeName; // 收入名称
private String accountId; // 收入账户
private String categoryId; // 收入分类
private Double amount; // 交易金额
private BigDecimal amount; // 交易金额
private Date updateTime; // 更新时间
private String accountName;
private String parentName;
private String categoryName;
@ExcelFields({
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
@ExcelField(title = "唯一标识", attrName = "incomeId", align = Align.CENTER, sort = 20),
@ExcelField(title = "收入名称", attrName = "incomeName", align = Align.CENTER, sort = 30),
@ExcelField(title = "收入账户", attrName = "accountId", align = Align.CENTER, sort = 40),
@ExcelField(title = "收入分类", attrName = "categoryId", align = Align.CENTER, sort = 50),
@ExcelField(title = "收入账户", attrName = "accountName", align = Align.CENTER, sort = 40),
@ExcelField(title = "父级分类", attrName = "parentName", align = Align.CENTER, sort = 50),
@ExcelField(title = "收入分类", attrName = "categoryName", align = Align.CENTER, sort = 50),
@ExcelField(title = "交易金额", attrName = "amount", align = Align.CENTER, sort = 60),
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 70, dataFormat = "yyyy-MM-dd hh:mm"),
})

View File

@@ -1,6 +1,7 @@
package com.jeesite.modules.erp.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
@@ -52,7 +53,7 @@ public class ErpTransactionFlow extends DataEntity<ErpTransactionFlow> implement
private String flowId; // 流水
private String flowName; // 交易名称
private String flowType; // 交易类型
private Double amount; // 交易金额
private BigDecimal amount; // 交易金额
private Date tradeTime; // 交易时间
private String accountId; // 交易账户
private String categoryId; // 交易分类

View File

@@ -1,6 +1,7 @@
package com.jeesite.modules.erp.web;
import java.util.List;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -26,6 +27,7 @@ import com.jeesite.modules.erp.service.ErpCategoryService;
/**
* 收支分类 Controller
*
* @author gaoxq
* @version 2026-03-22
*/
@@ -33,114 +35,123 @@ import com.jeesite.modules.erp.service.ErpCategoryService;
@RequestMapping(value = "${adminPath}/erp/category")
public class ErpCategoryController extends BaseController {
private final ErpCategoryService erpCategoryService;
private final ErpCategoryService erpCategoryService;
public ErpCategoryController(ErpCategoryService erpCategoryService) {
this.erpCategoryService = erpCategoryService;
}
/**
* 获取数据
*/
@ModelAttribute
public ErpCategory get(String categoryId, boolean isNewRecord) {
return erpCategoryService.get(categoryId, isNewRecord);
}
/**
* 查询列表
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = {"list", ""})
public String list(ErpCategory erpCategory, Model model) {
model.addAttribute("erpCategory", erpCategory);
return "modules/erp/erpCategoryList";
}
/**
* 查询列表数据
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "listData")
@ResponseBody
public Page<ErpCategory> listData(ErpCategory erpCategory, HttpServletRequest request, HttpServletResponse response) {
erpCategory.setPage(new Page<>(request, response));
Page<ErpCategory> page = erpCategoryService.findPage(erpCategory);
return page;
}
public ErpCategoryController(ErpCategoryService erpCategoryService) {
this.erpCategoryService = erpCategoryService;
}
/**
* 查看编辑表单
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "form")
public String form(ErpCategory erpCategory, Model model) {
model.addAttribute("erpCategory", erpCategory);
return "modules/erp/erpCategoryForm";
}
/**
* 获取数据
*/
@ModelAttribute
public ErpCategory get(String categoryId, boolean isNewRecord) {
return erpCategoryService.get(categoryId, isNewRecord);
}
/**
* 保存数据
*/
@RequiresPermissions("erp:category:edit")
@PostMapping(value = "save")
@ResponseBody
public String save(@Validated ErpCategory erpCategory) {
erpCategoryService.save(erpCategory);
return renderResult(Global.TRUE, text("保存分类成功!"));
}
/**
* 查询列表
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = {"list", ""})
public String list(ErpCategory erpCategory, Model model) {
model.addAttribute("erpCategory", erpCategory);
return "modules/erp/erpCategoryList";
}
/**
* 导出数据
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "exportData")
public void exportData(ErpCategory erpCategory, HttpServletResponse response) {
List<ErpCategory> list = erpCategoryService.findList(erpCategory);
String fileName = "分类" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
try(ExcelExport ee = new ExcelExport("分类", ErpCategory.class)){
ee.setDataList(list).write(response, fileName);
}
}
/**
* 查询列表数据
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "listData")
@ResponseBody
public Page<ErpCategory> listData(ErpCategory erpCategory, HttpServletRequest request, HttpServletResponse response) {
erpCategory.setPage(new Page<>(request, response));
Page<ErpCategory> page = erpCategoryService.findPage(erpCategory);
return page;
}
/**
* 下载模板
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "importTemplate")
public void importTemplate(HttpServletResponse response) {
ErpCategory erpCategory = new ErpCategory();
List<ErpCategory> list = ListUtils.newArrayList(erpCategory);
String fileName = "分类模板.xlsx";
try(ExcelExport ee = new ExcelExport("分类", ErpCategory.class, Type.IMPORT)){
ee.setDataList(list).write(response, fileName);
}
}
/**
* 查看编辑表单
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "form")
public String form(ErpCategory erpCategory, Model model) {
model.addAttribute("erpCategory", erpCategory);
return "modules/erp/erpCategoryForm";
}
/**
* 保存数据
*/
@RequiresPermissions("erp:category:edit")
@PostMapping(value = "save")
@ResponseBody
public String save(@Validated ErpCategory erpCategory) {
erpCategoryService.save(erpCategory);
return renderResult(Global.TRUE, text("保存分类成功!"));
}
/**
* 导出数据
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "exportData")
public void exportData(ErpCategory erpCategory, HttpServletResponse response) {
List<ErpCategory> list = erpCategoryService.findList(erpCategory);
String fileName = "分类" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
try (ExcelExport ee = new ExcelExport("分类", ErpCategory.class)) {
ee.setDataList(list).write(response, fileName);
}
}
/**
* 下载模板
*/
@RequiresPermissions("erp:category:view")
@RequestMapping(value = "importTemplate")
public void importTemplate(HttpServletResponse response) {
ErpCategory erpCategory = new ErpCategory();
List<ErpCategory> list = ListUtils.newArrayList(erpCategory);
String fileName = "分类模板.xlsx";
try (ExcelExport ee = new ExcelExport("分类", ErpCategory.class, Type.IMPORT)) {
ee.setDataList(list).write(response, fileName);
}
}
/**
* 导入数据
*/
@ResponseBody
@RequiresPermissions("erp:category:edit")
@PostMapping(value = "importData")
public String importData(MultipartFile file) {
try {
String message = erpCategoryService.importData(file);
return renderResult(Global.TRUE, "posfull:" + message);
} catch (Exception ex) {
return renderResult(Global.FALSE, "posfull:" + ex.getMessage());
}
}
/**
* 删除数据
*/
@RequiresPermissions("erp:category:edit")
@RequestMapping(value = "delete")
@ResponseBody
public String delete(ErpCategory erpCategory) {
erpCategoryService.delete(erpCategory);
return renderResult(Global.TRUE, text("删除分类成功!"));
}
/**
* 列表数据
*/
@RequestMapping(value = "listAll")
@ResponseBody
public List<ErpCategory> listAll(ErpCategory erpCategory) {
return erpCategoryService.findList(erpCategory);
}
/**
* 导入数据
*/
@ResponseBody
@RequiresPermissions("erp:category:edit")
@PostMapping(value = "importData")
public String importData(MultipartFile file) {
try {
String message = erpCategoryService.importData(file);
return renderResult(Global.TRUE, "posfull:"+message);
} catch (Exception ex) {
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
}
}
/**
* 删除数据
*/
@RequiresPermissions("erp:category:edit")
@RequestMapping(value = "delete")
@ResponseBody
public String delete(ErpCategory erpCategory) {
erpCategoryService.delete(erpCategory);
return renderResult(Global.TRUE, text("删除分类成功!"));
}
}