初始化项目
This commit is contained in:
@@ -80,25 +80,45 @@ public class erpFlowService {
|
||||
*/
|
||||
public void addDebt(ErpDebtRecords erpDebtRecords) {
|
||||
ErpDebts debts = erpDebtsService.get(erpDebtRecords.getDebtId());
|
||||
ErpCategory category = erpCategoryService.get(debts.getCategoryId());
|
||||
ErpAccount account = erpAccountService.get(erpDebtRecords.getAccountId());
|
||||
ErpCategory category = erpCategoryService.get(erpDebtRecords.getCategoryId());
|
||||
debts.setRemaining(BigDecimalUtils.add(debts.getRemaining(),erpDebtRecords.getRepayAmount()));
|
||||
|
||||
debts.setRemaining(BigDecimalUtils.add(debts.getRemaining(), erpDebtRecords.getRepayAmount()));
|
||||
erpDebtsService.save(debts);
|
||||
|
||||
account.setUpdateTime(new Date());
|
||||
account.setCurrentBalance(BigDecimalUtils.subtract(account.getCurrentBalance(), erpDebtRecords.getRepayAmount()));
|
||||
erpAccountService.save(account);
|
||||
addFlow(
|
||||
erpDebtRecords.getDebtName(), // 交易名称
|
||||
category.getCategoryType(), // 交易类型
|
||||
erpDebtRecords.getRepayAmount(), // 交易金额
|
||||
erpDebtRecords.getAccountId(), // 账户ID
|
||||
erpDebtRecords.getCategoryId(), // 分类ID
|
||||
erpDebtRecords.getRemark(), // 备注
|
||||
erpDebtRecords.getDebtId(), // 业务ID
|
||||
DateUtils.getCurrentYear(), // 年份
|
||||
DateUtils.getCurrentMonth() // 月份
|
||||
);
|
||||
if (debts.getDebtType().equals("1")) {
|
||||
account.setUpdateTime(new Date());
|
||||
account.setCurrentBalance(BigDecimalUtils.subtract(account.getCurrentBalance(), erpDebtRecords.getRepayAmount()));
|
||||
erpAccountService.save(account);
|
||||
addFlow(
|
||||
erpDebtRecords.getDebtName(), // 交易名称
|
||||
category.getCategoryType(), // 交易类型
|
||||
erpDebtRecords.getRepayAmount(), // 交易金额
|
||||
erpDebtRecords.getAccountId(), // 账户ID
|
||||
debts.getCategoryId(), // 分类ID
|
||||
erpDebtRecords.getRemark(), // 备注
|
||||
erpDebtRecords.getDebtId(), // 业务ID
|
||||
DateUtils.getCurrentYear(), // 年份
|
||||
DateUtils.getCurrentMonth() // 月份
|
||||
);
|
||||
}
|
||||
|
||||
if (debts.getDebtType().equals("2")) {
|
||||
account.setUpdateTime(new Date());
|
||||
account.setCurrentBalance(BigDecimalUtils.add(account.getCurrentBalance(), erpDebtRecords.getRepayAmount()));
|
||||
erpAccountService.save(account);
|
||||
addFlow(
|
||||
erpDebtRecords.getDebtName(), // 交易名称
|
||||
category.getCategoryType(), // 交易类型
|
||||
erpDebtRecords.getRepayAmount(), // 交易金额
|
||||
erpDebtRecords.getAccountId(), // 账户ID
|
||||
debts.getCategoryId(), // 分类ID
|
||||
erpDebtRecords.getRemark(), // 备注
|
||||
erpDebtRecords.getDebtId(), // 业务ID
|
||||
DateUtils.getCurrentYear(), // 年份
|
||||
DateUtils.getCurrentMonth() // 月份
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,6 @@ import java.io.Serial;
|
||||
@Column(name = "account_id", attrName = "accountId", label = "账户标识"),
|
||||
@Column(name = "repay_amount", attrName = "repayAmount", label = "还款金额", isQuery = false),
|
||||
@Column(name = "repay_time", attrName = "repayTime", label = "还款时间", isQuery = false, isUpdateForce = true),
|
||||
@Column(name = "category_id", attrName = "categoryId", label = "分类标识"),
|
||||
@Column(name = "remark", attrName = "remark", label = "备注说明", queryType = QueryType.LIKE),
|
||||
@Column(name = "is_recorded", attrName = "isRecorded", label = "是否记账"),
|
||||
}, joinTable = {
|
||||
@@ -51,12 +50,6 @@ import java.io.Serial;
|
||||
columns = {
|
||||
@Column(name = "debt_name", attrName = "debtName", label = "对方名称"),
|
||||
}),
|
||||
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "d",
|
||||
on = "a.category_id = d.category_id", attrName = "this",
|
||||
columns = {
|
||||
@Column(name = "parent_name", attrName = "parentName", label = "父级名称"),
|
||||
@Column(name = "category_name", attrName = "categoryName", label = "分类名称"),
|
||||
}),
|
||||
}, orderBy = "a.record_id DESC"
|
||||
)
|
||||
@Data
|
||||
@@ -70,17 +63,12 @@ public class ErpDebtRecords extends DataEntity<ErpDebtRecords> implements Serial
|
||||
private String accountId; // 账户标识
|
||||
private BigDecimal repayAmount; // 还款金额
|
||||
private Date repayTime; // 还款时间
|
||||
private String categoryId;
|
||||
private String remark; // 备注说明
|
||||
private String isRecorded;
|
||||
|
||||
private String accountName;
|
||||
private String debtName;
|
||||
|
||||
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 = "recordId", align = Align.CENTER, sort = 20),
|
||||
|
||||
@@ -39,7 +39,15 @@ import java.io.Serial;
|
||||
@Column(name = "remaining", attrName = "remaining", label = "未还金额", isQuery = false, isUpdateForce = true),
|
||||
@Column(name = "end_time", attrName = "endTime", label = "结清时间", isQuery = false, isUpdateForce = true),
|
||||
@Column(name = "ustatus", attrName = "ustatus", label = "状态"),
|
||||
@Column(name = "category_id", attrName = "categoryId", label = "分类标识"),
|
||||
@Column(name = "remark", attrName = "remark", label = "交易备注", isQuery = false),
|
||||
}, joinTable = {
|
||||
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "b",
|
||||
on = "a.category_id = b.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
|
||||
@@ -52,11 +60,17 @@ public class ErpDebts extends DataEntity<ErpDebts> implements Serializable {
|
||||
private String debtType; // 负债类型
|
||||
private String debtName; // 对方名称
|
||||
private BigDecimal debtAmount; // 借贷金额
|
||||
private BigDecimal remaining; // 未还金额
|
||||
private BigDecimal remaining; // 已还金额
|
||||
private Date endTime; // 结清时间
|
||||
private String ustatus; // 状态
|
||||
private String categoryId;
|
||||
private String remark;
|
||||
|
||||
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 = "debtId", align = Align.CENTER, sort = 20),
|
||||
|
||||
Reference in New Issue
Block a user