Browse Source

撒料计划 自动生成

bsj 3 years ago
parent
commit
326ec191e6
2 changed files with 492 additions and 22 deletions
  1. 468 0
      routers/api/spillage.go
  2. 24 22
      routers/router.go

+ 468 - 0
routers/api/spillage.go

@@ -0,0 +1,468 @@
+package api
+
+import (
+	"io/ioutil"
+	"log"
+	"net/http"
+	"time"
+
+	"../../pkg/app"
+	"../../pkg/e"
+	"../../pkg/logging"
+	"../../pkg/setting"
+	"../../routers/restful"
+
+	"github.com/Anderson-Lu/gofasion/gofasion"
+	"github.com/gin-gonic/gin"
+	"github.com/xormplus/xorm"
+)
+
+type feedtemplet struct {
+	Id     int64  `xorm:"id"`
+	Ccname string `xorm:"ccname"`
+	Cname  string `xorm:"tname"`
+}
+
+type tmrStruct struct {
+	Id          int64   `xorm:"id"`
+	Tname       string  `xorm:"tname"`
+	Maxstirfeed float64 `xorm:"maxstirfeed"`
+}
+
+type lpplanStruct struct {
+	Id          int64   `xorm:"id"`
+	Tmrname     string  `xorm:"tmrname"`
+	Tmrid       int64   `xorm:"tmrid"`
+	Sort        int64   `xorm:"sort"`
+	Sel         int64   `xorm:"sel"`
+	Times       int64   `xorm:"times"`
+	Ftname      string  `xorm:"ftname"`
+	Ftid        int64   `xorm:"ftid"`
+	Maxweight   float64 `xorm:"maxweight"`
+	Sumweight   float64 `xorm:"sumweight"`
+	Sumcowcount int64   `xorm:"sumcowcount"`
+	Pastureid   string  `xorm:"pastureid"`
+}
+
+type sysopt struct {
+	Inforvalue int `xorm:"inforvalue"`
+}
+
+type lpplanQueryInfo struct {
+	Pastureid   int64   `xorm:"pastureid"`
+	Lppid       int64   `xorm:"id"`
+	Maxweight   float64 `xorm:"maxweight"`
+	Lweight     float64 `xorm:"lweight"`
+	Lweighthis  float64 `xorm:"lweighthis"`
+	Barid       int64   `xorm:"barid"`
+	Barname     string  `xorm:"barname"`
+	Sort        int64   `xorm:"sort"`
+	Tmrid       int64   `xorm:"tmrid"`
+	Tmrname     string  `xorm:"tmrname"`
+	Cowcount    int64   `xorm:"cowcount"`
+	Ccountradio float64 `xorm:"ccountradio"`
+	Background  string  `xorm:"background"`
+	Times       int64   `xorm:"times"`
+	Ftid        int64   `xorm:"ftid"`
+}
+
+type fpdetailQueryInfo struct {
+	Fpdid       int64   `xorm:"fpdid"`
+	Ptsuse      float64 `xorm:"ptsuse"`
+	Ptuse       float64 `xorm:"ptuse"`
+	Weight      float64 `xorm:"weight"`
+	Barid       int64   `xorm:"barid"`
+	Barname     string  `xorm:"barname"`
+	Cowcount    int64   `xorm:"cowcount"`
+	Ccountradio float64 `xorm:"ccountradio"`
+}
+
+type lpplandtl1 struct {
+	Pastureid   int64   `xorm:"pastureid"`
+	Lppid       int64   `xorm:"lppid"`
+	Barid       int64   `xorm:"barid"`
+	Barname     string  `xorm:"barname"`
+	Fpdid       int64   `xorm:"fpdid"`
+	Fttype      int64   `xorm:"fttype"`
+	Lweight     float64 `xorm:"lweight"`
+	Sort        int64   `xorm:"sort"`
+	Tmrid       int64   `xorm:"tmrid"`
+	Tmrname     string  `xorm:"tmrname"`
+	Cowcount    int64   `xorm:"cowcount"`
+	Ccountradio float64 `xorm:"ccountradio"`
+	Background  string  `xorm:"background"`
+	Lweighthis  float64 `xorm:"lweighthis"`
+}
+
+//撒料计划 自动生成
+func Autogeneration(c *gin.Context) {
+	appG := app.Gin{C: c}
+	dataByte, _ := ioutil.ReadAll(c.Request.Body)
+	fsion := gofasion.NewFasion(string(dataByte))
+	pastureid := fsion.Get("pastureid").ValueStr()
+	typeIN := fsion.Get("type").ValueInt64()
+
+	tx := restful.Engine.NewSession()
+	feedtempletlist, err := getfeedtemplet(pastureid, tx)
+	if err != nil {
+		appG.Response(http.StatusOK, e.ERROR, false)
+		return
+	}
+
+	tmrlist, err := gettmr(pastureid, tx)
+	if err != nil {
+		appG.Response(http.StatusOK, e.ERROR, false)
+		return
+	}
+
+	times, err := gettimes(pastureid, tx)
+	if err != nil {
+		appG.Response(http.StatusOK, e.ERROR, false)
+		return
+	}
+
+	lpplanlist, err := getLpplanlist(pastureid, tx)
+	if err != nil {
+		appG.Response(http.StatusOK, e.ERROR, false)
+		return
+	}
+	// var wg sync.WaitGroup
+	// wg.Add(len(feedtempletlist))
+	for _, tem := range feedtempletlist {
+
+		// go func(tem *feedtemplet) {
+		// defer wg.Done()
+		count, err := getLpplanCount(tx)
+		if err != nil {
+			appG.Response(http.StatusOK, e.ERROR, false)
+			return
+		}
+		for _, tmr := range tmrlist {
+			for i := 1; i <= times; i++ {
+				exist := false
+				for _, lpp := range lpplanlist {
+
+					// session.Where("pastureid = ? ", pastureid)
+					// session.Where("times = ? ", times)
+					// session.Where("tmrid = ? ", tmrid)
+					// session.Where("ftid = ? ", ftid)
+					if lpp.Tmrid == tmr.Id && lpp.Times == int64(i) && lpp.Ftid == tem.Id {
+						exist = true
+						break
+					}
+				}
+				// exist, err := getLpplanExist(tmr.Id, tem.Id, i, pastureid, tx)
+				// if err != nil {
+				// 	appG.Response(http.StatusOK, e.ERROR, false)
+				// 	return
+				// }
+				if !exist {
+					ids, err := setting.SnowIds.NextId()
+					if err != nil {
+						ids = time.Now().UnixNano()
+						logging.Info("create SnowIds err", err)
+					}
+					count++
+					lpplan := &lpplanStruct{
+						Id:          ids,
+						Tmrname:     tmr.Tname,
+						Tmrid:       tmr.Id,
+						Sort:        count,
+						Sel:         1,
+						Times:       int64(i),
+						Ftname:      tem.Cname,
+						Ftid:        tem.Id,
+						Maxweight:   tmr.Maxstirfeed,
+						Sumweight:   0,
+						Sumcowcount: 0,
+						Pastureid:   pastureid,
+					}
+					err = addLpplan(lpplan, tx)
+					if err != nil {
+						appG.Response(http.StatusOK, e.ERROR, false)
+						return
+					}
+				}
+			}
+		}
+		// }(tem)
+	}
+
+	go func(typeIN int64, pastureid string, tx *xorm.Session) {
+		err = autogeneration(typeIN, pastureid, tx)
+		if err != nil {
+			appG.Response(http.StatusOK, e.ERROR, false)
+			return
+		}
+	}(typeIN, pastureid, tx)
+	appG.Response(http.StatusOK, e.SUCCESS, true)
+}
+
+//查看配方模板
+func getfeedtemplet(pastureid string, tx *xorm.Session) ([]*feedtemplet, error) {
+	data := make([]*feedtemplet, 0)
+	err := tx.Table("feedtemplet").Select("id,ccname,tname").Where("pastureid = ? ", pastureid).Find(&data)
+	if err != nil {
+		log.Println("getfeedtemplet-error", err)
+		return nil, err
+	}
+
+	return data, nil
+}
+
+//查看tmr设备
+func gettmr(pastureid string, tx *xorm.Session) ([]*tmrStruct, error) {
+	data := make([]*tmrStruct, 0)
+	session := tx.Table("tmr")
+
+	session.Select("TRIM(id) id,tname,maxstirfeed")
+	session.Where("pastureid = ? ", pastureid)
+	session.Where("enable = 1")
+	session.In("tclassid", "1,2,3")
+
+	err := session.Find(&data)
+	if err != nil {
+		log.Println("gettmr-error", err)
+		return nil, err
+	}
+
+	return data, nil
+}
+
+//判断计划种是否有该车次
+func getLpplanExist(tmrid, ftid int64, times int, pastureid string, tx *xorm.Session) (bool, error) {
+	session := tx.Table("lpplan")
+
+	session.Where("pastureid = ? ", pastureid)
+	session.Where("times = ? ", times)
+	session.Where("tmrid = ? ", tmrid)
+	session.Where("ftid = ? ", ftid)
+
+	exist, err := session.Exist()
+	if err != nil {
+		log.Println("getLpplanExist-error", err)
+		return false, err
+	}
+	return exist, nil
+}
+
+type lpplanList struct {
+	Tmrid int64 `xorm:"tmrid"`
+	Times int64 `xorm:"times"`
+	Ftid  int64 `xorm:"ftid"`
+}
+
+func getLpplanlist(patsureid string, tx *xorm.Session) ([]*lpplanList, error) {
+	session := tx.Table("lpplan")
+	session.Select("times,tmrid,ftid")
+	session.Where("pastureid = ? ", patsureid)
+	data := make([]*lpplanList, 0)
+	err := session.Find(&data)
+	if err != nil {
+		log.Println("getLpplanlist-error", err)
+		return nil, err
+	}
+	return data, nil
+}
+
+// 添加车次计划
+func addLpplan(lpplan *lpplanStruct, tx *xorm.Session) error {
+	_, err := tx.Table("lpplan").Insert(lpplan)
+	if err != nil {
+		log.Println("addLpplan-error", err)
+		return err
+	}
+	return nil
+}
+
+//获取车次数量
+func getLpplanCount(tx *xorm.Session) (int64, error) {
+	count, err := tx.Table("lpplan").Count()
+	if err != nil {
+		log.Println("getLpplanCount-error", err)
+		return 0, err
+	}
+	return count, err
+}
+
+//获取班次信息
+func gettimes(pastureid string, tx *xorm.Session) (int, error) {
+	session := tx.Table("sysopt")
+
+	session.Where("pastureid = ? ", pastureid)
+	session.Where("inforname = 'times' ")
+
+	data := new(sysopt)
+	_, err := session.Get(data)
+	if err != nil {
+		log.Println("gettimes-error", err)
+		return 0, err
+	}
+	return data.Inforvalue, nil
+}
+
+func autogeneration(typeIN int64, pastureid string, tx *xorm.Session) error {
+
+	tx.Begin()
+	if typeIN == 1 {
+		_, err := tx.SQL(`DELETE FROM lpplandtl1 WHERE pastureid = ?`, pastureid).Execute()
+		if err != nil {
+			log.Println("autogeneration-error-1", err)
+			tx.Rollback()
+			return err
+		}
+		_, err = tx.SQL(`update  fpdetail
+		 set ptuse = 0,ptsuse=0
+		WHERE pastureid = ?`, pastureid).Execute()
+		if err != nil {
+			log.Println("autogeneration-error-2", err)
+			tx.Rollback()
+			return err
+		}
+	}
+
+	lpplansession := tx.SQL(`select  
+	t1.sort,t1.tmrid,t1.tmrname,
+	 t1.pastureid,t1.id ,t1.maxweight,ifnull(t2.lweight,0) as lweight from lpplan t1 
+	left join ( select ifnull(sum(lweight),0) as lweight,lppid  from lpplandtl1  where pastureid =?   GROUP BY lppid) t2 on t1.id = t2.lppid
+	where t1.pastureid = ?  and t1.maxweight >  ifnull(t2.lweight,0)  `, pastureid, pastureid)
+
+	lpplanlist := make([]*lpplanQueryInfo, 0)
+
+	err := lpplansession.Find(&lpplanlist)
+	if err != nil {
+		log.Println("autogeneration-error-3", err)
+		tx.Rollback()
+		return err
+	}
+
+	for _, lpplan := range lpplanlist {
+		fpdetailsession := tx.Table("fpdetail").Alias("fpd")
+		fpdetailsession.Select("fpd.barid,fpd.barname,fpd.id as fpdid ,fpd.weight as weight,ifnull(fpd.ptuse,0) as ptuse,ifnull(fpd.ptsuse,0) as ptsuse,fpd.barid,fpd.barname,fpd.cowcount,fpd.ccountradio")
+		fpdetailsession.Join("inner", []string{"lpplan", "lpp"},
+			"lpp.pastureid = fpd.pastureid ").And("lpp.ftid = fpd.ptid").And(
+			"lpp.times = fpd.times").And("lpp.id = ?", lpplan.Lppid)
+		fpdetailsession.Where("fpd.pastureid = ? ", pastureid)
+		fpdetailsession.GroupBy("fpd.id")
+
+		fpdetaillist := make([]*fpdetailQueryInfo, 0)
+		err = fpdetailsession.Find(&fpdetaillist)
+		if err != nil {
+			log.Println("autogeneration-error-4", err)
+			tx.Rollback()
+			return err
+		}
+
+		for _, fpdetail := range fpdetaillist {
+			// 	//剩余料
+			weight := fpdetail.Weight*(1-fpdetail.Ptsuse) - fpdetail.Ptuse
+			if lpplan.Maxweight <= lpplan.Lweight || weight == 0 {
+				continue
+			}
+
+			var insertlweight float64
+			if lpplan.Maxweight-lpplan.Lweight > weight {
+				insertlweight = weight
+			} else {
+				insertlweight = lpplan.Maxweight - lpplan.Lweight
+			}
+			lpplan.Lweight += insertlweight
+			lpplan.Lweighthis = insertlweight
+			fpdetail.Ptuse += insertlweight
+
+			// updatefpd := tx.Table("fpdetail").Alias("fpd")
+			// updatefpd.Join("INNER", []string{"lpplan", "lpp"}, "lpp.pastureid = fpd.pastureid")
+			// updatefpd.Where("lpp.ftid = fpd.ptid").And("lpp.times = fpd.times")
+			// _, err = updatefpd.Update(fpdetail)
+			_, err = tx.SQL(` update fpdetail fpd  join lpplan lpp  on lpp.pastureid = fpd.pastureid  and  lpp.ftid = fpd.ptid and lpp.times = fpd.times
+			 set   fpd.ptuse = ?  where fpd.id = ? `, fpdetail.Ptuse, fpdetail.Fpdid).Execute()
+			if err != nil {
+				log.Println("autogeneration-error-5", err)
+				tx.Rollback()
+				return err
+			}
+
+			lpplandtlExecute, err := tx.SQL(`select id from lpplandtl1 where pastureid= ?
+				and  lppid = ?  and fpdid =? and  fttype = ? `, pastureid, lpplan.Lppid, fpdetail.Fpdid, 1).Exist()
+			if err != nil {
+				log.Println("autogeneration-error-6", err)
+				tx.Rollback()
+				return err
+			}
+			if lpplandtlExecute {
+				lpplandtl1query := new(lpplandtl1)
+				query := tx.Table("lpplandtl1")
+				query.Where("pastureid = ?", pastureid)
+				query.Where("lppid = ?", lpplan.Lppid)
+				query.Where("fpdid = ?", fpdetail.Fpdid)
+				query.Where("fttype = 1")
+				_, err = query.Get(lpplandtl1query)
+				if err != nil {
+					log.Println("autogeneration-error-7", err)
+					tx.Rollback()
+					return err
+				}
+
+				upLpplandtl1 := tx.Table("lpplandtl1")
+				data := &lpplandtl1{
+					Pastureid:   lpplan.Pastureid,
+					Lppid:       lpplan.Lppid,
+					Barid:       fpdetail.Barid,
+					Barname:     fpdetail.Barname,
+					Fpdid:       fpdetail.Fpdid,
+					Fttype:      1,
+					Lweight:     lpplandtl1query.Lweight + insertlweight,
+					Sort:        lpplan.Sort,
+					Tmrid:       lpplan.Tmrid,
+					Tmrname:     lpplan.Tmrname,
+					Cowcount:    fpdetail.Cowcount,
+					Ccountradio: fpdetail.Ccountradio,
+					// Background:  lpplan.Background,
+					Lweighthis: insertlweight,
+				}
+				upLpplandtl1.Where("pastureid = ?", pastureid)
+				upLpplandtl1.Where("lppid = ?", lpplan.Lppid)
+				upLpplandtl1.Where("fpdid = ?", fpdetail.Fpdid)
+				upLpplandtl1.Where("fttype = 1")
+				_, err = upLpplandtl1.Update(data)
+				if err != nil {
+					log.Println("autogeneration-error-8", err)
+					tx.Rollback()
+					return err
+				}
+			} else {
+				data := &lpplandtl1{
+					Pastureid:   lpplan.Pastureid,
+					Lppid:       lpplan.Lppid,
+					Barid:       lpplan.Barid,
+					Barname:     lpplan.Barname,
+					Fpdid:       fpdetail.Fpdid,
+					Fttype:      1,
+					Lweight:     insertlweight,
+					Sort:        lpplan.Sort,
+					Tmrid:       lpplan.Tmrid,
+					Tmrname:     lpplan.Tmrname,
+					Cowcount:    lpplan.Cowcount,
+					Ccountradio: lpplan.Ccountradio,
+					Background:  lpplan.Background,
+					Lweighthis:  insertlweight,
+				}
+
+				addLpplandtl1 := tx.Table("lpplandtl1")
+				_, err = addLpplandtl1.Insert(data)
+				if err != nil {
+					log.Println("autogeneration-error-9", err)
+					tx.Rollback()
+					return err
+				}
+			}
+		}
+	}
+
+	err = tx.Commit()
+	if err != nil {
+		log.Println("autogeneration-error-10", err)
+		return err
+	}
+	return nil
+}

