|
@@ -32,6 +32,28 @@ func (ea *ExpensesApi) QueryExpensesList(c *gin.Context) {
|
|
|
}, "获取成功", c)
|
|
|
}
|
|
|
|
|
|
+func (ea *ExpensesApi) QueryProjectFeeList(c *gin.Context) {
|
|
|
+ var info request.SearchExpenses
|
|
|
+ err := c.ShouldBindJSON(&info)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("QueryProjectFeeList ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ list, total, err := expensesService.QueryProjectFeeList(info)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("QueryProjectFeeList ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithDetailed(response.PageResult{
|
|
|
+ List: list,
|
|
|
+ Total: total,
|
|
|
+ Page: info.PageInfo.Page,
|
|
|
+ PageSize: info.PageInfo.PageSize,
|
|
|
+ }, "获取成功", c)
|
|
|
+}
|
|
|
+
|
|
|
func (ea *ExpensesApi) QueryExpensesSumByPeople(c *gin.Context) {
|
|
|
var info request.SearchExpenses
|
|
|
err := c.ShouldBindJSON(&info)
|
|
@@ -64,6 +86,18 @@ func (ea *ExpensesApi) QuerySurplus(c *gin.Context) {
|
|
|
response.OkWithData(surplus, c)
|
|
|
}
|
|
|
|
|
|
+func (ea *ExpensesApi) QueryProjectMonthFee(c *gin.Context) {
|
|
|
+ monthTime := c.Query("monthTime")
|
|
|
+ yearTime := c.Query("yearTime")
|
|
|
+ fee, err := expensesService.QueryProjectMonthFee(monthTime, yearTime)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("QueryProjectMonthFee ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithData(fee, c)
|
|
|
+}
|
|
|
+
|
|
|
func (ea *ExpensesApi) CreateExpenses(c *gin.Context) {
|
|
|
var expenses dao.Expenses
|
|
|
err := c.ShouldBindJSON(&expenses)
|
|
@@ -81,6 +115,23 @@ func (ea *ExpensesApi) CreateExpenses(c *gin.Context) {
|
|
|
response.OkWithMessage("新增成功", c)
|
|
|
}
|
|
|
|
|
|
+func (ea *ExpensesApi) CreateProjectFee(c *gin.Context) {
|
|
|
+ var projectFee dao.ProjectFee
|
|
|
+ err := c.ShouldBindJSON(&projectFee)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("CreateProjectFee ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = expensesService.CreateProjectFee(projectFee)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("CreateProjectFee ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithMessage("新增成功", c)
|
|
|
+}
|
|
|
+
|
|
|
func (ea *ExpensesApi) UpdateExpenses(c *gin.Context) {
|
|
|
var expenses dao.Expenses
|
|
|
err := c.ShouldBindJSON(&expenses)
|
|
@@ -98,6 +149,23 @@ func (ea *ExpensesApi) UpdateExpenses(c *gin.Context) {
|
|
|
response.OkWithMessage("修改成功", c)
|
|
|
}
|
|
|
|
|
|
+func (ea *ExpensesApi) UpdateProjectFee(c *gin.Context) {
|
|
|
+ var projectFee dao.ProjectFee
|
|
|
+ err := c.ShouldBindJSON(&projectFee)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("UpdateProjectFee ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = expensesService.UpdateProjectFee(projectFee)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("UpdateProjectFee ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithMessage("修改成功", c)
|
|
|
+}
|
|
|
+
|
|
|
func (ea *ExpensesApi) DeleteExpenses(c *gin.Context) {
|
|
|
var expenses dao.Expenses
|
|
|
err := c.ShouldBindJSON(&expenses)
|
|
@@ -112,5 +180,22 @@ func (ea *ExpensesApi) DeleteExpenses(c *gin.Context) {
|
|
|
global.GVA_LOG.Error("DeleteExpenses ====== " + err.Error())
|
|
|
return
|
|
|
}
|
|
|
- response.OkWithMessage("修改成功", c)
|
|
|
+ response.OkWithMessage("删除成功", c)
|
|
|
+}
|
|
|
+
|
|
|
+func (ea *ExpensesApi) DeleteProjectFee(c *gin.Context) {
|
|
|
+ var projectFee dao.ProjectFee
|
|
|
+ err := c.ShouldBindJSON(&projectFee)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("DeleteProjectFee ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = expensesService.DeleteProjectFee(projectFee)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("DeleteProjectFee ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithMessage("删除成功", c)
|
|
|
}
|