Răsfoiți Sursa

Merge branch 'dev1.0.0' of https://app.yhyue.com/moapp/jyInfo into dev1.0.0

wangshan 3 ani în urmă
părinte
comite
1c2c507d52

+ 6 - 0
rpc/common/internal/logic/sensitivemethodlogic.go

@@ -144,6 +144,12 @@ func (l *SensitiveMethodLogic) SensitiveMethod(in *commoninfo.SensitiveRequest)
 				supInfo["detail"] = (*data)["detail"]
 				supInfo["province"] = (*data)["province"]
 				supInfo["city"] = (*data)["city"]
+				validityTime := time.Now().Unix()
+				if (*data)["validity_time"] != nil && (*data)["validity_time"] != "" {
+					validity, _ := time.ParseInLocation("2006-01-02 15:04:05", mc.InterfaceToStr((*data)["validity_time"]), time.Local)
+					validityTime = validity.Unix()
+				}
+				supInfo["validityTime"] = validityTime
 				if !model.SaveSupplyInfo(entName, supInfo) {
 					log.Println("调用信息发布成功,更新信息失败", entName, supInfo)
 					resp.ErrCode = -3

+ 2 - 2
rpc/consumer/consumer.proto

@@ -267,7 +267,7 @@ message SupplyInfoDetailData {
 	string province = 4;//省份
 	string city = 5;//城市
 	string validityTime = 6;//有效期
-	int64 entId = 7;//企业id
+	string entId = 7;//企业id
 	string attach = 8;//附件列表
 	InfoDetailContact  infoDetailContact = 9;//联系人详情
 	string publishTime = 10;//发布时间
@@ -281,7 +281,7 @@ message OtherSupplyInfoByEnt{
 	string city = 4;
 	string publishTime = 5;
 	string createTime = 6;
-	int64 entId = 7;
+	string entId = 7;
 }
 //上传附件
 message InfoFileUploadReq {

+ 1 - 1
rpc/consumer/etc/consumer.yaml

@@ -29,4 +29,4 @@ Oss:
   ossAccessKeyId: LTAI4G5x9aoZx8dDamQ7vfZi
   ossAccessKeySecret: Bk98FsbPYXcJe72n1bG3Ssf73acuNh
   ossBucketName: jytest2022
-  ossUrl: https://jytest2022.oss-cn-beijing.aliyuncs.com/
+  ossUrl: https://jytest2022.oss-cn-beijing.aliyuncs.com

+ 16 - 6
rpc/consumer/internal/logic/publishinfologic.go

@@ -33,6 +33,13 @@ func NewPublishInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Publi
 	}
 }
 
+var PublishCity = map[string]string{
+	"北京": "北京市",
+	"上海": "上海市",
+	"天津": "天津市",
+	"重庆": "重庆市",
+}
+
 // 发布信息
 func (l *PublishInfoLogic) PublishInfo(in *consumerinfo.PublishInfoReq) (*consumerinfo.PublishInfoResp, error) {
 	res := consumerinfo.PublishInfoResp{}
@@ -40,11 +47,15 @@ func (l *PublishInfoLogic) PublishInfo(in *consumerinfo.PublishInfoReq) (*consum
 	var id int64
 	//信息类型1:招标信息 2:采购信息 3:供应信息
 	publishData := make(map[string]interface{})
-	publishData["user_id"] = in.UserId                                                            //发布人用户ID
-	publishData["phone"] = in.Phone                                                               //注册手机号
-	publishData["title"] = in.Title                                                               //信息标题
-	publishData["province"] = in.Province                                                         //项目省份
-	publishData["city"] = in.City                                                                 //项目城市
+	publishData["user_id"] = in.UserId    //发布人用户ID
+	publishData["phone"] = in.Phone       //注册手机号
+	publishData["title"] = in.Title       //信息标题
+	publishData["province"] = in.Province //项目省份
+	if v, ok := PublishCity[in.Province]; ok && v != "" {
+		publishData["city"] = v
+	} else {
+		publishData["city"] = in.City
+	} //项目城市
 	publishData["detail"] = util.NewCut().ClearHtml(in.Detail)                                    //正文信息
 	publishData["create_time"] = time.Now().Format("2006-01-02 15:04:05")                         //申请时间
 	publishData["attach"] = in.Attach                                                             //附件(多个附件逗号分割)
@@ -58,7 +69,6 @@ func (l *PublishInfoLogic) PublishInfo(in *consumerinfo.PublishInfoReq) (*consum
 	publishData["app_id"] = in.AppId
 	//  0:全部;1:待审核;2:待人工审核(敏感词审核不通过||敏感词审核通过);3:自动审核通过;4:人工审核通过;-1:自动审核不通过(机构冻结);-2:人工审核不通过;
 	publishData["status"] = 1
-	log.Println(in.MsgType, "-------------------")
 	switch in.MsgType {
 	case 1, 2:
 		publishData["related_id"] = mc.IntAll(se.SE.DecodeString(in.RelatedId)) //关联公告id

+ 2 - 2
rpc/consumer/internal/logic/supplyinfodetaillogic.go

@@ -56,7 +56,7 @@ func (l *SupplyInfoDetailLogic) SupplyInfoDetail(in *consumerinfo.StatusReq) (*c
 			conctact.Overt = mc.Int64All((*data)["contact_overt"])
 			info.InfoDetailContact = &conctact
 			info.Attach = astr
-			info.EntId = mc.Int64All((*data)["ent_id"])
+			info.EntId = se.SE.Encode2HexByCheck(mc.InterfaceToStr((*data)["ent_id"]))
 			info.Id = in.MsgId
 			//其他供应信息
 			otherData := es.GetSupplyOtherInfoByEntid(mc.InterfaceToStr(info.EntId), 5)
@@ -72,7 +72,7 @@ func (l *SupplyInfoDetailLogic) SupplyInfoDetail(in *consumerinfo.StatusReq) (*c
 						City:        mc.InterfaceToStr(v["city"]),
 						PublishTime: strconv.FormatInt(mc.Int64All(v["publish_time"]), 10),
 						CreateTime:  strconv.FormatInt(mc.Int64All(v["create_time"]), 10),
-						EntId:       mc.Int64All(v["ent_id"]),
+						EntId:       se.SE.Encode2HexByCheck(mc.InterfaceToStr(v["ent_id"])),
 					}
 					info.OtherSupplyInfo = append(info.OtherSupplyInfo, &otherSupplyInfo)
 				}

+ 10 - 15
rpc/consumer/type/consumer/consumer.pb.go

@@ -1,13 +1,12 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.23.0
-// 	protoc        v3.15.5
+// 	protoc-gen-go v1.28.0
+// 	protoc        v3.19.4
 // source: consumer.proto
 
 package consumer
 
 import (
-	proto "github.com/golang/protobuf/proto"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	reflect "reflect"
@@ -21,10 +20,6 @@ const (
 	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
 )
 
-// This is a compile-time assertion that a sufficiently up-to-date version
-// of the legacy proto package is being used.
-const _ = proto.ProtoPackageIsVersion4
-
 //信息发布Req
 type PublishInfoReq struct {
 	state         protoimpl.MessageState
@@ -2456,7 +2451,7 @@ type SupplyInfoDetailData struct {
 	Province          string                  `protobuf:"bytes,4,opt,name=province,proto3" json:"province,omitempty"`                   //省份
 	City              string                  `protobuf:"bytes,5,opt,name=city,proto3" json:"city,omitempty"`                           //城市
 	ValidityTime      string                  `protobuf:"bytes,6,opt,name=validityTime,proto3" json:"validityTime,omitempty"`           //有效期
-	EntId             int64                   `protobuf:"varint,7,opt,name=entId,proto3" json:"entId,omitempty"`                        //企业id
+	EntId             string                  `protobuf:"bytes,7,opt,name=entId,proto3" json:"entId,omitempty"`                         //企业id
 	Attach            string                  `protobuf:"bytes,8,opt,name=attach,proto3" json:"attach,omitempty"`                       //附件列表
 	InfoDetailContact *InfoDetailContact      `protobuf:"bytes,9,opt,name=infoDetailContact,proto3" json:"infoDetailContact,omitempty"` //联系人详情
 	PublishTime       string                  `protobuf:"bytes,10,opt,name=publishTime,proto3" json:"publishTime,omitempty"`            //发布时间
@@ -2537,11 +2532,11 @@ func (x *SupplyInfoDetailData) GetValidityTime() string {
 	return ""
 }
 
-func (x *SupplyInfoDetailData) GetEntId() int64 {
+func (x *SupplyInfoDetailData) GetEntId() string {
 	if x != nil {
 		return x.EntId
 	}
-	return 0
+	return ""
 }
 
 func (x *SupplyInfoDetailData) GetAttach() string {
@@ -2584,7 +2579,7 @@ type OtherSupplyInfoByEnt struct {
 	City        string `protobuf:"bytes,4,opt,name=city,proto3" json:"city,omitempty"`
 	PublishTime string `protobuf:"bytes,5,opt,name=publishTime,proto3" json:"publishTime,omitempty"`
 	CreateTime  string `protobuf:"bytes,6,opt,name=createTime,proto3" json:"createTime,omitempty"`
-	EntId       int64  `protobuf:"varint,7,opt,name=entId,proto3" json:"entId,omitempty"`
+	EntId       string `protobuf:"bytes,7,opt,name=entId,proto3" json:"entId,omitempty"`
 }
 
 func (x *OtherSupplyInfoByEnt) Reset() {
@@ -2661,11 +2656,11 @@ func (x *OtherSupplyInfoByEnt) GetCreateTime() string {
 	return ""
 }
 
-func (x *OtherSupplyInfoByEnt) GetEntId() int64 {
+func (x *OtherSupplyInfoByEnt) GetEntId() string {
 	if x != nil {
 		return x.EntId
 	}
-	return 0
+	return ""
 }
 
 //上传附件
@@ -3302,7 +3297,7 @@ var file_consumer_proto_rawDesc = []byte{
 	0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x54, 0x69,
 	0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x61,
+	0x09, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x61,
 	0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68,
 	0x12, 0x49, 0x0a, 0x11, 0x69, 0x6e, 0x66, 0x6f, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x43, 0x6f,
 	0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f,
@@ -3327,7 +3322,7 @@ var file_consumer_proto_rawDesc = []byte{
 	0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61,
 	0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72,
 	0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49,
-	0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5f,
+	0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5f,
 	0x0a, 0x11, 0x49, 0x6e, 0x66, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64,
 	0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18,
 	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12,

+ 1 - 1
rpc/consumer/type/consumer/consumer_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.15.5
+// - protoc             v3.19.4
 // source: consumer.proto
 
 package consumer

+ 6 - 0
rpc/manager/internal/logic/infoexaminelogic.go

@@ -110,6 +110,12 @@ func (l *InfoExamineLogic) InfoExamine(in *manager.InfoExamineReq) (*manager.Inf
 				supInfo["detail"] = (*data)["detail"]
 				supInfo["province"] = (*data)["province"]
 				supInfo["city"] = (*data)["city"]
+				validityTime := time.Now().Unix()
+				if (*data)["validity_time"] != nil && (*data)["validity_time"] != "" {
+					validity, _ := time.ParseInLocation("2006-01-02 15:04:05", common.InterfaceToStr((*data)["validity_time"]), time.Local)
+					validityTime = validity.Unix()
+				}
+				supInfo["validityTime"] = validityTime
 				if !model.SaveSupplyInfo(entName, supInfo) {
 					resp.ErrCode = -1
 					resp.ErrMsg = "人工审核通过,信息发布调用失败"

+ 6 - 0
rpc/manager/internal/logic/infoonekeyactionlogic.go

@@ -81,6 +81,12 @@ func (l *InfoOneKeyActionLogic) InfoOneKeyAction(in *manager.OneKeyActionReq) (*
 					supInfo["detail"] = res["detail"]
 					supInfo["province"] = res["province"]
 					supInfo["city"] = res["city"]
+					validityTime := time.Now().Unix()
+					if res["validity_time"] != nil && res["validity_time"] != "" {
+						validity, _ := time.ParseInLocation("2006-01-02 15:04:05", mc.InterfaceToStr(res["validity_time"]), time.Local)
+						validityTime = validity.Unix()
+					}
+					supInfo["validityTime"] = validityTime
 					if ok := es.SaveSupplyInfo(in.EntName, supInfo); ok {
 						if !model.Mysql.Update(tname, query, map[string]interface{}{
 							"published": 1,

+ 1 - 1
rpc/model/es/es.go

@@ -123,7 +123,7 @@ func SaveSupplyInfo(ent_name string, supplyInfo map[string]interface{}) bool {
 		"ent_name":      ent_name, //机构名称
 		"province":      supplyInfo["province"],
 		"city":          supplyInfo["city"],
-		"validity_time": now,
+		"validity_time": supplyInfo["validity_time"],
 		"create_time":   now,
 		"publish_time":  now,
 	})