Compare commits

...

28 Commits

Author SHA1 Message Date
jiaji.H
2d1fe66d90 Updata:增加电话号码映射表 2026-03-13 13:19:43 +08:00
jiaji.H
e5daac90f7 Updata:增加测试艺人id 2026-03-13 10:38:53 +08:00
jiaji.H
651f12d8d7 Updata:增加问卷调查白名单 2026-03-12 13:37:08 +08:00
jiaji.H
b91f06d240 Updata:更新发送问卷逻辑 2026-03-11 22:03:54 +08:00
jiaji.H
cb575bb37c Updata:更新效验规则 2026-03-11 21:48:51 +08:00
jiaji.H
fbf74734c6 Updata:更新增值获取数 2026-03-11 21:42:51 +08:00
jiaji.H
b041c5ce2d Updata:更新数据结构 2026-03-11 19:50:06 +08:00
jiaji.H
090d1ac8cc Updata:更新字段 2026-03-11 19:37:32 +08:00
jiaji.H
96e5872c78 Updata:更新结构 2026-03-11 19:33:47 +08:00
jiaji.H
5fef6272c3 Updata:增加中间数据结构 2026-03-11 19:31:13 +08:00
jiaji.H
1ff83504c2 Updata:更新赋值 2026-03-11 19:20:50 +08:00
jiaji.H
3e55413a35 Updata:更新sql 2026-03-11 19:15:32 +08:00
jiaji.H
332d0a65ff Updata:更新sql 2026-03-11 19:12:39 +08:00
jiaji.H
022d246765 Updata:更新sql 2026-03-11 19:05:37 +08:00
jiaji.H
fa3bf5c824 Updata:更新sql 2026-03-11 19:01:18 +08:00
jiaji.H
e17a3df63a Updata:更新数据库 2026-03-11 18:49:42 +08:00
jiaji.H
a21668b585 Updata:更新sql 2026-03-11 18:42:50 +08:00
jiaji.H
14609d29ca Updata 2026-03-11 18:39:10 +08:00
jiaji.H
9b22520851 Updata:更新sql 2026-03-11 18:38:30 +08:00
jiaji.H
1bec8e5ebf Updata:更新sql 2026-03-11 18:27:32 +08:00
jiaji.H
de3d4919e0 Updata:更新sql 2026-03-11 18:22:48 +08:00
jiaji.H
83d4a7d9c7 Updata:更新sql 2026-03-11 18:19:49 +08:00
jiaji.H
23b996bfd5 Updata:增加字段 2026-03-11 17:24:15 +08:00
jiaji.H
5bba22d18a Updata:增加字段 2026-03-11 17:16:57 +08:00
jiaji.H
9d31ce3d05 Updata:增加字段 2026-03-11 17:14:15 +08:00
jiaji.H
447cbff99e Updata:更新pb文件 2026-03-11 17:04:49 +08:00
jiaji.H
bd15ee93e9 Updata:修正逻辑 2026-03-11 16:54:41 +08:00
jiaji.H
f548ac9571 feat:新增问卷调查模块逻辑 2026-03-11 16:17:57 +08:00
10 changed files with 2769 additions and 817 deletions

View File

@ -0,0 +1,23 @@
package controller
import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
)
func (b *BundleProvider) SendQuestionnaireSurvey(_ context.Context, req *bundle.SendQuestionnaireSurveyRequest) (*bundle.SendQuestionnaireSurveyResponse, error) {
return logic.SendQuestionnaireSurvey(req)
}
func (b *BundleProvider) GetQuestionnaireSurveyInfo(_ context.Context, req *bundle.GetQuestionnaireSurveyInfoRequest) (*bundle.GetQuestionnaireSurveyInfoResponse, error) {
return logic.GetQuestionnaireSurveyInfo(req)
}
func (b *BundleProvider) CreateQuestionnaireSurveyAnswer(_ context.Context, req *bundle.CreateQuestionnaireSurveyAnswerRequest) (*bundle.CreateQuestionnaireSurveyAnswerResponse, error) {
return logic.CreateQuestionnaireSurveyAnswer(req)
}
func (b *BundleProvider) GetQuestionnaireSurveyList(_ context.Context, req *bundle.GetQuestionnaireSurveyListRequest) (*bundle.GetQuestionnaireSurveyListResponse, error) {
return logic.GetQuestionnaireSurveyList(req)
}

