Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
b86931c020
4 changed files with 30 additions and 30 deletions
  1. +3
    -3
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +22
    -22
      app/admin/svc/svc_central_kitchen_for_school_package.go
  3. +3
    -3
      app/admin/svc/svc_central_kitchen_for_school_package_for_system.go
  4. +2
    -2
      app/svc/svc_wx_pay.go

+ 3
- 3
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go View File

@@ -727,9 +727,9 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) {
if spec == nil {
spec = &model.CentralKitchenForSchoolWithSpec{
EnterpriseId: enterpriseId,
IsOpenBreakfast: 0,
IsOpenLunch: 0,
IsOpenDinner: 0,
IsOpenBreakfast: 1,
IsOpenLunch: 1,
IsOpenDinner: 1,
BreakfastUnitPrice: "0",
LunchUnitPrice: "0",
DinnerUnitPrice: "0",


+ 22
- 22
app/admin/svc/svc_central_kitchen_for_school_package.go View File

@@ -24,14 +24,14 @@ func AddCentralKitchenForSchoolPackage(req md.SaveCentralKitchenForSchoolPackage
return errors.New("请勿重复添加【" + req.Month + "】套餐")
}

//1、查询`central_kitchen_for_school_with_spec`
centralKitchenForSchoolWithSpec := db.CentralKitchenForSchoolWithSpec{}
centralKitchenForSchoolWithSpec.Set(req.EnterpriseId)
spec, err := centralKitchenForSchoolWithSpec.GetCentralKitchenForSchoolWithSpec()
if err != nil {
_ = session.Rollback()
return err
}
////1、查询`central_kitchen_for_school_with_spec`
//centralKitchenForSchoolWithSpec := db.CentralKitchenForSchoolWithSpec{}
//centralKitchenForSchoolWithSpec.Set(req.EnterpriseId)
//spec, err := centralKitchenForSchoolWithSpec.GetCentralKitchenForSchoolWithSpec()
//if err != nil {
// _ = session.Rollback()
// return err
//}
//1、新增`central_kitchen_for_school_package`
packageId, err := centralKitchenForSchoolPackageDb.CentralKitchenForSchoolPackageInsertBySession(session, &model.CentralKitchenForSchoolPackage{
EnterpriseId: req.EnterpriseId,
@@ -53,13 +53,13 @@ func AddCentralKitchenForSchoolPackage(req md.SaveCentralKitchenForSchoolPackage
var centralKitchenForSchoolPackageWithDays []*model.CentralKitchenForSchoolPackageWithDay
for _, v := range req.DateList {
var isOpenBreakfast, isOpenLunch, isOpenDinner, isOpenReplenish = md.CloseBreakfast, md.CloseLunch, md.CloseDinner, md.CloseReplenish
if spec.IsOpenBreakfast == md.OpenBreakfast && v.IsOpenBreakfast == md.OpenBreakfast {
if v.IsOpenBreakfast == md.OpenBreakfast {
isOpenBreakfast = md.OpenBreakfast
}
if spec.IsOpenLunch == md.OpenLunch && v.IsOpenLunch == md.OpenLunch {
if v.IsOpenLunch == md.OpenLunch {
isOpenLunch = md.OpenLunch
}
if spec.IsOpenDinner == md.OpenDinner && v.IsOpenDinner == md.OpenDinner {
if v.IsOpenDinner == md.OpenDinner {
isOpenDinner = md.OpenDinner
}
if v.IsOpenReplenish == md.OpenReplenish {
@@ -89,14 +89,14 @@ func UpdateCentralKitchenForSchoolPackage(req md.SaveCentralKitchenForSchoolPack
defer session.Close()
session.Begin()
now := time.Now()
//1、查询`central_kitchen_for_school_with_spec`
centralKitchenForSchoolWithSpec := db.CentralKitchenForSchoolWithSpec{}
centralKitchenForSchoolWithSpec.Set(req.EnterpriseId)
spec, err := centralKitchenForSchoolWithSpec.GetCentralKitchenForSchoolWithSpec()
if err != nil {
_ = session.Rollback()
return err
}
////1、查询`central_kitchen_for_school_with_spec`
//centralKitchenForSchoolWithSpec := db.CentralKitchenForSchoolWithSpec{}
//centralKitchenForSchoolWithSpec.Set(req.EnterpriseId)
//spec, err := centralKitchenForSchoolWithSpec.GetCentralKitchenForSchoolWithSpec()
//if err != nil {
// _ = session.Rollback()
// return err
//}
//2、修改`central_kitchen_for_school_package`
centralKitchenForSchoolPackageDb := db.CentralKitchenForSchoolPackageDb{}
centralKitchenForSchoolPackageDb.Set()
@@ -138,13 +138,13 @@ func UpdateCentralKitchenForSchoolPackage(req md.SaveCentralKitchenForSchoolPack
var centralKitchenForSchoolPackageWithDays []*model.CentralKitchenForSchoolPackageWithDay
for _, v := range req.DateList {
var isOpenBreakfast, isOpenLunch, isOpenDinner, isOpenReplenish = md.CloseBreakfast, md.CloseLunch, md.CloseDinner, md.CloseReplenish
if spec.IsOpenBreakfast == md.OpenBreakfast && v.IsOpenBreakfast == md.OpenBreakfast {
if v.IsOpenBreakfast == md.OpenBreakfast {
isOpenBreakfast = md.OpenBreakfast
}
if spec.IsOpenLunch == md.OpenLunch && v.IsOpenLunch == md.OpenLunch {
if v.IsOpenLunch == md.OpenLunch {
isOpenLunch = md.OpenLunch
}
if spec.IsOpenDinner == md.OpenDinner && v.IsOpenDinner == md.OpenDinner {
if v.IsOpenDinner == md.OpenDinner {
isOpenDinner = md.OpenDinner
}
if v.IsOpenReplenish == md.OpenReplenish {


+ 3
- 3
app/admin/svc/svc_central_kitchen_for_school_package_for_system.go View File

@@ -140,13 +140,13 @@ func SyncCentralKitchenForSchoolPackageForSystem(req md.SyncCentralKitchenForSch
var centralKitchenForSchoolPackageWithDays []*model.CentralKitchenForSchoolPackageWithDay
for _, v := range withDate {
var isOpenBreakfast, isOpenLunch, isOpenDinner, isOpenReplenish = md.CloseBreakfast, md.CloseLunch, md.CloseDinner, md.CloseReplenish
if spec.IsOpenBreakfast == md.OpenBreakfast && v.IsOpenBreakfast == md.OpenBreakfast {
if v.IsOpenBreakfast == md.OpenBreakfast {
isOpenBreakfast = md.OpenBreakfast
}
if spec.IsOpenLunch == md.OpenLunch && v.IsOpenLunch == md.OpenLunch {
if v.IsOpenLunch == md.OpenLunch {
isOpenLunch = md.OpenLunch
}
if spec.IsOpenDinner == md.OpenDinner && v.IsOpenDinner == md.OpenDinner {
if v.IsOpenDinner == md.OpenDinner {
isOpenDinner = md.OpenDinner
}
if v.IsOpenReplenish == md.OpenReplenish {


+ 2
- 2
app/svc/svc_wx_pay.go View File

@@ -12,10 +12,10 @@ import (
func NewWxPayClient(ctx *gin.Context) (client *core.Client, err error) {
sysCfgDb := db.SysCfgDb{}
sysCfgDb.Set()
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.WxSpAppId, enum.WxSpMchApiV3Key, enum.WxSpMchCertificateSerialNumber)
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.WxSpMchId, enum.WxSpMchApiV3Key, enum.WxSpMchCertificateSerialNumber)

var (
mchID string = sysCfg[enum.WxSpAppId] // 商户号
mchID string = sysCfg[enum.WxSpMchId] // 商户号
mchCertificateSerialNumber string = sysCfg[enum.WxSpMchCertificateSerialNumber] // 商户证书序列号
mchAPIv3Key string = sysCfg[enum.WxSpMchApiV3Key] // 商户APIv3密钥
)


Loading…
Cancel
Save