Compare commits

..

34 Commits

Author SHA1 Message Date
jiaji.H
f7271ee292 Updata:更新字段 2026-02-04 13:17:29 +08:00
jiaji.H
deaac40fad Updata:更新发票时间检索 2026-02-04 10:46:38 +08:00
jiaji.H
f219ed3b05 Updata:更新字段 2026-02-04 10:23:11 +08:00
jiaji.H
013c14b9f7 Updata:增加获取最新发票编辑号接口 2026-02-04 10:18:50 +08:00
jiaji.H
18e341edce Updata:更新时间排序 2026-02-04 09:48:07 +08:00
jiaji.H
d9b425bba1 Updata:增加不太类型时间格式兼容 2026-02-03 16:04:23 +08:00
jiaji.H
275ee0376f Updata:更新sql 2026-02-03 15:44:10 +08:00
jiaji.H
be45f91971 Updata:修改时间解析 2026-02-03 15:00:32 +08:00
jiaji.H
c149bc1af5 Updata:更新时间解析 2026-02-03 14:30:26 +08:00
jiaji.H
b8dcfafe7e Updata:列表倒叙排序 2026-02-03 13:59:49 +08:00
jiaji.H
c25d7dbdb0 Updata:更新字段类型 2026-02-03 13:26:23 +08:00
jiaji.H
24423900d3 Updata:更新检索sql 2026-02-03 13:17:48 +08:00
jiaji.H
40bd33d19c Updata:修正sql 2026-02-03 13:11:14 +08:00
jiaji.H
420a169c65 Updata:完善检索逻辑 2026-02-03 09:26:26 +08:00
jiaji.H
dfd82b87b8 Updata:更新log 2026-02-02 20:43:49 +08:00
jiaji.H
c348409a73 Updata:更新数据创建 2026-02-02 20:00:28 +08:00
jiaji.H
1f8fb4abf8 Updata:增加打印 2026-02-02 19:45:51 +08:00
jiaji.H
ae95c7dd4a Updata:增加字段 2026-02-02 19:40:10 +08:00
jiaji.H
7276a7d24e Updata:修改发票相关信息查询 2026-02-02 18:01:43 +08:00
jiaji.H
8a32b28680 Updata:更新pb文件 2026-02-02 15:27:58 +08:00
jiaji.H
574fa6e3e6 Updata:增加区号 2026-02-02 15:24:32 +08:00
jiaji.H
01e488555f Updata:增加区号字段 2026-02-02 15:22:21 +08:00
jiaji.H
2cf1b946d0 Updata:更新字段 2026-02-02 14:09:27 +08:00
jiaji.H
8db49c0db9 Updata:增加字段 2026-02-02 13:39:09 +08:00
jiaji.H
28add54ce9 Updata:增加状态更新 2026-02-02 11:25:38 +08:00
jiaji.H
1389a4ad94 Updata:修改数据结构 2026-02-02 11:14:50 +08:00
jiaji.H
0a273e7e32 Updata:增加H5获取用户发票列表 2026-02-02 10:56:54 +08:00
jiaji.H
6ac8b2b1b4 Updata:解决冲突 2026-01-30 15:18:47 +08:00
jiaji.H
d01f325ed4 Updata:增加接口数据字段 2026-01-30 11:16:21 +08:00
jiaji.H
d282c1d1f2 Updata:增加发票编号字段 2026-01-29 11:10:54 +08:00
jiaji.H
fb0e65eadc Updata:新增字段 2026-01-29 10:46:25 +08:00
jiaji.H
cae420eb0c Updata:更新字段类型 2026-01-28 16:48:36 +08:00
jiaji.H
b89f41fd6f Updata:更新字段 2026-01-28 16:37:10 +08:00
jiaji.H
e73aabf106 Updata:增加发票管理模块 2026-01-28 13:45:59 +08:00
24 changed files with 2977 additions and 5332 deletions

View File

View File

@ -130,10 +130,3 @@ func (b *BundleProvider) SoftDeleteUnfinishedInfo(_ context.Context, req *bundle
func (b *BundleProvider) ReSignTheContract(_ context.Context, req *bundle.ReSignTheContractRequest) (res *bundle.CommonResponse, err error) {
return logic.ReSignTheContract(req)
}
func (b *BundleProvider) OrderListByOrderUuid(_ context.Context, req *bundle.OrderInfoByOrderUuidRequest) (res *bundle.OrderInfoByOrderNoResp, err error) {
return logic.OrderListByOrderUuid(req)
}
func (b *BundleProvider) UpdateOrderRecordByOrderUuid(_ context.Context, req *bundle.OrderRecord) (res *bundle.CommonResponse, err error) {
return logic.UpdateOrderRecordByOrderUuid(req)
}

View File

@ -1,34 +0,0 @@
package controller
import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
)
// 合同管理相关接口
// UpdateContract 合同更新接口根据action判断新增/更新/删除)
func (b *BundleProvider) UpdateContract(_ context.Context, req *bundle.ContractUpdateRequest) (res *bundle.ComResponse, err error) {
return logic.UpdateContract(req)
}
// GetContractList 查询合同列表
func (b *BundleProvider) GetContractList(_ context.Context, req *bundle.ContractListRequest) (res *bundle.ContractListResponse, err error) {
return logic.GetContractList(req)
}
// GetContractDetail 根据合同UUID查询详情
func (b *BundleProvider) GetContractDetail(_ context.Context, req *bundle.ContractDetailRequest) (res *bundle.ContractDetailResponse, err error) {
return logic.GetContractDetail(req)
}
// GetDevelopmentCyclesByContractUUID 根据合同UUID查询开发周期
func (b *BundleProvider) GetDevelopmentCyclesByContractUUID(_ context.Context, req *bundle.GetDevelopmentCyclesByContractUUIDRequest) (res *bundle.GetDevelopmentCyclesByContractUUIDResponse, err error) {
return logic.GetDevelopmentCyclesByContractUUID(req)
}
// GetPaymentCyclesByContractUUID 根据合同UUID查询支付周期
func (b *BundleProvider) GetPaymentCyclesByContractUUID(_ context.Context, req *bundle.GetPaymentCyclesByContractUUIDRequest) (res *bundle.GetPaymentCyclesByContractUUIDResponse, err error) {
return logic.GetPaymentCyclesByContractUUID(req)
}

View File

@ -1,34 +0,0 @@
package controller
import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
)
// 客户管理相关接口
// GetCustomerList 多条件查询客户列表
func (b *BundleProvider) GetCustomerList(_ context.Context, req *bundle.CustomerListRequest) (res *bundle.CustomerListResponse, err error) {
return logic.GetCustomerList(req)
}
// GetCustomerDetail 根据客户ID查询客户详情
func (b *BundleProvider) GetCustomerDetail(_ context.Context, req *bundle.CustomerDetailRequest) (res *bundle.CustomerDetailResponse, err error) {
return logic.GetCustomerDetail(req)
}
// UpdateCustomer 更新客户接口根据action判断新增/更新/删除)
func (b *BundleProvider) UpdateCustomer(_ context.Context, req *bundle.CustomerUpdateRequest) (res *bundle.ComResponse, err error) {
// 调用logic层logic层返回CommonResponse需要转换为ComResponse
commonRes, err := logic.UpdateCustomer(req)
if err != nil {
return &bundle.ComResponse{Msg: err.Error()}, err
}
return &bundle.ComResponse{Msg: commonRes.Msg}, nil
}
// GetReferralPersonList 查询所有不重复的推荐人列表
func (b *BundleProvider) GetReferralPersonList(_ context.Context, req *bundle.ReferralPersonListRequest) (res *bundle.ReferralPersonListResponse, err error) {
return logic.GetReferralPersonList(req)
}

View File

@ -0,0 +1,79 @@
package controller
import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
)
// 创建电子发票
func (b *BundleProvider) CreateInvoice(_ context.Context, req *bundle.CreateInvoiceReq) (*bundle.CreateInvoiceResp, error) {
res, err := logic.CreateInvoice(req)
if err != nil {
return nil, err
}
return res, nil
}
// 创建纸质发票地址
func (b *BundleProvider) CreatePaperInvoiceAddress(_ context.Context, req *bundle.CreatePaperInvoiceAddressReq) (*bundle.CreatePaperInvoiceAddressResp, error) {
res, err := logic.CreatePaperInvoiceAddress(req)
if err != nil {
return nil, err
}
return res, nil
}
// 获取发票列表
func (b *BundleProvider) GetInvoiceList(_ context.Context, req *bundle.GetInvoiceListReq) (*bundle.GetInvoiceListResp, error) {
res, err := logic.GetInvoiceList(req)
if err != nil {
return nil, err
}
return res, nil
}
// 更新发票快递信息
func (b *BundleProvider) UpdateInvoiceExpressInfo(_ context.Context, req *bundle.UpdateInvoiceExpressInfoReq) (*bundle.UpdateInvoiceExpressInfoResp, error) {
res, err := logic.UpdateInvoiceExpressInfo(req)
if err != nil {
return nil, err
}
return res, nil
}
// 查看快递信息
func (b *BundleProvider) GetInvoiceExpressInfo(_ context.Context, req *bundle.GetInvoiceExpressInfoReq) (*bundle.GetInvoiceExpressInfoResp, error) {
res, err := logic.GetInvoiceExpressInfo(req)
if err != nil {
return nil, err
}
return res, nil
}
// 获取订单信息
func (b *BundleProvider) GetOrderInfoByOrderNo(_ context.Context, req *bundle.GetOrderInfoByOrderNoReq) (*bundle.GetOrderInfoByOrderNoResp, error) {
res, err := logic.GetOrderInfoByOrderNo(req)
if err != nil {
return nil, err
}
return res, nil
}
// 获取对应用户发票列表
func (b *BundleProvider) GetInvoiceInfoByOrderNo(_ context.Context, req *bundle.GetInvoiceInfoByOrderNoReq) (*bundle.GetInvoiceInfoByOrderNoResp, error) {
res, err := logic.GetInvoiceInfoByOrderNo(req)
if err != nil {
return nil, err
}
return res, nil
}
// 获取最后一张发票编号
func (b *BundleProvider) GetLastInvoiceNo(_ context.Context, req *bundle.GetLastInvoiceNoReq) (*bundle.GetLastInvoiceNoResp, error) {
res, err := logic.GetLastInvoiceNo(req)
if err != nil {
return nil, err
}
return res, nil
}

View File