View File

@ -0,0 +1,228 @@
package dao
import (
"encoding/json"
"errors"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
"micro-bundle/pkg/msg"
"time"
"github.com/google/uuid"
"github.com/samber/lo"
"gorm.io/gorm"
)
// 电话号码映射表:原始号码 -> 目标号码
var phoneMapping = map[string]string{
"15863272183": "15624971336", //毕德瑞
"15039229900": "18803928946", //陈春芳
"13832480736": "17746107444", //程宝江
"19290778586": "13196080727", //董跃亭
"18710227028": "13954838868", //方民
"17801586080": "15233398990", //韩玉玲
}
// 使用示例:仅当号码在白名单中时才返回映射结果,否则返回原号码
func MapPhoneIfInList(phone string) string {
if phoneMapping[phone] != "" {
return phoneMapping[phone]
}
return phone
}
func SendQuestionnaireSurvey(req *bundle.SendQuestionnaireSurveyRequest) (resp *bundle.SendQuestionnaireSurveyResponse, err error) {
resp = new(bundle.SendQuestionnaireSurveyResponse)
phone := MapPhoneIfInList(req.UserTel)
userInfo := &model.UserInfo{}
err = app.ModuleClients.BundleDB.Raw(`
SELECT
mau.id as user_id,
mau.sub_num as user_num,
mau.tel_num as user_tel,
marn.name as user_name
from `+"`micro-account`.`user`"+` as mau
left join `+"`micro-account`.`real_name`"+` as marn on marn.id = mau.real_name_id and marn.deleted_at = 0
where mau.deleted_at = 0 and mau.tel_num = ?
`, phone).Scan(&userInfo).Error
if err != nil {
return resp, err
}
if userInfo.UserId == 0 {
resp.Status = 1
return resp, nil
}
//判断是否在指定id列表中
userIds := []int{76, 77, 80, 82, 83, 98, 110, 119, 121, 137, 138, 140, 149, 152, 155, 156, 157, 163, 171, 178, 179, 183, 184, 187, 189, 195, 210, 212, 221, 223, 224, 225, 227, 229, 232, 233, 249, 279, 311, 274, 268, 314, 327, 291, 326, 320, 273, 319, 278, 264, 313, 296, 393, 395, 387, 371, 391, 366, 398, 400, 410, 411, 412, 419, 421, 430, 432, 540, 592, 630, 1015}
if lo.Contains(userIds, userInfo.UserId) {
resp.Status = 0
} else {
resp.Status = 1
return resp, nil
}
questionnaireInfo := &model.QuestionnaireSurvey{}
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).
Where("user_tel = ? and deleted_at is null", phone).
Order("created_at desc").
First(&questionnaireInfo).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
resp.Status = 0
} else {
return resp, err
}
}
if questionnaireInfo.UserId != 0 {
if questionnaireInfo.SurveyStatus == msg.QuestionnaireSent {
resp.Status = 0
return resp, nil
}
resp.Status = 2
return resp, nil
}
orderRecord := &model.BundleOrderRecords{}
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Where("customer_num = ? and deleted_at is null", userInfo.UserNum).
Order("created_at desc").
First(&orderRecord).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
resp.Status = 1
return resp, nil
}
return resp, err
}
bundleBalance := &model.BundleBalance{}
month := timeParse(req.EndTime + " 23:59:59").Format("2006-01")
err = app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).
Where("order_uuid = ? and deleted_at is null", orderRecord.UUID).
Where("month = ?", month).
First(&bundleBalance).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
resp.Status = 1
return resp, nil
}
return resp, err
}
if bundleBalance.ID == 0 {
resp.Status = 1
return resp, nil
}
bundleInfo := &model.BundleInfo{
BundleName: orderRecord.BundleName,
StartAt: bundleBalance.StartAt,
ExpiredAt: bundleBalance.ExpiredAt,
BundleAccountNumber: 3,
BundleVideoNumber: bundleBalance.BundleLimitVideoConsumptionNumber,
IncreaseVideoNumber: bundleBalance.IncreaseVideoConsumptionNumber,
BundleImageNumber: bundleBalance.BundleLimitImageConsumptionNumber,
BundleDataNumber: bundleBalance.BundleLimitDataAnalysisConsumptionNumber,
BundleCompetitiveNumber: bundleBalance.BundleLimitCompetitiveConsumptionNumber,
}
bundleInfoJSON, err := json.Marshal(bundleInfo)
if err != nil {
return resp, err
}
data := &model.QuestionnaireSurvey{
SurveyUUID: uuid.New().String(),
UserId: userInfo.UserId,
UserNum: userInfo.UserNum,
UserName: userInfo.UserName,
UserTel: userInfo.UserTel,
OrderUUID: orderRecord.UUID,
SendTime: timeParse(time.Now().Format("2006-01-02 15:04:05")),
SubmitTime: timeParse(time.Now().Format("2006-01-02 15:04:05")),
SurveyStatus: msg.QuestionnaireSent,
BundleInfo: string(bundleInfoJSON),
SurveyTitle: req.SurveyTitle,
}
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).Create(data).Error
if err != nil {
return resp, err
}
resp.Status = 0
return resp, nil
}
func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (data *model.QuestionnaireSurvey, err error) {
data = &model.QuestionnaireSurvey{}
phone := MapPhoneIfInList(req.UserTel)
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).
Where("user_tel = ? and deleted_at is null", phone).
Order("created_at desc").
First(&data).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("问卷信息不存在")
}
return data, err
}
return data, nil
}
func CreateQuestionnaireSurveyAnswer(req *bundle.CreateQuestionnaireSurveyAnswerRequest) (err error) {
phone := MapPhoneIfInList(req.UserTel)
surveyAnswer := &model.SurveyAnswer{
BundleAccountScore: req.SurveyAnswer.BundleAccountScore,
BundleVideoScore: req.SurveyAnswer.BundleVideoScore,
IncreaseVideoScore: req.SurveyAnswer.IncreaseVideoScore,
BundleImageScore: req.SurveyAnswer.BundleImageScore,
BundleDataScore: req.SurveyAnswer.BundleDataScore,
BundleCompetitiveScore: req.SurveyAnswer.BundleCompetitiveScore,
ServiceResponseSpeed: req.SurveyAnswer.ServiceResponseSpeed,
ServiceStaffProfessionalism: req.SurveyAnswer.ServiceStaffProfessionalism,
}
surveyAnswerJSON, err := json.Marshal(surveyAnswer)
if err != nil {
return err
}
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).
Where("user_tel = ? and deleted_at is null", phone).
Updates(map[string]interface{}{
"survey_answer": string(surveyAnswerJSON),
"merits_review": req.SurveyFeedback.MeritsReview,
"suggestionsor_improvements": req.SurveyFeedback.SuggestionsorImprovements,
"additional_comments": req.SurveyFeedback.AdditionalComments,
"submit_time": timeParse(time.Now().Format("2006-01-02 15:04:05")),
"survey_status": msg.QuestionnaireSubmitted,
"survey_url": req.SurveyUrl,
"submit_by": req.SubmitBy,
}).Error
if err != nil {
return err
}
return nil
}
func GetQuestionnaireSurveyList(req *bundle.GetQuestionnaireSurveyListRequest) (data []*model.QuestionnaireSurvey, total int64, err error) {
if req.Page == 0 {
req.Page = 1
}
if req.PageSize == 0 {
req.PageSize = 10
}
query := app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{})
if req.UserName != "" {
query = query.Where("user_name = ?", req.UserName)
}
if req.SurveyTitle != "" {
query = query.Where("survey_title = ?", req.SurveyTitle)
}
if req.SurveyStatus != 0 {
query = query.Where("survey_status = ?", req.SurveyStatus)
}
query = query.Order("created_at desc")
query.Count(&total)
query = query.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
err = query.Find(&data).Error
if err != nil {
return data, total, err
}
return data, total, nil
}

