Browse Source

feature(结算明细查看) 加入结算明细

liuqi@dashoo.cn 4 years ago
parent
commit
851cabda1e

+ 2 - 2
handler/settle_account_bill.go

@@ -38,7 +38,7 @@ func (a *SettleAccountBillController) SettleAccountBillList(ctx context.Context,
 }
 
 // 结算明细(已出账单)结算
-func (a *SettleAccountMainController) SettleAccountBill(ctx context.Context, req *accountModel.AccountBillSettleReq, rsp *comm_def.CommonMsg) error {
+func (a *SettleAccountBillController) SettleAccountBill(ctx context.Context, req *accountModel.AccountBillSettleReq, rsp *comm_def.CommonMsg) error {
 	tenant, err := micro_srv.GetTenant(ctx)
 	if err != nil {
 		return err
@@ -60,7 +60,7 @@ func (a *SettleAccountMainController) SettleAccountBill(ctx context.Context, req
 	return nil
 }
 // 结算明细(已出账单)确认
-func (a *SettleAccountMainController) ConfirmAccountBill(ctx context.Context, req *accountModel.AccountBillConfirmReq, rsp *comm_def.CommonMsg) error {
+func (a *SettleAccountBillController) ConfirmAccountBill(ctx context.Context, req *accountModel.AccountBillConfirmReq, rsp *comm_def.CommonMsg) error {
 	tenant, err := micro_srv.GetTenant(ctx)
 	if err != nil {
 		return err

+ 1 - 0
model/account/settle_account_main.go

@@ -28,6 +28,7 @@ type SettleAccountMainReq struct {
 	FeeType   string `json:"feeType"`
 	AppointStartDate string `json:"appointStartDate"`
 	AppointEndDate string `json:"appointEndDate"`
+	SettleDate string `json:"settleDate"`
 }
 
 type AccountMainConfirmReq struct {

+ 7 - 0
service/settle_account_main/settle_account_main.go

@@ -11,6 +11,7 @@ import (
 	accountModel "lims_adapter/model/account"
 	"math"
 	"strconv"
+	"strings"
 )
 
 // Service 会议室服务
@@ -74,6 +75,12 @@ func (s Service) List(req model.ListReq) ([]accountModel.SettleAccountMain, int,
 		if entity.AppointStartDate != "" && entity.AppointEndDate != "" {
 			where += fmt.Sprintf(" AND AppointStartDate>'%v' AND AppointEndDate<'%v'", entity.AppointStartDate, entity.AppointEndDate)
 		}
+		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])
+			}
+		}
 	}
 	entityModel = entityModel.Where(where)
 	total, err := entityModel.Count()