Przeglądaj źródła

feature(管理员账单) 加入账单确认页面

liuqi@dashoo.cn 4 lat temu
rodzic
commit
ed08a2952a

+ 2 - 2
model/account/internal/settle_account_bill.go

@@ -20,7 +20,7 @@ type SettleAccountBill struct {
 	ActualVerificationDate *gtime.Time `orm:"ActualVerificationDate" json:"actual_verification_date"` // 实际核销时间
 	ActualVerificationUser int         `orm:"ActualVerificationUser" json:"actual_verification_user"` // 实际核销人
 	VerificationUserId     int         `orm:"VerificationUserId"     json:"verification_user_id"`     // 核销人Id
-	VerificationUser       int         `orm:"VerificationUser"       json:"verification_user"`        // 核销人
+	VerificationUser       string         `orm:"VerificationUser"       json:"verification_user"`        // 核销人
 	VerificationDate       *gtime.Time `orm:"VerificationDate"       json:"verification_date"`        // 完成核销时间
 	CreateUserId           int         `orm:"CreateUserId"           json:"create_user_id"`           //
 	CreateBy               string      `orm:"CreateBy"               json:"create_by"`                //
@@ -34,7 +34,7 @@ type SettleAccountBill struct {
 	SettleUser             string         `orm:"SettleUser"             json:"settle_user"`              // 结算人
 	SettleDate             *gtime.Time `orm:"SettleDate"             json:"settle_date"`              // 结算时间
 	DeductMoneyUserId      int         `orm:"DeductMoneyUserId"      json:"deduct_money_user_id"`     // 扣款人Id
-	DeductMoneyUser        int         `orm:"DeductMoneyUser"        json:"deduct_money_user"`        // 扣款人
+	DeductMoneyUser        string         `orm:"DeductMoneyUser"        json:"deduct_money_user"`        // 扣款人
 	DeductMoneyDate        *gtime.Time `orm:"DeductMoneyDate"        json:"deduct_money_date"`        // 扣款时间
 	Remark                 string      `orm:"Remark"                 json:"remark"`                   // 备注
 	UpdateUserId           int         `orm:"UpdateUserId"           json:"update_user_id"`           // 更新者ID

+ 5 - 0
model/account/settle_account_bill.go

@@ -16,6 +16,11 @@ type SettleAccountBill internal.SettleAccountBill
 type SettleAccountBillReq struct {
 	MainUserId  int `json:"mainUserId"`
 	Status      string `json:"status"`
+	StartDate      string `json:"startDate"`
+	EndDate      string `json:"endDate"`
+	SettleDate      string `json:"settleDate"`
+	SettleUser      string `json:"settleUser"`
+	MainUser      string `json:"mainUser"`
 }
 
 type AccountBillSettleReq struct {

+ 16 - 0
service/settle_account_bill/settle_account_bill.go

@@ -11,6 +11,7 @@ import (
 	"lims_adapter/model"
 	accountModel "lims_adapter/model/account"
 	"strconv"
+	"strings"
 )
 
 // Service 会议室服务
@@ -41,6 +42,21 @@ func (s Service)  List(req model.ListReq) ([]accountModel.SettleAccountBill, int
 		if entity.Status != "" {
 			where += fmt.Sprintf(" AND Status='%v'", entity.Status)
 		}
+		if entity.SettleDate != "" {
+			timelist := strings.Split(entity.SettleDate,",")
+			if len(timelist) == 2 {
+				where += fmt.Sprintf(" AND SettleDate>'%v' AND SettleDate<'%v'", timelist[0],timelist[1])
+			}
+		}
+		if entity.SettleUser != "" {
+			where += fmt.Sprintf(" AND SettleUser LIKE '%%%v%%'", entity.SettleUser)
+		}
+		if entity.MainUser != "" {
+			where += fmt.Sprintf(" AND MainUser LIKE '%%%v%%'", entity.MainUser)
+		}
+		if entity.StartDate != "" && entity.EndDate != "" {
+			where += fmt.Sprintf(" AND StartDate>'%v' AND EndDate<'%v'", entity.StartDate, entity.EndDate)
+		}
 	}
 	entityModel = entityModel.Where(where)
 	total, err := entityModel.Count()