Ethan 7 miesięcy temu
rodzic
commit
060be83f05

+ 28 - 0
app/consts/error_code.go

@@ -0,0 +1,28 @@
+package consts
+
+import "github.com/go-redis/redis/v8"
+
+var RedisNil = redis.Nil
+var errorCodeToastMap = map[int32]string{}
+
+const DefaultToast = ""
+
+const ErrorSuccess int32 = 0
+const ErrorNotLogin int32 = 4001
+const ErrorParamCheck int32 = 5001
+const ErrorInternal int32 = 5001
+
+func init() {
+	errorCodeToastMap[ErrorSuccess] = "请求成功"
+	errorCodeToastMap[ErrorNotLogin] = "请登录后操作"
+	errorCodeToastMap[ErrorParamCheck] = "参数有误"
+	errorCodeToastMap[ErrorInternal] = "网络错误"
+}
+
+func GetErrorToast(errorCode int32) string {
+	toast, contain := errorCodeToastMap[errorCode]
+	if contain {
+		return toast
+	}
+	return "网络错误,请稍后再试"
+}

+ 27 - 0
app/consts/invoice_enums.go

@@ -0,0 +1,27 @@
+package consts
+
+var HeadTypeMap = map[int64]string{
+	1: "企业",
+	2: "个人",
+}
+
+func GetHeadType(HeadType int64) string {
+	toast, contain := HeadTypeMap[HeadType]
+	if contain {
+		return toast
+	}
+	return "未知"
+}
+
+var InvoiceTypeMap = map[int64]string{
+	1: "数电普票",
+	2: "数电专票",
+}
+
+func GetInvoiceType(InvoiceType int64) string {
+	toast, contain := InvoiceTypeMap[InvoiceType]
+	if contain {
+		return toast
+	}
+	return "未知"
+}

+ 20 - 0
app/consts/platform_icon.go

@@ -0,0 +1,20 @@
+package consts
+
+var platformIconMap = map[int]string{
+	0: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/platformlogo/redbook.png",
+	1: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/platformlogo/redbook.png",
+	2: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/pingtai2.png",
+	3: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_OojIrB54K2_gW0cQQGOvh1TQE8B_34_35.png",
+	4: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_NcjI7AD0T3viYtxQwGOvh1SwG0A_35_35.png",
+	5: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_N8lJbAnowYY8vg2EwGOvh1MQAcA_37_37.png",
+	6: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_NomJrBzk2H1dD_6NwGOvh1TQE8A_38_38.png",
+	7: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_OglJrDwCzIdgTtsKQGOvh1TAG0A_38_37.png",
+}
+
+func GetPaltformIcon(platformId int) string {
+	icon, contain := platformIconMap[platformId]
+	if contain {
+		return icon
+	}
+	return ""
+}

+ 95 - 0
app/consts/project_enums.go

@@ -0,0 +1,95 @@
+package consts
+
+var projectStatusMap = map[int64]string{
+	1:  "创建中",
+	2:  "待审核",
+	3:  "审核通过",
+	4:  "招募中",
+	5:  "招募完毕",
+	6:  "待支付",
+	7:  "已支付",
+	8:  "失效",
+	9:  "执行中",
+	10: "已结案",
+}
+
+func GetProjectStatus(status int64) string {
+	toast, contain := projectStatusMap[status]
+	if contain {
+		return toast
+	}
+	return "未知"
+}
+
+var ProjectPlatformMap = map[int64]string{
+	1: "红book",
+	2: "抖音",
+	3: "微博",
+	4: "快手",
+	5: "b站",
+	6: "大众点评",
+	7: "知乎",
+}
+
+func GetProjectPlatform(status int64) string {
+	toast, contain := ProjectPlatformMap[status]
+	if contain {
+		return toast
+	}
+	return "未知"
+}
+
+var ProjectFormMap = map[int64]string{
+	1: "实体商品寄拍",
+	2: "虚拟产品测评",
+	3: "线下探店打卡",
+	4: "素材微原创",
+}
+
+func GetProjectForm(status int64) string {
+	toast, contain := ProjectFormMap[status]
+	if contain {
+		return toast
+	}
+	return "未知"
+}
+
+var ProjectContentTypeMap = map[int64]string{
+	1: "图文",
+	2: "视频",
+}
+
+func GetProjectContentType(status int64) string {
+	toast, contain := ProjectContentTypeMap[status]
+	if contain {
+		return toast
+	}
+	return "未知"
+}
+
+var ProjectTypeMap = map[int64]string{
+	1: "全流程项目",
+	2: "专项执行项目",
+}
+
+func GetProjectType(projectType int64) string {
+	toast, contain := ProjectTypeMap[projectType]
+	if contain {
+		return toast
+	}
+	return "未知"
+}
+
+var RechargeMethod = map[int64]string{
+	1: "对公转账",
+	2: "支付宝",
+	3: "微信",
+}
+
+func GetRechargeMethod(method int64) string {
+	toast, contain := RechargeMethod[method]
+	if contain {
+		return toast
+	}
+	return "未知"
+}

+ 6 - 0
app/consts/session.go

@@ -0,0 +1,6 @@
+package consts
+
+const SessionAuthSchema = "session_auth"
+const SessionRedisPrefix = "b_user:"
+const AuthSalt = "fa2tg4y"
+const BRole = "3"

+ 94 - 0
app/controller/finance_controller.go

@@ -147,3 +147,97 @@ func (t FinanceController) RechargeInfoList(c *gin.Context) {
 	}
 	returnSuccess(c, 20000, result)
 }
