From e6d1b90338eed969e337c0d8fbd960c003aec1e7 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Wed, 19 Jun 2024 13:58:47 +0800 Subject: [PATCH] by Robin at 20240619 --- api/consts/option.go | 8 ++ api/errcode/errcode.go | 8 ++ api/proto/hvyogo/proto/hvyogo_ext.go | 5 + api/proto/hvyogo/proto/hvyogo_vo.go | 11 ++ .../proto/single_distribute_his_op.go | 66 +++++++++++ app/mix/controller/hvyogo_callback.go | 17 ++- app/mix/controller/init.go | 8 ++ .../controller/single_distribute_his_op.go | 73 ++++++++++++ app/mix/dao/mongo.go | 52 +++++++++ app/mix/service/apiservice.go | 27 ++++- app/mix/service/hvyogoservice.go | 17 ++- .../service/logic/single_distribute_his.go | 65 +++++++++++ app/mix/service/service.go | 107 +++++++++++++++++- codecreate/codecreate.go | 8 +- codecreate/resource/EntityDefine.xlsx | Bin 53381 -> 54764 bytes dbstruct/single_distribute_his.go | 23 ++++ library/idgenerator/genid.go | 7 ++ 17 files changed, 492 insertions(+), 10 deletions(-) create mode 100644 api/proto/single_distribute_his/proto/single_distribute_his_op.go create mode 100644 app/mix/controller/single_distribute_his_op.go create mode 100644 app/mix/service/logic/single_distribute_his.go create mode 100644 dbstruct/single_distribute_his.go diff --git a/api/consts/option.go b/api/consts/option.go index 33637af5..b407cd61 100644 --- a/api/consts/option.go +++ b/api/consts/option.go @@ -63,3 +63,11 @@ const ( const ( StreamerAcct_MatchPhraseLen = 3 ) + +const ( + BankCard = 10 //银行卡 + Alipay = 20 //支付宝 + Weixin = 30 //微信 + MerchantWeixin = 40 //商户方微信 + CPAccount = 51 //中金支付电子账户 +) diff --git a/api/errcode/errcode.go b/api/errcode/errcode.go index 506ce95c..4da010af 100644 --- a/api/errcode/errcode.go +++ b/api/errcode/errcode.go @@ -215,6 +215,9 @@ var ErrCodeMsgMap = map[ErrCode]string{ ErrCodeWorkerIdSrvFail: "用户职业者id映射表服务错误", ErrCodeWorkerIdNotExist: "用户职业者id映射表不存在", + ErrCodeSingleDistributeHisSrvFail: "慧用工下发打款历史表服务错误", + ErrCodeSingleDistributeHisNotExist: "慧用工下发打款历史表不存在", + ErrCodeHvyogoSrvFail: "慧用工接口服务错误", } @@ -515,6 +518,11 @@ const ( ErrCodeWorkerIdSrvFail ErrCode = -41001 // 用户职业者id映射表服务错误 ErrCodeWorkerIdNotExist ErrCode = -41002 // 用户职业者id映射表不存在 + // SingleDistributeHis: 42xxx + ErrCodeSingleDistributeHisSrvOk ErrCode = ErrCodeOk + ErrCodeSingleDistributeHisSrvFail ErrCode = -42001 // 慧用工下发打款历史表服务错误 + ErrCodeSingleDistributeHisNotExist ErrCode = -42002 // 慧用工下发打款历史表不存在 + // Media: 60xxx ErrCodeMediaSrvOk ErrCode = ErrCodeOk ErrCodeMediaSrvFail ErrCode = -60001 // 媒体服务错误 diff --git a/api/proto/hvyogo/proto/hvyogo_ext.go b/api/proto/hvyogo/proto/hvyogo_ext.go index 2d622d59..199c0bd5 100644 --- a/api/proto/hvyogo/proto/hvyogo_ext.go +++ b/api/proto/hvyogo/proto/hvyogo_ext.go @@ -4,3 +4,8 @@ type ExtAgreeCallbackReq struct { CooperatorId string `json:"cooperatorId"` // 商户对接唯一标识 BusinessBody string `json:"businessBody"` // AES加密后的字符串 } + +type ExtSingleDistributeCallbackReq struct { + CooperatorId string `json:"cooperatorId"` // 商户对接唯一标识 + BusinessBody string `json:"businessBody"` // AES加密后的字符串 +} diff --git a/api/proto/hvyogo/proto/hvyogo_vo.go b/api/proto/hvyogo/proto/hvyogo_vo.go index f556c30e..7d514be0 100644 --- a/api/proto/hvyogo/proto/hvyogo_vo.go +++ b/api/proto/hvyogo/proto/hvyogo_vo.go @@ -7,6 +7,17 @@ type ExtAgreeCallbackVO struct { WorkerMobile string `json:"workerMobile"` // 自由职业者手机号 } +type ExtSingleDistributeCallbackVO struct { + RequestNo string `json:"request_no"` //商户下发请求单号 + DistributeId string `json:"distribute_id"` //慧用工平台处理单号 + DistributeStatus int `json:"distribute_status"` //下发状态 + ServiceCharge string `json:"service_charge"` //该笔下发的服务费(单位:分) + DistributeAmount string `json:"distribute_amount"` //下发金额(单位:分) + Timestamp string `json:"timestamp"` //下单时间 + Remark string `json:"remark"` //银行返回打款备注 + ReasonCode string `json:"reason_code"` //余额不足时会返回E00001 +} + type WorkerAgreeStateVO struct { StatusCode string `json:"statusCode"` StatusText string `json:"statusText"` diff --git a/api/proto/single_distribute_his/proto/single_distribute_his_op.go b/api/proto/single_distribute_his/proto/single_distribute_his_op.go new file mode 100644 index 00000000..b738a50b --- /dev/null +++ b/api/proto/single_distribute_his/proto/single_distribute_his_op.go @@ -0,0 +1,66 @@ +package proto + +import ( + "service/api/base" + "service/dbstruct" +) + +// op 创建 +type OpCreateReq struct { + base.BaseRequest + *dbstruct.SingleDistributeHis +} + +type OpCreateData struct { +} + +type OpCreateResp struct { + base.BaseResponse + Data *OpCreateData `json:"data"` +} + +// op 删除 +type OpDeleteReq struct { + base.BaseRequest + Id int64 `json:"id"` +} + +type OpDeleteData struct { +} + +type OpDeleteResp struct { + base.BaseResponse + Data *OpDeleteData `json:"data"` +} + +// op 更新 +type OpUpdateReq struct { + base.BaseRequest + *dbstruct.SingleDistributeHis +} + +type OpUpdateData struct { +} + +type OpUpdateResp struct { + base.BaseResponse + Data *OpUpdateData `json:"data"` +} + +// op 列表 +type OpListReq struct { + base.BaseRequest + Offset int `json:"offset"` + Limit int `json:"limit"` +} + +type OpListData struct { + List []*dbstruct.SingleDistributeHis `json:"list"` + Offset int `json:"offset"` + More int `json:"more"` +} + +type OpListResp struct { + base.BaseResponse + Data *OpListData `json:"data"` +} diff --git a/app/mix/controller/hvyogo_callback.go b/app/mix/controller/hvyogo_callback.go index 50bd56a5..84ba944f 100644 --- a/app/mix/controller/hvyogo_callback.go +++ b/app/mix/controller/hvyogo_callback.go @@ -17,7 +17,7 @@ func ExtAgreeCallback(ctx *gin.Context) { // 存入数据 ec := service.DefaultService.SaveAgreeCallback(ctx, req) - if ec != errcode.ErrCodeWorkerIdSrvOk { + if ec != errcode.ErrCodeHvyogoSrvOk { logger.Error("SaveAgreeCallback fail, req: %v, ec: %v", util.ToJson(req), ec) response.ReplyErrCodeMsg(ctx, ec) return @@ -25,3 +25,18 @@ func ExtAgreeCallback(ctx *gin.Context) { response.ReplyOk(ctx, nil) } + +func ExtSingleDistributeCallback(ctx *gin.Context) { + + req := ctx.MustGet("client_req").(*hvyogoproto.ExtSingleDistributeCallbackReq) + + // 存入数据 + ec := service.DefaultService.SaveSingleDistributeCallback(ctx, req) + if ec != errcode.ErrCodeHvyogoSrvOk { + logger.Error("SaveSingleDistributeCallback fail, req: %v, ec: %v", util.ToJson(req), ec) + response.ReplyErrCodeMsg(ctx, ec) + return + } + + response.ReplyOk(ctx, nil) +} diff --git a/app/mix/controller/init.go b/app/mix/controller/init.go index a4068a0c..8db76b5b 100644 --- a/app/mix/controller/init.go +++ b/app/mix/controller/init.go @@ -317,6 +317,7 @@ func Init(r *gin.Engine) { // 慧用工 extHvyogoGroup := r.Group("/ext/hvyogo") extHvyogoGroup.POST("agree_callback", middleware.JSONParamValidator(hvyogoproto.ExtAgreeCallbackReq{}), ExtAgreeCallback) + extHvyogoGroup.POST("single_distribute_callback", middleware.JSONParamValidator(hvyogoproto.ExtSingleDistributeCallbackReq{}), ExtSingleDistributeCallback) // 验证码 opVeriCodeGroup := r.Group("/op/veri_code", PrepareOp()) @@ -539,6 +540,13 @@ func Init(r *gin.Engine) { // 空间相关每日报表 opDailyStatementZoneInfoGroup := r.Group("/op/daily_statement_zone_info", PrepareOp()) opDailyStatementZoneInfoGroup.POST("list", middleware.JSONParamValidator(daily_statement_zone_info_proto.OpListReq{}), middleware.JwtAuthenticator(), OpGetDailyStatementZoneInfoList) + + // 慧用工下发打款历史表 + // opSingleDistributeHisGroup := r.Group("/api/single_distribute_his", PrepareOp()) + // opSingleDistributeHisGroup.POST("create", middleware.JSONParamValidator(single_distribute_hisproto.OpCreateReq{}), middleware.JwtAuthenticator(), OpCreateSingleDistributeHis) + // opSingleDistributeHisGroup.POST("update", middleware.JSONParamValidator(single_distribute_hisproto.OpUpdateReq{}), middleware.JwtAuthenticator(), OpUpdateSingleDistributeHis) + // opSingleDistributeHisGroup.POST("delete", middleware.JSONParamValidator(single_distribute_hisproto.OpDeleteReq{}), middleware.JwtAuthenticator(), OpDeleteSingleDistributeHis) + // opSingleDistributeHisGroup.POST("list", middleware.JSONParamValidator(single_distribute_hisproto.OpListReq{}), middleware.JwtAuthenticator(), OpGetSingleDistributeHisList) } func ServeFile(ctx *gin.Context) { diff --git a/app/mix/controller/single_distribute_his_op.go b/app/mix/controller/single_distribute_his_op.go new file mode 100644 index 00000000..b854ee33 --- /dev/null +++ b/app/mix/controller/single_distribute_his_op.go @@ -0,0 +1,73 @@ +package controller + +import ( + "service/api/consts" + "service/api/errcode" + single_distribute_his_proto "service/api/proto/single_distribute_his/proto" + "service/app/mix/service" + "service/bizcommon/util" + "service/library/logger" + + "github.com/gin-gonic/gin" +) + +func OpCreateSingleDistributeHis(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*single_distribute_his_proto.OpCreateReq) + ec := service.DefaultService.OpCreateSingleDistributeHis(ctx, req) + if ec != errcode.ErrCodeSingleDistributeHisSrvOk { + logger.Error("OpCreateSingleDistributeHis fail, req: %v, ec: %v", util.ToJson(req), ec) + ReplyErrorMsg(ctx, "server error") + return + } + + ReplyOk(ctx, nil) +} + +func OpUpdateSingleDistributeHis(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*single_distribute_his_proto.OpUpdateReq) + ec := service.DefaultService.OpUpdateSingleDistributeHis(ctx, req) + if ec != errcode.ErrCodeSingleDistributeHisSrvOk { + logger.Error("OpUpdateSingleDistributeHis fail, req: %v, ec: %v", util.ToJson(req), ec) + ReplyErrCodeMsg(ctx, ec) + return + } + + ReplyOk(ctx, nil) +} + +func OpDeleteSingleDistributeHis(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*single_distribute_his_proto.OpDeleteReq) + ec := service.DefaultService.OpDeleteSingleDistributeHis(ctx, req.Id) + if ec != errcode.ErrCodeSingleDistributeHisSrvOk { + logger.Error("OpDeleteSingleDistributeHis fail, req: %v, ec: %v", util.ToJson(req), ec) + ReplyErrCodeMsg(ctx, ec) + return + } + + ReplyOk(ctx, nil) +} + +func OpGetSingleDistributeHisList(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*single_distribute_his_proto.OpListReq) + + //设置默认页长 + if req.Limit == 0 { + req.Limit = consts.DefaultPageSize + } + + list, ec := service.DefaultService.OpGetSingleDistributeHisList(ctx, req) + if ec != errcode.ErrCodeSingleDistributeHisSrvOk { + logger.Error("OpGetSingleDistributeHisList fail, req: %v, ec: %v", util.ToJson(req), ec) + ReplyErrCodeMsg(ctx, ec) + return + } + + data := &single_distribute_his_proto.OpListData{ + List: list, + Offset: req.Offset + len(list), + } + if len(list) >= req.Limit { + data.More = 1 + } + ReplyOk(ctx, data) +} diff --git a/app/mix/dao/mongo.go b/app/mix/dao/mongo.go index 6ced387c..f9b62604 100644 --- a/app/mix/dao/mongo.go +++ b/app/mix/dao/mongo.go @@ -33,6 +33,7 @@ import ( moment_audit_taskproto "service/api/proto/moment_audit_task/proto" productproto "service/api/proto/product/proto" realname_authenticationproto "service/api/proto/realname_authentication/proto" + single_distribute_his_proto "service/api/proto/single_distribute_his/proto" streamerproto "service/api/proto/streamer/proto" streamerauthapprovalproto "service/api/proto/streamerauthapproval/proto" streamerlinkproto "service/api/proto/streamerlink/proto" @@ -217,6 +218,9 @@ const ( DBWorkerId = "worker_id" COLWorkerId = "worker_id" + + DBSingleDistributeHis = "single_distribute_his" + COLSingleDistributeHis = "single_distribute_his" ) // 商品表 @@ -548,6 +552,11 @@ func (m *Mongo) getColWorkerId() *qmgo.Collection { return m.clientMix.Database(DBWorkerId).Collection(COLWorkerId) } +// 慧用工下发打款历史表表 +func (m *Mongo) getColSingleDistributeHis() *qmgo.Collection { + return m.clientMix.Database(DBSingleDistributeHis).Collection(COLSingleDistributeHis) +} + // 商品相关 func (m *Mongo) CreateProduct(ctx *gin.Context, product *dbstruct.Product) error { col := m.getColProduct() @@ -5270,3 +5279,46 @@ func (m *Mongo) GetWorkerIdByMid(ctx *gin.Context, req *workeridproto.OpListByMi } return workerId, err } + +// 慧用工下发打款历史表相关 +func (m *Mongo) CreateSingleDistributeHis(ctx *gin.Context, single_distribute_his *dbstruct.SingleDistributeHis) error { + col := m.getColSingleDistributeHis() + _, err := col.InsertOne(ctx, single_distribute_his) + return err +} + +func (m *Mongo) UpdateSingleDistributeHis(ctx *gin.Context, single_distribute_his *dbstruct.SingleDistributeHis) error { + col := m.getColSingleDistributeHis() + set := util.EntityToM(single_distribute_his) + set["ut"] = time.Now().Unix() + up := qmgo.M{ + "$set": set, + } + err := col.UpdateId(ctx, single_distribute_his.GetId(), up) + return err +} + +func (m *Mongo) DeleteSingleDistributeHis(ctx *gin.Context, id int64) error { + col := m.getColSingleDistributeHis() + update := qmgo.M{ + "$set": qmgo.M{ + "del_flag": 1, + }, + } + err := col.UpdateId(ctx, id, update) + return err +} + +func (m *Mongo) GetSingleDistributeHisList(ctx *gin.Context, req *single_distribute_his_proto.OpListReq) ([]*dbstruct.SingleDistributeHis, error) { + list := make([]*dbstruct.SingleDistributeHis, 0) + col := m.getColSingleDistributeHis() + query := qmgo.M{ + "del_flag": 0, + } + err := col.Find(ctx, query).Sort("-ct").Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list) + if err == qmgo.ErrNoSuchDocuments { + err = nil + return list, err + } + return list, err +} diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index bb2bf8c4..4b0330e1 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -18,6 +18,7 @@ import ( momentproto "service/api/proto/moment/proto" moment_audit_taskproto "service/api/proto/moment_audit_task/proto" realname_authenticationproto "service/api/proto/realname_authentication/proto" + single_distribute_his_proto "service/api/proto/single_distribute_his/proto" streamerproto "service/api/proto/streamer/proto" streameracctproto "service/api/proto/streamer_acct/proto" streamerauthapprovalproto "service/api/proto/streamerauthapproval/proto" @@ -3374,13 +3375,35 @@ func (s *Service) ApiHvyogoSingleDistribute(ctx *gin.Context, req *hvyogoproto.A msg := &request.HYG10010001Req{ HYGBaseReq: &request.HYGBaseReq{}, WorkerName: detailResp.WorkerName, + ReceiptChannel: consts.BankCard, + WorkerAccount: detailResp.BankCardNo, WorkerType: detailResp.CertificateType, IdNumber: detailResp.IdentNo, WorkerMobile: detailResp.WorkerMobile, DistributeAmount: req.DistributeAmount, } - // 5.调用下发打款接口 + // 5.若上送了别的渠道,则设置参数 + if req.ReceiptChannel != 0 { + msg.ReceiptChannel = int(req.ReceiptChannel) + msg.WorkerAccount = req.WorkerAccount + } + + // 6.写入下发历史表,将历史表id作为requestNo + singleDistributeHis := &single_distribute_his_proto.OpCreateReq{ + SingleDistributeHis: &dbstruct.SingleDistributeHis{ + Mid: goproto.Int64(req.BaseRequest.Mid), + }, + } + err = _DefaultSingleDistributeHis.OpCreate(ctx, singleDistributeHis) + if err != nil { + logger.Error("_DefaultSingleDistributeHis OpCreate fail, err: %v", err) + ec = errcode.ErrCodeSingleDistributeHisSrvFail + return + } + msg.RequestNo = singleDistributeHis.GetId() + + // 7.调用下发打款接口 resp, err := DefaultHvyogoService.SingleDistribute(msg) if err != nil { logger.Error("DefaultHvyogoService SingleDistribute fail, err: %v", err) @@ -3388,7 +3411,7 @@ func (s *Service) ApiHvyogoSingleDistribute(ctx *gin.Context, req *hvyogoproto.A return } - // 6.组装返回结果 + // 8.组装返回结果 data = &hvyogoproto.ApiSingleDistributeData{} deepcopier.Copy(resp).To(data) diff --git a/app/mix/service/hvyogoservice.go b/app/mix/service/hvyogoservice.go index 49ac2d51..f87e1b90 100644 --- a/app/mix/service/hvyogoservice.go +++ b/app/mix/service/hvyogoservice.go @@ -1,6 +1,7 @@ package service import ( + "encoding/hex" "encoding/json" "fmt" "service/api/message/request" @@ -9,6 +10,7 @@ import ( "service/library/configcenter" "service/library/logger" "service/library/mycrypto" + "strings" "time" hvyogoproto "service/api/proto/hvyogo/proto" @@ -119,12 +121,14 @@ func (s *HvyogoService) SingleDistribute(req *request.HYG10010001Req) (vo *hvyog func afterReceiving(resp []byte, vo any) (err error) { baseResponse := &response.HygBaseResponse{} + // 先将返回码和返回信息解码至vo err = json.Unmarshal(resp, vo) if err != nil { logger.Error("json Unmarshal fail, err: %v", err) return } + // 解码response,若不成功则直接返回 err = json.Unmarshal(resp, baseResponse) if err != nil { logger.Error("json Unmarshal fail, err: %v", err) @@ -133,6 +137,8 @@ func afterReceiving(resp []byte, vo any) (err error) { if baseResponse.StatusCode != response.StatusCodeSuccess { return } + + // 获取aes加密串 aesEncryptedStr, ok := baseResponse.Data.(string) if !ok { err = fmt.Errorf("type assertion fail") @@ -140,8 +146,15 @@ func afterReceiving(resp []byte, vo any) (err error) { return } - // 解码aes - bytes, err := mycrypto.CryptoServiceInstance().HygAES.Decrypt([]byte(aesEncryptedStr)) + // 十六进制解码 + encryptedStr, err := hex.DecodeString(strings.ToLower(aesEncryptedStr)) + if err != nil { + logger.Error("Decryption fail, err: %v", err) + return + } + + // aes解码 + bytes, err := mycrypto.CryptoServiceInstance().HygAES.Decrypt([]byte(encryptedStr)) if err != nil { logger.Error("Decryption fail, err: %v", err) return diff --git a/app/mix/service/logic/single_distribute_his.go b/app/mix/service/logic/single_distribute_his.go new file mode 100644 index 00000000..29292472 --- /dev/null +++ b/app/mix/service/logic/single_distribute_his.go @@ -0,0 +1,65 @@ +package logic + +import ( + "service/api/consts" + single_distribute_his_proto "service/api/proto/single_distribute_his/proto" + "service/app/mix/dao" + "service/dbstruct" + "service/library/idgenerator" + "service/library/logger" + "time" + + "github.com/gin-gonic/gin" + goproto "google.golang.org/protobuf/proto" +) + +type SingleDistributeHis struct { + store *dao.Store +} + +func NewSingleDistributeHis(store *dao.Store) (a *SingleDistributeHis) { + a = &SingleDistributeHis{ + store: store, + } + return +} + +func (p *SingleDistributeHis) OpCreate(ctx *gin.Context, req *single_distribute_his_proto.OpCreateReq) error { + req.SingleDistributeHis.Id = goproto.String(idgenerator.GenSingleDistributeHisId()) + req.SingleDistributeHis.Ct = goproto.Int64(time.Now().Unix()) + req.SingleDistributeHis.Ut = goproto.Int64(time.Now().Unix()) + req.SingleDistributeHis.DelFlag = goproto.Int64(consts.Exist) + err := p.store.CreateSingleDistributeHis(ctx, req.SingleDistributeHis) + if err != nil { + logger.Error("CreateSingleDistributeHis fail, err: %v", err) + return err + } + return nil +} + +func (p *SingleDistributeHis) OpUpdate(ctx *gin.Context, req *single_distribute_his_proto.OpUpdateReq) error { + err := p.store.UpdateSingleDistributeHis(ctx, req.SingleDistributeHis) + if err != nil { + logger.Error("UpdateSingleDistributeHis fail, err: %v", err) + return err + } + return nil +} + +func (p *SingleDistributeHis) OpDelete(ctx *gin.Context, id int64) error { + err := p.store.DeleteSingleDistributeHis(ctx, id) + if err != nil { + logger.Error("DeleteSingleDistributeHis fail, err: %v", err) + return err + } + return nil +} + +func (p *SingleDistributeHis) OpList(ctx *gin.Context, req *single_distribute_his_proto.OpListReq) ([]*dbstruct.SingleDistributeHis, error) { + list, err := p.store.GetSingleDistributeHisList(ctx, req) + if err != nil { + logger.Error("GetSingleDistributeHisList fail, err: %v", err) + return make([]*dbstruct.SingleDistributeHis, 0), err + } + return list, nil +} diff --git a/app/mix/service/service.go b/app/mix/service/service.go index ace84723..e7491a4e 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -32,6 +32,7 @@ import ( productproto "service/api/proto/product/proto" realname_authenticationproto "service/api/proto/realname_authentication/proto" resourceproto "service/api/proto/resource/proto" + single_distribute_his_proto "service/api/proto/single_distribute_his/proto" streamerproto "service/api/proto/streamer/proto" streameracctproto "service/api/proto/streamer_acct/proto" streamerauthapprovalproto "service/api/proto/streamerauthapproval/proto" @@ -136,6 +137,7 @@ var ( _DefaultContentAuditRTI *logic.ContentAuditRTI _DefaultStreamerScore *logic.StreamerScore _DefaultWorkerId *logic.WorkerId + _DefaultSingleDistributeHis *logic.SingleDistributeHis ) type Service struct { @@ -228,6 +230,7 @@ func (s *Service) Init(c any) (err error) { _DefaultContentAuditRTI = logic.NewContentAuditRTI(store) _DefaultStreamerScore = logic.NewStreamerScore(store) _DefaultWorkerId = logic.NewWorkerId(store) + _DefaultSingleDistributeHis = logic.NewSingleDistributeHis(store) _DefaultVas = logic.NewVas(store, _DefaultStreamer, _DefaultAccount, _DefaultZone, _DefaultZoneThirdPartner, _DefaultZoneCollaborator) _DefaultStreamerAcct = logic.NewStreamerAcct(store) @@ -4116,7 +4119,7 @@ func (s *Service) OpGetWorkerIdByMid(ctx *gin.Context, req *workeridproto.OpList } func (s *Service) SaveAgreeCallback(ctx *gin.Context, req *hvyogoproto.ExtAgreeCallbackReq) (ec errcode.ErrCode) { - ec = errcode.ErrCodeWorkerIdSrvOk + ec = errcode.ErrCodeHvyogoSrvOk // 解密AES bytes, err := hex.DecodeString(strings.ToLower(req.BusinessBody)) @@ -4173,3 +4176,105 @@ func (s *Service) SaveAgreeCallback(ctx *gin.Context, req *hvyogoproto.ExtAgreeC return } + +func (s *Service) SaveSingleDistributeCallback(ctx *gin.Context, req *hvyogoproto.ExtSingleDistributeCallbackReq) (ec errcode.ErrCode) { + ec = errcode.ErrCodeHvyogoSrvOk + + // 解密AES + bytes, err := hex.DecodeString(strings.ToLower(req.BusinessBody)) + if err != nil { + logger.Error("hex DecodeString fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeDecryptionInterceptFail + return + } + decryptedBytes, err := mycrypto.CryptoServiceInstance().HygAES.Decrypt(bytes) + if err != nil { + logger.Error("Decryption fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeDecryptionInterceptFail + return + } + + // 解析BusinessBody + vo := &hvyogoproto.ExtSingleDistributeCallbackVO{} + if err := json.Unmarshal(decryptedBytes, vo); err != nil { + logger.Error("Unmarshal fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeAssertionFail + return + } + + // 更新数据 + err = _DefaultSingleDistributeHis.OpUpdate(ctx, &single_distribute_his_proto.OpUpdateReq{ + SingleDistributeHis: &dbstruct.SingleDistributeHis{ + Id: goproto.String(vo.RequestNo), + DistributeId: goproto.String(vo.DistributeId), + DistributeStatus: goproto.Int64(int64(vo.DistributeStatus)), + ServiceCharge: goproto.String(vo.ServiceCharge), + DistributeAmount: goproto.String(vo.DistributeAmount), + Timestamp: goproto.String(vo.Timestamp), + Remark: goproto.String(vo.Remark), + ReasonCode: goproto.String(vo.ReasonCode), + }, + }) + if err == qmgo.ErrNoSuchDocuments { + logger.Error("_DefaultSingleDistributeHis OpUpdate fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeSingleDistributeHisNotExist + return + } + if err != nil { + logger.Error("_DefaultSingleDistributeHis OpUpdate fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeSingleDistributeHisSrvFail + return + } + + return +} + +// SingleDistributeHis +func (s *Service) OpCreateSingleDistributeHis(ctx *gin.Context, req *single_distribute_his_proto.OpCreateReq) (ec errcode.ErrCode) { + ec = errcode.ErrCodeSingleDistributeHisSrvOk + err := _DefaultSingleDistributeHis.OpCreate(ctx, req) + if err != nil { + logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeSingleDistributeHisSrvFail + return + } + return +} + +func (s *Service) OpUpdateSingleDistributeHis(ctx *gin.Context, req *single_distribute_his_proto.OpUpdateReq) (ec errcode.ErrCode) { + ec = errcode.ErrCodeSingleDistributeHisSrvOk + err := _DefaultSingleDistributeHis.OpUpdate(ctx, req) + if err == qmgo.ErrNoSuchDocuments { + ec = errcode.ErrCodeSingleDistributeHisNotExist + err = nil + return + } + if err != nil { + logger.Error("OpUpdate fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeSingleDistributeHisSrvFail + return + } + return +} + +func (s *Service) OpDeleteSingleDistributeHis(ctx *gin.Context, id int64) (ec errcode.ErrCode) { + ec = errcode.ErrCodeSingleDistributeHisSrvOk + err := _DefaultSingleDistributeHis.OpDelete(ctx, id) + if err != nil { + logger.Error("OpDelete fail, id: %v, err: %v", id, err) + ec = errcode.ErrCodeSingleDistributeHisSrvFail + return + } + return +} + +func (s *Service) OpGetSingleDistributeHisList(ctx *gin.Context, req *single_distribute_his_proto.OpListReq) (list []*dbstruct.SingleDistributeHis, ec errcode.ErrCode) { + ec = errcode.ErrCodeSingleDistributeHisSrvOk + list, err := _DefaultSingleDistributeHis.OpList(ctx, req) + if err != nil { + logger.Error("OpGetSingleDistributeHisList fail, req: %v, err: %v", util.ToJson(req), err) + ec = errcode.ErrCodeSingleDistributeHisSrvFail + return + } + return +} diff --git a/codecreate/codecreate.go b/codecreate/codecreate.go index f6020657..645bf5ac 100644 --- a/codecreate/codecreate.go +++ b/codecreate/codecreate.go @@ -9,10 +9,10 @@ import ( func main() { genSource := &generator.GenSource{ - EntityName: "WorkerId", - ModuleName: "worker_id", - EntityCNName: "用户职业者id映射表", - ErrCodeSeq: "41", + EntityName: "SingleDistributeHis", + ModuleName: "single_distribute_his", + EntityCNName: "慧用工下发打款历史表", + ErrCodeSeq: "42", } generator.CreateFileDirectory(genSource) diff --git a/codecreate/resource/EntityDefine.xlsx b/codecreate/resource/EntityDefine.xlsx index e87515d0426c21777c673d85ed8ff7d6e88bd830..d65c315b957abc52bc332ce4834123c5a9c3ab4c 100644 GIT binary patch delta 9830 zcmZ9SbyytDvhbJ1-Q6`TnJ>JSv?$_ZHyfpY*;+)Y%8>k9Cmmxp8RK@!s$2X`YB<)$Z91hzgP7LMOv4A zSCA-!Qk&M#yOyh7{&dEzh?H{6c;$}X7}%e6o}S7*HF;Gm7N_IW3v2dsSyC&@E{@HJ z;k}2+gOl3)$30FoEiMdK! zLY82KP2UjlyYE3{Bz8t*6vn5$sxz-#9mCJ7mEm8&{qSq{R-(p9^RNtNM1)h8w1Ag&#$tgq7&NNDD0ANLs?c~{gl`mh@f-Oi)}dghzV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t!A89KC*R&9l?=>~pKP{jITz$Fpkj731Q4ahqG z3fPAaBc%Z8o{1YESe^cOlSviALtyrZf*q@#g^|T7(yHo4L9S ztIM{26~j6EelS&?T)<*vnj0rd@H1GRVH4AIlYw4OjPUh;-j=e-+NCe?Ti;+Nw{VPl zmPK|A#GbyZnUa|0d&D~CKsdYfSW#n?!Z@?N`t{YXtJt$_h~GbAgz#pcjGF9~*yW6U z*N%}ME1@|Js|d;(r4Qy`gP-H3BEaZ_#oK~^(4vx^5cEvU~J!6Mu5S&JRe;DQaX?hN#k#1Z|z_{FL}5&MgyQC$bO4iALUA zlFzTQrT4EE(XVnk=Nj+9+!cKJV~K8NN7QB7r|^UPx+UF0TdxPOl##$o^|}+0BWcf zJ>)APA?d_ZVyu-LH+9OXN=2DgWF{*{^h=R#u%Fiq#Nb^~l!$C{$Q9B%(iU@k!FjZ( zVtBQ*&O6}z22t%!CQAV|&*@}=RB4v*nwg)|l+$xfs#Y={maS_ZTOI5-55Xi3b<3l& zhYVv?On4$<=e@QyNza(CWi71O1mY}Izle7q(SCAoSog|w{5Rgc5<>jODPnkN(gY?{ZIl@Jnc}S}WE2D> zeE-JLSK83O5+8~+27)n%ii}AD#XxTj*<&Ce3db9FU-|g)jjZD!peFwtUH?OoH@3eL zD)~m>1PDka_ePmlYAC&umQN@R+O`oE_X zFnmqIgI>M{no9p~V9o3;!)+E1+G_QG0}j@20p2MP(7^tU0k6bzhSp9=0KMGaTF|FK zKr*j4etzYq@7qn3d=a4dW0<7>E3E(kME@Jgs|o|&I&MwlLxpCDfrcSa-5DVuZWJ_g zhJy5etMmW>?*EteHx{}yBMdChea*&)f@X1{-jl>Yufn$hRJ=Y~_!TNZKP36U aW@7E2EC-M9pYH6hyXotTirW95v;PMfqwm20 diff --git a/dbstruct/single_distribute_his.go b/dbstruct/single_distribute_his.go new file mode 100644 index 00000000..eb79a4a6 --- /dev/null +++ b/dbstruct/single_distribute_his.go @@ -0,0 +1,23 @@ +package dbstruct + +type SingleDistributeHis struct { + Id *string `json:"id" bson:"_id"` // 慧用工下发打款历史表id + Mid *int64 `json:"mid" bson:"mid"` // 用户id + DistributeId *string `json:"distribute_id" bson:"distribute_id"` // 慧用工平台处理单号 + DistributeStatus *int64 `json:"distribute_status" bson:"distribute_status"` // 下发状态 + ServiceCharge *string `json:"service_charge" bson:"service_charge"` // 该笔下发的服务费(单位:分) + DistributeAmount *string `json:"distribute_amount" bson:"distribute_amount"` // 下发金额(单位:分) + Timestamp *string `json:"timestamp" bson:"timestamp"` // 下单时间 + Remark *string `json:"remark" bson:"remark"` // 银行返回打款备注 + ReasonCode *string `json:"reason_code" bson:"reason_code"` // 余额不足时会返回E00001 + Ct *int64 `json:"ct" bson:"ct"` // 创建时间 + Ut *int64 `json:"ut" bson:"ut"` // 更新时间 + DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记 +} + +func (p *SingleDistributeHis) GetId() string { + if p != nil && p.Id != nil { + return *p.Id + } + return "" +} diff --git a/library/idgenerator/genid.go b/library/idgenerator/genid.go index 806f8171..27100b50 100644 --- a/library/idgenerator/genid.go +++ b/library/idgenerator/genid.go @@ -54,6 +54,7 @@ const ( NodeZoneThirdPartner // node 空间代运营表 NodeDailyStatementZoneInfo // node 空间相关每日报表 NodeWorkerId // node 用户职业者id映射表 + NodeSingleDistributeHis // node 慧用工下发打款历史表 ) func GenIdInt64(node int64) (int64, error) { @@ -259,3 +260,9 @@ func GenWorkerIdId() int64 { id, _ := GenIdInt64(NodeWorkerId) return id } + +// single_distribute_his +func GenSingleDistributeHisId() string { + id, _ := GenIdString(NodeSingleDistributeHis) + return id +}