+ 24 - 22
routers/router.go

@@ -1,18 +1,21 @@
 package routers
 
 import (
+	"fmt"
+
 	"../comm"
 	_ "../docs"
 	"../middleware/jwt"
-	"fmt"
 	"github.com/gin-gonic/gin"
+
 	//	"../middleware/permission"
+	"net/http"
+	"strings"
+
 	"../pkg/setting"
 	"../routers/api"
-	"github.com/swaggo/gin-swagger"
+	ginSwagger "github.com/swaggo/gin-swagger"
 	"github.com/swaggo/gin-swagger/swaggerFiles"
-	"net/http"
-	"strings"
 )
 
 func InitRouter() *gin.Engine {
@@ -26,23 +29,22 @@ func InitRouter() *gin.Engine {
 	}))
 	r.Use(gin.Logger()) // 日志
 
-	r.Use(Cors())       // 跨域请求rolemenus
+	r.Use(Cors()) // 跨域请求rolemenus
 	r.Use(gin.Recovery())
 	gin.SetMode(setting.ServerSetting.RunMode)
 
-	r.Static("/static",  setting.CurrentPath + "/dist/static") 	// 添加资源路径
-	r.StaticFile("/",  setting.CurrentPath + "/dist/index.html")  //前端接口
-	r.StaticFile("/favicon.ico",  setting.CurrentPath + "/dist/favicon.ico")  //前端接口
-
-	r.Static("/file", setting.CurrentPath + "/uploads/file")
-	r.Static("/uploads", setting.CurrentPath + "/uploads")
-	r.POST("/auth", api.Auth)// 获取登录token
-	r.POST("/authlogin", api.AuthLogin)// 获取登录token
+	r.Static("/static", setting.CurrentPath+"/dist/static")               // 添加资源路径
+	r.StaticFile("/", setting.CurrentPath+"/dist/index.html")             //前端接口
+	r.StaticFile("/favicon.ico", setting.CurrentPath+"/dist/favicon.ico") //前端接口
 
