|
@@ -65,6 +65,16 @@ func (fa *FinanceApi) QueryExpensesGenre(c *gin.Context) {
|
|
|
response.OkWithData(genre, c)
|
|
|
}
|
|
|
|
|
|
+func (fa *FinanceApi) QueryProjectFeeGenre(c *gin.Context) {
|
|
|
+ genre, err := financeService.QueryProjectFeeGenre()
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("QueryProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithData(genre, c)
|
|
|
+}
|
|
|
+
|
|
|
func (fa *FinanceApi) QueryBorrowingList(c *gin.Context) {
|
|
|
var info request.SearchNameTime
|
|
|
err := c.ShouldBindJSON(&info)
|
|
@@ -171,6 +181,23 @@ func (fa *FinanceApi) CreateExpensesGenre(c *gin.Context) {
|
|
|
response.OkWithMessage("新增成功", c)
|
|
|
}
|
|
|
|
|
|
+func (fa *FinanceApi) CreateProjectFeeGenre(c *gin.Context) {
|
|
|
+ var projectFeeGenre dao.ProjectFeeGenre
|
|
|
+ err := c.ShouldBindJSON(&projectFeeGenre)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("CreateProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = financeService.CreateProjectFeeGenre(projectFeeGenre)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("CreateProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithMessage("新增成功", c)
|
|
|
+}
|
|
|
+
|
|
|
func (fa *FinanceApi) CreateBorrowing(c *gin.Context) {
|
|
|
var borrowing dao.Borrowing
|
|
|
err := c.ShouldBindJSON(&borrowing)
|
|
@@ -281,6 +308,23 @@ func (fa *FinanceApi) UpdateExpensesGenre(c *gin.Context) {
|
|
|
response.OkWithMessage("更新成功", c)
|
|
|
}
|
|
|
|
|
|
+func (fa *FinanceApi) UpdateProjectFeeGenre(c *gin.Context) {
|
|
|
+ var projectFeeGenre dao.ProjectFeeGenre
|
|
|
+ err := c.ShouldBindJSON(&projectFeeGenre)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("UpdateProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = financeService.UpdateProjectFeeGenre(projectFeeGenre)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("UpdateProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithMessage("更新成功", c)
|
|
|
+}
|
|
|
+
|
|
|
func (fa *FinanceApi) UpdateBorrowing(c *gin.Context) {
|
|
|
var borrowing dao.Borrowing
|
|
|
err := c.ShouldBindJSON(&borrowing)
|
|
@@ -337,6 +381,28 @@ func (fa *FinanceApi) DeleteExpensesGenre(c *gin.Context) {
|
|
|
response.OkWithMessage("删除成功", c)
|
|
|
}
|
|
|
|
|
|
+func (fa *FinanceApi) DeleteProjectFeeGenre(c *gin.Context) {
|
|
|
+ var projectFeeGenre dao.ProjectFeeGenre
|
|
|
+ err := c.ShouldBindJSON(&projectFeeGenre)
|
|
|
+ if err != nil {
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("DeleteProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = financeService.DeleteProjectFeeGenre(projectFeeGenre)
|
|
|
+ if err != nil {
|
|
|
+ if err.Error() == "项目收费类型正在被使用" {
|
|
|
+ response.FailWithMessage("项目收费类型正在被使用", c)
|
|
|
+ global.GVA_LOG.Error("DeleteProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.FailWithMessage("失败", c)
|
|
|
+ global.GVA_LOG.Error("DeleteProjectFeeGenre ====== " + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkWithMessage("删除成功", c)
|
|
|
+}
|
|
|
+
|
|
|
func (fa *FinanceApi) DeleteBorrowing(c *gin.Context) {
|
|
|
var borrowing dao.Borrowing
|
|
|
err := c.ShouldBindJSON(&borrowing)
|