View File

@ -0,0 +1,77 @@
package logic
import (
"encoding/json"
"errors"
"fmt"
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"github.com/samber/lo"
)
func SendQuestionnaireSurvey(req *bundle.SendQuestionnaireSurveyRequest) (*bundle.SendQuestionnaireSurveyResponse, error) {
resp, err := dao.SendQuestionnaireSurvey(req)
if err != nil {
return nil, err
}
return resp, nil
}
func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (*bundle.GetQuestionnaireSurveyInfoResponse, error) {
resp := new(bundle.GetQuestionnaireSurveyInfoResponse)
data, err := dao.GetQuestionnaireSurveyInfo(req)
if err != nil {
return nil, errors.New("获取问卷信息失败")
}
bundleInfo := &model.BundleInfo{}
err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo)
if err != nil {
return nil, errors.New("反序列化失败")
}
fmt.Println("获取套餐名称:", bundleInfo.BundleName)
resp.UserName = data.UserName
resp.BundleInfo = &bundle.SurveyBundleInfo{}
resp.BundleInfo.BundleName = bundleInfo.BundleName
resp.BundleInfo.StartAt = bundleInfo.StartAt.Format("2006-01-02 15:04:05")
resp.BundleInfo.ExpiredAt = bundleInfo.ExpiredAt.Format("2006-01-02 15:04:05")
resp.BundleInfo.BundleAccountNumber = int32(bundleInfo.BundleAccountNumber)
resp.BundleInfo.BundleVideoNumber = int32(bundleInfo.BundleVideoNumber)
resp.BundleInfo.IncreaseVideoNumber = int32(bundleInfo.IncreaseVideoNumber)
resp.BundleInfo.BundleImageNumber = int32(bundleInfo.BundleImageNumber)
resp.BundleInfo.BundleDataNumber = int32(bundleInfo.BundleDataNumber)
resp.BundleInfo.BundleCompetitiveNumber = int32(bundleInfo.BundleCompetitiveNumber)
return resp, nil
}
func CreateQuestionnaireSurveyAnswer(req *bundle.CreateQuestionnaireSurveyAnswerRequest) (*bundle.CreateQuestionnaireSurveyAnswerResponse, error) {
resp := new(bundle.CreateQuestionnaireSurveyAnswerResponse)
err := dao.CreateQuestionnaireSurveyAnswer(req)
if err != nil {
return nil, err
}
return resp, nil
}
func GetQuestionnaireSurveyList(req *bundle.GetQuestionnaireSurveyListRequest) (resp *bundle.GetQuestionnaireSurveyListResponse, err error) {
resp = &bundle.GetQuestionnaireSurveyListResponse{}
data, total, err := dao.GetQuestionnaireSurveyList(req)
if err != nil {
return nil, err
}
resp.Total = int32(total)
resp.Page = req.Page
resp.Size = req.PageSize
resp.SurveyList = lo.Map(data, func(m *model.QuestionnaireSurvey, _ int) *bundle.SurveyListInfo {
return &bundle.SurveyListInfo{
UserName: m.UserName,
UserTel: m.UserTel,
UserNum: m.UserNum,
SurveyTitle: m.SurveyTitle,
SurveyStatus: int32(m.SurveyStatus),
SurveyUrl: m.SurveyUrl,
}
})
return resp, nil
}

