baishaojie 2 سال پیش
کامیت
16691988d9
100فایلهای تغییر یافته به همراه10543 افزوده شده و 0 حذف شده
  1. 1 0
      .gitattributes
  2. 20 0
      .gitignore
  3. 74 0
      Makefile
  4. 9 0
      README.MD
  5. BIN
      __debug_bin.exe
  6. 12 0
      api/v1/auth.go
  7. 40 0
      api/v1/factory.go
  8. 42 0
      api/v1/management.go
  9. 47 0
      api/v1/neckringlisting.go
  10. 36 0
      api/v1/public.go
  11. 36 0
      api/v1/recall.go
  12. 88 0
      api/v1/receiver.go
  13. 80 0
      api/v1/sim.go
  14. 8 0
      conf/config.yaml
  15. BIN
      demo.exe
  16. BIN
      dist.zip
  17. BIN
      dist/favicon.ico
  18. 0 0
      dist/index.html
  19. 0 0
      dist/static/css/app.954b587f.css
  20. 0 0
      dist/static/css/chunk-elementUI.f92cd1c5.css
  21. 0 0
      dist/static/css/chunk-libs.1664ae71.css
  22. BIN
      dist/static/fonts/element-icons.535877f5.woff
  23. BIN
      dist/static/fonts/element-icons.732389de.ttf
  24. BIN
      dist/static/img/404.a57b6f31.png
  25. BIN
      dist/static/img/404_cloud.0f4bc32b.png
  26. 28 0
      dist/static/img/iconfont.0ddaba12.svg
  27. BIN
      dist/static/img/login-bg.dfe7c90f.jpg
  28. BIN
      dist/static/img/logo.afed751a.png
  29. BIN
      dist/static/img/logo1.0121925c.png
  30. BIN
      dist/static/img/logo_u3.3c77f543.png
  31. BIN
      dist/static/img/nlogin-bg1.77301f56.jpg
  32. BIN
      dist/static/img/row-bg3.b3be7548.png
  33. BIN
      dist/static/img/topBg.69ecd1e1.png
  34. 0 0
      dist/static/js/app.782925a4.js
  35. 0 0
      dist/static/js/chunk-2d0cc0b6.cff3716e.js
  36. 0 0
      dist/static/js/chunk-34900b22.1d5a2cd1.js
  37. 0 0
      dist/static/js/chunk-elementUI.738326d9.js
  38. 0 0
      dist/static/js/chunk-libs.41f61acc.js
  39. 1825 0
      docs/docs.go
  40. 1797 0
      docs/swagger.json
  41. 1237 0
      docs/swagger.yaml
  42. BIN
      file/脖环召回.xlsx
  43. BIN
      file/脖环管理.xlsx
  44. 35 0
      go.mod
  45. 511 0
      go.sum
  46. 4 0
      hack/config.yaml
  47. BIN
      image/123.jpg
  48. BIN
      image/default.jpg
  49. 96 0
      internal/app/code.go
  50. 34 0
      internal/app/msg.go
  51. 18 0
      internal/app/packed.go
  52. 127 0
      internal/cmd/cmd.go
  53. 1 0
      internal/consts/consts.go
  54. 65 0
      internal/controller/auth.go
  55. 9 0
      internal/controller/controller.go
  56. 554 0
      internal/controller/db.go
  57. 104 0
      internal/controller/factory.go
  58. 194 0
      internal/controller/management.go
  59. 149 0
      internal/controller/neckringlisting.go
  60. 297 0
      internal/controller/public.go
  61. 184 0
      internal/controller/recall.go
  62. 321 0
      internal/controller/receiver.go
  63. 328 0
      internal/controller/sim.go
  64. 411 0
      internal/dao/auth.go
  65. 49 0
      internal/dao/dao.go
  66. 250 0
      internal/dao/factory.go
  67. 94 0
      internal/dao/management.go
  68. 117 0
      internal/dao/neckringlisting.go
  69. 99 0
      internal/dao/public.go
  70. 137 0
      internal/dao/recall.go
  71. 139 0
      internal/dao/receiver.go
  72. 93 0
      internal/dao/sim.go
  73. 19 0
      internal/dao/sync.go
  74. 0 0
      internal/logic/.gitkeep
  75. 51 0
      internal/middleware/jwt/jwt.go
  76. 12 0
      internal/model/bar.go
  77. 13 0
      internal/model/deliveryandrecall.go
  78. 24 0
      internal/model/factory.go
  79. 13 0
      internal/model/housephy.go
  80. 24 0
      internal/model/jbqtj.go
  81. 22 0
      internal/model/management.go
  82. 13 0
      internal/model/management_bh.go
  83. 28 0
      internal/model/neckringlisting.go
  84. 11 0
      internal/model/pasture.go
  85. 18 0
      internal/model/recall.go
  86. 29 0
      internal/model/receiver.go
  87. 31 0
      internal/model/sim.go
  88. BIN
      internal/servefile/无标题.xlsx
  89. 0 0
      internal/service/.gitkeep
  90. 148 0
      internal/setting/setting.go
  91. 120 0
      internal/setting/snowflake.go
  92. 63 0
      internal/util/jwt.go
  93. 13 0
      internal/util/md5.go
  94. 6 0
      linux.bat
  95. 19 0
      main.go
  96. 11 0
      manifest/config/config.yaml
  97. 21 0
      manifest/deploy/kustomize/base/deployment.yaml
  98. 8 0
      manifest/deploy/kustomize/base/kustomization.yaml
  99. 12 0
      manifest/deploy/kustomize/base/service.yaml
  100. 14 0
      manifest/deploy/kustomize/overlays/develop/configmap.yaml

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+* linguist-language=GO

+ 20 - 0
.gitignore

@@ -0,0 +1,20 @@
+.buildpath
+.hgignore.swp
+.project
+.orig
+.swp
+.idea/
+.settings/
+.vscode/
+vendor/
+composer.lock
+gitpush.sh
+pkg/
+bin/
+cbuild
+**/.DS_Store
+.test/
+main
+output/
+manifest/output/
+temp/

+ 74 - 0
Makefile

@@ -0,0 +1,74 @@
+ROOT_DIR    = $(shell pwd)
+NAMESPACE   = "default"
+DEPLOY_NAME = "template-single"
+DOCKER_NAME = "template-single"
+
+# Install/Update to the latest CLI tool.
+.PHONY: cli
+cli:
+	@set -e; \
+	wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(shell go env GOOS)_$(shell go env GOARCH) && \
+	chmod +x gf && \
+	./gf install -y && \
+	rm ./gf
+
+
+# Check and install CLI tool.
+.PHONY: cli.install
+cli.install:
+	@set -e; \
+	gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \
+  		echo "GoFame CLI is not installed, start proceeding auto installation..."; \
+		make cli; \
+	fi;
+
+
+# Generate Go files for DAO/DO/Entity.
+.PHONY: dao
+dao: cli.install
+	@gf gen dao
+
+# Generate Go files for Service.
+.PHONY: service
+service: cli.install
+	@gf gen service
+
+# Build image, deploy image and yaml to current kubectl environment and make port forward to local machine.
+.PHONY: start
+start:
+	@set -e; \
+	make image; \
+	make deploy; \
+	make port;
+
+# Build docker image.
+.PHONY: image
+image: cli.install
+	$(eval _TAG  = $(shell git log -1 --format="%cd.%h" --date=format:"%Y%m%d%H%M%S"))
+ifneq (, $(shell git status --porcelain 2>/dev/null))
+	$(eval _TAG  = $(_TAG).dirty)
+endif
+	$(eval _TAG  = $(if ${TAG},  ${TAG}, $(_TAG)))
+	$(eval _PUSH = $(if ${PUSH}, ${PUSH}, ))
+	@gf docker -p -b "-a amd64 -s linux -p temp" -t $(DOCKER_NAME):${_TAG};
+
+
+# Build docker image and automatically push to docker repo.
+.PHONY: image.push
+image.push:
+	@make image PUSH=-p;
+
+
+# Deploy image and yaml to current kubectl environment.
+.PHONY: deploy
+deploy:
+	$(eval _TAG = $(if ${TAG},  ${TAG}, develop))
+
+	@set -e; \
+	mkdir -p $(ROOT_DIR)/temp/kustomize;\
+	cd $(ROOT_DIR)/manifest/deploy/kustomize/overlays/${_TAG};\
+	kustomize build > $(ROOT_DIR)/temp/kustomize.yaml;\
+	kubectl   apply -f $(ROOT_DIR)/temp/kustomize.yaml; \
+	kubectl   patch -n $(NAMESPACE) deployment/$(DEPLOY_NAME) -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(shell date +%s)\"}}}}}";
+
+

+ 9 - 0
README.MD

@@ -0,0 +1,9 @@
+# GoFrame Template For SingleRepo
+
+Project Makefile Commands: 
+- `make cli`: Install or Update to the latest GoFrame CLI tool.
+- `make dao`: Generate go files for `Entity/DAO/DO` according to the configuration file from `hack` folder.
+- `make service`: Parse `logic` folder to generate interface go files into `service` folder.
+- `make image TAG=xxx`: Run `docker build` to build image according `manifest/docker`.
+- `make image.push TAG=xxx`: Run `docker build` and `docker push` to build and push image according `manifest/docker`.
+- `make deploy TAG=xxx`: Run `kustomize build` to build and deploy deployment to kubernetes server group according `manifest/deploy`.

BIN
__debug_bin.exe


+ 12 - 0
api/v1/auth.go

@@ -0,0 +1,12 @@
+package v1
+
+type Auth struct {
+	Id         int    `json:"id"`
+	Username   string `json:"username"`
+	Password   string `json:"password"`
+	CaptchaKey string `json:"CaptchaKey"`
+	Role       int    `json:"role_id"`
+	Imei       string `json:"imei"`
+	PastureId  string `json:"pastureid"`
+	TypeIn     int    `json:"typein"`
+}

+ 40 - 0
api/v1/factory.go

@@ -0,0 +1,40 @@
+package v1
+
+type AddFactoryReq struct {
+	Count     int64   `json:"count"`
+	Genre     int64   `json:"genre"`  //0 购买,1 置换
+	Recall    int64   `json:"recall"` //关联召回批次数
+	Pastureid string  `json:"pastureid"`
+	RecallID  []int64 `json:"recallid"` //召回id
+}
+
+type GetFactoryReq struct {
+	Index      int64  `json:"index"`
+	PageSize   int64  `json:"pagesize"`
+	Batch      string `json:"batch"`      //批次
+	Genre      int64  `json:"genre"`      //0 购买,1 置换
+	StartCount int64  `json:"startcount"` //重量
+	EndCount   int64  `json:"endcount"`
+	CreateName string `json:"createname"` //登记人
+	StartDate  string `json:"startdate"`  //登记时间
+	EndDate    string `json:"enddate"`
+	RecallID   int64  `json:"recallid"` //召回id
+	Pastureid  string `json:"pastureid"`
+}
+
+type Factory struct {
+	Id          int64  `json:"id"`
+	PastureId   string `json:"pastureid"`   //牧场id
+	PastureName string `json:"pasturename"` //牧场名称
+	Count       int64  `json:"count"`       //出厂数量
+	Batch       string `json:"batch"`       //出厂批次
+	Genre       int64  `json:"genre"`       //0 购买,1 置换
+	Recall      int64  `json:"recall"`      //关联召回批次数
+	CreateName  string `json:"createname"`  //登记人
+	CreateTime  string `json:"createtime"`  //登记时间
+}
+
+type GetFactoryRes struct {
+	List  []*Factory `json:"list"`
+	Total int64      `json:"total"`
+}

+ 42 - 0
api/v1/management.go

@@ -0,0 +1,42 @@
+package v1
+
+type GetManagementReq struct {
+	Index     int64  `json:"index"`
+	PageSize  int64  `json:"pagesize"`
+	PastureId string `json:"pastureid"` //牧场id
+	Genre     int64  `json:"genre"`     //0 售卖,1 返厂 2 置换  -1 全部
+	StartDate string `json:"startdate"` //导入开始时间
+	EndDate   string `json:"enddate"`   //导入结束时间
+}
+
+type Management struct {
+	Id          int64  `json:"id"`
+	Pastureid   string `json:"pastureid"`   //牧场id
+	Count       int64  `json:"count"`       //出厂数量
+	Genre       int64  `json:"genre"`       //0 售卖,1 返厂 2 置换
+	Recall      int64  `json:"recall"`      //关联召回批次数
+	ImportTime  string `json:"importdate"`  //导入时间
+	PastureName string `json:"pasturename"` //牧场id
+}
+
+type GetManagementRes struct {
+	List  []*Management `json:"list"`
+	Total int64         `json:"total"`
+}
+
+type GetManagementBhReq struct {
+	Index        int64 `json:"index"`
+	PageSize     int64 `json:"pagesize"`
+	ManagementId int64 `json:"managementid"`
+}
+
+type ManagementBh struct {
+	ManagementID int64  `json:"managementid"` //脖环管理ID
+	Code         string `json:"code"`         //脖环编码
+	Date         string `json:"date"`         //日期
+}
+
+type GetManagementBhRes struct {
+	List  []*ManagementBh `json:"list"`
+	Total int64           `json:"total"`
+}

+ 47 - 0
api/v1/neckringlisting.go

@@ -0,0 +1,47 @@
+package v1
+
+import "time"
+
+type GetNeckRingListingReq struct {
+	Index            int64  `json:"index"`
+	PageSize         int64  `json:"pagesize"`
+	Code             int64  `json:"code"`             //脖环编码
+	Status           int64  `json:"status"`           //脖环状态
+	Cattle           string `json:"cattle"`           //牛号
+	BarName          string `json:"barname"`          //栏舍名称
+	PurchaseStart    string `json:"purchasestart"`    //购入开始日期
+	PurchaseEnd      string `json:"purchaseend"`      //购入结束日期
+	ManufactureStart string `json:"manufacturestart"` //生产开始日期
+	ManufactureEnd   string `json:"manufactureend"`   //生产结束日期
+	RecallID         int64  `json:"recallid"`         //召回记录
+	FactoryID        int64  `json:"factoryid"`        //出厂登记
+}
+
+type GetNeckRingListingRes struct {
+	Neckring []*NeckRingListing `json:"list"`
+	Total    int64              `json:"total"`
+}
+
+type NeckRingListing struct {
+	Id              int64  `json:"id"`
+	Name            string `json:"name"`            //脖环名称
+	Code            int64  `json:"code"`            //脖环编码
+	Status          int64  `json:"status"`          //脖环状态
+	Cattle          string `json:"cattle"`          //牛号
+	BarId           int64  `json:"barid"`           //栏舍id
+	Batch           string `json:"batch"`           //批次
+	BarName         string `json:"barname"`         //栏舍名称
+	PurchaseDate    string `json:"purchasedate"`    //购入日期
+	ManufactureDate string `json:"manufacturedate"` //生产日期
+}
+
+type AddNeckRingListingReq struct {
+	Name            string    `json:"name"`            //脖环名称
+	Code            string    `json:"code"`            //脖环编码
+	Status          int64     `json:"status"`          //脖环状态
+	Cattle          int64     `json:"cattle"`          //牛号
+	BarId           int64     `json:"barid"`           //栏舍id
+	BarName         string    `json:"barname"`         //栏舍名称
+	PurchaseDate    time.Time `json:"purchasedate"`    //购入日期
+	ManufactureDate time.Time `json:"manufacturedate"` //生产日期
+}

+ 36 - 0
api/v1/public.go

@@ -0,0 +1,36 @@
+package v1
+
+type GetBarListReq struct {
+	Index     int64  `json:"index"`
+	PageSize  int64  `json:"pagesize"`
+	Pastureid string `json:"pastureid"`
+	BarName   string `json:"barname"`
+}
+
+type BarList struct {
+	Id        string `json:"id"  `
+	Pastureid string `json:"pastureid"`
+	Bname     string `json:"bname"` //栏舍名称
+	Bcode     string `json:"bcode"` //栏舍编码
+}
+
+type GetBarListRes struct {
+	List  []*BarList `json:"list"`
+	Total int64      `json:"total"`
+}
+
+type GetPastureListReq struct {
+	Index    int64 `json:"index"`
+	PageSize int64 `json:"pagesize"`
+}
+
+type PastureList struct {
+	PastureCode string `json:"pasturecode"`
+	Pastureid   string `json:"pastureid"`
+	PastureName string `json:"pasturename"`
+}
+
+type GetPastureListRes struct {
+	List  []*PastureList `json:"list"`
+	Total int64          `json:"total"`
+}

+ 36 - 0
api/v1/recall.go

@@ -0,0 +1,36 @@
+package v1
+
+type AddRecallReq struct {
+	Pastureid string  `json:"pastureid"`
+	Count     int64   `json:"count"`
+	FactoryID []int64 `json:"factoryid"` //召回id
+}
+
+type GetRecallReq struct {
+	Index       int64  `json:"index"`
+	PageSize    int64  `json:"pagesize"`
+	Batch       string `json:"batch"`      //批次
+	StartCount  int64  `json:"startcount"` //重量
+	EndCount    int64  `json:"endcount"`
+	CreateName  string `json:"createname"` //登记人
+	StartDate   string `json:"startdate"`  //登记时间
+	EndDate     string `json:"enddate"`
+	FactoryID   int64  `json:"recallid"` //召回id
+	Pastureid   string `json:"pastureid"`
+	Replacement int64  `json:"replacement"` //置换时查看传 1
+}
+type Recall struct {
+	Id          int64  `json:"id"`
+	PastureId   string `json:"pastureid"`   //牧场id
+	PastureName string `json:"pasturename"` //牧场名称
+	Count       int64  `json:"count"`       //出厂数量
+	Batch       string `json:"batch"`       //出厂批次
+	Recall      int64  `json:"recall"`      //关联召回批次数
+	CreateName  string `json:"createname"`  //登记人
+	CreateTime  string `json:"createtime"`  //登记时间
+}
+
+type GetRecallRes struct {
+	List  []*Recall `json:"list"`
+	Total int64     `json:"total"`
+}

+ 88 - 0
api/v1/receiver.go

@@ -0,0 +1,88 @@
+package v1
+
+type GetReceiverReq struct {
+	Index    int64  `json:"index"`
+	PageSize int64  `json:"pagesize"`
+	Code     string `json:"code"`   //接收器编码
+	Status   int64  `json:"status"` //状态
+}
+
+type Receiver struct {
+	ReceiverId  int64  `json:"receiverid"`
+	Code        string `json:"code"`        //接收器编码
+	Pastureid   string `json:"pastureid"`   //牧场id
+	BarId       string `json:"barid"`       //栏舍id
+	BarName     string `json:"barname"`     //栏舍名称
+	SimId       int64  `json:"simid"`       //栏舍id
+	Status      int64  `json:"status"`      //脖环状态
+	Location    string `json:"location"`    //安装位置 设备位置(1:奶厅1,2:奶厅2)
+	UpdateDate  string `json:"updatedate"`  //最后修改时间
+	Card        string `json:"card"`        //sim编码 卡号
+	PastureName string `json:"pasturename"` //牧场名称
+	PastureCode string `json:"pasturecode"` //牧场编码
+	Id          int64  `json:"id"`
+	Image       string `json:"image"` //图片地址
+	Style       *Style `json:"style"`
+}
+
+type GetReceiverRes struct {
+	List  []*Receiver `json:"list"`
+	Total int64       `json:"total"`
+}
+
+type AddReceiverReq struct {
+	Code      string `json:"code"`      //接收器编码
+	Pastureid string `json:"pastureid"` //牧场id
+	BarId     string `json:"barId"`     //栏舍id
+	//BarName   string `json:"barname"`   //栏舍名称
+	SimId    int64  `json:"simid"`    //sim卡id
+	Status   int64  `json:"status"`   //脖环状态
+	Location string `json:"location"` //安装位置
+	//UpdateDate  time.Time `json:"updateDate"`  //最后修改时间
+	Card        string `json:"card"`        //卡号
+	PastureName string `json:"pasturename"` //牧场名称
+}
+
+type EditReceiverReq struct {
+	Id        int64  `json:"id"`
+	Code      string `json:"code"`      //接收器编码
+	Pastureid string `json:"pastureid"` //牧场id
+	BarId     string `json:"barid"`     //栏舍id
+	//BarName     string `json:"barname"`     //栏舍名称
+	SimId       int64  `json:"simId"`       //sim卡id
+	Status      int64  `json:"status"`      //脖环状态
+	Location    string `json:"location"`    //安装位置
+	Card        string `json:"card"`        //卡号
+	PastureName string `json:"pasturename"` //牧场名称
+}
+
+type ReceiverPull struct {
+	Id   int64  `json:"id"`
+	Code string `json:"code"`
+}
+type GetReceiverPullRes struct {
+	List []*ReceiverPull `json:"list"`
+	//Total int64           `json:"total"`
+}
+
+type Style struct {
+	Left string `json:"left"`
+	Top  string `json:"top"`
+}
+
+type CoordinatesInfo struct {
+	ID        int64  `json:"id"`
+	Pastureid string `json:"pastureid"` //牧场id
+	BarId     string `json:"barid"`     //栏舍id
+	Style     *Style `json:"style"`
+	Status    int64  `json:"enable"` //脖环状态
+	Left      string `json:"left"`
+	Top       string `json:"top"`
+}
+type GetReceiverInfoRes struct {
+	List []*CoordinatesInfo `json:"list"`
+}
+
+type EditReceiverCoordinatesReq struct {
+	List []*CoordinatesInfo `json:"list"`
+}

+ 80 - 0
api/v1/sim.go

@@ -0,0 +1,80 @@
+package v1
+
+type GetSimReq struct {
+	Index    int64  `json:"index"`
+	PageSize int64  `json:"pagesize"`
+	Card     string `json:"card"`    //sim卡号
+	Company  string `json:"company"` //公司
+	Status   int64  `json:"status"`  //状态
+}
+
+type GetSimRes struct {
+	List  []*Sim `json:"list"`
+	Total int64  `json:"total"`
+}
+
+type Sim struct {
+	Id           int64  `json:"id"`
+	Card         string `json:"card"`         //sim卡号
+	TotalFlow    string `json:"totalflow"`    //总流量
+	Used         string `json:"used"`         //已用流量
+	Remaining    string `json:"remaining"`    //剩余流量
+	Company      string `json:"company"`      //公司
+	PurchaseDate string `json:"purchasedate"` //购入日期
+	ActivateDate string `json:"activatedate"` //激活日期
+	TopUpDate    string `json:"topupdate"`    //充值日期
+	EndDate      string `json:"enddate"`      //充值日期
+	Status       int64  `json:"status"`       //状态
+	ReceiverId   int64  `json:"receiverid"`   //接收器id
+	Pastureid    string `json:"pastureid"`    //牧场id
+	BarId        string `json:"barid"`        //栏舍id
+	BarName      string `json:"barname"`      //栏舍名称
+	PastureName  string `json:"pasturename"`  //牧场名称
+	PastureCode  string `json:"pasturecode"`  //牧场编码
+	ReceiverCode string `json:"receivercode"` //接收器编码
+}
+
+type AddSimReq struct {
+	//Id           int64  `json:"id"`
+	Card         string `json:"card"`         //sim卡号
+	TotalFlow    string `json:"totalflow"`    //总流量
+	Used         string `json:"used"`         //已用流量
+	Remaining    string `json:"remaining"`    //剩余流量
+	Company      string `json:"company"`      //公司
+	PurchaseDate string `json:"purchasedate"` //购入日期
+	ActivateDate string `json:"activatedate"` //激活日期
+	TopUpDate    string `json:"topupdate"`    //充值日期
+	EndDate      string `json:"enddate"`      //充值日期
+	Status       int64  `json:"status"`       //状态
+	ReceiverId   int64  `json:"receiverid"`   //接收器id
+	Pastureid    string `json:"pastureid"`    //牧场id
+	//BarId        int64  `json:"barid"`        //栏舍id
+	//BarName      string `json:"barname"`      //栏舍名称
+}
+
+type EditSimReq struct {
+	Id           int64  `json:"id"`
+	Card         string `json:"card"`         //sim卡号
+	TotalFlow    string `json:"totalflow"`    //总流量
+	Used         string `json:"used"`         //已用流量
+	Remaining    string `json:"remaining"`    //剩余流量
+	Company      string `json:"company"`      //公司
+	PurchaseDate string `json:"purchasedate"` //购入日期
+	ActivateDate string `json:"activatedate"` //激活日期
+	TopUpDate    string `json:"topupdate"`    //充值日期
+	EndDate      string `json:"enddate"`      //结束日期
+	Status       int64  `json:"status"`       //状态
+	ReceiverId   int64  `json:"receiverid"`   //接收器id
+	Pastureid    string `json:"pastureid"`    //牧场id
+	//BarId        int64  `json:"barid"`        //栏舍id
+	//BarName      string `json:"barname"`      //栏舍名称
+}
+
+type SimPull struct {
+	Id   int64  `json:"id"`
+	Card string `json:"card"` //sim卡号
+}
+type GetSimPullRes struct {
+	List []*SimPull `json:"list"`
+	//Total int64      `json:"total"`
+}

+ 8 - 0
conf/config.yaml

@@ -0,0 +1,8 @@
+database:
+  UserName:   "root"
+  PassWord:  "kepaiteng!QAZ"
+  Host: "222.73.129.15"
+  Port: "31306"
+  Database: "neckring"
+server:
+  address: 8085

BIN
demo.exe


BIN
dist.zip


BIN
dist/favicon.ico


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/index.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/css/app.954b587f.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/css/chunk-elementUI.f92cd1c5.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/css/chunk-libs.1664ae71.css


BIN
dist/static/fonts/element-icons.535877f5.woff


BIN
dist/static/fonts/element-icons.732389de.ttf


BIN
dist/static/img/404.a57b6f31.png


BIN
dist/static/img/404_cloud.0f4bc32b.png


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 28 - 0
dist/static/img/iconfont.0ddaba12.svg


BIN
dist/static/img/login-bg.dfe7c90f.jpg


BIN
dist/static/img/logo.afed751a.png


BIN
dist/static/img/logo1.0121925c.png


BIN
dist/static/img/logo_u3.3c77f543.png


BIN
dist/static/img/nlogin-bg1.77301f56.jpg


BIN
dist/static/img/row-bg3.b3be7548.png


BIN
dist/static/img/topBg.69ecd1e1.png


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/app.782925a4.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/chunk-2d0cc0b6.cff3716e.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/chunk-34900b22.1d5a2cd1.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/chunk-elementUI.738326d9.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/chunk-libs.41f61acc.js


+ 1825 - 0
docs/docs.go

