This commit is contained in:
suyl
2021-07-20 15:10:42 +08:00
parent 1facd77f78
commit 59cc2d4ffd
3 changed files with 38 additions and 4 deletions

View File

@@ -12,7 +12,9 @@ import (
//每日流量卡流量结算
func SimFlowDaySettle(ctx *jxcontext.Context) {
var (
db = dao.GetDB()
db = dao.GetDB()
monthBegin = utils.Str2Time(utils.Int2Str(time.Now().Year()) + "-" + utils.Int2Str(int(time.Now().Month())) + "-01 00:00:00")
monthEnd = monthBegin.AddDate(0, 0, -1).AddDate(0, 1, 0)
)
//找出所有状态不为 超流量的打印机iccid卡
printers, _ := dao.GetPrinters(db, 0, "", 0, model.PrinterStatusNoFlow)
@@ -25,9 +27,10 @@ func SimFlowDaySettle(ctx *jxcontext.Context) {
//先查当月用的总的, 减去当月已经用的总的,就是昨天用的
if getCardInfoResultMonth, err2 := api.TibiotAPI.IotDataMonth(v.IccID); err2 == nil {
//表示当月用的总的也还没同步。只有去查卡信息中的总流量使用,减去所有总使用,就是昨天用的。。先不写
if getCardInfoResultMonth == nil || getCardInfoResultMonth.CardFlow == "" {
if getCardInfoResultMonth == nil || getCardInfoResultMonth.CardFlow == "" || getCardInfoResultMonth.CardFlow == "0KB" {
//api.TibiotAPI.BatchQueryCardInfo(1)
} else if getCardInfoResultMonth.CardFlow != "" {
sumExpend, _ := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd)
}
}