xu 7 月之前
父節點
當前提交
a305069ff9

+ 86 - 1
server/api/v1/admin/expenses.go

@@ -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)
 }

+ 3 - 11
server/dao/expenses.go

@@ -13,8 +13,6 @@ type Expenses struct {
 	FeeTime           string        `json:"feeTime" form:"feeTime" gorm:"comment:时间"`
 	Genre             int           `json:"genre" form:"genre" gorm:"comment:费用类型id"`
 	ExpensesGenre     ExpensesGenre `json:"expensesGenre" form:"expensesGenre" gorm:"foreignKey:Genre;references:id;"`
-	ProjectId         int           `json:"projectId" form:"projectId" gorm:"comment:项目id"`
-	Project           Project       `json:"project" form:"project" gorm:"foreignKey:ProjectId;references:id"`
 	ExpenseDetail     string        `json:"expenseDetail" form:"expenseDetail" gorm:"comment:费用明细;type:varchar(400)"`
 	Remarks           string        `json:"remarks" form:"remarks" gorm:"comment:备注"`
 	ThenBalance       float64       `json:"thenBalance" form:"thenBalance" gorm:"comment:当时余额;type:double(10,2)"`
@@ -34,16 +32,13 @@ func (Expenses) TableName() string {
 	return "expenses"
 }
 
-func QueryExpensesList(limit, offset, genre, projectId, name int, dayTime, monthTime, yearTime string) (expenses []Expenses, total int64, err error) {
+func QueryExpensesList(limit, offset, genre, name int, dayTime, monthTime, yearTime string) (expenses []Expenses, total int64, err error) {
 	// 创建db
 	db := global.GVA_DB.Model(&Expenses{})
 	// 如果有条件搜索 下方会自动创建搜索语句
 	if genre != 0 {
 		db = db.Where("genre = ?", genre)
 	}
-	if projectId != 0 {
-		db = db.Where("project_id = ?", projectId)
-	}
 	if name != 0 {
 		db = db.Where("reimburser = ?", name)
 	}
@@ -60,19 +55,16 @@ func QueryExpensesList(limit, offset, genre, projectId, name int, dayTime, month
 	if err != nil {
 		return
 	}
-	err = db.Order("id desc").Limit(limit).Offset(offset).Preload("SysUser").Preload("Department").Preload("ExpensesGenre").Preload("Project").Find(&expenses).Error
+	err = db.Order("id desc").Limit(limit).Offset(offset).Preload("SysUser").Preload("Department").Preload("ExpensesGenre").Find(&expenses).Error
 	return expenses, total, err
 }
 
-func QueryExpensesSumByPeople(limit, offset, genre, projectId, name int, dayTime, monthTime, yearTime string) (results []ExpensesResult, total int64, err error) {
+func QueryExpensesSumByPeople(limit, offset, genre, name int, dayTime, monthTime, yearTime string) (results []ExpensesResult, total int64, err error) {
 	db := global.GVA_DB.Model(&Expenses{}).Select("reimburser,SUM(expenditure_amount) as expenditure_amount_sum,SUM(deposit_amount) as deposit_amount_sum,department_id")
 	// 如果有条件搜索 下方会自动创建搜索语句
 	if genre != 0 {
 		db = db.Where("genre = ?", genre)
 	}
-	if projectId != 0 {
-		db = db.Where("project_id = ?", projectId)
-	}
 	if name != 0 {
 		db = db.Where("reimburser = ?", name)
 	}

+ 67 - 0
server/dao/projectFee.go

@@ -0,0 +1,67 @@
+package dao
+
+import "server/global"
+
+type ProjectFee struct {
+	global.GVA_MODEL
+	Reimburser        int             `json:"reimburser" form:"reimburser" gorm:"comment:报销人"`
+	SysUser           SysUser         `json:"user" form:"user" gorm:"foreignKey:Reimburser;references:id;"`
+	DepartmentId      int             `json:"departmentId" form:"departmentId" gorm:"comment:部门id"`
+	Department        Department      `json:"department" form:"department" gorm:"foreignKey:DepartmentId;references:id;"`
+	ExpenditureAmount float64         `json:"expenditureAmount" form:"expenditureAmount" gorm:"comment:支出金额;type:double(10,2)"`
+	DepositAmount     float64         `json:"depositAmount" form:"depositAmount" gorm:"comment:支入金额;type:double(10,2)"`
+	FeeTime           string          `json:"feeTime" form:"feeTime" gorm:"comment:时间"`
+	Genre             int             `json:"genre" form:"genre" gorm:"comment:费用类型id"`
+	ProjectFeeGenre   ProjectFeeGenre `json:"projectFeeGenre" form:"projectFeeGenre" gorm:"foreignKey:Genre;references:id;"`
+	ProjectCode       string          `json:"projectCode" form:"projectCode" gorm:"comment:项目编号"`
+	Project           Project         `json:"project" form:"project" gorm:"foreignKey:ProjectCode;references:code;"`
+	ExpenseDetail     string          `json:"expenseDetail" form:"expenseDetail" gorm:"comment:费用明细;type:varchar(400)"`
+	Remarks           string          `json:"remarks" form:"remarks" gorm:"comment:备注"`
+	ThenBalance       float64         `json:"thenBalance" form:"thenBalance" gorm:"comment:当时余额;type:double(10,2)"`
+}
+
+func (ProjectFee) TableName() string {
+	return "project_fee"
+}
+
+func QueryProjectFeeList(limit, offset, genre, name int, code, dayTime, monthTime, yearTime string) (projectFee []ProjectFee, total int64, err error) {
+	// 创建db
+	db := global.GVA_DB.Model(&ProjectFee{})
+	// 如果有条件搜索 下方会自动创建搜索语句
+	if genre != 0 {
+		db = db.Where("genre = ?", genre)
+	}
+	if name != 0 {
+		db = db.Where("reimburser = ?", name)
+	}
+	if code != "" {
+		db = db.Where("project_code = ?", code)
+	}
+	if dayTime != "" {
+		db = db.Where("DATE_FORMAT(fee_time, '%Y-%m-%d') = ?", dayTime)
+	}
+	if monthTime != "" {
+		db = db.Where("DATE_FORMAT(fee_time, '%Y-%m') = ?", monthTime)
+	}
+	if yearTime != "" {
+		db = db.Where("DATE_FORMAT(fee_time, '%Y') = ?", yearTime)
+	}
+	err = db.Count(&total).Error
+	if err != nil {
+		return
+	}
+	err = db.Order("id desc").Limit(limit).Offset(offset).Preload("SysUser").Preload("Department").Preload("Project").Preload("ProjectFeeGenre").Find(&projectFee).Error
+	return projectFee, total, err
+}
+
+func (e ProjectFee) CreateProjectFee() error {
+	return global.GVA_DB.Create(&e).Error
+}
+
+func (e ProjectFee) UpdateProjectFee() error {
+	return global.GVA_DB.Model(&ProjectFee{}).Save(&e).Error
+}
+
+func (e ProjectFee) DeleteProjectFee() error {
+	return global.GVA_DB.Unscoped().Where("id = ?", e.ID).Delete(&e).Error
+}

+ 41 - 0
server/dao/projectFeeGenre.go

@@ -0,0 +1,41 @@
+package dao
+
+import "server/global"
+
+type ProjectFeeGenre struct {
+	global.GVA_MODEL
+	Name string `json:"name" form:"name" gorm:"comment:费用类型名称"`
+}
+
+func (ProjectFeeGenre) TableName() string {
+	return "project_fee_genre"
+}
+
+// TODO:费用类型查询
+
+// QueryProjectFeeGenre 查询费用类型
+func QueryProjectFeeGenre() (projectFeeGenre []ProjectFeeGenre, err error) {
+	err = global.GVA_DB.Model(&ProjectFeeGenre{}).Find(&projectFeeGenre).Error
+	return projectFeeGenre, err
+}
+
+// TODO:费用类型新增
+
+// CreateProjectFeeGenre 新增费用类型
+func (eg ProjectFeeGenre) CreateProjectFeeGenre() error {
+	return global.GVA_DB.Create(&eg).Error
+}
+
+// TODO:费用类型修改
+
+// UpdateProjectFeeGenre 修改费用类型
+func (eg ProjectFeeGenre) UpdateProjectFeeGenre() error {
+	return global.GVA_DB.Model(&eg).Where("id = ?", eg.ID).Updates(&eg).Error
+}
+
+// TODO:费用类型删除
+
+// DeleteProjectFeeGenre 删除费用类型
+func (eg ProjectFeeGenre) DeleteProjectFeeGenre() error {
+	return global.GVA_DB.Unscoped().Delete(&eg).Error
+}

+ 56 - 0
server/dao/projectMonthFee.go

@@ -0,0 +1,56 @@
+package dao
+
+import (
+	"gorm.io/gorm"
+	"server/global"
+)
+
+type ProjectMonthFee struct {
+	global.GVA_MODEL
+	Genre            int             `json:"genre" form:"genre" gorm:"comment:费用类型Id"`
+	ProjectFeeGenre  ProjectFeeGenre `json:"projectFeeGenre" form:"projectFeeGenre" gorm:"foreignKey:Genre;references:id;"`
+	TotalDeposit     float64         `json:"totalDeposit" form:"totalDeposit" gorm:"comment:总支入;type:double(10,2)"`
+	TotalExpenditure float64         `json:"totalExpenditure" form:"totalExpenditure" gorm:"comment:总支出;type:double(10,2)"`
+	SettlementMonth  string          `json:"settlementMonth" form:"settlementMonth" gorm:"comment:结算月份"`
+}
+
+func (ProjectMonthFee) TableName() string {
+	return "project_month_fee"
+}
+
+func QueryProjectMonthFee(monthTime, yearTime string) (monthFees []ProjectMonthFee, err error) {
+	db := global.GVA_DB.Model(&ProjectMonthFee{}).Select("genre, SUM(total_deposit) AS total_deposit, SUM(total_expenditure) AS total_expenditure")
+	if monthTime != "" {
+		db = db.Where("DATE_FORMAT(settlement_month, '%Y-%m') = ?", monthTime)
+	}
+	if yearTime != "" {
+		db = db.Where("DATE_FORMAT(settlement_month, '%Y') = ?", yearTime)
+	}
+	err = db.Group("genre").Preload("ProjectFeeGenre").Find(&monthFees).Error
+	return monthFees, err
+}
+
+func QueryProjectMonthFeeBySettlementMonth(settlementMonth string) (monthFees []ProjectMonthFee, err error) {
+	err = global.GVA_DB.Where("settlement_month = ?", settlementMonth).Preload("ProjectFeeGenre").Find(&monthFees).Error
+	return monthFees, err
+}
+
+func CreateProjectMonthFee() error {
+	return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
+		tx = tx.Debug()
+		txErr := tx.Session(&gorm.Session{AllowGlobalUpdate: true}).Unscoped().Delete(&ProjectMonthFee{}).Error
+		if txErr != nil {
+			return txErr
+		}
+		var fees []ProjectMonthFee
+		txErr = tx.Raw(`SELECT DATE_FORMAT(fee_time, '%Y-%m') AS settlement_month,genre, SUM(deposit_amount) AS total_deposit, SUM(expenditure_amount) AS total_expenditure FROM  project_fee GROUP BY DATE_FORMAT(fee_time, '%Y-%m'),genre`).Scan(&fees).Error
+		if txErr != nil {
+			return txErr
+		}
+		txErr = tx.Model(&ProjectMonthFee{}).Create(&fees).Error
+		if txErr != nil {
+			return txErr
+		}
+		return txErr
+	})
+}

+ 2 - 1
server/go.mod

@@ -16,6 +16,7 @@ require (
 	github.com/go-sql-driver/mysql v1.7.1
 	github.com/gofrs/uuid/v5 v5.0.0
 	github.com/golang-jwt/jwt/v4 v4.5.0
+	github.com/google/uuid v1.3.0
 	github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.8+incompatible
 	github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84
 	github.com/mojocn/base64Captcha v1.3.6
@@ -23,6 +24,7 @@ require (
 	github.com/qiniu/api.v7/v7 v7.4.1
 	github.com/qiniu/qmgo v1.1.8
 	github.com/redis/go-redis/v9 v9.0.5
+	github.com/robfig/cron v1.2.0
 	github.com/robfig/cron/v3 v3.0.1
 	github.com/shirou/gopsutil/v3 v3.23.6
 	github.com/shopspring/decimal v1.4.0
@@ -74,7 +76,6 @@ require (
 	github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
 	github.com/google/go-querystring v1.0.0 // indirect
-	github.com/google/uuid v1.3.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
 	github.com/jackc/pgpassfile v1.0.0 // indirect
 	github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect

+ 2 - 0
server/go.sum

@@ -357,6 +357,8 @@ github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDO
 github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
+github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
+github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
 github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
 github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=

+ 20 - 0
server/initialize/job.go

@@ -0,0 +1,20 @@
+package initialize
+
+import (
+	"github.com/robfig/cron"
+	"server/dao"
+	"server/global"
+)
+
+func MyJob() {
+	c := cron.New()
+
+	c.AddFunc("0 0/5 * * * ?", func() {
+		err := dao.CreateProjectMonthFee()
+		if err != nil {
+			global.GVA_LOG.Error("CreateProjectMonthFee ====== " + err.Error())
+		}
+	})
+
+	c.Start()
+}

+ 1 - 0
server/main.go

@@ -35,5 +35,6 @@ func main() {
 		db, _ := global.GVA_DB.DB()
 		defer db.Close()
 	}
+	initialize.MyJob()
 	core.RunWindowsServer()
 }

+ 7 - 7
server/model/common/request/common.go

@@ -61,13 +61,13 @@ type SearchNameTime struct {
 }
 
 type SearchExpenses struct {
-	PageInfo   PageInfo `json:"pageInfo" form:"pageInfo"`
-	Reimburser int      `json:"reimburser" form:"reimburser"`
-	ProjectId  int      `json:"projectId" form:"projectId"`
-	Genre      int      `json:"genre" form:"genre"`
-	DayTime    string   `json:"dayTime" form:"dayTime"`
-	MonthTime  string   `json:"monthTime" form:"monthTime"`
-	YearTime   string   `json:"yearTime" form:"yearTime"`
+	PageInfo    PageInfo `json:"pageInfo" form:"pageInfo"`
+	Reimburser  int      `json:"reimburser" form:"reimburser"`
+	ProjectCode string   `json:"projectCode" form:"projectCode"`
+	Genre       int      `json:"genre" form:"genre"`
+	DayTime     string   `json:"dayTime" form:"dayTime"`
+	MonthTime   string   `json:"monthTime" form:"monthTime"`
+	YearTime    string   `json:"yearTime" form:"yearTime"`
 }
 
 type SearchProjectList struct {

+ 5 - 0
server/router/admin/expenses.go

@@ -15,12 +15,17 @@ func (s *DepartmentRouter) InitExpensesRouter(Router *gin.RouterGroup) {
 	expensesApi := v1.ApiGroupApp.AdminApiGroup.ExpensesApi
 	{
 		expensesRouter.POST("createExpenses", expensesApi.CreateExpenses)
+		expensesRouter.POST("createProjectFee", expensesApi.CreateProjectFee)
 		expensesRouter.PUT("updateExpenses", expensesApi.UpdateExpenses)
+		expensesRouter.PUT("updateProjectFee", expensesApi.UpdateProjectFee)
 		expensesRouter.DELETE("deleteExpenses", expensesApi.DeleteExpenses)
+		expensesRouter.DELETE("deleteProjectFee", expensesApi.DeleteProjectFee)
 	}
 	{
 		expensesRouterWithoutRecord.POST("queryExpensesList", expensesApi.QueryExpensesList)
+		expensesRouterWithoutRecord.POST("queryProjectFeeList", expensesApi.QueryProjectFeeList)
 		expensesRouterWithoutRecord.POST("queryExpensesSumByPeople", expensesApi.QueryExpensesSumByPeople)
 		expensesRouterWithoutRecord.GET("querySurplus", expensesApi.QuerySurplus)
+		expensesRouterWithoutRecord.GET("queryProjectMonthFee", expensesApi.QueryProjectMonthFee)
 	}
 }

+ 25 - 4
server/service/admin/expenses.go

@@ -10,15 +10,21 @@ type ExpensesService struct{}
 func (es *ExpensesService) QueryExpensesList(info request.SearchExpenses) ([]dao.Expenses, int64, error) {
 	limit := info.PageInfo.PageSize
 	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
-	return dao.QueryExpensesList(limit, offset, info.Genre, info.ProjectId, info.Reimburser, info.DayTime, info.MonthTime, info.YearTime)
+	return dao.QueryExpensesList(limit, offset, info.Genre, info.Reimburser, info.DayTime, info.MonthTime, info.YearTime)
+}
+
+func (es *ExpensesService) QueryProjectFeeList(info request.SearchExpenses) ([]dao.ProjectFee, int64, error) {
+	limit := info.PageInfo.PageSize
+	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
+	return dao.QueryProjectFeeList(limit, offset, info.Genre, info.Reimburser, info.ProjectCode, info.DayTime, info.MonthTime, info.YearTime)
 }
 
 func (es *ExpensesService) QueryExpensesSumByPeople(info request.SearchExpenses) ([]dao.ExpensesResult, int64, error) {
 	limit := info.PageInfo.PageSize
 	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
-	expenses, total, err := dao.QueryExpensesSumByPeople(limit, offset, info.Genre, info.ProjectId, info.Reimburser, info.DayTime, info.MonthTime, info.YearTime)
+	expenses, total, err := dao.QueryExpensesSumByPeople(limit, offset, info.Genre, info.Reimburser, info.DayTime, info.MonthTime, info.YearTime)
 	for i, expens := range expenses {
-		list, _, err := dao.QueryExpensesList(1000, 0, info.Genre, info.ProjectId, expens.Reimburser, info.DayTime, info.MonthTime, info.YearTime)
+		list, _, err := dao.QueryExpensesList(1000, 0, info.Genre, expens.Reimburser, info.DayTime, info.MonthTime, info.YearTime)
 		if err != nil {
 			return expenses, total, err
 		}
@@ -34,7 +40,6 @@ func (es *ExpensesService) QueryExpensesSumByPeople(info request.SearchExpenses)
 		expenses[i].Department = deps
 		expenses[i].SysUser = user
 	}
-
 	return expenses, total, err
 }
 
@@ -42,14 +47,30 @@ func (es *ExpensesService) QuerySurplus() (interface{}, error) {
 	return dao.QuerySurplus()
 }
 
+func (es *ExpensesService) QueryProjectMonthFee(monthTime, yearTime string) ([]dao.ProjectMonthFee, error) {
+	return dao.QueryProjectMonthFee(monthTime, yearTime)
+}
+
 func (es *ExpensesService) CreateExpenses(expenses dao.Expenses) error {
 	return expenses.CreateExpenses()
 }
 
+func (es *ExpensesService) CreateProjectFee(fee dao.ProjectFee) error {
+	return fee.CreateProjectFee()
+}
+
 func (es *ExpensesService) UpdateExpenses(expenses dao.Expenses) error {
 	return expenses.UpdateExpenses()
 }
 
+func (es *ExpensesService) UpdateProjectFee(fee dao.ProjectFee) error {
+	return fee.UpdateProjectFee()
+}
+
 func (es *ExpensesService) DeleteExpenses(expenses dao.Expenses) error {
 	return expenses.DeleteExpenses()
 }
+
+func (es *ExpensesService) DeleteProjectFee(fee dao.ProjectFee) error {
+	return fee.DeleteProjectFee()
+}

+ 11 - 0
server/service/example/cronWork.go

@@ -0,0 +1,11 @@
+package example
+
+import (
+	"server/dao"
+	"server/global"
+)
+
+func CreateProjectFeeSum() {
+	err := dao.CreateProjectMonthFee()
+	global.GVA_LOG.Error("CreateProjectFeeSum" + err.Error())
+}