Pārlūkot izejas kodu

add:微信支付

zoie 2 gadi atpakaļ
vecāks
revīzija
8f431ffd02

+ 4 - 0
conf/app.conf

@@ -34,6 +34,7 @@ Sms_Appid = "95559"
 Sms_Signature = "f8e63844edd79d5bd2ab4a3d92c3b820"
 Sms_Fee = 0.8
 
+
 VoiceCall_BaseUrl = "https://rtccall.cn-north-1.myhuaweicloud.cn:443"
 VoiceCall_AppKey = "Zy8539Sa61Iv5fo5iGNWLcV24KI1"
 VoiceCall_AppSecret = "KNZ3OFv8eVF7zO5smbr0160WS4Az"
@@ -41,3 +42,6 @@ VoiceCall_Template = "1101dc0ebc154a5a9e7c4e5f11bfdb41"
 VoiceCall_Phone = "+8651668971369"
 VoiceCall_Fee = 1.2
 
+Weixin_PwdKey = "oKk5Bbq4Cf1u2AJXjvj1a0h9tqk8sdfg"
+Weixin_Notify = "https://follow.baozhida.cn/api/Wx/Notify"
+

+ 2 - 0
conf/config.go

@@ -42,3 +42,5 @@ var VoiceCall_AppSecret, _ = beego.AppConfig.String("VoiceCall_AppSecret")
 var VoiceCall_Template, _ = beego.AppConfig.String("VoiceCall_Template")
 var VoiceCall_Phone, _ = beego.AppConfig.String("VoiceCall_Phone")
 var VoiceCall_Fee, _ = beego.AppConfig.Float("VoiceCall_Fee")
+var Weixin_PwdKey, _ = beego.AppConfig.String("Weixin_PwdKey")
+var Weixin_Notify, _ = beego.AppConfig.String("Weixin_Notify")

+ 1 - 1
controllers/Illness.go

