message
CI / changes (push) Successful in 38s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 1s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 51s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 49s
CI / payment (push) Successful in 0s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 0s
CI / changes (push) Successful in 38s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 1s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 51s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 49s
CI / payment (push) Successful in 0s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 0s
This commit is contained in:
@@ -31,19 +31,6 @@ func NewExpressJdBackLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Exp
|
||||
}
|
||||
|
||||
func (l *ExpressJdBackLogic) ExpressJdBack(in *express.JdRequest) (*express.SfResponse, error) {
|
||||
//TODO 透传数据还是获取?
|
||||
l.Logger.Error(in)
|
||||
//routers.POST("/transit/jd", obj.JdBack)
|
||||
//appKey := c.Query("app_key")
|
||||
//timestamp := c.Query("timestamp")
|
||||
//sign := c.Query("sign")
|
||||
//path := c.Query("path")
|
||||
//
|
||||
//l.Logger.Info("JD back params : app_key=", appKey,
|
||||
// " timestamp=", timestamp, " sign=", sign, " path=", path)
|
||||
|
||||
//JD back params : app_key=e99f6232b45c4c3e871780f5a9b1a555 timestamp=Tue, 26 May 2026 01:41:06 GMT sign=2640A486A4A529AAD722FED2E5C7E0BB path=
|
||||
//JD back data:{"carrierId":2087,"customerOrderNo":"JD2026052609395822530404255","extend":{"curSiteName":"张家口涿鹿汽车点部项目小站","curSiteId":"1929145","siteTelephone":"15732381119","siteId":"4989","remark":"【实时调度-路区排班】揽收任务已分配给李晓龙,配送员电话13833376743","operatorPhone":"13833376743","curJDCode":"34512","requireTime":"2026-05-27 22:00:00"},"nextLocation":{},"operateLocation":{"lat":"40.459022","lon":"115.276425","routeAddress":" 河北省张家口市下花园区S342(张家口农商银行苏家坊信用社南)","routeCityName":"张家口市","routeDistrictName":"涿鹿县","routeProvinceName":"河北","routeStreetName":"涿鹿镇"},"operateSite":"张家口涿鹿汽车点部项目小站","operateSiteId":"1929145","operationCode":"200034","operationTime":"2026-05-26 09:40:11","operationType":"2013","operatorName":"李晓龙","orderNo":"JD2026052609395822530404255","remark":"您的快件将由快递员李晓龙上门取件,快递员电话:13833376743,营业部电话:15732381119","waybillNo":"JDVA44161571823"}
|
||||
body := utils.GetBody(l.ctx)
|
||||
ret := express.SfResponse{
|
||||
ReturnCode: "1001",
|
||||
|
||||
@@ -48,7 +48,7 @@ func (l *ApiMessageLogic) ApiMessage(in *message.ItemsRequest) (*message.Respons
|
||||
|
||||
items, err := model.MessageModel{}.Init().Page(w, &info)
|
||||
if err != nil {
|
||||
l.Logger.Error(err)
|
||||
l.Logger.Error("get message list failed", err)
|
||||
return l.fail(utils.Fail)
|
||||
}
|
||||
var ids []string
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/pkg/validate"
|
||||
chore "lone-services/rpc/chore/pb"
|
||||
message "lone-services/rpc/message/pb"
|
||||
user "lone-services/rpc/user/pb"
|
||||
"lone-services/services/store/internal/dao"
|
||||
"lone-services/services/store/internal/model"
|
||||
@@ -122,12 +123,8 @@ func (l *VerifyStatusLogic) VerifyStatus(in *store.StatusRequest) (*store.Respon
|
||||
//}
|
||||
}
|
||||
|
||||
//TODO 站内消息
|
||||
//mErr := MessageService{}.Add(dao.TargetTypeAgent, dao.ObjTypeStore, status, info.SaleId, info.Id, content)
|
||||
//if mErr != nil {
|
||||
// model.Rollback()
|
||||
// return mErr
|
||||
//}
|
||||
l.message(utils.NumberOne, utils.NumberTwo, int32(status), info.SaleId, info.Id, content)
|
||||
|
||||
modelObj.Commit()
|
||||
|
||||
return l.ok(utils.NumberOne)
|
||||
@@ -184,3 +181,33 @@ func (l *VerifyStatusLogic) sendPassword(mobile, password string) utils.Status {
|
||||
|
||||
return utils.Ok
|
||||
}
|
||||
|
||||
func (l *VerifyStatusLogic) message(targetType, Type, typeStatus int32, targetId, objId int64, content string) {
|
||||
//TargetTypeAgent uint8 = 1 //代理
|
||||
//TargetTypeStore uint8 = 2 //门店
|
||||
//TargetTypeUser uint8 = 3 //个人
|
||||
//// 类型
|
||||
//ObjTypeAgent uint8 = 1 //添加代理
|
||||
//ObjTypeStore uint8 = 2 //加门店
|
||||
//ObjTypeSupply uint8 = 3 //审核补货
|
||||
cli, err := svc.GetRpcClient(l.svcCtx.MessageName)
|
||||
if err != nil {
|
||||
logx.Errorf("get user err: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
client := message.NewMessageClient(cli.Conn())
|
||||
|
||||
_, err = client.MessageAdd(context.Background(), &message.AddRequest{
|
||||
Content: content,
|
||||
TargetType: targetType,
|
||||
TargetId: targetId,
|
||||
TypeStatus: typeStatus,
|
||||
Type: Type,
|
||||
ObjId: objId,
|
||||
})
|
||||
if err != nil {
|
||||
logx.Errorf("get order err: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,13 +72,14 @@ func GetRpcClient(serviceName string) (zrpc.Client, error) {
|
||||
}
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
DB *gorm.DB
|
||||
Prefix string
|
||||
SaleName string
|
||||
OrderName string
|
||||
UserName string
|
||||
ChoreName string
|
||||
Config config.Config
|
||||
DB *gorm.DB
|
||||
Prefix string
|
||||
SaleName string
|
||||
OrderName string
|
||||
UserName string
|
||||
ChoreName string
|
||||
MessageName string
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext {
|
||||
@@ -102,7 +103,10 @@ func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext {
|
||||
if ChoreSvc == utils.StringEmpty {
|
||||
logx.Error("config services.chore empty")
|
||||
}
|
||||
|
||||
MessageSvc := utils.GetConfigString("services.message")
|
||||
if MessageSvc == utils.StringEmpty {
|
||||
logx.Error("config services.message empty")
|
||||
}
|
||||
svcCtx := &ServiceContext{
|
||||
Config: c,
|
||||
DB: db,
|
||||
|
||||
Reference in New Issue
Block a user