View File

@ -0,0 +1,75 @@
package model
import (
"time"
"gorm.io/gorm"
)
type QuestionnaireSurvey struct {
gorm.Model
SurveyUUID string `gorm:"column:survey_uuid;comment:问卷UUID" json:"survey_uuid"`
UserId int `gorm:"column:user_id;comment:用户ID" json:"user_id"`
UserNum string `gorm:"column:user_num;comment:用户编号" json:"user_num"`
UserName string `gorm:"column:user_name;comment:用户姓名" json:"user_name"`
UserTel string `gorm:"column:user_tel;comment:用户电话" json:"user_tel"`
OrderUUID string `gorm:"column:order_uuid;comment:订单UUID" json:"order_uuid"`
SendTime time.Time `gorm:"column:send_time;comment:发送时间" json:"send_time"`
SubmitTime time.Time `gorm:"column:submit_time;comment:提交时间" json:"submit_time"`
SurveyTitle string `gorm:"column:survey_title;comment:问卷标题" json:"survey_title"`
SurveyStatus int `gorm:"column:survey_status;comment:问卷状态 1:已发送 2:已提交" json:"survey_status"`
BundleInfo string `gorm:"column:bundle_info;type:varchar(1024);comment:套餐信息" json:"bundle_info"`
SurveyAnswer string `gorm:"column:survey_answer;type:varchar(512);comment:问卷答案" json:"survey_answer"`
MeritsReview string `gorm:"column:merits_review;type:varchar(512);comment:优点评价" json:"merits_review"`
SuggestionsorImprovements string `gorm:"column:suggestionsor_improvements;type:varchar(512);comment:改进建议" json:"suggestionsor_improvements"`
AdditionalComments string `gorm:"column:additional_comments;type:varchar(512);comment:补充意见" json:"additional_comments"`
SurveyUrl string `gorm:"column:survey_url;comment:问卷URL" json:"survey_url"`
SubmitBy string `gorm:"column:submit_by;comment:提交人" json:"submit_by"`
}
func (QuestionnaireSurvey) TableName() string {
return "questionnaire_survey"
}
type BundleInfo struct {
BundleName string `gorm:"column:bundle_name;not null;comment:套餐名称" json:"bundle_name"`
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间"`
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间"`
BundleAccountNumber int `gorm:"column:bundle_account_number;not null;comment:套餐账号数量" json:"bundle_account_number"`
BundleVideoNumber int `gorm:"column:bundle_video_number;not null;comment:套餐视频数量" json:"bundle_video_number"`
IncreaseVideoNumber int `gorm:"column:increase_video_number;not null;comment:增值视频数量" json:"increase_video_number"`
BundleImageNumber int `gorm:"column:bundle_image_number;not null;comment:套餐图片数量" json:"bundle_image_number"`
BundleDataNumber int `gorm:"column:bundle_data_number;not null;comment:套餐数据数量" json:"bundle_data_number"`
BundleCompetitiveNumber int `gorm:"column:bundle_competitive_number;not null;comment:套餐竞品数量" json:"bundle_competitive_number"`
}
type SurveyAnswer struct {
BundleAccountScore int32 `gorm:"column:bundle_account_score;not null;comment:套餐账号评分" json:"bundle_account_score"`
BundleVideoScore int32 `gorm:"column:bundle_video_score;not null;comment:套餐视频评分" json:"bundle_video_score"`
IncreaseVideoScore int32 `gorm:"column:increase_video_score;not null;comment:增值视频评分" json:"increase_video_score"`
BundleImageScore int32 `gorm:"column:bundle_image_score;not null;comment:套餐图片评分" json:"bundle_image_score"`
BundleDataScore int32 `gorm:"column:bundle_data_score;not null;comment:套餐数据评分" json:"bundle_data_score"`
BundleCompetitiveScore int32 `gorm:"column:bundle_competitive_score;not null;comment:套餐竞品评分" json:"bundle_competitive_score"`
ServiceResponseSpeed int32 `gorm:"column:service_response_speed;not null;comment:服务响应速度评分" json:"service_response_speed"`
ServiceStaffProfessionalism int32 `gorm:"column:service_staff_professionalism;not null;comment:服务人员专业性评分" json:"service_staff_professionalism"`
}
type UserInfo struct {
UserId int `gorm:"column:user_id;not null;comment:用户ID" json:"user_id"`
UserNum string `gorm:"column:user_num;not null;comment:用户编号" json:"user_num"`
UserName string `gorm:"column:user_name;not null;comment:用户姓名" json:"user_name"`
UserTel string `gorm:"column:user_tel;not null;comment:用户电话" json:"user_tel"`
}
type DbBundleInfo struct {
UserName string `json:"user_name"`
BundleName string `json:"bundle_name"`
StartAt time.Time `json:"start_at"`
ExpiredAt time.Time `json:"expired_at"`
BundleAccountNumber int32 `json:"bundle_account_number"`
BundleVideoNumber int32 `json:"bundle_video_number"`
IncreaseVideoNumber int32 `json:"increase_video_number"`
BundleImageNumber int32 `json:"bundle_image_number"`
BundleDataNumber int32 `json:"bundle_data_number"`
BundleCompetitiveNumber int32 `json:"bundle_competitive_number"`
}