@@ -0,0 +1,1825 @@
+// Package docs GENERATED BY SWAG; DO NOT EDIT
+// This file was generated by swaggo/swag
+package docs
+
+import "github.com/swaggo/swag"
+
+const docTemplate = `{
+    "schemes": {{ marshal .Schemes }},
+    "swagger": "2.0",
+    "info": {
+        "description": "{{escape .Description}}",
+        "title": "{{.Title}}",
+        "contact": {},
+        "version": "{{.Version}}"
+    },
+    "host": "{{.Host}}",
+    "basePath": "{{.BasePath}}",
+    "paths": {
+        "/factory/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环出厂登记"
+                ],
+                "summary": "脖环出厂登记添加",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddFactoryReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/factory/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环出厂登记"
+                ],
+                "summary": "脖环出厂登记查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 批次",
+                        "name": "batch",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 0 购买,1 置换  -1 全部",
+                        "name": "genre",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "startcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "endcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记人",
+                        "name": "createname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "startdate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "enddate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 查看关联出厂批次",
+                        "name": "recallid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetFactoryRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/housephy/image": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "上传接收器图片",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/image": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "接收器图片查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetBarListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/management/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环管理"
+                ],
+                "summary": "脖环管理导入",
+                "responses": {}
+            }
+        },
+        "/management/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环管理"
+                ],
+                "summary": "脖环管理查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环编码",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 牧场id",
+                        "name": "pastureid",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int64 0 售卖,1 返厂 2 置换  -1 全部",
+                        "name": "genre",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 导入开始时间",
+                        "name": "startdate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 导入结束时间",
+                        "name": "enddate",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetManagementRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/managementbh/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环管理"
+                ],
+                "summary": "脖环管理明细查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "managementid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetManagementBhRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/public/bar": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "栏舍查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 栏舍名称",
+                        "name": "barname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 牧场编码",
+                        "name": "pastureid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetBarListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/public/housephy": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "物理栏舍查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string ",
+                        "name": "pastureid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetBarListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/public/pasture": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "牧场信息查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetPastureListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/recall/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环召回计划"
+                ],
+                "summary": "脖环召回计划添加",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddRecallReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/recall/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环召回计划"
+                ],
+                "summary": "脖环召回查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 批次",
+                        "name": "batch",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "startcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "endcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记人",
+                        "name": "createname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "startdate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "enddate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 查看召回批次",
+                        "name": "factoryid",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 置换时查看传 1",
+                        "name": "replacement",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetRecallRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/receiver/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "添加接收器",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddReceiverReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/receiver/coordinates": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "接收器位置信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "string 栏舍",
+                        "name": "barid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetReceiverRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/receiver/coordinates/edit": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "编辑接收器坐标",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.EditReceiverCoordinatesReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/receiver/edit": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "编辑接收器",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.EditReceiverReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/receiver/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "接收器管理查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 接收器编码",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetReceiverRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/receiver/pull": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "接口器下拉",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetReceiverRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/ring/listing": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环清单"
+                ],
+                "summary": "脖环清单查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环编码",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int 牛号",
+                        "name": "cattle",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 栏舍名称",
+                        "name": "barname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 购入开始日期",
+                        "name": "purchasestart",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 购入结束日期",
+                        "name": "purchaseend",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 生产开始日期",
+                        "name": "manufacturestart",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 生产结束日期",
+                        "name": "manufactureend",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 出厂数量",
+                        "name": "factoryid",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 召回",
+                        "name": "recallid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetNeckRingListingRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/sim/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "SIM卡管理"
+                ],
+                "summary": "SIM卡添加",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddSimReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/sim/edit": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "SIM卡管理"
+                ],
+                "summary": "SIM卡修改",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.EditSimReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/sim/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "SIM卡管理"
+                ],
+                "summary": "SIM卡查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string sim卡号",
+                        "name": "card",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 公司",
+                        "name": "company",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetSimRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/sim/pull": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "SIM卡下拉",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetSimPullRes"
+                        }
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+        "v1.AddFactoryReq": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "type": "integer"
+                },
+                "genre": {
+                    "description": "0 购买,1 置换",
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                },
+                "recallid": {
+                    "description": "召回id",
+                    "type": "array",
+                    "items": {
+                        "type": "integer"
+                    }
+                }
+            }
+        },
+        "v1.AddRecallReq": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "type": "integer"
+                },
+                "factoryid": {
+                    "description": "召回id",
+                    "type": "array",
+                    "items": {
+                        "type": "integer"
+                    }
+                },
+                "pastureid": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.AddReceiverReq": {
+            "type": "object",
+            "properties": {
+                "barId": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "UpdateDate  time.Time ` + "`" + `json:\"updateDate\"` + "`" + `  //最后修改时间",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "location": {
+                    "description": "安装位置",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "simid": {
+                    "description": "BarName   string ` + "`" + `json:\"barname\"` + "`" + `   //栏舍名称",
+                    "type": "integer"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.AddSimReq": {
+            "type": "object",
+            "properties": {
+                "activatedate": {
+                    "description": "激活日期",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "Id           int64  ` + "`" + `json:\"id\"` + "`" + `",
+                    "type": "string"
+                },
+                "company": {
+                    "description": "公司",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "description": "接收器id",
+                    "type": "integer"
+                },
+                "remaining": {
+                    "description": "剩余流量",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "状态",
+                    "type": "integer"
+                },
+                "topupdate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "totalflow": {
+                    "description": "总流量",
+                    "type": "string"
+                },
+                "used": {
+                    "description": "已用流量",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.BarList": {
+            "type": "object",
+            "properties": {
+                "bcode": {
+                    "description": "栏舍编码",
+                    "type": "string"
+                },
+                "bname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "string"
+                },
+                "pastureid": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.CoordinatesInfo": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "enable": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "left": {
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "style": {
+                    "$ref": "#/definitions/v1.Style"
+                },
+                "top": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.EditReceiverCoordinatesReq": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.CoordinatesInfo"
+                    }
+                }
+            }
+        },
+        "v1.EditReceiverReq": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "卡号",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "location": {
+                    "description": "安装位置",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "simId": {
+                    "description": "BarName     string ` + "`" + `json:\"barname\"` + "`" + `     //栏舍名称",
+                    "type": "integer"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.EditSimReq": {
+            "type": "object",
+            "properties": {
+                "activatedate": {
+                    "description": "激活日期",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "sim卡号",
+                    "type": "string"
+                },
+                "company": {
+                    "description": "公司",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "结束日期",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "description": "接收器id",
+                    "type": "integer"
+                },
+                "remaining": {
+                    "description": "剩余流量",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "状态",
+                    "type": "integer"
+                },
+                "topupdate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "totalflow": {
+                    "description": "总流量",
+                    "type": "string"
+                },
+                "used": {
+                    "description": "已用流量",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.Factory": {
+            "type": "object",
+            "properties": {
+                "batch": {
+                    "description": "出厂批次",
+                    "type": "string"
+                },
+                "count": {
+                    "description": "出厂数量",
+                    "type": "integer"
+                },
+                "createname": {
+                    "description": "登记人",
+                    "type": "string"
+                },
+                "createtime": {
+                    "description": "登记时间",
+                    "type": "string"
+                },
+                "genre": {
+                    "description": "0 购买,1 置换",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetBarListRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.BarList"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetFactoryRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Factory"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetManagementBhRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.ManagementBh"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetManagementRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Management"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetNeckRingListingRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.NeckRingListing"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetPastureListRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.PastureList"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetRecallRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Recall"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetReceiverRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Receiver"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetSimPullRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.SimPull"
+                    }
+                }
+            }
+        },
+        "v1.GetSimRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Sim"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.Management": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "description": "出厂数量",
+                    "type": "integer"
+                },
+                "genre": {
+                    "description": "0 售卖,1 返厂 2 置换",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "importdate": {
+                    "description": "导入时间",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.ManagementBh": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "description": "脖环编码",
+                    "type": "string"
+                },
+                "date": {
+                    "description": "日期",
+                    "type": "string"
+                },
+                "managementid": {
+                    "description": "脖环管理ID",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.NeckRingListing": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "integer"
+                },
+                "barname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "batch": {
+                    "description": "批次",
+                    "type": "string"
+                },
+                "cattle": {
+                    "description": "牛号",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "脖环编码",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "manufacturedate": {
+                    "description": "生产日期",
+                    "type": "string"
+                },
+                "name": {
+                    "description": "脖环名称",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.PastureList": {
+            "type": "object",
+            "properties": {
+                "pasturecode": {
+                    "type": "string"
+                },
+                "pastureid": {
+                    "type": "string"
+                },
+                "pasturename": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.Recall": {
+            "type": "object",
+            "properties": {
+                "batch": {
+                    "description": "出厂批次",
+                    "type": "string"
+                },
+                "count": {
+                    "description": "出厂数量",
+                    "type": "integer"
+                },
+                "createname": {
+                    "description": "登记人",
+                    "type": "string"
+                },
+                "createtime": {
+                    "description": "登记时间",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.Receiver": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "barname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "sim编码 卡号",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "image": {
+                    "description": "图片地址",
+                    "type": "string"
+                },
+                "location": {
+                    "description": "安装位置 设备位置(1:奶厅1,2:奶厅2)",
+                    "type": "string"
+                },
+                "pasturecode": {
+                    "description": "牧场编码",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "type": "integer"
+                },
+                "simid": {
+                    "description": "栏舍id",
+                    "type": "integer"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                },
+                "style": {
+                    "$ref": "#/definitions/v1.Style"
+                },
+                "updatedate": {
+                    "description": "最后修改时间",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.Sim": {
+            "type": "object",
+            "properties": {
+                "activatedate": {
+                    "description": "激活日期",
+                    "type": "string"
+                },
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "barname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "sim卡号",
+                    "type": "string"
+                },
+                "company": {
+                    "description": "公司",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pasturecode": {
+                    "description": "牧场编码",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "receivercode": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "description": "接收器id",
+                    "type": "integer"
+                },
+                "remaining": {
+                    "description": "剩余流量",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "状态",
+                    "type": "integer"
+                },
+                "topupdate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "totalflow": {
+                    "description": "总流量",
+                    "type": "string"
+                },
+                "used": {
+                    "description": "已用流量",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.SimPull": {
+            "type": "object",
+            "properties": {
+                "card": {
+                    "description": "sim卡号",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.Style": {
+            "type": "object",
+            "properties": {
+                "left": {
+                    "type": "string"
+                },
+                "top": {
+                    "type": "string"
+                }
+            }
+        }
+    }
+}`
+
+// SwaggerInfo holds exported Swagger Info so clients can modify it
+var SwaggerInfo = &swag.Spec{
+	Version:          "",
+	Host:             "",
+	BasePath:         "",
+	Schemes:          []string{},
+	Title:            "",
+	Description:      "",
+	InfoInstanceName: "swagger",
+	SwaggerTemplate:  docTemplate,
+}
+
+func init() {
+	swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
+}

+ 1797 - 0
docs/swagger.json