@ -83,7 +83,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
WHEN bb.expired_at > NOW() THEN 2
ELSE 1
END AS balance_status`).
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id and rn.deleted_at = 0").
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id").
Joins("LEFT JOIN (?) as bor ON bor.customer_id = u.id", subQuery).
Joins("LEFT JOIN bundle_balance bb ON u.id = bb.user_id AND bb.order_uuid = bor.uuid and bb.deleted_at is null").
Joins("LEFT JOIN bundle_activate bc on bc.user_id = u.id").

View File

@ -67,12 +67,12 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
// ---------- 新增金额统计 ----------
var NewFeePaymentAmount struct {
NewFeePaymentAmount string `gorm:"column:new_fee_payment_amount"`
NewPaymentAmount string `gorm:"column:new_payment_amount"`
NewFeePaymentAmount float32 `gorm:"column:new_fee_payment_amount"`
NewPaymentAmount float32 `gorm:"column:new_payment_amount"`
}
subQuery = app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
Select("TRUNCATE(COALESCE(SUM(CAST(handling_fee AS DECIMAL(12,3))), 0), 3) AS new_fee_payment_amount,TRUNCATE(COALESCE(SUM(CAST(pay_amount AS DECIMAL(12,3))), 0), 3) AS new_payment_amount").
Select("SUM(handling_fee) as new_fee_payment_amount, SUM(pay_amount) as new_payment_amount").
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no COLLATE utf8mb4_general_ci = reconciliation.bundle_order_on COLLATE utf8mb4_general_ci").
Where("`reconciliation`.pay_time >= ?", req.Start+" 00:00:00").
Where("`reconciliation`.pay_time <= ?", req.End+" 23:59:59").
@ -103,16 +103,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
if err != nil {
return
}
// 使用 decimal 计算新增结算金额,避免精度丢失
newPayDecimal, err := decimal.NewFromString(result.NewPaymentAmount)
if err != nil {
return nil, fmt.Errorf("解析实收金额失败: %v", err)
}
newFeeDecimal, err := decimal.NewFromString(result.NewFeePaymentAmount)
if err != nil {
return nil, fmt.Errorf("解析手续费失败: %v", err)
}
result.NewFinalPaymentAmount = newPayDecimal.Sub(newFeeDecimal).Truncate(3).StringFixed(2)
result.NewFinalPaymentAmount = result.NewPaymentAmount - result.NewFeePaymentAmount
// ---------- 新套餐数统计 ----------
var newBundleCount int64
@ -199,11 +190,10 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
Joins("INNER JOIN cast_work_log cwl on cwl.work_uuid = cast_work.uuid and cwl.work_status = 9").
Where("cwe.cost_type = 1").
Where("cast_work.work_category = 2").
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
Where("cwl.update_time <= ?", req.End+" 23:59:59").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0 and cwl.deleted_at = 0")
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0")
if req.BundleUuid != "" {
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
}
@ -219,11 +209,10 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
Joins("INNER JOIN cast_work_log cwl on cwl.work_uuid = cast_work.uuid and cwl.work_status = 9").
Where("cwe.cost_type != 1").
Where("cast_work.work_category = 2").
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
Where("cwl.update_time <= ?", req.End+" 23:59:59").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0 and cwl.deleted_at = 0")
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0")
if req.BundleUuid != "" {
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
}
@ -251,7 +240,6 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("LEFT JOIN cast_work_log AS cwl ON cwl.work_uuid = cw.uuid and cwl.work_status = 9").
Where("cwl.work_status = 9").
Where("cwe.cost_type in ?", []int{1, 2}).
Where("cw.work_category = ?", 2).
Where("cw.status in ?", []int{7, 6, 9}).
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
Where("cwl.update_time <= ?", req.End+" 23:59:59").
@ -355,7 +343,6 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 2"). // 视频类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
if req.BundleUuid != "" {
@ -373,7 +360,6 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 2"). // 视频类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
if req.BundleUuid != "" {
@ -494,7 +480,6 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 1"). // 图文类型
Where("cwe.cost_type = 1 "). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
if req.BundleUuid != "" {
@ -512,7 +497,6 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 1"). // 图文类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
if req.BundleUuid != "" {
@ -779,7 +763,6 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 2"). // 视频类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
Count(&totalUploadedBundleVideoCount)
@ -790,7 +773,6 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 2"). // 视频类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型或扩展类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
Count(&totalUploadedIncreaseVideoCount)
@ -840,7 +822,6 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 1"). // 图文类型
Where("cast_work.origin_uuid = ''").
Where("cast_work.status != 8").
// Where("cwe.cost_type = 2"). // 套餐类型
Where("deleted_at = 0").
Count(&totalUploadedImageCount)
@ -852,7 +833,6 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 1"). // 图文类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
Count(&totalUploadedBundleImageCount)
@ -1776,8 +1756,7 @@ func ExportWorkCastInfo(req *bundle.ExportWorkCastInfoReq) (*bundle.ExportWorkCa
cw.work_category,
cw.submit_time,
cwl_wating.update_time AS waiting_time,
cwl_confirm.update_time AS confirm_time,
cwe.confirm_type AS confirm_type
cwl_confirm.update_time AS confirm_time
FROM bundle_balance bb
LEFT JOIN bundle_order_records bor
ON bor.uuid = bb.order_uuid AND bor.deleted_at IS NULL

View File

@ -1,288 +0,0 @@
package dao
import (
"errors"
"micro-bundle/internal/model"
"micro-bundle/pkg/app"
commonErr "micro-bundle/pkg/err"
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
// ContractQueryRequest 合同查询请求参数
type ContractQueryRequest struct {
ContractName string `json:"contractName"` // 合同名称(模糊查询)
ProjectName string `json:"projectName"` // 项目名称(模糊查询)
CustomerName string `json:"customerName"` // 客户名称(模糊查询)
Page int `json:"page"` // 页码
PageSize int `json:"pageSize"` // 每页数量
}
// CreateContract 创建合同(包括支付周期和开发周期子表)
func CreateContract(contract *model.Contract) error {
// 如果未提供 ContractUUID则生成 UUID
if contract.ContractUUID == "" {
contract.ContractUUID = uuid.New().String()
}
// 设置创建时间和更新时间
now := time.Now()
contract.CreatedAt = now
contract.UpdatedAt = now
contract.OperatorTime = now
// 使用事务创建合同及其子表
err := app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error {
// 创建主表Omit 跳过关联,避免 GORM 自动创建子表导致与后面显式 Create 重复插入)
if err := tx.Model(&model.Contract{}).Omit("PaymentCycles", "DevelopmentCycles").Create(contract).Error; err != nil {
return commonErr.ReturnError(err, "创建合同失败", "创建合同失败: ")
}
// 创建支付周期子表
if len(contract.PaymentCycles) > 0 {
if len(contract.PaymentCycles) > 10 {
return commonErr.ReturnError(errors.New("支付周期不能超过10期"), "创建支付周期失败", "创建支付周期失败:")
}
for i := range contract.PaymentCycles {
if contract.PaymentCycles[i].ContractPaymentCycleUUID == "" {
contract.PaymentCycles[i].ContractPaymentCycleUUID = uuid.New().String()
}
contract.PaymentCycles[i].ContractUUID = contract.ContractUUID
contract.PaymentCycles[i].PaymentCyclePeriod = contract.PaymentCycles[i].PaymentCyclePeriod
contract.PaymentCycles[i].CreatedAt = now
contract.PaymentCycles[i].UpdatedAt = now
}
if err := tx.Model(&model.ContractPaymentCycle{}).Create(&contract.PaymentCycles).Error; err != nil {
return commonErr.ReturnError(err, "创建支付周期失败", "创建支付周期失败: ")
}
}
// 创建开发周期子表
if len(contract.DevelopmentCycles) > 0 {
if len(contract.DevelopmentCycles) > 10 {
return commonErr.ReturnError(errors.New("开发周期不能超过10期"), "创建开发周期失败", "创建开发周期失败:")
}
for i := range contract.DevelopmentCycles {
if contract.DevelopmentCycles[i].DevelopmentCycleUUID == "" {
contract.DevelopmentCycles[i].DevelopmentCycleUUID = uuid.New().String()
}
contract.DevelopmentCycles[i].ContractUUID = contract.ContractUUID
contract.DevelopmentCycles[i].DevelopmentPeriod = contract.DevelopmentCycles[i].DevelopmentPeriod
contract.DevelopmentCycles[i].CreatedAt = now
contract.DevelopmentCycles[i].UpdatedAt = now
}
if err := tx.Model(&model.DevelopmentCycle{}).Create(&contract.DevelopmentCycles).Error; err != nil {
return commonErr.ReturnError(err, "创建开发周期失败", "创建开发周期失败: ")
}
}
return nil
})
return err
}
// UpdateContract 更新合同信息(包括支付周期和开发周期子表)
func UpdateContract(contractUUID string, contract *model.Contract) error {
// 设置更新时间
now := time.Now()
contract.UpdatedAt = now
contract.OperatorTime = now
// 使用事务更新合同及其子表
err := app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error {
// 更新主表Omit 跳过关联,子表由下面先删后建单独处理)
if err := tx.Model(&model.Contract{}).
Where("contract_uuid = ?", contractUUID).
Omit("PaymentCycles", "DevelopmentCycles").
Updates(contract).Error; err != nil {
return commonErr.ReturnError(err, "更新合同失败", "更新合同失败: ")
}
// 删除旧的支付周期子表数据(软删除)
if err := tx.Where("contract_uuid = ?", contractUUID).
Delete(&model.ContractPaymentCycle{}).Error; err != nil {
return commonErr.ReturnError(err, "删除支付周期失败", "删除支付周期失败: ")
}
// 创建新的支付周期子表数据
if len(contract.PaymentCycles) > 0 {
now := time.Now()
for i := range contract.PaymentCycles {
if contract.PaymentCycles[i].ContractPaymentCycleUUID == "" {
contract.PaymentCycles[i].ContractPaymentCycleUUID = uuid.New().String()
}
contract.PaymentCycles[i].ContractUUID = contractUUID
contract.PaymentCycles[i].PaymentCyclePeriod = contract.PaymentCycles[i].PaymentCyclePeriod
contract.PaymentCycles[i].CreatedAt = now
contract.PaymentCycles[i].UpdatedAt = now
}
if err := tx.Model(&model.ContractPaymentCycle{}).Create(&contract.PaymentCycles).Error; err != nil {
return commonErr.ReturnError(err, "创建支付周期失败", "创建支付周期失败: ")
}
}
// 删除旧的开发周期子表数据(软删除)
if err := tx.Where("contract_uuid = ?", contractUUID).
Delete(&model.DevelopmentCycle{}).Error; err != nil {
return commonErr.ReturnError(err, "删除开发周期失败", "删除开发周期失败: ")
}
// 创建新的开发周期子表数据
if len(contract.DevelopmentCycles) > 0 {
now := time.Now()
for i := range contract.DevelopmentCycles {
if contract.DevelopmentCycles[i].DevelopmentCycleUUID == "" {
contract.DevelopmentCycles[i].DevelopmentCycleUUID = uuid.New().String()
}
contract.DevelopmentCycles[i].ContractUUID = contractUUID
contract.DevelopmentCycles[i].DevelopmentPeriod = contract.DevelopmentCycles[i].DevelopmentPeriod
contract.DevelopmentCycles[i].CreatedAt = now
contract.DevelopmentCycles[i].UpdatedAt = now
}
if err := tx.Model(&model.DevelopmentCycle{}).Create(&contract.DevelopmentCycles).Error; err != nil {
return commonErr.ReturnError(err, "创建开发周期失败", "创建开发周期失败: ")
}
}
return nil
})
return err
}
// DeleteContract 删除合同(软删除,包括子表)
func DeleteContract(contractUUID string) error {
// 使用事务删除合同及其子表
err := app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error {
// 删除主表
if err := tx.Where("contract_uuid = ?", contractUUID).
Delete(&model.Contract{}).Error; err != nil {
return commonErr.ReturnError(err, "删除合同失败", "删除合同失败: ")
}
// 删除支付周期子表
if err := tx.Where("contract_uuid = ?", contractUUID).
Delete(&model.ContractPaymentCycle{}).Error; err != nil {
return commonErr.ReturnError(err, "删除支付周期失败", "删除支付周期失败: ")
}
// 删除开发周期子表
if err := tx.Where("contract_uuid = ?", contractUUID).
Delete(&model.DevelopmentCycle{}).Error; err != nil {
return commonErr.ReturnError(err, "删除开发周期失败", "删除开发周期失败: ")
}
return nil
})
return err
}
// GetContractList 多条件分页查询合同列表
func GetContractList(req *ContractQueryRequest) ([]*model.Contract, int64, error) {
var contracts []*model.Contract
var total int64
// 构建查询条件
query := app.ModuleClients.BundleDB.Model(&model.Contract{}).
Where("deleted_at = 0")
// 合同名称模糊查询
if req.ContractName != "" {
query = query.Where("contract_name LIKE ?", "%"+req.ContractName+"%")
}
// 项目名称模糊查询
if req.ProjectName != "" {
query = query.Where("project_name LIKE ?", "%"+req.ProjectName+"%")
}
// 客户名称模糊查询
if req.CustomerName != "" {
query = query.Where("customer_name LIKE ?", "%"+req.CustomerName+"%")
}
// 计算总数
err := query.Count(&total).Error
if err != nil {
return nil, 0, commonErr.ReturnError(err, "查询合同总数失败", "查询合同总数失败: ")
}
// 分页查询
if req.PageSize > 0 && req.Page > 0 {
offset := (req.Page - 1) * req.PageSize
query = query.Limit(req.PageSize).Offset(offset)
}
// 按创建时间倒序排列
err = query.Order("created_at DESC").Find(&contracts).Error
if err != nil {
if err == gorm.ErrRecordNotFound {
return []*model.Contract{}, 0, nil
}
return nil, 0, commonErr.ReturnError(err, "查询合同列表失败", "查询合同列表失败: ")
}
return contracts, total, nil
}
// GetContractByUUID 根据合同UUID查询合同信息包括子表
func GetContractByUUID(contractUUID string) (*model.Contract, error) {
var contract model.Contract
err := app.ModuleClients.BundleDB.
Where("contract_uuid = ?", contractUUID).
Where("deleted_at = 0").
Preload("PaymentCycles", func(db *gorm.DB) *gorm.DB {
return db.Where("deleted_at = 0").Order("payment_cycle_period ASC")
}).
Preload("DevelopmentCycles", func(db *gorm.DB) *gorm.DB {
return db.Where("deleted_at = 0").Order("development_period ASC")
}).
First(&contract).Error
if err != nil {
if err == gorm.ErrRecordNotFound {
return nil, nil
}
return nil, commonErr.ReturnError(err, "查询失败", "查询失败: ")
}
return &contract, nil
}
// GetPaymentCyclesByContractUUID 根据合同UUID查询支付周期列表
func GetPaymentCyclesByContractUUID(contractUUID string) ([]*model.ContractPaymentCycle, error) {
var paymentCycles []*model.ContractPaymentCycle
err := app.ModuleClients.BundleDB.Model(&model.ContractPaymentCycle{}).
Where("contract_uuid = ?", contractUUID).
Where("deleted_at = 0").
Order("payment_cycle_period ASC").
Find(&paymentCycles).Error
if err != nil {
if err == gorm.ErrRecordNotFound {
return []*model.ContractPaymentCycle{}, nil
}
return nil, commonErr.ReturnError(err, "查询支付周期失败", "查询支付周期失败: ")
}
return paymentCycles, nil
}
// GetDevelopmentCyclesByContractUUID 根据合同UUID查询开发周期列表
func GetDevelopmentCyclesByContractUUID(contractUUID string) ([]*model.DevelopmentCycle, error) {
var developmentCycles []*model.DevelopmentCycle
err := app.ModuleClients.BundleDB.Model(&model.DevelopmentCycle{}).
Where("contract_uuid = ?", contractUUID).
Where("deleted_at = 0").
Order("development_period ASC").
Find(&developmentCycles).Error
if err != nil {
if err == gorm.ErrRecordNotFound {
return []*model.DevelopmentCycle{}, nil
}
return nil, commonErr.ReturnError(err, "查询开发周期失败", "查询开发周期失败: ")
}
return developmentCycles, nil
}

View File

@ -1,167 +0,0 @@
package dao
import (
"micro-bundle/internal/model"
"micro-bundle/pkg/app"
commonErr "micro-bundle/pkg/err"
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
// CustomerQueryRequest 客户查询请求参数
type CustomerQueryRequest struct {
CustomerName string `json:"customerName"` // 客户名称(模糊查询)
ReferralPerson string `json:"referralPerson"` // 推荐人(模糊查询)
Page int `json:"page"` // 页码
PageSize int `json:"pageSize"` // 每页数量
}
// CreateCustomer 创建客户
func CreateCustomer(customer *model.Customer) error {
// 如果未提供 CustomerID则生成 UUID
if customer.CustomerID == "" {
customer.CustomerID = uuid.New().String()
}
// 设置创建时间和更新时间
now := time.Now()
customer.CreatedAt = now
customer.UpdatedAt = now
err := app.ModuleClients.BundleDB.Model(&model.Customer{}).Create(customer).Error
if err != nil {
return commonErr.ReturnError(err, "创建失败", "创建失败: ")
}
return nil
}
// UpdateCustomer 更新客户信息
func UpdateCustomer(customerID string, customer *model.Customer) error {
err := app.ModuleClients.BundleDB.Model(&model.Customer{}).
Where("customer_id = ?", customerID).
Updates(customer).Error
if err != nil {
return commonErr.ReturnError(err, "更新失败", "更新失败: ")
}
return nil
}
// DeleteCustomer 删除客户(软删除)
func DeleteCustomer(customerID string) error {
err := app.ModuleClients.BundleDB.
Where("customer_id = ?", customerID).
Delete(&model.Customer{}).Error
if err != nil {
return commonErr.ReturnError(err, "删除失败", "删除失败: ")
}
return nil
}
// GetCustomerList 多条件分页查询客户列表
func GetCustomerList(req *CustomerQueryRequest) ([]*model.Customer, int64, error) {
var customers []*model.Customer
var total int64
// 构建查询条件
query := app.ModuleClients.BundleDB.Model(&model.Customer{})
// 客户名称模糊查询
if req.CustomerName != "" {
query = query.Where("customer_name LIKE ?", "%"+req.CustomerName+"%")
}
// 推荐人模糊查询
if req.ReferralPerson != "" {
query = query.Where("referral_person LIKE ?", "%"+req.ReferralPerson+"%")
}
// 计算总数
err := query.Count(&total).Error
if err != nil {
return nil, 0, commonErr.ReturnError(err, "查询客户总数失败", "查询客户总数失败: ")
}
// 分页查询
if req.PageSize > 0 && req.Page > 0 {
offset := (req.Page - 1) * req.PageSize
query = query.Limit(req.PageSize).Offset(offset)
}
// 按创建时间倒序排列
err = query.Order("created_at DESC").Find(&customers).Error
if err != nil {
if err == gorm.ErrRecordNotFound {
return []*model.Customer{}, 0, nil
}
return nil, 0, commonErr.ReturnError(err, "查询客户列表失败", "查询客户列表失败: ")
}
return customers, total, nil
}
// GetCustomerByID 根据客户ID查询客户信息
func GetCustomerByID(customerID string) (*model.Customer, error) {
var customer model.Customer
err := app.ModuleClients.BundleDB.
Where("customer_id = ?", customerID).
Where("deleted_at = 0").
First(&customer).Error
if err != nil {
if err == gorm.ErrRecordNotFound {
return nil, nil
}
return nil, commonErr.ReturnError(err, "查询客户信息失败", "查询客户信息失败: ")
}
return &customer, nil
}
func CheckCustomerNameExists(customerName string, excludeCustomerID string) (bool, error) {
if customerName == "" {
return false, nil
}
var count int64
query := app.ModuleClients.BundleDB.Model(&model.Customer{}).
Where("customer_name = ?", customerName).
Where("deleted_at = 0")
if excludeCustomerID != "" {
query = query.Where("customer_id != ?", excludeCustomerID)
}
err := query.Count(&count).Error
if err != nil {
return false, commonErr.ReturnError(err, "查询客户名称失败", "查询客户名称失败: ")
}
return count > 0, nil
}
// GetDistinctReferralPersons 查询所有不重复的推荐人
// keyword: 推荐人关键字,支持模糊查询,为空则查询所有
func GetDistinctReferralPersons(keyword string) ([]string, error) {
var referralPersons []string
// 构建查询条件
query := app.ModuleClients.BundleDB.Model(&model.Customer{}).
Where("deleted_at = 0").
Where("referral_person != ''").
Where("referral_person IS NOT NULL")
// 如果提供了关键字,进行模糊查询
if keyword != "" {
query = query.Where("referral_person LIKE ?", "%"+keyword+"%")
}
// 查询所有不重复的推荐人
err := query.Distinct("referral_person").
Pluck("referral_person", &referralPersons).Error
if err != nil {
return nil, commonErr.ReturnError(err, "查询推荐人列表失败", "查询推荐人列表失败: ")
}
return referralPersons, nil
}

246
internal/dao/invoiceDao.go Normal file
View File

@ -0,0 +1,246 @@
package dao
import (
"fmt"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
"strconv"
"time"
)
func CreateInvoice(req *bundle.CreateInvoiceReq) (res *bundle.CreateInvoiceResp, err error) {
res = new(bundle.CreateInvoiceResp)
userId, err := strconv.Atoi(req.UserId)
if err != nil {
return nil, err
}
fmt.Println("创建发票信息applyTime=", req.ApplyTime)
loc, _ := time.LoadLocation("Asia/Shanghai")
applyTime, err := time.ParseInLocation("20060102 15:04:05", req.ApplyTime, loc)
if err != nil {
applyTime, err = time.ParseInLocation(time.DateTime, req.ApplyTime, loc)
if err != nil {
fmt.Println("创建发票信息失败:", err)
return nil, err
}
}
inv := &model.Invoice{
UserId: userId,
UserNum: req.UserNum,
UserName: req.UserName,
OrderNo: req.OrderNo,
ApplyTime: applyTime,
InvoiceType: int(req.InvoiceType),
InvoiceNo: req.InvoiceNo,
InvoiceUrl: req.InvoiceUrl,
PaperInvocieStatus: int(req.PaperInvocieStatus),
Remark: req.Remark,
}
//打印信息
fmt.Println("创建发票信息userId=", inv.UserId, "userNum=", inv.UserNum, "userName=", inv.UserName, "orderNo=", inv.OrderNo, "applyTime=", inv.ApplyTime, "invoiceType=", inv.InvoiceType, "invoiceNo=", inv.InvoiceNo, "invoiceUrl=", inv.InvoiceUrl, "paperInvocieStatus=", inv.PaperInvocieStatus, "remark=", inv.Remark)
err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).Create(inv).Error
if err != nil {
return nil, err
}
fmt.Println("创建发票信息成功")
return res, nil
}
func CreatePaperInvoiceAddress(req *bundle.CreatePaperInvoiceAddressReq) (res *bundle.CreatePaperInvoiceAddressResp, err error) {
res = new(bundle.CreatePaperInvoiceAddressResp)
userId, err := strconv.Atoi(req.UserId)
if err != nil {
return nil, err
}
loc, _ := time.LoadLocation("Asia/Shanghai")
applyTime, err := time.ParseInLocation("20060102 15:04:05", req.ApplyTime, loc)
if err != nil {
applyTime, err = time.ParseInLocation(time.DateTime, req.ApplyTime, loc)
if err != nil {
fmt.Println("创建发票信息失败:", err)
return nil, err
}
}
pia := &model.PaperInvoiceAddress{
UserId: userId,
ApplyTime: applyTime,
OrderNo: req.OrderNo,
InvoiceNo: req.InvoiceNo,
Name: req.Name,
TelAreaCode: req.TelAreaCode,
Phone: req.Phone,
PostalCode: req.PostalCode,
Country: req.Country,
Address: req.Address,
Remark: req.Remark,
}
err = app.ModuleClients.BundleDB.Model(&model.PaperInvoiceAddress{}).Create(pia).Error
if err != nil {
return nil, err
}
//更新主表状态
err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).Where("order_no = ?", req.OrderNo).Updates(
&map[string]interface{}{
"paper_invocie_status": 2,
}).Error
if err != nil {
return nil, err
}
return res, nil
}
func GetInvoiceList(req *bundle.GetInvoiceListReq) (data []*model.InvoiceInfo, total int64, err error) {
data = make([]*model.InvoiceInfo, 0)
query := app.ModuleClients.BundleDB.Model(&model.Invoice{}).
Select(`
COALESCE(pia.name, rn.name) AS name,
COALESCE(pia.tel_area_code, user.tel_area_code) AS tel_area_code,
COALESCE(pia.phone, user.tel_num) AS phone,
COALESCE(pia.country, rn.nationality) AS country,
COALESCE(pia.address, rn.place_of_residence) AS address,
pia.apply_time AS apply_time,
invoice.user_name AS user_name,
invoice.user_num AS user_num,
invoice.order_no AS order_no,
invoice.invoice_no AS invoice_no,
invoice.invoice_url AS invoice_url,
invoice.paper_invocie_status AS paper_invocie_status
`).
Joins("LEFT JOIN paper_invoice_address as pia ON invoice.order_no = pia.order_no and pia.deleted_at = 0").
Joins("LEFT JOIN `micro-account`.`user` AS user ON invoice.user_id = user.id and user.deleted_at = 0").
Joins("LEFT JOIN `micro-account`.real_name AS rn ON user.real_name_id = rn.id and rn.deleted_at = 0")
if req.IsExpress != 0 {
if req.IsExpress == 2 && req.IsApplyInvocice == 1 {
query = query.Where("invoice.paper_invocie_status = ?", req.IsApplyInvocice)
} else {
query = query.Where("invoice.paper_invocie_status = ?", req.IsExpress)
}
} else {
if req.IsApplyInvocice == 2 {
query = query.Where("invoice.paper_invocie_status >= ?", req.IsApplyInvocice)
} else if req.IsApplyInvocice == 1 {
query = query.Where("invoice.paper_invocie_status = ?", req.IsApplyInvocice)
} else {
}
}
if req.ApplyTimeStart != "" {
// 使用 COALESCE 后的 apply_time 进行筛选
query = query.Where("pia.apply_time >= ?", req.ApplyTimeStart)
}
if req.ApplyTimeEnd != "" {
query = query.Where("pia.apply_time <= ?", req.ApplyTimeEnd)
}
if req.Name != "" {
// 使用 COALESCE 后的 name 进行模糊筛选,统一 collation 避免 Illegal mix of collations
query = query.Where("COALESCE(pia.name, rn.name) COLLATE utf8mb4_general_ci LIKE ?", "%"+req.Name+"%")
}
if req.Phone != "" {
query = query.Where("COALESCE(pia.phone, user.tel_num) COLLATE utf8mb4_general_ci LIKE ?", "%"+req.Phone+"%")
}
if req.Country != "" {
query = query.Where("COALESCE(pia.country, rn.nationality) COLLATE utf8mb4_general_ci LIKE ?", "%"+req.Country+"%")
}
if req.UserName != "" {
query = query.Where("invoice.user_name LIKE ?", "%"+req.UserName+"%")
}
query.Order("pia.apply_time DESC")
query = query.Count(&total)
err = query.Offset(int(req.Page-1) * int(req.Size)).Limit(int(req.Size)).Find(&data).Error
if err != nil {
return nil, 0, err
}
return data, total, nil
}
func UpdateInvoiceExpressInfo(req *bundle.UpdateInvoiceExpressInfoReq) (res *bundle.UpdateInvoiceExpressInfoResp, err error) {
res = new(bundle.UpdateInvoiceExpressInfoResp)
err = app.ModuleClients.BundleDB.Model(&model.PaperInvoiceAddress{}).Where("order_no = ?", req.OrderNo).Updates(
&map[string]interface{}{
"express_company": req.ExpressCompany,
"express_no": req.ExpressNo,
"remark": req.Remark,
}).Error
if err != nil {
return nil, err
}
//更新主表状态
err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).Where("order_no = ?", req.OrderNo).Updates(
&map[string]interface{}{
"paper_invocie_status": 3,
}).Error
if err != nil {
return nil, err
}
return res, nil
}
func GetInvoiceExpressInfo(req *bundle.GetInvoiceExpressInfoReq) (res *bundle.GetInvoiceExpressInfoResp, err error) {
res = new(bundle.GetInvoiceExpressInfoResp)
err = app.ModuleClients.BundleDB.Model(&model.PaperInvoiceAddress{}).Where("order_no = ?", req.OrderNo).First(&res).Error
if err != nil {
return nil, err
}
return res, nil
}
func GetOrderInfoByOrderNo(req *bundle.GetOrderInfoByOrderNoReq) (orderRecord *model.InvoiceOrderInfo, err error) {
orderRecord = new(model.InvoiceOrderInfo)
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Select(`
bundle_order_records.customer_name AS user_name,
user.id AS user_id,
bundle_order_records.order_no AS order_no,
bundle_order_records.customer_num AS user_num,
bundle_order_records.amount_type AS amount_type,
bundle_order_records.total_amount AS total_amount,
bundle_order_records.bundle_name AS bundle_name,
rn.place_of_residence AS address,
user.tel_num AS phone
`).
Joins("left join `micro-account`.`user` as user on user.id = bundle_order_records.customer_id and user.deleted_at = 0").
Joins("left join `micro-account`.`real_name` as rn on rn.id = user.real_name_id and rn.deleted_at = 0").
Where("uuid = ?", req.Uuid).
Where("bundle_order_records.deleted_at is null").
Order("bundle_order_records.created_at DESC").
First(&orderRecord).Error
if err != nil {
return nil, err
}
return orderRecord, nil
}
func GetInvoiceInfoByOrderNo(req *bundle.GetInvoiceInfoByOrderNoReq) (data []*model.InvoiceInfoByOrderNo, err error) {
data = make([]*model.InvoiceInfoByOrderNo, 0)
err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).
Select(`
invoice.order_no AS order_no,
invoice.invoice_no AS invoice_no,
invoice.invoice_url AS invoice_url,
bor.bundle_name AS bundle_name,
bor.amount_type AS amount_type,
bor.total_amount AS total_amount,
bor.pay_time AS pay_time,
invoice.paper_invocie_status AS paper_invocie_status
`).
Joins("left join bundle_order_records bor on invoice.order_no = bor.order_no and bor.deleted_at is null").
Where("invoice.user_id = ?", req.UserId).
Order("bor.pay_time DESC").
Find(&data).Error
if err != nil {
return nil, err
}
return data, nil
}
func GetLastInvoiceNo() (lastNo model.Invoice, err error) {
err = app.ModuleClients.BundleDB.Model(&model.Invoice{}).
Order("apply_time DESC").
Limit(1).
First(&lastNo).Error
if err != nil {
return model.Invoice{}, err
}
return lastNo, nil
}

View File

@ -818,17 +818,7 @@ func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundl
func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
var existing model.Reconciliation
//req.SerialNumber现在是orderuuid
var order model.BundleOrderRecords
if err := app.ModuleClients.BundleDB.Where("uuid = ?", req.SerialNumber).First(&order).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("订单记录不存在")
}
return nil, fmt.Errorf("查询订单失败: %v", err)
}
if err := app.ModuleClients.BundleDB.Where("bundle_order_on = ?", order.OrderNo).First(&existing).Error; err != nil {
if err := app.ModuleClients.BundleDB.Where("serial_number = ?", req.SerialNumber).First(&existing).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("对账单记录不存在")
}
@ -837,7 +827,7 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
updates := model.Reconciliation{
PayTime: req.PayTime,
PayStatus: int(req.PaymentStatus),
SerialNumber: order.OrderNo,
SerialNumber: req.SerialNumber,
}
if req.PaymentStatus == 2 && existing.CurrencyType == 2 && existing.PayAmount > 0 {
@ -989,108 +979,3 @@ func ReSignTheContract(req *bundle.ReSignTheContractRequest) (*bundle.CommonResp
return res, nil
}
func UpdateOrderRecordByOrderUuid(orderRecord *model.BundleOrderRecords) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
// Step 1: 先更新子订单(增值服务)的支付状态
valueAdd := &model.BundleOrderValueAdd{
PaymentStatus: int(orderRecord.Status),
PaymentTime: orderRecord.PayTime,
}
if orderRecord.CheckoutSessionId != "" {
valueAdd.CheckoutSessionId = orderRecord.CheckoutSessionId
valueAdd.CheckoutSessionUrl = orderRecord.CheckoutSessionUrl
}
if orderRecord.Status == 2 {
tempValues := make([]*model.BundleOrderValueAdd, 0)
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Where("order_uuid = ?", orderRecord.UUID).
Find(&tempValues).Error
if len(tempValues) > 0 {
for _, value := range tempValues {
if value.PaymentStatus == 2 {
fmt.Println("====================已经付过了")
return nil, errors.New("已付款了")
}
}
}
tempRecord := new(model.BundleOrderRecords)
if err := app.ModuleClients.BundleDB.Where("deleted_at is null and uuid = ?", orderRecord.UUID).First(&tempRecord).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("订单记录不存在")
}
return nil, fmt.Errorf("查询订单失败: %v", err)
}
if orderRecord.Status == 2 && tempRecord.AmountType == 2 && tempRecord.TotalAmount > 0 {
// 当回调支付成功币种是美元且订单金额大于0计算美元手续费订单金额*0.019(四舍五入保留两位小数字)+0.1
amount := decimal.NewFromFloat32(tempRecord.TotalAmount)
rate, _ := decimal.NewFromString("0.019")
fee := amount.Mul(rate)
// 4. 四舍五入保留两位小数
feeRounded := fee.Round(2)
addition, _ := decimal.NewFromString("0.1")
result := feeRounded.Add(addition)
valueAdd.HandlingFee = result.String()
}
}
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Where("order_uuid = ?", orderRecord.UUID).
Updates(valueAdd).Error
if err != nil {
res.Msg = msg.ErrorUpdateOrderInfo
return res, commonErr.ReturnError(err, msg.ErrorUpdateOrderInfo, "更新增值服务支付状态失败: ")
}
// Step 2: 再更新主订单信息(如果存在)
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Where("uuid = ?", orderRecord.UUID).
Updates(orderRecord).Error
// Step 3: 返回结果(即使主订单更新失败,也视为成功)
res.Uuid = orderRecord.UUID
res.Msg = msg.SuccessUpdateOrderInfo
return res, nil
}
func OrderListByOrderUuid(req *bundle.OrderInfoByOrderUuidRequest) (*bundle.OrderInfoByOrderNoResp, error) {
if req == nil || req.OrderUuid == "" {
return nil, errors.New("invalid request")
}
var addOrder []*model.BundleOrderValueAdd
if err := app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Where("order_uuid = ?", req.OrderUuid).
Find(&addOrder).Error; err != nil {
return nil, err
}
if len(addOrder) == 0 {
return &bundle.OrderInfoByOrderNoResp{}, nil
}
//订单类型 1:套餐 2:单独购买
userID, err := strconv.ParseInt(addOrder[0].CustomerID, 10, 64)
if err != nil {
return nil, err
}
res := &bundle.OrderInfoByOrderNoResp{
Type: int32(addOrder[0].Source),
UserId: uint64(userID),
OrderUUID: addOrder[0].OrderUUID,
UserName: addOrder[0].CustomerName,
}
for _, item := range addOrder {
switch item.ServiceType {
case 1:
res.VideoNumber += item.Num // 使用 += 而不是直接赋值
case 2:
res.ImageNumber += item.Num
case 3:
res.DataNumber += item.Num
case 4:
res.AccountNumber += item.Num
case 5:
res.Duration += item.Num
res.Unit = item.Unit // 如果有多个duration记录最后一个unit会覆盖前面的
}
}
return res, nil
}

View File

@ -1,617 +0,0 @@
package logic
import (
"encoding/json"
"errors"
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"time"
"unicode/utf8"
"github.com/google/uuid"
)
// attachmentsToJSON 将附件列表url+fileName序列化为 JSON 字符串存入 DB
func attachmentsToJSON(items []*bundle.AttachmentItem) string {
if len(items) == 0 {
return "[]"
}
list := make([]model.AttachmentItem, 0, len(items))
for _, it := range items {
list = append(list, model.AttachmentItem{URL: it.GetUrl(), FileName: it.GetFileName()})
}
b, _ := json.Marshal(list)
return string(b)
}
// jsonToAttachments 将 DB 中的 JSON 反序列化为附件列表(格式:[{"url":"","fileName":""},...]
func jsonToAttachments(s string) []*bundle.AttachmentItem {
if s == "" || s == "[]" {
return nil
}
var list []model.AttachmentItem
_ = json.Unmarshal([]byte(s), &list)
out := make([]*bundle.AttachmentItem, 0, len(list))
for i := range list {
out = append(out, &bundle.AttachmentItem{Url: list[i].URL, FileName: list[i].FileName})
}
return out
}
// validateContractBody 校验合同主体字段create/update 共用)
func validateContractBody(c *bundle.Contract) (string, error) {
// 1. 合同名称必填最多50个字
if c.ContractName == "" {
return "合同名称不能为空", errors.New("合同名称不能为空")
}
if utf8.RuneCountInString(c.ContractName) > 50 {
return "合同名称最多50个字", errors.New("合同名称最多50个字")
}
// 2. 项目名称必填最多50个字
if c.ProjectName == "" {
return "项目名称不能为空", errors.New("项目名称不能为空")
}
if utf8.RuneCountInString(c.ProjectName) > 50 {
return "项目名称最多50个字", errors.New("项目名称最多50个字")
}
if c.CustomerName == "" {
return "客户名称不能为空", errors.New("客户名称不能为空")
}
if c.ContractorName == "" {
return "承办商名称不能为空", errors.New("承办商名称不能为空")
}
if c.SigningDate == "" {
return "签署日期不能为空", errors.New("签署日期不能为空")
}
if c.EffectiveDate == "" {
return "生效日期不能为空", errors.New("生效日期不能为空")
}
if c.ContractAmount <= 0 {
return "合同金额不能为空", errors.New("合同金额不能为空")
}
if c.ContractCurrencyType == 0 {
return "合同货币类型不能为空", errors.New("合同货币类型不能为空")
}
if c.ContractPaymentCycle == "" {
return "支付周期不能为空", errors.New("支付周期不能为空")
}
if c.DevelopmentCycle == "" {
return "开发周期不能为空", errors.New("开发周期不能为空")
}
if c.MaintenanceCycleType == 0 {
return "维护周期类型不能为空", errors.New("维护周期类型不能为空")
}
if c.MaintenanceFee <= 0 {
return "维护费用不能为空", errors.New("维护费用不能为空")
}
if c.MaintenanceCurrencyType == 0 {
return "维护货币类型不能为空", errors.New("维护货币类型不能为空")
}
if c.QualityAssuranceFee <= 0 {
return "质量保证金额不能为空", errors.New("质量保证金额不能为空")
}
if c.QualityAssuranceCurrencyType == 0 {
return "质量保证金货币类型不能为空", errors.New("质量保证金货币类型不能为空")
}
if len(c.ContractAttachments) > 5 {
return "合同附件不能超过5个", errors.New("合同附件不能超过5个")
}
if len(c.OtherAttachments) > 5 {
return "其他附件不能超过5个", errors.New("其他附件不能超过5个")
}
return "", nil
}
// validateCyclePeriods 验证周期期数是否从1开始连续递增
func validateCyclePeriods(periods []int32, cycleName string) (string, error) {
if len(periods) > 10 {
msg := cycleName + "不能超过10期"
return msg, errors.New(msg)
}
if len(periods) == 0 {
msg := cycleName + "至少有1期"
return msg, errors.New(msg)
}
periodSet := make(map[int32]bool)
for _, p := range periods {
periodSet[p] = true
}
count := int32(len(periods))
for i := int32(1); i <= count; i++ {
if !periodSet[i] {
msg := cycleName + "不是递增"
return msg, errors.New(msg)
}
}
return "", nil
}
// convertPaymentCycles 转换支付周期子表
// isUpdate: true 时保留前端传入的 UUIDfalse 时生成新 UUID
func convertPaymentCycles(cycles []*bundle.ContractPaymentCycle, contractUUID string, isUpdate bool) ([]model.ContractPaymentCycle, string, error) {
if len(cycles) == 0 {
return nil, "", nil
}
result := make([]model.ContractPaymentCycle, 0, len(cycles))
for _, pc := range cycles {
// 交付时间点最多200个字
if utf8.RuneCountInString(pc.DeliveryTime) > 200 {
return nil, "交付时间点最多200个字", errors.New("交付时间点最多200个字")
}
cycleUUID := uuid.New().String()
if isUpdate && pc.ContractPaymentCycleUUID != "" {
cycleUUID = pc.ContractPaymentCycleUUID
}
result = append(result, model.ContractPaymentCycle{
ContractPaymentCycleUUID: cycleUUID,
ContractUUID: contractUUID,
PaymentCyclePeriod: int(pc.PaymentCyclePeriod),
DeliveryTime: pc.DeliveryTime,
ContractPaymentCycleAmount: pc.ContractPaymentCycleAmount,
PaymentCycleCurrencyType: int(pc.PaymentCycleCurrencyType),
})
}
return result, "", nil
}
// convertDevelopmentCycles 转换开发周期子表
// isUpdate: true 时保留前端传入的 UUIDfalse 时生成新 UUID
func convertDevelopmentCycles(cycles []*bundle.DevelopmentCycle, contractUUID string, isUpdate bool) ([]model.DevelopmentCycle, string, error) {
if len(cycles) == 0 {
return nil, "", nil
}
result := make([]model.DevelopmentCycle, 0, len(cycles))
for _, dc := range cycles {
if len(dc.Attachments) > 5 {
return nil, "附件URLs不能超过5个", errors.New("附件URLs不能超过5个")
}
// 开发时间最多50个字
if utf8.RuneCountInString(dc.DevelopmentTime) > 50 {
return nil, "开发时间最多50个字", errors.New("开发时间最多50个字")
}
// 交付内容最多200个字
if utf8.RuneCountInString(dc.DeliveryContent) > 200 {
return nil, "交付内容最多200个字", errors.New("交付内容最多200个字")
}
cycleUUID := uuid.New().String()
if isUpdate && dc.DevelopmentCycleUUID != "" {
cycleUUID = dc.DevelopmentCycleUUID
}
result = append(result, model.DevelopmentCycle{
DevelopmentCycleUUID: cycleUUID,
ContractUUID: contractUUID,
DevelopmentPeriod: int(dc.DevelopmentPeriod),
DevelopmentTime: dc.DevelopmentTime,
AttachmentURLs: attachmentsToJSON(dc.Attachments),
DeliveryContent: dc.DeliveryContent,
})
}
return result, "", nil
}
// UpdateContract 合同更新接口根据action判断新增/更新/删除)
func UpdateContract(req *bundle.ContractUpdateRequest) (res *bundle.ComResponse, err error) {
res = new(bundle.ComResponse)
if req.Contract == nil {
res.Msg = "合同信息不能为空"
return res, errors.New("合同信息不能为空")
}
switch req.Action {
case "create": // 新增
if msg, e := validateContractBody(req.Contract); e != nil {
res.Msg = msg
return res, e
}
// 构建model对象
contract := &model.Contract{
ContractUUID: req.Contract.ContractUUID,
ContractName: req.Contract.ContractName,
ProjectName: req.Contract.ProjectName,
CustomerName: req.Contract.CustomerName,
ContractorName: req.Contract.ContractorName,
SigningDate: req.Contract.SigningDate,
EffectiveDate: req.Contract.EffectiveDate,
ContractAmount: req.Contract.ContractAmount,
ContractCurrencyType: int(req.Contract.ContractCurrencyType),
ContractPaymentCycle: req.Contract.ContractPaymentCycle,
DevelopmentCycle: req.Contract.DevelopmentCycle,
MaintenanceCycleType: int(req.Contract.MaintenanceCycleType),
MaintenanceFee: req.Contract.MaintenanceFee,
MaintenanceCurrencyType: int(req.Contract.MaintenanceCurrencyType),
QualityAssuranceFee: req.Contract.QualityAssuranceFee,
QualityAssuranceCurrencyType: int(req.Contract.QualityAssuranceCurrencyType),
ContractAttachmentURLs: attachmentsToJSON(req.Contract.ContractAttachments),
OtherAttachmentURLs: attachmentsToJSON(req.Contract.OtherAttachments),
Operator: req.Contract.Operator,
OperatorID: req.Contract.OperatorID,
OperatorNum: req.Contract.OperatorNum,
}
contract.OperatorTime = time.Now()
// 支付周期:前端传 -1 表示不保存该条,过滤掉
paymentCyclesFiltered := make([]*bundle.ContractPaymentCycle, 0, len(req.Contract.PaymentCycles))
for _, pc := range req.Contract.PaymentCycles {
if pc.PaymentCyclePeriod != -1 {
paymentCyclesFiltered = append(paymentCyclesFiltered, pc)
}
}
// 验证并转换支付周期子表
paymentPeriods := make([]int32, 0, len(paymentCyclesFiltered))
for _, pc := range paymentCyclesFiltered {
paymentPeriods = append(paymentPeriods, pc.PaymentCyclePeriod)
}
if msg, e := validateCyclePeriods(paymentPeriods, "支付周期"); e != nil {
res.Msg = msg
return res, e
}
paymentCycles, msg, e := convertPaymentCycles(paymentCyclesFiltered, contract.ContractUUID, false)
if e != nil {
res.Msg = msg
return res, e
}
contract.PaymentCycles = paymentCycles
// 开发周期:前端传 -1 表示不保存该条,过滤掉
devCyclesFiltered := make([]*bundle.DevelopmentCycle, 0, len(req.Contract.DevelopmentCycles))
for _, dc := range req.Contract.DevelopmentCycles {
if dc.DevelopmentPeriod != -1 {
devCyclesFiltered = append(devCyclesFiltered, dc)
}
}
// 验证并转换开发周期子表
devPeriods := make([]int32, 0, len(devCyclesFiltered))
for _, dc := range devCyclesFiltered {
devPeriods = append(devPeriods, dc.DevelopmentPeriod)
}
if msg, e := validateCyclePeriods(devPeriods, "开发周期"); e != nil {
res.Msg = msg
return res, e
}
devCycles, msg, e := convertDevelopmentCycles(devCyclesFiltered, contract.ContractUUID, false)
if e != nil {
res.Msg = msg
return res, e
}
contract.DevelopmentCycles = devCycles
// 调用dao层创建
err = dao.CreateContract(contract)
if err != nil {
res.Msg = "创建失败"
return res, err
}
res.Msg = "创建成功"
case "update": // 更新
// 参数校验
if req.Contract.ContractUUID == "" {
res.Msg = "合同UUID不能为空"
return res, errors.New("合同UUID不能为空")
}
if msg, e := validateContractBody(req.Contract); e != nil {
res.Msg = msg
return res, e
}
// 构建model对象
contract := &model.Contract{
ContractName: req.Contract.ContractName,
ProjectName: req.Contract.ProjectName,
CustomerName: req.Contract.CustomerName,
ContractorName: req.Contract.ContractorName,
SigningDate: req.Contract.SigningDate,
EffectiveDate: req.Contract.EffectiveDate,
ContractAmount: req.Contract.ContractAmount,
ContractCurrencyType: int(req.Contract.ContractCurrencyType),
ContractPaymentCycle: req.Contract.ContractPaymentCycle,
DevelopmentCycle: req.Contract.DevelopmentCycle,
MaintenanceCycleType: int(req.Contract.MaintenanceCycleType),
MaintenanceFee: req.Contract.MaintenanceFee,
MaintenanceCurrencyType: int(req.Contract.MaintenanceCurrencyType),
QualityAssuranceFee: req.Contract.QualityAssuranceFee,
QualityAssuranceCurrencyType: int(req.Contract.QualityAssuranceCurrencyType),
ContractAttachmentURLs: attachmentsToJSON(req.Contract.ContractAttachments),
OtherAttachmentURLs: attachmentsToJSON(req.Contract.OtherAttachments),
Operator: req.Contract.Operator,
OperatorID: req.Contract.OperatorID,
OperatorNum: req.Contract.OperatorNum,
}
contract.OperatorTime = time.Now()
// 支付周期:前端传 -1 表示不保存该条,过滤掉
paymentCyclesFiltered := make([]*bundle.ContractPaymentCycle, 0, len(req.Contract.PaymentCycles))
for _, pc := range req.Contract.PaymentCycles {
if pc.PaymentCyclePeriod != -1 {
paymentCyclesFiltered = append(paymentCyclesFiltered, pc)
}
}
// 验证并转换支付周期子表
paymentPeriods := make([]int32, 0, len(paymentCyclesFiltered))
for _, pc := range paymentCyclesFiltered {
paymentPeriods = append(paymentPeriods, pc.PaymentCyclePeriod)
}
if msg, e := validateCyclePeriods(paymentPeriods, "支付周期"); e != nil {
res.Msg = msg
return res, e
}
paymentCycles, msg, e := convertPaymentCycles(paymentCyclesFiltered, req.Contract.ContractUUID, true)
if e != nil {
res.Msg = msg
return res, e
}
contract.PaymentCycles = paymentCycles
// 开发周期:前端传 -1 表示不保存该条,过滤掉
devCyclesFiltered := make([]*bundle.DevelopmentCycle, 0, len(req.Contract.DevelopmentCycles))
for _, dc := range req.Contract.DevelopmentCycles {
if dc.DevelopmentPeriod != -1 {
devCyclesFiltered = append(devCyclesFiltered, dc)
}
}
// 验证并转换开发周期子表
devPeriods := make([]int32, 0, len(devCyclesFiltered))
for _, dc := range devCyclesFiltered {
devPeriods = append(devPeriods, dc.DevelopmentPeriod)
}
if msg, e := validateCyclePeriods(devPeriods, "开发周期"); e != nil {
res.Msg = msg
return res, e
}
devCycles, msg, e := convertDevelopmentCycles(devCyclesFiltered, req.Contract.ContractUUID, true)
if e != nil {
res.Msg = msg
return res, e
}
contract.DevelopmentCycles = devCycles
// 调用dao层更新
err = dao.UpdateContract(req.Contract.ContractUUID, contract)
if err != nil {
res.Msg = "更新失败"
return res, err
}
res.Msg = "更新成功"
case "delete": // 删除
// 参数校验
if req.Contract.ContractUUID == "" {
res.Msg = "合同UUID不能为空"
return res, errors.New("合同UUID不能为空")
}
// 调用dao层删除
err = dao.DeleteContract(req.Contract.ContractUUID)
if err != nil {
res.Msg = "删除失败"
return res, err
}
res.Msg = "删除成功"
default:
res.Msg = "未知操作"
return res, errors.New("未知操作")
}
return res, nil
}
// GetContractList 查询合同列表
func GetContractList(req *bundle.ContractListRequest) (res *bundle.ContractListResponse, err error) {
res = new(bundle.ContractListResponse)
// 构建dao层查询请求
daoReq := &dao.ContractQueryRequest{
ContractName: req.ContractName,
ProjectName: req.ProjectName,
CustomerName: req.CustomerName,
Page: int(req.Page),
PageSize: int(req.PageSize),
}
// 调用dao层查询
contracts, total, err := dao.GetContractList(daoReq)
if err != nil {
return res, err
}
// 转换model到proto响应
contractInfoList := make([]*bundle.ContractInfo, 0, len(contracts))
for _, contract := range contracts {
contractInfo := &bundle.ContractInfo{
ContractUUID: contract.ContractUUID,
ContractName: contract.ContractName,
ProjectName: contract.ProjectName,
CustomerName: contract.CustomerName,
ContractorName: contract.ContractorName,
SigningDate: contract.SigningDate,
EffectiveDate: contract.EffectiveDate,
ContractAmount: contract.ContractAmount,
ContractCurrencyType: int32(contract.ContractCurrencyType),
ContractPaymentCycle: contract.ContractPaymentCycle,
DevelopmentCycle: contract.DevelopmentCycle,
QualityAssuranceFee: contract.QualityAssuranceFee,
QualityAssuranceCurrencyType: int32(contract.QualityAssuranceCurrencyType),
MaintenanceCycleType: int32(contract.MaintenanceCycleType),
MaintenanceFee: contract.MaintenanceFee,
MaintenanceCurrencyType: int32(contract.MaintenanceCurrencyType),
ContractAttachments: jsonToAttachments(contract.ContractAttachmentURLs),
OtherAttachments: jsonToAttachments(contract.OtherAttachmentURLs),
Operator: contract.Operator,
}
// 格式化操作时间
if !contract.OperatorTime.IsZero() {
contractInfo.OperatorTime = contract.OperatorTime.Format("2006-01-02 15:04")
}
contractInfoList = append(contractInfoList, contractInfo)
}
res.List = contractInfoList
res.Total = total
res.Page = req.Page
res.PageSize = req.PageSize
return res, nil
}
// GetContractDetail 根据合同UUID查询详情
func GetContractDetail(req *bundle.ContractDetailRequest) (res *bundle.ContractDetailResponse, err error) {
res = new(bundle.ContractDetailResponse)
// 参数校验
if req.ContractUUID == "" {
res.Msg = "合同UUID不能为空"
return res, errors.New("合同UUID不能为空")
}
// 调用dao层查询
contract, err := dao.GetContractByUUID(req.ContractUUID)
if err != nil {
res.Msg = "查询合同信息失败"
return res, err
}
// 如果合同不存在
if contract == nil {
res.Msg = "合同不存在"
return res, errors.New("合同不存在")
}
// 转换model到proto响应
contractProto := &bundle.Contract{
ContractUUID: contract.ContractUUID,
ContractName: contract.ContractName,
ProjectName: contract.ProjectName,
CustomerName: contract.CustomerName,
ContractorName: contract.ContractorName,
SigningDate: contract.SigningDate,
EffectiveDate: contract.EffectiveDate,
ContractAmount: contract.ContractAmount,
ContractCurrencyType: int32(contract.ContractCurrencyType),
ContractPaymentCycle: contract.ContractPaymentCycle,
DevelopmentCycle: contract.DevelopmentCycle,
MaintenanceCycleType: int64(contract.MaintenanceCycleType),
MaintenanceFee: contract.MaintenanceFee,
MaintenanceCurrencyType: int32(contract.MaintenanceCurrencyType),
QualityAssuranceFee: contract.QualityAssuranceFee,
QualityAssuranceCurrencyType: int32(contract.QualityAssuranceCurrencyType),
ContractAttachments: jsonToAttachments(contract.ContractAttachmentURLs),
OtherAttachments: jsonToAttachments(contract.OtherAttachmentURLs),
Operator: contract.Operator,
}
// 格式化操作时间
if !contract.OperatorTime.IsZero() {
contractProto.OperatorTime = contract.OperatorTime.Format("2006-01-02 15:04")
}
// 转换支付周期子表
if len(contract.PaymentCycles) > 0 {
contractProto.PaymentCycles = make([]*bundle.ContractPaymentCycle, 0, len(contract.PaymentCycles))
for _, pc := range contract.PaymentCycles {
contractProto.PaymentCycles = append(contractProto.PaymentCycles, &bundle.ContractPaymentCycle{
ContractPaymentCycleUUID: pc.ContractPaymentCycleUUID,
ContractUUID: pc.ContractUUID,
PaymentCyclePeriod: int32(pc.PaymentCyclePeriod),
DeliveryTime: pc.DeliveryTime,
ContractPaymentCycleAmount: pc.ContractPaymentCycleAmount,
PaymentCycleCurrencyType: int32(pc.PaymentCycleCurrencyType),
})
}
}
// 转换开发周期子表
if len(contract.DevelopmentCycles) > 0 {
contractProto.DevelopmentCycles = make([]*bundle.DevelopmentCycle, 0, len(contract.DevelopmentCycles))
for _, dc := range contract.DevelopmentCycles {
contractProto.DevelopmentCycles = append(contractProto.DevelopmentCycles, &bundle.DevelopmentCycle{
DevelopmentCycleUUID: dc.DevelopmentCycleUUID,
ContractUUID: dc.ContractUUID,
DevelopmentPeriod: int32(dc.DevelopmentPeriod),
DevelopmentTime: dc.DevelopmentTime,
Attachments: jsonToAttachments(dc.AttachmentURLs),
DeliveryContent: dc.DeliveryContent,
})
}
}
res.Contract = contractProto
res.Msg = "查询成功"
return res, nil
}
// GetDevelopmentCyclesByContractUUID 根据合同UUID查询开发周期
func GetDevelopmentCyclesByContractUUID(req *bundle.GetDevelopmentCyclesByContractUUIDRequest) (res *bundle.GetDevelopmentCyclesByContractUUIDResponse, err error) {
res = new(bundle.GetDevelopmentCyclesByContractUUIDResponse)
// 参数校验
if req.ContractUUID == "" {
res.Msg = "合同UUID不能为空"
return res, errors.New("合同UUID不能为空")
}
// 调用dao层查询
developmentCycles, err := dao.GetDevelopmentCyclesByContractUUID(req.ContractUUID)
if err != nil {
res.Msg = "查询开发周期失败"
return res, err
}
// 转换model到proto响应
developmentCycleList := make([]*bundle.DevelopmentCycle, 0, len(developmentCycles))
for _, dc := range developmentCycles {
developmentCycleList = append(developmentCycleList, &bundle.DevelopmentCycle{
DevelopmentCycleUUID: dc.DevelopmentCycleUUID,
ContractUUID: dc.ContractUUID,
DevelopmentPeriod: int32(dc.DevelopmentPeriod),
DevelopmentTime: dc.DevelopmentTime,
Attachments: jsonToAttachments(dc.AttachmentURLs),
DeliveryContent: dc.DeliveryContent,
})
}
res.List = developmentCycleList
res.Msg = "查询成功"
return res, nil
}
// GetPaymentCyclesByContractUUID 根据合同UUID查询支付周期
func GetPaymentCyclesByContractUUID(req *bundle.GetPaymentCyclesByContractUUIDRequest) (res *bundle.GetPaymentCyclesByContractUUIDResponse, err error) {
res = new(bundle.GetPaymentCyclesByContractUUIDResponse)
// 参数校验
if req.ContractUUID == "" {
res.Msg = "合同UUID不能为空"
return res, errors.New("合同UUID不能为空")
}
// 调用dao层查询
paymentCycles, err := dao.GetPaymentCyclesByContractUUID(req.ContractUUID)
if err != nil {
res.Msg = "查询支付周期失败"
return res, err
}
// 转换model到proto响应
paymentCycleList := make([]*bundle.ContractPaymentCycle, 0, len(paymentCycles))
for _, pc := range paymentCycles {
paymentCycleList = append(paymentCycleList, &bundle.ContractPaymentCycle{
ContractPaymentCycleUUID: pc.ContractPaymentCycleUUID,
ContractUUID: pc.ContractUUID,
PaymentCyclePeriod: int32(pc.PaymentCyclePeriod),
DeliveryTime: pc.DeliveryTime,
ContractPaymentCycleAmount: pc.ContractPaymentCycleAmount,
PaymentCycleCurrencyType: int32(pc.PaymentCycleCurrencyType),
})
}
res.List = paymentCycleList
res.Msg = "查询成功"
return res, nil
}

View File

@ -1,273 +0,0 @@
package logic
import (
"errors"
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"time"
"unicode/utf8"
)
// validateCustomerFields 校验客户字段
func validateCustomerFields(customer *bundle.Customer) error {
// 1. 客户名称必填最多50个字
if customer.CustomerName == "" {
return errors.New("客户名称不能为空")
}
if utf8.RuneCountInString(customer.CustomerName) > 50 {
return errors.New("客户名称最多50个字")
}
// 2. 授权代表必填最多50个字
if customer.AuthorizedRepresentative == "" {
return errors.New("授权代表不能为空")
}
if utf8.RuneCountInString(customer.AuthorizedRepresentative) > 50 {
return errors.New("授权代表最多50个字")
}
// 3. 注册地址必填最多200字
if customer.RegistrationAddress == "" {
return errors.New("注册地址不能为空")
}
if utf8.RuneCountInString(customer.RegistrationAddress) > 200 {
return errors.New("注册地址最多200个字")
}
// 4. 推荐人非必填最多50个字
if customer.ReferralPerson != "" && utf8.RuneCountInString(customer.ReferralPerson) > 50 {
return errors.New("推荐人最多50个字")
}
return nil
}
// GetCustomerList 多条件查询客户列表
func GetCustomerList(req *bundle.CustomerListRequest) (res *bundle.CustomerListResponse, err error) {
res = new(bundle.CustomerListResponse)
// 构建dao层查询请求
daoReq := &dao.CustomerQueryRequest{
CustomerName: req.CustomerName,
ReferralPerson: req.ReferralPerson,
Page: int(req.Page),
PageSize: int(req.PageSize),
}
// 调用dao层查询
customers, total, err := dao.GetCustomerList(daoReq)
if err != nil {
return res, err
}
// 转换model到proto响应
customerInfoList := make([]*bundle.CustomerInfo, 0, len(customers))
for _, customer := range customers {
customerInfo := &bundle.CustomerInfo{
CustomerID: customer.CustomerID,
CustomerName: customer.CustomerName,
AuthorizedRepresentative: customer.AuthorizedRepresentative,
RegistrationAddress: customer.RegistrationAddress,
ReferralPerson: customer.ReferralPerson,
Operator: customer.Operator,
}
// 格式化操作时间
if !customer.OperatorTime.IsZero() {
customerInfo.OperatorTime = customer.OperatorTime.Format("2006-01-02 15:04")
}
customerInfoList = append(customerInfoList, customerInfo)
}
res.List = customerInfoList
res.Total = total
res.Page = req.Page
res.PageSize = req.PageSize
return res, nil
}
// GetCustomerDetail 根据客户ID查询客户详情
func GetCustomerDetail(req *bundle.CustomerDetailRequest) (res *bundle.CustomerDetailResponse, err error) {
res = new(bundle.CustomerDetailResponse)
// 参数校验
if req.CustomerID == "" {
res.Msg = "客户ID不能为空"
return res, errors.New("客户ID不能为空")
}
// 调用dao层查询
customer, err := dao.GetCustomerByID(req.CustomerID)
if err != nil {
res.Msg = "查询客户信息失败"
return res, err
}
// 如果客户不存在
if customer == nil {
res.Msg = "客户不存在"
return res, errors.New("客户不存在")
}
// 转换model到proto响应
customerProto := &bundle.Customer{
CustomerID: customer.CustomerID,
CustomerName: customer.CustomerName,
AuthorizedRepresentative: customer.AuthorizedRepresentative,
RegistrationAddress: customer.RegistrationAddress,
ReferralPerson: customer.ReferralPerson,
Operator: customer.Operator,
OperatorID: customer.OperatorID,
OperatorNum: customer.OperatorNum,
}
// 格式化时间字段
if !customer.OperatorTime.IsZero() {
customerProto.OperatorTime = customer.OperatorTime.Format("2006-01-02 15:04")
}
if !customer.CreatedAt.IsZero() {
customerProto.CreatedAt = customer.CreatedAt.Format("2006-01-02 15:04:05")
}
if !customer.UpdatedAt.IsZero() {
customerProto.UpdatedAt = customer.UpdatedAt.Format("2006-01-02 15:04:05")
}
res.Customer = customerProto
res.Msg = "查询成功"
return res, nil
}
// UpdateCustomer 更新客户接口根据action判断新增/更新/删除)
func UpdateCustomer(req *bundle.CustomerUpdateRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
// 参数校验
if req.Customer == nil {
res.Msg = "客户信息不能为空"
return res, errors.New("客户信息不能为空")
}
// 根据action执行不同操作
switch req.Action {
case "create": // 新增
// 字段校验
if err := validateCustomerFields(req.Customer); err != nil {
res.Msg = err.Error()
return res, err
}
// 检查客户名称是否已存在
exists, err := dao.CheckCustomerNameExists(req.Customer.CustomerName, "")
if err != nil {
res.Msg = "检查客户名称重复失败"
return res, err
}
if exists {
res.Msg = "客户名称重复"
return res, errors.New("客户名称重复")
}
// 构建model对象
customer := &model.Customer{
CustomerName: req.Customer.CustomerName,
AuthorizedRepresentative: req.Customer.AuthorizedRepresentative,
RegistrationAddress: req.Customer.RegistrationAddress,
ReferralPerson: req.Customer.ReferralPerson,
Operator: req.Customer.Operator,
OperatorID: req.Customer.OperatorID,
OperatorNum: req.Customer.OperatorNum,
}
customer.OperatorTime = time.Now()
// 调用dao层创建
err = dao.CreateCustomer(customer)
if err != nil {
res.Msg = "创建失败"
return res, err
}
res.Msg = "创建成功"
case "update": // 更新
// 参数校验
if req.Customer.CustomerID == "" {
res.Msg = "ID不能为空"
return res, errors.New("ID不能为空")
}
// 字段校验
if err := validateCustomerFields(req.Customer); err != nil {
res.Msg = err.Error()
return res, err
}
// 检查客户名称是否重复
exists, err := dao.CheckCustomerNameExists(req.Customer.CustomerName, req.Customer.CustomerID)
if err != nil {
res.Msg = "检查客户名称重复失败"
return res, err
}
if exists {
res.Msg = "客户名称重复"
return res, errors.New("客户名称重复")
}
// 构建model对象
customer := &model.Customer{
CustomerName: req.Customer.CustomerName,
AuthorizedRepresentative: req.Customer.AuthorizedRepresentative,
RegistrationAddress: req.Customer.RegistrationAddress,
ReferralPerson: req.Customer.ReferralPerson,
Operator: req.Customer.Operator,
OperatorID: req.Customer.OperatorID,
OperatorNum: req.Customer.OperatorNum,
}
customer.OperatorTime = time.Now()
customer.UpdatedAt = time.Now()
// 调用dao层更新
err = dao.UpdateCustomer(req.Customer.CustomerID, customer)
if err != nil {
res.Msg = "更新失败"
return res, err
}
res.Msg = "更新成功"
case "delete": // 删除
// 参数校验
if req.Customer.CustomerID == "" {
res.Msg = "客户ID不能为空"
return res, errors.New("客户ID不能为空")
}
// 调用dao层删除
err = dao.DeleteCustomer(req.Customer.CustomerID)
if err != nil {
res.Msg = "删除失败"
return res, err
}
res.Msg = "删除成功"
default:
res.Msg = "未知操作"
return res, errors.New("未知操作")
}
return res, nil
}
// GetReferralPersonList 查询所有不重复的推荐人列表
func GetReferralPersonList(req *bundle.ReferralPersonListRequest) (res *bundle.ReferralPersonListResponse, err error) {
res = new(bundle.ReferralPersonListResponse)
// 调用dao层查询不重复的推荐人
referralPersons, err := dao.GetDistinctReferralPersons(req.Keyword)
if err != nil {
res.Msg = "查询失败"
return res, err
}
res.List = referralPersons
res.Msg = "查询成功"
return res, nil
}

View File

@ -0,0 +1,120 @@
package logic
import (
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"strconv"
"github.com/samber/lo"
)
func CreateInvoice(req *bundle.CreateInvoiceReq) (*bundle.CreateInvoiceResp, error) {
res, err := dao.CreateInvoice(req)
if err != nil {
return nil, err
}
return res, nil
}
func CreatePaperInvoiceAddress(req *bundle.CreatePaperInvoiceAddressReq) (*bundle.CreatePaperInvoiceAddressResp, error) {
res, err := dao.CreatePaperInvoiceAddress(req)
if err != nil {
return nil, err
}
return res, nil
}
func GetInvoiceList(req *bundle.GetInvoiceListReq) (*bundle.GetInvoiceListResp, error) {
res := new(bundle.GetInvoiceListResp)
data, total, err := dao.GetInvoiceList(req)
if err != nil {
return nil, err
}
res.Total = total
res.Size = req.Size
res.Page = req.Page
res.Data = lo.Map(data, func(m *model.InvoiceInfo, _ int) *bundle.InvoiceInfo {
return &bundle.InvoiceInfo{
Name: m.Name,
Phone: m.TelAreaCode + m.Phone,
Country: m.Country,
Address: m.Address,
ApplyTime: m.ApplyTime,
UserName: m.UserName,
UserNum: m.UserNum,
OrderNo: m.OrderNo,
InvoiceNo: m.InvoiceNo,
InvoiceUrl: m.InvoiceUrl,
PaperInvocieStatus: m.PaperInvocieStatus,
}
})
return res, nil
}
func UpdateInvoiceExpressInfo(req *bundle.UpdateInvoiceExpressInfoReq) (*bundle.UpdateInvoiceExpressInfoResp, error) {
res, err := dao.UpdateInvoiceExpressInfo(req)
if err != nil {
return nil, err
}
return res, nil
}
func GetInvoiceExpressInfo(req *bundle.GetInvoiceExpressInfoReq) (*bundle.GetInvoiceExpressInfoResp, error) {
res, err := dao.GetInvoiceExpressInfo(req)
if err != nil {
return nil, err
}
return res, nil
}
func GetOrderInfoByOrderNo(req *bundle.GetOrderInfoByOrderNoReq) (*bundle.GetOrderInfoByOrderNoResp, error) {
res := new(bundle.GetOrderInfoByOrderNoResp)
orderRecord, err := dao.GetOrderInfoByOrderNo(req)
if err != nil {
return nil, err
}
res = &bundle.GetOrderInfoByOrderNoResp{
UserName: orderRecord.UserName,
UserId: strconv.FormatInt(orderRecord.UserId, 10),
UserNum: orderRecord.UserNum,
OrderNo: orderRecord.OrderNo,
TotalAmount: strconv.FormatFloat(float64(orderRecord.TotalAmount), 'f', -1, 64),
BundleName: orderRecord.BundleName,
AmountType: orderRecord.AmountType,
Address: orderRecord.Address,
Phone: orderRecord.Phone,
}
return res, nil
}
func GetInvoiceInfoByOrderNo(req *bundle.GetInvoiceInfoByOrderNoReq) (*bundle.GetInvoiceInfoByOrderNoResp, error) {
res := new(bundle.GetInvoiceInfoByOrderNoResp)
data, err := dao.GetInvoiceInfoByOrderNo(req)
if err != nil {
return nil, err
}
res.Data = lo.Map(data, func(m *model.InvoiceInfoByOrderNo, _ int) *bundle.InvoiceInfoByOrderNo {
return &bundle.InvoiceInfoByOrderNo{
OrderNo: m.OrderNo,
InvoiceNo: m.InvoiceNo,
InvoiceUrl: m.InvoiceUrl,
BundleName: m.BundleName,
AmountType: m.AmountType,
TotalAmount: strconv.FormatFloat(float64(m.TotalAmount), 'f', -1, 64),
PayTime: m.PayTime,
PaperInvocieStatus: m.PaperInvocieStatus,
}
})
return res, nil
}
func GetLastInvoiceNo(req *bundle.GetLastInvoiceNoReq) (*bundle.GetLastInvoiceNoResp, error) {
res := new(bundle.GetLastInvoiceNoResp)
lastNo, err := dao.GetLastInvoiceNo()
if err != nil {
return nil, err
}
res.LastNo = lastNo.InvoiceNo
return res, nil
}

View File

@ -1,9 +1,6 @@
package logic
import (
"errors"
"fmt"
uuid "github.com/satori/go.uuid"
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
@ -15,13 +12,7 @@ import (
func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
//orderUUID := app.ModuleClients.SfNode.Generate().Base64()
uuidV4, err := uuid.NewV4()
if err != nil {
fmt.Println("生成错误", err)
return nil, errors.New("生成uuid失败")
}
orderUUID := uuidV4.String()
orderUUID := app.ModuleClients.SfNode.Generate().Base64()
orderNo := utils.GetOrderNo()
if req.OrderNo != "" {
orderNo = req.OrderNo
@ -100,8 +91,6 @@ func UpdateOrderRecordByOrderNo(req *bundle.OrderRecord) (res *bundle.CommonResp
_ = copier.CopyWithOption(&orderRecord, req, copier.Option{DeepCopy: true})
orderRecord.UUID = req.Uuid
orderRecord.BundleUUID = req.BundleUuid
orderRecord.Status = req.Status
fmt.Println("UpdateOrderRecordByOrderNo Status:", req.Status)
res, err = dao.UpdateOrderRecordByOrderNO(orderRecord)
return
}
@ -200,20 +189,3 @@ func ReSignTheContract(req *bundle.ReSignTheContractRequest) (res *bundle.Common
res, err = dao.ReSignTheContract(req)
return
}
func UpdateOrderRecordByOrderUuid(req *bundle.OrderRecord) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
orderRecord := new(model.BundleOrderRecords)
_ = copier.CopyWithOption(&orderRecord, req, copier.Option{DeepCopy: true})
orderRecord.UUID = req.Uuid
orderRecord.BundleUUID = req.BundleUuid
orderRecord.Status = req.Status
fmt.Println("UpdateOrderRecordByOrderUuid Status:", req.Status)
res, err = dao.UpdateOrderRecordByOrderUuid(orderRecord)
return
}
func OrderListByOrderUuid(req *bundle.OrderInfoByOrderUuidRequest) (res *bundle.OrderInfoByOrderNoResp, err error) {
res = new(bundle.OrderInfoByOrderNoResp)
res, err = dao.OrderListByOrderUuid(req)
return
}

View File

@ -1,110 +0,0 @@
package model
import (
"time"
"gorm.io/plugin/soft_delete"
)
// 定义常量
const (
CurrencyTypeRMB = 1 // 人民币
CurrencyTypeUSD = 2 // 美元
CurrencyTypeJPY = 3 // 日元
)
// 维护周期
const (
MaintenanceCycleTypeYear = 1 // 年
MaintenanceCycleTypeHalfYear = 2 // 半年
MaintenanceCycleTypeQuarter = 3 // 季度
MaintenanceCycleTypeMonth = 4 // 月
)
// AttachmentItem 单个附件DB 中附件字段存的是该结构体数组的 JSON
type AttachmentItem struct {
URL string `json:"url"`
FileName string `json:"fileName"`
}
// 合同表
type Contract struct {
ContractUUID string `gorm:"column:contract_uuid;comment:合同UUID" json:"contractUUID"`
ContractName string `gorm:"column:contract_name;comment:合同名称" json:"contractName"`
ProjectName string `gorm:"column:project_name;comment:项目名称" json:"projectName"`
CustomerName string `gorm:"column:customer_name;comment:客户名称" json:"customerName"`
ContractorName string `gorm:"column:contractor_name;comment:承办商名称" json:"contractorName"`
SigningDate string `gorm:"column:signing_date;comment:签署日期" json:"signingDate"`
EffectiveDate string `gorm:"column:effective_date;comment:生效日期" json:"effectiveDate"`
// 合同总金额
ContractAmount float64 `json:"contractAmount" gorm:"column:contract_amount;type:decimal(18,4);comment:合同金额"`
ContractCurrencyType int `json:"contractCurrencyType" gorm:"column:contract_currency_type;type:int;comment:合同货币类型"`
ContractPaymentCycle string `gorm:"column:contract_payment_cycle;type:text;comment:支付周期" json:"contractPaymentCycle"` // 单独一个字段,用来存
DevelopmentCycle string `gorm:"column:development_cycle;type:text;comment:开发周期" json:"developmentCycle"` // 单独一个字段,用来存开发周期
// 维护费用
MaintenanceCycleType int `json:"maintenanceCycleType" gorm:"column:maintenance_cycle_type;type:int;comment:维护周期类型"`
MaintenanceFee float64 `json:"maintenanceFee" gorm:"column:maintenance_fee;type:decimal(18,4);comment:维护费用"`
MaintenanceCurrencyType int `json:"maintenanceCurrencyType" gorm:"column:maintenance_currency_type;type:int;comment:维护货币类型"`
// 质量保证金
QualityAssuranceFee float64 `json:"qualityAssuranceFee" gorm:"column:quality_assurance_fee;type:decimal(18,4);comment:质量保证金额"`
QualityAssuranceCurrencyType int `json:"qualityAssuranceCurrencyType" gorm:"column:quality_assurance_currency_type;type:int;comment:质量保证金货币类型"`
// 附件JSON 数组,每项为 {"url":"","fileName":""}
ContractAttachmentURLs string `gorm:"column:contract_attachment_urls;type:json;comment:合同附件(含url+fileName)" json:"contractAttachmentURLs"`
OtherAttachmentURLs string `gorm:"column:other_attachment_urls;type:json;comment:其他附件(含url+fileName)" json:"otherAttachmentURLs"`
Operator string `gorm:"column:operator;comment:操作人;index:idx_operator" json:"operator"`
OperatorID string `gorm:"column:operator_id;type:varchar(50);NOT NULL;default:'';comment:操作人ID" json:"operatorID"`
OperatorNum string `gorm:"column:operator_num;comment:操作人账号;index:idx_operator_num" json:"operatorNum"`
OperatorTime time.Time `gorm:"column:operator_time;comment:操作时间;index:idx_operator_time;" json:"operatorTime"`
PaymentCycles []ContractPaymentCycle `gorm:"foreignKey:ContractUUID;references:ContractUUID" json:"paymentCycles"`
DevelopmentCycles []DevelopmentCycle `gorm:"foreignKey:ContractUUID;references:ContractUUID" json:"developmentCycles"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_deleted_at" json:"deletedAt"`
}
func (c *Contract) TableName() string {
return "contract"
}
// 支付周期子表
type ContractPaymentCycle struct {
ContractPaymentCycleUUID string `gorm:"column:contract_payment_cycle_uuid;comment:合同支付周期UUID" json:"contractPaymentCycleUUID"`
ContractUUID string `gorm:"column:contract_uuid;comment:合同UUID" json:"contractUUID"`
PaymentCyclePeriod int `json:"paymentCyclePeriod" gorm:"column:payment_cycle_period;type:int;comment:支付周期第几期"`
DeliveryTime string `gorm:"column:delivery_time;type:text;comment:交付时间点" json:"deliveryTime"`
ContractPaymentCycleAmount float64 `json:"contractPaymentCycleAmount" gorm:"column:contract_payment_cycle_amount;type:decimal(18,4);comment:合同支付周期金额"`
PaymentCycleCurrencyType int `json:"paymentCycleCurrencyType" gorm:"column:payment_cycle_currency_type;type:int;comment:支付周期货币类型"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_deleted_at" json:"deletedAt"`
}
func (c *ContractPaymentCycle) TableName() string {
return "contract_payment_cycle"
}
// 开发周期子表
type DevelopmentCycle struct {
DevelopmentCycleUUID string `gorm:"column:development_cycle_uuid;comment:开发周期UUID" json:"developmentCycleUUID"`
ContractUUID string `gorm:"column:contract_uuid;comment:合同UUID" json:"contractUUID"`
DevelopmentPeriod int `json:"developmentPeriod" gorm:"column:development_period;type:int;comment:开发第几期"`
DevelopmentTime string `gorm:"column:development_time;type:text;comment:开发时间" json:"developmentTime"`
// 附件JSON 数组,每项为 {"url":"","fileName":""}
AttachmentURLs string `gorm:"column:attachment_urls;type:json;comment:附件(含url+fileName)" json:"attachmentURLs"`
DeliveryContent string `gorm:"column:delivery_content;type:text;comment:交付内容" json:"deliveryContent"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_deleted_at" json:"deletedAt"`
}
func (d *DevelopmentCycle) TableName() string {
return "contract_development_cycle"
}