View File

@ -146,6 +146,13 @@ service Bundle {
rpc UpdateOrderRecordByOrderUuid(OrderRecord) returns (CommonResponse) {}
rpc OrderListByOrderUuid(OrderInfoByOrderUuidRequest) returns (OrderInfoByOrderNoResp) {}
//
rpc SendQuestionnaireSurvey(SendQuestionnaireSurveyRequest) returns (SendQuestionnaireSurveyResponse) {}
rpc GetQuestionnaireSurveyInfo(GetQuestionnaireSurveyInfoRequest) returns (GetQuestionnaireSurveyInfoResponse) {}
rpc CreateQuestionnaireSurveyAnswer(CreateQuestionnaireSurveyAnswerRequest) returns (CreateQuestionnaireSurveyAnswerResponse) {}
rpc GetQuestionnaireSurveyList(GetQuestionnaireSurveyListRequest) returns (GetQuestionnaireSurveyListResponse) {}
}
message GetInEffectOrderRecordRequest{
uint64 userID = 1;
@ -2374,4 +2381,89 @@ message UpdataInvoiceInfoReq{
}
message UpdataInvoiceInfoResp{
}
message SendQuestionnaireSurveyRequest{
string endTime = 1;
string userTel = 2;
string surveyTitle = 3;
}
message SendQuestionnaireSurveyResponse{
int32 status = 1;//0 1 2
}
message GetQuestionnaireSurveyInfoRequest{
string userTel = 1;
}
message SurveyBundleInfo{
string bundleName = 1;
string startAt = 2;
string expiredAt = 3;
int32 bundleAccountNumber = 4;
int32 bundleVideoNumber = 5;
int32 increaseVideoNumber = 6;
int32 bundleImageNumber = 7;
int32 bundleDataNumber = 8;
int32 bundleCompetitiveNumber = 9;
}
message GetQuestionnaireSurveyInfoResponse{
string userName = 1;
SurveyBundleInfo bundleInfo = 2;
}
message SurveyAnswer {
int32 BundleAccountScore = 1;
int32 BundleVideoScore = 2;
int32 IncreaseVideoScore = 3;
int32 BundleImageScore = 4;
int32 BundleDataScore = 5;
int32 BundleCompetitiveScore = 6;
int32 ServiceResponseSpeed = 7;
int32 ServiceStaffProfessionalism = 8;
}
message SurveyFeedback {
string MeritsReview = 1;
string SuggestionsorImprovements = 2;
string AdditionalComments = 3;
}
message CreateQuestionnaireSurveyAnswerRequest{
string userTel = 1;
SurveyAnswer surveyAnswer = 2;
SurveyFeedback surveyFeedback = 3;
string surveyUrl = 4;
string submitTime = 5;
string submitBy = 6;
string longitude = 7;
string latitude = 8;
}
message CreateQuestionnaireSurveyAnswerResponse{
}
message GetQuestionnaireSurveyListRequest{
int32 page = 1;
int32 pageSize = 2;
string userName = 3;
string surveyTitle = 4;
int32 surveyStatus = 5;
}
message SurveyListInfo{
string userName = 1;
string userTel = 2;
string userNum = 3;
string surveyTitle = 4;
int32 surveyStatus = 5;
string surveyUrl = 6;
}
message GetQuestionnaireSurveyListResponse{
repeated SurveyListInfo surveyList = 1;
int32 total = 2;
int32 page = 3;
int32 size = 4;
}

File diff suppressed because it is too large Load Diff

View File

@ -1096,3 +1096,61 @@ func (this *UpdataInvoiceInfoReq) Validate() error {
func (this *UpdataInvoiceInfoResp) Validate() error {
return nil
}
func (this *SendQuestionnaireSurveyRequest) Validate() error {
return nil
}
func (this *SendQuestionnaireSurveyResponse) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyInfoRequest) Validate() error {
return nil
}
func (this *SurveyBundleInfo) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyInfoResponse) Validate() error {
if this.BundleInfo != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.BundleInfo); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleInfo", err)
}
}
return nil
}
func (this *SurveyAnswer) Validate() error {
return nil
}
func (this *SurveyFeedback) Validate() error {
return nil
}
func (this *CreateQuestionnaireSurveyAnswerRequest) Validate() error {
if this.SurveyAnswer != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.SurveyAnswer); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SurveyAnswer", err)
}
}
if this.SurveyFeedback != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.SurveyFeedback); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SurveyFeedback", err)
}
}
return nil
}
func (this *CreateQuestionnaireSurveyAnswerResponse) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyListRequest) Validate() error {
return nil
}
func (this *SurveyListInfo) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyListResponse) Validate() error {
for _, item := range this.SurveyList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SurveyList", err)
}
}
}
return nil
}

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.21.1
// - protoc-gen-go-triple v1.0.5
// - protoc v5.26.0
// source: pb/bundle.proto
package bundle
@ -147,6 +147,11 @@ type BundleClient interface {
GetPaymentCyclesByContractUUID(ctx context.Context, in *GetPaymentCyclesByContractUUIDRequest, opts ...grpc_go.CallOption) (*GetPaymentCyclesByContractUUIDResponse, common.ErrorWithAttachment)
UpdateOrderRecordByOrderUuid(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
OrderListByOrderUuid(ctx context.Context, in *OrderInfoByOrderUuidRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
// 问卷调查
SendQuestionnaireSurvey(ctx context.Context, in *SendQuestionnaireSurveyRequest, opts ...grpc_go.CallOption) (*SendQuestionnaireSurveyResponse, common.ErrorWithAttachment)
GetQuestionnaireSurveyInfo(ctx context.Context, in *GetQuestionnaireSurveyInfoRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyInfoResponse, common.ErrorWithAttachment)
CreateQuestionnaireSurveyAnswer(ctx context.Context, in *CreateQuestionnaireSurveyAnswerRequest, opts ...grpc_go.CallOption) (*CreateQuestionnaireSurveyAnswerResponse, common.ErrorWithAttachment)
GetQuestionnaireSurveyList(ctx context.Context, in *GetQuestionnaireSurveyListRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyListResponse, common.ErrorWithAttachment)
}
type bundleClient struct {
@ -261,6 +266,10 @@ type BundleClientImpl struct {
GetPaymentCyclesByContractUUID func(ctx context.Context, in *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error)
UpdateOrderRecordByOrderUuid func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
OrderListByOrderUuid func(ctx context.Context, in *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error)
SendQuestionnaireSurvey func(ctx context.Context, in *SendQuestionnaireSurveyRequest) (*SendQuestionnaireSurveyResponse, error)
GetQuestionnaireSurveyInfo func(ctx context.Context, in *GetQuestionnaireSurveyInfoRequest) (*GetQuestionnaireSurveyInfoResponse, error)
CreateQuestionnaireSurveyAnswer func(ctx context.Context, in *CreateQuestionnaireSurveyAnswerRequest) (*CreateQuestionnaireSurveyAnswerResponse, error)
GetQuestionnaireSurveyList func(ctx context.Context, in *GetQuestionnaireSurveyListRequest) (*GetQuestionnaireSurveyListResponse, error)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -917,6 +926,30 @@ func (c *bundleClient) OrderListByOrderUuid(ctx context.Context, in *OrderInfoBy
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderListByOrderUuid", in, out)
}
func (c *bundleClient) SendQuestionnaireSurvey(ctx context.Context, in *SendQuestionnaireSurveyRequest, opts ...grpc_go.CallOption) (*SendQuestionnaireSurveyResponse, common.ErrorWithAttachment) {
out := new(SendQuestionnaireSurveyResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SendQuestionnaireSurvey", in, out)
}
func (c *bundleClient) GetQuestionnaireSurveyInfo(ctx context.Context, in *GetQuestionnaireSurveyInfoRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyInfoResponse, common.ErrorWithAttachment) {
out := new(GetQuestionnaireSurveyInfoResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetQuestionnaireSurveyInfo", in, out)
}
func (c *bundleClient) CreateQuestionnaireSurveyAnswer(ctx context.Context, in *CreateQuestionnaireSurveyAnswerRequest, opts ...grpc_go.CallOption) (*CreateQuestionnaireSurveyAnswerResponse, common.ErrorWithAttachment) {
out := new(CreateQuestionnaireSurveyAnswerResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateQuestionnaireSurveyAnswer", in, out)
}
func (c *bundleClient) GetQuestionnaireSurveyList(ctx context.Context, in *GetQuestionnaireSurveyListRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyListResponse, common.ErrorWithAttachment) {
out := new(GetQuestionnaireSurveyListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetQuestionnaireSurveyList", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
@ -1040,6 +1073,11 @@ type BundleServer interface {
GetPaymentCyclesByContractUUID(context.Context, *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error)
UpdateOrderRecordByOrderUuid(context.Context, *OrderRecord) (*CommonResponse, error)
OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error)
// 问卷调查
SendQuestionnaireSurvey(context.Context, *SendQuestionnaireSurveyRequest) (*SendQuestionnaireSurveyResponse, error)
GetQuestionnaireSurveyInfo(context.Context, *GetQuestionnaireSurveyInfoRequest) (*GetQuestionnaireSurveyInfoResponse, error)
CreateQuestionnaireSurveyAnswer(context.Context, *CreateQuestionnaireSurveyAnswerRequest) (*CreateQuestionnaireSurveyAnswerResponse, error)
GetQuestionnaireSurveyList(context.Context, *GetQuestionnaireSurveyListRequest) (*GetQuestionnaireSurveyListResponse, error)
mustEmbedUnimplementedBundleServer()
}
@ -1369,6 +1407,18 @@ func (UnimplementedBundleServer) UpdateOrderRecordByOrderUuid(context.Context, *
func (UnimplementedBundleServer) OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderListByOrderUuid not implemented")
}
func (UnimplementedBundleServer) SendQuestionnaireSurvey(context.Context, *SendQuestionnaireSurveyRequest) (*SendQuestionnaireSurveyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendQuestionnaireSurvey not implemented")
}
func (UnimplementedBundleServer) GetQuestionnaireSurveyInfo(context.Context, *GetQuestionnaireSurveyInfoRequest) (*GetQuestionnaireSurveyInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetQuestionnaireSurveyInfo not implemented")
}
func (UnimplementedBundleServer) CreateQuestionnaireSurveyAnswer(context.Context, *CreateQuestionnaireSurveyAnswerRequest) (*CreateQuestionnaireSurveyAnswerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateQuestionnaireSurveyAnswer not implemented")
}
func (UnimplementedBundleServer) GetQuestionnaireSurveyList(context.Context, *GetQuestionnaireSurveyListRequest) (*GetQuestionnaireSurveyListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetQuestionnaireSurveyList not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
@ -4500,6 +4550,122 @@ func _Bundle_OrderListByOrderUuid_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _Bundle_SendQuestionnaireSurvey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SendQuestionnaireSurveyRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("SendQuestionnaireSurvey", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetQuestionnaireSurveyInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetQuestionnaireSurveyInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetQuestionnaireSurveyInfo", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_CreateQuestionnaireSurveyAnswer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateQuestionnaireSurveyAnswerRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("CreateQuestionnaireSurveyAnswer", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetQuestionnaireSurveyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetQuestionnaireSurveyListRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetQuestionnaireSurveyList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -4935,6 +5101,22 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "OrderListByOrderUuid",
Handler: _Bundle_OrderListByOrderUuid_Handler,
},
{
MethodName: "SendQuestionnaireSurvey",
Handler: _Bundle_SendQuestionnaireSurvey_Handler,
},
{
MethodName: "GetQuestionnaireSurveyInfo",
Handler: _Bundle_GetQuestionnaireSurveyInfo_Handler,
},
{
MethodName: "CreateQuestionnaireSurveyAnswer",
Handler: _Bundle_CreateQuestionnaireSurveyAnswer_Handler,
},
{
MethodName: "GetQuestionnaireSurveyList",
Handler: _Bundle_GetQuestionnaireSurveyList_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",

View File

@ -68,6 +68,7 @@ func loadMysqlConn(conn string) *gorm.DB {
&model.Customer{},
&model.Invoice{},
&model.PaperInvoiceAddress{},
&model.QuestionnaireSurvey{},
)
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "platform_ids") == false {
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "platform_ids"); err != nil {

View File

@ -126,3 +126,11 @@ const (
IsExpired = 1 //已过期
NotExpired = 0 //未过期
)
// 问卷状态
const (
//已发送
QuestionnaireSent = 1
//已提交
QuestionnaireSubmitted = 2
)