@@ -0,0 +1,1797 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "contact": {}
+    },
+    "paths": {
+        "/factory/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环出厂登记"
+                ],
+                "summary": "脖环出厂登记添加",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddFactoryReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/factory/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环出厂登记"
+                ],
+                "summary": "脖环出厂登记查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 批次",
+                        "name": "batch",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 0 购买,1 置换  -1 全部",
+                        "name": "genre",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "startcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "endcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记人",
+                        "name": "createname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "startdate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "enddate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 查看关联出厂批次",
+                        "name": "recallid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetFactoryRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/housephy/image": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "上传接收器图片",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/image": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "接收器图片查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetBarListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/management/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环管理"
+                ],
+                "summary": "脖环管理导入",
+                "responses": {}
+            }
+        },
+        "/management/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环管理"
+                ],
+                "summary": "脖环管理查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环编码",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 牧场id",
+                        "name": "pastureid",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int64 0 售卖,1 返厂 2 置换  -1 全部",
+                        "name": "genre",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 导入开始时间",
+                        "name": "startdate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 导入结束时间",
+                        "name": "enddate",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetManagementRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/managementbh/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环管理"
+                ],
+                "summary": "脖环管理明细查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "managementid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetManagementBhRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/public/bar": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "栏舍查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 栏舍名称",
+                        "name": "barname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 牧场编码",
+                        "name": "pastureid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetBarListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/public/housephy": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "物理栏舍查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string ",
+                        "name": "pastureid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetBarListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/public/pasture": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "牧场信息查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetPastureListRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/recall/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环召回计划"
+                ],
+                "summary": "脖环召回计划添加",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddRecallReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/recall/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环召回计划"
+                ],
+                "summary": "脖环召回查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 批次",
+                        "name": "batch",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "startcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 数量",
+                        "name": "endcount",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记人",
+                        "name": "createname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "startdate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 登记时间",
+                        "name": "enddate",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 查看召回批次",
+                        "name": "factoryid",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 置换时查看传 1",
+                        "name": "replacement",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetRecallRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/receiver/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "添加接收器",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddReceiverReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/receiver/coordinates": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "接收器位置信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "string 栏舍",
+                        "name": "barid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetReceiverRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/receiver/coordinates/edit": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "编辑接收器坐标",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.EditReceiverCoordinatesReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/receiver/edit": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "编辑接收器",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.EditReceiverReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/receiver/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "接收器管理"
+                ],
+                "summary": "接收器管理查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 接收器编码",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetReceiverRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/receiver/pull": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "接口器下拉",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetReceiverRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/ring/listing": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "脖环清单"
+                ],
+                "summary": "脖环清单查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环编码",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 脖环状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int 牛号",
+                        "name": "cattle",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 栏舍名称",
+                        "name": "barname",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 购入开始日期",
+                        "name": "purchasestart",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 购入结束日期",
+                        "name": "purchaseend",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 生产开始日期",
+                        "name": "manufacturestart",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 生产结束日期",
+                        "name": "manufactureend",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 出厂数量",
+                        "name": "factoryid",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 召回",
+                        "name": "recallid",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetNeckRingListingRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/sim/add": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "SIM卡管理"
+                ],
+                "summary": "SIM卡添加",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.AddSimReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/sim/edit": {
+            "post": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "SIM卡管理"
+                ],
+                "summary": "SIM卡修改",
+                "parameters": [
+                    {
+                        "description": "Add account",
+                        "name": "account",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/v1.EditSimReq"
+                        }
+                    }
+                ],
+                "responses": {}
+            }
+        },
+        "/sim/list": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "SIM卡管理"
+                ],
+                "summary": "SIM卡查看",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "index",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "int ",
+                        "name": "pagesize",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string sim卡号",
+                        "name": "card",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "string 公司",
+                        "name": "company",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "string 状态",
+                        "name": "status",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetSimRes"
+                        }
+                    }
+                }
+            }
+        },
+        "/sim/pull": {
+            "get": {
+                "description": "add by json account",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "公共接口"
+                ],
+                "summary": "SIM卡下拉",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/v1.GetSimPullRes"
+                        }
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+        "v1.AddFactoryReq": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "type": "integer"
+                },
+                "genre": {
+                    "description": "0 购买,1 置换",
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                },
+                "recallid": {
+                    "description": "召回id",
+                    "type": "array",
+                    "items": {
+                        "type": "integer"
+                    }
+                }
+            }
+        },
+        "v1.AddRecallReq": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "type": "integer"
+                },
+                "factoryid": {
+                    "description": "召回id",
+                    "type": "array",
+                    "items": {
+                        "type": "integer"
+                    }
+                },
+                "pastureid": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.AddReceiverReq": {
+            "type": "object",
+            "properties": {
+                "barId": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "UpdateDate  time.Time `json:\"updateDate\"`  //最后修改时间",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "location": {
+                    "description": "安装位置",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "simid": {
+                    "description": "BarName   string `json:\"barname\"`   //栏舍名称",
+                    "type": "integer"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.AddSimReq": {
+            "type": "object",
+            "properties": {
+                "activatedate": {
+                    "description": "激活日期",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "Id           int64  `json:\"id\"`",
+                    "type": "string"
+                },
+                "company": {
+                    "description": "公司",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "description": "接收器id",
+                    "type": "integer"
+                },
+                "remaining": {
+                    "description": "剩余流量",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "状态",
+                    "type": "integer"
+                },
+                "topupdate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "totalflow": {
+                    "description": "总流量",
+                    "type": "string"
+                },
+                "used": {
+                    "description": "已用流量",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.BarList": {
+            "type": "object",
+            "properties": {
+                "bcode": {
+                    "description": "栏舍编码",
+                    "type": "string"
+                },
+                "bname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "string"
+                },
+                "pastureid": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.CoordinatesInfo": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "enable": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "left": {
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "style": {
+                    "$ref": "#/definitions/v1.Style"
+                },
+                "top": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.EditReceiverCoordinatesReq": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.CoordinatesInfo"
+                    }
+                }
+            }
+        },
+        "v1.EditReceiverReq": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "卡号",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "location": {
+                    "description": "安装位置",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "simId": {
+                    "description": "BarName     string `json:\"barname\"`     //栏舍名称",
+                    "type": "integer"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.EditSimReq": {
+            "type": "object",
+            "properties": {
+                "activatedate": {
+                    "description": "激活日期",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "sim卡号",
+                    "type": "string"
+                },
+                "company": {
+                    "description": "公司",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "结束日期",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "description": "接收器id",
+                    "type": "integer"
+                },
+                "remaining": {
+                    "description": "剩余流量",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "状态",
+                    "type": "integer"
+                },
+                "topupdate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "totalflow": {
+                    "description": "总流量",
+                    "type": "string"
+                },
+                "used": {
+                    "description": "已用流量",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.Factory": {
+            "type": "object",
+            "properties": {
+                "batch": {
+                    "description": "出厂批次",
+                    "type": "string"
+                },
+                "count": {
+                    "description": "出厂数量",
+                    "type": "integer"
+                },
+                "createname": {
+                    "description": "登记人",
+                    "type": "string"
+                },
+                "createtime": {
+                    "description": "登记时间",
+                    "type": "string"
+                },
+                "genre": {
+                    "description": "0 购买,1 置换",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetBarListRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.BarList"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetFactoryRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Factory"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetManagementBhRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.ManagementBh"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetManagementRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Management"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetNeckRingListingRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.NeckRingListing"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetPastureListRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.PastureList"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetRecallRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Recall"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetReceiverRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Receiver"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.GetSimPullRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.SimPull"
+                    }
+                }
+            }
+        },
+        "v1.GetSimRes": {
+            "type": "object",
+            "properties": {
+                "list": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/v1.Sim"
+                    }
+                },
+                "total": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.Management": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "description": "出厂数量",
+                    "type": "integer"
+                },
+                "genre": {
+                    "description": "0 售卖,1 返厂 2 置换",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "importdate": {
+                    "description": "导入时间",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.ManagementBh": {
+            "type": "object",
+            "properties": {
+                "code": {
+                    "description": "脖环编码",
+                    "type": "string"
+                },
+                "date": {
+                    "description": "日期",
+                    "type": "string"
+                },
+                "managementid": {
+                    "description": "脖环管理ID",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.NeckRingListing": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "integer"
+                },
+                "barname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "batch": {
+                    "description": "批次",
+                    "type": "string"
+                },
+                "cattle": {
+                    "description": "牛号",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "脖环编码",
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "manufacturedate": {
+                    "description": "生产日期",
+                    "type": "string"
+                },
+                "name": {
+                    "description": "脖环名称",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.PastureList": {
+            "type": "object",
+            "properties": {
+                "pasturecode": {
+                    "type": "string"
+                },
+                "pastureid": {
+                    "type": "string"
+                },
+                "pasturename": {
+                    "type": "string"
+                }
+            }
+        },
+        "v1.Recall": {
+            "type": "object",
+            "properties": {
+                "batch": {
+                    "description": "出厂批次",
+                    "type": "string"
+                },
+                "count": {
+                    "description": "出厂数量",
+                    "type": "integer"
+                },
+                "createname": {
+                    "description": "登记人",
+                    "type": "string"
+                },
+                "createtime": {
+                    "description": "登记时间",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "recall": {
+                    "description": "关联召回批次数",
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.Receiver": {
+            "type": "object",
+            "properties": {
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "barname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "sim编码 卡号",
+                    "type": "string"
+                },
+                "code": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "image": {
+                    "description": "图片地址",
+                    "type": "string"
+                },
+                "location": {
+                    "description": "安装位置 设备位置(1:奶厅1,2:奶厅2)",
+                    "type": "string"
+                },
+                "pasturecode": {
+                    "description": "牧场编码",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "type": "integer"
+                },
+                "simid": {
+                    "description": "栏舍id",
+                    "type": "integer"
+                },
+                "status": {
+                    "description": "脖环状态",
+                    "type": "integer"
+                },
+                "style": {
+                    "$ref": "#/definitions/v1.Style"
+                },
+                "updatedate": {
+                    "description": "最后修改时间",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.Sim": {
+            "type": "object",
+            "properties": {
+                "activatedate": {
+                    "description": "激活日期",
+                    "type": "string"
+                },
+                "barid": {
+                    "description": "栏舍id",
+                    "type": "string"
+                },
+                "barname": {
+                    "description": "栏舍名称",
+                    "type": "string"
+                },
+                "card": {
+                    "description": "sim卡号",
+                    "type": "string"
+                },
+                "company": {
+                    "description": "公司",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
+                "pasturecode": {
+                    "description": "牧场编码",
+                    "type": "string"
+                },
+                "pastureid": {
+                    "description": "牧场id",
+                    "type": "string"
+                },
+                "pasturename": {
+                    "description": "牧场名称",
+                    "type": "string"
+                },
+                "purchasedate": {
+                    "description": "购入日期",
+                    "type": "string"
+                },
+                "receivercode": {
+                    "description": "接收器编码",
+                    "type": "string"
+                },
+                "receiverid": {
+                    "description": "接收器id",
+                    "type": "integer"
+                },
+                "remaining": {
+                    "description": "剩余流量",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "状态",
+                    "type": "integer"
+                },
+                "topupdate": {
+                    "description": "充值日期",
+                    "type": "string"
+                },
+                "totalflow": {
+                    "description": "总流量",
+                    "type": "string"
+                },
+                "used": {
+                    "description": "已用流量",
+                    "type": "string"
+                }
+            }
+        },
+        "v1.SimPull": {
+            "type": "object",
+            "properties": {
+                "card": {
+                    "description": "sim卡号",
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                }
+            }
+        },
+        "v1.Style": {
+            "type": "object",
+            "properties": {
+                "left": {
+                    "type": "string"
+                },
+                "top": {
+                    "type": "string"
+                }
+            }
+        }
+    }
+}

+ 1237 - 0
docs/swagger.yaml

@@ -0,0 +1,1237 @@
+definitions:
+  v1.AddFactoryReq:
+    properties:
+      count:
+        type: integer
+      genre:
+        description: 0 购买,1 置换
+        type: integer
+      pastureid:
+        type: string
+      recall:
+        description: 关联召回批次数
+        type: integer
+      recallid:
+        description: 召回id
+        items:
+          type: integer
+        type: array
+    type: object
+  v1.AddRecallReq:
+    properties:
+      count:
+        type: integer
+      factoryid:
+        description: 召回id
+        items:
+          type: integer
+        type: array
+      pastureid:
+        type: string
+    type: object
+  v1.AddReceiverReq:
+    properties:
+      barId:
+        description: 栏舍id
+        type: string
+      card:
+        description: UpdateDate  time.Time `json:"updateDate"`  //最后修改时间
+        type: string
+      code:
+        description: 接收器编码
+        type: string
+      location:
+        description: 安装位置
+        type: string
+      pastureid:
+        description: 牧场id
+        type: string
+      pasturename:
+        description: 牧场名称
+        type: string
+      simid:
+        description: BarName   string `json:"barname"`   //栏舍名称
+        type: integer
+      status:
+        description: 脖环状态
+        type: integer
+    type: object
+  v1.AddSimReq:
+    properties:
+      activatedate:
+        description: 激活日期
+        type: string
+      card:
+        description: Id           int64  `json:"id"`
+        type: string
+      company:
+        description: 公司
+        type: string
+      enddate:
+        description: 充值日期
+        type: string
+      pastureid:
+        description: 牧场id
+        type: string
+      purchasedate:
+        description: 购入日期
+        type: string
+      receiverid:
+        description: 接收器id
+        type: integer
+      remaining:
+        description: 剩余流量
+        type: string
+      status:
+        description: 状态
+        type: integer
+      topupdate:
+        description: 充值日期
+        type: string
+      totalflow:
+        description: 总流量
+        type: string
+      used:
+        description: 已用流量
+        type: string
+    type: object
+  v1.BarList:
+    properties:
+      bcode:
+        description: 栏舍编码
+        type: string
+      bname:
+        description: 栏舍名称
+        type: string
+      id:
+        type: string
+      pastureid:
+        type: string
+    type: object
+  v1.CoordinatesInfo:
+    properties:
+      barid:
+        description: 栏舍id
+        type: string
+      enable:
+        description: 脖环状态
+        type: integer
+      id:
+        type: integer
+      left:
+        type: string
+      pastureid:
+        description: 牧场id
+        type: string
+      style:
+        $ref: '#/definitions/v1.Style'
+      top:
+        type: string
+    type: object
+  v1.EditReceiverCoordinatesReq:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.CoordinatesInfo'
+        type: array
+    type: object
+  v1.EditReceiverReq:
+    properties:
+      barid:
+        description: 栏舍id
+        type: string
+      card:
+        description: 卡号
+        type: string
+      code:
+        description: 接收器编码
+        type: string
+      id:
+        type: integer
+      location:
+        description: 安装位置
+        type: string
+      pastureid:
+        description: 牧场id
+        type: string
+      pasturename:
+        description: 牧场名称
+        type: string
+      simId:
+        description: BarName     string `json:"barname"`     //栏舍名称
+        type: integer
+      status:
+        description: 脖环状态
+        type: integer
+    type: object
+  v1.EditSimReq:
+    properties:
+      activatedate:
+        description: 激活日期
+        type: string
+      card:
+        description: sim卡号
+        type: string
+      company:
+        description: 公司
+        type: string
+      enddate:
+        description: 结束日期
+        type: string
+      id:
+        type: integer
+      pastureid:
+        description: 牧场id
+        type: string
+      purchasedate:
+        description: 购入日期
+        type: string
+      receiverid:
+        description: 接收器id
+        type: integer
+      remaining:
+        description: 剩余流量
+        type: string
+      status:
+        description: 状态
+        type: integer
+      topupdate:
+        description: 充值日期
+        type: string
+      totalflow:
+        description: 总流量
+        type: string
+      used:
+        description: 已用流量
+        type: string
+    type: object
+  v1.Factory:
+    properties:
+      batch:
+        description: 出厂批次
+        type: string
+      count:
+        description: 出厂数量
+        type: integer
+      createname:
+        description: 登记人
+        type: string
+      createtime:
+        description: 登记时间
+        type: string
+      genre:
+        description: 0 购买,1 置换
+        type: integer
+      id:
+        type: integer
+      pastureid:
+        description: 牧场id
+        type: string
+      pasturename:
+        description: 牧场名称
+        type: string
+      recall:
+        description: 关联召回批次数
+        type: integer
+    type: object
+  v1.GetBarListRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.BarList'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetFactoryRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.Factory'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetManagementBhRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.ManagementBh'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetManagementRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.Management'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetNeckRingListingRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.NeckRingListing'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetPastureListRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.PastureList'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetRecallRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.Recall'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetReceiverRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.Receiver'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.GetSimPullRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.SimPull'
+        type: array
+    type: object
+  v1.GetSimRes:
+    properties:
+      list:
+        items:
+          $ref: '#/definitions/v1.Sim'
+        type: array
+      total:
+        type: integer
+    type: object
+  v1.Management:
+    properties:
+      count:
+        description: 出厂数量
+        type: integer
+      genre:
+        description: 0 售卖,1 返厂 2 置换
+        type: integer
+      id:
+        type: integer
+      importdate:
+        description: 导入时间
+        type: string
+      pastureid:
+        description: 牧场id
+        type: string
+      pasturename:
+        description: 牧场id
+        type: string
+      recall:
+        description: 关联召回批次数
+        type: integer
+    type: object
+  v1.ManagementBh:
+    properties:
+      code:
+        description: 脖环编码
+        type: string
+      date:
+        description: 日期
+        type: string
+      managementid:
+        description: 脖环管理ID
+        type: integer
+    type: object
+  v1.NeckRingListing:
+    properties:
+      barid:
+        description: 栏舍id
+        type: integer
+      barname:
+        description: 栏舍名称
+        type: string
+      batch:
+        description: 批次
+        type: string
+      cattle:
+        description: 牛号
+        type: string
+      code:
+        description: 脖环编码
+        type: integer
+      id:
+        type: integer
+      manufacturedate:
+        description: 生产日期
+        type: string
+      name:
+        description: 脖环名称
+        type: string
+      purchasedate:
+        description: 购入日期
+        type: string
+      status:
+        description: 脖环状态
+        type: integer
+    type: object
+  v1.PastureList:
+    properties:
+      pasturecode:
+        type: string
+      pastureid:
+        type: string
+      pasturename:
+        type: string
+    type: object
+  v1.Recall:
+    properties:
+      batch:
+        description: 出厂批次
+        type: string
+      count:
+        description: 出厂数量
+        type: integer
+      createname:
+        description: 登记人
+        type: string
+      createtime:
+        description: 登记时间
+        type: string
+      id:
+        type: integer
+      pastureid:
+        description: 牧场id
+        type: string
+      pasturename:
+        description: 牧场名称
+        type: string
+      recall:
+        description: 关联召回批次数
+        type: integer
+    type: object
+  v1.Receiver:
+    properties:
+      barid:
+        description: 栏舍id
+        type: string
+      barname:
+        description: 栏舍名称
+        type: string
+      card:
+        description: sim编码 卡号
+        type: string
+      code:
+        description: 接收器编码
+        type: string
+      id:
+        type: integer
+      image:
+        description: 图片地址
+        type: string
+      location:
+        description: 安装位置 设备位置(1:奶厅1,2:奶厅2)
+        type: string
+      pasturecode:
+        description: 牧场编码
+        type: string
+      pastureid:
+        description: 牧场id
+        type: string
+      pasturename:
+        description: 牧场名称
+        type: string
+      receiverid:
+        type: integer
+      simid:
+        description: 栏舍id
+        type: integer
+      status:
+        description: 脖环状态
+        type: integer
+      style:
+        $ref: '#/definitions/v1.Style'
+      updatedate:
+        description: 最后修改时间
+        type: string
+    type: object
+  v1.Sim:
+    properties:
+      activatedate:
+        description: 激活日期
+        type: string
+      barid:
+        description: 栏舍id
+        type: string
+      barname:
+        description: 栏舍名称
+        type: string
+      card:
+        description: sim卡号
+        type: string
+      company:
+        description: 公司
+        type: string
+      enddate:
+        description: 充值日期
+        type: string
+      id:
+        type: integer
+      pasturecode:
+        description: 牧场编码
+        type: string
+      pastureid:
+        description: 牧场id
+        type: string
+      pasturename:
+        description: 牧场名称
+        type: string
+      purchasedate:
+        description: 购入日期
+        type: string
+      receivercode:
+        description: 接收器编码
+        type: string
+      receiverid:
+        description: 接收器id
+        type: integer
+      remaining:
+        description: 剩余流量
+        type: string
+      status:
+        description: 状态
+        type: integer
+      topupdate:
+        description: 充值日期
+        type: string
+      totalflow:
+        description: 总流量
+        type: string
+      used:
+        description: 已用流量
+        type: string
+    type: object
+  v1.SimPull:
+    properties:
+      card:
+        description: sim卡号
+        type: string
+      id:
+        type: integer
+    type: object
+  v1.Style:
+    properties:
+      left:
+        type: string
+      top:
+        type: string
+    type: object
+info:
+  contact: {}
+paths:
+  /factory/add:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: Add account
+        in: body
+        name: account
+        required: true
+        schema:
+          $ref: '#/definitions/v1.AddFactoryReq'
+      produces:
+      - application/json
+      responses: {}
+      summary: 脖环出厂登记添加
+      tags:
+      - 脖环出厂登记
+  /factory/list:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: string 批次
+        in: path
+        name: batch
+        required: true
+        type: string
+      - description: string 0 购买,1 置换  -1 全部
+        in: path
+        name: genre
+        required: true
+        type: integer
+      - description: string 数量
+        in: path
+        name: startcount
+        required: true
+        type: string
+      - description: string 数量
+        in: path
+        name: endcount
+        required: true
+        type: string
+      - description: string 登记人
+        in: path
+        name: createname
+        required: true
+        type: string
+      - description: string 登记时间
+        in: path
+        name: startdate
+        required: true
+        type: string
+      - description: string 登记时间
+        in: path
+        name: enddate
+        required: true
+        type: string
+      - description: string 查看关联出厂批次
+        in: path
+        name: recallid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetFactoryRes'
+      summary: 脖环出厂登记查看
+      tags:
+      - 脖环出厂登记
+  /housephy/image:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: id
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses: {}
+      summary: 上传接收器图片
+      tags:
+      - 接收器管理
+  /image:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: id
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetBarListRes'
+      summary: 接收器图片查看
+      tags:
+      - 接收器管理
+  /management/add:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      produces:
+      - application/json
+      responses: {}
+      summary: 脖环管理导入
+      tags:
+      - 脖环管理
+  /management/list:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: string 脖环编码
+        in: path
+        name: code
+        required: true
+        type: string
+      - description: string 脖环状态
+        in: path
+        name: status
+        required: true
+        type: string
+      - description: string 牧场id
+        in: path
+        name: pastureid
+        required: true
+        type: string
+      - description: int64 0 售卖,1 返厂 2 置换  -1 全部
+        in: path
+        name: genre
+        required: true
+        type: integer
+      - description: string 导入开始时间
+        in: path
+        name: startdate
+        required: true
+        type: string
+      - description: string 导入结束时间
+        in: path
+        name: enddate
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetManagementRes'
+      summary: 脖环管理查看
+      tags:
+      - 脖环管理
+  /managementbh/list:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: managementid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetManagementBhRes'
+      summary: 脖环管理明细查看
+      tags:
+      - 脖环管理
+  /public/bar:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: string 栏舍名称
+        in: path
+        name: barname
+        required: true
+        type: string
+      - description: string 牧场编码
+        in: path
+        name: pastureid
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetBarListRes'
+      summary: 栏舍查看
+      tags:
+      - 公共接口
+  /public/housephy:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: 'string '
+        in: path
+        name: pastureid
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetBarListRes'
+      summary: 物理栏舍查看
+      tags:
+      - 公共接口
+  /public/pasture:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetPastureListRes'
+      summary: 牧场信息查看
+      tags:
+      - 公共接口
+  /recall/add:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: Add account
+        in: body
+        name: account
+        required: true
+        schema:
+          $ref: '#/definitions/v1.AddRecallReq'
+      produces:
+      - application/json
+      responses: {}
+      summary: 脖环召回计划添加
+      tags:
+      - 脖环召回计划
+  /recall/list:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: string 批次
+        in: path
+        name: batch
+        required: true
+        type: string
+      - description: string 数量
+        in: path
+        name: startcount
+        required: true
+        type: string
+      - description: string 数量
+        in: path
+        name: endcount
+        required: true
+        type: string
+      - description: string 登记人
+        in: path
+        name: createname
+        required: true
+        type: string
+      - description: string 登记时间
+        in: path
+        name: startdate
+        required: true
+        type: string
+      - description: string 登记时间
+        in: path
+        name: enddate
+        required: true
+        type: string
+      - description: string 查看召回批次
+        in: path
+        name: factoryid
+        required: true
+        type: integer
+      - description: string 置换时查看传 1
+        in: path
+        name: replacement
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetRecallRes'
+      summary: 脖环召回查看
+      tags:
+      - 脖环召回计划
+  /receiver/add:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: Add account
+        in: body
+        name: account
+        required: true
+        schema:
+          $ref: '#/definitions/v1.AddReceiverReq'
+      produces:
+      - application/json
+      responses: {}
+      summary: 添加接收器
+      tags:
+      - 接收器管理
+  /receiver/coordinates:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: string 栏舍
+        in: path
+        name: barid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetReceiverRes'
+      summary: 接收器位置信息
+      tags:
+      - 接收器管理
+  /receiver/coordinates/edit:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: Add account
+        in: body
+        name: account
+        required: true
+        schema:
+          $ref: '#/definitions/v1.EditReceiverCoordinatesReq'
+      produces:
+      - application/json
+      responses: {}
+      summary: 编辑接收器坐标
+      tags:
+      - 接收器管理
+  /receiver/edit:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: Add account
+        in: body
+        name: account
+        required: true
+        schema:
+          $ref: '#/definitions/v1.EditReceiverReq'
+      produces:
+      - application/json
+      responses: {}
+      summary: 编辑接收器
+      tags:
+      - 接收器管理
+  /receiver/list:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: string 接收器编码
+        in: path
+        name: code
+        required: true
+        type: string
+      - description: string 状态
+        in: path
+        name: status
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetReceiverRes'
+      summary: 接收器管理查看
+      tags:
+      - 接收器管理
+  /receiver/pull:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetReceiverRes'
+      summary: 接口器下拉
+      tags:
+      - 公共接口
+  /ring/listing:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: string 脖环编码
+        in: path
+        name: code
+        required: true
+        type: string
+      - description: string 脖环状态
+        in: path
+        name: status
+        required: true
+        type: string
+      - description: int 牛号
+        in: path
+        name: cattle
+        required: true
+        type: integer
+      - description: string 栏舍名称
+        in: path
+        name: barname
+        required: true
+        type: string
+      - description: string 购入开始日期
+        in: path
+        name: purchasestart
+        required: true
+        type: string
+      - description: string 购入结束日期
+        in: path
+        name: purchaseend
+        required: true
+        type: string
+      - description: string 生产开始日期
+        in: path
+        name: manufacturestart
+        required: true
+        type: string
+      - description: string 生产结束日期
+        in: path
+        name: manufactureend
+        required: true
+        type: string
+      - description: string 出厂数量
+        in: path
+        name: factoryid
+        required: true
+        type: string
+      - description: string 召回
+        in: path
+        name: recallid
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetNeckRingListingRes'
+      summary: 脖环清单查看
+      tags:
+      - 脖环清单
+  /sim/add:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: Add account
+        in: body
+        name: account
+        required: true
+        schema:
+          $ref: '#/definitions/v1.AddSimReq'
+      produces:
+      - application/json
+      responses: {}
+      summary: SIM卡添加
+      tags:
+      - SIM卡管理
+  /sim/edit:
+    post:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: Add account
+        in: body
+        name: account
+        required: true
+        schema:
+          $ref: '#/definitions/v1.EditSimReq'
+      produces:
+      - application/json
+      responses: {}
+      summary: SIM卡修改
+      tags:
+      - SIM卡管理
+  /sim/list:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      parameters:
+      - description: 'int '
+        in: path
+        name: index
+        required: true
+        type: integer
+      - description: 'int '
+        in: path
+        name: pagesize
+        required: true
+        type: integer
+      - description: string sim卡号
+        in: path
+        name: card
+        required: true
+        type: string
+      - description: string 公司
+        in: path
+        name: company
+        required: true
+        type: string
+      - description: string 状态
+        in: path
+        name: status
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetSimRes'
+      summary: SIM卡查看
+      tags:
+      - SIM卡管理
+  /sim/pull:
+    get:
+      consumes:
+      - application/json
+      description: add by json account
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/v1.GetSimPullRes'
+      summary: SIM卡下拉
+      tags:
+      - 公共接口
+swagger: "2.0"

BIN
file/脖环召回.xlsx


BIN
file/脖环管理.xlsx


+ 35 - 0
go.mod

@@ -0,0 +1,35 @@
+module demo
+
+go 1.15
+
+require (
+	github.com/Anderson-Lu/gofasion v0.0.0-20190530065914-6a05b679ee48 // indirect
+	github.com/OwnLocal/goes v1.0.0 // indirect
+	github.com/PuerkitoBio/purell v1.2.0 // indirect
+	github.com/astaxie/beego v1.12.3 // indirect
+	github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
+	github.com/go-ini/ini v1.67.0 // indirect
+	github.com/go-openapi/spec v0.20.7 // indirect
+	github.com/go-openapi/swag v0.22.3 // indirect
+	github.com/go-sql-driver/mysql v1.6.0
+	github.com/go-xorm/xorm v0.7.9
+	github.com/gogf/gf/v2 v2.1.3
+	github.com/jacobsa/go-serial v0.0.0-20180131005756-15cf729a72d4 // indirect
+	github.com/kr/pretty v0.3.0 // indirect
+	github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
+	github.com/pkg/errors v0.9.1
+	github.com/satori/go.uuid v1.2.0 // indirect
+	github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
+	github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 // indirect
+	github.com/siddontang/ledisdb v0.0.0-20181029004158-becf5f38d373 // indirect
+	github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect
+	github.com/swaggo/swag v1.8.5 // indirect
+	github.com/tealeg/xlsx v1.0.5 // indirect
+	github.com/urfave/cli v1.20.0 // indirect
+	github.com/urfave/cli/v2 v2.11.2 // indirect
+	github.com/xuri/excelize/v2 v2.6.1 // indirect
+	golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c // indirect
+	golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect
+	golang.org/x/tools v0.1.12 // indirect
+	xorm.io/core v0.7.3 // indirect
+)

+ 511 - 0
go.sum

@@ -0,0 +1,511 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
+cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
+github.com/Anderson-Lu/gofasion v0.0.0-20190530065914-6a05b679ee48 h1:Y0um3nHCQDleEpQzahJAkT8mvKTlLqvjoIqZYIAJgAw=
+github.com/Anderson-Lu/gofasion v0.0.0-20190530065914-6a05b679ee48/go.mod h1:nJfnu9e1b/lczgULa3laeoUzeadR3ylEgYj8zpXO+Wc=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I=
+github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
+github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
+github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
+github.com/OwnLocal/goes v1.0.0/go.mod h1:8rIFjBGTue3lCU0wplczcUgt9Gxgrkkrw7etMIcn8TM=
+github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/purell v1.2.0 h1:/Jdm5QfyM8zdlqT6WVZU4cfP23sot6CEHA4CS49Ezig=
+github.com/PuerkitoBio/purell v1.2.0/go.mod h1:OhLRTaaIzhvIyofkJfB24gokC7tM42Px5UhoT32THBk=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
+github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
+github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
+github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
+github.com/astaxie/beego v1.12.3 h1:SAQkdD2ePye+v8Gn1r4X6IKZM1wd28EyUOVQ3PDSOOQ=
+github.com/astaxie/beego v1.12.3/go.mod h1:p3qIm0Ryx7zeBHLljmd7omloyca1s4yu1a8kM1FkpIA=
+github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
+github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
+github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
+github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
+github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
+github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E=
+github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
+github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
+github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
+github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
+github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
+github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
+github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
+github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADGYw5LqMnHqSkyIELsHCGF6PkrmM31V8rF7o=
+github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
+github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
+github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
+github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
+github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
+github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
+github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
+github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
+github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
+github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
+github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
+github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
+github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
+github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
+github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
+github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
+github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
+github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns=
+github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
+github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
+github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I=
+github.com/go-openapi/spec v0.20.7 h1:1Rlu/ZrOCCob0n+JKKJAWhNWMPW8bOZRg8FJaY+0SKI=
+github.com/go-openapi/spec v0.20.7/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
+github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
+github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
+github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
+github.com/go-redis/redis v6.14.2+incompatible h1:UE9pLhzmWf+xHNmZsoccjXosPicuiNaInPgym8nzfg0=
+github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
+github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
+github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
+github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
+github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
+github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
+github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:9wScpmSP5A3Bk8V3XHWUcJmYTh+ZnlHVyc+A4oZYS3Y=
+github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
+github.com/go-xorm/xorm v0.7.9 h1:LZze6n1UvRmM5gpL9/U9Gucwqo6aWlFVlfcHKH10qA0=
+github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmjh5sQ=
+github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
+github.com/gogf/gf/v2 v2.1.3 h1:jAPBHZmicCz/ny83+vg7jEc+Uq91A0Z8OrKm+5xQk50=
+github.com/gogf/gf/v2 v2.1.3/go.mod h1:thvkyb43RWUu/m05sRm4CbH9r7t7/FrW2M56L9Ystwk=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
+github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
+github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
+github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
+github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
+github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
+github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/grokify/html-strip-tags-go v0.0.1 h1:0fThFwLbW7P/kOiTBs03FsJSV9RM2M/Q/MOnCQxKMo0=
+github.com/grokify/html-strip-tags-go v0.0.1/go.mod h1:2Su6romC5/1VXOQMaWL2yb618ARB8iVo6/DR99A6d78=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ=
+github.com/jackc/pgx v3.6.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
+github.com/jacobsa/go-serial v0.0.0-20180131005756-15cf729a72d4 h1:G2ztCwXov8mRvP0ZfjE6nAlaCX2XbykaeHdbT6KwDz0=
+github.com/jacobsa/go-serial v0.0.0-20180131005756-15cf729a72d4/go.mod h1:2RvX5ZjVtsznNZPEt4xwJXNJrM3VTZoQf7V6gk0ysvs=
+github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
+github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
+github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
+github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
+github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
+github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
+github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
+github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
+github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
+github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
+github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
+github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
+github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
+github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
+github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o=
+github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
+github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
+github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
+github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
+github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
+github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
+github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
+github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
+github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
+github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
+github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
+github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ=
+github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
+github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
+github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
+github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
+github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
+github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
+github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
+github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
+github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
+github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
+github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
+github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
+github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
+github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
+github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
+github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM=
+github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
+github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
+github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
+github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
+github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
+github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 h1:DAYUYH5869yV94zvCES9F51oYtN5oGlwjxJJz7ZCnik=
+github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
+github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
+github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
+github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
+github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
+github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM=
+github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
+github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
+github.com/siddontang/ledisdb v0.0.0-20181029004158-becf5f38d373/go.mod h1:mF1DpOSOUiJRMR+FDqaqu3EBqrybQtrDDszLUZ6oxPg=
+github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY=
+github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
+github.com/swaggo/swag v1.8.5 h1:7NgtfXsXE+jrcOwRyiftGKW7Ppydj7tZiVenuRf1fE4=
+github.com/swaggo/swag v1.8.5/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg=
+github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
+github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
+github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE=
+github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCnORM=
+github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
+github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
+github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
+github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
+github.com/urfave/cli/v2 v2.11.2 h1:FVfNg4m3vbjbBpLYxW//WjxUoHvJ9TlppXcqY9Q9ZfA=
+github.com/urfave/cli/v2 v2.11.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
+github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
+github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
+github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
+github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 h1:6932x8ltq1w4utjmfMPVj09jdMlkY0aiA6+Skbtl3/c=
+github.com/xuri/efp v0.0.0-20220603152613-6918739fd470/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
+github.com/xuri/excelize/v2 v2.6.1 h1:ICBdtw803rmhLN3zfvyEGH3cwSmZv+kde7LhTDT659k=
+github.com/xuri/excelize/v2 v2.6.1/go.mod h1:tL+0m6DNwSXj/sILHbQTYsLi9IF4TW59H2EF3Yrx1AU=
+github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 h1:OAmKAfT06//esDdpi/DZ8Qsdt4+M5+ltca05dA5bG2M=
+github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
+github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
+github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
+github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
+go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
+go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM=
+go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
+go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0=
+go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU=
+go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o=
+go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8 h1:GIAS/yBem/gq2MUqgNIzUHW7cJMmx3TGZOrnyYaNQ6c=
+golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
+golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
+golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
+golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
+golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c h1:JVAXQ10yGGVbSyoer5VILysz6YKjdNT2bsvlayjqhes=
+golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0=
+golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 h1:UiNENfZ8gDvpiWw7IpOMQ27spWmThO1RwwdQVbJahJM=
+golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 h1:GLw7MR8AfAG2GmGcmVgObFOHXYypgGjnGno25RDwn3Y=
+golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2/go.mod h1:EFNZuWvGYxIRUEX+K8UmCFwYmZjqcrnq15ZuVldZkZ0=
+golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
+golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
+golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
+google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+xorm.io/builder v0.3.6 h1:ha28mQ2M+TFx96Hxo+iq6tQgnkC9IZkM6D8w9sKHHF8=
+xorm.io/builder v0.3.6/go.mod h1:LEFAPISnRzG+zxaxj2vPicRwz67BdhFreKg8yv8/TgU=
+xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb h1:msX3zG3BPl8Ti+LDzP33/9K7BzO/WqFXk610K1kYKfo=
+xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb/go.mod h1:jJfd0UAEzZ4t87nbQYtVjmqpIODugN6PD2D9E+dJvdM=
+xorm.io/core v0.7.3 h1:W8ws1PlrnkS1CZU1YWaYLMQcQilwAmQXU0BJDJon+H0=
+xorm.io/core v0.7.3/go.mod h1:jJfd0UAEzZ4t87nbQYtVjmqpIODugN6PD2D9E+dJvdM=

+ 4 - 0
hack/config.yaml

@@ -0,0 +1,4 @@
+
+# CLI tool, only in development environment.
+# https://goframe.org/pages/viewpage.action?pageId=3673173
+gfcli:

BIN
image/123.jpg


BIN
image/default.jpg


+ 96 - 0
internal/app/code.go

@@ -0,0 +1,96 @@
+package app
+
+const (
+	SUCCESS        = 200
+	ERROR          = 500
+	INVALID_PARAMS = 400
+
+	ERROR_EXIST       = 10001
+	ERROR_EXIST_FAIL  = 10002
+	ERROR_NOT_EXIST   = 10003
+	ERROR_GET_S_FAIL  = 10004
+	ERROR_COUNT_FAIL  = 10005
+	ERROR_ADD_FAIL    = 10006
+	ERROR_EDIT_FAIL   = 10007
+	ERROR_DELETE_FAIL = 10008
+	ERROR_EXPORT_FAIL = 10009
+	ERROR_IMPORT_FAIL = 10010
+
+	ERROR_AUTH_CHECK_TOKEN_FAIL    = 20001
+	ERROR_AUTH_CHECK_TOKEN_TIMEOUT = 20002
+	ERROR_AUTH_TOKEN               = 20003
+	ERROR_AUTH                     = 20004
+
+	THROUGHOUt_THE_DAY_TO_END = 30001
+	RECALL                    = 30002
+)
+
+const (
+	StatusContinue           = 100 // RFC 7231, 6.2.1
+	StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2
+	StatusProcessing         = 102 // RFC 2518, 10.1
+	StatusEarlyHints         = 103 // RFC 8297
+
+	StatusOK                   = 200 // RFC 7231, 6.3.1
+	StatusCreated              = 201 // RFC 7231, 6.3.2
+	StatusAccepted             = 202 // RFC 7231, 6.3.3
+	StatusNonAuthoritativeInfo = 203 // RFC 7231, 6.3.4
+	StatusNoContent            = 204 // RFC 7231, 6.3.5
+	StatusResetContent         = 205 // RFC 7231, 6.3.6
+	StatusPartialContent       = 206 // RFC 7233, 4.1
+	StatusMultiStatus          = 207 // RFC 4918, 11.1
+	StatusAlreadyReported      = 208 // RFC 5842, 7.1
+	StatusIMUsed               = 226 // RFC 3229, 10.4.1
+
+	StatusMultipleChoices   = 300 // RFC 7231, 6.4.1
+	StatusMovedPermanently  = 301 // RFC 7231, 6.4.2
+	StatusFound             = 302 // RFC 7231, 6.4.3
+	StatusSeeOther          = 303 // RFC 7231, 6.4.4
+	StatusNotModified       = 304 // RFC 7232, 4.1
+	StatusUseProxy          = 305 // RFC 7231, 6.4.5
+	_                       = 306 // RFC 7231, 6.4.6 (Unused)
+	StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7
+	StatusPermanentRedirect = 308 // RFC 7538, 3
+
+	StatusBadRequest                   = 400 // RFC 7231, 6.5.1
+	StatusUnauthorized                 = 401 // RFC 7235, 3.1
+	StatusPaymentRequired              = 402 // RFC 7231, 6.5.2
+	StatusForbidden                    = 403 // RFC 7231, 6.5.3
+	StatusNotFound                     = 404 // RFC 7231, 6.5.4
+	StatusMethodNotAllowed             = 405 // RFC 7231, 6.5.5
+	StatusNotAcceptable                = 406 // RFC 7231, 6.5.6
+	StatusProxyAuthRequired            = 407 // RFC 7235, 3.2
+	StatusRequestTimeout               = 408 // RFC 7231, 6.5.7
+	StatusConflict                     = 409 // RFC 7231, 6.5.8
+	StatusGone                         = 410 // RFC 7231, 6.5.9
+	StatusLengthRequired               = 411 // RFC 7231, 6.5.10
+	StatusPreconditionFailed           = 412 // RFC 7232, 4.2
+	StatusRequestEntityTooLarge        = 413 // RFC 7231, 6.5.11
+	StatusRequestURITooLong            = 414 // RFC 7231, 6.5.12
+	StatusUnsupportedMediaType         = 415 // RFC 7231, 6.5.13
+	StatusRequestedRangeNotSatisfiable = 416 // RFC 7233, 4.4
+	StatusExpectationFailed            = 417 // RFC 7231, 6.5.14
+	StatusTeapot                       = 418 // RFC 7168, 2.3.3
+	StatusMisdirectedRequest           = 421 // RFC 7540, 9.1.2
+	StatusUnprocessableEntity          = 422 // RFC 4918, 11.2
+	StatusLocked                       = 423 // RFC 4918, 11.3
+	StatusFailedDependency             = 424 // RFC 4918, 11.4
+	StatusTooEarly                     = 425 // RFC 8470, 5.2.
+	StatusUpgradeRequired              = 426 // RFC 7231, 6.5.15
+	StatusPreconditionRequired         = 428 // RFC 6585, 3
+	StatusTooManyRequests              = 429 // RFC 6585, 4
+	StatusRequestHeaderFieldsTooLarge  = 431 // RFC 6585, 5
+	StatusUnavailableForLegalReasons   = 451 // RFC 7725, 3
+
+	StatusInternalServerError           = 500 // RFC 7231, 6.6.1
+	StatusNotImplemented                = 501 // RFC 7231, 6.6.2
+	StatusBadGateway                    = 502 // RFC 7231, 6.6.3
+	StatusServiceUnavailable            = 503 // RFC 7231, 6.6.4
+	StatusGatewayTimeout                = 504 // RFC 7231, 6.6.5
+	StatusHTTPVersionNotSupported       = 505 // RFC 7231, 6.6.6
+	StatusVariantAlsoNegotiates         = 506 // RFC 2295, 8.1
+	StatusInsufficientStorage           = 507 // RFC 4918, 11.5
+	StatusLoopDetected                  = 508 // RFC 5842, 7.2
+	StatusNotExtended                   = 510 // RFC 2774, 7
+	StatusNetworkAuthenticationRequired = 511 // RFC 6585, 6
+)

+ 34 - 0
internal/app/msg.go

@@ -0,0 +1,34 @@
+package app
+
+var MsgFlags = map[int]string{
+	SUCCESS:        "ok",
+	ERROR:          "fail",
+	RECALL:         "recall",
+	INVALID_PARAMS: "请求参数错误",
+
+	ERROR_EXIST:       "已存在该对象名称",
+	ERROR_EXIST_FAIL:  "获取已存在对象失败",
+	ERROR_NOT_EXIST:   "该对象不存在",
+	ERROR_GET_S_FAIL:  "获取所有对象失败",
+	ERROR_COUNT_FAIL:  "统计对象失败",
+	ERROR_ADD_FAIL:    "新增对象失败",
+	ERROR_EDIT_FAIL:   "修改对象失败",
+	ERROR_DELETE_FAIL: "删除对象失败",
+	ERROR_EXPORT_FAIL: "导出对象失败",
+	ERROR_IMPORT_FAIL: "导入对象失败",
+
+	ERROR_AUTH_CHECK_TOKEN_FAIL:    "Token鉴权失败",
+	ERROR_AUTH_CHECK_TOKEN_TIMEOUT: "Token已超时",
+	ERROR_AUTH_TOKEN:               "Token生成失败",
+	ERROR_AUTH:                     "Token错误",
+	THROUGHOUt_THE_DAY_TO_END:      "全天结束",
+}
+
+func GetMsg(code int) string {
+	msg, ok := MsgFlags[code]
+	if ok {
+		return msg
+	}
+
+	return MsgFlags[ERROR]
+}

+ 18 - 0
internal/app/packed.go

@@ -0,0 +1,18 @@
+package app
+
+import (
+	"github.com/gogf/gf/v2/net/ghttp"
+)
+
+type Ghttp struct {
+	C *ghttp.Request
+}
+
+func (g *Ghttp) Response(httpCode, errCode int, data interface{}) {
+	g.C.Response.WriteJson(map[string]interface{}{
+		"code": httpCode,
+		"msg":  GetMsg(errCode),
+		"data": data,
+	})
+	return
+}

+ 127 - 0
internal/cmd/cmd.go

@@ -0,0 +1,127 @@
+package cmd
+
+import (
+	"context"
+	"demo/internal/controller"
+	"demo/internal/middleware/jwt"
+	"encoding/json"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/gogf/gf/v2/os/gcmd"
+	"github.com/siddontang/go/log"
+)
+
+var (
+	Main = gcmd.Command{
+		Name:  "main",
+		Usage: "main",
+		Brief: "start http server",
+		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
+			s := g.Server()
+			s.BindStatusHandler(404, func(r *ghttp.Request) {
+				r.Response.Writeln("This is customized 404 page")
+			})
+			s.SetIndexFolder(true)
+			//s.SetServerRoot("")
+			//s.SetIndexFiles([]string{"data/index.html"})
+			s.AddSearchPath("dist")
+			s.AddSearchPath("")
+			s.Use(MiddlewareErrorHandler)
+			s.Use(MiddlewareCORS)
+			s.Group("/", func(group *ghttp.RouterGroup) {
+				group.Middleware(MiddlewareCORS)
+				group.Middleware(ghttp.MiddlewareHandlerResponse)
+				group.POST("/auth", controller.Auth)
+
+				group.ALL("/download", func(r *ghttp.Request) {
+					r.Response.ServeFileDownload("file/" + r.Get("filename").String())
+				})
+			})
+
+			//s.BindHandler("/download", func(r *ghttp.Request) {
+			//	r.Response.ServeFileDownload("file/" + r.Get("filename").String())
+			//})
+			s.Group("/", func(group *ghttp.RouterGroup) {
+				group.Middleware(ghttp.MiddlewareHandlerResponse)
+				group.Middleware(MiddlewareCORS)
+				group.Middleware(jwt.JWT)
+
+				//脖环清单
+				group.GET("/ring/listing", controller.GetNeckRingListing)
+				//group.POST("/ring/listing", controller.AddNeckRingListing)
+
+				//接收器管理
+				group.GET("/receiver/list", controller.GetReceiver)
+				group.POST("/receiver/add", controller.AddReceiver)
+				group.POST("/receiver/edit", controller.EditReceiver)
+
+				//sim卡管理
+				group.GET("/sim/list", controller.GetSim)
+				group.POST("/sim/add", controller.AddSim)
+				group.POST("/sim/edit", controller.EditSim)
+
+				//脖环出厂登记
+				group.POST("/factory/add", controller.AddFactory)
+				group.GET("/factory/list", controller.GetFactory)
+
+				//脖环召回记录
+				group.POST("/recall/add", controller.AddRecall)
+				group.GET("/recall/list", controller.GetRecall)
+
+				//脖环管理
+				group.GET("/management/list", controller.GetManagement)
+				group.POST("/management/add", controller.AddManagement)
+				group.GET("/managementbh/list", controller.GetManagementBh)
+				//group.GET("/usetj", controller.GetUseTj)
+
+				//图片查看
+				group.GET("/image", controller.GetImage)
+				//图片上传
+				group.POST("/housephy/image", controller.UploadImage)
+				//查看接收器坐标
+				group.GET("/receiver/coordinates", controller.GetReceiverInfo)
+				group.POST("/receiver/coordinates/edit", controller.EditReceiverCoordinates)
+
+				//公共接口
+				group.GET("/public/bar", controller.GetBarList)
+				group.GET("/public/pasture", controller.GetPastureList)
+				group.GET("/public/housephy", controller.GetHousephyList)
+				group.GET("/sim/pull", controller.GetSimPull)
+				group.GET("/receiver/pull", controller.GetReceiverPull)
+
+				//权限等接口
+				group.POST("/authdata/GetDataByNames", controller.GetDataByNames)
+				group.POST("/authdata/GetRecuDataByName", controller.GetRecuDataByName)
+				group.GET("/authdata/userinfo", controller.GetUserInfo)
+				group.POST("/authdata/ExecDataByConfig", controller.ExecDataByConfig)
+				group.POST("/authdata/GetDataByName", controller.GetDataByName)
+				group.POST("/authdata/PostDataByName", controller.PostDataByName)
+				group.POST("/authdata/logout", controller.UserLogout)
+
+			})
+
+			conf, _ := g.Cfg().Get(context.Background(), "server")
+			port, _ := conf.Map()["address"].(json.Number).Int64()
+			s.SetPort(int(port))
+			s.Run()
+			return nil
+		},
+	}
+)
+
+func MiddlewareErrorHandler(r *ghttp.Request) {
+	r.Middleware.Next()
+	if err := r.GetError(); err != nil {
+		// 记录到自定义错误日志文件
+		g.Log("exception").Error(context.Background(), err)
+		//返回固定的友好信息
+		r.Response.ClearBuffer()
+		r.Response.Writeln("服务器居然开小差了,请稍后再试吧!")
+	}
+}
+
+func MiddlewareCORS(r *ghttp.Request) {
+	log.Info(r.Router.Method, "  ", r.Router.Uri)
+	r.Response.CORSDefault()
+	r.Middleware.Next()
+}

+ 1 - 0
internal/consts/consts.go

@@ -0,0 +1 @@
+package consts

+ 65 - 0
internal/controller/auth.go

@@ -0,0 +1,65 @@
+package controller
+
+import (
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/util"
+	"fmt"
+	"github.com/astaxie/beego/validation"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/siddontang/go/log"
+	"net/http"
+)
+
+func Auth(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	var reqInfo v1.Auth
+	err := appG.C.Parse(&reqInfo)
+
+	valid := validation.Validation{}
+	valid.MaxSize(reqInfo.Username, 100, "username").Message("最长为100字符")
+	valid.MaxSize(reqInfo.Password, 100, "password").Message("最长为100字符")
+
+	if valid.HasErrors() {
+		log.Error(valid.Errors)
+		appG.Response(http.StatusInternalServerError, app.ERROR_ADD_FAIL, valid.Errors)
+		return
+	}
+	isExist, err := srv.CheckUser(reqInfo.Username, reqInfo.Password)
+	if err != nil {
+		log.Error(err)
+		appG.Response(http.StatusInternalServerError, app.ERROR_AUTH_CHECK_TOKEN_FAIL, err)
+		return
+	}
+
+	if !isExist {
+		appG.Response(http.StatusOK, app.ERROR_AUTH, "用户名或密码错误")
+		return
+	}
+
+	token, err := util.GenerateToken(reqInfo.Username, reqInfo.Password)
+	if err != nil {
+		appG.Response(http.StatusInternalServerError, app.ERROR_AUTH_TOKEN, err)
+		return
+	}
+
+	appG.Response(http.StatusOK, app.SUCCESS, map[string]string{
+		"token": token,
+	})
+}
+
+func GetUserInfo(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	data := srv.GetUserInfo(r.Context().Value("jwt_username").(string))
+	fmt.Println(r.Get("jwt_username").String())
+	appG.Response(http.StatusOK, app.SUCCESS, data)
+}
+
+func UserLogout(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	data := make(map[string]interface{})
+	data["name"] = ""
+	data["avatar"] = ""
+	data["introduction"] = ""
+	appG.Response(http.StatusOK, app.SUCCESS, data)
+}

+ 9 - 0
internal/controller/controller.go

@@ -0,0 +1,9 @@
+package controller
+
+import "demo/internal/dao"
+
+var srv *dao.Dao
+
+func RegisterDb() {
+	srv = dao.New()
+}

+ 554 - 0
internal/controller/db.go

@@ -0,0 +1,554 @@
+package controller
+
+import (
+	"demo/internal/app"
+	"demo/internal/setting"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/siddontang/go/log"
+	"io/ioutil"
+	"net/http"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func GetDataByName(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	sqlnamestr := r.Get("name").String()
+	offset := r.Get("offset").Int()
+	pagecount := r.Get("pagecount").Int()
+	returntype := r.Get("returntype").String()
+
+	//tx := restful.Engine.NewSession()
+	//err := tx.Begin()
+	//defer func() {
+	//	switch {
+	//	case err != nil:
+	//		logging.Error("tx.Begin 事务启动失败__error:", err)
+	//		if tx != nil {
+	//			tx.Rollback()
+	//		}
+	//	default:
+	//		if tx != nil {
+	//			err = tx.Commit()
+	//		}
+	//	}
+	//	if tx != nil {
+	//		tx.Close()
+	//	}
+	//}()
+
+	sql, p, err := srv.GetSqlByNameDBT(sqlnamestr)
+	if err != nil {
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	if sql != "" {
+		s_params := make([]interface{}, 0)
+		if !r.Get("parammaps").IsEmpty() {
+			parammaps := r.Get("parammaps").Map()
+
+			paramslist := strings.Split(p, ",")
+			if len(paramslist) > 0 && p != "" {
+				for _, value := range paramslist {
+					if strings.ToLower(strings.Trim(value, " ")) == "jwt_username" {
+						//if parammaps["jwt_username"] != nil {
+						s_params = append(s_params, r.Context().Value("jwt_username"))
+						//} else {
+						//	s_params = append(s_params, "")
+						//}
+					} else {
+						if parammaps[strings.Trim(value, " ")] == nil {
+							s_params = append(s_params, "")
+						} else {
+							s_params = append(s_params, parammaps[strings.Trim(value, " ")])
+						}
+
+					}
+				}
+			}
+		} else if !r.Get("params").IsEmpty() {
+			params := r.Get("params").Array()
+			//logging.Info("GetDataByName", c.Keys, c.Request.RemoteAddr, sqlnamestr, params)
+			for _, v_params := range params {
+				s_params = append(s_params, v_params)
+			}
+		}
+
+		queryData, err := getDataBySqlT(sql, offset, pagecount, returntype, s_params)
+		if err != nil {
+			log.Error("GetDataByName  err: ", err)
+			appG.Response(http.StatusOK, app.ERROR, err)
+		} else {
+			appG.Response(http.StatusOK, app.SUCCESS, queryData)
+		}
+
+	} else {
+		appG.Response(http.StatusOK, app.SUCCESS, nil)
+	}
+}
+
+func getDataBySqlT(sqlstr string, offset, pagecount int, returntype string, params []interface{}) (interface{}, error) {
+	//if offset > 0 {
+	//	offset = offset - 1
+	//}
+	//if pagecount == 0 {
+	//	pagecount = setting.AppSetting.PageSize
+	//}else if pagecount>setting.AppSetting.PageSize{
+	//	pagecount = setting.AppSetting.PageSize
+	//}
+	if returntype == "list" {
+		queryData, err := srv.QueryByListT(sqlstr, offset, pagecount, params)
+		return queryData, err
+	} else if returntype == "listlist" {
+		queryData, err := srv.QueryByListListT(sqlstr, offset, pagecount, params)
+		return queryData, err
+	} else {
+		fmt.Println(params)
+		queryData, err := srv.QueryByMapT(sqlstr, offset, pagecount, params)
+		return queryData, err
+	}
+}
+
+func ExecDataByConfig(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	dataByte, _ := ioutil.ReadAll(r.Request.Body)
+	tempval_ := make(map[string]interface{})
+	tempCommon := make(map[string]interface{})
+	tempval := make([]map[string]interface{}, 0)
+	err := json.Unmarshal(dataByte, &tempval_)
+	//logging.Info("ExecDataByConfig ", c.Keys, c.Request.RemoteAddr, tempval_["common"], tempval_["data"])
+	// fmt.Println("ExecDataByConfig ", c.Keys, c.Request.RemoteAddr, tempval_["common"], tempval_["data"])
+	if err != nil {
+	} else {
+		if v, ok := tempval_["common"].(map[string]interface{}); ok {
+			tempCommon = v
+		}
+
+		if v, ok := tempval_["data"].([]interface{}); ok {
+			for _, Tvalue := range v {
+				if v1, ok := Tvalue.(map[string]interface{}); ok {
+					tempval = append(tempval, v1)
+				}
+			}
+		}
+
+		if err == nil {
+			if r.Get("jwt_username").String() != "" {
+				tempCommon["jwt_username"] = r.Get("jwt_username").String()
+			}
+
+			for _, paramvalue := range tempval {
+				if _, ok := paramvalue["resultname"]; !ok {
+					paramvalue["resultname"] = paramvalue["name"]
+				}
+				_, err = ExecDataParam(paramvalue, tempCommon, tempval, nil, nil)
+				if err != nil {
+					log.Error("ExecDataParam error:", err)
+					break
+				}
+			}
+			if err == nil {
+				if tempCommon["returnmap"] != nil && tempCommon["returnmap"] != "" {
+					appG.Response(http.StatusOK, app.SUCCESS, tempval)
+				} else {
+					appG.Response(http.StatusOK, app.SUCCESS, "成功执行!")
+				}
+			} else {
+				appG.Response(http.StatusOK, app.ERROR, err)
+				//appG.Response(http.StatusOK, e.ERROR, err.Error())
+			}
+		}
+	}
+	if err != nil {
+		appG.Response(http.StatusOK, app.ERROR, err)
+		//appG.Response(http.StatusOK, e.ERROR, err.Error())
+	}
+}
+
+func ExecDataParam(fasion map[string]interface{}, CommonParamMap map[string]interface{}, ParamMap []map[string]interface{}, ParentParamMap map[string]interface{}, sameParamMap []map[string]interface{}) ([]map[string]interface{}, error) {
+	sqlname := fasion["name"].(string)
+	sqltype := "" //v  校验/s1 查询/sm 查询/e  执行
+	if v, ok := fasion["type"]; ok {
+		sqltype = v.(string)
+	}
+	sql := ""
+	p := ""
+	var err error
+	s_params := make([]interface{}, 0)
+	if sqltype != "" {
+		sql, p, err = srv.GetSqlByNameDBT(sqlname)
+		if err != nil {
+			return nil, err
+		}
+		//sqlApi, _ := models.GetApisqlByName(sqlname)
+		if v, ok := fasion["parammaps"].(map[string]interface{}); ok {
+			paramslist := strings.Split(p, ",")
+			if len(paramslist) > 0 && p != "" {
+				for _, value := range paramslist {
+					ss := ""
+					if strings.ToLower(strings.Trim(value, " ")) == "snowid" {
+						//ids, err := setting.SnowIds.NextId()
+						//if err != nil {
+						ids := time.Now().UnixNano()
+						log.Info("create SnowIds err", err)
+						//}
+						s_params = append(s_params, ids)
+					} else {
+						if ss == "" && CommonParamMap != nil {
+							if valuestring, ok := v[strings.Trim(value, " ")].(string); ok {
+								ss = valuestring
+								tempstrb := strings.IndexAny(valuestring, "@")
+								tempstre := strings.IndexAny(valuestring, ".")
+								if (tempstre > tempstrb) && (strings.ToLower(valuestring[tempstrb+1:tempstre]) == "common") {
+									if CommonParamMap[valuestring[tempstre+1:]] != nil {
+										ss = CommonParamMap[valuestring[tempstre+1:]].(string)
+									}
+								} else {
+									ss = ""
+								}
+							}
+
+						}
+
+						if ss == "" && ParentParamMap != nil {
+							ss = getParamValue_(v, value, ParentParamMap)
+						}
+						if ss == "" && sameParamMap != nil {
+							ss = getParamValue(v, value, sameParamMap)
+						}
+						if ss == "" && ParamMap != nil {
+							ss = getParamValue(v, value, ParamMap)
+						}
+						s_params = append(s_params, ss)
+					}
+
+				}
+			}
+
+		}
+	}
+	if sql == "" {
+		sqltype = ""
+	}
+
+	if sqltype == "s1" {
+		tempValParam, err := srv.QueryByMap(sql, 0, 1, s_params)
+		if v, ok := tempValParam.(map[string]interface{}); ok {
+			fasion["resultmaps"] = v["list"].([]map[string]interface{})
+		}
+		if err != nil {
+			return nil, err
+		}
+		err = ExitsChildrenParam(fasion, tempValParam, ParamMap, CommonParamMap)
+		if err != nil {
+			return nil, err
+		}
+		return tempValParam.(map[string]interface{})["list"].([]map[string]interface{}), err
+	} else if sqltype == "sm" {
+		tempValParam, err := srv.QueryByMap(sql, 0, 0, s_params)
+		if v, ok := tempValParam.(map[string]interface{}); ok {
+			fasion["resultmaps"] = v["list"].([]map[string]interface{})
+		} else {
+
+		}
+
+		if err != nil {
+			return nil, err
+		}
+		err = ExitsChildrenParam(fasion, tempValParam, ParamMap, CommonParamMap)
+		if err != nil {
+			return nil, err
+		}
+		return tempValParam.(map[string]interface{})["list"].([]map[string]interface{}), err
+
+	} else if sqltype == "v" {
+		tempValParam, err := srv.QueryByMap(sql, 0, 1, s_params)
+		if v, ok := tempValParam.(map[string]interface{}); ok {
+			fasion["resultmaps"] = v["list"].([]map[string]interface{})
+		} else {
+
+		}
+		if err != nil {
+			return nil, err
+		}
+		if tempValParam.(map[string]interface{})["list"].([]map[string]interface{})[0]["vmsg"] != "" {
+			return nil, errors.New(tempValParam.(map[string]interface{})["list"].([]map[string]interface{})[0]["vmsg"].(string))
+		}
+	} else if sqltype == "e" {
+		tempVal_arrary := make([]map[string]interface{}, 0)
+		tempVal_map := make(map[string]interface{})
+		tempValParam, err := srv.ExecQueryT(sql, s_params)
+		if err == nil {
+			fasion["resultmaps"] = tempValParam.(map[string]interface{})
+			tempVal_map["result"] = tempValParam.(map[string]interface{})["result"]
+			tempVal_map["LastInsertId"] = tempValParam.(map[string]interface{})["LastInsertId"]
+			tempVal_arrary = append(tempVal_arrary, tempVal_map)
+			return tempVal_arrary, err
+		}
+		return nil, err
+	} else {
+		if tempValParam, ok := fasion["resultmaps"].(map[string]interface{}); ok {
+			err := ExitsChildrenParam(fasion, tempValParam, ParamMap, CommonParamMap)
+			if err != nil {
+				return nil, err
+			}
+			return nil, err
+		}
+	}
+	return nil, nil
+}
+
+func getParamValue_(parammaps map[string]interface{}, value string, ParamMap map[string]interface{}) string {
+	if valuestring, ok := parammaps[strings.Trim(value, " ")].(string); ok {
+		tempstrb := strings.IndexAny(valuestring, "@")
+		tempstre := strings.IndexAny(valuestring, ".")
+		if tempstrb > -1 && tempstre > -1 {
+			if v, ok := ParamMap[valuestring[tempstre+1:]]; ok {
+				if s, ok := v.(string); ok {
+					return s
+				} else if s, ok := v.(float64); ok {
+
+					return strconv.FormatFloat(s, 'f', -1, 64)
+					// return strconv.FormatInt(int64(s), 10)
+				}
+			}
+		}
+	}
+
+	return ""
+}
+
+func getParamValue(parammaps map[string]interface{}, value string, ParamMap []map[string]interface{}) string {
+
+	if valuestring, ok := parammaps[strings.Trim(value, " ")].(string); ok {
+
+		tempstrb := strings.IndexAny(valuestring, "@")
+		tempstre := strings.IndexAny(valuestring, ".")
+		if tempstrb > -1 && tempstre > -1 {
+			for _, ParamMapList := range ParamMap {
+				if v, ok := ParamMapList["resultname"]; ok {
+					if v == valuestring[tempstrb+1:tempstre] {
+						if v1, ok := ParamMapList["resultmaps"]; ok {
+							if newA, ok := v1.([]map[string]interface{}); ok {
+								return interfacetostring(newA[0][valuestring[tempstre+1:]])
+							} else if newA, ok := v1.(map[string]interface{}); ok {
+								return interfacetostring(newA[valuestring[tempstre+1:]])
+							}
+
+						}
+					}
+				}
+			}
+		} else {
+			return valuestring
+		}
+	} else if valuestring, ok := parammaps[strings.Trim(value, " ")].(float64); ok {
+		return strconv.FormatInt(int64(valuestring), 10)
+	}
+	return ""
+}
+
+func interfacetostring(val interface{}) string {
+	switch val.(type) {
+	case string:
+		ss := val.(string)
+		return ss
+		break
+	case int:
+		ss := val.(int)
+		return strconv.Itoa(ss)
+		break
+	case int64:
+		ss := val.(int64)
+		return strconv.FormatInt(ss, 10)
+		break
+	case float64:
+		ss := val.(float64)
+		return strconv.FormatFloat(ss, 'E', -1, 32)
+		break
+	}
+	return ""
+}
+
+func ExitsChildrenParam(fasion map[string]interface{}, tempValParam interface{}, ParamMap []map[string]interface{}, commonParam map[string]interface{}) error {
+	var err error
+	subarray, ok := fasion["children"]
+
+	if ok {
+		for _, v := range tempValParam.(map[string]interface{})["list"].([]interface{}) { //遍历父集有多少行数据
+			tempVal_arrary := make([]map[string]interface{}, 0)
+			for _, subarrayvalue := range subarray.([]interface{}) { //遍历所有执行命令
+				tempVal_ := make(map[string]interface{})
+				if _, ok := subarrayvalue.(map[string]interface{})["resultname"]; !ok {
+					tempVal_["resultname"] = subarrayvalue.(map[string]interface{})["name"]
+				} else {
+					tempVal_["resultname"] = subarrayvalue.(map[string]interface{})["resultname"]
+				}
+				tempVal_["resultmaps"], err = ExecDataParam(subarrayvalue.(map[string]interface{}), commonParam, ParamMap, v.(map[string]interface{}), tempVal_arrary) //递归调用执行
+
+				if err != nil {
+					return err
+				}
+				tempVal_arrary = append(tempVal_arrary, tempVal_)
+			}
+			v.(map[string]interface{})["children"] = tempVal_arrary
+		}
+	}
+	return nil
+}
+
+func PostDataByName(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	//dataByte, _ := ioutil.ReadAll(c.Request.Body)
+	//fsion := gofasion.NewFasion(string(dataByte))
+	sqlnamestr := r.Get("name").String()
+
+	s_params := make([]interface{}, 0)
+
+	sql, p, err := srv.GetSqlByNameDBT(sqlnamestr)
+	if err != nil {
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	if sql != "" {
+		if !r.Get("parammaps").IsEmpty() {
+			parammaps := r.Get("parammaps").Map()
+			//logging.Info("PostDataByName ", c.Keys, c.Request.RemoteAddr, sqlnamestr, parammaps.ValueStr())
+			paramslist := strings.Split(p, ",")
+			if len(paramslist) > 0 && p != "" {
+				for _, value := range paramslist {
+					if strings.ToLower(strings.Trim(value, " ")) == "jwt_username" {
+						if r.Get("jwt_username").String() != "" {
+							s_params = append(s_params, r.Get("jwt_username").String())
+						} else {
+							s_params = append(s_params, "")
+						}
+					} else if strings.ToLower(strings.Trim(value, " ")) == "snowid" {
+						ids, err := setting.SnowIds.NextId()
+						if err != nil {
+							ids = time.Now().UnixNano()
+							//logging.Info("create SnowIds err", err)
+						}
+						s_params = append(s_params, ids)
+					} else {
+						if parammaps[strings.Trim(value, " ")] == nil {
+							s_params = append(s_params, "")
+						} else {
+							s_params = append(s_params, parammaps[strings.Trim(value, " ")])
+						}
+
+					}
+				}
+			}
+		} else if !r.Get("params").IsEmpty() {
+			params := r.Get("params").Array()
+			for _, v_params := range params {
+				s_params = append(s_params, v_params)
+			}
+		}
+		queryData, err := execDataBySqlT(sql, s_params)
+		if err != nil {
+			log.Error("PostDataByName  err: ", err)
+		} else {
+			appG.Response(http.StatusOK, app.SUCCESS, queryData)
+		}
+	} else {
+		appG.Response(http.StatusOK, app.SUCCESS, nil)
+	}
+}
+
+func execDataBySqlT(sqlstr string, params []interface{}) (interface{}, error) {
+	queryData, err := srv.ExecQueryT(sqlstr, params)
+	return queryData, err
+}
+
+func GetRecuDataByName(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	//dataByte, _ := ioutil.ReadAll(c.Request.Body)
+	//fsion := gofasion.NewFasion(string(dataByte))
+	sqlnamestr := r.Get("name").String()
+	parentidname := r.Get("idname").String()
+	sql, p := srv.GetSqlByNameDB(sqlnamestr)
+	params := make(map[string]interface{})
+	s_params := make([]interface{}, 0)
+	if !r.Get("params").IsEmpty() {
+		for _, v_params := range r.Get("params").Array() {
+			s_params = append(s_params, v_params)
+		}
+		params["params"] = s_params
+
+	} else {
+		jparams := r.Get("parammaps").Map()
+		paramslist := strings.Split(p, ",")
+		if len(paramslist) > 0 && p != "" {
+			for _, value := range paramslist {
+				if strings.ToLower(strings.Trim(value, " ")) == "jwt_username" {
+					if r.Get("jwt_username").String() != "" {
+						params[value] = r.Get("jwt_username").String()
+					} else {
+						params[value] = ""
+					}
+				} else {
+					params[value] = jparams[strings.Trim(value, " ")]
+				}
+			}
+
+		}
+	}
+	queryData, err := GetRecuData_BySql(sql, p, parentidname, params, !r.Get("params").IsEmpty())
+	//logging.Info("sqlname parammaps", c.Keys, c.Request.RemoteAddr, sqlnamestr, params)
+	if err != nil {
+		appG.Response(http.StatusOK, app.ERROR, err.Error())
+	}
+	appG.Response(http.StatusOK, app.SUCCESS, queryData)
+}
+
+func GetRecuData_BySql(sql string, Params string, idname string, thisParams map[string]interface{}, isList bool) (interface{}, error) {
+	paramslist := strings.Split(Params, ",")
+	s_params := make([]interface{}, 0)
+	if isList {
+		for _, v_params := range thisParams["params"].([]interface{}) {
+			s_params = append(s_params, v_params)
+		}
+	} else {
+		paramslist := strings.Split(Params, ",")
+		if len(paramslist) > 0 && Params != "" {
+			for _, value := range paramslist {
+				s_params = append(s_params, thisParams[strings.Trim(value, " ")])
+			}
+		}
+	}
+	queryData, err := srv.QueryByMapMenu(sql, 0, 0, s_params)
+	for _, queryData_ := range queryData {
+		if v, ok := queryData_["haschildren"]; (ok && v.(int64) > 0) || !ok {
+			if isList {
+				//fmt.Println(idname, "--------------             -queryData_[idname]", queryData_)
+				if queryData_[idname] != nil {
+					thisParams["params"].([]interface{})[len(thisParams["params"].([]interface{}))-1] = queryData_[idname].(interface{})
+				}
+
+			} else {
+				if queryData_[idname] != nil {
+					thisParams[idname] = queryData_[idname].(interface{})
+				}
+				if len(paramslist) > 0 && Params != "" {
+					s_params = make([]interface{}, 0)
+					for _, value := range paramslist {
+						s_params = append(s_params, thisParams[strings.Trim(value, " ")])
+					}
+				}
+			}
+			queryData_["children"], _ = GetRecuData_BySql(sql, Params, idname, thisParams, isList)
+		} else {
+
+		}
+	}
+	return queryData, err
+}

+ 104 - 0
internal/controller/factory.go

@@ -0,0 +1,104 @@
+package controller
+
+import (
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/model"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"time"
+)
+
+// AddFactory
+// @Summary 脖环出厂登记添加
+// @Description add by json account
+// @Tags 脖环出厂登记
+// @Accept  json
+// @Produce  json
+// @Param account body v1.AddFactoryReq true "Add account"
+// @Router /factory/add [post]
+func AddFactory(r *ghttp.Request) {
+	var req *v1.AddFactoryReq
+	username := r.Context().Value("jwt_username")
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "AddFactory-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	go func() {
+		err = srv.AddFactory(model.Factory{
+			Pastureid:  req.Pastureid,
+			Count:      req.Count,
+			Genre:      req.Genre,
+			Recall:     int64(len(req.RecallID)),
+			CreateName: username.(string),
+			CreateTime: time.Now(),
+		}, req.RecallID)
+		if err != nil {
+			return
+		}
+	}()
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+// GetFactory
+// @Summary 脖环出厂登记查看
+// @Description add by json account
+// @Tags 脖环出厂登记
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param batch path string true "string 批次"
+// @Param genre path int true "string 0 购买,1 置换  -1 全部"
+// @Param startcount path string true "string 数量"
+// @Param endcount path string true "string 数量"
+// @Param createname path string true "string 登记人"
+// @Param startdate path string true "string 登记时间"
+// @Param enddate path string true "string 登记时间"
+// @Param recallid path int true "string 查看关联出厂批次"
+// @Success 200 {object} v1.GetFactoryRes
+// @Router /factory/list [get]
+func GetFactory(r *ghttp.Request) {
+	var req *v1.GetFactoryReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	respList, count, err := srv.GetFactory(req.Index, req.PageSize, req.Pastureid, req.Batch, req.Genre, req.StartCount, req.EndCount, req.CreateName, req.StartDate, req.EndDate, req.RecallID)
+	if err != nil {
+		return
+	}
+
+	resp := v1.GetFactoryRes{}
+	dataList := make([]*v1.Factory, 0)
+	for _, item := range respList {
+		var data v1.Factory
+		data.Id = item.Id
+		data.PastureId = item.Pastureid
+		data.Count = item.Count
+		data.Batch = item.Batch
+		data.Genre = item.Genre
+		data.Recall = item.Recall
+		data.CreateName = item.CreateName
+		data.PastureName = item.PastureName
+		if !item.CreateTime.IsZero() {
+			data.CreateTime = item.CreateTime.Format("2006-01-02")
+		}
+		dataList = append(dataList, &data)
+	}
+
+	resp.List = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}

+ 194 - 0
internal/controller/management.go

@@ -0,0 +1,194 @@
+package controller
+
+import (
+	"strings"
+	"time"
+
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/model"
+
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"github.com/xuri/excelize/v2"
+)
+
+// AddManagement
+// @Summary 脖环管理导入
+// @Description add by json account
+// @Tags 脖环管理
+// @Accept  json
+// @Produce  json
+// @Router /management/add [post]
+func AddManagement(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+
+	pastureidStr := r.FormValue("pastureid")
+	file, _, err := r.FormFile("file")
+	if err != nil {
+		err = errors.Wrap(err, "AddManagement-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	xlsx1, err := excelize.OpenReader(file)
+	rows, _ := xlsx1.GetRows("sheet")
+
+	managementBhList := make([]*model.ManagementBh, 0)
+
+	timeLayout := "2006-01-02"
+	var genreStr string
+	var genre int64
+
+	for i, r := range rows {
+		var exist bool
+		if i > 0 {
+			var arg model.ManagementBh
+			if genreStr == "" {
+				genreStr = r[2]
+			} else if genreStr != r[2] {
+				continue
+			}
+			arg.Code = r[0]
+			if r[1] == "" {
+				continue
+			}
+			date, _ := time.Parse(timeLayout, r[1])
+			arg.Date = date
+			for _, management := range managementBhList {
+				if management.Code == arg.Code {
+					exist = true
+					continue
+				}
+			}
+			if !exist {
+				managementBhList = append(managementBhList, &arg)
+			}
+		}
+	}
+	//0 售卖,1 返厂 2 置换
+	if strings.Index(genreStr, "售卖") >= 0 {
+		genre = 0
+	} else if strings.Index(genreStr, "返厂") >= 0 {
+		genre = 1
+	} else if strings.Index(genreStr, "置换") >= 0 {
+		genre = 2
+	}
+
+	//pastureid, _ := strconv.ParseInt(pastureidStr, 10, 64)
+	err = srv.AddManagement(model.Management{
+		Pastureid:  pastureidStr,
+		ImportTime: time.Now(),
+		Genre:      genre,
+		Count:      int64(len(managementBhList)),
+	}, managementBhList)
+	if err != nil {
+		err = errors.Wrap(err, "AddManagement-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+// GetManagement
+// @Summary 脖环管理查看
+// @Description add by json account
+// @Tags 脖环管理
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param code path string true "string 脖环编码"
+// @Param status path string true "string 脖环状态"
+// @Param pastureid path string true "string 牧场id"
+// @Param genre path  int64 true "int64 0 售卖,1 返厂 2 置换  -1 全部"
+// @Param startdate path  string true "string 导入开始时间"
+// @Param enddate path  string true "string 导入结束时间"
+// @Success 200 {object} v1.GetManagementRes
+// @Router /management/list [get]
+func GetManagement(r *ghttp.Request) {
+	var req *v1.GetManagementReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	managementList, count, err := srv.GetManagement(req.Index, req.PageSize, req.PastureId, req.Genre, req.StartDate, req.EndDate)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	resp := v1.GetManagementRes{}
+	dataList := make([]*v1.Management, 0)
+	for _, item := range managementList {
+		var data v1.Management
+		data.Id = item.Id
+		data.Pastureid = item.Pastureid
+		data.Count = item.Count
+		data.Genre = item.Genre
+		data.Recall = item.Recall
+		if !item.ImportTime.IsZero() {
+			data.ImportTime = item.ImportTime.Format("2006-01-02 15:04:05")
+		}
+		data.PastureName = item.PastureName
+		dataList = append(dataList, &data)
+	}
+
+	resp.Total = count
+	resp.List = dataList
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+// GetManagementBh
+// @Summary 脖环管理明细查看
+// @Description add by json account
+// @Tags 脖环管理
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param managementid path int true "int "
+// @Success 200 {object} v1.GetManagementBhRes
+// @Router /managementbh/list [get]
+func GetManagementBh(r *ghttp.Request) {
+	var req *v1.GetManagementBhReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	managementList, count, err := srv.GetManagementBh(req.Index, req.PageSize, req.ManagementId)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	resp := v1.GetManagementBhRes{}
+	dataList := make([]*v1.ManagementBh, 0)
+	for _, item := range managementList {
+		var data v1.ManagementBh
+		data.ManagementID = item.ManagementID
+		data.Code = item.Code
+		if !item.Date.IsZero() {
+			data.Date = item.Date.Format("2006-01-02 15:04:05")
+		}
+		dataList = append(dataList, &data)
+	}
+	resp.Total = count
+	resp.List = dataList
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}

+ 149 - 0
internal/controller/neckringlisting.go

@@ -0,0 +1,149 @@
+package controller
+
+import (
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/model"
+	"strconv"
+	"sync"
+
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+)
+
+// GetNeckRingListing
+// @Summary 脖环清单查看
+// @Description add by json account
+// @Tags 脖环清单
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param code path string true "string 脖环编码"
+// @Param status path string true "string 脖环状态"
+// @Param cattle path int true "int 牛号"
+// @Param barname path string true "string 栏舍名称"
+// @Param purchasestart path  string true "string 购入开始日期"
+// @Param purchaseend path  string true "string 购入结束日期"
+// @Param manufacturestart path  string true "string 生产开始日期"
+// @Param manufactureend path  string true "string 生产结束日期"
+// @Param factoryid path  string true "string 出厂数量"
+// @Param recallid path  string true "string 召回"
+// @Success 200 {object} v1.GetNeckRingListingRes
+// @Router /ring/listing [get]
+func GetNeckRingListing(r *ghttp.Request) {
+	var req *v1.GetNeckRingListingReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	var wg sync.WaitGroup
+	//wg.Add(1)
+	housenameList := make([]map[string]string, 0)
+	//go func() {
+	//	defer wg.Done()
+	//
+	//}()
+
+	userList, count, err := srv.GetNeckRingListing(req.Index, req.PageSize, req.Code, req.BarName,
+		req.PurchaseStart, req.PurchaseEnd, req.ManufactureStart, req.ManufactureEnd, req.Status, req.Cattle, req.RecallID, req.FactoryID)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	//wg.Wait()
+
+	var codeList []string
+	for _, item := range userList {
+		code := strconv.FormatInt(item.Code, 10)
+		codeList = append(codeList, code)
+	}
+
+	housenameList, err = srv.GetHOUSENAME(codeList)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	for _, item := range userList {
+		wg.Add(1)
+		go func(item *model.NeckRingListingList) {
+			defer wg.Done()
+			for _, housename := range housenameList {
+				code := strconv.FormatInt(item.Code, 10)
+				if housename["REGIST_NUM_2"] == code && housename["FARM_UUID"] == item.Pastureid {
+					item.BarName = housename["HOUSE_NAME"]
+					item.Cattle = housename["COW_NUM"]
+				}
+			}
+		}(item)
+	}
+	wg.Wait()
+
+	resp := v1.GetNeckRingListingRes{}
+	dataList := make([]*v1.NeckRingListing, 0)
+	for _, item := range userList {
+		var data v1.NeckRingListing
+		data.Id = item.Id
+		//data.Name = item.Name
+		data.Code = item.Code
+		data.Status = item.Status
+		data.Cattle = item.Cattle
+		data.Batch = item.Batch
+		data.BarName = item.BarName
+		if !item.PurchaseDate.IsZero() {
+			data.PurchaseDate = item.PurchaseDate.Format("2006-01-02")
+		}
+		if !item.ManufactureDate.IsZero() {
+			data.ManufactureDate = item.ManufactureDate.Format("2006-01-02 15:04:05")
+		}
+		dataList = append(dataList, &data)
+	}
+
+	resp.Neckring = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+// AddNeckRingListing
+// @Summary 添加脖环
+// @Description add by json account
+// @Tags 脖环清单
+// @Accept  json
+// @Produce  json
+// @Param account body v1.AddNeckRingListingReq true "Add account"
+// @Router /ring/listing [post]
+//func AddNeckRingListing(r *ghttp.Request) {
+//	var req *v1.AddNeckRingListingReq
+//	appG := app.Ghttp{C: r}
+//	err := appG.C.Parse(&req)
+//	if err != nil {
+//		err = errors.Wrap(err, "GetNeckRingListing-error")
+//		log.Error(err)
+//		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+//		return
+//	}
+//
+//	err = srv.AddNeckRingListing(model.NeckRingListing{
+//		Name:            req.Name,
+//		Code:            req.Code,
+//		Status:          req.Status,
+//		Cattle:          req.Cattle,
+//		BarId:           req.BarId,
+//		BarName:         req.BarName,
+//		PurchaseDate:    req.PurchaseDate,
+//		ManufactureDate: req.ManufactureDate,
+//	})
+//	if err != nil {
+//		return
+//	}
+//	appG.Response(app.StatusOK, app.SUCCESS, true)
+//}

+ 297 - 0
internal/controller/public.go

@@ -0,0 +1,297 @@
+package controller
+
+import (
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/model"
+	"fmt"
+	"github.com/Anderson-Lu/gofasion/gofasion"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strings"
+)
+
+// GetBarList
+// @Summary 栏舍查看
+// @Description add by json account
+// @Tags 公共接口
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param barname path string true "string 栏舍名称"
+// @Param pastureid path  string true "string 牧场编码"
+// @Success 200 {object} v1.GetBarListRes
+// @Router /public/bar [get]
+func GetBarList(r *ghttp.Request) {
+	var req *v1.GetBarListReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	barList, count, err := srv.GetBarList(req.Index, req.PageSize, req.BarName, req.Pastureid)
+	if err != nil {
+		return
+	}
+	resp := v1.GetBarListRes{}
+	dataList := make([]*v1.BarList, 0)
+	for _, item := range barList {
+		var data v1.BarList
+		data.Id = item.Id
+		data.Pastureid = item.Pastureid
+		data.Bname = item.Bname
+		data.Bcode = item.Bcode
+		dataList = append(dataList, &data)
+	}
+
+	resp.List = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+// GetPastureList
+// @Summary 牧场信息查看
+// @Description add by json account
+// @Tags 公共接口
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Success 200 {object} v1.GetPastureListRes
+// @Router /public/pasture [get]
+func GetPastureList(r *ghttp.Request) {
+	var req *v1.GetPastureListReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetPastureList-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	pastureList, count, err := srv.GetPastureList(req.Index, req.PageSize)
+	if err != nil {
+		return
+	}
+	resp := v1.GetPastureListRes{}
+	dataList := make([]*v1.PastureList, 0)
+	for _, item := range pastureList {
+		var data v1.PastureList
+		data.PastureCode = item.PastureCode
+		data.Pastureid = item.Pastureid
+		data.PastureName = item.PastureName
+		dataList = append(dataList, &data)
+	}
+
+	resp.List = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+// GetHousephyList
+// @Summary 物理栏舍查看
+// @Description add by json account
+// @Tags 公共接口
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param pastureid path string true "string "
+// @Success 200 {object} v1.GetBarListRes
+// @Router /public/housephy [get]
+func GetHousephyList(r *ghttp.Request) {
+	var req *v1.GetBarListReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetHousephyList-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	barList, count, err := srv.GetHousephyList(req.Index, req.PageSize, req.Pastureid)
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	resp := v1.GetBarListRes{}
+	dataList := make([]*v1.BarList, 0)
+	for _, item := range barList {
+		var data v1.BarList
+		data.Id = item.Id
+		data.Pastureid = item.Pastureid
+		data.Bname = item.Bname
+		data.Bcode = item.Bcode
+		dataList = append(dataList, &data)
+	}
+
+	resp.List = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+// GetImage
+// @Summary 接收器图片查看
+// @Description add by json account
+// @Tags 接收器管理
+// @Accept  json
+// @Produce  json
+// @Param id path int true "int "
+// @Success 200 {object} v1.GetBarListRes
+// @Router /image [get]
+func GetImage(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+
+	id := r.Get("id").String()
+	housephy, err := srv.GetHousephyImage(id)
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	//file, err := os.Open(fmt.Sprintf("image/%s", housephy.Image))
+	//if err != nil {
+	//	fmt.Println(err)
+	//	return
+	//}
+	//
+	//f, _ := ioutil.ReadAll(file)
+	//r.Response.Writer.Write(f)
+	if housephy.Image != "" {
+		appG.Response(app.StatusOK, app.SUCCESS, fmt.Sprintf("image/%s", housephy.Image))
+	} else {
+		appG.Response(app.StatusOK, app.SUCCESS, nil)
+	}
+}
+
+// UploadImage
+// @Summary 上传接收器图片
+// @Description add by json account
+// @Tags 接收器管理
+// @Accept  json
+// @Produce  json
+// @Param id path int true "int "
+// @Router /housephy/image [post]
+func UploadImage(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	id := r.Get("id").String()
+	file := r.GetUploadFile("file")
+	os.Remove(fmt.Sprintf("image/%s", file.Filename))
+	_, err := file.Save("image")
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	housephy, err := srv.GetHousephyImage(id)
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	if housephy.Image != "" {
+		os.Remove(fmt.Sprintf("image/%s", housephy.Image))
+	}
+
+	err = srv.UpdateHousephyImage(&model.Housephy{Id: id, Image: file.Filename})
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+func GetDataByNames(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	dataByte, _ := ioutil.ReadAll(r.Request.Body)
+	fsion := gofasion.NewFasion(string(dataByte))
+	sqlParams := fsion.Array()
+	queryData := make(map[string]interface{})
+	for _, v := range sqlParams {
+		fsion2 := gofasion.NewFasion(v.Json())
+		//logging.Info("GetDataByNames", c.Keys, fsion2.Get("name").ValueStr(), c.Request.RemoteAddr)
+		fmt.Println(fsion2.Get("name").ValueStr())
+		sql, p := srv.GetSqlByNameDB(fsion2.Get("name").ValueStr())
+		if sql == "" {
+			errorm := make(map[string]interface{})
+			errorm["code"] = app.ERROR
+			errorm["message"] = "sql没找到"
+			queryData[fsion2.Get("name").ValueStr()] = errorm
+			continue
+		} else if sql != "" {
+			offset := fsion2.Get("offset").ValueInt()
+			pagecount := fsion2.Get("pagecount").ValueInt()
+			returntype := fsion2.Get("returntype").ValueStr()
+			s_params := make([]interface{}, 0)
+			if fsion2.HasKey("parammaps") {
+				parammaps := fsion2.Get("parammaps")
+				paramslist := strings.Split(p, ",")
+				if len(paramslist) > 0 && p != "" {
+					for _, value := range paramslist {
+						if strings.ToLower(strings.Trim(value, " ")) == "jwt_username" {
+							if r.Get("jwt_username").String() != "" {
+								s_params = append(s_params, r.Get("jwt_username").String())
+							} else {
+								s_params = append(s_params, "")
+							}
+						} else {
+							s_params = append(s_params, parammaps.Get(strings.Trim(value, " ")).ValueStr())
+						}
+					}
+				}
+			} else if fsion2.HasKey("params") {
+				params := fsion2.Get("params").Array()
+				for _, v_params := range params {
+					s_params = append(s_params, v_params.ValueStr())
+				}
+			}
+
+			queryData1, err := getDataBySql(sql, offset, pagecount, returntype, s_params)
+
+			if err != nil {
+				errorm := make(map[string]interface{})
+				errorm["code"] = app.ERROR
+				errorm["message"] = err
+				queryData[fsion2.Get("name").ValueStr()] = errorm
+				//logging.Error("GetDataByNames  err: ", err)
+				continue
+			} else {
+				queryData[fsion2.Get("name").ValueStr()] = queryData1
+			}
+		}
+	}
+	appG.Response(http.StatusOK, app.SUCCESS, queryData)
+}
+
+func getDataBySql(sqlstr string, offset, pagecount int, returntype string, params []interface{}) (interface{}, error) {
+	if offset > 0 {
+		offset = offset - 1
+	}
+	//if pagecount == 0 {
+	//	pagecount = setting.AppSetting.PageSize
+	//}else if pagecount>setting.AppSetting.PageSize{
+	//	pagecount = setting.AppSetting.PageSize
+	//}
+	if returntype == "list" {
+		//queryData, err := srv.QueryByList(sqlstr, offset, pagecount, params)
+		//return queryData, err
+	} else if returntype == "listlist" {
+		//queryData, err := srv.QueryByListList(sqlstr, offset, pagecount, params)
+		//return queryData, err
+	} else {
+		queryData, err := srv.QueryByMap(sqlstr, offset, pagecount, params)
+		return queryData, err
+	}
+	return nil, nil
+}

+ 184 - 0
internal/controller/recall.go

@@ -0,0 +1,184 @@
+package controller
+
+import (
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/model"
+	"fmt"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"github.com/xuri/excelize/v2"
+	"strconv"
+	"time"
+)
+
+// AddRecall
+// @Summary 脖环召回计划添加
+// @Description add by json account
+// @Tags 脖环召回计划
+// @Accept  json
+// @Produce  json
+// @Param account body v1.AddRecallReq true "Add account"
+// @Router /recall/add [post]
+func AddRecall(r *ghttp.Request) {
+	var req *v1.AddRecallReq
+	username := r.Context().Value("jwt_username")
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	file, _, err := r.FormFile("file")
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	var REGISTNUM2 []string
+	xlsx1, err := excelize.OpenReader(file)
+	rows, _ := xlsx1.GetRows("sheet")
+	for i, r := range rows {
+		if i > 0 {
+			REGISTNUM2 = append(REGISTNUM2, r[0])
+		}
+	}
+
+	dataList, err := srv.GetFactoryidByREGISTNUM2(REGISTNUM2)
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	for _, data := range dataList {
+		exist := false
+		for _, factoryID := range req.FactoryID {
+			if factoryID == data.FactoryId {
+				exist = true
+				break
+			}
+		}
+		if !exist {
+			appG.Response(app.StatusInternalServerError, app.ERROR, "牛号与批次不匹配!!!")
+			return
+		}
+	}
+
+	neckringList, err := srv.GetNeckRingListingIDByFactoryId(req.FactoryID)
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	var hasRecalled []string
+	for _, REGISTNUM := range REGISTNUM2 {
+		exist := false
+		code, _ := strconv.ParseInt(REGISTNUM, 10, 64)
+		for _, item := range neckringList {
+			if item.Code == code {
+				exist = true
+				break
+			}
+		}
+		if !exist {
+			hasRecalled = append(hasRecalled, REGISTNUM)
+		}
+	}
+
+	if len(hasRecalled) > 0 {
+		dataList := make([]map[string]interface{}, 0)
+		for _, REGISTNUM := range REGISTNUM2 {
+			exist := false
+			for _, code := range hasRecalled {
+				if REGISTNUM == code {
+					exist = true
+					break
+				}
+			}
+			data := make(map[string]interface{})
+			data["a1"] = REGISTNUM
+			data["a2"] = ""
+			if exist {
+				data["a2"] = fmt.Sprintf("%s已经被召回!!!", REGISTNUM)
+			}
+			dataList = append(dataList, data)
+		}
+		appG.Response(app.StatusOK, app.RECALL, dataList)
+		return
+	}
+
+	err = srv.AddRecall(model.Factory{
+		Pastureid:  req.Pastureid,
+		Count:      req.Count,
+		CreateName: username.(string),
+		CreateTime: time.Now(),
+		Genre:      2,
+	}, req.FactoryID, REGISTNUM2)
+	if err != nil {
+		return
+	}
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+// GetRecall
+// @Summary 脖环召回查看
+// @Description add by json account
+// @Tags 脖环召回计划
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param batch path string true "string 批次"
+// @Param startcount path string true "string 数量"
+// @Param endcount path string true "string 数量"
+// @Param createname path string true "string 登记人"
+// @Param startdate path string true "string 登记时间"
+// @Param enddate path string true "string 登记时间"
+// @Param factoryid path int true "string 查看召回批次"
+// @Param replacement path int true "string 置换时查看传 1"
+// @Success 200 {object} v1.GetRecallRes
+// @Router /recall/list [get]
+func GetRecall(r *ghttp.Request) {
+	var req *v1.GetRecallReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	respList, count, err := srv.GetRecall(req.Index, req.PageSize, req.Pastureid, req.Batch, req.StartCount, req.EndCount, req.CreateName, req.StartDate, req.EndDate, req.FactoryID, req.Replacement)
+	if err != nil {
+		return
+	}
+
+	resp := v1.GetRecallRes{}
+	dataList := make([]*v1.Recall, 0)
+	for _, item := range respList {
+		var data v1.Recall
+		data.Id = item.Id
+		data.PastureId = item.Pastureid
+		data.PastureName = item.PastureName
+		data.Count = item.Count
+		data.Batch = item.Batch
+		data.Recall = item.Recall
+		data.CreateName = item.CreateName
+		if !item.CreateTime.IsZero() {
+			data.CreateTime = item.CreateTime.Format("2006-01-02")
+		}
+		dataList = append(dataList, &data)
+	}
+
+	resp.List = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}

+ 321 - 0
internal/controller/receiver.go

@@ -0,0 +1,321 @@
+package controller
+
+import (
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/model"
+	"encoding/json"
+	"fmt"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"time"
+)
+
+// GetReceiver
+// @Summary 接收器管理查看
+// @Description add by json account
+// @Tags 接收器管理
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param code path string true "string 接收器编码"
+// @Param status path int true "string 状态"
+// @Success 200 {object} v1.GetReceiverRes
+// @Router /receiver/list [get]
+func GetReceiver(r *ghttp.Request) {
+	var req *v1.GetReceiverReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	receiverList, count, err := srv.GetReceiverList(req.Index, req.PageSize, req.Code, req.Status)
+	if err != nil {
+		return
+	}
+
+	resp := v1.GetReceiverRes{}
+	dataList := make([]*v1.Receiver, 0)
+	for _, item := range receiverList {
+		var data v1.Receiver
+		data.ReceiverId = item.Receiver.Id
+		data.Code = item.IMEI
+		data.Pastureid = item.Receiver.Pastureid
+		data.BarId = item.Receiver.BarId
+		data.BarName = item.BarName
+		data.SimId = item.Receiver.Id
+		data.Status = item.Receiver.Status
+		data.Location = item.BarName
+		if !item.UpdateDate.IsZero() {
+			data.UpdateDate = item.Receiver.UpdateDate.Format("2006-01-02 15:04:05")
+		}
+		data.Card = item.Sim.Card
+		data.PastureName = item.PastureName
+		data.PastureCode = item.PastureCode
+		data.Id = item.Receiver.Id
+		if item.Image != "" {
+			data.Image = fmt.Sprintf("image/%s", item.Image)
+		}
+		style := new(v1.Style)
+		coordinatesmap := make(map[string]string)
+		if item.Coordinates != "" {
+			err := json.Unmarshal([]byte(item.Coordinates), &coordinatesmap)
+			if err == nil {
+				if _, ok := coordinatesmap["left"]; ok {
+					if coordinatesmap["left"] != "" {
+						style.Left = coordinatesmap["left"]
+					}
+				}
+				if _, ok := coordinatesmap["top"]; ok {
+					if coordinatesmap["top"] != "" {
+						style.Top = coordinatesmap["top"]
+					}
+				}
+			}
+		}
+		data.Style = style
+		dataList = append(dataList, &data)
+	}
+
+	resp.List = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+//AddReceiver
+//@Summary 添加接收器
+//@Description add by json account
+//@Tags 接收器管理
+//@Accept  json
+//@Produce  json
+//@Param account body v1.AddReceiverReq true "Add account"
+//@Router /receiver/add [post]
+func AddReceiver(r *ghttp.Request) {
+	var req *v1.AddReceiverReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "AddReceiver-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	exist, err := srv.CheckReceiverCode(0, req.Code)
+	if err != nil {
+		err = errors.Wrap(err, "AddReceiver-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	if exist {
+		appG.Response(app.StatusInternalServerError, app.ERROR, "IMEI卡号已经存在!!!")
+		return
+	}
+
+	err = srv.AddReceiver(model.Receiver{
+		IMEI:      req.Code,
+		Pastureid: req.Pastureid,
+		BarId:     req.BarId,
+		//BarName:    req.BarName,
+		SimID:  req.SimId,
+		Status: req.Status,
+		//Location:   req.Location,
+		UpdateDate: time.Now(),
+	})
+	if err != nil {
+		err = errors.Wrap(err, "AddReceiver-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+//EditReceiver
+//@Summary 编辑接收器
+//@Description add by json account
+//@Tags 接收器管理
+//@Accept  json
+//@Produce  json
+//@Param account body v1.EditReceiverReq true "Add account"
+//@Router /receiver/edit [post]
+func EditReceiver(r *ghttp.Request) {
+	var req *v1.EditReceiverReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	exist, err := srv.CheckReceiverCode(req.Id, req.Code)
+	if err != nil {
+		err = errors.Wrap(err, "EditReceiver-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	if exist {
+		appG.Response(app.StatusInternalServerError, app.ERROR, "IMEI卡号已经存在!!!")
+		return
+	}
+
+	err = srv.EditReceiver(model.Receiver{
+		Id:        req.Id,
+		IMEI:      req.Code,
+		Pastureid: req.Pastureid,
+		BarId:     req.BarId,
+		SimID:     req.SimId,
+		Status:    req.Status,
+		//Location:   req.Location,
+		UpdateDate: time.Now(),
+	})
+	if err != nil {
+		return
+	}
+
+	//err = srv.EditSimReceiverid(model.Sim{
+	//	Id:         req.SimId,
+	//	ReceiverId: req.Id,
+	//})
+	//if err != nil {
+	//	return
+	//}
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+// GetReceiverPull
+// @Summary 接口器下拉
+// @Description add by json account
+// @Tags 公共接口
+// @Accept  json
+// @Produce  json
+// @Success 200 {object} v1.GetReceiverRes
+// @Router /receiver/pull [get]
+func GetReceiverPull(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	receiverList, err := srv.GetReceiverPull()
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	resp := v1.GetReceiverPullRes{}
+	dataList := make([]*v1.ReceiverPull, 0)
+	for _, item := range receiverList {
+		var arg v1.ReceiverPull
+		arg.Id = item.Id
+		arg.Code = item.IMEI
+		dataList = append(dataList, &arg)
+	}
+
+	resp.List = dataList
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+// GetReceiverInfo
+// @Summary 接收器位置信息
+// @Description add by json account
+// @Tags 接收器管理
+// @Accept  json
+// @Produce  json
+// @Param barid path int true "string 栏舍"
+// @Success 200 {object} v1.GetReceiverRes
+// @Router /receiver/coordinates [get]
+func GetReceiverInfo(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	barid := r.Get("barid").String()
+
+	receiverList, err := srv.GetReceiverByPHYHOUSEUUID(barid)
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	resp := v1.GetReceiverInfoRes{}
+	dataList := make([]*v1.CoordinatesInfo, 0)
+	for _, item := range receiverList {
+		var arg v1.CoordinatesInfo
+		arg.ID = item.Id
+		arg.Pastureid = item.Pastureid
+		arg.BarId = item.BarId
+		arg.Status = item.Status
+		coordinatesmap := make(map[string]string)
+		style := new(v1.Style)
+		if item.Coordinates != "" {
+			err := json.Unmarshal([]byte(item.Coordinates), &coordinatesmap)
+			if err == nil {
+				if _, ok := coordinatesmap["left"]; ok {
+					if coordinatesmap["left"] != "" {
+						style.Left = coordinatesmap["left"]
+					}
+				}
+				if _, ok := coordinatesmap["top"]; ok {
+					if coordinatesmap["top"] != "" {
+						style.Top = coordinatesmap["top"]
+					}
+				}
+			}
+		}
+		arg.Style = style
+		dataList = append(dataList, &arg)
+	}
+	resp.List = dataList
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+//EditReceiverCoordinates
+//@Summary 编辑接收器坐标
+//@Description add by json account
+//@Tags 接收器管理
+//@Accept  json
+//@Produce  json
+//@Param account body v1.EditReceiverCoordinatesReq true "Add account"
+//@Router /receiver/coordinates/edit [post]
+func EditReceiverCoordinates(r *ghttp.Request) {
+	//var req *v1.EditReceiverCoordinatesReq
+	reqList := make([]*v1.CoordinatesInfo, 0)
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&reqList)
+	if err != nil {
+		err = errors.Wrap(err, "EditReceiverCoordinates-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	dataList := make([]*model.Receiver, 0)
+	for _, item := range reqList {
+		var arg model.Receiver
+		arg.Id = item.ID
+		arg.Status = item.Status
+		if item.Left == "" || item.Top == "" {
+			arg.Coordinates = ""
+		} else {
+			coordinatesMap := make(map[string]string)
+			coordinatesMap["left"] = item.Left
+			coordinatesMap["top"] = item.Top
+			coordinatesByte, _ := json.Marshal(coordinatesMap)
+			arg.Coordinates = string(coordinatesByte)
+		}
+		dataList = append(dataList, &arg)
+	}
+
+	err = srv.UpdateReceiverById(dataList)
+	if err != nil {
+		err = errors.Wrap(err, "EditReceiverCoordinates-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}

+ 328 - 0
internal/controller/sim.go

@@ -0,0 +1,328 @@
+package controller
+
+import (
+	v1 "demo/api/v1"
+	"demo/internal/app"
+	"demo/internal/model"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"time"
+)
+
+// GetSim
+// @Summary SIM卡查看
+// @Description add by json account
+// @Tags SIM卡管理
+// @Accept  json
+// @Produce  json
+// @Param index path int true "int "
+// @Param pagesize path int true "int "
+// @Param card path string true "string sim卡号"
+// @Param company path string true "string 公司"
+// @Param status path int true "string 状态"
+// @Success 200 {object} v1.GetSimRes
+// @Router /sim/list [get]
+func GetSim(r *ghttp.Request) {
+	var req *v1.GetSimReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "GetSim-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	simList, count, err := srv.GetSimList(req.Index, req.PageSize, req.Card, req.Company, req.Status)
+	if err != nil {
+		return
+	}
+
+	resp := v1.GetSimRes{}
+	dataList := make([]*v1.Sim, 0)
+	for _, item := range simList {
+		var data v1.Sim
+		data.Id = item.Sim.Id
+		data.Card = item.Card
+		data.TotalFlow = item.TotalFlow
+		data.Used = item.Used
+		data.Remaining = item.Remaining
+		data.Company = item.Company
+		if !item.PurchaseDate.IsZero() {
+			data.PurchaseDate = item.PurchaseDate.Format("2006-01-02")
+		}
+		if !item.ActivateDate.IsZero() {
+			data.ActivateDate = item.ActivateDate.Format("2006-01-02")
+		}
+		if !item.TopUpDate.IsZero() {
+			data.TopUpDate = item.TopUpDate.Format("2006-01-02 15:04:05")
+		}
+		if !item.EndDate.IsZero() {
+			data.EndDate = item.EndDate.Format("2006-01-02")
+		}
+		data.Status = item.Sim.Status
+		data.ReceiverId = item.ReceiverId
+		data.Pastureid = item.Sim.Pastureid
+		//data.BarId = item.BarId
+		data.BarName = item.BarName
+		data.PastureName = item.PastureName
+		data.PastureCode = item.PastureCode
+		data.ReceiverCode = item.Receiver.IMEI
+		dataList = append(dataList, &data)
+	}
+
+	resp.List = dataList
+	resp.Total = count
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}
+
+//AddSim
+//@Summary SIM卡添加
+//@Description add by json account
+//@Tags SIM卡管理
+//@Accept  json
+//@Produce  json
+//@Param account body v1.AddSimReq true "Add account"
+//@Router /sim/add [post]
+func AddSim(r *ghttp.Request) {
+	var req *v1.AddSimReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "AddSim-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	layout := "2006-01-02"
+	var purchaseDate, activateDate, topUpDate, endDate time.Time
+	if req.PurchaseDate != "" {
+		purchaseDate, err = time.Parse(layout, req.PurchaseDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+	if req.ActivateDate != "" {
+		activateDate, err = time.Parse(layout, req.ActivateDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+	if req.TopUpDate != "" {
+		topUpDate, err = time.Parse("2006-01-02 15:04:05", req.TopUpDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+	if req.EndDate != "" {
+		endDate, err = time.Parse(layout, req.EndDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+
+	exist, err := srv.CheckSimCode(0, req.Card)
+	if err != nil {
+		err = errors.Wrap(err, "AddSim-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	if exist {
+		appG.Response(app.StatusInternalServerError, app.ERROR, "SIM卡号已经存在!!!")
+		return
+	}
+
+	id, err := srv.AddSim(model.Sim{
+		Card:         req.Card,
+		TotalFlow:    req.TotalFlow,
+		Used:         req.Used,
+		Remaining:    req.Remaining,
+		Company:      req.Company,
+		PurchaseDate: purchaseDate,
+		ActivateDate: activateDate,
+		TopUpDate:    topUpDate,
+		EndDate:      endDate,
+		Status:       req.Status,
+		//ReceiverId:   req.ReceiverId,
+		Pastureid: req.Pastureid,
+		//BarId:        req.BarId,
+		//BarName:      req.BarName,
+	})
+	if err != nil {
+		return
+	}
+
+	if req.ReceiverId != 0 && id != 0 {
+		err = srv.UpdateReceiverSimId(&model.Receiver{
+			Id:    req.ReceiverId,
+			SimID: id,
+		})
+		if err != nil {
+			return
+		}
+	}
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+//EditSim
+//@Summary SIM卡修改
+//@Description add by json account
+//@Tags SIM卡管理
+//@Accept  json
+//@Produce  json
+//@Param account body v1.EditSimReq true "Add account"
+//@Router /sim/edit [post]
+func EditSim(r *ghttp.Request) {
+	var req *v1.EditSimReq
+	appG := app.Ghttp{C: r}
+	err := appG.C.Parse(&req)
+	if err != nil {
+		err = errors.Wrap(err, "EditSim-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	layout := "2006-01-02"
+	var purchaseDate, activateDate, topUpDate, endDate time.Time
+	if req.PurchaseDate != "" {
+		purchaseDate, err = time.Parse(layout, req.PurchaseDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+	if req.ActivateDate != "" {
+		activateDate, err = time.Parse(layout, req.ActivateDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+	if req.TopUpDate != "" {
+		topUpDate, err = time.Parse("2006-01-02 15:04:05", req.TopUpDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+	if req.EndDate != "" {
+		endDate, err = time.Parse(layout, req.EndDate)
+		if err != nil {
+			err = errors.Wrap(err, "AddSim-error")
+			log.Error(err)
+			appG.Response(app.StatusInternalServerError, app.ERROR, err)
+			return
+		}
+	}
+
+	exist, err := srv.CheckSimCode(req.Id, req.Card)
+	if err != nil {
+		err = errors.Wrap(err, "AddSim-error")
+		log.Error(err)
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+	if exist {
+		appG.Response(app.StatusInternalServerError, app.ERROR, "SIM卡号已经存在!!!")
+		return
+	}
+
+	err = srv.EditSim(model.Sim{
+		Id:           req.Id,
+		Card:         req.Card,
+		TotalFlow:    req.TotalFlow,
+		Used:         req.Used,
+		Remaining:    req.Remaining,
+		Company:      req.Company,
+		PurchaseDate: purchaseDate,
+		ActivateDate: activateDate,
+		TopUpDate:    topUpDate,
+		EndDate:      endDate,
+		Status:       req.Status,
+		//ReceiverId:   req.ReceiverId,
+		Pastureid: req.Pastureid,
+		//BarId:        req.BarId,
+		//BarName:      req.BarName,
+	})
+	if err != nil {
+		return
+	}
+	if req.Status == 0 {
+		err = srv.UpdateReceiverSimId(&model.Receiver{
+			Id:    req.ReceiverId,
+			SimID: 0,
+		})
+		if err != nil {
+			return
+		}
+	}
+	//if req.ReceiverId != 0 {
+	err = srv.UpdateReceiverSimId(&model.Receiver{
+		Id:    req.ReceiverId,
+		SimID: req.Id,
+	})
+	if err != nil {
+		return
+	}
+	//} else {
+	//	err = srv.UpdateReceiverSimId(&model.Receiver{
+	//		Id:    req.Id,
+	//		SimID: 0,
+	//	})
+	//	if err != nil {
+	//		return
+	//	}
+	//}
+
+	appG.Response(app.StatusOK, app.SUCCESS, true)
+}
+
+// GetSimPull
+// @Summary SIM卡下拉
+// @Description add by json account
+// @Tags 公共接口
+// @Accept  json
+// @Produce  json
+// @Success 200 {object} v1.GetSimPullRes
+// @Router /sim/pull [get]
+func GetSimPull(r *ghttp.Request) {
+	appG := app.Ghttp{C: r}
+	simList, err := srv.GetSimPull()
+	if err != nil {
+		appG.Response(app.StatusInternalServerError, app.ERROR, err)
+		return
+	}
+
+	resp := v1.GetSimPullRes{}
+	dataList := make([]*v1.SimPull, 0)
+	for _, item := range simList {
+		var arg v1.SimPull
+		arg.Id = item.Id
+		arg.Card = item.Card
+		dataList = append(dataList, &arg)
+	}
+
+	resp.List = dataList
+	appG.Response(app.StatusOK, app.SUCCESS, resp)
+}

+ 411 - 0
internal/dao/auth.go

@@ -0,0 +1,411 @@
+package dao
+
+import (
+	"demo/internal/setting"
+	"demo/internal/util"
+	"fmt"
+	"github.com/patrickmn/go-cache"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"math"
+	"strconv"
+	"strings"
+	"unsafe"
+)
+
+var (
+	Apisql_cache *cache.Cache
+)
+
+func (d *Dao) CheckUser(username, passwd string) (bool, error) {
+	return d.db.Table("user").Where("username = ? ", username).And(" password = ? ", util.EncodeMD5(passwd)).Exist()
+}
+
+func (d *Dao) GetSqlByNameDBT(sqlname string) (string, string, error) {
+	apiList, err := d.db.Table("apisql").Where("sqlname = ?", sqlname).QueryString()
+	if err != nil {
+		err = errors.Wrap(err, "GetSqlByNameDBT-db-error")
+		log.Error(err)
+		return "", "", err
+	}
+
+	sqlstr := ""
+	p := ""
+	for _, api := range apiList {
+		sqlstr = api["sqlstr"]
+		p = api["params"]
+	}
+	return sqlstr, p, nil
+}
+
+func (d *Dao) QueryByListT(sqlstr string, offset, count int, params []interface{}) (interface{}, error) {
+	if strings.Contains(sqlstr, ";") {
+		return nil, errors.New("can not have ;")
+	}
+
+	if count == 0 {
+		count = 1000
+	}
+	recordcount := int64(0)
+	if count > 1 {
+		tt, err := d.db.SQL("SELECT COUNT(*) as count FROM ("+sqlstr+") a", params...).QueryInterface()
+		if err != nil {
+			return nil, err
+		}
+		switch tt[0]["count"].(type) {
+		case int64:
+			recordcount = tt[0]["count"].(int64)
+		case string:
+			temp, _ := strconv.Atoi(tt[0]["count"].(string))
+			recordcount = int64(temp)
+
+		}
+	}
+	queryData := make([]map[string]interface{}, 1)
+	var err error
+	if count == 0 {
+		queryData, err = d.db.SQL(sqlstr, params...).QueryInterface()
+	} else {
+		if count > 0 && offset > 0 {
+			offset = offset * count
+		}
+		queryData, err = d.db.SQL(sqlstr, params...).Limit(count, offset).QueryInterface()
+
+	}
+	if err != nil {
+		return nil, err
+	}
+	columnsname := make([]string, 0)
+	listdata := make(map[string][]interface{})
+	if len(queryData) > 0 {
+		for i, _ := range queryData {
+			if i == 0 {
+				for i, _ := range queryData[0] {
+					columnsname = append(columnsname, i)
+				}
+			}
+
+			for _, v := range columnsname {
+				listdata[v] = append(listdata[v], queryData[i][v])
+			}
+
+		}
+		recordcount = int64(len(queryData))
+	}
+
+	data := make(map[string]interface{})
+	data["lists"] = listdata
+	//data["columnsname"] = columnsname
+	data["total"] = recordcount
+	data["code"] = 0
+	data["message"] = "ok"
+	if count > 0 {
+		data["pages"] = math.Ceil(float64(recordcount) / float64(count))
+		data["pageNum"] = math.Ceil(float64(offset+1) / float64(count))
+	}
+	data["pageSize"] = count
+	return data, nil
+}
+
+func (d *Dao) QueryByListListT(sqlstr string, offset, count int, params []interface{}) (interface{}, error) {
+	if strings.Contains(sqlstr, ";") {
+		return nil, errors.New("can not have ;")
+	}
+
+	if count == 0 {
+		count = 1000
+	}
+	recordcount := int64(0)
+	if count > 1 {
+		tt, err := d.db.SQL("SELECT COUNT(*) as count FROM ("+sqlstr+") a", params...).QueryInterface()
+		if err != nil {
+			return nil, err
+		}
+		switch tt[0]["count"].(type) {
+		case int64:
+			recordcount = tt[0]["count"].(int64)
+		case string:
+			temp, _ := strconv.Atoi(tt[0]["count"].(string))
+			recordcount = int64(temp)
+
+		}
+	}
+
+	queryData := make([]map[string]interface{}, 1)
+	var err error
+	if count == 0 {
+		queryData, err = d.db.SQL(sqlstr, params...).QueryInterface()
+	} else {
+		if count > 0 && offset > 0 {
+			offset = offset * count
+		}
+		queryData, err = d.db.SQL(sqlstr, params...).Limit(count, offset).QueryInterface()
+	}
+
+	if err != nil {
+		return nil, err
+	}
+	columnsname := make([]string, 0)
+	listdata := make([]interface{}, 0)
+	if len(queryData) > 0 {
+		for i, _ := range queryData {
+			if i == 0 {
+				for i, _ := range queryData[0] {
+					columnsname = append(columnsname, i)
+				}
+			}
+			listdatarow := make([]interface{}, 0)
+
+			for _, v := range columnsname {
+				listdatarow = append(listdatarow, queryData[i][v])
+			}
+			listdata = append(listdata, listdatarow)
+		}
+		recordcount = int64(len(queryData))
+	}
+	data := make(map[string]interface{})
+	data["list"] = listdata
+	data["columnsname"] = columnsname
+	data["total"] = recordcount
+	data["code"] = 0
+	data["message"] = "ok"
+	if count > 0 {
+		data["pages"] = math.Ceil(float64(recordcount) / float64(count))
+		data["pageNum"] = math.Ceil(float64(offset+1) / float64(count))
+	}
+	data["pageSize"] = count
+	return data, nil
+}
+
+func (d *Dao) QueryByMapT(sqlstr string, offset, count int, params []interface{}) (interface{}, error) {
+	if strings.Contains(sqlstr, ";") {
+		return nil, errors.New("can not have ;")
+	}
+
+	recordcount := int64(0)
+
+	if count > 1 {
+		tt, err := d.db.SQL("SELECT COUNT(*) as count FROM ("+sqlstr+") a", params...).Count()
+		if err != nil {
+			fmt.Println("s1", err)
+			return nil, err
+		}
+		recordcount = tt
+		//if tt == nil {
+		//	recordcount = 0
+		//} else {
+		//	switch tt[0]["count"].(type) {
+		//	case int64:
+		//		recordcount = tt[0]["count"].(int64)
+		//	case string:
+		//		temp, _ := strconv.Atoi(tt[0]["count"].(string))
+		//		recordcount = int64(temp)
+		//
+		//	}
+		//
+		//}
+
+	}
+	queryData := make([]map[string]string, 0)
+	var err error
+	if count == 0 {
+		queryData, err = d.db.SQL(sqlstr, params...).QueryString()
+	} else {
+		offset := (offset - 1) * count
+		queryData, err = d.db.SQL(fmt.Sprintf("%s limit %d,%d", sqlstr, offset, count), params...).QueryString()
+	}
+	//fmt.Println("count, offset==================",count, offset)
+	if err != nil {
+		return nil, err
+	}
+	if recordcount == 0 {
+		recordcount = int64(len(queryData))
+	}
+
+	data := make(map[string]interface{})
+	data["list"] = queryData
+	data["total"] = recordcount
+	data["code"] = 0
+	data["message"] = "ok"
+	if count > 0 {
+		data["pages"] = math.Ceil(float64(recordcount) / float64(count))
+		data["pageNum"] = math.Ceil(float64(offset+1) / float64(count))
+	}
+	data["pageSize"] = count
+	return data, nil
+}
+
+func (d *Dao) QueryByMap(sqlstr string, offset, count int, params []interface{}) (interface{}, error) {
+	recordcount := int64(0)
+	if count > 1 {
+		tt, err := d.db.SQL("SELECT COUNT(*) as count FROM ("+sqlstr+") a", params...).QueryInterface()
+		if err != nil {
+			fmt.Println("s1", err)
+			return nil, err
+		}
+		if tt == nil {
+			recordcount = 0
+		} else {
+			recordcount = tt[0]["count"].(int64)
+		}
+
+	}
+	queryData := make([]map[string]string, 1)
+	var err error
+	if count == 0 {
+		queryData, err = d.db.SQL(sqlstr, params...).QueryString()
+	} else {
+		if count > 0 && offset > 0 {
+			offset = offset * count
+		}
+		queryData, err = d.db.SQL(sqlstr, params...).Limit(count, offset).QueryString()
+	}
+	//fmt.Println("count, offset==================",count, offset)
+
+	if err != nil {
+		return nil, err
+	}
+	if recordcount == 0 {
+		recordcount = int64(len(queryData))
+	}
+
+	data := make(map[string]interface{})
+	data["list"] = queryData
+	data["total"] = recordcount
+	data["code"] = 0
+	data["message"] = "ok"
+	if count > 0 {
+		data["pages"] = math.Ceil(float64(recordcount) / float64(count))
+		data["pageNum"] = math.Ceil(float64(offset+1) / float64(count))
+	}
+	data["pageSize"] = count
+	return data, nil
+}
+
+func (d *Dao) ExecQueryT(sqlstr string, params []interface{}) (interface{}, error) {
+	//if err := sqlCheckParam(sqlstr); err != nil {
+	//	return 0, err
+	//}
+	var args []interface{}
+	args = append(args, sqlstr)
+	args = append(args, params...)
+	rows, err := d.db.Exec(args...)
+	if err != nil {
+		log.Error(err)
+		return nil, err
+	}
+
+	LastInsertId, err := rows.LastInsertId()
+	idPointer := (*int)(unsafe.Pointer(&LastInsertId))
+	idd16 := *idPointer
+	data := make(map[string]interface{})
+
+	RowsAffected, _ := rows.RowsAffected()
+	_idPointer := (*int)(unsafe.Pointer(&RowsAffected))
+	_idd16 := *_idPointer
+	data["LastInsertId"] = strconv.Itoa(idd16)
+	data["LastInsertIdStr"] = idd16
+	data["RowsAffected"] = _idd16
+	data["result"] = rows
+	return data, nil
+}
+
+func (d *Dao) GetUserInfo(username string) map[string]interface{} {
+	valuesMap, err := d.db.SQL("SELECT * FROM  `user` WHERE `username` = ? and `enable` >0 ", username).QueryString()
+
+	if err != nil {
+		return nil
+	}
+	resp := make(map[string]interface{})
+	if len(valuesMap) > 0 {
+		valuesMap2, err := d.db.SQL("SELECT r.`name`,r.`id` FROM `user` u  JOIN `role` r ON r.id=u.`roleid` WHERE r.`enable`>0  AND u.username=?", username).QueryString()
+		if err == nil {
+			resp["role"] = valuesMap2
+		}
+		for k, v := range valuesMap[0] {
+			resp[k] = v
+		}
+		return resp
+	}
+	return nil
+}
+
+func (d *Dao) GetSqlByNameDB(name string) (string, string) {
+
+	sqls := ""
+	param := ""
+	//Apisql_cache.Get(name)
+	//fmt.Println(setting.DatabaseSetting.CacheApiSql)
+	//if sql, ok := Apisql_cache.Get(name); ok && setting.DatabaseSetting.CacheApiSql {
+	//	tempstrb := strings.IndexAny(sql.(string), "|")
+	//	sqls = sql.(string)[0:tempstrb]
+	//	param = sql.(string)[tempstrb+1:]
+	//} else {
+	valuesMap, err := d.db.SQL("SELECT sqlstr,params FROM apisql WHERE sqlname = ? AND ENABLE>0 ", name).QueryString()
+
+	if err == nil && len(valuesMap) > 0 {
+		sqls = valuesMap[0]["sqlstr"]
+		param = valuesMap[0]["params"]
+		//Apisql_cache.Set(name, (sqls + "|" + param), cache.DefaultExpiration)
+	}
+	//}
+	if setting.DatabaseSetting.ShowGetSqllog {
+
+		fmt.Println("==============")
+		fmt.Println("apisql:" + sqls)
+		fmt.Println("--------------")
+		fmt.Println("param:" + param)
+		fmt.Println("==============")
+	}
+	return sqls, param
+}
+
+func (d *Dao) QueryByMapMenu(sqlstr string, offset, count int, params []interface{}) ([]map[string]interface{}, error) {
+
+	if offset < 0 {
+		offset = 0
+	}
+	if count <= 0 {
+		count = 0
+	}
+	if count > 0 {
+		sqlstr += " limit " + strconv.Itoa(offset) + "," + strconv.Itoa(count)
+	}
+
+	rows, err := d.db.SQL(sqlstr, params...).QueryString()
+	if err != nil {
+		return nil, err
+	}
+
+	//defer rows.Close()
+	//columnsType, _ := rows.ColumnTypes()
+	//columnsLen := len(columnsType)
+	//columns, _ := rows.Columns()
+	//queryData := make([]map[string]interface{}, 0)
+	//values := make([]interface{}, columnsLen)
+	//valuePtrs := make([]interface{}, columnsLen)
+	//
+	//for rows.Next() {
+	//	for a := 0; a < columnsLen; a++ {
+	//		valuePtrs[a] = &values[a]
+	//	}
+	//	rows.Scan(valuePtrs...)
+	//	entry := make(map[string]interface{})
+	//	for i, col := range columns {
+	//		entry[col] = getValue(values[i], columnsType[i].DatabaseTypeName())
+	//	}
+	//	queryData = append(queryData, entry)
+	//}
+
+	dataList := make([]map[string]interface{}, 0)
+	for _, row := range rows {
+		data := make(map[string]interface{}, 0)
+		for k, v := range row {
+			data[k] = v
+		}
+		dataList = append(dataList, data)
+	}
+	//data := rows
+	return dataList, nil
+	//return Engine.SQL(sqlstr, params...).Query().List()
+}

+ 49 - 0
internal/dao/dao.go

@@ -0,0 +1,49 @@
+package dao
+
+import (
+	"context"
+	"fmt"
+	_ "github.com/go-sql-driver/mysql"
+	"github.com/go-xorm/xorm"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type Dao struct {
+	db *xorm.Engine
+}
+
+// var dao *xorm.Engine
+
+const (
+	UserName = "root"
+	PassWord = "kepaiteng!QAZ"
+	Host     = "222.73.129.15"
+	Port     = "31306"
+	Database = "neckring"
+	//Charset  = "utf8"
+)
+
+func New() (dao *Dao) {
+	confMap, _ := g.Cfg().Get(context.Background(), "database")
+	sqlStr := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8", confMap.Map()["UserName"], confMap.Map()["PassWord"], confMap.Map()["Host"], confMap.Map()["Port"], confMap.Map()["Database"])
+	// var err error
+	xe, err := xorm.NewEngine("mysql", sqlStr)
+	if err != nil {
+		fmt.Println("数据库连接失败:", err)
+		return
+	}
+	if xe == nil {
+		fmt.Println("引擎初始化异常")
+		return
+	}
+
+	dao = &Dao{
+		db: xe,
+	}
+	xe.ShowSQL(true)
+	err = SyncTable(xe)
+	if err != nil {
+		fmt.Println("数据表同步失败:", err)
+	}
+	return
+}

+ 250 - 0
internal/dao/factory.go

@@ -0,0 +1,250 @@
+package dao
+
+import (
+	"demo/internal/model"
+	"fmt"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"strconv"
+	"strings"
+	"sync"
+	"time"
+)
+
+func (d *Dao) AddFactory(arg model.Factory, recall []int64) error {
+	row := d.db.NewSession()
+	defer row.Close()
+	row.Begin()
+
+	c := time.Now().Format("20060102")
+
+	count1, err := row.Where(" batch like ? ", "%"+fmt.Sprintf("EB%s", c)+"%").Count(&model.Factory{})
+	if err != nil {
+		err = errors.Wrap(err, "AddFactory-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+	count1 = count1 + 1
+	var batch string
+	//for i := 0; i <= int(count1); i++ {
+	batch = fmt.Sprintf("EB%s", c)
+	//	//count1 = count1 + 1
+	num := 3 - len(fmt.Sprintf("%d", count1))
+	for n := 0; n < num; n++ {
+		batch = fmt.Sprintf("%s0", batch)
+	}
+
+	batch = fmt.Sprintf("%s%d", batch, count1)
+	//}
+	arg.Batch = batch
+
+	arg.Recall = int64(len(recall))
+	_, err = row.InsertOne(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "AddFactory-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+	err = row.Commit()
+	if err != nil {
+		err = errors.Wrap(err, "AddFactory-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+
+	row.Begin()
+	now := time.Now()
+	if arg.Genre == 0 {
+		//count, err := row.Where(" code like ? ", "%"+fmt.Sprintf("bh%s", c)+"%").Count(&model.NeckRingListing{})
+		//if err != nil {
+		//	err = errors.Wrap(err, "AddFactory-db-error")
+		//	log.Error(err)
+		//	row.Rollback()
+		//	return err
+		//}
+
+		var wg sync.WaitGroup
+		dataList := make([]*model.NeckRingListing, 0)
+		for i := 0; i < int(arg.Count); i++ {
+			wg.Add(1)
+			go func() {
+				defer wg.Done()
+				insertarg := &model.NeckRingListing{
+					Pastureid: arg.Pastureid,
+					Code:      0,
+					//Status:       0,
+					PurchaseDate: now,
+					CreateDate:   now,
+					FactoryId:    arg.Id,
+				}
+				dataList = append(dataList, insertarg)
+			}()
+		}
+		wg.Wait()
+
+		_, err := row.Insert(dataList)
+		if err != nil {
+			err = errors.Wrap(err, "AddFactory-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+		_, err = row.Exec(` update  t_nz_jbqid SET REGIST_NUM_2 = id WHERE (CREATETIME = ?) `, now.Format("2006-01-02 15:04:05"))
+		if err != nil {
+			err = errors.Wrap(err, "AddFactory-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+	} else {
+		//TODO 置换
+		deliveryandrecallList := make([]*model.DeliveryAndRecall, 0)
+		for _, recallId := range recall {
+			var deliveryandrecall model.DeliveryAndRecall
+			deliveryandrecall.FactoryId = arg.Id
+			deliveryandrecall.Status = 0
+			deliveryandrecall.RecallId = recallId
+			deliveryandrecallList = append(deliveryandrecallList, &deliveryandrecall)
+		}
+		_, err := row.Insert(&deliveryandrecallList)
+		if err != nil {
+			err = errors.Wrap(err, "AddFactory-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+
+		count, err := row.In("factoryid", recall).And("status = 1").Count(new(model.DeliveryAndRecall))
+		if err != nil {
+			err = errors.Wrap(err, "AddFactory-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+
+		dataList := make([]*model.NeckRingListing, 0)
+		for i := 0; i < int(count); i++ {
+			//wg.Add(1)
+			//go func() {
+			//	defer wg.Done()
+			insertarg := &model.NeckRingListing{
+				Pastureid:    arg.Pastureid,
+				Code:         0,
+				Recall:       0,
+				PurchaseDate: now,
+				CreateDate:   now,
+				FactoryId:    arg.Id,
+			}
+			//go func() {
+			//_, err := row.Insert(insertarg)
+			//if err != nil {
+			//	err = errors.Wrap(err, "AddFactory-db-error")
+			//	log.Error(err)
+			//	row.Rollback()
+			//	return err
+			//}
+			dataList = append(dataList, insertarg)
+
+			//}()
+		}
+
+		_, err = row.Insert(dataList)
+		if err != nil {
+			err = errors.Wrap(err, "AddFactory-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+		//for _, item := range dataList {
+		//	item.Code = item.Id
+		//	_, err = row.Cols("REGIST_NUM_2").Where("id = ?", item.Id).Update(item)
+		//	if err != nil {
+		//		err = errors.Wrap(err, "AddFactory-db-error")
+		//		log.Error(err)
+		//		row.Rollback()
+		//		return err
+		//	}
+		//}
+		_, err = row.Exec(` update  t_nz_jbqid SET REGIST_NUM_2 = id WHERE (CREATETIME = ?) `, now.Format("2006-01-02 15:04:05"))
+		if err != nil {
+			err = errors.Wrap(err, "AddFactory-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+
+		//wg.Wait()
+		var recallstr []string
+		for _, r := range recall {
+			recallstr = append(recallstr, strconv.FormatInt(r, 10))
+		}
+		_, err = row.Exec(fmt.Sprintf(`update t_nz_jbqid set recall = 2  where id in( 
+select recallid from deliveryandrecall where factoryid in(%s) and status = 1) and  recall = 1 `, strings.Join(recallstr, ",")))
+		if err != nil {
+			err = errors.Wrap(err, "AddFactory-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+	}
+
+	err = row.Commit()
+	if err != nil {
+		err = errors.Wrap(err, "AddFactory-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) GetFactory(index, pagesize int64, pastureid, batch string, genre, startCount, endCount int64, createName, startDate, endDate string, recallID int64) ([]*model.FactoryList, int64, error) {
+	rows := d.db.NewSession()
+	defer rows.Close()
+	rows.Table("factory").Alias("f")
+	rows.Join("inner", []string{"t_nz_farm", "fa"}, "f.FARM_UUID=fa.UUID")
+
+	if batch != "" {
+		rows.Where(" f.batch like ? ", "%"+batch+"%")
+	}
+
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+	if genre != -1 {
+		rows.Where(" f.genre = ? ", genre)
+	}
+	if startCount > 0 {
+		rows.Where(" f.count >= ? ", startCount)
+	}
+	if endCount > 0 {
+		rows.Where(" f.count <= ? ", endCount)
+	}
+	if createName != "" {
+		rows.Where(" f.createname like ? ", "%"+createName+"%")
+	}
+	if startDate != "" && endDate != "" {
+		rows.Where(" f.createtime between ? and ? ", startDate, endDate)
+	}
+	if pastureid != "" {
+		rows.Where(" f.FARM_UUID = ? ", pastureid)
+	}
+	if recallID > 0 {
+		rows.Where("f.id in(select recallid from deliveryandrecall where factoryid  = ? and status = 1)", recallID)
+	}
+
+	rows.Where("f.genre != 2")
+	dataList := make([]*model.FactoryList, 0)
+	count, err := rows.Desc("f.createtime").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetFactory-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+
+	return dataList, count, nil
+}

+ 94 - 0
internal/dao/management.go

@@ -0,0 +1,94 @@
+package dao
+
+import (
+	"demo/internal/model"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+)
+
+func (d *Dao) AddManagement(arg model.Management, mnagementBh []*model.ManagementBh) error {
+	row := d.db.NewSession()
+	defer row.Close()
+	row.Begin()
+
+	_, err := row.Insert(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "AddManagement-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+
+	for _, bh := range mnagementBh {
+		bh.ManagementID = arg.Id
+		_, err := row.Insert(bh)
+		if err != nil {
+			err = errors.Wrap(err, "AddManagement-db-error")
+			log.Error(err)
+			row.Rollback()
+			return err
+		}
+	}
+
+	err = row.Commit()
+	if err != nil {
+		err = errors.Wrap(err, "AddManagement-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) GetManagement(index, pagesize int64, pastureid string, genre int64, startDate, endDate string) ([]*model.ManagementList, int64, error) {
+	//rows := d.db.NewSession()
+	rows := d.db.NewSession().Table(new(model.Management).TableName()).Alias("m")
+	rows.Join("inner", []string{"t_nz_farm", "f"}, "m.FARM_UUID=f.UUID")
+	rows.Select("m.*,f.FARM_NAME")
+	defer rows.Close()
+	//importdate
+
+	if pastureid != "" {
+		rows.Where("m.FARM_UUID = ?", pastureid)
+	}
+	if genre >= 0 {
+		//0 售卖,1 返厂 2 置换
+		rows.Where("m.genre = ?", genre)
+	}
+	if startDate != "" && endDate != "" {
+		rows.Where("m.importdate  between ? and ? ", startDate, endDate)
+	}
+
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+
+	dataList := make([]*model.ManagementList, 0)
+	count, err := rows.Desc("importdate").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetManagement-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+	return dataList, count, nil
+}
+
+func (d *Dao) GetManagementBh(index, pagesize, managementId int64) ([]*model.ManagementBh, int64, error) {
+	rows := d.db.NewSession()
+	defer rows.Close()
+
+	rows.Where("managementid = ?", managementId)
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+	dataList := make([]*model.ManagementBh, 0)
+	count, err := rows.OrderBy("REGIST_NUM_2").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetManagementBh-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+	return dataList, count, nil
+}

+ 117 - 0
internal/dao/neckringlisting.go

@@ -0,0 +1,117 @@
+package dao
+
+import (
+	"demo/internal/model"
+	"fmt"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"strings"
+)
+
+func (d *Dao) GetNeckRingListing(index, pagesize int64, code int64, barName, purchaseStart, purchaseEnd,
+	manufactureStart, manufactureEnd string, status int64, cattle string, recallID, factoryID int64) ([]*model.NeckRingListingList, int64, error) {
+	dataList := make([]*model.NeckRingListingList, 0)
+	rows := d.db.NewSession().Table("t_nz_jbqid").Alias("j")
+	rows.Join("inner", []string{"t_nz_farm", "f"}, "j.FARM_UUID=f.UUID")
+
+	if recallID == 0 && factoryID == 0 {
+		rows.Select(`j.id,j.FARM_UUID ,j.REGIST_NUM_2,j.BUY_DATE,j.ENTER_DATE,j.START_DATE,j.ISUSED as status,j.STOP_DATE,j.CREATETIME`)
+	} else {
+		rows.Join("left", []string{"factory", "fa"}, " fa.id = j.factoryid ")
+		rows.Select(`j.id,j.FARM_UUID ,j.REGIST_NUM_2,j.BUY_DATE,j.ENTER_DATE,j.START_DATE,j.ISUSED as status,j.STOP_DATE,j.CREATETIME
+,fa.createtime,fa.batch`)
+	}
+
+	defer rows.Close()
+
+	if code != 0 {
+		rows.Where("j.REGIST_NUM_2 = ? ", code)
+	}
+
+	if barName != "" || cattle != "" {
+		rows.Join("left", []string{"t_nz_cow", "c"}, " j.FARM_UUID=c.FARM_UUID   And  j.REGIST_NUM_2=c.REGIST_NUM_2")
+		rows.Join("left", []string{"t_jc_house", "h"}, " c.HOUSE_UUID=h.UUID ")
+	}
+	if barName != "" {
+		rows.Where("h.HOUSE_NAME like ? ", "%"+barName+"%")
+	}
+	if purchaseStart != "" && purchaseEnd != "" {
+		rows.Where(" j.BUY_DATE between ? and ? ", purchaseStart, purchaseEnd)
+	}
+	if manufactureStart != "" && manufactureEnd != "" {
+		rows.Where(" j.ENTER_DATE between ? and ? ", manufactureStart, manufactureEnd)
+	}
+	if status > 0 {
+		if status == 0 {
+			rows.Where("j.STOP_DATE is not null ")
+		} else {
+			rows.Where("j.STOP_DATE is null ")
+		}
+	}
+	if cattle != "" {
+		rows.Where("c.COW_NUM = ? ", cattle)
+	}
+	if recallID > 0 {
+		rows.Where("REGIST_NUM_2 in(select  REGIST_NUM_2 from deliveryandrecall where factoryid = ? and status = 1)", recallID)
+	}
+	if factoryID > 0 {
+		rows.Where("factoryid  =? ", factoryID)
+	}
+
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+
+	count, err := rows.Desc("j.CREATETIME").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListing-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+	return dataList, count, nil
+}
+
+func (d *Dao) GetFactoryidByREGISTNUM2(REGISTNUM2 []string) ([]*model.NeckRingListing, error) {
+	rows := d.db.NewSession()
+	defer rows.Close()
+	rows.In("REGIST_NUM_2", REGISTNUM2)
+	dataList := make([]*model.NeckRingListing, 0)
+	err := rows.Cols("factoryid").GroupBy("factoryid").Find(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetFactoryidByREGISTNUM2-db-error")
+		log.Error(err)
+		return dataList, err
+	}
+	return dataList, nil
+}
+
+func (d *Dao) GetHOUSENAME(codeList []string) ([]map[string]string, error) {
+	rows := d.db.NewSession()
+	dataList, err := rows.SQL(fmt.Sprintf(`select c.COW_NUM,
+	h.HOUSE_NAME ,c.REGIST_NUM_2, c.FARM_UUID from t_nz_cow c  JOIN t_jc_house h  ON c.HOUSE_UUID = h.UUID  
+	                                          where c.del = 0  and c.REGIST_NUM_2 in(%s)`, strings.Join(codeList, ","))).QueryString()
+	if err != nil {
+		err = errors.Wrap(err, "GetFactoryidByREGISTNUM2-db-error")
+		log.Error(err)
+		return dataList, err
+	}
+
+	return dataList, nil
+}
+
+func (d *Dao) GetNeckRingListingIDByFactoryId(factoryId []int64) ([]*model.NeckRingListing, error) {
+	rows := d.db.NewSession()
+	defer rows.Close()
+	dataList := make([]*model.NeckRingListing, 0)
+
+	rows.In("factoryid", factoryId)
+	rows.Where("recall = 0")
+	err := rows.Cols("REGIST_NUM_2").Find(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetNeckRingListingIDByFactoryId-db-error")
+		log.Error(err)
+		return dataList, err
+	}
+	return dataList, err
+}

+ 99 - 0
internal/dao/public.go

@@ -0,0 +1,99 @@
+package dao
+
+import (
+	"demo/internal/model"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+)
+
+func (d *Dao) GetBarList(index, pagesize int64, barName, pastureid string) ([]*model.Bar, int64, error) {
+	dataList := make([]*model.Bar, 0)
+	rows := d.db.NewSession()
+	defer rows.Close()
+
+	if pastureid != "" {
+		rows.Where("FARM_UUID = ?", pastureid)
+	}
+	if barName != "" {
+		rows.Where("HOUSE_NAME = ?", barName)
+	}
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+
+	count, err := rows.FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetBarList-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+	return dataList, count, nil
+}
+
+func (d *Dao) GetPastureList(index, pagesize int64) ([]*model.Pasture, int64, error) {
+	dataList := make([]*model.Pasture, 0)
+	rows := d.db.NewSession()
+	defer rows.Close()
+
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+
+	count, err := rows.FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetPastureList-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+	return dataList, count, nil
+}
+
+func (d *Dao) GetHousephyList(index, pagesize int64, pastureId string) ([]*model.Housephy, int64, error) {
+	dataList := make([]*model.Housephy, 0)
+	rows := d.db.NewSession()
+	defer rows.Close()
+
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+
+	rows.Where("FARM_UUID = ?", pastureId)
+	rows.Where("DEL = 0")
+	count, err := rows.OrderBy("PHYSICALCODE").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetHousephyList-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+	return dataList, count, nil
+}
+
+func (d *Dao) UpdateHousephyImage(housephy *model.Housephy) error {
+	rows := d.db.NewSession()
+	defer rows.Close()
+
+	_, err := rows.Cols("image").Where("UUID = ? ", housephy.Id).Update(housephy)
+	if err != nil {
+		err = errors.Wrap(err, "UpdateHousephyImage-db-error")
+		log.Error(err)
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) GetHousephyImage(id string) (*model.Housephy, error) {
+	rows := d.db.NewSession()
+	defer rows.Close()
+
+	housephy := new(model.Housephy)
+	_, err := rows.Where("UUID = ? ", id).Get(housephy)
+	if err != nil {
+		err = errors.Wrap(err, "GetHousephyImage-db-error")
+		log.Error(err)
+		return nil, err
+	}
+	return housephy, nil
+}

+ 137 - 0
internal/dao/recall.go

@@ -0,0 +1,137 @@
+package dao
+
+import (
+	"demo/internal/model"
+	"fmt"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+	"time"
+)
+
+func (d *Dao) AddRecall(arg model.Factory, factory []int64, REGISTNUM2 []string) error {
+	row := d.db.NewSession()
+	defer row.Close()
+	row.Begin()
+
+	c := time.Now().Format("20060102")
+
+	count1, err := row.Where(" batch like ? ", "%"+fmt.Sprintf("RB%s", c)+"%").Count(&model.Factory{})
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+
+	count1 = count1 + 1
+	var batch string
+	//for i := 0; i <= int(count1); i++ {
+	batch = fmt.Sprintf("RB%s", c)
+	//	//count1 = count1 + 1
+	num := 3 - len(fmt.Sprintf("%d", count1))
+	for n := 0; n < num; n++ {
+		batch = fmt.Sprintf("%s0", batch)
+	}
+
+	neckRingList := make([]*model.NeckRingListing, 0)
+	err = row.In("REGIST_NUM_2", REGISTNUM2).Find(&neckRingList)
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+
+	factorymap := make(map[int64]int64)
+	for _, n := range neckRingList {
+		factorymap[n.FactoryId] = 1
+	}
+
+	arg.Batch = batch
+	arg.Count = int64(len(REGISTNUM2))
+	arg.Recall = int64(len(factorymap))
+	_, err = row.Insert(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+
+	deliveryandrecallList := make([]*model.DeliveryAndRecall, 0)
+	for _, item := range neckRingList {
+		var deliveryandrecall model.DeliveryAndRecall
+		deliveryandrecall.FactoryId = arg.Id
+		deliveryandrecall.Status = 1
+		deliveryandrecall.RecallId = item.FactoryId
+		deliveryandrecall.REGISTNUM2 = item.Code
+		deliveryandrecallList = append(deliveryandrecallList, &deliveryandrecall)
+	}
+
+	_, err = row.Insert(&deliveryandrecallList)
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+
+	row.Cols("recall").In("REGIST_NUM_2", REGISTNUM2).Update(&model.NeckRingListing{Recall: 1})
+	err = row.Commit()
+	if err != nil {
+		err = errors.Wrap(err, "AddRecall-db-error")
+		log.Error(err)
+		row.Rollback()
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) GetRecall(index, pagesize int64, pastureid, batch string, startCount, endCount int64, createName, startDate, endDate string, factoryID, replacement int64) ([]*model.FactoryList, int64, error) {
+	rows := d.db.NewSession()
+	defer rows.Close()
+	rows.Table("factory").Alias("f")
+	rows.Join("inner", []string{"t_nz_farm", "fa"}, "f.FARM_UUID=fa.UUID")
+
+	if batch != "" {
+		rows.Where(" f.batch like ? ", "%"+batch+"%")
+	}
+
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+
+	if startCount > 0 {
+		rows.Where(" f.count >= ? ", startCount)
+	}
+	if endCount > 0 {
+		rows.Where(" f.count <= ? ", endCount)
+	}
+	if createName != "" {
+		rows.Where(" f.createname like ? ", "%"+createName+"%")
+	}
+	if pastureid != "" {
+		rows.Where(" f.FARM_UUID = ? ", pastureid)
+	}
+	if startDate != "" && endDate != "" {
+		rows.Where(" f.createtime between ? and ? ", startDate, endDate)
+	}
+	if factoryID > 0 {
+		rows.Where("f.id in(select  recallid from deliveryandrecall where factoryid = ? and status = 0)", factoryID)
+	}
+	if replacement == 1 {
+		rows.Where("( select count(1) from  deliveryandrecall where recallid = f.id) =0 ")
+	}
+
+	rows.Where("f.genre = 2")
+	dataList := make([]*model.FactoryList, 0)
+	count, err := rows.Desc("f.createtime").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetRecall-db-error")
+		log.Error(err)
+		return dataList, count, err
+	}
+
+	return dataList, count, nil
+}

+ 139 - 0
internal/dao/receiver.go

@@ -0,0 +1,139 @@
+package dao
+
+import (
+	"demo/internal/model"
+	"github.com/pkg/errors"
+	uuid "github.com/satori/go.uuid"
+	"github.com/siddontang/go/log"
+)
+
+func (d *Dao) GetReceiverList(index, pagesize int64, code string, status int64) ([]*model.ListReceiver, int64, error) {
+	rows := d.db.Table("t_sb_device_connection").Alias("s")
+	rows.Join("left", []string{"sim", "s1"}, "s1.id=s.simid")
+	rows.Join("inner", []string{"t_jc_housephy", "h"}, "s.PHYHOUSE_UUID=h.UUID")
+	rows.Join("inner", []string{"t_nz_farm", "f"}, "s.FARM_UUID=f.uuid")
+
+	rows.Select("s.ID, s.UUID, s.DEVICE_NAME, s.DEVICE_SECRET,  s.`HOST`, s.TOPIC_NAME, s.IMEI, f.FARM_NUM, " +
+		"s.FARM_UUID, f.FARM_NAME, s.PHYHOUSE_UUID, h.PHYSICALCODE, h.PHYSICALNAME,s.DEVICE_ADDRESS,s1.card,s1.id,s.status,s.updatedate,s.coordinates,h.image")
+
+	rows.Where("s.TYPE='meck' AND IFNULL(s.DEL, 0)=0")
+	defer rows.Close()
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+	if code != "" {
+		rows.Where("s.IMEI = ? ", code)
+	}
+	if status != -1 {
+		rows.Where("s.status = ? ", status)
+	}
+
+	dataList := make([]*model.ListReceiver, 0)
+	count, err := rows.Desc("s.LAST_UPDATE_DATE").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetReceiverList-db-error")
+		log.Error(err)
+		return dataList, 0, err
+	}
+
+	return dataList, count, nil
+}
+
+func (d *Dao) AddReceiver(arg model.Receiver) error {
+	arg.TYPE = "meck"
+	arg.UUID = uuid.NewV4().String()
+	_, err := d.db.Insert(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "AddReceiver-db-error")
+		log.Error(err)
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) EditReceiver(arg model.Receiver) error {
+	_, err := d.db.Where("id = ?", arg.Id).Cols("IMEI,FARM_UUID,PHYHOUSE_UUID,updatedate,DEL,status,simid").Update(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "EditReceiver-db-error")
+		log.Error(err)
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) GetReceiverPull() ([]*model.Receiver, error) {
+	dataList := make([]*model.Receiver, 0)
+	err := d.db.Select("id,IMEI").Where("TYPE='meck' ").And(" IFNULL(DEL, 0)=0").
+		And(" ( select count(1) from sim where sim.id =  t_sb_device_connection.simid ) = 0 ").Find(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetReceiverPull-db-error")
+		log.Error(err)
+		return dataList, err
+	}
+	return dataList, nil
+}
+
+func (d *Dao) GetReceiverByPHYHOUSEUUID(PHYHOUSEUUID string) ([]*model.Receiver, error) {
+	rows := d.db.NewSession()
+	defer rows.Close()
+
+	rows.Where("PHYHOUSE_UUID = ? ", PHYHOUSEUUID)
+	rows.Where("TYPE = ? ", "meck")
+	rows.Where("DEL = 0 or del is null")
+
+	dataList := make([]*model.Receiver, 0)
+	err := rows.Cols("id,status,coordinates,FARM_UUID").OrderBy("CREATION_DATE").Find(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetReceiverByPHYHOUSEUUID-db-error")
+		log.Error(err)
+		return dataList, err
+	}
+	return dataList, nil
+}
+
+func (d *Dao) UpdateReceiverById(data []*model.Receiver) error {
+	rows := d.db.NewSession()
+	rows.Begin()
+	for _, item := range data {
+		_, err := rows.Cols("status,coordinates").Where("ID = ? ", item.Id).Update(item)
+		if err != nil {
+			err = errors.Wrap(err, "UpdateReceiverById-db-error")
+			log.Error(err)
+			rows.Rollback()
+			return err
+		}
+	}
+
+	return rows.Commit()
+}
+
+func (d *Dao) UpdateReceiverSimId(data *model.Receiver) error {
+	rows := d.db.NewSession()
+	rows.Begin()
+	//for _, item := range data {
+	if data.Id > 0 {
+		rows.Where("ID = ? ", data.Id)
+	} else {
+		rows.Where("simid = ? ", data.SimID)
+		data.SimID = 0
+	}
+	_, err := rows.Cols("simid").Update(data)
+	if err != nil {
+		err = errors.Wrap(err, "UpdateReceiverById-db-error")
+		log.Error(err)
+		rows.Rollback()
+		return err
+	}
+
+	return rows.Commit()
+}
+
+func (d *Dao) CheckReceiverCode(id int64, IMEI string) (bool, error) {
+	rows := d.db.NewSession().Table(new(model.Receiver).TableName())
+	rows.Close()
+	if id != 0 {
+		rows.Where("id != ? ", id)
+	}
+	return rows.Where("IMEI = ? ", IMEI).Exist()
+}

+ 93 - 0
internal/dao/sim.go

@@ -0,0 +1,93 @@
+package dao
+
+import (
+	"demo/internal/model"
+	"github.com/pkg/errors"
+	"github.com/siddontang/go/log"
+)
+
+func (d *Dao) GetSimList(index, pagesize int64, card, company string, status int64) ([]*model.ListSim, int64, error) {
+	rows := d.db.Table("sim").Alias("s")
+	rows.Join("left", []string{"t_sb_device_connection", "r"}, "r.simid = s.id")
+	rows.Join("left", []string{"t_nz_farm", "p"}, "r.FARM_UUID = p.UUID")
+	rows.Join("left", []string{"t_jc_housephy", "h"}, "r.PHYHOUSE_UUID=h.UUID")
+	rows.Select("s.*,r.IMEI, p.FARM_NAME,h.PHYSICALNAME as bname,p.FARM_NUM")
+	defer rows.Close()
+	if index != 0 && pagesize != 0 {
+		first := (index - 1) * pagesize
+		rows.Limit(int(pagesize), int(first))
+	}
+	if card != "" {
+		rows.Where("s.card = ? ", card)
+	}
+	if company != "" {
+		rows.Where("s.company = ? ", company)
+	}
+	if status != -1 {
+		rows.Where("s.status = ? ", status)
+	}
+
+	dataList := make([]*model.ListSim, 0)
+	count, err := rows.Desc("s.purchasedate").FindAndCount(&dataList)
+	if err != nil {
+		err = errors.Wrap(err, "GetSimList-db-error")
+		log.Error(err)
+		return dataList, 0, err
+	}
+
+	return dataList, count, nil
+}
+
+func (d *Dao) AddSim(arg model.Sim) (int64, error) {
+	_, err := d.db.Insert(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "AddSim-db-error")
+		log.Error(err)
+		return 0, err
+	}
+	return arg.Id, nil
+}
+
+func (d *Dao) EditSim(arg model.Sim) error {
+	_, err := d.db.Where("id = ?", arg.Id).
+		Cols("card,totalflow,used,remaining,company,purchasedate,activatedate,topupdate,enddate,status,receiverid,pastureid,barid,barname ").Update(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "EditSim-db-error")
+		log.Error(err)
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) GetSimPull() ([]*model.Sim, error) {
+	dataList := make([]*model.Sim, 0)
+	err := d.db.Select("id,card").Where("status = 1 ").
+		Where(" (select count(1)  from  t_sb_device_connection where sim.id = t_sb_device_connection.simid ) = 0 ").Find(&dataList)
+
+	if err != nil {
+		err = errors.Wrap(err, "GetSimPull-db-error")
+		log.Error(err)
+		return dataList, err
+	}
+	return dataList, nil
+}
+
+func (d *Dao) EditSimReceiverid(arg model.Sim) error {
+	_, err := d.db.Where("id = ?", arg.Id).
+		Cols("receiverid ").Update(&arg)
+	if err != nil {
+		err = errors.Wrap(err, "EditSim-db-error")
+		log.Error(err)
+		return err
+	}
+	return nil
+}
+
+func (d *Dao) CheckSimCode(id int64, card string) (bool, error) {
+	rows := d.db.NewSession().Table(new(model.Sim).TableName())
+	rows.Close()
+	if id != 0 {
+		rows.Where("id != ? ", id)
+	}
+	return rows.Where("card = ? ", card).Exist()
+}

+ 19 - 0
internal/dao/sync.go

@@ -0,0 +1,19 @@
+package dao
+
+import (
+	"demo/internal/model"
+
+	"github.com/go-xorm/xorm"
+)
+
+func SyncTable(OutDB *xorm.Engine) error {
+	return OutDB.Sync(
+		new(model.DeliveryAndRecall),
+		new(model.Receiver),
+		new(model.Sim),
+		new(model.Factory),
+		new(model.Recall),
+		new(model.Management),
+		new(model.ManagementBh),
+	)
+}

+ 0 - 0
internal/logic/.gitkeep


+ 51 - 0
internal/middleware/jwt/jwt.go

@@ -0,0 +1,51 @@
+package jwt
+
+import (
+	"demo/internal/app"
+	"demo/internal/util"
+	"github.com/dgrijalva/jwt-go"
+	"github.com/gogf/gf/v2/net/ghttp"
+)
+
+//r *ghttp.Request
+func JWT(r *ghttp.Request) {
+	var code int
+	var data interface{}
+
+	code = app.SUCCESS
+	Authorization := r.GetHeader("token")
+	token := Authorization
+	if Authorization == "" {
+		code = app.INVALID_PARAMS
+	} else {
+		_, err := util.ParseToken(token)
+		if err != nil {
+			switch err.(*jwt.ValidationError).Errors {
+			case jwt.ValidationErrorExpired:
+				code = app.ERROR_AUTH_CHECK_TOKEN_TIMEOUT
+			default:
+				code = app.ERROR_AUTH_CHECK_TOKEN_FAIL
+			}
+		}
+	}
+
+	if code != app.SUCCESS {
+		r.Response.WriteJson(map[string]interface{}{
+			"code": code,
+			"msg":  "登录超时",
+			"data": data,
+		})
+		return
+	}
+
+	t, _ := jwt.Parse(token, func(*jwt.Token) (interface{}, error) {
+		return util.JwtSecret, nil
+	})
+
+	//r.Context().Value()
+
+	//r.Context().Value("jwt_username") = util.GetIdFromClaims("username", t.Claims)
+	//r.Set
+	r.SetCtxVar("jwt_username", util.GetIdFromClaims("username", t.Claims))
+	r.Middleware.Next()
+}

+ 12 - 0
internal/model/bar.go

@@ -0,0 +1,12 @@
+package model
+
+type Bar struct {
+	Id        string `xorm:"'uuid'"`
+	Pastureid string `xorm:"varchar(30)  'FARM_UUID'"`
+	Bname     string `xorm:"varchar(20)   'HOUSE_NAME'"`
+	Bcode     string `xorm:"varchar(20)   'HOUSE_NUM'"`
+}
+
+func (s *Bar) TableName() string {
+	return "t_jc_house"
+}

+ 13 - 0
internal/model/deliveryandrecall.go

@@ -0,0 +1,13 @@
+package model
+
+// 脖环出厂登记和脖环召回关联表
+type DeliveryAndRecall struct {
+	FactoryId  int64 `xorm:"bigint(20)  'factoryid'"` //出厂登记id
+	RecallId   int64 `xorm:"bigint(20)  'recallid'"`  //召回id
+	Status     int64 `xorm:"int(1)  'status'"`        //0 出厂登记,1 脖环召回
+	REGISTNUM2 int64 `xorm:"int(11)  'REGIST_NUM_2'"` //召回id
+}
+
+func (s *DeliveryAndRecall) TableName() string {
+	return "deliveryandrecall"
+}

+ 24 - 0
internal/model/factory.go

@@ -0,0 +1,24 @@
+package model
+
+import "time"
+
+// 脖环出厂登记
+type Factory struct {
+	Id         int64     `xorm:"pk autoincr 'id'"`
+	Pastureid  string    `xorm:"varchar(80)  'FARM_UUID'"`  //牧场id
+	Count      int64     `xorm:"int(11)  'count'"`          //出厂数量
+	Batch      string    `xorm:"varchar(30)  'batch'"`      //出厂批次
+	Genre      int64     `xorm:"int(1)  'genre'"`           //0 购买,1 置换 2召回
+	Recall     int64     `xorm:"int(11)  'recall'"`         //关联召回批次数
+	CreateName string    `xorm:"varchar(30)  'createname'"` //登记人
+	CreateTime time.Time `xorm:"DATETIME 'createtime'"`     //登记时间
+}
+
+func (s *Factory) TableName() string {
+	return "factory"
+}
+
+type FactoryList struct {
+	Factory     `xorm:"extends"`
+	PastureName string `xorm:"FARM_NAME"`
+}

+ 13 - 0
internal/model/housephy.go

@@ -0,0 +1,13 @@
+package model
+
+type Housephy struct {
+	Id        string `xorm:"'uuid'"`
+	Pastureid string `xorm:"varchar(30)  'FARM_UUID'"`
+	Bname     string `xorm:"varchar(30)   'PHYSICALNAME'"`
+	Bcode     string `xorm:"varchar(30)   'PHYSICALCODE'"`
+	Image     string `xorm:"image"`
+}
+
+func (s *Housephy) TableName() string {
+	return "t_jc_housephy"
+}

+ 24 - 0
internal/model/jbqtj.go

@@ -0,0 +1,24 @@
+package model
+
+import "time"
+
+type JBQTJ struct {
+	Id              int64     `xorm:"id"`
+	FARMUUID        string    `xorm:"FARM_UUID"`
+	FARMNAME        string    `xorm:"FARM_NAME"`         //牛场名称
+	NbAdult         int64     `xorm:"nb_adult"`          //成母牛数
+	NbMilkno        int64     `xorm:"nb_milkno"`         //泌乳牛未佩戴脖环数
+	NbUse           int64     `xorm:"nb_use"`            //佩戴脖环数
+	Nmb             int64     `xorm:"nmb"`               //实际运行脖环数量
+	NbErr           int64     `xorm:"nb_err"`            //异常脖环数量
+	NbJbqrecInstall int64     `xorm:"nb_jbqrec_install"` //接收器安装数量
+	NbJbqrec        int64     `xorm:"nb_jbqrec"`         //接收器工作数量
+	P8h             int64     `xorm:"p8h"`               //8小时接收率
+	NbLost          int64     `xorm:"nbLost"`            //记录丢失牛只数
+	SumLost         int64     `xorm:"sumLost"`           //丢失记录数
+	Createtime      time.Time `xorm:"createtime"`        //创建时间
+}
+
+func (s *JBQTJ) TableName() string {
+	return "t_nz_jbqtj"
+}

+ 22 - 0
internal/model/management.go

@@ -0,0 +1,22 @@
+package model
+
+import "time"
+
+//脖环管理
+type Management struct {
+	Id         int64     `xorm:"pk autoincr 'id'"`
+	Pastureid  string    `xorm:"varchar(80)  'FARM_UUID'"` //牧场id
+	Count      int64     `xorm:"int(11)  'count'"`         //出厂数量
+	Genre      int64     `xorm:"int(1)  'genre'"`          //0 售卖,1 返厂 2 置换
+	Recall     int64     `xorm:"int(11)  'recall'"`        //关联召回批次数
+	ImportTime time.Time `xorm:"DATETIME 'importdate'"`    //导入时间
+}
+
+func (s *Management) TableName() string {
+	return "management"
+}
+
+type ManagementList struct {
+	Management  `xorm:"extends"`
+	PastureName string `xorm:"FARM_NAME"`
+}

+ 13 - 0
internal/model/management_bh.go

@@ -0,0 +1,13 @@
+package model
+
+import "time"
+
+type ManagementBh struct {
+	ManagementID int64     `xorm:"bigint(20)  'managementid'"`          //脖环管理ID
+	Code         string    `xorm:"varchar(80) notnull  'REGIST_NUM_2'"` //脖环编码
+	Date         time.Time `xorm:"DATE 'date'"`                         //日期
+}
+
+func (s *ManagementBh) TableName() string {
+	return "management_bh"
+}

+ 28 - 0
internal/model/neckringlisting.go

@@ -0,0 +1,28 @@
+package model
+
+import "time"
+
+type NeckRingListing struct {
+	Id        int64  `xorm:"pk autoincr 'id'"`
+	Pastureid string `xorm:"varchar(30)  'FARM_UUID'"`            //牧场uuid
+	Code      int64  `xorm:"varchar(20) notnull  'REGIST_NUM_2'"` //脖环编码
+	//Status       int64     `xorm:"int(1)  'status'"`                    //脖环状态
+	PurchaseDate time.Time `xorm:"DATETIME 'BUY_DATE'"`     //购入日期
+	EndDate      time.Time `xorm:"DATETIME 'STOP_DATE'"`    //停用日期
+	FactoryId    int64     `xorm:"bigint(11)  'factoryid'"` //出厂登记id
+	CreateDate   time.Time `xorm:"DATETIME 'CREATETIME'"`   //购入日期
+	Recall       int64     `xorm:"recall"`
+}
+
+func (s *NeckRingListing) TableName() string {
+	return "t_nz_jbqid"
+}
+
+type NeckRingListingList struct {
+	NeckRingListing `xorm:"extends"`
+	Cattle          string    `xorm:"COW_NUM"`
+	BarName         string    `xorm:"HOUSE_NAME"`
+	ManufactureDate time.Time `xorm:"createtime"`
+	Status          int64     `xorm:"status"`
+	Batch           string    `xorm:"batch"` //出厂批次
+}

+ 11 - 0
internal/model/pasture.go

@@ -0,0 +1,11 @@
+package model
+
+type Pasture struct {
+	PastureCode string `xorm:"varchar(50)   'FARM_NUM'"`
+	Pastureid   string `xorm:"varchar(30)  'uuid'"`
+	PastureName string `xorm:"varchar(30)  'FARM_NAME'"`
+}
+
+func (s *Pasture) TableName() string {
+	return "t_nz_farm"
+}

+ 18 - 0
internal/model/recall.go

@@ -0,0 +1,18 @@
+package model
+
+import "time"
+
+// 脖环召回记录
+type Recall struct {
+	Id         int64     `xorm:"pk autoincr 'id'"`
+	Pastureid  string    `xorm:"varchar(30)  'pastureid'"`  //牧场id
+	Count      int64     `xorm:"int(11)  'count'"`          //召回数量
+	Batch      string    `xorm:"varchar(30)  'batch'"`      //召回批次
+	Factory    int64     `xorm:"int(11)  'factory'"`        //关联召回批次数
+	CreateName string    `xorm:"varchar(30)  'createname'"` //登记人
+	CreateTime time.Time `xorm:"DATETIME 'createtime'"`     //登记时间
+}
+
+func (s *Recall) TableName() string {
+	return "recall"
+}

+ 29 - 0
internal/model/receiver.go

@@ -0,0 +1,29 @@
+package model
+
+import "time"
+
+type Receiver struct {
+	Id        int64  `xorm:"'id'"`
+	IMEI      string `xorm:"varchar(80)  'IMEI'"`      //牧场id
+	Pastureid string `xorm:"varchar(30)  'FARM_UUID'"` //牧场uuid
+	//Location    string    `xorm:"varchar(30)  'DEVICE_ADDRESS'"` //设备位置(1:奶厅1,2:奶厅2)
+	BarId       string    `xorm:"varchar(110)  'PHYHOUSE_UUID'"` //栏舍名称
+	UpdateDate  time.Time `xorm:"DATETIME 'updatedate'"`         //最后修改时间
+	SimID       int64     `xorm:"bigint(20)  'simid'"`
+	Status      int64     `xorm:"int(1)  'status'"` //是否删除(0:否,1:是
+	UUID        string    `xorm:"varchar(80)  'uuid'"`
+	TYPE        string    `xorm:"varchar(80)  'TYPE'"`
+	Coordinates string    `xorm:"coordinates"`
+}
+
+func (s *Receiver) TableName() string {
+	return "t_sb_device_connection"
+}
+
+type ListReceiver struct {
+	Receiver `xorm:"extends"`
+	Sim      `xorm:"extends"`
+	Pasture  `xorm:"extends"`
+	BarName  string `xorm:"PHYSICALNAME"`
+	Image    string `xorm:"image"`
+}

+ 31 - 0
internal/model/sim.go

@@ -0,0 +1,31 @@
+package model
+
+import "time"
+
+type Sim struct {
+	Id           int64     `xorm:"pk autoincr 'id'"`
+	Card         string    `xorm:"varchar(50) notnull  'card'"` //sim卡号
+	TotalFlow    string    `xorm:"varchar(30)  'totalflow'"`    //总流量
+	Used         string    `xorm:"varchar(30)  'used'"`         //已用流量
+	Remaining    string    `xorm:"varchar(30)  'remaining'"`    //剩余流量
+	Company      string    `xorm:"varchar(30)  'company'"`      //公司
+	PurchaseDate time.Time `xorm:"DATETIME 'purchasedate'"`     //购入日期
+	ActivateDate time.Time `xorm:"DATETIME 'activatedate'"`     //激活日期
+	TopUpDate    time.Time `xorm:"DATETIME 'topupdate'"`        //充值日期
+	EndDate      time.Time `xorm:"DATETIME 'enddate'"`          //充值日期
+	Status       int64     `xorm:"int(1)  'status'"`            //状态
+	ReceiverId   int64     `xorm:"bigint(20)  'receiverid'"`    //接收器id
+	Pastureid    string    `xorm:"varchar(110)  'FARM_UUID'"`   //牧场id
+
+}
+
+func (s *Sim) TableName() string {
+	return "sim"
+}
+
+type ListSim struct {
+	Sim      `xorm:"extends"`
+	Receiver `xorm:"extends"`
+	Pasture  `xorm:"extends"`
+	BarName  string `xorm:"bname"`
+}

BIN
internal/servefile/无标题.xlsx


+ 0 - 0
internal/service/.gitkeep


+ 148 - 0
internal/setting/setting.go

@@ -0,0 +1,148 @@
+package setting
+
+import (
+	"errors"
+	"github.com/go-ini/ini"
+	"github.com/jacobsa/go-serial/serial"
+	"log"
+	"os"
+	"os/exec"
+	"path/filepath"
+	"runtime"
+	"strings"
+	"time"
+)
+
+type App struct {
+	JwtSecret string
+	PageSize  int
+	PrefixUrl string
+
+	RuntimeRootPath string
+
+	FileSavePath  string
+	FileMaxSize   int      // 普通文件上传的限制大小,单位byte, 最大单位1GB
+	FileAllowType []string // 允许上传的文件后缀名
+
+	ImageSavePath  string
+	ImageMaxSize   int
+	ImageAllowExts []string
+
+	ThumbnailSavePath  string
+	ThumbnailMaxWidth  int
+	ThumbnailMaxHeight int
+
+	ExportSavePath string
+	QrCodeSavePath string
+	FontSavePath   string
+
+	LogSavePath string
+	LogSaveName string
+	LogFileExt  string
+	TimeFormat  string
+}
+
+var AppSetting = &App{}
+
+type Server struct {
+	RunMode          string
+	HttpPort         int
+	ReadTimeout      time.Duration
+	WriteTimeout     time.Duration
+	NoAuth           int
+	Mdns_servicename string
+	Mdns_serviceport int
+	HttpsPort        int
+	Https            int
+	CrtPath          string
+	KeyPath          string
+	ServerName       string
+	DisplayName      string
+	Description      string
+	GRFD             string
+	GRFDURL          string
+}
+
+var ServerSetting = &Server{}
+
+var CommSetting = &serial.OpenOptions{}
+var SnowIds *IdWorker
+
+type Database struct {
+	Type          string
+	User          string
+	Password      string
+	Host          string
+	Name          string
+	ShowXormlog   bool
+	ShowGetSqllog bool
+	CacheApiSql   bool
+	TablePrefix   string
+}
+
+var DatabaseSetting = &Database{}
+
+var cfg *ini.File
+
+var CurrentPath string
+
+func GetCurrentPath() (string, error) {
+	file, err := exec.LookPath(os.Args[0])
+	if err != nil {
+		return "", err
+	}
+	path, err := filepath.Abs(file)
+	if err != nil {
+		return "", err
+	}
+	//fmt.Println("path111:", path)
+	if runtime.GOOS == "windows" {
+		path = strings.Replace(path, "\\", "/", -1)
+	}
+	//fmt.Println("path222:", path)
+	i := strings.LastIndex(path, "/")
+	if i < 0 {
+		return "", errors.New(`Can't find "/" or "\".`)
+	}
+	//fmt.Println("path333:", path)
+	return string(path[0 : i+1]), nil
+}
+func Setup(dir string) {
+	var err error
+	if strings.Trim(dir, " ") == "" {
+		CurrentPath, err = GetCurrentPath()
+	} else {
+		CurrentPath = dir
+	}
+	cfg, err = ini.Load(CurrentPath + "conf/app.ini")
+	if err != nil {
+		log.Fatalf("setting.Setup, fail to parse 'conf/app.ini': %v", err)
+	}
+
+	SnowIds, err = NewIdWorker(1)
+	if err != nil {
+		log.Fatalf("setting.Setup, fail to create SnowIds: %v", err)
+	}
+	DatabaseSetting.ShowXormlog = false
+	DatabaseSetting.ShowGetSqllog = false
+	DatabaseSetting.CacheApiSql = false
+	mapTo("app", AppSetting)
+	mapTo("server", ServerSetting)
+	mapTo("database", DatabaseSetting)
+	mapTo("comm", CommSetting)
+
+	AppSetting.ImageMaxSize = AppSetting.ImageMaxSize * 1024 * 1024
+	ServerSetting.ReadTimeout = ServerSetting.ReadTimeout * time.Second
+	ServerSetting.WriteTimeout = ServerSetting.ReadTimeout * time.Second
+
+	ServerSetting.CrtPath = CurrentPath + ServerSetting.CrtPath
+	ServerSetting.KeyPath = CurrentPath + ServerSetting.KeyPath
+
+}
+
+func mapTo(section string, v interface{}) {
+	err := cfg.Section(section).MapTo(v)
+	if err != nil {
+		log.Fatalf("Cfg.MapTo RedisSetting err: %v", err)
+	}
+}

+ 120 - 0
internal/setting/snowflake.go

@@ -0,0 +1,120 @@
+package setting
+
+import (
+	"errors"
+	"fmt"
+	"sync"
+	"time"
+)
+
+const (
+	twepoch        = int64(1417937700000) // 默认起始的时间戳 1449473700000 。计算时,减去这个值
+	DistrictIdBits = uint(5)              //区域 所占用位置
+	NodeIdBits     = uint(9)              //节点 所占位置
+	sequenceBits   = uint(10)             //自增ID 所占用位置
+
+	/*
+	 * 1 符号位  |  39 时间戳                                     | 5 区域  |  9 节点       | 10 (毫秒内)自增ID
+	 * 0        |  0000000 00000000 00000000 00000000 00000000  | 00000  | 000000 000   |  000000 0000
+	 *
+	 */
+	maxNodeId     = -1 ^ (-1 << NodeIdBits)     //节点 ID 最大范围
+	maxDistrictId = -1 ^ (-1 << DistrictIdBits) //最大区域范围
+
+	nodeIdShift        = sequenceBits //左移次数
+	DistrictIdShift    = sequenceBits + NodeIdBits
+	timestampLeftShift = sequenceBits + NodeIdBits + DistrictIdBits
+	sequenceMask       = -1 ^ (-1 << sequenceBits)
+	maxNextIdsNum      = 100 //单次获取ID的最大数量
+)
+
+type IdWorker struct {
+	sequence      int64 //序号
+	lastTimestamp int64 //最后时间戳
+	nodeId        int64 //节点ID
+	twepoch       int64
+	districtId    int64
+	mutex         sync.Mutex
+}
+
+// NewIdWorker new a snowflake id generator object.
+func NewIdWorker(NodeId int64) (*IdWorker, error) {
+	var districtId int64
+	districtId = 1 //暂时默认给1 ,方便以后扩展
+	idWorker := &IdWorker{}
+	if NodeId > maxNodeId || NodeId < 0 {
+		fmt.Sprintf("NodeId Id can't be greater than %d or less than 0", maxNodeId)
+		return nil, errors.New(fmt.Sprintf("NodeId Id: %d error", NodeId))
+	}
+	if districtId > maxDistrictId || districtId < 0 {
+		fmt.Sprintf("District Id can't be greater than %d or less than 0", maxDistrictId)
+		return nil, errors.New(fmt.Sprintf("District Id: %d error", districtId))
+	}
+	idWorker.nodeId = NodeId
+	idWorker.districtId = districtId
+	idWorker.lastTimestamp = -1
+	idWorker.sequence = 0
+	idWorker.twepoch = twepoch
+	idWorker.mutex = sync.Mutex{}
+	fmt.Sprintf("worker starting. timestamp left shift %d, District id bits %d, worker id bits %d, sequence bits %d, workerid %d", timestampLeftShift, DistrictIdBits, NodeIdBits, sequenceBits, NodeId)
+	return idWorker, nil
+}
+
+// timeGen generate a unix millisecond.
+func timeGen() int64 {
+	return time.Now().UnixNano() / int64(time.Millisecond)
+}
+
+// tilNextMillis spin wait till next millisecond.
+func tilNextMillis(lastTimestamp int64) int64 {
+	timestamp := timeGen()
+	for timestamp <= lastTimestamp {
+		timestamp = timeGen()
+	}
+	return timestamp
+}
+
+// NextId get a snowflake id.
+func (id *IdWorker) NextId() (int64, error) {
+	id.mutex.Lock()
+	defer id.mutex.Unlock()
+	return id.nextid()
+}
+
+// NextIds get snowflake ids.
+func (id *IdWorker) NextIds(num int) ([]int64, error) {
+	if num > maxNextIdsNum || num < 0 {
+		fmt.Sprintf("NextIds num can't be greater than %d or less than 0", maxNextIdsNum)
+		return nil, errors.New(fmt.Sprintf("NextIds num: %d error", num))
+	}
+	ids := make([]int64, num)
+	id.mutex.Lock()
+	defer id.mutex.Unlock()
+	for i := 0; i < num; i++ {
+		ids[i], _ = id.nextid()
+	}
+	return ids, nil
+}
+
+func (id *IdWorker) nextid() (int64, error) {
+	//取毫秒时间戳
+	timestamp := timeGen()
+	//id.lastTimestamp 最后的时间戳
+	if timestamp < id.lastTimestamp {
+		//    fmt.Sprintf("clock is moving backwards.  Rejecting requests until %d.", id.lastTimestamp)
+		return 0, errors.New(fmt.Sprintf("Clock moved backwards.  Refusing to generate id for %d milliseconds", id.lastTimestamp-timestamp))
+	}
+
+	// 最后时间戳 = 当前时间戳
+	if id.lastTimestamp == timestamp {
+		// sequence 序号
+		id.sequence = (id.sequence + 1) & sequenceMask
+		if id.sequence == 0 {
+			timestamp = tilNextMillis(id.lastTimestamp)
+		}
+	} else {
+		id.sequence = 0
+	}
+	id.lastTimestamp = timestamp
+	return ((timestamp - id.twepoch) << timestampLeftShift) | (id.districtId << DistrictIdShift) | (id.nodeId << nodeIdShift) | id.sequence, nil
+}

+ 63 - 0
internal/util/jwt.go

@@ -0,0 +1,63 @@
+package util
+
+import (
+	"demo/internal/setting"
+	"fmt"
+	"github.com/dgrijalva/jwt-go"
+	"reflect"
+	"time"
+)
+
+var JwtSecret = []byte(setting.AppSetting.JwtSecret)
+
+type Claims struct {
+	Username string `json:"username"`
+	Password string `json:"password"`
+	jwt.StandardClaims
+}
+
+func GenerateToken(username, password string) (string, error) {
+	nowTime := time.Now()
+	expireTime := nowTime.Add(12 * time.Hour)
+
+	claims := Claims{
+		username,
+		EncodeMD5(password),
+		jwt.StandardClaims{
+			ExpiresAt: expireTime.Unix(),
+			Issuer:    "https://github.com/kptyun/go-admin/",
+		},
+	}
+
+	tokenClaims := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
+	token, err := tokenClaims.SignedString(JwtSecret)
+	return token, err
+}
+
+func ParseToken(token string) (*Claims, error) {
+	tokenClaims, err := jwt.ParseWithClaims(token, &Claims{}, func(token *jwt.Token) (interface{}, error) {
+		return JwtSecret, nil
+	})
+
+	if tokenClaims != nil {
+		if claims, ok := tokenClaims.Claims.(*Claims); ok && tokenClaims.Valid {
+			return claims, nil
+		}
+	}
+
+	return nil, err
+}
+
+func GetIdFromClaims(key string, claims jwt.Claims) string {
+	v := reflect.ValueOf(claims)
+	if v.Kind() == reflect.Map {
+		for _, k := range v.MapKeys() {
+			value := v.MapIndex(k)
+
+			if fmt.Sprintf("%s", k.Interface()) == key {
+				return fmt.Sprintf("%v", value.Interface())
+			}
+		}
+	}
+	return ""
+}

+ 13 - 0
internal/util/md5.go

@@ -0,0 +1,13 @@
+package util
+
+import (
+	"crypto/md5"
+	"encoding/hex"
+)
+
+func EncodeMD5(value string) string {
+	m := md5.New()
+	m.Write([]byte(value))
+
+	return hex.EncodeToString(m.Sum(nil))
+}

+ 6 - 0
linux.bat

@@ -0,0 +1,6 @@
+set GOARCH=amd64
+set GOOS=linux
+go build -o neckring
+
+
+

+ 19 - 0
main.go

@@ -0,0 +1,19 @@
+package main
+
+import (
+	"demo/internal/controller"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gcfg"
+
+	// _ "demo/internal/packed"
+
+	"github.com/gogf/gf/v2/os/gctx"
+
+	"demo/internal/cmd"
+)
+
+func main() {
+	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("conf/config.yaml")
+	controller.RegisterDb()
+	cmd.Main.Run(gctx.New())
+}

+ 11 - 0
manifest/config/config.yaml

@@ -0,0 +1,11 @@
+server:
+  address:     ":8000"
+  openapiPath: "/api.json"
+  swaggerPath: "/swagger"
+
+logger:
+  level : "all"
+  stdout: true
+
+
+

+ 21 - 0
manifest/deploy/kustomize/base/deployment.yaml

@@ -0,0 +1,21 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: template-single
+  labels:
+    app: template-single
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: template-single
+  template:
+    metadata:
+      labels:
+        app: template-single
+    spec:
+      containers:
+        - name : main
+          image: template-single
+          imagePullPolicy: Always
+

+ 8 - 0
manifest/deploy/kustomize/base/kustomization.yaml

@@ -0,0 +1,8 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+- deployment.yaml
+- service.yaml
+
+
+

+ 12 - 0
manifest/deploy/kustomize/base/service.yaml

@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: template-single
+spec:
+  ports:
+  - port: 80
+    protocol: TCP
+    targetPort: 8000
+  selector:
+    app: template-single
+

+ 14 - 0
manifest/deploy/kustomize/overlays/develop/configmap.yaml

@@ -0,0 +1,14 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: template-single-configmap
+data:
+  config.yaml: |
+    server:
+      address:     ":8000"
+      openapiPath: "/api.json"
+      swaggerPath: "/swagger"
+
+    logger:
+      level : "all"
+      stdout: true

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است