View File

@ -1,27 +0,0 @@
package model
import (
"time"
"gorm.io/plugin/soft_delete"
)
// 客户表
type Customer struct {
CustomerID string `gorm:"column:customer_id;type:varchar(50);NOT NULL;primarykey;comment:客户ID" json:"customerID"`
CustomerName string `gorm:"column:customer_name;comment:客户名称;uniqueIndex:idx_customer_name_deleted,priority:1" json:"customerName"`
AuthorizedRepresentative string `gorm:"column:authorized_representative;comment:授权代表" json:"authorizedRepresentative"`
RegistrationAddress string `gorm:"column:registration_address;comment:注册地址" json:"registrationAddress"`
ReferralPerson string `gorm:"column:referral_person;comment:推荐人;index:idx_referral_person" json:"referralPerson"` // 增加索引
Operator string `gorm:"column:operator;comment:操作人;index:idx_operator" json:"operator"`
OperatorID string `gorm:"column:operator_id;type:varchar(50);NOT NULL;default:'';comment:操作人ID" json:"operatorID"`
OperatorNum string `gorm:"column:operator_num;comment:操作人账号;index:idx_operator_num" json:"operatorNum"`
OperatorTime time.Time `gorm:"column:operator_time;comment:操作时间;index:idx_operator_time;" json:"operatorTime"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_deleted_at;uniqueIndex:idx_customer_name_deleted,priority:2" json:"deletedAt"`
}
func (c *Customer) TableName() string {
return "customer"
}