+	r.Static("/file", setting.CurrentPath+"/uploads/file")
+	r.Static("/uploads", setting.CurrentPath+"/uploads")
+	r.POST("/auth", api.Auth)           // 获取登录token
+	r.POST("/authlogin", api.AuthLogin) // 获取登录token
 
 	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) // API 注释
 
-	if setting.CommSetting.PortName!="" {
+	if setting.CommSetting.PortName != "" {
 		r.GET("/comm/:id/:x/:y/", comm.ProcessHttp)
 		r.GET("/cps/:id/:limit", comm.ProcessHttpCPS)
 		r.POST("/comm/:id/:x/:y/", comm.ProcessHttp)
@@ -52,7 +54,7 @@ func InitRouter() *gin.Engine {
 	eqm.POST("/login", api.Auth)
 
 	apiV1 := r.Group("/authdata")
-	apiV1.Use(jwt.JWT())                     // token 验证
+	apiV1.Use(jwt.JWT()) // token 验证
 	{
 		apiV1.POST("/rolemenus", api.GetRecuDataByName)
 		apiV1.GET("/userinfo", api.GetUserinfo)
@@ -65,7 +67,7 @@ func InitRouter() *gin.Engine {
 		apiV1.POST("/GetDataByNames", api.GetDataByNames)
 		apiV1.POST("/PostDataByName", api.PostDataByName)
 		apiV1.POST("/PostDataByNames", api.PostDataByNames)
-		apiV1.POST("/UpdateDataRelation", api.UpdateDataRelation)  //log.error
+		apiV1.POST("/UpdateDataRelation", api.UpdateDataRelation) //log.error
 		apiV1.POST("/GetDataByNameForm", api.GetDataByNameForm)
 		apiV1.POST("/PostDataByNameForm", api.PostDataByNameForm)
 		apiV1.POST("/GetUpkeepPlan", api.GetUpkeepPlan)
@@ -74,12 +76,10 @@ func InitRouter() *gin.Engine {
 		apiV1.POST("/GETNurJudge", api.GETNurJudge)
 		apiV1.POST("/GETNurJudgeRport", api.GETNurJudgeRport)
 
-
 		apiV1.POST("/ExecDataByConfig", api.ExecDataByConfig)
 
 		apiV1.POST("/ImportExcel", api.ImportExcel)
 
-
 		apiV1.POST("/upload/:id/:name", api.UploadFile)
 		apiV1.POST("/uploads", api.UploadFiles)
 		apiV1.POST("/uploaderimage", api.UploaderImage)
@@ -108,6 +108,8 @@ func InitRouter() *gin.Engine {
 		apiV1.POST("/PostRJSBData", api.PostRJSBData)
 		apiV1.POST("/PostRJSBDatas", api.PostRJSBDatas)
 
+		apiV1.POST("/autogeneration", api.Autogeneration)
+
 	}
 
 	//不需要登录验证的接口
@@ -143,15 +145,15 @@ func Cors() gin.HandlerFunc {
 		}
 		if origin != "" {
 			c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
-			c.Header("Access-Control-Allow-Origin", "*")                                       // 这是允许访问所有域
+			c.Header("Access-Control-Allow-Origin", "*")                                        // 这是允许访问所有域
 			c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, UPDATE") //服务器支持的所有跨域请求的方法,为了避免浏览次请求的多次'预检'请求
 			//  header的类型
 			c.Header("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, id,  Token, name, optname, thumbnail, session, X_Requested_With, Accept, Origin, Host, Connection, Accept-Encoding, Accept-Language,DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Pragma")
 			//              允许跨域设置                                                                                                      可以返回其他子段
 			c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, Pragma, FooBar") // 跨域关键设置 让浏览器可以解析
-			c.Header("Access-Control-Max-Age", "172800")                                                                                                                                                           // 缓存请求信息 单位为秒
-			c.Header("Access-Control-Allow-Credentials", "false")                                                                                                                                                  //  跨域请求是否需要带cookie信息 默认设置为true
-			c.Set("content-type", "application/json")                                                                                                                                                              // 设置返回格式是json
+			c.Header("Access-Control-Max-Age", "172800")                                                                                                                                                                  // 缓存请求信息 单位为秒
+			c.Header("Access-Control-Allow-Credentials", "false")                                                                                                                                                         //  跨域请求是否需要带cookie信息 默认设置为true
+			c.Set("content-type", "application/json")                                                                                                                                                                     // 设置返回格式是json
 		}
 
 		//放行所有OPTIONS方法