|
|
@ -2804,9 +2804,15 @@ func (t *Chargetab) ChargeTotalPage(pageSize int, pageIndex int, startDate strin |
|
|
|
feeMap := make(map[int]Chargetab) |
|
|
|
begDate := make(map[string]time.Time) |
|
|
|
endDate := make(map[string]time.Time) |
|
|
|
chargetimeMap := make(map[string]string) |
|
|
|
for _, v := range feeLog { |
|
|
|
feeID = append(feeID, v.Chargenr) |
|
|
|
feeMap[v.Chargenr] = v |
|
|
|
if _, ok := chargetimeMap[v.Propertyid]; ok { |
|
|
|
chargetimeMap[v.Propertyid] += ";" + v.Chargetime |
|
|
|
} else { |
|
|
|
chargetimeMap[v.Propertyid] = v.Chargetime |
|
|
|
} |
|
|
|
if info, ok := begDate[v.Propertyid]; ok { |
|
|
|
if _info, _ := time.Parse("2006-01-02", v.Chargestartdate); _info.Before(info) { |
|
|
|
begDate[v.Propertyid] = _info |
|
|
@ -2863,14 +2869,16 @@ func (t *Chargetab) ChargeTotalPage(pageSize int, pageIndex int, startDate strin |
|
|
|
//如果等于查询年 为当前
|
|
|
|
if v.Allocateyear == nowEndDate.Year() { |
|
|
|
nowMoney[info.Propertyid] += v.Allocateexpense |
|
|
|
_year := utils.ValueToString(v.Allocateyear, "") |
|
|
|
_month := utils.ValueToString(v.Allocatemonth, "") |
|
|
|
if len(_month) == 1 { |
|
|
|
_month = "0" + _month |
|
|
|
} |
|
|
|
//_year := utils.ValueToString(v.Allocateyear, "")
|
|
|
|
//_month := utils.ValueToString(v.Allocatemonth, "")
|
|
|
|
//if len(_month) == 1 {
|
|
|
|
// _month = "0" + _month
|
|
|
|
//}
|
|
|
|
//记录档期时间
|
|
|
|
_date, _ := time.Parse("2006-01-02", _year+"-"+_month+"-01") |
|
|
|
_dateEnd := _date.AddDate(0, 1, -1) |
|
|
|
_date, _ := time.Parse("2006-01-02", info.Chargestartdate) |
|
|
|
//_dateEnd := _date.AddDate(0, 1, -1)
|
|
|
|
_dateEnd, _ := time.Parse("2006-01-02", info.Chargeenddate) |
|
|
|
if _info, ok := nowStartDateMap[info.Propertyid]; ok { |
|
|
|
if _date.Before(_info) { |
|
|
|
nowStartDateMap[info.Propertyid] = _date |
|
|
@ -2886,7 +2894,6 @@ func (t *Chargetab) ChargeTotalPage(pageSize int, pageIndex int, startDate strin |
|
|
|
nowEndDateMap[info.Propertyid] = _dateEnd |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -2914,7 +2921,10 @@ func (t *Chargetab) ChargeTotalPage(pageSize int, pageIndex int, startDate strin |
|
|
|
if info, ok := lengthDate[v.Propertyid]; ok { |
|
|
|
data[k].Lengthdate = utils.ValueToString(info, "") |
|
|
|
} |
|
|
|
data[k].Chargetime = startDate |
|
|
|
/** |
|
|
|
需要加载每天时间 |
|
|
|
*/ |
|
|
|
data[k].Chargetime = chargetimeMap[v.Propertyid] |
|
|
|
data[k].StatisticalDate = startDate |
|
|
|
//加载开始时间
|
|
|
|
//data[k].Begdate = utils.ValueToString(begDate[v.Propertyid], "")
|
|
|
@ -3068,28 +3078,24 @@ func (t *Chargetab) ChargeTotalPage(pageSize int, pageIndex int, startDate strin |
|
|
|
//如果等于查询年 为当前
|
|
|
|
if v.Allocateyear == nowEndDate.Year() { |
|
|
|
nowMoney[info.Accesscardid] += v.Allocateexpense |
|
|
|
_year := utils.ValueToString(v.Allocateyear, "") |
|
|
|
_month := utils.ValueToString(v.Allocatemonth, "") |
|
|
|
if len(_month) == 1 { |
|
|
|
_month = "0" + _month |
|
|
|
} |
|
|
|
//记录档期时间
|
|
|
|
_date, _ := time.Parse("2006-01-02", _year+"-"+_month+"-01") |
|
|
|
_dateEnd := _date.AddDate(0, 1, -1) |
|
|
|
if _info, ok := nowStartDateMap[info.Accesscardid]; ok { |
|
|
|
_date, _ := time.Parse("2006-01-02", info.Chargestartdate) |
|
|
|
//_dateEnd := _date.AddDate(0, 1, -1)
|
|
|
|
_dateEnd, _ := time.Parse("2006-01-02", info.Chargeenddate) |
|
|
|
if _info, ok := nowStartDateMap[info.Propertyid]; ok { |
|
|
|
if _date.Before(_info) { |
|
|
|
nowStartDateMap[info.Accesscardid] = _date |
|
|
|
nowStartDateMap[info.Propertyid] = _date |
|
|
|
} |
|
|
|
} else { |
|
|
|
nowStartDateMap[info.Accesscardid] = _date |
|
|
|
nowStartDateMap[info.Propertyid] = _date |
|
|
|
} |
|
|
|
if _info, ok := nowEndDateMap[info.Accesscardid]; ok { |
|
|
|
if _info, ok := nowEndDateMap[info.Propertyid]; ok { |
|
|
|
if _dateEnd.After(_info) { |
|
|
|
nowStartDateMap[info.Accesscardid] = _dateEnd |
|
|
|
nowStartDateMap[info.Propertyid] = _dateEnd |
|
|
|
} |
|
|
|
} else { |
|
|
|
nowEndDateMap[info.Accesscardid] = _dateEnd |
|
|
|
} |
|
|
|
nowEndDateMap[info.Propertyid] = _dateEnd |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -3273,28 +3279,24 @@ func (t *Chargetab) ChargeTotalPage(pageSize int, pageIndex int, startDate strin |
|
|
|
//如果等于查询年 为当前
|
|
|
|
if v.Allocateyear == nowEndDate.Year() { |
|
|
|
nowMoney[info.Carportid] += v.Allocateexpense |
|
|
|
_year := utils.ValueToString(v.Allocateyear, "") |
|
|
|
_month := utils.ValueToString(v.Allocatemonth, "") |
|
|
|
if len(_month) == 1 { |
|
|
|
_month = "0" + _month |
|
|
|
} |
|
|
|
//记录档期时间
|
|
|
|
_date, _ := time.Parse("2006-01-02", _year+"-"+_month+"-01") |
|
|
|
_dateEnd := _date.AddDate(0, 1, -1) |
|
|
|
if _info, ok := nowStartDateMap[info.Carportid]; ok { |
|
|
|
_date, _ := time.Parse("2006-01-02", info.Chargestartdate) |
|
|
|
//_dateEnd := _date.AddDate(0, 1, -1)
|
|
|
|
_dateEnd, _ := time.Parse("2006-01-02", info.Chargeenddate) |
|
|
|
if _info, ok := nowStartDateMap[info.Propertyid]; ok { |
|
|
|
if _date.Before(_info) { |
|
|
|
nowStartDateMap[info.Carportid] = _date |
|
|
|
nowStartDateMap[info.Propertyid] = _date |
|
|
|
} |
|
|
|
} else { |
|
|
|
nowStartDateMap[info.Carportid] = _date |
|
|
|
nowStartDateMap[info.Propertyid] = _date |
|
|
|
} |
|
|
|
if _info, ok := nowEndDateMap[info.Carportid]; ok { |
|
|
|
if _info, ok := nowEndDateMap[info.Propertyid]; ok { |
|
|
|
if _dateEnd.After(_info) { |
|
|
|
nowStartDateMap[info.Carportid] = _dateEnd |
|
|
|
nowStartDateMap[info.Propertyid] = _dateEnd |
|
|
|
} |
|
|
|
} else { |
|
|
|
nowEndDateMap[info.Carportid] = _dateEnd |
|
|
|
} |
|
|
|
nowEndDateMap[info.Propertyid] = _dateEnd |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|