92
internal/model/invoice.go Normal file
View File

@ -0,0 +1,92 @@
package model
import (
"time"
"gorm.io/plugin/soft_delete"
)
// 发票主表
type Invoice struct {
ID int64 `gorm:"primarykey"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11)" json:"deletedAt"`
UserId int `gorm:"column:user_id;comment:用户ID"`
UserNum string `gorm:"column:user_num;comment:用户编号"`
UserName string `gorm:"column:user_name;comment:用户名称"`
OrderNo string `gorm:"column:order_no;comment:订单编号"`
ApplyTime time.Time `gorm:"column:apply_time;comment:申请时间"`
InvoiceType int `gorm:"column:invoice_type;comment:发票类型 1基础类型"`
InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"`
InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"`
PaperInvocieStatus int `gorm:"column:paper_invocie_status;default:1;comment:纸质发票状态1未申请 2已申请 3已邮寄"`
Remark string `gorm:"column:remark;comment:备注"`
}
func (i *Invoice) TableName() string {
return "invoice"
}
// 纸质发票地址
type PaperInvoiceAddress struct {
ID int64 `gorm:"primarykey"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11)" json:"deletedAt"`
UserId int `gorm:"column:user_id;comment:用户ID"`
ApplyTime time.Time `gorm:"column:apply_time;comment:申请时间"`
OrderNo string `gorm:"column:order_no;comment:订单编号"`
InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"`
Name string `gorm:"column:name;comment:申请纸质发票姓名"`
TelAreaCode string `gorm:"column:tel_area_code;comment:申请纸质发票电话区号"`
Phone string `gorm:"column:phone;comment:申请纸质发票电话"`
PostalCode string `gorm:"column:postal_code;type:varchar(20);comment:申请纸质发票邮政编码"`
Country string `gorm:"column:country;comment:申请纸质发票国家"`
Address string `gorm:"column:address;comment:详细地址"`
ExpressCompany string `gorm:"column:express_company;comment:快递公司"`
ExpressNo string `gorm:"column:express_no;comment:快递单号"`
Remark string `gorm:"column:remark;comment:备注"`
}
func (p *PaperInvoiceAddress) TableName() string {
return "paper_invoice_address"
}
type InvoiceInfo struct {
Name string `gorm:"column:name;comment:姓名"`
TelAreaCode string `gorm:"column:tel_area_code;comment:电话区号"`
Phone string `gorm:"column:phone;comment:电话"`
Country string `gorm:"column:country;comment:国家"`
Address string `gorm:"column:address;comment:地址"`
ApplyTime string `gorm:"column:apply_time;comment:申请时间"`
UserName string `gorm:"column:user_name;comment:用户名称"`
UserNum string `gorm:"column:user_num;comment:用户编号"`
OrderNo string `gorm:"column:order_no;comment:订单编号"`
InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"`
InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"`
PaperInvocieStatus int64 `gorm:"column:paper_invocie_status;comment:纸质发票状态"`
}
type InvoiceOrderInfo struct {
UserName string `gorm:"column:user_name;comment:用户名称"`
UserId int64 `gorm:"column:user_id;comment:用户ID"`
UserNum string `gorm:"column:user_num;comment:用户编号"`
OrderNo string `gorm:"column:order_no;comment:订单编号"`
AmountType int64 `gorm:"column:amount_type;comment:金额类型 1:人民币 2:美元"`
TotalAmount float32 `gorm:"column:total_amount;comment:总金额"`
BundleName string `gorm:"column:bundle_name;comment:套餐名称"`
Address string `gorm:"column:address;comment:地址"`
Phone string `gorm:"column:phone;comment:电话"`
}
type InvoiceInfoByOrderNo struct {
OrderNo string `gorm:"column:order_no;comment:订单编号"`
InvoiceNo string `gorm:"column:invoice_no;comment:发票编号"`
InvoiceUrl string `gorm:"column:invoice_url;comment:发票URL"`
BundleName string `gorm:"column:bundle_name;comment:套餐名称"`
AmountType int64 `gorm:"column:amount_type;comment:金额类型 1:人民币 2:美元"`
TotalAmount float32 `gorm:"column:total_amount;comment:总金额"`
PayTime string `gorm:"column:pay_time;comment:支付时间"`
PaperInvocieStatus int64 `gorm:"column:paper_invocie_status;comment:纸质发票状态 1:未申请 2:已申请 3:已邮寄"`
}