@@ -2,10 +2,10 @@ package controllers
 
 import (
 	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/models/Account"
 	"FollowUp_Notice/models/Illness"
 	"FollowUp_Notice/models/System"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"
 	"strconv"

+ 2 - 2
controllers/Patient.go

@@ -3,6 +3,7 @@ package controllers
 import (
 	"FollowUp_Notice/conf"
 	"FollowUp_Notice/http"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"FollowUp_Notice/models/Account"
 	"FollowUp_Notice/models/Illness"
@@ -11,7 +12,6 @@ import (
 	"FollowUp_Notice/models/System"
 	"FollowUp_Notice/models/Tag"
 	"encoding/json"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/robfig/cron/v3"
 	"math"
@@ -342,7 +342,7 @@ func Cron_Patient() {
 	//给对象增加定时任务
 	//c.AddFunc("0 */1 * * * ?", Cron_Patient_ChangeFollowUp)
 	c.AddFunc("@daily", Cron_Patient_ChangeFollowUp) // 修改复诊状态
-	c.AddFunc("0 0 8 * * *", Cron_Patient_Notice)    // 消息通知
+	c.AddFunc("0 0 12 * * *", Cron_Patient_Notice)   // 消息通知
 
 	//启动定时任务
 	c.Start()

+ 1 - 1
controllers/Surgical.go

@@ -2,10 +2,10 @@ package controllers
 
 import (
 	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/models/Account"
 	"FollowUp_Notice/models/Surgical"
 	"FollowUp_Notice/models/System"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"
 	"strconv"

+ 1 - 1
controllers/Tag.go

@@ -2,12 +2,12 @@ package controllers
 
 import (
 	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/models/Account"
 	"FollowUp_Notice/models/Patient"
 	"FollowUp_Notice/models/System"
 	"FollowUp_Notice/models/Tag"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"
 	"strconv"

+ 122 - 1
controllers/User.go

@@ -4,12 +4,13 @@ import (
 	"FollowUp_Notice/Nats/NatsServer"
 	"FollowUp_Notice/conf"
 	"FollowUp_Notice/http"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"FollowUp_Notice/models/Account"
 	"FollowUp_Notice/models/Patient"
 	"FollowUp_Notice/models/System"
+	"encoding/json"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/robfig/cron/v3"
 	"github.com/shopspring/decimal"
@@ -782,6 +783,104 @@ func (c *UserController) Send_Test() {
 
 }
 
+// 获取微信支付二维码
+func (c *UserController) Get_Weixin_QR_Code() {
+	Total, _ := c.GetFloat("Total")
+	Title := "复诊通知" + c.User.T_user
+	res, err := http.PayTransactionNative(Title, Total)
+	if err != nil {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: err.Error()}
+		c.ServeJSON()
+		return
+	}
+	if res.Code != 200 {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: res.Message}
+		c.ServeJSON()
+		return
+	}
+
+	var_ := Account.UserPayOrder{
+		T_uid:      c.User.Id,
+		T_type:     "微信",
+		T_title:    Title,
+		T_total:    Total,
+		T_order_no: res.OrderNo,
+	}
+
+	_, err = Account.Add_UserPayOrder(var_)
+	if err != nil {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "添加失败!"}
+		c.ServeJSON()
+		return
+	}
+
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: res}
+	c.ServeJSON()
+	return
+
+}
+
+// 微信支付回调
+func (c *UserController) Weixin_Notify() {
+
+	type RequestBody struct {
+		TradeNo string
+		Status  string
+	}
+	type JSON struct {
+		Code    int
+		Message string
+	}
+	buf := make([]byte, 1024)
+	n, _ := c.Ctx.Request.Body.Read(buf)
+	fmt.Println("Body:", string(buf[0:n]))
+
+	//解密
+	adc_str, err := lib.AesDeCrypt(buf[0:n], []byte(conf.Weixin_PwdKey))
+	//adc_str, _ := lib.AesDeCrypt(buf[0:n], []byte(conf.Weixin_PwdKey))
+
+	var body RequestBody
+	logs.Info("data================ ", string(adc_str))
+	err = json.Unmarshal(adc_str, &body)
+	if err != nil {
+		c.Data["json"] = JSON{Code: 202, Message: "json.Unmarshal is err:" + err.Error()}
+		c.ServeJSON()
+	}
+
+	UserPayOrder, err := Account.Get_UserPayOrder_ByT_order_no(body.TradeNo)
+	if err != nil {
+		c.Data["json"] = JSON{Code: 202, Message: "查询失败!"}
+		c.ServeJSON()
+		return
+	}
+	UserPayOrder.T_status = body.Status
+	err = Account.Update_UserPayOrder(UserPayOrder, "T_status")
+	if err != nil {
+		c.Data["json"] = JSON{Code: 202, Message: "更新状态失败!"}
+		c.ServeJSON()
+		return
+	}
+
+	c.Data["json"] = JSON{Code: 200, Message: "成功"}
+	c.ServeJSON()
+	return
+
+}
+
+// 获取微信支付订单状态
+func (c *UserController) GetWxOrderState() {
+	OrderNo := c.GetString("OrderNo")
+	UserPayOrder, err := Account.Get_UserPayOrder_ByT_order_no(OrderNo)
+	if err != nil {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "查询失败!"}
+		c.ServeJSON()
+		return
+	}
+	c.Data["json"] = lib.JSONS{Code: 200, Msg: "成功", Data: UserPayOrder}
+	c.ServeJSON()
+	return
+}
+
 // 用户定时任务
 func Cron_User() {
 
@@ -814,7 +913,19 @@ func Cron_User_Money_Bill() {
 		if money == 0 {
 			continue
 		}
+		sendMsg := false
+		moneyFlag := ""
 		var_ := Account.User{Id: user.Id, T_money: user.T_money - float32(money)}
+		if user.T_money >= 100 && var_.T_money < 100 {
+			sendMsg = true
+			moneyFlag = "不足100元"
+		} else if user.T_money >= 10 && var_.T_money < 10 {
+			sendMsg = true
+			moneyFlag = "不足10元"
+		} else if user.T_money >= 0 && var_.T_money < 0 {
+			sendMsg = true
+			moneyFlag = "欠费"
+		}
 		err := Account.Update_User(var_, "T_money")
 		if err != nil {
 			System.Add_SysLogs_T("用户扣费", "扣费失败", var_)
@@ -832,6 +943,16 @@ func Cron_User_Money_Bill() {
 		if err != nil {
 			System.Add_SysLogs_T("用户扣费", "添加扣费记录失败", bill)
 		}
+		if sendMsg {
+			_, err = http.SmsXSendBill(user.T_phone, user.T_user, moneyFlag)
+			info := fmt.Sprintf("T_uid:%v, T_phone:%v, T_user:%v, moneyFlag:%v", user.Id, user.T_phone, user.T_user, moneyFlag)
+			if err != nil {
+				System.Add_SysLogs_T("复诊通知-账单", "短信通知失败", info)
+			} else {
+				System.Add_SysLogs_T("复诊通知-账单", "短信通知成功", info)
+			}
+		}
+
 	}
 	logs.Info("用户账单扣费统计结束")
 

+ 1 - 1
controllers/UserLogs.go

@@ -2,9 +2,9 @@ package controllers
 
 import (
 	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/models/Account"
 	"FollowUp_Notice/models/System"
-	"git.baozhida.cn/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"
 )

+ 0 - 3
go.mod

@@ -2,10 +2,7 @@ module FollowUp_Notice
 
 go 1.19
 
-replace git.baozhida.cn/ERP_libs => /Users/zoie/work/bzd_project/BZD_libs
-
 require (
-	git.baozhida.cn/ERP_libs v0.0.0-00010101000000-000000000000
 	github.com/astaxie/beego v1.12.3
 	github.com/beego/beego/v2 v2.0.7
 	github.com/go-sql-driver/mysql v1.7.0

+ 37 - 1
http/SmsTemplate.go

@@ -2,9 +2,9 @@ package http
 
 import (
 	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"encoding/json"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/go-resty/resty/v2"
 )
 
@@ -193,3 +193,39 @@ func SmsXSend(template_id, to, name, time string) (XSendRes, error) {
 	}
 	return temp, nil
 }
+
+func SmsXSendBill(to, name, moneyFlag string) (XSendRes, error) {
+
+	type Vars struct {
+		Name string `json:"name"`
+		Msg  string `json:"msg"`
+	}
+
+	vars := Vars{Name: name, Msg: moneyFlag}
+
+	b, _ := json.Marshal(vars)
+
+	client := resty.New()
+	resp, err := client.R().
+		SetHeader("Content-Type", "application/x-www-form-urlencoded").
+		SetFormData(map[string]string{
+			"appid":     conf.Sms_Appid,
+			"signature": conf.Sms_Signature,
+			"to":        to,
+			"project":   "LPdPa4",
+			"vars":      string(b),
+		}).
+		SetResult(&XSendRes{}).
+		Post("https://api-v4.mysubmail.com/sms/xsend")
+
+	if err != nil {
+		return XSendRes{}, err
+	}
+
+	temp := XSendRes{}
+	if err = json.Unmarshal(resp.Body(), &temp); err != nil {
+		logs.Error(lib.FuncName(), err)
+		return XSendRes{}, err
+	}
+	return temp, nil
+}

+ 1 - 1
http/VcoiceCall.go

@@ -1,6 +1,7 @@
 package http
 
 import (
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"crypto/hmac"
 	"crypto/sha256"
@@ -8,7 +9,6 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/go-resty/resty/v2"
 	uuid "github.com/satori/go.uuid"
 	"strings"

+ 50 - 0
http/weixin.go

@@ -0,0 +1,50 @@
+package http
+
+import (
+	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
+	"FollowUp_Notice/logs"
+	"encoding/json"
+	"fmt"
+	"github.com/go-resty/resty/v2"
+)
+
+// {"Code".200,"CodeUrl":"weixin://wxpay/bizpayurl?pr=NtLrWvBzz","Message":"成功"}
+type WeixinRes struct {
+	Code    int    `json:"Code"`
+	CodeUrl string `json:"CodeUrl"`
+	Message string `json:"Message"`
+	OrderNo string `json:"OrderNo"`
+}
+
+func PayTransactionNative(title string, total float64) (WeixinRes, error) {
+
+	type Vars struct {
+		PwdKey string
+		Title  string
+		Total  float32
+		Notify string
+	}
+
+	client := resty.New()
+	resp, err := client.R().
+		SetHeader("Content-Type", "application/x-www-form-urlencoded").
+		SetFormData(map[string]string{
+			"PwdKey": conf.Weixin_PwdKey,
+			"Notify": conf.Weixin_Notify,
+			"Title":  title,
+			"Total":  fmt.Sprintf("%f", total),
+		}).
+		Post("https://cold.coldbaozhida.com/wxpay_wxb5b2c9147ae0b9db/PayTransactionNative")
+
+	if err != nil {
+		return WeixinRes{}, err
+	}
+
+	temp := WeixinRes{}
+	if err = json.Unmarshal(resp.Body(), &temp); err != nil {
+		logs.Error(lib.FuncName(), err)
+		return WeixinRes{}, err
+	}
+	return temp, nil
+}

+ 71 - 0
lib/Aes.go

@@ -0,0 +1,71 @@
+package lib
+
+import (
+	"bytes"
+	"crypto/aes"
+	"crypto/cipher"
+	"errors"
+)
+
+// PKCS7 填充模式
+func PKCS7Padding(ciphertext []byte, blockSize int) []byte {
+	padding := blockSize - len(ciphertext)%blockSize
+	//Repeat()函数的功能是把切片[]byte{byte(padding)}复制padding个,然后合并成新的字节切片返回
+	padtext := bytes.Repeat([]byte{byte(padding)}, padding)
+	return append(ciphertext, padtext...)
+}
+
+// 填充的反向操作,删除填充字符串
+func PKCS7UnPadding(origData []byte) ([]byte, error) {
+	//获取数据长度
+	length := len(origData)
+	if length == 0 {
+		return nil, errors.New("加密字符串错误!")
+	} else {
+		//获取填充字符串长度
+		unpadding := int(origData[length-1])
+		//截取切片,删除填充字节,并且返回明文
+		return origData[:(length - unpadding)], nil
+	}
+}
+
+// 实现加密
+func AesEcrypt(origData []byte, key []byte) ([]byte, error) {
+	//创建加密算法实例
+	block, err := aes.NewCipher(key)
+	if err != nil {
+		return nil, err
+	}
+	//获取块的大小
+	blockSize := block.BlockSize()
+	//对数据进行填充,让数据长度满足需求
+	origData = PKCS7Padding(origData, blockSize)
+	//采用AES加密方法中CBC加密模式
+	blocMode := cipher.NewCBCEncrypter(block, key[:blockSize])
+	crypted := make([]byte, len(origData))
+	//执行加密
+	blocMode.CryptBlocks(crypted, origData)
+	return crypted, nil
+}
+
+// 实现解密
+func AesDeCrypt(cypted []byte, key []byte) ([]byte, error) {
+	//创建加密算法实例
+	block, err := aes.NewCipher(key)
+	if err != nil {
+		return nil, err
+	}
+	//获取块大小
+	blockSize := block.BlockSize()
+	//创建加密客户端实例
+	blockMode := cipher.NewCBCDecrypter(block, key[:blockSize])
+	origData := make([]byte, len(cypted))
+	//这个函数也可以用来解密
+	blockMode.CryptBlocks(origData, cypted)
+	//去除填充字符串
+	origData, err = PKCS7UnPadding(origData)
+	if err != nil {
+		return nil, err
+	}
+	return origData, err
+}

+ 50 - 0
lib/GoPDF.go

@@ -0,0 +1,50 @@
+package lib
+
+import "github.com/signintech/gopdf"
+
+const (
+	ValignTop    = 1
+	ValignMiddle = 2
+	ValignBottom = 3
+)
+
+const (
+	AlignLeft   = 4
+	AlignCenter = 5
+	AlignRight  = 6
+)
+
+func RectFillColor(pdf *gopdf.GoPdf,
+	text string,
+	fontSize int,
+	x, y, w, h float64,
+	r, g, b uint8,
+	align, valign int,
+) {
+
+
+	pdf.SetLineWidth(0.1)
+	pdf.SetFillColor(r, g, b) //setup fill color
+	pdf.SetLineType("")       // 线条样式
+	pdf.RectFromUpperLeftWithStyle(x, y, w, h, "FD")
+	pdf.SetFillColor(0, 0, 0)
+
+	if align == AlignCenter {
+		textw, _ := pdf.MeasureTextWidth(text)
+		x = x + (w / 2) - (textw / 2)
+	} else if align == AlignRight {
+		textw, _ := pdf.MeasureTextWidth(text)
+		x = x + w - textw
+	}
+
+	pdf.SetX(x)
+
+	if valign == ValignMiddle {
+		y = y + (h / 2) - (float64(fontSize) / 2)
+	} else if valign == ValignBottom {
+		y = y + h - float64(fontSize)
+	}
+
+	pdf.SetY(y)
+	pdf.Cell(nil, text)
+}

+ 193 - 0
lib/Onelink.go

@@ -0,0 +1,193 @@
+package lib
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+)
+
+func yidong_token() (string,bool) {
+
+	url := "https://api.iot.10086.cn/v5/ec/get/token?transid=851AIOT202204251553361888100000003&password=L44tB,J5EQhj&appid=851AIOT2022042515533618881&refresh=0"
+	method := "GET"
+
+	client := &http.Client {
+	}
+	req, err := http.NewRequest(method, url, nil)
+
+	if err != nil {
+		fmt.Println(err)
+		return "",false
+	}
+	res, err := client.Do(req)
+	if err != nil {
+		fmt.Println(err)
+		return "",false
+	}
+	defer res.Body.Close()
+
+	body, err := ioutil.ReadAll(res.Body)
+	if err != nil {
+		fmt.Println(err)
+		return "",false
+	}
+	fmt.Println(string(body))
+
+
+	type Token struct {
+		Token string `json:"token"`
+	}
+	type TestJson struct {
+		Result []Token `json:"result"`
+	}
+
+	var c TestJson
+	err = json.Unmarshal(body, c)
+	if err := json.Unmarshal([]byte(body), &c); err != nil {
+		fmt.Println("Error =", err)
+	}
+
+	fmt.Println("bodyjson:",c)
+
+	//dd := c["result"]
+	if(len(c.Result) == 0){
+		return "",false
+	}
+	fmt.Println("Token:",c.Result[0].Token)
+
+	return c.Result[0].Token,true
+
+}
+
+
+// 实时查询群组本月套餐内GPRS流量使用量信息。
+type FlowPoolSharingInfo struct {
+	TotalAmount string `json:"totalAmount"`
+	RemainAmount string `json:"remainAmount"`
+	UseAmount string `json:"useAmount"`
+}
+func Yidong_group_data_margin() (FlowPoolSharingInfo,bool) {
+	token,token_is := yidong_token()
+	if !token_is{
+		return FlowPoolSharingInfo{},false
+	}
+	url := "https://api.iot.10086.cn/v5/ec/query/group-data-margin?transid=851AIOT202204251553361888100000003&token="+token+"&groupId=9921000021089000"
+	method := "GET"
+
+	client := &http.Client {
+	}
+	req, err := http.NewRequest(method, url, nil)
+
+	if err != nil {
+		fmt.Println(err)
+		return FlowPoolSharingInfo{},false
+	}
+	res, err := client.Do(req)
+	if err != nil {
+		fmt.Println(err)
+		return FlowPoolSharingInfo{},false
+	}
+	defer res.Body.Close()
+
+	body, err := ioutil.ReadAll(res.Body)
+	if err != nil {
+		fmt.Println(err)
+		return FlowPoolSharingInfo{},false
+	}
+	fmt.Println(string(body))
+
+
+	type List_data struct {
+		FlowPoolSharingInfo []FlowPoolSharingInfo `json:"flowPoolSharingInfo"`
+	}
+	type TestJson struct {
+		Result []List_data `json:"result"`
+	}
+
+	var c TestJson
+	err = json.Unmarshal(body, c)
+	if err := json.Unmarshal([]byte(body), &c); err != nil {
+		fmt.Println("Error =", err)
+	}
+
+	fmt.Println("bodyjson:",c)
+
+	//dd := c["result"]
+	if(len(c.Result) == 0){
+		return FlowPoolSharingInfo{},false
+	}
+	//fmt.Println("Token:",c.Result[0].UseAmount)
+
+	return c.Result[0].FlowPoolSharingInfo[0],true
+
+}
+
+// 实时查询物联卡本月套餐内流量使用量。
+func yidong_sim_data_usage(msisdn string) (string,bool) {
+	token,token_is := yidong_token()
+	if !token_is{
+		return "",false
+	}
+	url := "https://api.iot.10086.cn/v5/ec/query/sim-data-usage?transid=851AIOT202204251553361888100000003&token="+token+"&msisdn="+msisdn
+	method := "GET"
+
+	client := &http.Client {
+	}
+	req, err := http.NewRequest(method, url, nil)
+
+	if err != nil {
+		fmt.Println(err)
+		return "",false
+	}
+	res, err := client.Do(req)
+	if err != nil {
+		fmt.Println(err)
+		return "",false
+	}
+	defer res.Body.Close()
+
+	body, err := ioutil.ReadAll(res.Body)
+	if err != nil {
+		fmt.Println(err)
+		return "",false
+	}
+	fmt.Println(string(body))
+
+
+	type List_data struct {
+		DataAmount string `json:"dataAmount"`
+	}
+	type TestJson struct {
+		Result []List_data `json:"result"`
+	}
+
+	var c TestJson
+	err = json.Unmarshal(body, c)
+	if err := json.Unmarshal([]byte(body), &c); err != nil {
+		fmt.Println("Error =", err)
+	}
+
+	fmt.Println("bodyjson:",c)
+
+	//dd := c["result"]
+	if(len(c.Result) == 0){
+		return "",false
+	}
+	//fmt.Println("Token:",c.Result[0].UseAmount)
+
+	return c.Result[0].DataAmount,true
+
+}
+
+
+//
+//
+//flowPoolSharingInfo,_ := yidong_group_data_margin()
+//println("总量:",flowPoolSharingInfo.RemainAmount)
+//println("使用:",flowPoolSharingInfo.RemainAmount)
+//println("剩余:",flowPoolSharingInfo.RemainAmount)
+//
+//sim_data_usage,_ := yidong_sim_data_usage("1440761145498")
+//println("单卡使用量:",sim_data_usage)
+

+ 3 - 0
lib/Qiniu.go

@@ -0,0 +1,3 @@
+package lib
+
+

+ 24 - 0
lib/ReplaceSQL.go

@@ -0,0 +1,24 @@
+package lib
+
+import "strings"
+
+// 过滤sql特殊字符
+func ReplaceSQL(name string) string {
+	name = strings.Replace(name, ";", "", -1)
+	name = strings.Replace(name, ",", "", -1)
+	name = strings.Replace(name, "?", "", -1)
+	name = strings.Replace(name, "<", "", -1)
+	name = strings.Replace(name, ">", "", -1)
+	name = strings.Replace(name, "(", "", -1)
+	name = strings.Replace(name, ")", "", -1)
+	name = strings.Replace(name, "@", "", -1)
+	name = strings.Replace(name, "=", "", -1)
+	name = strings.Replace(name, "+", "", -1)
+	name = strings.Replace(name, "*", "", -1)
+	name = strings.Replace(name, "&", "", -1)
+	name = strings.Replace(name, "#", "", -1)
+	name = strings.Replace(name, "%", "", -1)
+	name = strings.Replace(name, "$", "", -1)
+
+	return name
+}

+ 20 - 0
lib/WritePid.go

@@ -0,0 +1,20 @@
+package lib
+
+import (
+	"bufio"
+	"os"
+	"strconv"
+)
+
+func WritePid() {
+	fileName := "./server.pid"
+	file, _ := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0666)
+	defer file.Close()
+
+	writer := bufio.NewWriter(file)
+
+	pid := strconv.Itoa(os.Getpid())
+	println("server_pid:", pid)
+	writer.Write([]byte(pid))
+	writer.Flush()
+}

+ 407 - 0
lib/lib.go

@@ -0,0 +1,407 @@
+package lib
+
+import (
+	"encoding/json"
+	"fmt"
+	"github.com/beego/beego/v2/server/web/context"
+	"github.com/mssola/user_agent"
+	"github.com/shopspring/decimal"
+	"math/rand"
+	"os"
+	"path/filepath"
+	"runtime"
+
+	"sort"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type JSONS struct {
+	//必须的大写开头
+	Code int16
+	Msg  string
+	Data interface{} // 泛型
+}
+type R_JSONS_List struct {
+	//必须的大写开头
+	Data      []interface{}
+	Num       int64
+	Page      int
+	Page_size int
+}
+type R_JSONS struct {
+	//必须的大写开头
+	Data      interface{}
+	Num       int64
+	Page      int
+	Page_size int
+}
+
+type R1_JSONS struct {
+	//必须的大写开头
+	List      interface{}
+	Num       int
+	Page      int
+	Page_size int
+	Pages     []Page_T
+}
+
+// func_page 分页   [{3 1} {4 2} {4 3} {4 4} {4 5} {4 6} {4 7} {4 8} {4 9} {5 2}]-
+type Page_T struct {
+	A int
+	V int64
+}
+
+func Func_page(Page int64, Page_size int64) (page_t_list []Page_T) {
+	if Page > 1 {
+		page_t_list = append(page_t_list, Page_T{A: 1, V: Page - 1})
+	}
+	i := int64(0)
+	for aa := int64(1); aa < 5; aa++ {
+		if Page-aa <= 0 {
+			break
+		}
+		page_t_list = append(page_t_list, Page_T{A: 2, V: Page - aa})
+		i++
+	}
+	page_t_list = append(page_t_list, Page_T{A: 3, V: Page})
+
+	for aa := int64(1); aa < 10-i; aa++ {
+		if Page_size < Page+aa {
+			break
+		}
+		page_t_list = append(page_t_list, Page_T{A: 4, V: Page + aa})
+	}
+	sort.Slice(page_t_list, func(i, j int) bool {
+		if page_t_list[i].V < page_t_list[j].V {
+			return true
+		}
+		return false
+	})
+	sort.Slice(page_t_list, func(i, j int) bool {
+		if page_t_list[i].A < page_t_list[j].A {
+			return true
+		}
+		return false
+
+	})
+	if Page < Page_size {
+		page_t_list = append(page_t_list, Page_T{A: 5, V: Page + 1})
+	}
+
+	return page_t_list
+}
+
+func Strval(value interface{}) string {
+	var key string
+	if value == nil {
+		return key
+	}
+
+	switch value.(type) {
+	case float64:
+		ft := value.(float64)
+		key = strconv.FormatFloat(ft, 'f', -1, 64)
+	case float32:
+		ft := value.(float32)
+		key = strconv.FormatFloat(float64(ft), 'f', -1, 64)
+	case int:
+		it := value.(int)
+		key = strconv.Itoa(it)
+	case uint:
+		it := value.(uint)
+		key = strconv.Itoa(int(it))
+	case int8:
+		it := value.(int8)
+		key = strconv.Itoa(int(it))
+	case uint8:
+		it := value.(uint8)
+		key = strconv.Itoa(int(it))
+	case int16:
+		it := value.(int16)
+		key = strconv.Itoa(int(it))
+	case uint16:
+		it := value.(uint16)
+		key = strconv.Itoa(int(it))
+	case int32:
+		it := value.(int32)
+		key = strconv.Itoa(int(it))
+	case uint32:
+		it := value.(uint32)
+		key = strconv.Itoa(int(it))
+	case int64:
+		it := value.(int64)
+		key = strconv.FormatInt(it, 10)
+	case uint64:
+		it := value.(uint64)
+		key = strconv.FormatUint(it, 10)
+	case string:
+		key = value.(string)
+	case []byte:
+		key = string(value.([]byte))
+	default:
+		newValue, _ := json.Marshal(value)
+		key = string(newValue)
+	}
+
+	return key
+}
+
+func To_int(value interface{}) int {
+	var key int
+	if value == nil {
+		return key
+	}
+	switch value.(type) {
+	case float64:
+		key = int(value.(float64))
+	case float32:
+		key = int(value.(float32))
+	case int:
+		key = int(value.(int))
+	case uint:
+		key = int(value.(uint))
+	case int8:
+		key = int(value.(int8))
+	case uint8:
+		key = int(value.(uint8))
+	case int16:
+		key = int(value.(int16))
+	case uint16:
+		key = int(value.(uint16))
+	case int32:
+		key = int(value.(int32))
+	case uint32:
+		key = int(value.(uint32))
+	case int64:
+		key = int(value.(int64))
+	case uint64:
+		key = int(value.(uint64))
+	case string:
+		key, _ = strconv.Atoi(value.(string))
+	case []byte:
+		key, _ = strconv.Atoi(string(value.([]byte)))
+	default:
+		newValue, _ := json.Marshal(value)
+		key, _ = strconv.Atoi(string(newValue))
+	}
+	return key
+}
+
+func To_float32(value interface{}) float32 {
+	var key float32
+	if value == nil {
+		return key
+	}
+
+	switch value.(type) {
+	case float64:
+		key = float32(value.(float64))
+	case float32:
+		key = float32(value.(float32))
+	case int:
+		key = float32(value.(int))
+	case uint:
+		key = float32(value.(uint))
+	case int8:
+		key = float32(value.(int8))
+	case uint8:
+		key = float32(value.(uint8))
+	case int16:
+		key = float32(value.(int16))
+	case uint16:
+		key = float32(value.(uint16))
+	case int32:
+		key = float32(value.(int32))
+	case uint32:
+		key = float32(value.(uint32))
+	case int64:
+		key = float32(value.(int64))
+	case uint64:
+		key = float32(value.(uint64))
+	case string:
+		key_float64, _ := strconv.ParseFloat(value.(string), 32/64)
+		key = float32(key_float64)
+	case []byte:
+		key_float64, _ := strconv.ParseFloat(string(value.([]byte)), 32/64)
+		key = float32(key_float64)
+	default:
+		newValue, _ := json.Marshal(value)
+		key_float64, _ := strconv.ParseFloat(string(newValue), 32/64)
+		key = float32(key_float64)
+	}
+
+	key_float64, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", key), 32/64)
+	key = float32(key_float64)
+
+	return key
+}
+
+func To_string(value interface{}) string {
+	var key string
+	if value == nil {
+		return key
+	}
+
+	switch value.(type) {
+	case float64:
+		ft := value.(float64)
+		key = strconv.FormatFloat(ft, 'f', -1, 64)
+	case float32:
+		ft := value.(float32)
+		key = strconv.FormatFloat(float64(ft), 'f', -1, 64)
+	case int:
+		it := value.(int)
+		key = strconv.Itoa(it)
+	case uint:
+		it := value.(uint)
+		key = strconv.Itoa(int(it))
+	case int8:
+		it := value.(int8)
+		key = strconv.Itoa(int(it))
+	case uint8:
+		it := value.(uint8)
+		key = strconv.Itoa(int(it))
+	case int16:
+		it := value.(int16)
+		key = strconv.Itoa(int(it))
+	case uint16:
+		it := value.(uint16)
+		key = strconv.Itoa(int(it))
+	case int32:
+		it := value.(int32)
+		key = strconv.Itoa(int(it))
+	case uint32:
+		it := value.(uint32)
+		key = strconv.Itoa(int(it))
+	case int64:
+		it := value.(int64)
+		key = strconv.FormatInt(it, 10)
+	case uint64:
+		it := value.(uint64)
+		key = strconv.FormatUint(it, 10)
+	case string:
+		key = value.(string)
+	case []byte:
+		key = string(value.([]byte))
+	default:
+		newValue, _ := json.Marshal(value)
+		key = string(newValue)
+	}
+	return key
+}
+
+func Random(min, max int) int {
+	rand.Seed(time.Now().Unix()) //Seed生成的随机数
+	return rand.Intn(max-min) + min
+}
+
+// 取文本(字符串)中间
+func GetBetweenStr(str, start, end string) string {
+	n := strings.Index(str, start)
+	if n == -1 {
+		n = 0
+	} else {
+		n = n + len(start) // 增加了else,不加的会把start带上
+	}
+	str = string([]byte(str)[n:])
+	m := strings.Index(str, end)
+	if m == -1 {
+		m = len(str)
+	}
+	str = string([]byte(str)[:m])
+	return str
+}
+
+// getYearMonthToDay 查询指定年份指定月份有多少天
+// @params year int 指定年份
+// @params month int 指定月份
+func GetYearMonthToDay(year int, month int) int {
+	// 有31天的月份
+	day31 := map[int]bool{
+		1:  true,
+		3:  true,
+		5:  true,
+		7:  true,
+		8:  true,
+		10: true,
+		12: true,
+	}
+	if day31[month] == true {
+		return 31
+	}
+	// 有30天的月份
+	day30 := map[int]bool{
+		4:  true,
+		6:  true,
+		9:  true,
+		11: true,
+	}
+	if day30[month] == true {
+		return 30
+	}
+	// 计算是平年还是闰年
+	if (year%4 == 0 && year%100 != 0) || year%400 == 0 {
+		// 得出2月的天数
+		return 29
+	}
+	// 得出2月的天数
+	return 28
+}
+
+func Decimal(value float64) float64 {
+	value, _ = strconv.ParseFloat(fmt.Sprintf("%.1f", value), 64)
+	return value
+}
+
+func Strconv_Atoi(string string) int {
+	int, _ := strconv.Atoi(string)
+	return int
+}
+
+// golang获取程序运行路径
+func GetCurrentDirectory() string {
+	dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
+
+	return strings.Replace(dir, "\\", "/", -1)
+}
+
+// 获取正在运行的函数名
+func FuncName() string {
+	pc := make([]uintptr, 1)
+	runtime.Callers(2, pc)
+	f := runtime.FuncForPC(pc[0])
+	return f.Name()
+}
+
+// 获取两个时间相差的天数,0表同一天,正数表t1>t2,负数表t1<t2
+func GetDiffDays(t1, t2 time.Time) int {
+	t1 = time.Date(t1.Year(), t1.Month(), t1.Day(), 0, 0, 0, 0, time.Local)
+	t2 = time.Date(t2.Year(), t2.Month(), t2.Day(), 0, 0, 0, 0, time.Local)
+
+	return int(t1.Sub(t2).Hours() / 24)
+}
+
+// 获取用户登录信息
+func GetUserLoginInfo(ctx *context.Context) map[string]interface{} {
+	//Ipaddr      ip地址
+	//Browser     浏览器
+	//Os          系统
+	//Platform    固件
+	l := make(map[string]interface{})
+	ua := user_agent.New(ctx.Request.UserAgent())
+	l["ipaddr"] = ctx.Input.IP()
+	l["remark"] = ctx.Request.UserAgent()
+	browserName, browserVersion := ua.Browser()
+	l["browser"] = browserName + " " + browserVersion
+	l["os"] = ua.OS()
+	l["platform"] = ua.Platform()
+	return l
+}
+
+// Float64转float64保留2位小数
+func Float64ToFloat64TwoDecimal(num float64) float64 {
+	f, _ := decimal.NewFromFloat(num).Round(2).Float64()
+	return f
+}

+ 132 - 0
lib/libString.go

@@ -0,0 +1,132 @@
+package lib
+
+import (
+	"crypto/md5"
+	"encoding/hex"
+	"github.com/shopspring/decimal"
+	"math/rand"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// #取得随机字符串:通过打乱slice来操作
+func GetRandstring(length int, char string, rand_x int64) string {
+	if length < 1 {
+		return ""
+	}
+
+	if len(char) <= 6 || len(char) <= length {
+		char = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+	}
+
+	charArr := strings.Split(char, "")
+	ran := rand.New(rand.NewSource(time.Now().UnixMilli() + rand_x))
+
+	l := len(charArr)
+	for i := l - 1; i > 0; i-- {
+		r := ran.Intn(i)
+		charArr[r], charArr[i] = charArr[i], charArr[r]
+	}
+	rchar := charArr[:length]
+	return strings.Join(rchar, "")
+}
+
+// 返回一个32位md5加密后的字符串
+func Md5(str string) string {
+	h := md5.New()
+	h.Write([]byte(str))
+	return hex.EncodeToString(h.Sum(nil))
+}
+
+// 转化
+func TimeStrToTime(T_time string) (time.Time, bool) {
+	stamp, err := time.ParseInLocation("2006-01-02 15:04:05", T_time, time.Local) // +8
+	if err != nil {
+		return time.Time{}, false
+	}
+
+	return stamp, true
+}
+func DateStrToTime(T_date string) (time.Time, bool) {
+	stamp, err := time.ParseInLocation("2006-01-02", T_date, time.Local) // +8
+	if err != nil {
+		return time.Time{}, false
+	}
+
+	return stamp, true
+}
+
+func MonthStrToTime(T_month string) (time.Time, bool) {
+	stamp, err := time.ParseInLocation("2006-01", T_month, time.Local) // +8
+	if err != nil {
+		return time.Time{}, false
+	}
+
+	return stamp, true
+}
+
+func SplitStringIds(str string, prefix string) (r []string) {
+	if len(str) == 0 {
+		return r
+	}
+	Ids_str := strings.TrimRight(str, "|")
+	Ids := strings.Split(Ids_str, "|")
+	for _, v := range Ids {
+		r = append(r, strings.TrimLeft(v, prefix))
+	}
+	return r
+}
+
+func SplitStringToDotStr(str string, prefix string) (r string) {
+	if len(str) == 0 {
+		return r
+	}
+	Ids_str := strings.TrimRight(str, "|")
+	Ids := strings.Split(Ids_str, "|")
+	for _, v := range Ids {
+		r += strings.TrimLeft(v, prefix) + ","
+	}
+	r = strings.TrimRight(r, ",")
+	return r
+}
+
+func SplitStringToIntIds(str string, prefix string) (r []int) {
+	if len(str) == 0 {
+		return r
+	}
+	Ids_str := strings.TrimRight(str, "|")
+	Ids := strings.Split(Ids_str, "|")
+	for _, v := range Ids {
+		id, _ := strconv.Atoi(strings.TrimLeft(v, prefix))
+		r = append(r, id)
+	}
+	return r
+}
+
+func IntIdsDistinct(Ids []int) (result []int) {
+	distinctMap := make(map[int]int, len(Ids))
+	for _, Id := range Ids {
+		if _, ok := distinctMap[Id]; !ok {
+			distinctMap[Id] = 1
+			result = append(result, Id)
+		}
+	}
+	return result
+}
+
+func SplitString(str string, cutset string) (r []string) {
+	if len(str) == 0 {
+		return r
+	}
+	list := strings.Split(strings.TrimRight(str, cutset), cutset)
+
+	return list
+}
+
+// string转float64保留2位小数
+func StringToFloat64TwoDecimal(str string) float64 {
+	temp, _ := strconv.ParseFloat(str, 64)
+	f, _ := decimal.NewFromFloat(temp).Round(2).Float64()
+	return f
+}

+ 5 - 0
lib/orm.go

@@ -0,0 +1,5 @@
+package lib
+
+var (
+	ErrNoRows = "<QuerySeter> no row found"
+)

+ 1 - 1
models/Account/Tokey.go

@@ -2,9 +2,9 @@ package Account
 
 import (
 	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/cache"
 	_ "github.com/astaxie/beego/cache/redis"
 	uuid "github.com/satori/go.uuid"

+ 1 - 1
models/Account/User.go

@@ -1,9 +1,9 @@
 package Account
 
 import (
+	"FollowUp_Notice/lib"
 	"errors"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Account/UserBill.go

@@ -1,7 +1,7 @@
 package Account
 
 import (
-	"git.baozhida.cn/ERP_libs/lib"
+	"FollowUp_Notice/lib"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 63 - 0
models/Account/UserPayOrder.go

@@ -0,0 +1,63 @@
+package Account
+
+import (
+	"FollowUp_Notice/lib"
+	"FollowUp_Notice/logs"
+	"fmt"
+	"github.com/beego/beego/v2/adapter/orm"
+	"time"
+)
+
+// 用户支付订单
+type UserPayOrder struct {
+	Id         int       `orm:"column(ID);size(11);auto;pk"`
+	T_uid      int       `orm:"index;size(256);"`                                      // User.Id
+	T_type     string    `orm:"size(256)"`                                             // 微信
+	T_title    string    `orm:"type(text)"`                                            // 标题
+	T_total    float64   `orm:"digits(12);decimals(2)"`                                // 金额
+	T_order_no string    `orm:"size(256)"`                                             // 支付订单
+	T_status   string    `orm:"size(256)"`                                             // 支付状态
+	CreateTime time.Time `orm:"column(create_time);type(timestamp);null;auto_now_add"` //auto_now_add 第一次保存时才设置时间
+}
+
+func (t *UserPayOrder) TableName() string {
+	return "user_pay_order" // 数据库名称   // ************** 替换 DesignDeviceNotice **************
+}
+
+func init() {
+	//注册模型
+	orm.RegisterModel(new(UserPayOrder))
+}
+
+func Add_UserPayOrder(r UserPayOrder) (id int64, err error) {
+	o := orm.NewOrm()
+	id, err = o.Insert(&r)
+	if err != nil {
+		logs.Error(lib.FuncName(), err)
+		return
+	}
+	return
+}
+
+// 修改
+func Update_UserPayOrder(m UserPayOrder, cols ...string) error {
+	o := orm.NewOrm()
+	num, err := o.Update(&m, cols...)
+	if err != nil {
+		logs.Error(lib.FuncName(), err)
+		return err
+	}
+	fmt.Println("Number of records updated in database:", num)
+	return nil
+}
+
+// 获取 ByT_order_no
+func Get_UserPayOrder_ByT_order_no(T_order_no string) (r UserPayOrder, err error) {
+	o := orm.NewOrm()
+	qs := o.QueryTable(new(UserPayOrder))
+	err = qs.Filter("T_order_no", T_order_no).One(&r)
+	if err != nil {
+		logs.Error(lib.FuncName(), err)
+	}
+	return
+}

+ 1 - 1
models/Illness/Illness.go

@@ -1,8 +1,8 @@
 package Illness
 
 import (
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
-	"git.baozhida.cn/ERP_libs/lib"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Patient/Patient.go

@@ -1,11 +1,11 @@
 package Patient
 
 import (
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/models/Illness"
 	"FollowUp_Notice/models/Surgical"
 	"FollowUp_Notice/models/Tag"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Patient/PatientSend.go

@@ -1,8 +1,8 @@
 package Patient
 
 import (
+	"FollowUp_Notice/lib"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Surgical/Surgical.go

@@ -1,7 +1,7 @@
 package Surgical
 
 import (
-	"git.baozhida.cn/ERP_libs/lib"
+	"FollowUp_Notice/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"sync"
 	"time"

+ 1 - 1
models/System/SysLogs.go

@@ -1,10 +1,10 @@
 package System
 
 import (
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"encoding/json"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"time"

+ 1 - 1
models/System/UserLogs.go

@@ -1,10 +1,10 @@
 package System
 
 import (
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"encoding/json"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"time"

+ 1 - 1
models/Tag/Tag.go

@@ -1,8 +1,8 @@
 package Tag
 
 import (
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
-	"git.baozhida.cn/ERP_libs/lib"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 4 - 0
routers/Account.go

@@ -20,4 +20,8 @@ func init() {
 	beego.Router("/User/Send", &controllers.UserController{}, "*:Send")             // 通知
 	beego.Router("/User/Send_Excel", &controllers.UserController{}, "*:Send_Excel") // 通知下载
 	beego.Router("/User/Send_Test", &controllers.UserController{}, "*:Send_Test")   // 测试通知
+
+	beego.Router("/Wx/Get_QR_Code", &controllers.UserController{}, "*:Get_Weixin_QR_Code") // 获取微信支付二维码
+	beego.Router("/Wx/Notify", &controllers.UserController{}, "*:Weixin_Notify")           // 获取微信支付二维码
+	beego.Router("/Wx/GetOrderState", &controllers.UserController{}, "*:GetWxOrderState")  // 获取微信支付状态
 }

+ 1 - 1
routers/filter.go

@@ -2,9 +2,9 @@ package routers
 
 import (
 	"FollowUp_Notice/conf"
+	"FollowUp_Notice/lib"
 	"FollowUp_Notice/logs"
 	"FollowUp_Notice/models/Account"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/beego/beego/v2/server/web/context"
 	"strings"
 )

+ 0 - 2
routers/router.go

@@ -2,13 +2,11 @@ package routers
 
 import (
 	"FollowUp_Notice/controllers"
-	errorlibs "git.baozhida.cn/ERP_libs/Error"
 	beego "github.com/beego/beego/v2/server/web"
 )
 
 func init() {
 
-	beego.ErrorController(&errorlibs.ErrorController{})
 	//过滤器,拦截所有请求
 	beego.InsertFilter("/*", beego.BeforeRouter, RBACFilter)
 	beego.Router("/receivecallstatus", &controllers.PatientController{}, "*:VoiceCall_Status") // 删除患者