+
+// 设置默认开票抬头
+func (t FinanceController) UpdateInvoiceDefault(c *gin.Context) {
+	param := &vo.InvoiceDefaultParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	invoiceId, err := service.InvoiceService{}.UpdateInvoiceDefault(param)
+	if err != nil {
+		logrus.Errorf("[UpdateInvoiceDefault] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["invoiceId"] = *invoiceId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 获取默认开票抬头
+func (t FinanceController) GetInvoiceDefault(c *gin.Context) {
+	param := &vo.InvoiceDefaultParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	reInvoiceInfo, err := service.InvoiceService{}.GetInvoiceDefault(param)
+	if err != nil {
+		logrus.Errorf("[GetInvoiceDefault] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, reInvoiceInfo)
+}
+
+// 确认开票
+func (t FinanceController) BillInvoice(c *gin.Context) {
+	param := &vo.InvoiceBillParam{}
+	err := c.BindJSON(param)
+	if err != nil || len(param.TaskIds) != 3 {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	billingId, err := service.InvoiceService{}.BillInvoice(param)
+	if err != nil {
+		logrus.Errorf("[BillInvoice] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["billingId"] = *billingId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 开票记录
+func (t FinanceController) GetBillList(c *gin.Context) {
+	param := &vo.InvoiceBillListParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	result, err := service.InvoiceService{}.GetBillList(param)
+	if err != nil {
+		logrus.Errorf("[GetBillList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 可开票账单
+func (t FinanceController) GetBillableList(c *gin.Context) {
+	param := &vo.InvoiceBillListParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	result, err := service.InvoiceService{}.GetBillableList(param)
+	if err != nil {
+		logrus.Errorf("[GetBillableList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}

+ 49 - 0
app/dao/invoice_info_dao.go

@@ -0,0 +1,49 @@
+package dao
+
+import (
+	"gorm.io/gorm"
+	"youngee_b_api/app/entity"
+)
+
+type InvoiceInfoDao struct{}
+
+func (d InvoiceInfoDao) Select(invoiceId int64) (*entity.InvoiceInfo, error) {
+	var invoiceInfo entity.InvoiceInfo
+	err := Db.Debug().Model(&entity.InvoiceInfo{}).Where("invoice_id = ?", invoiceId).Find(&invoiceInfo).Error
+	if err != nil {
+		if err == gorm.ErrRecordNotFound {
+			return &invoiceInfo, nil
+		}
+		return nil, err
+	}
+	return &invoiceInfo, nil
+}
+
+func (d InvoiceInfoDao) Delete(invoiceId int64) error {
+	var invoiceInfo entity.InvoiceInfo
+	err := Db.Debug().Model(&entity.InvoiceInfo{}).Where("invoice_id = ?", invoiceId).Delete(&invoiceInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d InvoiceInfoDao) SelectDefault(enterpriseId string, invoiceType int64, isDefault int64) (*entity.InvoiceInfo, error) {
+	var invoiceInfo entity.InvoiceInfo
+	err := Db.Debug().Model(&entity.InvoiceInfo{}).Where("enterprise_id = ? AND invoice_type = ? AND is_default = ?", enterpriseId, invoiceType, isDefault).Find(&invoiceInfo).Error
+	if err != nil {
+		if err == gorm.ErrRecordNotFound {
+			return &invoiceInfo, nil
+		}
+		return nil, err
+	}
+	return &invoiceInfo, nil
+}
+
+func (d InvoiceInfoDao) Insert(invoiceInfo *entity.InvoiceInfo) error {
+	err := Db.Debug().Model(&entity.InvoiceInfo{}).Create(invoiceInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 120 - 0
app/dao/invoice_record_dao.go

@@ -0,0 +1,120 @@
+package dao
+
+import (
+	"errors"
+	"youngee_b_api/app/entity"
+)
+
+type InvoiceRecordDao struct{}
+
+func (d InvoiceRecordDao) Insert(invoiceRecord *entity.InvoiceRecord) error {
+	err := Db.Debug().Model(&entity.InvoiceRecord{}).Omit("billing_at").Create(invoiceRecord).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 开票记录
+func (d InvoiceRecordDao) GetBillList(enterpriseId string, subAccountId int64, status int64, page int, pageSize int) ([]*entity.InvoiceRecord, int64, error) {
+	invoiceRecords := []*entity.InvoiceRecord{}
+	var total int64
+	query := Db.Debug().Model(&entity.InvoiceRecord{}).Where("status = ?", status)
+	if subAccountId == 0 {
+		if enterpriseId == "" {
+			return invoiceRecords, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", enterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", subAccountId)
+	}
+	query.Count(&total)
+	query = query.Select("billing_id, enterprise_id, sub_account_id, invoice_amount, invoice_body, invoice_type, task_ids, status, submit_at, billing_at")
+	offset := (page - 1) * pageSize
+	var err error
+	if status == 1 {
+		err = query.Order("submit_at desc").Offset(offset).Limit(pageSize).Find(&invoiceRecords).Error
+	} else if status == 2 {
+		err = query.Order("billing_at desc").Offset(offset).Limit(pageSize).Find(&invoiceRecords).Error
+	}
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return invoiceRecords, total, nil
+}
+
+// 可开票账单——电商带货
+func (d InvoiceRecordDao) GetBillableSelectionList(enterpriseId string, subAccountId int64, page int, pageSize int) ([]*entity.SelectionInfo, int64, error) {
+	billableSelections := []*entity.SelectionInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.SelectionInfo{}).Where("selection_status = ? AND invoice_status = ?", 8, 0)
+	if subAccountId == 0 {
+		if enterpriseId == "" {
+			return billableSelections, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", enterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", subAccountId)
+	}
+	query.Count(&total)
+	query = query.Select("selection_id, enterprise_id, sub_account_id, product_id, platform, settlement_amount")
+	//offset := (page - 1) * pageSize
+	//err := query.Order("finish_at desc").Offset(offset).Limit(pageSize).Find(&invoiceRecords).Error
+	err := query.Order("finish_at desc").Find(&billableSelections).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return billableSelections, total, nil
+}
+
+// 可开票账单——品牌种草
+func (d InvoiceRecordDao) GetBillableProjectList(enterpriseId string, subAccountId int64, page int, pageSize int) ([]*entity.Project, int64, error) {
+	billableProjects := []*entity.Project{}
+	var total int64
+	query := Db.Debug().Model(&entity.Project{}).Where("project_status = ? AND invoice_status = ?", 10, 0)
+	if subAccountId == 0 {
+		if enterpriseId == "" {
+			return billableProjects, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", enterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", subAccountId)
+	}
+	query.Count(&total)
+	query = query.Select("project_id, enterprise_id, sub_account_id, product_id, project_platform, settlement_amount")
+	//offset := (page - 1) * pageSize
+	//err := query.Order("finish_at desc").Offset(offset).Limit(pageSize).Find(&invoiceRecords).Error
+	err := query.Order("finish_at desc").Find(&billableProjects).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return billableProjects, total, nil
+}
+
+// 可开票账单——本地生活
+//func (d InvoiceRecordDao) GetBillableProjectList(enterpriseId string, subAccountId int64, page int, pageSize int) ([]*entity.Project, int64, error) {
+//	billableProjects := []*entity.Project{}
+//	var total int64
+//	query := Db.Debug().Model(&entity.Project{}).Where("project_status = ? AND invoice_status = ?", 10, 0)
+//	if subAccountId == 0 {
+//		if enterpriseId == "" {
+//			return billableProjects, 0, errors.New("enterpriseId is empty")
+//		}
+//		query = query.Where("enterprise_id = ?", enterpriseId)
+//	} else {
+//		query = query.Where("sub_account_id = ?", subAccountId)
+//	}
+//	query.Count(&total)
+//	query = query.Select("project_id, enterprise_id, sub_account_id, product_id, project_platform, settlement_amount")
+//	//offset := (page - 1) * pageSize
+//	//err := query.Order("finish_at desc").Offset(offset).Limit(pageSize).Find(&invoiceRecords).Error
+//	err := query.Order("finish_at desc").Find(&billableProjects).Error
+//	if err != nil {
+//		return nil, 0, err
+//	}
+//
+//	return billableProjects, total, nil
+//}

+ 9 - 0
app/dao/project_dao.go

@@ -67,6 +67,15 @@ func (d ProjectDAO) UpdateProject(project entity.Project) error {
 	return nil
 }
 
+// 更新开票状态字段
+func (d ProjectDAO) UpdateInvoiceStatus(projectIDs []string) error {
+	err := Db.Model(&entity.Project{}).Where("project_id IN ?", projectIDs).Updates(entity.Project{InvoiceStatus: 1}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
 // 获取种草任务列表
 func (d ProjectDAO) GetProjectPreviews(param *vo.ProjectSearchParam) ([]vo.ReProjectTaskPreview, int64, error) {
 	var reProjectTaskPreviews []vo.ReProjectTaskPreview

+ 1 - 1
app/dao/recharge_record_dao.go

@@ -32,7 +32,7 @@ func (d RechargeRecordDao) RechargeInfoList(param *vo.RechargeParam) ([]entity.R
 	var total int64
 	query := Db.Debug().Model(&entity.RechargeRecord{}).Where("enterprise_id = ? AND status = ?", param.EnterpriseId, param.RechargeState)
 	query.Count(&total)
-	query = query.Select("recharge_id, recharge_amount, transfer_voucher_url, recharge_method, commit_at, confirm_at, refuse_at, fail_reason")
+	query = query.Select("recharge_id, recharge_amount, transfer_voucher_url, recharge_method, commit_at, confirm_at, refuse_at, fail_reason, enterprise_id, sub_account_id")
 	offset := (param.Page - 1) * param.PageSize
 	var err error
 	if param.RechargeState == 1 {

+ 7 - 1
app/dao/selection_info_dao.go

@@ -49,13 +49,19 @@ func (d SelectionInfoDAO) CreateSelectionInfo(selectionInfo entity.SelectionInfo
 
 // 更新带货任务
 func (d SelectionInfoDAO) UpdateSelectionInfo(selectionInfo entity.SelectionInfo) error {
-	err := Db.Model(&entity.SelectionInfo{}).Where("selection_id = ?", selectionInfo.SelectionID).Updates(selectionInfo).Error
+	err := Db.Debug().Model(&entity.SelectionInfo{}).Where("selection_id = ?", selectionInfo.SelectionID).Updates(selectionInfo).Error
 	if err != nil {
 		return err
 	}
 	return nil
 }
 
+// 更新开票状态字段
+func (d SelectionInfoDAO) UpdateInvoiceStatus(selectionIDs []string) error {
+	err := Db.Model(&entity.SelectionInfo{}).Where("selection_id IN ?", selectionIDs).Updates(entity.SelectionInfo{InvoiceStatus: 1}).Error
+	return err
+}
+
 // 获取带货任务列表
 func (d SelectionInfoDAO) GetSelectionPreviews(param *vo.SelectionSearchParam) ([]vo.ReSelectionTaskPreview, int64, error) {
 	var reSelectionTaskPreviews []vo.ReSelectionTaskPreview

+ 19 - 0
app/entity/invoice_address.go

@@ -0,0 +1,19 @@
+package entity
+
+import "time"
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+type YounggeeInvoiceAddress struct {
+	AddressID    int64     `gorm:"column:address_id;primary_key;AUTO_INCREMENT"` // 发票收件地址id
+	EnterpriseID string    `gorm:"column:enterprise_id;NOT NULL"`                // 企业id
+	Name         string    `gorm:"column:name;NOT NULL"`                         // 收件人姓名
+	RegionCode   string    `gorm:"column:region_code;NOT NULL"`                  // 所在地区编码
+	Address      string    `gorm:"column:address;NOT NULL"`                      // 详细地址
+	Phone        string    `gorm:"column:phone;NOT NULL"`                        // 手机号码
+	UpdateAt     time.Time `gorm:"column:update_at;NOT NULL"`                    // 创建时间
+}
+
+func (m *YounggeeInvoiceAddress) TableName() string {
+	return "younggee_invoice_address"
+}

+ 24 - 0
app/entity/invoice_info.go

@@ -0,0 +1,24 @@
+package entity
+
+import "time"
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+type InvoiceInfo struct {
+	InvoiceID         int64     `gorm:"column:invoice_id;primary_key;AUTO_INCREMENT"` // 发票信息id
+	EnterpriseID      string    `gorm:"column:enterprise_id;NOT NULL"`                // 企业id
+	InvoiceType       int64     `gorm:"column:invoice_type;NOT NULL"`                 // 发票类型
+	HeadType          string    `gorm:"column:head_type;NOT NULL"`                    // 抬头类型
+	InvoiceHeader     string    `gorm:"column:invoice_header;NOT NULL"`               // 发票抬头
+	TaxCode           string    `gorm:"column:tax_code;NOT NULL"`                     // 税务登记证号/统一社会信用代码
+	RegisteredAddress string    `gorm:"column:registered_address;NOT NULL"`           // 企业注册地址
+	RegisteredPhone   string    `gorm:"column:registered_phone;NOT NULL"`             // 企业注册电话
+	Bank              string    `gorm:"column:bank;NOT NULL"`                         // 开户银行
+	BankCardNumber    string    `gorm:"column:bank_card_number;NOT NULL"`             // 开户银行账号
+	IsDefault         int64     `gorm:"column:is_default;NOT NULL"`                   // 1默认抬头
+	UpdateAt          time.Time `gorm:"column:update_at;NOT NULL"`                    // 更新时间
+}
+
+func (m *InvoiceInfo) TableName() string {
+	return "younggee_invoice_info"
+}

+ 32 - 0
app/entity/invoice_record.go

@@ -0,0 +1,32 @@
+package entity
+
+import (
+	"time"
+)
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+type InvoiceRecord struct {
+	Id                int64     `gorm:"column:id;NOT NULL;primary_key;AUTO_INCREMENT"` // 自增ID
+	BillingId         string    `gorm:"column:billing_id;NOT NULL;unique_key"`         // 开票订单ID
+	EnterpriseID      string    `gorm:"column:enterprise_id;NOT NULL"`                 // 企业id
+	SubAccountId      int64     `gorm:"column:sub_account_id;NOT NULL"`                // 子账号id
+	InvoiceAmount     float64   `gorm:"column:invoice_amount;NOT NULL"`                // 开票金额
+	InvoiceBody       string    `gorm:"column:invoice_body;NOT NULL"`                  // 开票方信息
+	InvoiceContent    string    `gorm:"column:invoice_content;NOT NULL"`               // 发票内容
+	InvoiceType       int64     `gorm:"column:invoice_type;NOT NULL"`                  // 发票类型
+	InvoiceHeader     string    `gorm:"column:invoice_header;NOT NULL"`                // 发票抬头
+	TaxCode           string    `gorm:"column:tax_code;NOT NULL"`                      // 税务登记证号/统一社会信用代码
+	RegisteredAddress string    `gorm:"column:registered_address;NOT NULL"`            // 企业注册地址
+	RegisteredPhone   string    `gorm:"column:registered_phone;NOT NULL"`              // 企业注册电话
+	Bank              string    `gorm:"column:bank;NOT NULL"`                          // 开户银行
+	BankCardNumber    string    `gorm:"column:bank_card_number;NOT NULL"`              // 开户银行账号
+	Status            int64     `gorm:"column:status;NOT NULL"`                        // 开票状态:1 为待开票,2为已开票
+	SubmitAt          time.Time `gorm:"column:submit_at;NOT NULL"`                     // 申请提交时间
+	BillingAt         time.Time `gorm:"column:billing_at;NOT NULL"`                    // 开票时间
+	TaskIds           string    `gorm:"column:task_ids;NOT NULL"`                      // 账单列表
+}
+
+func (m *InvoiceRecord) TableName() string {
+	return "younggee_invoice_record"
+}

+ 1 - 0
app/entity/project.go

@@ -48,6 +48,7 @@ type Project struct {
 	OperatorType      int64     `gorm:"column:operator_type"`                  // 创建者类型,1商家主账号,2商家子账号
 	TotalRecruitNum   int64     `gorm:"column:total_recruit_num"`              // 各策略招募人数总和
 	Tools             string    `gorm:"column:tools"`                          // 工具选择,1邀约招募 2结算账单 3样品物流 4审稿工具 5作品审查 6数据巡检(,分隔)
+	InvoiceStatus     int64     `gorm:"column:invoice_status"`                 // 开票状态(1开票中 2已开票)
 }
 
 func (m *Project) TableName() string {

+ 3 - 2
app/entity/recharge_record.go

@@ -3,8 +3,9 @@ package entity
 import "time"
 
 type RechargeRecord struct {
-	RechargeID         string    `gorm:"column:recharge_id;primary_key"`       // 充值订单ID
-	EnterpriseID       string    `gorm:"column:enterprise_id;NOT NULL"`        // 企业id
+	RechargeID         string    `gorm:"column:recharge_id;primary_key"` // 充值订单ID
+	EnterpriseID       string    `gorm:"column:enterprise_id;NOT NULL"`  // 企业id
+	SubAccountId       int64     `gorm:"column:sub_account_id;NOT NULL"`
 	RechargeAmount     float64   `gorm:"column:recharge_amount;NOT NULL"`      // 充值金额
 	TransferVoucherUrl string    `gorm:"column:transfer_voucher_url;NOT NULL"` // 转账凭证图片链接
 	Phone              string    `gorm:"column:phone;NOT NULL"`                // 联系方式

+ 1 - 0
app/entity/selection_info.go

@@ -44,6 +44,7 @@ type SelectionInfo struct {
 	Status           int64     `gorm:"column:status"`                   // 选品是否删除 2代表删除
 	EnrollNum        int64     `gorm:"column:enroll_num"`               // 报名数量
 	ChooseNum        int64     `gorm:"column:choose_num"`               // 已选数量
+	InvoiceStatus    int64     `gorm:"column:invoice_status"`           // 开票状态(1开票中 2已开票)
 }
 
 func (m *SelectionInfo) TableName() string {

+ 298 - 0
app/service/invoice_service.go

@@ -0,0 +1,298 @@
+package service
+
+import (
+	"encoding/json"
+	"fmt"
+	"time"
+	"youngee_b_api/app/consts"
+	"youngee_b_api/app/dao"
+	"youngee_b_api/app/entity"
+	"youngee_b_api/app/util"
+	"youngee_b_api/app/vo"
+)
+
+type InvoiceService struct{}
+
+// 设置默认开票抬头
+func (s InvoiceService) UpdateInvoiceDefault(param *vo.InvoiceDefaultParam) (*int64, error) {
+	var err error
+	invoiceInfo, err := dao.InvoiceInfoDao{}.SelectDefault(param.EnterpriseId, param.InvoiceType, 1)
+	if err != nil {
+		return nil, err
+	}
+	if invoiceInfo != nil && invoiceInfo.InvoiceID != 0 {
+		err := dao.InvoiceInfoDao{}.Delete(invoiceInfo.InvoiceID)
+		if err != nil {
+			return nil, err
+		}
+	}
+	if param.HeadType == 0 {
+		param.HeadType = 1
+	}
+	invoiceInfoAdd := entity.InvoiceInfo{
+		EnterpriseID:      param.EnterpriseId,
+		InvoiceType:       param.InvoiceType,
+		HeadType:          consts.GetHeadType(param.HeadType),
+		InvoiceHeader:     param.InvoiceHead,
+		TaxCode:           param.TaxCode,
+		RegisteredAddress: param.RegisteredAddress,
+		RegisteredPhone:   param.RegisteredPhone,
+		Bank:              param.Bank,
+		BankCardNumber:    param.BankCardNumber,
+		IsDefault:         1,
+		UpdateAt:          time.Now(),
+	}
+	err = dao.InvoiceInfoDao{}.Insert(&invoiceInfoAdd)
+	if err != nil {
+		return nil, err
+	}
+
+	return &invoiceInfoAdd.InvoiceID, nil
+}
+
+// 获取默认开票抬头
+func (s InvoiceService) GetInvoiceDefault(param *vo.InvoiceDefaultParam) (*vo.ReInvoiceInfo, error) {
+	invoiceInfo, err := dao.InvoiceInfoDao{}.SelectDefault(param.EnterpriseId, param.InvoiceType, 1)
+	if err != nil {
+		return nil, err
+	}
+	reInvoiceInfo := &vo.ReInvoiceInfo{
+		InvoiceHeader:     invoiceInfo.InvoiceHeader,
+		TaxCode:           invoiceInfo.TaxCode,
+		RegisteredAddress: invoiceInfo.RegisteredAddress,
+		RegisteredPhone:   invoiceInfo.RegisteredPhone,
+		Bank:              invoiceInfo.Bank,
+		BankCardNumber:    invoiceInfo.BankCardNumber,
+		IsDefault:         invoiceInfo.IsDefault,
+	}
+	return reInvoiceInfo, nil
+}
+
+// 确认开票
+func (s InvoiceService) BillInvoice(param *vo.InvoiceBillParam) (*string, error) {
+	var err error
+	billingId := util.GenerateDateRelatedUUID()
+	taskIds := param.TaskIds
+	// 将二维数组转换为 JSON 字符串
+	jsonData, _ := json.Marshal(taskIds)
+	// 将 []byte 转换为 string
+	taskIdsString := string(jsonData)
+	invoiceRecordAdd := entity.InvoiceRecord{
+		BillingId:         billingId,
+		EnterpriseID:      param.EnterpriseId,
+		SubAccountId:      param.SubAccountId,
+		InvoiceAmount:     param.InvoiceAmount,
+		InvoiceBody:       param.InvoiceBody,
+		InvoiceContent:    param.InvoiceContent,
+		InvoiceType:       param.InvoiceType,
+		InvoiceHeader:     param.InvoiceHead,
+		TaxCode:           param.TaxCode,
+		RegisteredAddress: param.RegisteredAddress,
+		RegisteredPhone:   param.RegisteredPhone,
+		Bank:              param.Bank,
+		BankCardNumber:    param.BankCardNumber,
+		TaskIds:           taskIdsString,
+		Status:            1,
+		SubmitAt:          time.Now(),
+	}
+	err = dao.InvoiceRecordDao{}.Insert(&invoiceRecordAdd)
+	if err != nil {
+		return nil, err
+	}
+	// 更新选品表的开票状态字段
+	// 电商带货
+	err = dao.SelectionInfoDAO{}.UpdateInvoiceStatus(taskIds[0])
+	if err != nil {
+		return nil, err
+	}
+	// 品牌种草
+	err = dao.ProjectDAO{}.UpdateInvoiceStatus(taskIds[1])
+	if err != nil {
+		return nil, err
+	}
+	// 本地生活
+
+	return &billingId, nil
+}
+
+// 开票记录
+func (s InvoiceService) GetBillList(param *vo.InvoiceBillListParam) (vo.ResultVO, error) {
+	if param.Page <= 0 {
+		param.Page = 1
+	}
+	if param.PageSize <= 0 {
+		param.PageSize = 10
+	}
+	var result vo.ResultVO
+	var reInvoiceRecords []*vo.ReInvoiceRecord
+	invoiceRecords, total, err := dao.InvoiceRecordDao{}.GetBillList(param.EnterpriseId, param.SubAccountId, param.BillStatus, param.Page, param.PageSize)
+	if err != nil {
+		return result, err
+	}
+	for _, invoiceRecord := range invoiceRecords {
+		var creatorName string
+		if invoiceRecord.SubAccountId == 0 {
+			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(invoiceRecord.EnterpriseID)
+			if err == nil && enterprise != nil {
+				creatorName = enterprise.BusinessName
+			}
+		} else {
+			subAccount, err := dao.SubAccountDao{}.GetSubAccount(invoiceRecord.SubAccountId)
+			if err == nil && subAccount != nil {
+				creatorName = subAccount.SubAccountName
+			}
+		}
+		var taskNumber int
+		// 将 JSON 字符串解码为二维数组
+		var arrayData [3][]string
+		err := json.Unmarshal([]byte(invoiceRecord.TaskIds), &arrayData)
+		if err != nil {
+			fmt.Println("Error unmarshaling JSON:", err)
+			return result, err
+		}
+		for _, array := range arrayData {
+			taskNumber += len(array)
+		}
+		reInvoiceRecord := &vo.ReInvoiceRecord{
+			BillingId:     invoiceRecord.BillingId,
+			InvoiceAmount: invoiceRecord.InvoiceAmount,
+			CreatorName:   creatorName,
+			SubmitAt:      invoiceRecord.SubmitAt.Format("2006-01-02 15:04:05"),
+			InvoiceBody:   invoiceRecord.InvoiceBody,
+			InvoiceType:   invoiceRecord.InvoiceType,
+			Status:        invoiceRecord.Status,
+			TaskNumber:    int64(taskNumber),
+		}
+		if param.BillStatus == 2 {
+			reInvoiceRecord.BillingAt = invoiceRecord.BillingAt.Format("2006-01-02 15:04:05")
+		}
+		reInvoiceRecords = append(reInvoiceRecords, reInvoiceRecord)
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     reInvoiceRecords,
+	}
+	return result, nil
+}
+
+// 可开票账单
+func (s InvoiceService) GetBillableList(param *vo.InvoiceBillListParam) (vo.ResultVO, error) {
+	if param.Page <= 0 {
+		param.Page = 1
+	}
+	if param.PageSize <= 0 {
+		param.PageSize = 10
+	}
+	var result vo.ResultVO
+	var reBillableInfos []*vo.ReBillableInfo
+	var billableSelections []*entity.SelectionInfo
+	var billableProjects []*entity.Project
+	// 电商带货
+	billableSelections, _, _ = dao.InvoiceRecordDao{}.GetBillableSelectionList(param.EnterpriseId, param.SubAccountId, param.Page, param.PageSize)
+	// 品牌种草
+	billableProjects, _, _ = dao.InvoiceRecordDao{}.GetBillableProjectList(param.EnterpriseId, param.SubAccountId, param.Page, param.PageSize)
+	// 本地生活
+
+	// 汇总结果
+	for _, billableSelection := range billableSelections {
+		// 获取商品详情字段
+		var creatorName string
+		var productName string
+		var productPrice float64
+		var mainImage string
+		if billableSelection.SubAccountId == 0 {
+			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(billableSelection.EnterpriseID)
+			if err == nil && enterprise != nil {
+				creatorName = enterprise.BusinessName
+			}
+		} else {
+			subAccount, err := dao.SubAccountDao{}.GetSubAccount(billableSelection.SubAccountId)
+			if err == nil && subAccount != nil {
+				creatorName = subAccount.SubAccountName
+			}
+		}
+		product, err := dao.ProductDAO{}.GetProductByID(billableSelection.ProductID)
+		if err == nil && product != nil {
+			productName = product.ProductName
+			productPrice = product.ProductPrice
+		}
+		mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(billableSelection.ProductID)
+		// 电商带货汇总
+		reBillableInfo := &vo.ReBillableInfo{
+			ProductId:      billableSelection.ProductID,
+			MainImage:      mainImage,
+			ProductName:    productName,
+			ProductPrice:   productPrice,
+			Platform:       billableSelection.Platform,
+			CreatorName:    creatorName,
+			TaskType:       "电商带货",
+			BillableAmount: billableSelection.SettlementAmount,
+			TaskId:         billableSelection.SelectionID,
+		}
+		reBillableInfos = append(reBillableInfos, reBillableInfo)
+	}
+	for _, billableProject := range billableProjects {
+		// 获取商品详情字段
+		var creatorName string
+		var productName string
+		var productPrice float64
+		var mainImage string
+		if billableProject.SubAccountId == 0 {
+			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(billableProject.EnterpriseID)
+			if err == nil && enterprise != nil {
+				creatorName = enterprise.BusinessName
+			}
+		} else {
+			subAccount, err := dao.SubAccountDao{}.GetSubAccount(billableProject.SubAccountId)
+			if err == nil && subAccount != nil {
+				creatorName = subAccount.SubAccountName
+			}
+		}
+		product, err := dao.ProductDAO{}.GetProductByID(billableProject.ProductID)
+		if err == nil && product != nil {
+			productName = product.ProductName
+			productPrice = product.ProductPrice
+		}
+		mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(billableProject.ProductID)
+		// 品牌种草汇总
+		reBillableInfo := &vo.ReBillableInfo{
+			ProductId:      billableProject.ProductID,
+			MainImage:      mainImage,
+			ProductName:    productName,
+			ProductPrice:   productPrice,
+			Platform:       billableProject.ProjectPlatform,
+			CreatorName:    creatorName,
+			TaskType:       "品牌种草",
+			BillableAmount: billableProject.SettlementAmount,
+			TaskId:         billableProject.ProjectId,
+		}
+		reBillableInfos = append(reBillableInfos, reBillableInfo)
+	}
+	// 本地生活
+
+	startIndex := (param.Page - 1) * param.PageSize
+	endIndex := startIndex + param.PageSize
+
+	// 分页
+	if startIndex >= len(reBillableInfos) {
+		result = vo.ResultVO{
+			Page:     param.Page,
+			PageSize: param.PageSize,
+			Total:    int64(len(reBillableInfos)),
+			Data:     nil,
+		}
+		return result, nil
+	}
+	if endIndex > len(reBillableInfos) {
+		endIndex = len(reBillableInfos)
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    int64(len(reBillableInfos)),
+		Data:     reBillableInfos[startIndex:endIndex],
+	}
+	return result, nil
+}

+ 18 - 4
app/service/recharge_service.go

@@ -30,11 +30,12 @@ func (s RechargeService) TransferToPublic(param *vo.RechargeTransferParam) (*str
 	//	rechargeId = util.MakeRechargeId(strconv.FormatInt(param.SubAccountId, 10))
 	//	phone, _ = dao.SubAccountDao{}.GetSubAccountPhone(param.SubAccountId)
 	//}
-	rechargeId = util.MakeRechargeId(param.EnterpriseId)
+	rechargeId = util.GenerateDateRelatedUUID()
 	phone, _ = dao.EnterpriseDao{}.GetEnterprisePhone(param.EnterpriseId)
 	rechargeRecord := entity.RechargeRecord{
 		RechargeID:         rechargeId,
 		EnterpriseID:       param.EnterpriseId,
+		SubAccountId:       param.SubAccountId,
 		RechargeAmount:     param.Amount,
 		TransferVoucherUrl: param.TransferVoucherUrl,
 		Phone:              phone,
@@ -290,6 +291,12 @@ func (s RechargeService) FrozenInfoList(param *vo.BalanceParam) (vo.ResultVO, er
 
 	// 分页
 	if startIndex >= len(reBalanceShows) {
+		result = vo.ResultVO{
+			Page:     param.Page,
+			PageSize: param.PageSize,
+			Total:    int64(len(reBalanceShows)),
+			Data:     nil,
+		}
 		return result, nil
 	}
 	if endIndex > len(reBalanceShows) {
@@ -330,9 +337,16 @@ func (s RechargeService) RechargeInfoList(param *vo.RechargeParam) (vo.ResultVO,
 	}
 	for _, rechargeRecord := range rechargeRecords {
 		var creatorName string
-		enterprise, err := dao.EnterpriseDao{}.GetEnterprise(param.EnterpriseId)
-		if err == nil && enterprise != nil {
-			creatorName = enterprise.BusinessName
+		if rechargeRecord.SubAccountId == 0 {
+			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(rechargeRecord.EnterpriseID)
+			if err == nil && enterprise != nil {
+				creatorName = enterprise.BusinessName
+			}
+		} else {
+			subAccount, err := dao.SubAccountDao{}.GetSubAccount(rechargeRecord.SubAccountId)
+			if err == nil && subAccount != nil {
+				creatorName = subAccount.SubAccountName
+			}
 		}
 		reRechargeInfo := &vo.ReRechargeInfo{
 			RechargeId:         rechargeRecord.RechargeID,

+ 8 - 2
app/util/uuid.go

@@ -53,7 +53,7 @@ func GetProjectID() string {
 	return selectionId
 }
 
-func MakeRechargeId(EnterpriseID string) string {
+func MakeRechargeId(enterpriseID string) string {
 	// 1、年月日
 	year := time.Now().Year()
 	month := time.Now().Month()
@@ -71,7 +71,7 @@ func MakeRechargeId(EnterpriseID string) string {
 		sum += 1
 	}
 	last := ""
-	rechargeIdPrefix := "8" + EnterpriseID[len(EnterpriseID)-2:] + conv.MustString(sum)
+	rechargeIdPrefix := "8" + enterpriseID[len(enterpriseID)-2:] + conv.MustString(sum)
 	var rechargeIdLast string
 	err := dao.Db.Model(entity.RechargeRecord{}).Select("recharge_id").Where("recharge_id like ?", rechargeIdPrefix+"%").
 		Last(&rechargeIdLast).Error
@@ -89,3 +89,9 @@ func MakeRechargeId(EnterpriseID string) string {
 	}
 	return rechargeIdPrefix + last
 }
+
+func GenerateDateRelatedUUID() string {
+	date := time.Now().Format("20060102") // 获取当前日期
+	u := uuid.New()
+	return date + u.String()[:8]
+}

+ 25 - 0
app/vo/invoice_bill_param.go

@@ -0,0 +1,25 @@
+package vo
+
+type InvoiceBillParam struct {
+	EnterpriseId      string     `json:"enterprise_id"`
+	SubAccountId      int64      `json:"sub_account_id"`
+	InvoiceAmount     float64    `json:"invoice_amount"`     // 开票金额
+	InvoiceBody       string     `json:"invoice_body"`       // 开票方信息
+	InvoiceContent    string     `json:"invoice_content"`    // 发票内容
+	InvoiceType       int64      `json:"invoice_type"`       // 发票类型(1数电普票 2数电专票)
+	InvoiceHead       string     `json:"invoice_head"`       // 发票抬头(企业名称)
+	TaxCode           string     `json:"tax_code"`           // 企业税号
+	RegisteredAddress string     `json:"registered_address"` // 企业注册地址
+	RegisteredPhone   string     `json:"registered_phone"`   // 企业注册电话
+	Bank              string     `json:"bank"`               // 开户银行
+	BankCardNumber    string     `json:"bank_card_number"`   // 银行账号
+	TaskIds           [][]string `json:"task_ids"`           // 账单列表
+}
+
+type InvoiceBillListParam struct {
+	EnterpriseId string `json:"enterprise_id"`
+	SubAccountId int64  `json:"sub_account_id"`
+	BillStatus   int64  `json:"bill_status"` // 开票状态:1开票中 2已开票
+	Page         int    `json:"page"`
+	PageSize     int    `json:"page_size"`
+}

+ 14 - 0
app/vo/invoice_default_param.go

@@ -0,0 +1,14 @@
+package vo
+
+type InvoiceDefaultParam struct {
+	EnterpriseId string `json:"enterprise_id"`
+	HeadType     int64  `json:"head_type"`    // 抬头类型(1企业 2个人)
+	InvoiceType  int64  `json:"invoice_type"` // 发票类型(1数电普票 2数电专票)
+	InvoiceHead  string `json:"invoice_head"` //发票抬头(企业名称)
+	TaxCode      string `json:"tax_code"`     // 企业税号
+
+	RegisteredAddress string `json:"registered_address"` // 企业注册地址
+	RegisteredPhone   string `json:"registered_phone"`   // 企业注册电话
+	Bank              string `json:"bank"`               // 开户银行
+	BankCardNumber    string `json:"bank_card_number"`   // 银行账号
+}

+ 2 - 1
app/vo/pay_wx_param.go

@@ -2,7 +2,8 @@ package vo
 
 type GetCodeUrlParam struct {
 	EnterpriseId string `json:"enterprise_id"` // 企业id
-	Amount       int64  `json:"amount"`        // 金额(分)
+	SubAccountId int64  `json:"sub_account_id"`
+	Amount       int64  `json:"amount"` // 金额(分)
 }
 
 type QueryOrderByTradeIdParam struct {

+ 13 - 0
app/vo/re_billable_info.go

@@ -0,0 +1,13 @@
+package vo
+
+type ReBillableInfo struct {
+	ProductId      int64   `json:"productId"`
+	MainImage      string  `json:"mainImage"`
+	ProductName    string  `json:"productName"`
+	ProductPrice   float64 `json:"productPrice"`
+	Platform       int64   `json:"platform"`
+	CreatorName    string  `json:"creatorName"`
+	TaskType       string  `json:"taskType"` // 任务类型
+	BillableAmount float64 `json:"billableAmount"`
+	TaskId         string  `json:"taskId"`
+}

+ 11 - 0
app/vo/re_invoice_info.go

@@ -0,0 +1,11 @@
+package vo
+
+type ReInvoiceInfo struct {
+	InvoiceHeader     string `json:"invoiceHeader"`     // 发票抬头
+	TaxCode           string `json:"taxCode"`           // 税务登记证号/统一社会信用代码
+	RegisteredAddress string `json:"registeredAddress"` // 企业注册地址
+	RegisteredPhone   string `json:"registeredPhone"`   // 企业注册电话
+	Bank              string `json:"bank"`              // 开户银行
+	BankCardNumber    string `json:"bankCardNumber"`    // 开户银行账号
+	IsDefault         int64  `json:"isDefault"`         // 1默认抬头
+}

+ 13 - 0
app/vo/re_invoice_record.go

@@ -0,0 +1,13 @@
+package vo
+
+type ReInvoiceRecord struct {
+	BillingId     string  `json:"billingId"`
+	InvoiceAmount float64 `json:"invoiceAmount"`
+	CreatorName   string  `json:"creatorName"`
+	SubmitAt      string  `json:"submitAt"`
+	BillingAt     string  `json:"billingAt"`
+	InvoiceBody   string  `json:"invoiceBody"`
+	InvoiceType   int64   `json:"invoiceType"`
+	Status        int64   `json:"status"`
+	TaskNumber    int64   `json:"taskNumber"`
+}

+ 1 - 1
app/vo/re_recharge_info.go

@@ -1,7 +1,7 @@
 package vo
 
 type ReRechargeInfo struct {
-	RechargeId         string  `json:"recharge_id"`
+	RechargeId         string  `json:"rechargeId"`
 	CreatorName        string  `json:"creatorName"`
 	RechargeAmount     float64 `json:"rechargeAmount"`
 	RechargeMethod     int64   `json:"rechargeMethod"` // 1对公转账 2微信支付

+ 2 - 1
app/vo/recharge_param.go

@@ -1,7 +1,8 @@
 package vo
 
 type RechargeParam struct {
-	EnterpriseId  string `json:"enterprise_id"`  // 企业id
+	EnterpriseId  string `json:"enterprise_id"` // 企业id
+	SubAccountId  int64  `json:"sub_account_id"`
 	RechargeState int64  `json:"recharge_state"` // 充值状态(1充值待确认 2已充值 3充值失败)
 	Page          int    `json:"page"`
 	PageSize      int    `json:"page_size"`

+ 1 - 0
app/vo/recharge_transfer_param.go

@@ -2,6 +2,7 @@ package vo
 
 type RechargeTransferParam struct {
 	EnterpriseId       string  `json:"enterprise_id"`
+	SubAccountId       int64   `json:"sub_account_id"`
 	Amount             float64 `json:"amount"`
 	TransferVoucherUrl string  `json:"transfer_voucher_url"`
 }

+ 2 - 2
consts/invoice.go

@@ -14,8 +14,8 @@ func GetHeadType(HeadType string) string {
 }
 
 var InvoiceTypeMap = map[string]string{
-	"1": "增值税专用发票",
-	"2": "增值税普通发票",
+	"1": "数电普票",
+	"2": "数电专票",
 }
 
 func GetInvoiceType(InvoiceType string) string {

+ 5 - 0
route/init.go

@@ -213,6 +213,11 @@ func InitRoute(r *gin.Engine) {
 		finance.POST("/recharge/show", controller.FinanceController{}.ShowRecharge)                  // 充值管理——累计充值金额、确认中金额
 		finance.POST("/recharge/info", controller.FinanceController{}.RechargeInfoList)              // 充值管理——充值记录
 		// YG官方汇款账号
+		finance.POST("/invoice/default/update", controller.FinanceController{}.UpdateInvoiceDefault) // 设置默认开票抬头
+		finance.POST("/invoice/default/get", controller.FinanceController{}.GetInvoiceDefault)       // 获取默认开票抬头
+		finance.POST("/invoice/bill", controller.FinanceController{}.BillInvoice)                    // 确认开票
+		finance.POST("/invoice/list/bill", controller.FinanceController{}.GetBillList)               // 开票记录
+		finance.POST("/invoice/list/billable", controller.FinanceController{}.GetBillableList)       // 可开票账单
 	}
 
 }