View File

@ -113,25 +113,18 @@ service Bundle {
rpc MetricsVideoSubmitExport(MetricsVideoSubmitExportReq) returns (MetricsVideoSubmitExportResp) {}
rpc QueryTheOrderSnapshotInformation(QueryTheOrderSnapshotInformationReq) returns (QueryTheOrderSnapshotInformationResp) {}
//
rpc CreateInvoice(CreateInvoiceReq) returns (CreateInvoiceResp) {}//
rpc CreatePaperInvoiceAddress(CreatePaperInvoiceAddressReq) returns (CreatePaperInvoiceAddressResp) {}//
rpc GetInvoiceList(GetInvoiceListReq) returns (GetInvoiceListResp) {}//
rpc UpdateInvoiceExpressInfo(UpdateInvoiceExpressInfoReq) returns (UpdateInvoiceExpressInfoResp) {}//
rpc GetInvoiceExpressInfo(GetInvoiceExpressInfoReq) returns (GetInvoiceExpressInfoResp) {}//
rpc GetOrderInfoByOrderNo(GetOrderInfoByOrderNoReq) returns (GetOrderInfoByOrderNoResp) {}//
rpc GetInvoiceInfoByOrderNo(GetInvoiceInfoByOrderNoReq) returns (GetInvoiceInfoByOrderNoResp) {}//
rpc GetLastInvoiceNo(GetLastInvoiceNoReq) returns (GetLastInvoiceNoResp) {}//
//
rpc ExportWorkCastInfo(ExportWorkCastInfoReq) returns (ExportWorkCastInfoResp) {}
//
rpc GetCustomerList(CustomerListRequest) returns (CustomerListResponse) {} //
rpc GetCustomerDetail(CustomerDetailRequest) returns (CustomerDetailResponse) {} // ID查询客户详情
rpc UpdateCustomer(CustomerUpdateRequest) returns (ComResponse) {} // action判断新增//
rpc GetReferralPersonList(ReferralPersonListRequest) returns (ReferralPersonListResponse) {} //
//
rpc UpdateContract(ContractUpdateRequest) returns (ComResponse) {} // action判断新增//
rpc GetContractList(ContractListRequest) returns (ContractListResponse) {} //
rpc GetContractDetail(ContractDetailRequest) returns (ContractDetailResponse) {} // UUID查询详情
rpc GetDevelopmentCyclesByContractUUID(GetDevelopmentCyclesByContractUUIDRequest) returns (GetDevelopmentCyclesByContractUUIDResponse) {} // UUID查询开发周期
rpc GetPaymentCyclesByContractUUID(GetPaymentCyclesByContractUUIDRequest) returns (GetPaymentCyclesByContractUUIDResponse) {} // UUID查询支付周期
rpc UpdateOrderRecordByOrderUuid(OrderRecord) returns (CommonResponse) {}
rpc OrderListByOrderUuid(OrderInfoByOrderUuidRequest) returns (OrderInfoByOrderNoResp) {}
}
message QueryTheOrderSnapshotInformationReq{
string orderNo = 1;
@ -1681,11 +1674,11 @@ message MetricsBusinessResp {
string finalPaymentAmount = 4; //
string totalFeePaymentAmount = 5; //
string newBundlePaymentAmount = 6; //
string newIncreasePaymentAmount = 7; //
string newPaymentAmount = 8; //
string newFinalPaymentAmount = 9; //
string newFeePaymentAmount = 10; //
float newBundlePaymentAmount = 6; //
float newIncreasePaymentAmount = 7; //
float newPaymentAmount = 8; //
float newFinalPaymentAmount = 9; //
float newFeePaymentAmount = 10; //
// ====== ======
int64 newBundleCount = 11; //
@ -1908,208 +1901,108 @@ message MetricsBalanceDetailExportReq{
string month = 1;
}
//
//
message CustomerListRequest {
string customerName = 1 [json_name = "customerName"]; //
string referralPerson = 2 [json_name = "referralPerson"]; //
int32 page = 3 [json_name = "page"]; //
int32 pageSize = 4 [json_name = "pageSize"]; //
message CreateInvoiceReq{
string userId = 1;
string userNum = 2;
string userName = 3;
string orderNo = 4;
string applyTime = 5;
int32 invoiceType = 6;
string invoiceNo = 7;
string invoiceUrl = 8;
int64 paperInvocieStatus = 9;
string remark = 10;
}
//
message CustomerListResponse {
repeated CustomerInfo list = 1 [json_name = "list"]; //
int64 total = 2 [json_name = "total"]; //
int32 page = 3 [json_name = "page"]; //
int32 pageSize = 4 [json_name = "pageSize"]; //
message CreateInvoiceResp{
}
//
message CustomerDetailRequest {
string customerID = 1 [json_name = "customerID"]; // ID
message CreatePaperInvoiceAddressReq{
string userId = 1;
string orderNo = 2;
string invoiceNo = 3;
string applyTime = 4;
string name = 5;
string telAreaCode = 6;
string phone = 7;
string postalCode = 8;
string country = 9;
string address = 10;
string remark = 11;
}
//
message CustomerDetailResponse {
Customer customer = 1 [json_name = "customer"]; //
string msg = 2 [json_name = "msg"]; //
message CreatePaperInvoiceAddressResp{
}
// action判断新增//
message CustomerUpdateRequest {
string action = 1 [json_name = "action"]; // create=update=delete=
Customer Customer = 2 [json_name = "customer"]; // customerID
message InvoiceInfo{
string name = 1;
string phone = 2;
string country = 3;
string address = 4;
string applyTime = 5;
string userName = 6;
string userNum = 7;
string orderNo = 8;
string invoiceNo = 9;
string invoiceUrl = 10;
int64 paperInvocieStatus = 11;
}
//
message CustomerInfo {
string customerID = 1 [json_name = "customerID"]; // ID
string customerName = 2 [json_name = "customerName"]; //
string authorizedRepresentative = 3 [json_name = "authorizedRepresentative"]; //
string registrationAddress = 4 [json_name = "registrationAddress"]; //
string referralPerson = 6 [json_name = "referralPerson"]; //
string operator = 7 [json_name = "operator"]; //
string operatorTime = 10 [json_name = "operatorTime"]; //
message GetInvoiceListReq{
int64 size = 1;
int64 page = 2;
int64 isApplyInvocice = 3;
int64 isExpress = 4;
string applyTimeStart = 5;
string applyTimeEnd = 6;
string name = 7;
string phone = 8;
string country = 9;
string userName = 10;
}
message Customer {
string customerID = 1 [json_name = "customerID"]; // ID
string customerName = 2 [json_name = "customerName"]; //
string authorizedRepresentative = 3 [json_name = "authorizedRepresentative"]; //
string registrationAddress = 4 [json_name = "registrationAddress"]; //
string referralPerson = 6 [json_name = "referralPerson"]; //
string operator = 7 [json_name = "operator"]; //
string operatorID = 8 [json_name = "operatorID"]; // ID
string operatorNum = 9 [json_name = "operatorNum"]; //
string operatorTime = 10 [json_name = "operatorTime"]; //
string createdAt = 11 [json_name = "createdAt"]; //
string updatedAt = 12 [json_name = "updatedAt"]; //
message GetInvoiceListResp{
repeated InvoiceInfo data = 1;
int64 total = 2;
int64 page = 3;
int64 size = 4;
}
//
message ReferralPersonListRequest {
string keyword = 1 [json_name = "keyword"]; //
message UpdateInvoiceExpressInfoReq{
string orderNo = 1;
string expressCompany = 2;
string expressNo = 3;
string remark = 4;
}
//
message ReferralPersonListResponse {
repeated string list = 1 [json_name = "list"]; //
string msg = 2 [json_name = "msg"]; //
message UpdateInvoiceExpressInfoResp{
}
//
message ContractUpdateRequest {
string action = 1 [json_name = "action"]; // create=update=delete=
Contract contract = 2 [json_name = "contract"]; // contractUUID
message GetInvoiceExpressInfoReq{
string orderNo = 1;
}
//
message ContractListRequest {
string contractName = 1 [json_name = "contractName"]; //
string projectName = 2 [json_name = "projectName"]; //
string customerName = 3 [json_name = "customerName"]; //
int32 page = 4 [json_name = "page"]; //
int32 pageSize = 5 [json_name = "pageSize"]; //
message GetInvoiceExpressInfoResp{
string expressCompany = 1;
string expressNo = 2;
string remark = 3;
}
//
message ContractListResponse {
repeated ContractInfo list = 1 [json_name = "list"]; //
int64 total = 2 [json_name = "total"]; //
int32 page = 3 [json_name = "page"]; //
int32 pageSize = 4 [json_name = "pageSize"]; //
message GetOrderInfoByOrderNoReq{
string uuid = 1;
}
//
message ContractDetailRequest {
string contractUUID = 1 [json_name = "contractUUID"]; // UUID
}
//
message ContractDetailResponse {
Contract contract = 1 [json_name = "contract"]; //
string msg = 2 [json_name = "msg"]; //
}
// UUID查询开发周期请求
message GetDevelopmentCyclesByContractUUIDRequest {
string contractUUID = 1 [json_name = "contractUUID"]; // UUID
}
// UUID查询开发周期响应
message GetDevelopmentCyclesByContractUUIDResponse {
repeated DevelopmentCycle list = 1 [json_name = "list"]; //
string msg = 2 [json_name = "msg"]; //
}
// UUID查询支付周期请求
message GetPaymentCyclesByContractUUIDRequest {
string contractUUID = 1 [json_name = "contractUUID"]; // UUID
}
// UUID查询支付周期响应
message GetPaymentCyclesByContractUUIDResponse {
repeated ContractPaymentCycle list = 1 [json_name = "list"]; //
string msg = 2 [json_name = "msg"]; //
}
// URL
message AttachmentItem {
string url = 1 [json_name = "url"]; //
string fileName = 2 [json_name = "fileName"]; //
}
//
message ContractInfo {
string contractUUID = 1 [json_name = "contractUUID"]; // UUID
string contractName = 2 [json_name = "contractName"]; //
string projectName = 3 [json_name = "projectName"]; //
string customerName = 4 [json_name = "customerName"]; //
string contractorName = 5 [json_name = "contractorName"]; //
string signingDate = 6 [json_name = "signingDate"]; //
string effectiveDate = 7 [json_name = "effectiveDate"]; //
double contractAmount = 8 [json_name = "contractAmount"]; //
int32 contractCurrencyType = 9 [json_name = "contractCurrencyType"]; //
string contractPaymentCycle = 10 [json_name = "contractPaymentCycle"]; //
string developmentCycle = 11 [json_name = "developmentCycle"]; //
double qualityAssuranceFee = 12 [json_name = "qualityAssuranceFee"]; //
int32 qualityAssuranceCurrencyType = 13 [json_name = "qualityAssuranceCurrencyType"]; //
int32 maintenanceCycleType = 14 [json_name = "maintenanceCycleType"]; //
double maintenanceFee = 15 [json_name = "maintenanceFee"]; //
int32 maintenanceCurrencyType = 16 [json_name = "maintenanceCurrencyType"]; //
repeated AttachmentItem contractAttachments = 17 [json_name = "contractAttachments"]; // url+fileName
repeated AttachmentItem otherAttachments = 18 [json_name = "otherAttachments"]; // url+fileName
string operator = 19 [json_name = "operator"]; //
string operatorTime = 22 [json_name = "operatorTime"]; //
}
//
message Contract {
string contractUUID = 1 [json_name = "contractUUID"]; // UUID
string contractName = 2 [json_name = "contractName"]; //
string projectName = 3 [json_name = "projectName"]; //
string customerName = 4 [json_name = "customerName"]; //
string contractorName = 5 [json_name = "contractorName"]; //
string signingDate = 6 [json_name = "signingDate"]; //
string effectiveDate = 7 [json_name = "effectiveDate"]; //
double contractAmount = 8 [json_name = "contractAmount"]; //
int32 contractCurrencyType = 9 [json_name = "contractCurrencyType"]; //
string contractPaymentCycle = 10 [json_name = "contractPaymentCycle"]; //
string developmentCycle = 11 [json_name = "developmentCycle"]; //
int64 maintenanceCycleType = 12 [json_name = "maintenanceCycleType"]; //
double maintenanceFee = 13 [json_name = "maintenanceFee"]; //
int32 maintenanceCurrencyType = 14 [json_name = "maintenanceCurrencyType"]; //
double qualityAssuranceFee = 15 [json_name = "qualityAssuranceFee"]; //
int32 qualityAssuranceCurrencyType = 16 [json_name = "qualityAssuranceCurrencyType"]; //
repeated AttachmentItem contractAttachments = 17 [json_name = "contractAttachments"]; // url+fileName
repeated AttachmentItem otherAttachments = 18 [json_name = "otherAttachments"]; // url+fileName
string operator = 19 [json_name = "operator"]; //
string operatorID = 20 [json_name = "operatorID"]; // ID
string operatorNum = 21 [json_name = "operatorNum"]; //
string operatorTime = 23 [json_name = "operatorTime"]; //
repeated ContractPaymentCycle paymentCycles = 24 [json_name = "paymentCycles"]; //
repeated DevelopmentCycle developmentCycles = 25 [json_name = "developmentCycles"]; //
}
//
message ContractPaymentCycle {
string contractPaymentCycleUUID = 1 [json_name = "contractPaymentCycleUUID"]; // UUID
string contractUUID = 2 [json_name = "contractUUID"]; // UUID
int32 paymentCyclePeriod = 3 [json_name = "paymentCyclePeriod"]; //
string deliveryTime = 4 [json_name = "deliveryTime"]; //
double contractPaymentCycleAmount = 5 [json_name = "contractPaymentCycleAmount"]; //
int32 paymentCycleCurrencyType = 6 [json_name = "paymentCycleCurrencyType"]; //
}
//
message DevelopmentCycle {
string developmentCycleUUID = 1 [json_name = "developmentCycleUUID"]; // UUID
string contractUUID = 2 [json_name = "contractUUID"]; // UUID
int32 developmentPeriod = 3 [json_name = "developmentPeriod"]; //
string developmentTime = 4 [json_name = "developmentTime"]; //
repeated AttachmentItem attachments = 5 [json_name = "attachments"]; // url+fileName
string deliveryContent = 6 [json_name = "deliveryContent"]; //
message GetOrderInfoByOrderNoResp{
string userName = 1;
string userId = 2;
string userNum = 3;
string totalAmount = 4;
string bundleName = 5;
int64 AmountType = 6;
string address = 7;
string phone = 8;
string orderNo = 9;
}
message WorkCastInfo{
@ -2123,7 +2016,6 @@ message WorkCastInfo{
string submitTime = 8;
string waitingTime = 9;
string confirmTime = 10;
int64 confirmType = 11;
}
message ExportWorkCastInfoReq{
@ -2134,6 +2026,29 @@ message ExportWorkCastInfoReq{
message ExportWorkCastInfoResp{
repeated WorkCastInfo data = 1;
}
message OrderInfoByOrderUuidRequest{
string orderUuid = 1;
message GetInvoiceInfoByOrderNoReq{
string userId = 1;
}
message InvoiceInfoByOrderNo{
string orderNo = 1;
string invoiceNo = 2;
string invoiceUrl = 3;
string bundleName = 4;
int64 amountType = 5;
string totalAmount = 6;
string payTime = 7;
int64 paperInvocieStatus = 8;
}
message GetInvoiceInfoByOrderNoResp{
repeated InvoiceInfoByOrderNo data = 1;
}
message GetLastInvoiceNoReq{
}
message GetLastInvoiceNoResp{
string lastNo = 1;
}

File diff suppressed because it is too large Load Diff

View File

@ -5,11 +5,11 @@ package bundle
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/protobuf/types/descriptorpb"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/descriptorpb"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -812,170 +812,50 @@ func (this *MetricsVideoSubmitExportItem) Validate() error {
func (this *MetricsBalanceDetailExportReq) Validate() error {
return nil
}
func (this *CustomerListRequest) Validate() error {
func (this *CreateInvoiceReq) Validate() error {
return nil
}
func (this *CustomerListResponse) Validate() error {
for _, item := range this.List {
func (this *CreateInvoiceResp) Validate() error {
return nil
}
func (this *CreatePaperInvoiceAddressReq) Validate() error {
return nil
}
func (this *CreatePaperInvoiceAddressResp) Validate() error {
return nil
}
func (this *InvoiceInfo) Validate() error {
return nil
}
func (this *GetInvoiceListReq) Validate() error {
return nil
}
func (this *GetInvoiceListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *CustomerDetailRequest) Validate() error {
func (this *UpdateInvoiceExpressInfoReq) Validate() error {
return nil
}
func (this *CustomerDetailResponse) Validate() error {
if this.Customer != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Customer); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Customer", err)
}
}
func (this *UpdateInvoiceExpressInfoResp) Validate() error {
return nil
}
func (this *CustomerUpdateRequest) Validate() error {
if this.Customer != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Customer); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Customer", err)
}
}
func (this *GetInvoiceExpressInfoReq) Validate() error {
return nil
}
func (this *CustomerInfo) Validate() error {
func (this *GetInvoiceExpressInfoResp) Validate() error {
return nil
}
func (this *Customer) Validate() error {
func (this *GetOrderInfoByOrderNoReq) Validate() error {
return nil
}
func (this *ReferralPersonListRequest) Validate() error {
return nil
}
func (this *ReferralPersonListResponse) Validate() error {
return nil
}
func (this *ContractUpdateRequest) Validate() error {
if this.Contract != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Contract); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Contract", err)
}
}
return nil
}
func (this *ContractListRequest) Validate() error {
return nil
}
func (this *ContractListResponse) Validate() error {
for _, item := range this.List {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
}
}
}
return nil
}
func (this *ContractDetailRequest) Validate() error {
return nil
}
func (this *ContractDetailResponse) Validate() error {
if this.Contract != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Contract); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Contract", err)
}
}
return nil
}
func (this *GetDevelopmentCyclesByContractUUIDRequest) Validate() error {
return nil
}
func (this *GetDevelopmentCyclesByContractUUIDResponse) Validate() error {
for _, item := range this.List {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
}
}
}
return nil
}
func (this *GetPaymentCyclesByContractUUIDRequest) Validate() error {
return nil
}
func (this *GetPaymentCyclesByContractUUIDResponse) Validate() error {
for _, item := range this.List {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
}
}
}
return nil
}
func (this *AttachmentItem) Validate() error {
return nil
}
func (this *ContractInfo) Validate() error {
for _, item := range this.ContractAttachments {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ContractAttachments", err)
}
}
}
for _, item := range this.OtherAttachments {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OtherAttachments", err)
}
}
}
return nil
}
func (this *Contract) Validate() error {
for _, item := range this.ContractAttachments {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ContractAttachments", err)
}
}
}
for _, item := range this.OtherAttachments {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OtherAttachments", err)
}
}
}
for _, item := range this.PaymentCycles {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PaymentCycles", err)
}
}
}
for _, item := range this.DevelopmentCycles {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("DevelopmentCycles", err)
}
}
}
return nil
}
func (this *ContractPaymentCycle) Validate() error {
return nil
}
func (this *DevelopmentCycle) Validate() error {
for _, item := range this.Attachments {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Attachments", err)
}
}
}
func (this *GetOrderInfoByOrderNoResp) Validate() error {
return nil
}
func (this *WorkCastInfo) Validate() error {
@ -994,6 +874,25 @@ func (this *ExportWorkCastInfoResp) Validate() error {
}
return nil
}
func (this *OrderInfoByOrderUuidRequest) Validate() error {
func (this *GetInvoiceInfoByOrderNoReq) Validate() error {
return nil
}
func (this *InvoiceInfoByOrderNo) Validate() error {
return nil
}
func (this *GetInvoiceInfoByOrderNoResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *GetLastInvoiceNoReq) Validate() error {
return nil
}
func (this *GetLastInvoiceNoResp) Validate() error {
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 v5.26.1
// - protoc-gen-go-triple v1.0.5
// - protoc v5.26.0
// source: pb/bundle.proto
package bundle
@ -119,21 +119,17 @@ type BundleClient interface {
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment)
// 发票管理
CreateInvoice(ctx context.Context, in *CreateInvoiceReq, opts ...grpc_go.CallOption) (*CreateInvoiceResp, common.ErrorWithAttachment)
CreatePaperInvoiceAddress(ctx context.Context, in *CreatePaperInvoiceAddressReq, opts ...grpc_go.CallOption) (*CreatePaperInvoiceAddressResp, common.ErrorWithAttachment)
GetInvoiceList(ctx context.Context, in *GetInvoiceListReq, opts ...grpc_go.CallOption) (*GetInvoiceListResp, common.ErrorWithAttachment)
UpdateInvoiceExpressInfo(ctx context.Context, in *UpdateInvoiceExpressInfoReq, opts ...grpc_go.CallOption) (*UpdateInvoiceExpressInfoResp, common.ErrorWithAttachment)
GetInvoiceExpressInfo(ctx context.Context, in *GetInvoiceExpressInfoReq, opts ...grpc_go.CallOption) (*GetInvoiceExpressInfoResp, common.ErrorWithAttachment)
GetOrderInfoByOrderNo(ctx context.Context, in *GetOrderInfoByOrderNoReq, opts ...grpc_go.CallOption) (*GetOrderInfoByOrderNoResp, common.ErrorWithAttachment)
GetInvoiceInfoByOrderNo(ctx context.Context, in *GetInvoiceInfoByOrderNoReq, opts ...grpc_go.CallOption) (*GetInvoiceInfoByOrderNoResp, common.ErrorWithAttachment)
GetLastInvoiceNo(ctx context.Context, in *GetLastInvoiceNoReq, opts ...grpc_go.CallOption) (*GetLastInvoiceNoResp, common.ErrorWithAttachment)
// 临时接口
ExportWorkCastInfo(ctx context.Context, in *ExportWorkCastInfoReq, opts ...grpc_go.CallOption) (*ExportWorkCastInfoResp, common.ErrorWithAttachment)
// 客户管理
GetCustomerList(ctx context.Context, in *CustomerListRequest, opts ...grpc_go.CallOption) (*CustomerListResponse, common.ErrorWithAttachment)
GetCustomerDetail(ctx context.Context, in *CustomerDetailRequest, opts ...grpc_go.CallOption) (*CustomerDetailResponse, common.ErrorWithAttachment)
UpdateCustomer(ctx context.Context, in *CustomerUpdateRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
GetReferralPersonList(ctx context.Context, in *ReferralPersonListRequest, opts ...grpc_go.CallOption) (*ReferralPersonListResponse, common.ErrorWithAttachment)
// 合同管理
UpdateContract(ctx context.Context, in *ContractUpdateRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
GetContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListResponse, common.ErrorWithAttachment)
GetContractDetail(ctx context.Context, in *ContractDetailRequest, opts ...grpc_go.CallOption) (*ContractDetailResponse, common.ErrorWithAttachment)
GetDevelopmentCyclesByContractUUID(ctx context.Context, in *GetDevelopmentCyclesByContractUUIDRequest, opts ...grpc_go.CallOption) (*GetDevelopmentCyclesByContractUUIDResponse, common.ErrorWithAttachment)
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)
}
type bundleClient struct {
@ -224,18 +220,15 @@ type BundleClientImpl struct {
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
QueryTheOrderSnapshotInformation func(ctx context.Context, in *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
CreateInvoice func(ctx context.Context, in *CreateInvoiceReq) (*CreateInvoiceResp, error)
CreatePaperInvoiceAddress func(ctx context.Context, in *CreatePaperInvoiceAddressReq) (*CreatePaperInvoiceAddressResp, error)
GetInvoiceList func(ctx context.Context, in *GetInvoiceListReq) (*GetInvoiceListResp, error)
UpdateInvoiceExpressInfo func(ctx context.Context, in *UpdateInvoiceExpressInfoReq) (*UpdateInvoiceExpressInfoResp, error)
GetInvoiceExpressInfo func(ctx context.Context, in *GetInvoiceExpressInfoReq) (*GetInvoiceExpressInfoResp, error)
GetOrderInfoByOrderNo func(ctx context.Context, in *GetOrderInfoByOrderNoReq) (*GetOrderInfoByOrderNoResp, error)
GetInvoiceInfoByOrderNo func(ctx context.Context, in *GetInvoiceInfoByOrderNoReq) (*GetInvoiceInfoByOrderNoResp, error)
GetLastInvoiceNo func(ctx context.Context, in *GetLastInvoiceNoReq) (*GetLastInvoiceNoResp, error)
ExportWorkCastInfo func(ctx context.Context, in *ExportWorkCastInfoReq) (*ExportWorkCastInfoResp, error)
GetCustomerList func(ctx context.Context, in *CustomerListRequest) (*CustomerListResponse, error)
GetCustomerDetail func(ctx context.Context, in *CustomerDetailRequest) (*CustomerDetailResponse, error)
UpdateCustomer func(ctx context.Context, in *CustomerUpdateRequest) (*ComResponse, error)
GetReferralPersonList func(ctx context.Context, in *ReferralPersonListRequest) (*ReferralPersonListResponse, error)
UpdateContract func(ctx context.Context, in *ContractUpdateRequest) (*ComResponse, error)
GetContractList func(ctx context.Context, in *ContractListRequest) (*ContractListResponse, error)
GetContractDetail func(ctx context.Context, in *ContractDetailRequest) (*ContractDetailResponse, error)
GetDevelopmentCyclesByContractUUID func(ctx context.Context, in *GetDevelopmentCyclesByContractUUIDRequest) (*GetDevelopmentCyclesByContractUUIDResponse, error)
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)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -748,78 +741,60 @@ func (c *bundleClient) QueryTheOrderSnapshotInformation(ctx context.Context, in
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/QueryTheOrderSnapshotInformation", in, out)
}
func (c *bundleClient) CreateInvoice(ctx context.Context, in *CreateInvoiceReq, opts ...grpc_go.CallOption) (*CreateInvoiceResp, common.ErrorWithAttachment) {
out := new(CreateInvoiceResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateInvoice", in, out)
}
func (c *bundleClient) CreatePaperInvoiceAddress(ctx context.Context, in *CreatePaperInvoiceAddressReq, opts ...grpc_go.CallOption) (*CreatePaperInvoiceAddressResp, common.ErrorWithAttachment) {
out := new(CreatePaperInvoiceAddressResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreatePaperInvoiceAddress", in, out)
}
func (c *bundleClient) GetInvoiceList(ctx context.Context, in *GetInvoiceListReq, opts ...grpc_go.CallOption) (*GetInvoiceListResp, common.ErrorWithAttachment) {
out := new(GetInvoiceListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetInvoiceList", in, out)
}
func (c *bundleClient) UpdateInvoiceExpressInfo(ctx context.Context, in *UpdateInvoiceExpressInfoReq, opts ...grpc_go.CallOption) (*UpdateInvoiceExpressInfoResp, common.ErrorWithAttachment) {
out := new(UpdateInvoiceExpressInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateInvoiceExpressInfo", in, out)
}
func (c *bundleClient) GetInvoiceExpressInfo(ctx context.Context, in *GetInvoiceExpressInfoReq, opts ...grpc_go.CallOption) (*GetInvoiceExpressInfoResp, common.ErrorWithAttachment) {
out := new(GetInvoiceExpressInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetInvoiceExpressInfo", in, out)
}
func (c *bundleClient) GetOrderInfoByOrderNo(ctx context.Context, in *GetOrderInfoByOrderNoReq, opts ...grpc_go.CallOption) (*GetOrderInfoByOrderNoResp, common.ErrorWithAttachment) {
out := new(GetOrderInfoByOrderNoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetOrderInfoByOrderNo", in, out)
}
func (c *bundleClient) GetInvoiceInfoByOrderNo(ctx context.Context, in *GetInvoiceInfoByOrderNoReq, opts ...grpc_go.CallOption) (*GetInvoiceInfoByOrderNoResp, common.ErrorWithAttachment) {
out := new(GetInvoiceInfoByOrderNoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetInvoiceInfoByOrderNo", in, out)
}
func (c *bundleClient) GetLastInvoiceNo(ctx context.Context, in *GetLastInvoiceNoReq, opts ...grpc_go.CallOption) (*GetLastInvoiceNoResp, common.ErrorWithAttachment) {
out := new(GetLastInvoiceNoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetLastInvoiceNo", in, out)
}
func (c *bundleClient) ExportWorkCastInfo(ctx context.Context, in *ExportWorkCastInfoReq, opts ...grpc_go.CallOption) (*ExportWorkCastInfoResp, common.ErrorWithAttachment) {
out := new(ExportWorkCastInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ExportWorkCastInfo", in, out)
}
func (c *bundleClient) GetCustomerList(ctx context.Context, in *CustomerListRequest, opts ...grpc_go.CallOption) (*CustomerListResponse, common.ErrorWithAttachment) {
out := new(CustomerListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetCustomerList", in, out)
}
func (c *bundleClient) GetCustomerDetail(ctx context.Context, in *CustomerDetailRequest, opts ...grpc_go.CallOption) (*CustomerDetailResponse, common.ErrorWithAttachment) {
out := new(CustomerDetailResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetCustomerDetail", in, out)
}
func (c *bundleClient) UpdateCustomer(ctx context.Context, in *CustomerUpdateRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment) {
out := new(ComResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateCustomer", in, out)
}
func (c *bundleClient) GetReferralPersonList(ctx context.Context, in *ReferralPersonListRequest, opts ...grpc_go.CallOption) (*ReferralPersonListResponse, common.ErrorWithAttachment) {
out := new(ReferralPersonListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetReferralPersonList", in, out)
}
func (c *bundleClient) UpdateContract(ctx context.Context, in *ContractUpdateRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment) {
out := new(ComResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateContract", in, out)
}
func (c *bundleClient) GetContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListResponse, common.ErrorWithAttachment) {
out := new(ContractListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetContractList", in, out)
}
func (c *bundleClient) GetContractDetail(ctx context.Context, in *ContractDetailRequest, opts ...grpc_go.CallOption) (*ContractDetailResponse, common.ErrorWithAttachment) {
out := new(ContractDetailResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetContractDetail", in, out)
}
func (c *bundleClient) GetDevelopmentCyclesByContractUUID(ctx context.Context, in *GetDevelopmentCyclesByContractUUIDRequest, opts ...grpc_go.CallOption) (*GetDevelopmentCyclesByContractUUIDResponse, common.ErrorWithAttachment) {
out := new(GetDevelopmentCyclesByContractUUIDResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetDevelopmentCyclesByContractUUID", in, out)
}
func (c *bundleClient) GetPaymentCyclesByContractUUID(ctx context.Context, in *GetPaymentCyclesByContractUUIDRequest, opts ...grpc_go.CallOption) (*GetPaymentCyclesByContractUUIDResponse, common.ErrorWithAttachment) {
out := new(GetPaymentCyclesByContractUUIDResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPaymentCyclesByContractUUID", in, out)
}
func (c *bundleClient) UpdateOrderRecordByOrderUuid(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateOrderRecordByOrderUuid", in, out)
}
func (c *bundleClient) OrderListByOrderUuid(ctx context.Context, in *OrderInfoByOrderUuidRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment) {
out := new(OrderInfoByOrderNoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderListByOrderUuid", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
@ -915,21 +890,17 @@ type BundleServer interface {
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
// 发票管理
CreateInvoice(context.Context, *CreateInvoiceReq) (*CreateInvoiceResp, error)
CreatePaperInvoiceAddress(context.Context, *CreatePaperInvoiceAddressReq) (*CreatePaperInvoiceAddressResp, error)
GetInvoiceList(context.Context, *GetInvoiceListReq) (*GetInvoiceListResp, error)
UpdateInvoiceExpressInfo(context.Context, *UpdateInvoiceExpressInfoReq) (*UpdateInvoiceExpressInfoResp, error)
GetInvoiceExpressInfo(context.Context, *GetInvoiceExpressInfoReq) (*GetInvoiceExpressInfoResp, error)
GetOrderInfoByOrderNo(context.Context, *GetOrderInfoByOrderNoReq) (*GetOrderInfoByOrderNoResp, error)
GetInvoiceInfoByOrderNo(context.Context, *GetInvoiceInfoByOrderNoReq) (*GetInvoiceInfoByOrderNoResp, error)
GetLastInvoiceNo(context.Context, *GetLastInvoiceNoReq) (*GetLastInvoiceNoResp, error)
// 临时接口
ExportWorkCastInfo(context.Context, *ExportWorkCastInfoReq) (*ExportWorkCastInfoResp, error)
// 客户管理
GetCustomerList(context.Context, *CustomerListRequest) (*CustomerListResponse, error)
GetCustomerDetail(context.Context, *CustomerDetailRequest) (*CustomerDetailResponse, error)
UpdateCustomer(context.Context, *CustomerUpdateRequest) (*ComResponse, error)
GetReferralPersonList(context.Context, *ReferralPersonListRequest) (*ReferralPersonListResponse, error)
// 合同管理
UpdateContract(context.Context, *ContractUpdateRequest) (*ComResponse, error)
GetContractList(context.Context, *ContractListRequest) (*ContractListResponse, error)
GetContractDetail(context.Context, *ContractDetailRequest) (*ContractDetailResponse, error)
GetDevelopmentCyclesByContractUUID(context.Context, *GetDevelopmentCyclesByContractUUIDRequest) (*GetDevelopmentCyclesByContractUUIDResponse, error)
GetPaymentCyclesByContractUUID(context.Context, *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error)
UpdateOrderRecordByOrderUuid(context.Context, *OrderRecord) (*CommonResponse, error)
OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error)
mustEmbedUnimplementedBundleServer()
}
@ -1187,42 +1158,33 @@ func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *Metr
func (UnimplementedBundleServer) QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryTheOrderSnapshotInformation not implemented")
}
func (UnimplementedBundleServer) CreateInvoice(context.Context, *CreateInvoiceReq) (*CreateInvoiceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateInvoice not implemented")
}
func (UnimplementedBundleServer) CreatePaperInvoiceAddress(context.Context, *CreatePaperInvoiceAddressReq) (*CreatePaperInvoiceAddressResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreatePaperInvoiceAddress not implemented")
}
func (UnimplementedBundleServer) GetInvoiceList(context.Context, *GetInvoiceListReq) (*GetInvoiceListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetInvoiceList not implemented")
}
func (UnimplementedBundleServer) UpdateInvoiceExpressInfo(context.Context, *UpdateInvoiceExpressInfoReq) (*UpdateInvoiceExpressInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateInvoiceExpressInfo not implemented")
}
func (UnimplementedBundleServer) GetInvoiceExpressInfo(context.Context, *GetInvoiceExpressInfoReq) (*GetInvoiceExpressInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetInvoiceExpressInfo not implemented")
}
func (UnimplementedBundleServer) GetOrderInfoByOrderNo(context.Context, *GetOrderInfoByOrderNoReq) (*GetOrderInfoByOrderNoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrderInfoByOrderNo not implemented")
}
func (UnimplementedBundleServer) GetInvoiceInfoByOrderNo(context.Context, *GetInvoiceInfoByOrderNoReq) (*GetInvoiceInfoByOrderNoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetInvoiceInfoByOrderNo not implemented")
}
func (UnimplementedBundleServer) GetLastInvoiceNo(context.Context, *GetLastInvoiceNoReq) (*GetLastInvoiceNoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetLastInvoiceNo not implemented")
}
func (UnimplementedBundleServer) ExportWorkCastInfo(context.Context, *ExportWorkCastInfoReq) (*ExportWorkCastInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExportWorkCastInfo not implemented")
}
func (UnimplementedBundleServer) GetCustomerList(context.Context, *CustomerListRequest) (*CustomerListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCustomerList not implemented")
}
func (UnimplementedBundleServer) GetCustomerDetail(context.Context, *CustomerDetailRequest) (*CustomerDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCustomerDetail not implemented")
}
func (UnimplementedBundleServer) UpdateCustomer(context.Context, *CustomerUpdateRequest) (*ComResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateCustomer not implemented")
}
func (UnimplementedBundleServer) GetReferralPersonList(context.Context, *ReferralPersonListRequest) (*ReferralPersonListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetReferralPersonList not implemented")
}
func (UnimplementedBundleServer) UpdateContract(context.Context, *ContractUpdateRequest) (*ComResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateContract not implemented")
}
func (UnimplementedBundleServer) GetContractList(context.Context, *ContractListRequest) (*ContractListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetContractList not implemented")
}
func (UnimplementedBundleServer) GetContractDetail(context.Context, *ContractDetailRequest) (*ContractDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetContractDetail not implemented")
}
func (UnimplementedBundleServer) GetDevelopmentCyclesByContractUUID(context.Context, *GetDevelopmentCyclesByContractUUIDRequest) (*GetDevelopmentCyclesByContractUUIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDevelopmentCyclesByContractUUID not implemented")
}
func (UnimplementedBundleServer) GetPaymentCyclesByContractUUID(context.Context, *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentCyclesByContractUUID not implemented")
}
func (UnimplementedBundleServer) UpdateOrderRecordByOrderUuid(context.Context, *OrderRecord) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateOrderRecordByOrderUuid not implemented")
}
func (UnimplementedBundleServer) OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderListByOrderUuid not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
@ -3658,6 +3620,238 @@ func _Bundle_QueryTheOrderSnapshotInformation_Handler(srv interface{}, ctx conte
return interceptor(ctx, in, info, handler)
}
func _Bundle_CreateInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateInvoiceReq)
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("CreateInvoice", 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_CreatePaperInvoiceAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreatePaperInvoiceAddressReq)
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("CreatePaperInvoiceAddress", 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_GetInvoiceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetInvoiceListReq)
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("GetInvoiceList", 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_UpdateInvoiceExpressInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateInvoiceExpressInfoReq)
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("UpdateInvoiceExpressInfo", 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_GetInvoiceExpressInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetInvoiceExpressInfoReq)
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("GetInvoiceExpressInfo", 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_GetOrderInfoByOrderNo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetOrderInfoByOrderNoReq)
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("GetOrderInfoByOrderNo", 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_GetInvoiceInfoByOrderNo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetInvoiceInfoByOrderNoReq)
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("GetInvoiceInfoByOrderNo", 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_GetLastInvoiceNo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetLastInvoiceNoReq)
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("GetLastInvoiceNo", 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_ExportWorkCastInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ExportWorkCastInfoReq)
if err := dec(in); err != nil {
@ -3687,325 +3881,6 @@ func _Bundle_ExportWorkCastInfo_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetCustomerList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CustomerListRequest)
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("GetCustomerList", 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_GetCustomerDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CustomerDetailRequest)
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("GetCustomerDetail", 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_UpdateCustomer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CustomerUpdateRequest)
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("UpdateCustomer", 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_GetReferralPersonList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ReferralPersonListRequest)
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("GetReferralPersonList", 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_UpdateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ContractUpdateRequest)
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("UpdateContract", 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_GetContractList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ContractListRequest)
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("GetContractList", 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_GetContractDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ContractDetailRequest)
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("GetContractDetail", 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_GetDevelopmentCyclesByContractUUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetDevelopmentCyclesByContractUUIDRequest)
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("GetDevelopmentCyclesByContractUUID", 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_GetPaymentCyclesByContractUUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPaymentCyclesByContractUUIDRequest)
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("GetPaymentCyclesByContractUUID", 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_UpdateOrderRecordByOrderUuid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OrderRecord)
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("UpdateOrderRecordByOrderUuid", 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_OrderListByOrderUuid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OrderInfoByOrderUuidRequest)
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("OrderListByOrderUuid", 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)
@ -4345,54 +4220,42 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "QueryTheOrderSnapshotInformation",
Handler: _Bundle_QueryTheOrderSnapshotInformation_Handler,
},
{
MethodName: "CreateInvoice",
Handler: _Bundle_CreateInvoice_Handler,
},
{
MethodName: "CreatePaperInvoiceAddress",
Handler: _Bundle_CreatePaperInvoiceAddress_Handler,
},
{
MethodName: "GetInvoiceList",
Handler: _Bundle_GetInvoiceList_Handler,
},
{
MethodName: "UpdateInvoiceExpressInfo",
Handler: _Bundle_UpdateInvoiceExpressInfo_Handler,
},
{
MethodName: "GetInvoiceExpressInfo",
Handler: _Bundle_GetInvoiceExpressInfo_Handler,
},
{
MethodName: "GetOrderInfoByOrderNo",
Handler: _Bundle_GetOrderInfoByOrderNo_Handler,
},
{
MethodName: "GetInvoiceInfoByOrderNo",
Handler: _Bundle_GetInvoiceInfoByOrderNo_Handler,
},
{
MethodName: "GetLastInvoiceNo",
Handler: _Bundle_GetLastInvoiceNo_Handler,
},
{
MethodName: "ExportWorkCastInfo",
Handler: _Bundle_ExportWorkCastInfo_Handler,
},
{
MethodName: "GetCustomerList",
Handler: _Bundle_GetCustomerList_Handler,
},
{
MethodName: "GetCustomerDetail",
Handler: _Bundle_GetCustomerDetail_Handler,
},
{
MethodName: "UpdateCustomer",
Handler: _Bundle_UpdateCustomer_Handler,
},
{
MethodName: "GetReferralPersonList",
Handler: _Bundle_GetReferralPersonList_Handler,
},
{
MethodName: "UpdateContract",
Handler: _Bundle_UpdateContract_Handler,
},
{
MethodName: "GetContractList",
Handler: _Bundle_GetContractList_Handler,
},
{
MethodName: "GetContractDetail",
Handler: _Bundle_GetContractDetail_Handler,
},
{
MethodName: "GetDevelopmentCyclesByContractUUID",
Handler: _Bundle_GetDevelopmentCyclesByContractUUID_Handler,
},
{
MethodName: "GetPaymentCyclesByContractUUID",
Handler: _Bundle_GetPaymentCyclesByContractUUID_Handler,
},
{
MethodName: "UpdateOrderRecordByOrderUuid",
Handler: _Bundle_UpdateOrderRecordByOrderUuid_Handler,
},
{
MethodName: "OrderListByOrderUuid",
Handler: _Bundle_OrderListByOrderUuid_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",

View File

@ -62,11 +62,8 @@ func loadMysqlConn(conn string) *gorm.DB {
// &model.Reconciliation{},
&model.BundleActivate{},
&model.BundleBalanceLayout{},
&model.Contract{},
&model.ContractPaymentCycle{},
&model.DevelopmentCycle{},
&model.Customer{},
&model.Invoice{},
&model.PaperInvoiceAddress{},
)
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "platform_ids") == false {
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "platform_ids"); err != nil {

View File

@ -9,7 +9,7 @@ const source = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
// 生成订单号 模版 BD20250220104501+6位随机数 避免 订单号重复
func GetOrderNo() string {
return "BD" + GetRandomString(20)
return "BD" + time.Now().Format("20060102150405") + GetRandomString(6)
}
// 生成随机字符串