收入信息的维护编写

main
jml 2 weeks ago
parent e884bd8d82
commit 68a35140f3

@ -24,4 +24,16 @@
<property name="createDate" value="2023-06-18"/>
</bean>
<!-- 组员A收入信息维护 -->
<bean id="income" class="com.ssm.ioc.Income">
<property name="id" value="1001"/>
<property name="userId" value="10"/>
<property name="typeId" value="1"/>
<property name="amount" value="5000.00"/>
<property name="incomeDate">
<bean class="java.util.Date"/>
</property>
<property name="remark" value="工资收入"/>
</bean>
</beans>

@ -0,0 +1,89 @@
package com.ssm.ioc;
import java.math.BigDecimal;
import java.util.Date;
/**
* -
*/
public class Income {
private Integer id; // 收入ID
private Integer userId; // 所属用户ID关联User
private Integer typeId; // 收入类型ID关联数据字典
private BigDecimal amount; // 收入金额
private Date incomeDate; // 收入日期
private String remark; // 备注
public Income() {
}
public Income(Integer id, Integer userId, Integer typeId, BigDecimal amount, Date incomeDate, String remark) {
this.id = id;
this.userId = userId;
this.typeId = typeId;
this.amount = amount;
this.incomeDate = incomeDate;
this.remark = remark;
}
// getter和setter
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getTypeId() {
return typeId;
}
public void setTypeId(Integer typeId) {
this.typeId = typeId;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Date getIncomeDate() {
return incomeDate;
}
public void setIncomeDate(Date incomeDate) {
this.incomeDate = incomeDate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "Income{" +
"id=" + id +
", userId=" + userId +
", typeId=" + typeId +
", amount=" + amount +
", incomeDate=" + incomeDate +
", remark='" + remark + '\'' +
'}';
}
}

@ -10,7 +10,8 @@ public class TestIoc {
System.out.println(user.toString());
StockAccount stockaccount = (StockAccount) ac.getBean("stockAccount");
System.out.println(stockaccount.toString());
Income income = (Income) ac.getBean("income");
System.out.println(income.toString());
}
}

@ -4,7 +4,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- 组长:用户信息维护 -->
<bean id="user" class="com.ssm.ioc.User">
<property name="id" value="1"/>
<property name="username" value="zhangsan"/>
@ -14,6 +14,18 @@
<property name="createTime" value="2024-01-01"/>
</bean>
<!-- 组员C证券账户管理 -->
<bean id="stockAccount" class="com.ssm.ioc.StockAccount">
<property name="id" value="3001"/>
<property name="userId" value="1"/>
<property name="accountName" value="张三的A股账户"/>
<property name="broker" value="东方财富证券"/>
<property name="balance" value="100000.00"/>
<property name="createDate" value="2023-06-18"/>
</bean>
<!-- 组员A收入信息维护 -->
<bean id="income" class="com.ssm.ioc.Income">
<property name="id" value="1001"/>
<property name="userId" value="10"/>
@ -24,5 +36,4 @@
</property>
<property name="remark" value="工资收入"/>
</bean>
</beans>
Loading…
Cancel
Save