DengBiao 1 год назад
Родитель
Сommit
4ca0e76511
5 измененных файлов: 16 добавлений и 6 удалений
  1. +3
    -1
      app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go
  2. +1
    -0
      app/admin/md/md_enterprise_manage.go
  3. +3
    -3
      app/admin/svc/svc_data_statisstics.go
  4. +8
    -2
      app/db/db_central_kitchen_for_school_user_with_day.go
  5. +1
    -0
      app/db/model/self_support_for_school_info.go

+ 3
- 1
app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go Просмотреть файл

@@ -1149,6 +1149,7 @@ func SelfSupportForSchoolConsumeLimit(c *gin.Context) {
}

data.SchoolCode = selfSupportForSchoolInfo.SchoolCode
data.SchoolName = selfSupportForSchoolInfo.SchoolName
data.ConsumeLimitSyncInfo = append(data.ConsumeLimitSyncInfo, md2.ConsumeLimitSyncInfo{
FaceUid: faceInfo.UserId,
OutRosterCode: utils.IntToStr(v.UserIdentityId),
@@ -1328,7 +1329,8 @@ func SelfSupportForSchoolConsumeLimitList(c *gin.Context) {
})
}
e.OutSuc(c, map[string]interface{}{
"list": list,
"list": list,
"enterprise_kind_list": md.EnterpriseKindForSchool,
"daily_consume_limit_switch_list": []map[string]string{
{
"name": "开启",


+ 1
- 0
app/admin/md/md_enterprise_manage.go Просмотреть файл

@@ -509,6 +509,7 @@ type SelfSupportForSchoolConsumeLimitReq struct {

type SelfSupportForSchoolConsumeLimitListReq struct {
EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"`
EnterpriseKind int `json:"enterprise_kind" label:"企业类型"`
Limit int `json:"limit" binding:"required"`
Page int `json:"page" binding:"required"`
Name string `json:"name" label:"姓名"`


+ 3
- 3
app/admin/svc/svc_data_statisstics.go Просмотреть файл

@@ -1706,7 +1706,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD

for _, value := range req.MealKindList {
if value == enum.CentralKitchenForSchoolUserWithDayKindForBreakfast {
count1, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
count1, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, req.StartDate, req.EndDate, enum.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
@@ -1715,7 +1715,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast).String()] += count1
}
if value == enum.CentralKitchenForSchoolUserWithDayKindForLunch {
count2, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForLunch, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
count2, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, req.StartDate, req.EndDate, enum.CentralKitchenForSchoolUserWithDayKindForLunch, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
@@ -1724,7 +1724,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForLunch).String()] += count2
}
if value == enum.CentralKitchenForSchoolUserWithDayKindForDinner {
count3, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForDinner, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
count3, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, req.StartDate, req.EndDate, enum.CentralKitchenForSchoolUserWithDayKindForDinner, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())


+ 8
- 2
app/db/db_central_kitchen_for_school_user_with_day.go Просмотреть файл

@@ -91,9 +91,15 @@ func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb
return count, nil
}

func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(ordNo string, kind, state int) (count int64, err error) {
func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(ordNo, startDate, endDate string, kind, state int) (count int64, err error) {
var m model.CentralKitchenForSchoolUserWithDay
count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("kind =?", kind).And("state !=?", state).Count(&m)
sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", startDate, time.Local)
eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", endDate, time.Local)

count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("kind =?", kind).
And("date >= ?", sDate.Format("2006-01-02")).And("date <= ?", eDate.Format("2006-01-02")).
And("state !=?", state).
Count(&m)
return count, nil
}



+ 1
- 0
app/db/model/self_support_for_school_info.go Просмотреть файл

@@ -6,6 +6,7 @@ type SelfSupportForSchoolInfo struct {
SchoolCode string `json:"school_code" xorm:"not null default '' comment('学校内标') VARCHAR(255)"`
SchoolStdCode string `json:"school_std_code" xorm:"not null default '' comment('学校外标') VARCHAR(255)"`
GroupKey string `json:"group_key" xorm:"not null default '' comment('学校人脸库ID') VARCHAR(255)"`
SchoolName string `json:"school_name" xorm:"not null default '' VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' VARCHAR(255)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`


Загрузка…
Отмена
Сохранить