Quellcode durchsuchen

[20250214]任务中心迁移

lin-jim-leon vor 2 Monaten
Ursprung
Commit
4c5faf7346
100 geänderte Dateien mit 6192 neuen und 0 gelöschten Zeilen
  1. 5 0
      app/config/review_config.json
  2. 28 0
      app/consts/error_code.go
  3. 27 0
      app/consts/invoice_enums.go
  4. 20 0
      app/consts/platform_icon.go
  5. 31 0
      app/consts/product_type.go
  6. 95 0
      app/consts/project_enums.go
  7. 6 0
      app/consts/session.go
  8. 30 0
      app/controller/account_controller.go
  9. 142 0
      app/controller/bill_controller.go
  10. 30 0
      app/controller/common.go
  11. 31 0
      app/controller/common_controller.go
  12. 270 0
      app/controller/cooperation_controller.go
  13. 241 0
      app/controller/finance_controller.go
  14. 941 0
      app/controller/task_controller.go
  15. 25 0
      app/controller/workspace_controller.go
  16. 49 0
      app/dao/book_info_dao.go
  17. 12 0
      app/dao/common_dao.go
  18. 30 0
      app/dao/dao.go
  19. 92 0
      app/dao/enterprise_dao.go
  20. 68 0
      app/dao/enterprise_supplier_cooperate_dao.go
  21. 34 0
      app/dao/free_strategy_dao.go
  22. 21 0
      app/dao/info_auto_default_dao.go
  23. 21 0
      app/dao/info_auto_task_dao.go
  24. 43 0
      app/dao/info_pricing_strategy_dao.go
  25. 49 0
      app/dao/invoice_info_dao.go
  26. 120 0
      app/dao/invoice_record_dao.go
  27. 34 0
      app/dao/local_life_brief_dao.go
  28. 323 0
      app/dao/local_life_dao.go
  29. 34 0
      app/dao/local_life_material_dao.go
  30. 34 0
      app/dao/local_life_review_dao.go
  31. 155 0
      app/dao/local_life_task_info_dao.go
  32. 18 0
      app/dao/platform_kuaishou_user_info_dao.go
  33. 129 0
      app/dao/product_dao.go
  34. 124 0
      app/dao/product_photo_dao.go
  35. 34 0
      app/dao/project_brief_dao.go
  36. 390 0
      app/dao/project_dao.go
  37. 34 0
      app/dao/project_material_dao.go
  38. 34 0
      app/dao/project_review_dao.go
  39. 137 0
      app/dao/project_task_info_dao.go
  40. 102 0
      app/dao/recharge_record_dao.go
  41. 34 0
      app/dao/recruit_strategy_dao.go
  42. 11 0
      app/dao/region_info_dao.go
  43. 34 0
      app/dao/reward_strategy_dao.go
  44. 71 0
      app/dao/s_project_dao.go
  45. 34 0
      app/dao/sec_brief_dao.go
  46. 34 0
      app/dao/sec_material_dao.go
  47. 34 0
      app/dao/sec_task_info_dao.go
  48. 280 0
      app/dao/selection_info_dao.go
  49. 34 0
      app/dao/selection_review_dao.go
  50. 89 0
      app/dao/store_dao.go
  51. 23 0
      app/dao/sub_account_dao.go
  52. 46 0
      app/dao/supplier_dao.go
  53. 39 0
      app/dao/talent_info_dao.go
  54. 21 0
      app/dao/task_logistics_dao.go
  55. 76 0
      app/dao/team_buying_dao.go
  56. 23 0
      app/dao/user_dao.go
  57. 32 0
      app/entity/book_info.go
  58. 12 0
      app/entity/coop_platform.go
  59. 30 0
      app/entity/enterprise.go
  60. 24 0
      app/entity/enterprise_supplier_cooperate.go
  61. 20 0
      app/entity/free_strategy.go
  62. 28 0
      app/entity/info_auto_default.go
  63. 23 0
      app/entity/info_auto_task.go
  64. 27 0
      app/entity/info_pricing_strategy.go
  65. 11 0
      app/entity/info_product_category.go
  66. 19 0
      app/entity/invoice_address.go
  67. 24 0
      app/entity/invoice_info.go
  68. 33 0
      app/entity/invoice_record.go
  69. 20 0
      app/entity/local_life_brief.go
  70. 59 0
      app/entity/local_life_info.go
  71. 21 0
      app/entity/local_life_material.go
  72. 87 0
      app/entity/local_life_task_info.go
  73. 31 0
      app/entity/platform_kuaishou_user_info.go
  74. 26 0
      app/entity/product.go
  75. 23 0
      app/entity/product_photo.go
  76. 60 0
      app/entity/project.go
  77. 20 0
      app/entity/project_brief.go
  78. 17 0
      app/entity/project_material.go
  79. 61 0
      app/entity/project_task_info.go
  80. 24 0
      app/entity/recharge_record.go
  81. 34 0
      app/entity/recruit_strategy.go
  82. 14 0
      app/entity/region_info.go
  83. 25 0
      app/entity/review_local_life.go
  84. 22 0
      app/entity/review_project.go
  85. 21 0
      app/entity/review_selection.go
  86. 14 0
      app/entity/reward_strategy.go
  87. 42 0
      app/entity/s_project.go
  88. 17 0
      app/entity/sec_brief.go
  89. 17 0
      app/entity/sec_material.go
  90. 46 0
      app/entity/sec_task_info.go
  91. 53 0
      app/entity/selection_info.go
  92. 44 0
      app/entity/selection_task_info.go
  93. 28 0
      app/entity/store.go
  94. 13 0
      app/entity/store_category.go
  95. 19 0
      app/entity/sub_account.go
  96. 20 0
      app/entity/supplier.go
  97. 12 0
      app/entity/talent_category.go
  98. 39 0
      app/entity/talent_info.go
  99. 29 0
      app/entity/task_logistics.go
  100. 25 0
      app/entity/team_buying.go

+ 5 - 0
app/config/review_config.json

@@ -0,0 +1,5 @@
+{
+  "review_ak": "CNN8MCCSJFGHL1MXCJRF",
+  "review_sk": "91arFGHyO7RrzXnZIFSPcLSC6y4P4MTKtkq3qLIy",
+  "project_id": "CNN8MCCSJFGHL1MXCJRF"
+}

+ 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 ""
+}

+ 31 - 0
app/consts/product_type.go

@@ -0,0 +1,31 @@
+package consts
+
+var productTypeMap = map[int64]string{
+	1:  "3C及电器",
+	2:  "食品饮料",
+	3:  "服装配饰",
+	4:  "医疗",
+	5:  "房地产",
+	6:  "家居建材",
+	7:  "教育培训",
+	8:  "出行旅游",
+	9:  "游戏",
+	10: "互联网平台",
+	11: "汽车",
+	12: "文体娱乐",
+	13: "影视传媒",
+	14: "线下店铺",
+	15: "软件服务",
+	16: "美妆",
+	17: "母婴宠物",
+	18: "日化",
+	19: "其他",
+}
+
+func GetProductType(productType int64) string {
+	toast, contain := productTypeMap[productType]
+	if contain {
+		return toast
+	}
+	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"

+ 30 - 0
app/controller/account_controller.go

@@ -0,0 +1,30 @@
+package controller
+
+//
+//import (
+//	"github.com/gin-gonic/gin"
+//	"github.com/sirupsen/logrus"
+//	"youngee_m_api/app/service/review_service"
+//	"youngee_m_api/app/vo"
+//)
+//
+//type AccountController struct{}
+//
+//// 营业执照OCR识别
+//func (t AccountController) OCRIdentify(c *gin.Context) {
+//	param := &vo.IdentifyParam{}
+//	err := c.BindJSON(param)
+//	if err != nil {
+//		logrus.Errorf("Request bind err:%+v\n", err)
+//		returnError(c, 40000, "Parameter Error: "+err.Error())
+//		return
+//	}
+//	reviewService := review_service.GetConfig()
+//	resultMap, err := reviewService.CheckBusinessLicense(param)
+//	if err != nil {
+//		logrus.Errorf("[OCRIdentify] call Show err:%+v\n", err)
+//		returnError(c, 40000, err.Error())
+//		return
+//	}
+//	returnSuccess(c, 20000, resultMap)
+//}

+ 142 - 0
app/controller/bill_controller.go

@@ -0,0 +1,142 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/service"
+	"youngee_m_api/app/vo"
+)
+
+type BillController struct{}
+
+// 电商带货账单列表
+func (f BillController) SelectionBillList(c *gin.Context) {
+	param := &vo.SelectionSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.BillService{}.GetBillSelectionTaskList(param)
+	if err != nil {
+		logrus.Errorf("[SelectionBillList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 电商带货账单支付
+func (f BillController) SelectionPay(c *gin.Context) {
+	param := &vo.PayParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err1 := service.BillService{}.PaySelection(param)
+	if err1 != nil {
+		if err1.Error() == "状态异常" {
+			returnError(c, 31000, err1.Error())
+			return
+		}
+		if err1.Error() == "可用余额不足" {
+			returnError(c, 32000, err1.Error())
+			return
+		}
+		logrus.Errorf("[SelectionPay] call Show err:%+v\n", err)
+		returnError(c, 40000, err1.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}
+
+// 品牌种草账单列表
+func (f BillController) ProjectBillList(c *gin.Context) {
+	param := &vo.ProjectSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.BillService{}.GetBillProjectTaskList(param)
+	if err != nil {
+		logrus.Errorf("[ProjectBillList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 品牌种草账单支付
+func (f BillController) ProjectPay(c *gin.Context) {
+	param := &vo.PayParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err1 := service.BillService{}.PayProject(param)
+	if err1 != nil {
+		if err1.Error() == "状态异常" {
+			returnError(c, 31000, err1.Error())
+			return
+		}
+		if err1.Error() == "可用余额不足" {
+			returnError(c, 32000, err1.Error())
+			return
+		}
+		logrus.Errorf("[ProjectPay] call Show err:%+v\n", err)
+		returnError(c, 40000, err1.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}
+
+// 本地生活账单列表
+func (f BillController) LocalLifeBillList(c *gin.Context) {
+	param := &vo.LocalSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.BillService{}.GetBillLocalLifeTaskList(param)
+	if err != nil {
+		logrus.Errorf("[LocalLifeBillList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 本地生活账单支付
+func (f BillController) LocalLifePay(c *gin.Context) {
+	param := &vo.PayParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err1 := service.BillService{}.PayLocalLife(param)
+	if err1 != nil {
+		if err1.Error() == "状态异常" {
+			returnError(c, 31000, err1.Error())
+			return
+		}
+		if err1.Error() == "可用余额不足" {
+			returnError(c, 32000, err1.Error())
+			return
+		}
+		logrus.Errorf("[LocalLifePay] call Show err:%+v\n", err)
+		returnError(c, 40000, err1.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}

+ 30 - 0
app/controller/common.go

@@ -0,0 +1,30 @@
+package controller
+
+import "github.com/gin-gonic/gin"
+
+type JsonStruct struct {
+	Code int         `json:"code"`
+	Msg  interface{} `json:"msg"`
+	Data interface{} `json:"data"`
+	//Count int64       `json:"count"`
+}
+
+type JsonErrStruct struct {
+	Code int         `json:"code"`
+	Msg  interface{} `json:"msg"`
+}
+
+func returnSuccess(c *gin.Context, code int, data interface{}) {
+	json := &JsonStruct{Code: code, Msg: "ok", Data: data}
+	c.JSON(200, json)
+}
+
+func returnError(c *gin.Context, code int, msg string) {
+	json := &JsonErrStruct{}
+	if msg == "" {
+		json = &JsonErrStruct{Code: code, Msg: "error"}
+	} else {
+		json = &JsonErrStruct{Code: code, Msg: msg}
+	}
+	c.JSON(400, json)
+}

+ 31 - 0
app/controller/common_controller.go

@@ -0,0 +1,31 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/service"
+)
+
+type CommonController struct{}
+
+// 获取合作平台列表
+func (t CommonController) CooperationPlatform(c *gin.Context) {
+	result, err := service.CommonService{}.CooperationPlatform()
+	if err != nil {
+		logrus.Errorf("[CooperationPlatform] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 获取商品类目
+func (t CommonController) ProductCategory(c *gin.Context) {
+	result, err := service.ProductService{}.GetProductCategorys()
+	if err != nil {
+		logrus.Errorf("[ProductCategory] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}

+ 270 - 0
app/controller/cooperation_controller.go

@@ -0,0 +1,270 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"strings"
+	"youngee_m_api/app/service"
+	"youngee_m_api/app/vo"
+)
+
+type CooperationController struct{}
+
+// 服务商端链接
+func (o CooperationController) GetSupplierLink(c *gin.Context) {
+	supplierLink := "服务商端链接"
+	resultMap := make(map[string]string)
+	resultMap["supplierLink"] = supplierLink
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 服务商搜索
+func (o CooperationController) SearchSupplier(c *gin.Context) {
+	param := &vo.SupplierSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.FieldName {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	reSupplierPreviews, err := service.CooperationService{}.SearchSupplier(param)
+	if err != nil {
+		logrus.Errorf("[SearchSupplier] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, reSupplierPreviews)
+}
+
+// 服务商入库批量邀请
+func (o CooperationController) InviteSupplier(c *gin.Context) {
+	param := &vo.SupplierInviteParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err1 := service.CooperationService{}.InviteSupplier(param)
+	if err1 != nil {
+		if strings.Contains(err1.Error(), "Duplicate entry") {
+			logrus.Errorf("[InviteSupplier] call Show err:%+v\n", err)
+			returnError(c, 40000, "请勿邀请已入库服务商")
+		} else {
+			logrus.Errorf("[InviteSupplier] call Show err:%+v\n", err)
+			returnError(c, 40000, err1.Error())
+		}
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}
+
+// 在库服务商列表
+func (o CooperationController) GetEnterprisePoolList(c *gin.Context) {
+	param := &vo.SupplierSearchInPoolParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.EnterpriseId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err1 := service.CooperationService{}.GetEnterprisePoolList(param)
+	if err1 != nil {
+		logrus.Errorf("[GetEnterprisePoolList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 服务商邀请待确认列表
+func (o CooperationController) GetSupplierConfirmingList(c *gin.Context) {
+	param := &vo.SupplierConfirmingParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.EnterpriseId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err1 := service.CooperationService{}.GetSupplierConfirmingList(param)
+	if err1 != nil {
+		logrus.Errorf("[GetSupplierConfirmingList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 门店详情
+func (o CooperationController) GetStoreDetail(c *gin.Context) {
+	param := &vo.StoreSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil || 0 == param.StoreId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	reStoreInfo, err := service.StoreService{}.GetStoreDetail(param)
+	if err != nil {
+		logrus.Errorf("[GetStoreDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, reStoreInfo)
+}
+
+// 更新门店
+func (o CooperationController) UpdateStore(c *gin.Context) {
+	param := &vo.StoreUpdateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	storeId, err := service.StoreService{}.UpdateStore(param)
+	if err != nil {
+		logrus.Errorf("[UpdateStore] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["storeId"] = storeId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 删除门店
+func (o CooperationController) DeleteStore(c *gin.Context) {
+	param := &vo.StoreUpdateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	storeId, err := service.StoreService{}.DeleteStore(param)
+	if err != nil {
+		logrus.Errorf("[DeleteStore] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["storeId"] = storeId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 团购详情
+func (o CooperationController) GetTeamBuyingDetail(c *gin.Context) {
+	param := &vo.TeamBuyingSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil || 0 == param.TeamBuyingId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	reTeamBuyingInfo, err := service.TeamBuyingService{}.GetTeamBuyingDetail(param)
+	if err != nil {
+		logrus.Errorf("[GetTeamBuyingDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, reTeamBuyingInfo)
+}
+
+// 更新团购
+func (o CooperationController) UpdateTeamBuying(c *gin.Context) {
+	param := &vo.TeamBuyingUpdateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	teamBuyingId, err := service.TeamBuyingService{}.UpdateTeamBuying(param)
+	if err != nil {
+		logrus.Errorf("[UpdateTeamBuying] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["teamBuyingId"] = teamBuyingId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 删除团购
+func (o CooperationController) DeleteTeamBuying(c *gin.Context) {
+	param := &vo.TeamBuyingUpdateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	teamBuyingId, err := service.TeamBuyingService{}.DeleteTeamBuying(param)
+	if err != nil {
+		logrus.Errorf("[DeleteTeamBuying] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["teamBuyingId"] = teamBuyingId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 商品详情
+func (o CooperationController) GetProductDetail(c *gin.Context) {
+	param := &vo.ProductSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil || 0 == param.ProductId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	reStoreInfo, err := service.ProductService{}.GetProductDetail(param)
+	if err != nil {
+		logrus.Errorf("[GetProductDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, reStoreInfo)
+}
+
+// 更新商品
+func (o CooperationController) UpdateProduct(c *gin.Context) {
+	param := &vo.ProductUpdateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	productId, err := service.ProductService{}.UpdateProduct(param)
+	if err != nil {
+		logrus.Errorf("[UpdateProduct] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["productId"] = productId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 删除商品
+func (o CooperationController) DeleteProduct(c *gin.Context) {
+	param := &vo.ProductUpdateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	productId, err := service.ProductService{}.DeleteProduct(param)
+	if err != nil {
+		logrus.Errorf("[DeleteProduct] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["productId"] = productId
+	returnSuccess(c, 20000, resultMap)
+}

+ 241 - 0
app/controller/finance_controller.go

@@ -0,0 +1,241 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/service"
+	"youngee_m_api/app/util"
+	"youngee_m_api/app/vo"
+)
+
+type FinanceController struct{}
+
+// 充值管理——对公转账
+func (f FinanceController) TransferToPublic(c *gin.Context) {
+	param := &vo.RechargeTransferParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	rechargeId, err := service.RechargeService{}.TransferToPublic(param)
+	if err != nil {
+		logrus.Errorf("[TransferToPublic] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["rechargeId"] = *rechargeId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 获取微信支付CodeUrl
+func (f FinanceController) GetCodeUrl(c *gin.Context) {
+	param := &vo.GetCodeUrlParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	tradeId := util.GenerateDateRelatedUUID(16)
+	codeUrl, timeExpire, err := service.RechargeService{}.NativeApiServicePrepay(param.EnterpriseId, param.SubAccountId, tradeId, param.Amount)
+	if err != nil {
+		logrus.Errorf("[GetCodeUrl] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	reCodeUrl := vo.ReCodeUrl{
+		CodeUrl:    codeUrl,
+		TradeId:    tradeId,
+		TimeExpire: timeExpire.Format("2006-01-02 15:04:05"),
+	}
+	returnSuccess(c, 20000, reCodeUrl)
+}
+
+// 根据交易id查询微信是否扫码付款
+func (f FinanceController) QueryOrderByTradeId(c *gin.Context) {
+	param := &vo.QueryOrderByTradeIdParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	tradeState, err := service.RechargeService{}.QueryOrderByTradeId(param.EnterpriseId, param.SubAccountId, param.TradeId)
+	if err != nil {
+		logrus.Errorf("[QueryOrderByTradeId] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["tradeState"] = tradeState
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 余额管理——总金额、可用余额、冻结金额
+func (f FinanceController) ShowBalance(c *gin.Context) {
+	param := &vo.BalanceParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	reBalanceShow, err := service.RechargeService{}.ShowBalance(param)
+	if err != nil {
+		logrus.Errorf("[ShowBalance] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, reBalanceShow)
+}
+
+// 余额管理——冻结记录
+func (f FinanceController) FrozenInfoList(c *gin.Context) {
+	param := &vo.BalanceParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.RechargeService{}.FrozenInfoList(param)
+	if err != nil {
+		logrus.Errorf("[FrozenInfoList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 充值管理——累计充值金额、确认中金额
+func (f FinanceController) ShowRecharge(c *gin.Context) {
+	param := &vo.RechargeParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	reRechargeShow, err := service.RechargeService{}.ShowRecharge(param)
+	if err != nil {
+		logrus.Errorf("[ShowRecharge] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, reRechargeShow)
+}
+
+// 充值管理——充值记录
+func (f FinanceController) RechargeInfoList(c *gin.Context) {
+	param := &vo.RechargeParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.RechargeService{}.RechargeInfoList(param)
+	if err != nil {
+		logrus.Errorf("[RechargeInfoList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 设置默认开票抬头
+func (f 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, "Parameter Error: "+err.Error())
+		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 (f 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, "Parameter Error: "+err.Error())
+		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 (f 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, "Parameter Error: "+err.Error())
+		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 (f 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, "Parameter Error: "+err.Error())
+		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 (f 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, "Parameter Error: "+err.Error())
+		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)
+}

+ 941 - 0
app/controller/task_controller.go

@@ -0,0 +1,941 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/service"
+	"youngee_m_api/app/vo"
+)
+
+type TaskController struct{}
+
+type SelectionDetailParam struct {
+	SelectionId string `json:"selection_id"`
+	//EnterpriseId string `json:"enterprise_id"`
+	//SubAccountId int    `json:"sub_account_id"`
+}
+
+type ProjectDetailParam struct {
+	ProjectId string `json:"project_id"`
+	//EnterpriseId string `json:"enterprise_id"`
+	//SubAccountId int    `json:"sub_account_id"`
+}
+
+type LocalLifeDetailParam struct {
+	LocalLifeId string `json:"local_id"`
+	//EnterpriseId string `json:"enterprise_id"`
+	//SubAccountId int    `json:"sub_account_id"`
+}
+
+// 关联商品-已有商品展示
+func (t TaskController) GetAllProduct(c *gin.Context) {
+	search := vo.GetAllProductParam{}
+	err := c.BindJSON(&search)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	var result vo.ResultVO
+	result, err = service.ProductService{}.GetTaskProductsByUserId(search)
+	if err != nil {
+		logrus.Errorf("[GetAllProduct] call GetAllProduct err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+	return
+}
+
+// 关联商品-新建商品
+func (t TaskController) CreateProduct(c *gin.Context) {
+	data := &vo.ProductCreateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	productId, err := service.ProductService{}.CreateProduct(data)
+	if err != nil {
+		logrus.Errorf("[CreateProduct] call CreateProduct err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["productId"] = productId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 关联商品-完成关联创建带货任务
+func (t TaskController) CreateSelection(c *gin.Context) {
+	//data := &vo.SelectionInfoCreateParam{}
+	data := &vo.SelectionInfoCreateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	selectionId, err := service.SelectionInfoService{}.CreateSelectionInfo(data)
+	if err != nil {
+		logrus.Errorf("[CreateSelection] call CreateSelection err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["selectionId"] = *selectionId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 更新带货任务(样品奖励、补充信息)
+func (t TaskController) UpdateSelection(c *gin.Context) {
+	data := &vo.SelectionInfoUpdateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	selectionId, err := service.SelectionInfoService{}.UpdateSelectionInfo(data)
+	if err != nil {
+		logrus.Errorf("[UpdateSelection] call UpdateSelection err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["selectionId"] = *selectionId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 电商带货任务预览
+func (t TaskController) GetSelectionDetail(c *gin.Context) {
+	data := &SelectionDetailParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.SelectionInfoService{}.GetSelectionDetail(data.SelectionId)
+	if err != nil {
+		logrus.Errorf("[GetSelectionDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+//// 电商带货提交审核
+//func (t TaskController) SelectionToReview(c *gin.Context) {
+//	data := &vo.SelectionInfoUpdateParam{}
+//	err := c.BindJSON(data)
+//	if err != nil || data.SelectionID == "" {
+//		logrus.Errorf("Request bind err:%+v\n", err)
+//		returnError(c, 40000, "Parameter Error: "+err.Error())
+//		return
+//	}
+//	selectionId, err := service.SelectionInfoService{}.SelectionToReview(data)
+//	if err != nil {
+//		logrus.Errorf("[SelectionToReview] call SelectionToReview err:%+v\n", err)
+//		returnError(c, 40000, err.Error())
+//		return
+//	}
+//	resultMap := make(map[string]string)
+//	resultMap["selectionId"] = *selectionId
+//	returnSuccess(c, 20000, resultMap)
+//}
+
+// 电商带货任务列表
+func (t TaskController) SelectionTaskList(c *gin.Context) {
+	param := &vo.SelectionSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.SelectionInfoService{}.GetSelectionTaskList(param)
+	if err != nil {
+		logrus.Errorf("[SelectionTaskList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 删除带货任务
+func (t TaskController) SelectionDel(c *gin.Context) {
+	param := &vo.SelectionSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	selectionId, err := service.SelectionInfoService{}.DeleteSelection(param.SelectionId)
+	if err != nil {
+		logrus.Errorf("[SelectionDel] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["selectionId"] = *selectionId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 创建种草任务
+func (t TaskController) CreateProject(c *gin.Context) {
+	data := &vo.ProjectCreateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	projectId, err := service.ProjectService{}.CreateProject(data)
+	if err != nil {
+		logrus.Errorf("[CreateProject] call CreateProject err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["projectId"] = *projectId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 更新种草任务
+func (t TaskController) UpdateProject(c *gin.Context) {
+	data := &vo.ProjectUpdateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	projectId, err := service.ProjectService{}.UpdateProject(data)
+	if err != nil {
+		logrus.Errorf("[UpdateProject] call UpdateProject err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["projectId"] = *projectId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 更新定向种草任务
+func (t TaskController) UpdateProjectTarget(c *gin.Context) {
+	data := &vo.ProjectUpdateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	projectId, err := service.ProjectService{}.UpdateProjectTarget(data)
+	if err != nil {
+		logrus.Errorf("[UpdateProject] call UpdateProject err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["projectId"] = *projectId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 种草任务预览
+func (t TaskController) GetProjectDetail(c *gin.Context) {
+	data := &ProjectDetailParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.ProjectService{}.GetProjectDetail(data.ProjectId)
+	if err != nil {
+		logrus.Errorf("[GetProjectDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+//// 种草提交审核
+//func (t TaskController) ProjectToReview(c *gin.Context) {
+//	data := &vo.ProjectUpdateParam{}
+//	err := c.BindJSON(data)
+//	if err != nil || data.ProjectID == "" {
+//		logrus.Errorf("Request bind err:%+v\n", err)
+//		returnError(c, 40000, "Parameter Error: "+err.Error())
+//		return
+//	}
+//	projectId, err := service.ProjectService{}.ProjectToReview(data)
+//	if err != nil {
+//		logrus.Errorf("[ProjectToReview] call ProjectToReview err:%+v\n", err)
+//		returnError(c, 40000, err.Error())
+//		return
+//	}
+//	resultMap := make(map[string]string)
+//	resultMap["projectId"] = *projectId
+//	returnSuccess(c, 20000, resultMap)
+//}
+
+// 种草任务列表
+func (t TaskController) ProjectTaskList(c *gin.Context) {
+	param := &vo.ProjectSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.ProjectService{}.GetProjectTaskList(param)
+	if err != nil {
+		logrus.Errorf("[ProjectTaskList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 删除种草任务
+func (t TaskController) ProjectDel(c *gin.Context) {
+	param := &vo.ProjectSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	projectId, err := service.ProjectService{}.DeleteProject(param.ProjectId)
+	if err != nil {
+		logrus.Errorf("[ProjectDel] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["projectId"] = *projectId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 草稿箱——电商带货
+func (t TaskController) GetSelectionDraftList(c *gin.Context) {
+	param := &vo.SelectionDraftParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.SelectionInfoService{}.GetSelectionDraftList(param)
+	if err != nil {
+		logrus.Errorf("[SelectionTaskList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 草稿箱——品牌种草
+func (t TaskController) GetProjectDraftList(c *gin.Context) {
+	param := &vo.ProjectDraftParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.ProjectService{}.GetProjectDraftList(param)
+	if err != nil {
+		logrus.Errorf("[ProjectTaskList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 草稿箱——本地生活
+func (t TaskController) GetLocalLifeDraftList(c *gin.Context) {
+	param := &vo.LocalDraftParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.LocalLifeService{}.GetLocalLifeDraftList(param)
+	if err != nil {
+		logrus.Errorf("[LocalLifeTaskList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——违约公开任务列表
+func (t TaskController) GetPublicDefaultList(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.DefaultService{}.GetPublicDefaultList(param)
+	if err != nil {
+		logrus.Errorf("[GetPublicDefaultList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——违约定向任务列表
+func (t TaskController) GetTargetDefaultList(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.DefaultService{}.GetTargetDefaultList(param)
+	if err != nil {
+		logrus.Errorf("[GetTargetDefaultList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——公开任务-违约达人列表
+func (t TaskController) GetPublicDefaultTalentList(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.DefaultService{}.GetPublicDefaultTalentList(param)
+	if err != nil {
+		logrus.Errorf("[GetPublicDefaultTalentList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——定向任务-违约达人列表
+func (t TaskController) GetTargetDefaultTalentList(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.DefaultService{}.GetTargetDefaultTalentList(param)
+	if err != nil {
+		logrus.Errorf("[GetTargetDefaultTalentList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——达人解约
+func (t TaskController) CancelTalent(c *gin.Context) {
+	param := &vo.TalentCancelParam{}
+	err := c.BindJSON(param)
+	if err != nil || param.TaskId == "" {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err = service.DefaultService{}.CancelTalent(param)
+	if err != nil {
+		logrus.Errorf("[CancelTalent] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["taskId"] = param.TaskId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 违约管理——达人批量解约
+func (t TaskController) CancelTalentList(c *gin.Context) {
+	param := &vo.TalentCancelParam{}
+	err := c.BindJSON(param)
+	if err != nil || param.TaskIds == nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err = service.DefaultService{}.CancelTalentList(param)
+	if err != nil {
+		logrus.Errorf("[CancelTalentList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string][]string)
+	resultMap["taskIds"] = param.TaskIds
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 服务商合作-服务商列表
+func (o TaskController) GetSupplierInTargetTaskList(c *gin.Context) {
+	param := &vo.SupplierSearchInTargetTaskParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.EnterpriseId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err1 := service.CooperationService{}.GetSupplierInTargetTaskList(param)
+	if err1 != nil {
+		logrus.Errorf("[GetSuplierList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 服务商合作-邀约合作
+func (o TaskController) InviteSupplier(c *gin.Context) {
+	param := &vo.SupplierInviteInTargetTaskParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err1 := service.CooperationService{}.InviteSupplierInTargetTask(param)
+	if err1 != nil {
+		logrus.Errorf("[InviteSupplier] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}
+
+// 门店类目
+func (t TaskController) GetStoreCategory(c *gin.Context) {
+	res, err := service.StoreService{}.GetStoreCategory()
+	if err != nil {
+		logrus.Errorf("[GetStoreCategory] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, res)
+}
+
+// 达人内容类型
+func (t TaskController) GetTalentCategory(c *gin.Context) {
+	res, err := service.ProjectService{}.GetTalentCategory()
+	if err != nil {
+		logrus.Errorf("[GetTalentCategory] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, res)
+}
+
+// 关联门店-已有门店展示
+func (t TaskController) GetAllStore(c *gin.Context) {
+	search := vo.GetAllStoreParam{}
+	err := c.BindJSON(&search)
+	if err != nil || search.EnterpriseId == "" {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	var result vo.ResultVO
+	result, err = service.StoreService{}.GetStoresByEnterpriseId(search)
+	if err != nil {
+		logrus.Errorf("[GetAllStore] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 关联门店-新建门店
+func (t TaskController) CreateStore(c *gin.Context) {
+	param := &vo.StoreCreateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	storeId, err := service.StoreService{}.CreateStore(param)
+	if err != nil {
+		logrus.Errorf("[CreateStore] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["storeId"] = storeId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 门店团购列表
+func (t TaskController) GetAllTeamBuying(c *gin.Context) {
+	search := vo.GetAllTeamBuyingParam{}
+	err := c.BindJSON(&search)
+	if err != nil || search.StoreId == 0 {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	var result vo.ResultVO
+	result, err = service.TeamBuyingService{}.GetTeamBuyingsByStoreId(search)
+	if err != nil {
+		logrus.Errorf("[GetAllTeamBuying] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 新建团购
+func (t TaskController) CreateTeamBuying(c *gin.Context) {
+	param := &vo.TeamBuyingCreateParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	teamBuyingId, err := service.TeamBuyingService{}.CreateTeamBuying(param)
+	if err != nil {
+		logrus.Errorf("[CreateTeamBuying] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]int64)
+	resultMap["teamBuyingId"] = teamBuyingId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 创建本地生活任务
+func (t TaskController) CreateLocalLife(c *gin.Context) {
+	data := &vo.LocalCreateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	localId, err := service.LocalLifeService{}.CreateLocalLife(data)
+	if err != nil {
+		logrus.Errorf("[CreateLocalLife] call CreateLocalLife err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["localId"] = *localId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 更新本地生活任务
+func (t TaskController) UpdateLocalLife(c *gin.Context) {
+	data := &vo.LocalUpdateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	localId, err := service.LocalLifeService{}.UpdateLocal(data)
+	if err != nil {
+		logrus.Errorf("[UpdateLocalLife] call UpdateLocalLife err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["localId"] = *localId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 更新定向本地生活任务
+func (t TaskController) UpdateLocalLifeTarget(c *gin.Context) {
+	data := &vo.LocalUpdateParam{}
+	err := c.BindJSON(data)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	localId, err := service.LocalLifeService{}.UpdateLocalTarget(data)
+	if err != nil {
+		logrus.Errorf("[UpdateLocalLifeTarget] call UpdateLocalLifeTarget err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["localId"] = *localId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 本地生活任务预览
+func (t TaskController) GetLocalLifeDetail(c *gin.Context) {
+	param := &LocalLifeDetailParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.LocalLifeService{}.GetLocalLifeDetail(param.LocalLifeId)
+	if err != nil {
+		logrus.Errorf("[GetLocalLifeDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+//// 本地生活提交审核
+//func (t TaskController) LocalLifeToReview(c *gin.Context) {
+//	data := &vo.LocalUpdateParam{}
+//	err := c.BindJSON(data)
+//	if err != nil || data.LocalID == "" {
+//		logrus.Errorf("Request bind err:%+v\n", err)
+//		returnError(c, 40000, "Parameter Error: "+err.Error())
+//		return
+//	}
+//	localId, err := service.LocalLifeService{}.LocalLifeToReview(data)
+//	if err != nil {
+//		logrus.Errorf("[ProjectToReview] call ProjectToReview err:%+v\n", err)
+//		returnError(c, 40000, err.Error())
+//		return
+//	}
+//	resultMap := make(map[string]string)
+//	resultMap["localId"] = *localId
+//	returnSuccess(c, 20000, resultMap)
+//}
+
+// 达人物流列表
+func (t TaskController) LogisticsTalentList(c *gin.Context) {
+	param := &vo.LogisticsTalentParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.ProjectId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.TaskInfoService{}.LogisticsTalentList(param)
+	if err != nil {
+		logrus.Errorf("[LogisticsTalentList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 本地生活列表
+func (t TaskController) LocalLifeTaskList(c *gin.Context) {
+	param := &vo.LocalSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.LocalLifeService{}.GetLocalLifeTaskList(param)
+	if err != nil {
+		logrus.Errorf("[LocalLifeTaskList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 删除本地生活任务
+func (t TaskController) LocalLifeDel(c *gin.Context) {
+	param := &vo.LocalSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	localId, err := service.LocalLifeService{}.DeleteLocalLife(param.LocalId)
+	if err != nil {
+		logrus.Errorf("[LocalLifeDel] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["localId"] = *localId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 探店本地生活列表
+func (t TaskController) StoreExploreList(c *gin.Context) {
+	param := &vo.LocalSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.LocalLifeService{}.GetStoreExploreList(param)
+	if err != nil {
+		logrus.Errorf("[StoreExploreList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, res)
+}
+
+// 探店达人详情
+func (t TaskController) StoreExploreInfo(c *gin.Context) {
+	param := &vo.StoreExploreParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.LocalLifeService{}.GetStoreExploreInfo(param)
+	if err != nil {
+		logrus.Errorf("[StoreExploreInfo] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, res)
+}
+
+// 探店终止合作
+func (t TaskController) StoreExploreOver(c *gin.Context) {
+	param := &vo.LocalTalentOperateParam{}
+	err := c.BindJSON(param)
+	if err != nil || param.TaskId == "" {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, err := service.LocalLifeService{}.StoreExploreOver(param)
+	if err != nil {
+		logrus.Errorf("[StoreExploreOver] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, res)
+}
+
+// 预约时间批量同意/驳回
+func (t TaskController) StoreExploreOperate(c *gin.Context) {
+	param := &vo.LocalTalentOperateParam{}
+	err := c.BindJSON(param)
+	if err != nil || param.TaskIds == nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	err = service.LocalLifeService{}.StoreExploreOperate(param)
+	if err != nil {
+		logrus.Errorf("[StoreExploreOperate] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}
+
+// 电商带货看数据-达人数据
+func (t TaskController) TalentDataDetail(c *gin.Context) {
+	param := &vo.SelectionShowDataParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.ViewDataService{}.SelectionTalentDataDetail(param)
+	if err != nil {
+		logrus.Errorf("[TalentDataDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]vo.ReSelectionTalentData)
+	resultMap["dataInfo"] = result
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 电商带货看数据-领样数据
+func (t TaskController) SampleDataDetail(c *gin.Context) {
+	param := &vo.SelectionShowDataParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.ViewDataService{}.SelectionSampleDataDetail(param)
+	if err != nil {
+		logrus.Errorf("[SampleDataDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]vo.ReSelectionSampleData)
+	resultMap["dataInfo"] = result
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 电商带货看数据-带货数据
+func (t TaskController) SelectionDataDetail(c *gin.Context) {
+	param := &vo.SelectionShowDataParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.ViewDataService{}.SelectionDataDetail(param)
+	if err != nil {
+		logrus.Errorf("[SelectionDataDetail] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	resultMap := make(map[string]vo.ReSelectionData)
+	resultMap["dataInfo"] = result
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 电商带货执行中-悬赏兑现
+func (t TaskController) SelectionRewardCash(c *gin.Context) {
+	param := &vo.SelectionRewardCashParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err1 := service.TaskInfoService{}.SelectionRewardCashDetail(param)
+	if err1 != nil {
+		logrus.Errorf("[SelectionRewardCash] call Show err:%+v\n", err)
+		returnError(c, 40000, err1.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}

+ 25 - 0
app/controller/workspace_controller.go

@@ -0,0 +1,25 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"youngee_m_api/app/service"
+)
+
+type WorkspaceController struct{}
+
+type GetTakegoodsInfoParam struct {
+	EnterpriseId string `json:"enterprise_id"`
+	DateRange    string `json:"days"`
+}
+
+func (w WorkspaceController) GetTakegoodsInfo(c *gin.Context) {
+	search := &GetTakegoodsInfoParam{}
+	err := c.BindJSON(&search)
+	if err != nil {
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result := service.EnterpriseService{}.GetEnterpriseTakegoodsInfo(search.EnterpriseId, search.DateRange)
+
+	returnSuccess(c, 20000, result)
+}

+ 49 - 0
app/dao/book_info_dao.go

@@ -0,0 +1,49 @@
+package dao
+
+import (
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type BookInfoDao struct{}
+
+// 获取指定任务id的最新预约记录
+func (d BookInfoDao) GetLastByTaskId(taskId string) (*entity.BookInfo, error) {
+	var bookInfo entity.BookInfo
+	err := Db.Model(&entity.BookInfo{}).Where("task_id = ?", taskId).Order("create_at DESC").First(&bookInfo).Error
+	if err != nil {
+		if err == gorm.ErrRecordNotFound {
+			return &bookInfo, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &bookInfo, nil
+}
+
+// 更新预约状态
+func (d BookInfoDao) UpdateBookStatus(bookIds []int64, bookInfo entity.BookInfo) error {
+	err := Db.Debug().Model(&entity.BookInfo{}).Where("book_id IN ?", bookIds).Updates(bookInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 更新字段
+func (d BookInfoDao) UpdateField(bookId int64, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.BookInfo{}).Where("book_id = ?", bookId).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 批量更新字段
+func (d BookInfoDao) UpdateFieldBatch(bookIds []int64, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.BookInfo{}).Where("book_id IN ?", bookIds).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 12 - 0
app/dao/common_dao.go

@@ -0,0 +1,12 @@
+package dao
+
+import "youngee_m_api/app/entity"
+
+type CommonDao struct{}
+
+// 获取所有合作平台icon
+func (d CommonDao) GetCoopPlatform() ([]entity.CoopPlatform, error) {
+	var coopPlatforms []entity.CoopPlatform
+	err := Db.Model(&entity.CoopPlatform{}).Find(&coopPlatforms).Order("id").Error
+	return coopPlatforms, err
+}

+ 30 - 0
app/dao/dao.go

@@ -0,0 +1,30 @@
+package dao
+
+import (
+	"fmt"
+	"gorm.io/driver/mysql"
+
+	"gorm.io/gorm"
+	"youngee_m_api/model/system_model"
+)
+
+var (
+	Db  *gorm.DB
+	err error
+)
+
+func Init(config *system_model.Mysql) {
+	dsn := "%v:%v@tcp(%v:%v)/%v?charset=utf8mb4&parseTime=True&loc=Local"
+	dsn = fmt.Sprintf(dsn, config.User, config.Password, config.Host, config.Port, config.Database)
+	Db, err = gorm.Open(mysql.Open(dsn), &gorm.Config{})
+	if err != nil {
+		panic(err)
+	}
+	if Db.Error != nil {
+		panic(err)
+	}
+
+	//Db.DB().SetMaxIdleConns(10)
+	//Db.DB().SetMaxOpenConns(100)
+	//Db.DB().SetConnMaxLifetime(time.Hour)
+}

+ 92 - 0
app/dao/enterprise_dao.go

@@ -0,0 +1,92 @@
+package dao
+
+import (
+	"errors"
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type EnterpriseDao struct{}
+
+func (d EnterpriseDao) GetEnterpriseInfo(enterpriseId string) (*entity.Enterprise, error) {
+	var enterprise entity.Enterprise
+	err := Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Find(&enterprise).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &enterprise, nil
+}
+
+func (d EnterpriseDao) GetEnterprise(enterpriseId string) (*entity.Enterprise, error) {
+	var enterprise entity.Enterprise
+	err := Db.Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Select("business_name, user_id").Find(&enterprise).Error
+	if err != nil {
+		return nil, err
+	}
+	return &enterprise, nil
+}
+
+func (d EnterpriseDao) GetEnterprisePhone(enterpriseId string) (string, error) {
+	var phone string
+	err := Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Select("phone").Find(&phone).Error
+	if err != nil {
+		return "", err
+	}
+	return phone, nil
+}
+
+// 充值-更新账户余额
+func (d EnterpriseDao) UpdateEnterpriseBalance(enterpriseId string, amount float64) (*string, error) {
+	var enterprise entity.Enterprise
+	var err error
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Find(&enterprise).Error
+	if err != nil {
+		return nil, err
+	}
+	newBalance := enterprise.Balance + amount
+	newAvailableBalance := enterprise.AvailableBalance + amount
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Updates(entity.Enterprise{
+		Balance:          newBalance,
+		AvailableBalance: newAvailableBalance}).Error
+	if err != nil {
+		return nil, err
+	}
+	return &enterpriseId, nil
+}
+
+// 支付-更新账户余额、冻结金额
+func (d EnterpriseDao) UpdateEnterpriseBalanceAndFrozen(enterpriseId string, amount float64) (*string, error) {
+	var enterprise entity.Enterprise
+	var err error
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Find(&enterprise).Error
+	if err != nil {
+		return nil, err
+	}
+	if enterprise.AvailableBalance < amount {
+		return nil, errors.New("可用余额不足")
+	}
+	newBalance := enterprise.Balance - amount
+	newAvailableBalance := enterprise.AvailableBalance - amount
+	newFrozenBalance := enterprise.FrozenBalance + amount
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Updates(entity.Enterprise{
+		Balance:          newBalance,
+		AvailableBalance: newAvailableBalance,
+		FrozenBalance:    newFrozenBalance}).Error
+	if err != nil {
+		return nil, err
+	}
+	return &enterpriseId, nil
+}
+
+// 更新商家信息
+func (d EnterpriseDao) UpdateEnterprise(enterprise entity.Enterprise) error {
+	err := Db.Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterprise.EnterpriseID).Updates(enterprise).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 68 - 0
app/dao/enterprise_supplier_cooperate_dao.go

@@ -0,0 +1,68 @@
+package dao
+
+import (
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type EnterpriseSupplierCooperateDao struct{}
+
+// 检查给定的服务商是否在该商家库中
+func (d EnterpriseSupplierCooperateDao) EnterpriseDatabaseCheck(enterpriseId string, supplierId int64) (bool, error) {
+	var count int64
+	err := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND supplier_id = ? AND cooperate_status != 2", enterpriseId, supplierId).Count(&count).Error
+	if err != nil {
+		return false, err
+	}
+	return count > 0, nil
+}
+
+// 批量插入数据
+func (d EnterpriseSupplierCooperateDao) InsertBatch(records []*entity.EnterpriseSupplierCooperate) error {
+	result := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Omit("agree_time", "reject_time").Create(&records)
+	return result.Error
+}
+
+// 获取指定商家的服务商库
+func (d EnterpriseSupplierCooperateDao) GetSupplierByEnterprise(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+	var total int64
+	offset := (page - 1) * pageSize
+	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", enterpriseId)
+	query.Count(&total)
+	query = query.Select("supplier_id, cooperate_num, upload_talent_num, cooperate_talent_num, b_operator, b_operator_type, agree_time")
+	err := query.Order("agree_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return enterpriseSupplierCooperates, total, nil
+}
+
+// 获取指定商家的某个服务商数据
+func (d EnterpriseSupplierCooperateDao) GetDataByEnterpriseAndSupplier(enterpriseId string, supplierId int64) (*entity.EnterpriseSupplierCooperate, error) {
+	var enterpriseSupplierCooperate *entity.EnterpriseSupplierCooperate
+	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND supplier_id = ?", enterpriseId, supplierId)
+	query = query.Select("supplier_id, cooperate_num, upload_talent_num, cooperate_talent_num, b_operator, b_operator_type")
+	err := query.Find(&enterpriseSupplierCooperate).Error
+	if err != nil && err != gorm.ErrRecordNotFound {
+		return nil, err
+	}
+	return enterpriseSupplierCooperate, nil
+}
+
+// 获取邀请待确认的服务商
+func (d EnterpriseSupplierCooperateDao) GetSupplierConfirmingList(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+	var total int64
+	offset := (page - 1) * pageSize
+	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", enterpriseId)
+	query.Count(&total)
+	query = query.Select("supplier_id,  b_operator, b_operator_type, cooperate_status, create_time")
+	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return enterpriseSupplierCooperates, total, nil
+}

+ 34 - 0
app/dao/free_strategy_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type FreeStrategyDao struct{}
+
+func (d FreeStrategyDao) DeleteFreeStrategyBySelectionId(selectionId string) error {
+	err := Db.Where("selection_id = ?", selectionId).Delete(&entity.FreeStrategy{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d FreeStrategyDao) CreateFreeStrategy(freeStrategys []entity.FreeStrategy) error {
+	err := Db.Create(&freeStrategys).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d FreeStrategyDao) GetFreeStrategyBySelectionId(selectionId string) ([]*entity.FreeStrategy, error) {
+	var freeStrategys []*entity.FreeStrategy
+	err := Db.Model(entity.FreeStrategy{}).Where("selection_id = ?", selectionId).Find(&freeStrategys).Error
+	if err != nil {
+		logrus.Errorf("[GetFreeStrategyBySelectionId] error query, err:%+v", err)
+		return nil, err
+	}
+	return freeStrategys, nil
+}

+ 21 - 0
app/dao/info_auto_default_dao.go

@@ -0,0 +1,21 @@
+package dao
+
+import (
+	"youngee_m_api/app/entity"
+)
+
+type InfoAutoDefaultDao struct{}
+
+// 获取指定 enterpriseId 下的最新一条自动任务配置
+func (d InfoAutoDefaultDao) GetAutoDefaultLast(enterpriseId string) entity.InfoAutoDefault {
+	autoDefaultInfo := entity.InfoAutoDefault{}
+	Db.Model(&entity.InfoAutoDefault{}).Where("enterprise_id = ?", enterpriseId).Last(&autoDefaultInfo)
+	return autoDefaultInfo
+}
+
+// 获取指定 auto_default_id 的指定字段值
+func (d InfoAutoDefaultDao) GetValueByIdFieldName(autoDefaultId int64, fieldName string) int64 {
+	var value int64
+	Db.Model(&entity.InfoAutoDefault{}).Select(fieldName).Where("auto_default_id = ?", autoDefaultId).Find(&value)
+	return value
+}

+ 21 - 0
app/dao/info_auto_task_dao.go

@@ -0,0 +1,21 @@
+package dao
+
+import (
+	"youngee_m_api/app/entity"
+)
+
+type InfoAutoTaskDao struct{}
+
+// 获取指定 enterpriseId 下的最新一条自动任务配置
+func (d InfoAutoTaskDao) GetAutoTaskLast(enterpriseId string) entity.InfoAutoTask {
+	autoTaskInfo := entity.InfoAutoTask{}
+	Db.Model(&entity.InfoAutoTask{}).Where("enterprise_id = ?", enterpriseId).Last(&autoTaskInfo)
+	return autoTaskInfo
+}
+
+// 获取指定 autoTaskId 的指定字段值
+func (d InfoAutoTaskDao) GetValueByIdFieldName(autoTaskId int64, fieldName string) entity.InfoAutoTask {
+	autoTaskInfo := entity.InfoAutoTask{}
+	Db.Model(&entity.InfoAutoTask{}).Select(fieldName).Where("auto_task_id = ?", autoTaskId).First(&autoTaskInfo)
+	return autoTaskInfo
+}

+ 43 - 0
app/dao/info_pricing_strategy_dao.go

@@ -0,0 +1,43 @@
+package dao
+
+import (
+	"fmt"
+	log "github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type InfoPricingStrategylDao struct{}
+
+func (d InfoPricingStrategylDao) GetPricingStrategy(fansLow int64, fansUp int64, feeForm int64, platForm int64) (*entity.InfoPricingStrategy, error) {
+	// fansLow粉丝量下限  fansUp粉丝量上限  feeForm稿费形式 1产品置换 2固定稿费 3自报价  platForm平台
+	var pricingStrategys []entity.InfoPricingStrategy
+	whereStr := fmt.Sprintf("fee_form = %d and platform = %d and fans_low <= %d and fans_up > %d", feeForm, platForm, fansLow, fansLow)
+	orStr := fmt.Sprintf("fee_form = %d and platform = %d and fans_low < %d and fans_up >= %d", feeForm, platForm, fansUp, fansUp)
+	orStr1 := fmt.Sprintf("fee_form = %d and platform = %d and fans_low >= %d and fans_up <= %d", feeForm, platForm, fansLow, fansUp)
+	orStr2 := fmt.Sprintf("fee_form = %d and platform = %d and fans_low <= %d and fans_up >= %d", feeForm, platForm, fansLow, fansUp)
+	err := Db.Model(entity.InfoPricingStrategy{}).Where(whereStr).Or(orStr).Or(orStr1).Or(orStr2).Scan(&pricingStrategys).Error
+	if err != nil {
+		log.Println("DB GetLastAutoDefaultID:", err)
+		return nil, err
+	}
+	fmt.Printf("PricingStrategys%+v \n", pricingStrategys)
+	pricingStrategy := entity.InfoPricingStrategy{}
+	if feeForm == 1 { // 如果是产品置换,则选取服务费最高时的定价策略
+		var maxCharge float64 = 0
+		for _, v := range pricingStrategys {
+			if v.ServiceCharge >= maxCharge {
+				maxCharge = v.ServiceCharge
+				pricingStrategy = v
+			}
+		}
+	} else { // 如果是固定稿费或自报价,则选取服务费率最高时的定价策略
+		var maxRate int64 = 0
+		for _, v := range pricingStrategys {
+			if v.ServiceRate >= maxRate {
+				maxRate = v.ServiceRate
+				pricingStrategy = v
+			}
+		}
+	}
+	return &pricingStrategy, nil
+}

+ 49 - 0
app/dao/invoice_info_dao.go

@@ -0,0 +1,49 @@
+package dao
+
+import (
+	"gorm.io/gorm"
+	"youngee_m_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_m_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, invoice_url")
+	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
+//}

+ 34 - 0
app/dao/local_life_brief_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type LocalLifeBriefDao struct{}
+
+func (p LocalLifeBriefDao) DeleteLocalBriefByLocalId(localId string) error {
+	err := Db.Where("local_id = ?", localId).Delete(entity.LocalLifeBrief{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p LocalLifeBriefDao) CreateLocalBrief(briefInfo entity.LocalLifeBrief) error {
+	err := Db.Create(&briefInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p LocalLifeBriefDao) GetLocalBriefInfo(localId string) ([]*entity.LocalLifeBrief, error) {
+	var localBriefInfos []*entity.LocalLifeBrief
+	err := Db.Model(entity.LocalLifeBrief{}).Where("local_id = ?", localId).Order("created_at asc").Find(&localBriefInfos).Error
+	if err != nil {
+		logrus.Errorf("[GetLocalBriefInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return localBriefInfos, nil
+}

+ 323 - 0
app/dao/local_life_dao.go

@@ -0,0 +1,323 @@
+package dao
+
+import (
+	"errors"
+	"fmt"
+	"gorm.io/gorm"
+	"time"
+	"youngee_m_api/app/entity"
+	"youngee_m_api/app/vo"
+)
+
+type LocalLifeDao struct{}
+
+// 根据localId获取localLife信息
+func (d LocalLifeDao) GetLocalById(localId string) (*entity.LocalLifeInfo, error) {
+	var localLife entity.LocalLifeInfo
+	err := Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ?", localId).First(&localLife).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &localLife, err
+}
+
+// 根据localId获取违约状态id
+func (d LocalLifeDao) GetAutoDefaultId(localId string) (*int64, error) {
+	var autoDefaultId int64
+	err := Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ?", localId).Select("auto_default_id").Find(&autoDefaultId).Error
+	if err != nil {
+		return nil, nil
+	}
+	return &autoDefaultId, nil
+}
+
+// 根据enterpriseId查询指定某天的所有本地生活数据
+func (d LocalLifeDao) GetLocalListOfDay(enterpriseId string, date time.Time) ([]entity.LocalLifeInfo, error) {
+	var localLifes []entity.LocalLifeInfo
+	// 构建查询
+	query := Db.Model(&entity.LocalLifeInfo{})
+	if enterpriseId != "" {
+		query = query.Where("enterprise_id = ?", enterpriseId)
+	}
+	// 将日期部分提取出来进行匹配
+	query = query.Where("DATE(created_at) = ?", date.Format("2006-01-02"))
+	err := query.Find(&localLifes).Error
+	return localLifes, err
+}
+
+// 创建本地生活任务
+func (d LocalLifeDao) CreateLocalLife(localLife entity.LocalLifeInfo) error {
+	err := Db.Omit("auto_fail_at", "pay_at", "submit_at", "pass_at", "finish_at").Create(&localLife).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 更新本地生活任务
+func (d LocalLifeDao) UpdateLocal(localLife entity.LocalLifeInfo) error {
+	err := Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ?", localLife.LocalID).Updates(localLife).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 更新开票状态字段
+func (d LocalLifeDao) UpdateInvoiceStatus(localIDs []string) error {
+	err := Db.Debug().Model(&entity.LocalLifeInfo{}).Where("local_id IN ?", localIDs).Updates(entity.LocalLifeInfo{InvoiceStatus: 1}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 获取本地生活任务列表
+func (d LocalLifeDao) GetLocalPreviews(param *vo.LocalSearchParam) ([]vo.ReLocalTaskPreview, int64, error) {
+	var reLocalTaskPreviews []vo.ReLocalTaskPreview
+	var localLifes []entity.LocalLifeInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{})
+	//// 动态添加查询条件
+	//if param.SubAccountId == 0 {
+	//	if param.EnterpriseId == "" {
+	//		return reLocalTaskPreviews, 0, errors.New("enterpriseId is empty")
+	//	}
+	//	query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	//} else {
+	//	query = query.Where("sub_account_id = ?", param.SubAccountId)
+	//}
+	if param.LocalType != 0 {
+		query = query.Where("local_type = ?", param.LocalType)
+	}
+	if param.LocalPlatform != 0 {
+		query = query.Where("local_platform = ?", param.LocalPlatform)
+	}
+	if param.LocalStatus != 0 {
+		query = query.Where("task_status = ?", param.LocalStatus)
+	}
+	if param.LocalForm != 0 {
+		query = query.Where("task_form = ?", param.LocalForm)
+	}
+	if param.ContentType != 0 {
+		query = query.Where("content_type = ?", param.ContentType)
+	}
+	if param.LocalId != "" {
+		query = query.Where("local_id = ?", param.LocalId)
+	}
+	if param.LocalName != "" {
+		query = query.Where("local_name LIKE ?", "%"+param.LocalName+"%")
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, task_status, estimated_cost, task_form, content_type, need_review, need_quality, need_calculate, store_id, team_buying_id, tools")
+	offset := (param.Page - 1) * param.PageSize
+	if param.Order == 1 {
+		if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifes).Error; err != nil {
+			return nil, 0, err
+		}
+	} else {
+		if err := query.Order("created_at desc").Offset(offset).Limit(param.PageSize).Find(&localLifes).Error; err != nil {
+			return nil, 0, err
+		}
+	}
+	for _, localLife := range localLifes {
+		reLocalTaskPreview := vo.ReLocalTaskPreview{
+			EnterpriseId:  localLife.EnterpriseID,
+			SubAccountId:  localLife.SubAccountID,
+			LocalId:       localLife.LocalID,
+			LocalPlatform: localLife.LocalPlatform,
+			LocalStatus:   localLife.TaskStatus,
+			EstimatedCost: localLife.EstimatedCost,
+			LocalForm:     localLife.TaskForm,
+			ContentType:   localLife.ContentType,
+			NeedReview:    localLife.NeedReview,
+			NeedQuality:   localLife.NeedQuality,
+			NeedCalculate: localLife.NeedCalculate,
+			StoreId:       localLife.StoreID,
+			TeamBuyingId:  localLife.TeamBuyingId,
+			Tools:         localLife.Tools,
+		}
+		reLocalTaskPreviews = append(reLocalTaskPreviews, reLocalTaskPreview)
+	}
+
+	return reLocalTaskPreviews, total, nil
+}
+
+// 删除本地生活任务
+func (d LocalLifeDao) DeleteLocalLife(localId string) (*string, error) {
+	if localId == "" {
+		return &localId, nil
+	}
+	err := Db.Where("local_id = ?", localId).Delete(&entity.LocalLifeInfo{}).Error
+	if err != nil {
+		return nil, err
+	}
+	return &localId, nil
+}
+
+// 获取草稿箱——本地生活任务列表
+func (d LocalLifeDao) GetLocalDraftList(param *vo.LocalDraftParam) ([]vo.ReLocalTaskPreview, int64, error) {
+	var reLocalTaskPreviews []vo.ReLocalTaskPreview
+	var localLifeInfos []entity.LocalLifeInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{}).Where("task_status = ?", 1)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reLocalTaskPreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.LocalType != 0 {
+		query = query.Where("local_type = ?", param.LocalType)
+	}
+	if param.LocalPlatform != 0 {
+		query = query.Where("local_platform = ?", param.LocalPlatform)
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, local_type, created_at, store_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifeInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, localLifeInfo := range localLifeInfos {
+		reLocalTaskPreview := vo.ReLocalTaskPreview{
+			EnterpriseId:  localLifeInfo.EnterpriseID,
+			SubAccountId:  localLifeInfo.SubAccountID,
+			LocalId:       localLifeInfo.LocalID,
+			LocalPlatform: localLifeInfo.LocalPlatform,
+			LocalType:     localLifeInfo.LocalType,
+			CreatedAt:     localLifeInfo.CreatedAt.Format("2006-01-02 15:04:05"),
+			StoreId:       localLifeInfo.StoreID,
+		}
+		reLocalTaskPreviews = append(reLocalTaskPreviews, reLocalTaskPreview)
+	}
+
+	return reLocalTaskPreviews, total, nil
+}
+
+// 获取公开种草中全部指定状态值的项目
+func (d LocalLifeDao) GetLocalLifeList(value int64, fieldName string) ([]*entity.LocalLifeInfo, error) {
+	var localLifeInfos []*entity.LocalLifeInfo
+	err := Db.Model(entity.LocalLifeInfo{}).Where(fmt.Sprintf("local_type = ? AND %s = ? ", fieldName), 1, value).Find(&localLifeInfos).Error
+	if err != nil {
+		return nil, err
+	}
+	return localLifeInfos, nil
+}
+
+// 探店本地生活列表
+func (d LocalLifeDao) GetLocalStoreExplorePreviews(param *vo.LocalSearchParam) ([]vo.ReLocalStoreExplorePreview, int64, error) {
+	var reLocalStoreExplorePreviews []vo.ReLocalStoreExplorePreview
+	var localLifes []entity.LocalLifeInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{})
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reLocalStoreExplorePreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.LocalType != 0 {
+		query = query.Where("local_type = ?", param.LocalType)
+	}
+	if param.LocalPlatform != 0 {
+		query = query.Where("local_platform = ?", param.LocalPlatform)
+	}
+	if param.LocalId != "" {
+		query = query.Where("local_id = ?", param.LocalId)
+	}
+	if param.LocalName != "" {
+		query = query.Where("local_name LIKE ?", "%"+param.LocalName+"%")
+	}
+	query = query.Where("task_status = ? AND task_form = ?", 8, 1)
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, local_id, local_type, local_platform, need_reserve, need_confirm, need_explore, explored_num, store_id, team_buying_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("pay_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifes).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, localLife := range localLifes {
+		reLocalStoreExplorePreview := vo.ReLocalStoreExplorePreview{
+			EnterpriseId:  localLife.EnterpriseID,
+			SubAccountId:  localLife.SubAccountID,
+			LocalId:       localLife.LocalID,
+			LocalPlatform: localLife.LocalPlatform,
+			LocalType:     localLife.LocalType,
+			NeedReserve:   localLife.NeedReserve,
+			NeedConfirm:   localLife.NeedConfirm,
+			NeedExplore:   localLife.NeedExplore,
+			ExploredNum:   localLife.ExploredNum,
+			StoreId:       localLife.StoreID,
+			TeamBuyingId:  localLife.TeamBuyingId,
+		}
+		reLocalStoreExplorePreviews = append(reLocalStoreExplorePreviews, reLocalStoreExplorePreview)
+	}
+
+	return reLocalStoreExplorePreviews, total, nil
+}
+
+// 获取本地生活账单列表
+func (d LocalLifeDao) GetBillLocalPreviews(param *vo.LocalSearchParam) ([]vo.ReBillLocalTaskPreview, int64, error) {
+	var reBillLocalTaskPreviews []vo.ReBillLocalTaskPreview
+	var localLifes []entity.LocalLifeInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{})
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reBillLocalTaskPreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.LocalType != 0 {
+		query = query.Where("local_type = ?", param.LocalType)
+	}
+	if param.LocalPlatform != 0 {
+		query = query.Where("local_platform = ?", param.LocalPlatform)
+	}
+	if param.LocalStatus != 0 {
+		query = query.Where("task_status = ?", param.LocalStatus)
+	}
+	if param.LocalId != "" {
+		query = query.Where("local_id = ?", param.LocalId)
+	}
+	if param.LocalName != "" {
+		query = query.Where("local_name LIKE ?", "%"+param.LocalName+"%")
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, task_status, estimated_cost, task_form, content_type, store_id, team_buying_id, settlement_amount")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifes).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, localLife := range localLifes {
+		reBillLocalTaskPreview := vo.ReBillLocalTaskPreview{
+			EnterpriseId:  localLife.EnterpriseID,
+			SubAccountId:  localLife.SubAccountID,
+			LocalId:       localLife.LocalID,
+			LocalPlatform: localLife.LocalPlatform,
+			LocalStatus:   localLife.TaskStatus,
+			EstimatedCost: localLife.EstimatedCost,
+			LocalForm:     localLife.TaskForm,
+			ContentType:   localLife.ContentType,
+			StoreId:       localLife.StoreID,
+			TeamBuyingId:  localLife.TeamBuyingId,
+			CashAmount:    localLife.SettlementAmount,
+		}
+		reBillLocalTaskPreviews = append(reBillLocalTaskPreviews, reBillLocalTaskPreview)
+	}
+
+	return reBillLocalTaskPreviews, total, nil
+}

+ 34 - 0
app/dao/local_life_material_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type LocalLifeMaterialDao struct{}
+
+func (d LocalLifeMaterialDao) DeleteLocalMaterialByLocalId(localId string) error {
+	err := Db.Where("local_id = ?", localId).Delete(entity.LocalLifeMaterial{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d LocalLifeMaterialDao) CreateLocalMaterial(localMaterial entity.LocalLifeMaterial) error {
+	err := Db.Create(&localMaterial).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d LocalLifeMaterialDao) GetLocalMaterialInfo(localId string) ([]*entity.LocalLifeMaterial, error) {
+	var localMaterialInfos []*entity.LocalLifeMaterial
+	err := Db.Model(entity.LocalLifeMaterial{}).Where("local_id = ?", localId).Order("created_at asc").Find(&localMaterialInfos).Error
+	if err != nil {
+		logrus.Errorf("[GetLocalMaterialInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return localMaterialInfos, nil
+}

+ 34 - 0
app/dao/local_life_review_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type LocalLifeReviewDao struct{}
+
+func (p LocalLifeReviewDao) Create(reviewInfo *entity.ReviewLocalLife) error {
+	err := Db.Create(&reviewInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p LocalLifeReviewDao) GetLocalReviewByStatus(status int64) ([]*entity.ReviewLocalLife, error) {
+	var reviewLocalLifes []*entity.ReviewLocalLife
+	err := Db.Model(entity.ReviewLocalLife{}).Where("status = ?", status).Find(&reviewLocalLifes).Error
+	if err != nil {
+		logrus.Errorf("[GetLocalReviewByStatus] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return reviewLocalLifes, nil
+}
+
+func (p LocalLifeReviewDao) UpdateLocalReview(reviewLocalLife *entity.ReviewLocalLife) error {
+	err := Db.Debug().Model(&entity.ReviewLocalLife{}).Where("id = ?", reviewLocalLife.ID).Updates(reviewLocalLife).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 155 - 0
app/dao/local_life_task_info_dao.go

@@ -0,0 +1,155 @@
+package dao
+
+import (
+	"youngee_m_api/app/entity"
+	"youngee_m_api/app/vo"
+)
+
+type LocalLifeTaskInfoDao struct{}
+
+// 获取指定违约类型的本地生活子任务数量
+func (d LocalLifeTaskInfoDao) CountByDefaultType(localId string, defaultType int64) int64 {
+	var total int64
+	Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND cur_default_type = ?", localId, defaultType).Count(&total)
+	return total
+}
+
+// 获取指定任务阶段的本地生活子任务数量
+func (d LocalLifeTaskInfoDao) CountByTaskStage(localId string, taskStage int64) int64 {
+	var total int64
+	Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", localId, taskStage).Count(&total)
+	return total
+}
+
+// 获取指定任务阶段的本地生活子任务
+func (d LocalLifeTaskInfoDao) GetListByTaskStage(localId string, bookStatus int64, time string, page int, pageSize int) ([]*entity.LocalLifeTaskInfo, int64, error) {
+	var taskInfos []*entity.LocalLifeTaskInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", localId, bookStatus)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	var err error
+	if bookStatus == 1 {
+		query.Count(&total)
+		err = query.Order("select_date asc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if bookStatus == 2 {
+		if time != "" {
+			query = query.Where("DATE(reserve_time) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("reserve_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if bookStatus == 3 {
+		if time != "" {
+			query = query.Where("DATE(explore_time) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("explore_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if bookStatus == 4 {
+		if time != "" {
+			query = query.Where("DATE(finish_explore_time) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("finish_explore_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	}
+	if err != nil {
+		return nil, 0, err
+	}
+	return taskInfos, total, nil
+}
+
+// 获取未传初稿的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListBySketchDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeTaskInfo, int64, error) {
+	localTaskInfos := []entity.LocalLifeTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 4)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, sketch_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("sketch_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return localTaskInfos, total, nil
+}
+
+// 获取未发作品的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByLinkDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeTaskInfo, int64, error) {
+	localTaskInfos := []entity.LocalLifeTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 6)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, link_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("link_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return localTaskInfos, total, nil
+}
+
+// 获取未传数据的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByDataDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeTaskInfo, int64, error) {
+	localTaskInfos := []entity.LocalLifeTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 8)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, data_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("data_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return localTaskInfos, total, nil
+}
+
+// 获取终止合作的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeTaskInfo, int64, error) {
+	localTaskInfos := []entity.LocalLifeTaskInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", param.TaskId, 17)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("terminate_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return localTaskInfos, total, nil
+}
+
+// 获取已解约的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByCancelDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeTaskInfo, int64, error) {
+	localTaskInfos := []entity.LocalLifeTaskInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", param.TaskId, 16)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("cancel_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return localTaskInfos, total, nil
+}
+
+// 更新字段
+func (d LocalLifeTaskInfoDao) UpdateField(taskId string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.LocalLifeTaskInfo{}).Where("task_id = ?", taskId).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 批量更新字段
+func (d LocalLifeTaskInfoDao) UpdateFieldBatch(taskIds []string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.LocalLifeTaskInfo{}).Where("task_id IN ?", taskIds).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 批量更新字段
+func (d LocalLifeTaskInfoDao) UpdateLocalStatus(taskIds []string, localLifeTaskInfo entity.LocalLifeTaskInfo) error {
+	err := Db.Debug().Model(&entity.LocalLifeTaskInfo{}).Where("task_id IN ?", taskIds).Updates(localLifeTaskInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 18 - 0
app/dao/platform_kuaishou_user_info_dao.go

@@ -0,0 +1,18 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type PlatformKuaishouUserInfoDao struct{}
+
+func (d PlatformKuaishouUserInfoDao) SelectUserInfo(talentId string) (*entity.PlatformKuaishouUserInfo, error) {
+	var userInfo *entity.PlatformKuaishouUserInfo
+	err := Db.Model(entity.PlatformKuaishouUserInfo{}).Select("open_id, nick_name, head_uri").Where("talent_id = ?", talentId).Find(&userInfo).Error
+	if err != nil {
+		logrus.Errorf("[SelectUserInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return userInfo, nil
+}

+ 129 - 0
app/dao/product_dao.go

@@ -0,0 +1,129 @@
+package dao
+
+import (
+	"errors"
+	"github.com/sirupsen/logrus"
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type ProductDAO struct{}
+
+func (d ProductDAO) GetProductsByEnterpriseID(enterpriseId string, page int, pageSize int) ([]entity.Product, int64, error) {
+	var products []entity.Product
+	var total int64
+	Db.Model(&entity.Product{}).Where("enterprise_id = ? AND is_deleted = 0", enterpriseId).Count(&total)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	// 分页查询
+	err := Db.Where("enterprise_id = ? AND is_deleted = 0", enterpriseId).Order("created_at desc").Offset(offset).Limit(pageSize).Find(&products).Error
+	if err != nil {
+		return nil, 0, err
+	}
+	return products, total, nil
+}
+
+func (d ProductDAO) GetProductsByEnterpriseIDAndTypeTitle(enterpriseId string, productType int64, productTitle string, page int, pageSize int) ([]entity.Product, int64, error) {
+	var products []entity.Product
+	var total int64
+	query := Db.Model(&entity.Product{}).Where("enterprise_id = ? AND product_type = ? AND is_deleted = 0", enterpriseId, productType)
+	if productTitle != "" {
+		query = query.Where("product_name LIKE ?", "%"+productTitle+"%")
+	}
+	query.Count(&total)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	// 分页查询
+	err := query.Order("created_at desc").Offset(offset).Limit(pageSize).Find(&products).Error
+	if err != nil {
+		return nil, 0, err
+	}
+	return products, total, nil
+}
+
+func (d ProductDAO) GetProductsBySubAccountId(subAccountId int64, page int, pageSize int) ([]entity.Product, int64, error) {
+	var products []entity.Product
+	var total int64
+	Db.Model(&entity.Product{}).Where("sub_account_id = ? AND is_deleted = 0", subAccountId).Count(&total)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	// 分页查询
+	err := Db.Where("sub_account_id = ? AND is_deleted = 0", subAccountId).Order("created_at desc").Offset(offset).Limit(pageSize).Find(&products).Error
+	if err != nil {
+		return nil, 0, err
+	}
+	return products, total, nil
+}
+
+func (d ProductDAO) CreateProduct(product entity.Product) (int64, error) {
+	err := Db.Create(&product).Error
+	if err != nil {
+		return 0, err
+	}
+	return product.ProductID, nil
+}
+
+func (d ProductDAO) UpdateProduct(product entity.Product) (int64, error) {
+	err := Db.Model(&entity.Product{}).Where("product_id = ?", product.ProductID).Updates(product).Error
+	if err != nil {
+		return 0, err
+	}
+	return product.ProductID, nil
+}
+
+func (d ProductDAO) DeleteProduct(productId int64) error {
+	err := Db.Where("product_id = ?", productId).Delete(&entity.Product{}).Error
+	return err
+}
+
+func (d ProductDAO) GetProductByID(productId int64) (*entity.Product, error) {
+	var product entity.Product
+	err := Db.Debug().Where("product_id = ?", productId).First(&product).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &product, nil
+}
+
+func (d ProductDAO) GetProductBySelectionId(selectionId string) (*entity.Product, error) {
+	productId := 0
+	err := Db.Model(entity.SelectionInfo{}).Select("product_id").Where("selection_id = ?", selectionId).Find(&productId).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	productInfo := entity.Product{}
+	err = Db.Model(entity.Product{}).Where("product_id = ?", productId).Find(&productInfo).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return &productInfo, nil
+}
+
+func (d ProductDAO) GetProductByProjectId(projectId string) (*entity.Product, error) {
+	productId := 0
+	err := Db.Model(entity.Project{}).Select("product_id").Where("project_id = ?", projectId).Find(&productId).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	productInfo := entity.Product{}
+	err = Db.Model(entity.Product{}).Where("product_id = ?", productId).Find(&productInfo).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return &productInfo, nil
+}
+
+// 获取商品类目
+func (d ProductDAO) GetProductCategorys() ([]entity.InfoProductCategory, error) {
+	var infoProductCategorys []entity.InfoProductCategory
+	err := Db.Model(&entity.InfoProductCategory{}).Find(&infoProductCategorys).Order("id").Error
+	return infoProductCategorys, err
+}

+ 124 - 0
app/dao/product_photo_dao.go

@@ -0,0 +1,124 @@
+package dao
+
+import (
+	"errors"
+	"github.com/sirupsen/logrus"
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type ProductPhotoDAO struct{}
+
+func (d ProductPhotoDAO) CreateProductPhoto(productPhotos []entity.ProductPhoto) error {
+	err := Db.Debug().Create(&productPhotos).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 获取所属商品的图片
+func (d ProductPhotoDAO) GetProductPhotoByProductID(productId int64) ([]entity.ProductPhoto, error) {
+	var productPhotos []entity.ProductPhoto
+	err := Db.Where("product_id = ?", productId).Order("created_at asc").Find(&productPhotos).Error
+	if err != nil {
+		return nil, err
+	}
+	return productPhotos, nil
+}
+
+// 获取所属商品的主图详情
+func (d ProductPhotoDAO) GetMainProductPhotoInfoByProductID(productId int64) (*entity.ProductPhoto, error) {
+	var productPhoto entity.ProductPhoto
+	err := Db.Where("product_id = ? AND symbol = ?", productId, 1).First(&productPhoto).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &productPhoto, nil
+}
+
+// 获取所属商品的主图
+func (d ProductPhotoDAO) GetMainPhotoByProductID(productId int64) (string, error) {
+	var productPhoto entity.ProductPhoto
+	err := Db.Where("product_id = ? AND symbol = ?", productId, 1).Find(&productPhoto).Error
+	if err != nil {
+		return "", err
+	}
+	return productPhoto.PhotoUrl, nil
+}
+
+// 获取所属门店的图片
+func (d ProductPhotoDAO) GetProductPhotoByStoreID(storeId int64) ([]entity.ProductPhoto, error) {
+	var productPhotos []entity.ProductPhoto
+	err := Db.Where("store_id = ?", storeId).Order("created_at asc").Find(&productPhotos).Error
+	if err != nil {
+		return nil, err
+	}
+	return productPhotos, nil
+}
+
+// 获取所属门店的主图
+func (d ProductPhotoDAO) GetMainPhotoByStoreID(storeId int64) (string, error) {
+	var productPhoto entity.ProductPhoto
+	err := Db.Where("store_id = ? AND symbol = ?", storeId, 1).Find(&productPhoto).Error
+	if err != nil {
+		return "", err
+	}
+	return productPhoto.PhotoUrl, nil
+}
+
+// 获取所属团购的图片
+func (d ProductPhotoDAO) GetProductPhotoByTeamBuyingID(teamBuyingId int64) ([]entity.ProductPhoto, error) {
+	var productPhotos []entity.ProductPhoto
+	err := Db.Where("team_buying_id = ?", teamBuyingId).Order("created_at asc").Find(&productPhotos).Error
+	if err != nil {
+		return nil, err
+	}
+	return productPhotos, nil
+}
+
+// 获取所属团购的主图
+func (d ProductPhotoDAO) GetMainPhotoByTeamBuyingID(teamBuyingId int64) (string, error) {
+	var productPhoto entity.ProductPhoto
+	err := Db.Where("team_buying_id = ? AND symbol = ?", teamBuyingId, 1).Find(&productPhoto).Error
+	if err != nil {
+		return "", err
+	}
+	return productPhoto.PhotoUrl, nil
+}
+
+func (d ProductPhotoDAO) GetProductPhotosBySelectionId(selectionId string) ([]*entity.ProductPhoto, error) {
+	productId := 0
+	err := Db.Model(entity.SelectionInfo{}).Select("product_id").Where("selection_id = ?", selectionId).Find(&productId).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	var productPhotos []*entity.ProductPhoto
+	err = Db.Model(entity.ProductPhoto{}).Where("product_id = ?", productId).Find(&productPhotos).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return productPhotos, nil
+}
+
+func (d ProductPhotoDAO) GetProductPhotosByProjectId(projectId string) ([]*entity.ProductPhoto, error) {
+	productId := 0
+	err := Db.Model(entity.Project{}).Select("product_id").Where("project_id = ?", projectId).Find(&productId).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	var productPhotos []*entity.ProductPhoto
+	err = Db.Model(entity.ProductPhoto{}).Where("product_id = ?", productId).Find(&productPhotos).Error
+	if err != nil {
+		logrus.Errorf("[GetProductInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return productPhotos, nil
+}

+ 34 - 0
app/dao/project_brief_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type ProjectBriefDao struct{}
+
+func (p ProjectBriefDao) DeleteSecBriefBySelectionId(projectId string) error {
+	err := Db.Where("project_id = ?", projectId).Delete(entity.ProjectBrief{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p ProjectBriefDao) CreateProjectBrief(briefInfo entity.ProjectBrief) error {
+	err := Db.Create(&briefInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p ProjectBriefDao) GetProjectBriefInfo(projectId string) ([]*entity.ProjectBrief, error) {
+	var projectBriefInfos []*entity.ProjectBrief
+	err := Db.Model(entity.ProjectBrief{}).Where("project_id = ?", projectId).Order("created_at asc").Find(&projectBriefInfos).Error
+	if err != nil {
+		logrus.Errorf("[GetProjectBriefInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return projectBriefInfos, nil
+}

+ 390 - 0
app/dao/project_dao.go

@@ -0,0 +1,390 @@
+package dao
+
+import (
+	"errors"
+	"fmt"
+	"gorm.io/gorm"
+	"time"
+	"youngee_m_api/app/entity"
+	"youngee_m_api/app/vo"
+)
+
+type ProjectDAO struct{}
+
+// 根据projectId获取project信息
+func (d ProjectDAO) GetProjectById(projectId string) (*entity.Project, error) {
+	var project entity.Project
+	err := Db.Where("project_id = ?", projectId).Find(&project).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &project, err
+}
+
+// 根据projectId获取违约状态id
+func (d ProjectDAO) GetAutoDefaultId(projectId string) (*int64, error) {
+	var autoDefaultId int64
+	err := Db.Model(&entity.Project{}).Where("project_id = ?", projectId).Select("auto_default_id").Find(&autoDefaultId).Error
+	if err != nil {
+		return nil, nil
+	}
+	return &autoDefaultId, nil
+}
+
+// 根据enterpriseId查询指定某天的所有带货数据
+func (d ProjectDAO) GetProjectListOfDay(enterpriseId string, date time.Time) ([]entity.Project, error) {
+	var projects []entity.Project
+	// 构建查询
+	query := Db.Model(&entity.Project{})
+	if enterpriseId != "" {
+		query = query.Where("enterprise_id = ?", enterpriseId)
+	}
+	// 将日期部分提取出来进行匹配
+	query = query.Where("DATE(created_at) = ?", date.Format("2006-01-02"))
+	err := query.Find(&projects).Error
+	return projects, err
+}
+
+// 创建种草任务
+func (d ProjectDAO) CreateProject(project entity.Project) error {
+	err := Db.Omit("auto_fail_at", "auto_script_break_at", "auto_sketch_break_at", "pay_at", "pass_at", "finish_at", "submit_at").Create(&project).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 更新种草任务
+func (d ProjectDAO) UpdateProject(project entity.Project) error {
+	err := Db.Model(&entity.Project{}).Where("project_id = ?", project.ProjectId).Updates(project).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 更新开票状态字段
+func (d ProjectDAO) UpdateInvoiceStatus(projectIDs []string) error {
+	err := Db.Debug().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
+	var projects []entity.Project
+	var total int64
+	query := Db.Model(&entity.Project{})
+	//// 动态添加查询条件
+	//if param.SubAccountId == 0 {
+	//	if param.EnterpriseId == "" {
+	//		return reProjectTaskPreviews, 0, errors.New("enterpriseId is empty")
+	//	}
+	//	query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	//} else {
+	//	query = query.Where("sub_account_id = ?", param.SubAccountId)
+	//}
+	if param.ProjectType != 0 {
+		query = query.Where("project_type = ?", param.ProjectType)
+	}
+	if param.ProjectPlatform != 0 {
+		query = query.Where("project_platform = ?", param.ProjectPlatform)
+	}
+	if param.ProjectStatus != 0 {
+		query = query.Where("project_status = ?", param.ProjectStatus)
+	}
+	if param.ProjectForm != 0 {
+		query = query.Where("project_form = ?", param.ProjectForm)
+	}
+	if param.ContentType != 0 {
+		query = query.Where("content_type = ?", param.ContentType)
+	}
+	if param.ProjectId != "" {
+		query = query.Where("project_id = ?", param.ProjectId)
+	}
+	if param.ProjectName != "" {
+		query = query.Where("project_name LIKE ?", "%"+param.ProjectName+"%")
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, project_status, estimated_cost, project_form, content_type, need_review, need_quality, need_calculate, before_delivery_num, delivery_num, after_delivery_num, product_id, tools")
+	offset := (param.Page - 1) * param.PageSize
+	if param.Order == 1 {
+		if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+			return nil, 0, err
+		}
+	} else {
+		if err := query.Order("created_at desc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+			return nil, 0, err
+		}
+	}
+	for _, project := range projects {
+		reProjectTaskPreview := vo.ReProjectTaskPreview{
+			EnterpriseId:    project.EnterpriseID,
+			SubAccountId:    project.SubAccountId,
+			ProjectId:       project.ProjectId,
+			ProjectPlatform: project.ProjectPlatform,
+			ProjectStatus:   project.ProjectStatus,
+			EstimatedCost:   project.EstimatedCost,
+			ProjectForm:     project.ProjectForm,
+			ContentType:     project.ContentType,
+			NeedReview:      project.NeedReview,
+			NeedQuality:     project.NeedQuality,
+			NeedCalculate:   project.NeedCalculate,
+			ProductId:       project.ProductID,
+			Tools:           project.Tools,
+			NeedDelivery:    project.BeforeDeliveryNum,
+			NeedReceive:     project.DeliveryNum,
+			Received:        project.AfterDeliveryNum,
+		}
+		reProjectTaskPreviews = append(reProjectTaskPreviews, reProjectTaskPreview)
+	}
+
+	return reProjectTaskPreviews, total, nil
+}
+
+// 删除种草任务
+func (d ProjectDAO) DeleteProject(projectId string) (*string, error) {
+	if projectId == "" {
+		return &projectId, nil
+	}
+	err := Db.Debug().Where("project_id = ?", projectId).Delete(&entity.Project{}).Error
+	if err != nil {
+		return nil, err
+	}
+	return &projectId, nil
+}
+
+// 获取草稿箱——电商带货任务列表
+func (d ProjectDAO) GetProjectDraftList(param *vo.ProjectDraftParam) ([]vo.ReProjectTaskPreview, int64, error) {
+	var reProjectTaskPreviews []vo.ReProjectTaskPreview
+	var projects []entity.Project
+	var total int64
+	query := Db.Model(&entity.Project{}).Where("project_status = ?", 1)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reProjectTaskPreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.ProjectType != 0 {
+		query = query.Where("project_type = ?", param.ProjectType)
+	}
+	if param.ProjectPlatform != 0 {
+		query = query.Where("project_platform = ?", param.ProjectPlatform)
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, project_type, created_at, product_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, project := range projects {
+		reProjectTaskPreview := vo.ReProjectTaskPreview{
+			EnterpriseId:    project.EnterpriseID,
+			SubAccountId:    project.SubAccountId,
+			ProjectId:       project.ProjectId,
+			ProjectPlatform: project.ProjectPlatform,
+			ProjectType:     project.ProjectType,
+			CreatedAt:       project.CreatedAt.Format("2006-01-02 15:04:05"),
+			ProductId:       project.ProductID,
+		}
+		reProjectTaskPreviews = append(reProjectTaskPreviews, reProjectTaskPreview)
+	}
+
+	return reProjectTaskPreviews, total, nil
+}
+
+// 获取公开种草中全部指定状态值的项目
+func (d ProjectDAO) GetProjectList(value int64, fieldName string) ([]*entity.Project, error) {
+	var projectInfos []*entity.Project
+	err := Db.Model(entity.Project{}).Where(fmt.Sprintf("project_type = ? AND %s = ? ", fieldName), 1, value).Find(&projectInfos).Error
+	if err != nil {
+		return nil, err
+	}
+	return projectInfos, nil
+}
+
+// 违约管理——违约公开种草任务列表
+func (d ProjectDAO) GetProjectPublicList(param *vo.DefaultSearchParam) ([]vo.ReTaskDefaultPublic, int64, error) {
+	var reTaskDefaultPublics []vo.ReTaskDefaultPublic
+	var projects []entity.Project
+	var total int64
+	query := Db.Model(&entity.Project{}).Where("project_type = ?", 1)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reTaskDefaultPublics, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.Platform != 0 {
+		query = query.Where("project_platform = ?", param.Platform)
+	}
+	if param.TaskId != "" {
+		query = query.Where("project_id = ?", param.TaskId)
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, project_form, content_type, product_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, project := range projects {
+		reTaskDefaultPublic := vo.ReTaskDefaultPublic{
+			EnterpriseId: project.EnterpriseID,
+			SubAccountId: project.SubAccountId,
+			TaskId:       project.ProjectId,
+			Platform:     project.ProjectPlatform,
+			TaskForm:     project.ProjectForm,
+			ContentType:  project.ContentType,
+			TaskType:     1,
+			ProductId:    project.ProductID,
+		}
+		reTaskDefaultPublics = append(reTaskDefaultPublics, reTaskDefaultPublic)
+	}
+
+	return reTaskDefaultPublics, total, nil
+}
+
+// 违约管理——违约定向种草任务列表
+func (d ProjectDAO) GetProjectTargetList(param *vo.DefaultSearchParam) ([]vo.ReTaskDefaultTarget, int64, error) {
+	var reTaskDefaultTargets []vo.ReTaskDefaultTarget
+	var projects []entity.Project
+	var total int64
+	query := Db.Model(&entity.Project{}).Where("project_type = ?", 2)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reTaskDefaultTargets, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.Platform != 0 {
+		query = query.Where("project_platform = ?", param.Platform)
+	}
+	if param.TaskId != "" {
+		query = query.Where("project_id = ?", param.TaskId)
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, tools, content_type, product_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, project := range projects {
+		reTaskDefaultPublic := vo.ReTaskDefaultTarget{
+			EnterpriseId: project.EnterpriseID,
+			SubAccountId: project.SubAccountId,
+			TaskId:       project.ProjectId,
+			Platform:     project.ProjectPlatform,
+			Tools:        project.Tools,
+			ContentType:  project.ContentType,
+			TaskType:     1,
+			ProductId:    project.ProductID,
+		}
+		reTaskDefaultTargets = append(reTaskDefaultTargets, reTaskDefaultPublic)
+	}
+
+	return reTaskDefaultTargets, total, nil
+}
+
+// 获取品牌种草冻结中的任务
+func (d ProjectDAO) GetProjectFrozenList(enterpriseId string) ([]*entity.Project, error) {
+	var projects []*entity.Project
+	query := Db.Debug().Model(entity.Project{})
+	query.Select("project_id, product_id, enterprise_id, sub_account_id, project_platform, payment_amount, pay_at") // 冻结金额:payment_amount
+	err := query.Where(fmt.Sprintf("enterprise_id = ? AND (project_status between 7 and 8) "), enterpriseId).Find(&projects).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return projects, nil
+		} else {
+			return nil, err
+		}
+	}
+	return projects, nil
+}
+
+// 获取品牌种草冻结解除的任务
+func (d ProjectDAO) GetProjectFrozenCancelList(enterpriseId string) ([]*entity.Project, error) {
+	var projects []*entity.Project
+	query := Db.Debug().Model(entity.Project{})
+	query.Select("project_id, product_id, enterprise_id, sub_account_id, project_platform, settlement_amount, pay_at") // 解冻金额:settlement_amount
+	err := query.Where(fmt.Sprintf("enterprise_id = ? AND (project_status between 9 and 10) "), enterpriseId).Find(&projects).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return projects, nil
+		} else {
+			return nil, err
+		}
+	}
+	return projects, nil
+}
+
+// 获取品牌种草账单列表
+func (d ProjectDAO) GetBillProjectPreviews(param *vo.ProjectSearchParam) ([]vo.ReBillProjectTaskPreview, int64, error) {
+	var reBillProjectTaskPreviews []vo.ReBillProjectTaskPreview
+	var projects []entity.Project
+	var total int64
+	query := Db.Model(&entity.Project{})
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reBillProjectTaskPreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.ProjectType != 0 {
+		query = query.Where("project_type = ?", param.ProjectType)
+	}
+	if param.ProjectPlatform != 0 {
+		query = query.Where("project_platform = ?", param.ProjectPlatform)
+	}
+	if param.ProjectStatus != 0 {
+		query = query.Where("project_status = ?", param.ProjectStatus)
+	}
+	if param.ProjectId != "" {
+		query = query.Where("project_id = ?", param.ProjectId)
+	}
+	if param.ProjectName != "" {
+		query = query.Where("project_name LIKE ?", "%"+param.ProjectName+"%")
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, project_status, estimated_cost, project_form, content_type, product_id, settlement_amount")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, project := range projects {
+		reBillProjectTaskPreview := vo.ReBillProjectTaskPreview{
+			EnterpriseId:    project.EnterpriseID,
+			SubAccountId:    project.SubAccountId,
+			ProjectId:       project.ProjectId,
+			ProjectPlatform: project.ProjectPlatform,
+			ProjectStatus:   project.ProjectStatus,
+			ProjectForm:     project.ProjectForm,
+			ContentType:     project.ContentType,
+			ProductId:       project.ProductID,
+			EstimatedCost:   project.EstimatedCost,    // 应付金额
+			CashAmount:      project.SettlementAmount, //实际结算金额
+		}
+		reBillProjectTaskPreviews = append(reBillProjectTaskPreviews, reBillProjectTaskPreview)
+	}
+
+	return reBillProjectTaskPreviews, total, nil
+}

+ 34 - 0
app/dao/project_material_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type ProjectMaterialDao struct{}
+
+func (d ProjectMaterialDao) DeleteProjectMaterialByProjectId(projectId string) error {
+	err := Db.Where("project_id = ?", projectId).Delete(entity.ProjectMaterial{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d ProjectMaterialDao) CreateProjectMaterial(projectMaterial entity.ProjectMaterial) error {
+	err := Db.Create(&projectMaterial).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d ProjectMaterialDao) GetProjectMaterialInfo(projectId string) ([]*entity.ProjectMaterial, error) {
+	var projectMaterialInfos []*entity.ProjectMaterial
+	err := Db.Model(entity.ProjectMaterial{}).Where("project_id = ?", projectId).Order("created_at asc").Find(&projectMaterialInfos).Error
+	if err != nil {
+		logrus.Errorf("[GetProjectMaterialInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return projectMaterialInfos, nil
+}

+ 34 - 0
app/dao/project_review_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type ProjectReviewDao struct{}
+
+func (p ProjectReviewDao) Create(reviewInfo *entity.ReviewProject) error {
+	err := Db.Create(&reviewInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p ProjectReviewDao) GetProjectReviewByStatus(status int64) ([]*entity.ReviewProject, error) {
+	var reviewProjects []*entity.ReviewProject
+	err := Db.Model(entity.ReviewProject{}).Where("status = ?", status).Find(&reviewProjects).Error
+	if err != nil {
+		logrus.Errorf("[GetProjectReviewByStatus] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return reviewProjects, nil
+}
+
+func (p ProjectReviewDao) UpdateProjectReview(reviewProject *entity.ReviewProject) error {
+	err := Db.Debug().Model(&entity.ReviewProject{}).Where("id = ?", reviewProject.ID).Updates(reviewProject).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 137 - 0
app/dao/project_task_info_dao.go

@@ -0,0 +1,137 @@
+package dao
+
+import (
+	"youngee_m_api/app/entity"
+	"youngee_m_api/app/vo"
+)
+
+type ProjectTaskInfoDao struct{}
+
+// 获取指定违约类型的种草子任务数量
+func (d ProjectTaskInfoDao) CountByDefaultType(projectId string, defaultType int64) int64 {
+	var total int64
+	Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", projectId, defaultType).Count(&total)
+	return total
+}
+
+// 获取指定任务阶段的种草子任务数量
+func (d ProjectTaskInfoDao) CountByTaskStage(projectId string, taskStage int64) int64 {
+	var total int64
+	Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", projectId, taskStage).Count(&total)
+	return total
+}
+
+// 获取指定任务阶段的种草子任务
+func (d ProjectTaskInfoDao) GetListByTaskStage(projectId string, taskStage int64, time string, page int, pageSize int) ([]*entity.ProjectTaskInfo, int64, error) {
+	var taskInfos []*entity.ProjectTaskInfo
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", projectId, taskStage)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	var err error
+	if taskStage == 4 {
+		query.Count(&total)
+		err = query.Order("create_date desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if taskStage == 5 {
+		if time != "" {
+			query = query.Where("DATE(delivery_date) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("delivery_date desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if taskStage == 6 {
+		query.Count(&total)
+		err = query.Order("signed_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	}
+	if err != nil {
+		return nil, 0, err
+	}
+	return taskInfos, total, nil
+}
+
+// 获取未传初稿的种草子任务数据
+func (d ProjectTaskInfoDao) GetListBySketchDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 4)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, sketch_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("sketch_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取未发作品的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByLinkDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 6)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, link_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("link_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取未传数据的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByDataDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 8)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, data_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("data_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取终止合作的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.TaskId, 17)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("terminate_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取已解约的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByCancelDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.TaskId, 16)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("cancel_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 更新字段
+func (d ProjectTaskInfoDao) UpdateField(taskId string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.ProjectTaskInfo{}).Where("task_id = ?", taskId).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 批量更新字段
+func (d ProjectTaskInfoDao) UpdateFieldBatch(taskIds []string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.ProjectTaskInfo{}).Where("task_id IN ?", taskIds).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 102 - 0
app/dao/recharge_record_dao.go

@@ -0,0 +1,102 @@
+package dao
+
+import (
+	"time"
+	"youngee_m_api/app/entity"
+	"youngee_m_api/app/vo"
+)
+
+type RechargeRecordDao struct{}
+
+func (d RechargeRecordDao) Insert(rechargeRecord *entity.RechargeRecord) error {
+	err := Db.Debug().Model(entity.RechargeRecord{}).Omit("confirm_at", "refuse_at").Create(rechargeRecord).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 获取指定企业id的累计充值金额、充值确认中金额
+func (d RechargeRecordDao) GetRechargeAmount(enterpriseId string, status int64) (float64, error) {
+	var totalAmount float64
+	query := Db.Debug().Model(&entity.RechargeRecord{})
+	err := query.Where("enterprise_id = ? AND status = ?", enterpriseId, status).Select("SUM(recharge_amount)").Scan(&totalAmount).Error
+	if err != nil {
+		return 0, err
+	}
+	return totalAmount, nil
+}
+
+// 获取指定企业id的充值记录
+func (d RechargeRecordDao) RechargeInfoList(param *vo.RechargeParam) ([]entity.RechargeRecord, int64, error) {
+	rechargeRecords := []entity.RechargeRecord{}
+	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, enterprise_id, sub_account_id")
+	offset := (param.Page - 1) * param.PageSize
+	var err error
+	if param.RechargeState == 1 {
+		err = query.Order("commit_at desc").Offset(offset).Limit(param.PageSize).Find(&rechargeRecords).Error
+	} else if param.RechargeState == 2 {
+		err = query.Order("confirm_at desc").Offset(offset).Limit(param.PageSize).Find(&rechargeRecords).Error
+	} else if param.RechargeState == 3 {
+		err = query.Order("refuse_at desc").Offset(offset).Limit(param.PageSize).Find(&rechargeRecords).Error
+	}
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return rechargeRecords, total, nil
+}
+
+// 更新充值状态
+func (d RechargeRecordDao) UpdateRechargeStatus(rechargeId string, status int64, t time.Time) error {
+	rechargeRecord := entity.RechargeRecord{
+		Status: status,
+	}
+	if status == 2 {
+		rechargeRecord.InvoiceStatus = 1
+		rechargeRecord.ConfirmAt = t
+	}
+	if status == 3 {
+		rechargeRecord.FailReason = "微信支付失败"
+		rechargeRecord.RefuseAt = t
+	}
+	err = Db.Debug().Model(&entity.RechargeRecord{}).Where("recharge_id = ?", rechargeId).Updates(rechargeRecord).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 查找微信充值中超时且状态为充值未确认的记录
+func (d RechargeRecordDao) GetWXRechargeByStatusList(status int64) ([]*entity.RechargeRecord, error) {
+	now := time.Now()
+	var rechargeRecords []*entity.RechargeRecord
+	err := Db.Debug().Model(&entity.RechargeRecord{}).Where("recharge_method = ? AND status = ? AND refuse_at < ?", 2, status, now).Find(&rechargeRecords).Error
+	if err != nil {
+		return nil, err
+	}
+	return rechargeRecords, nil
+}
+
+// 批量更新指定id的充值记录状态
+func (d RechargeRecordDao) UpdateRechargeFailedList(noPayIds []int64) error {
+	err := Db.Debug().Model(&entity.RechargeRecord{}).Where("id IN ?", noPayIds).Updates(entity.RechargeRecord{Status: 3, FailReason: "微信支付失败"}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+//// 更新所有充值记录中微信支付超时的记录
+//func (d RechargeRecordDao) UpdateRechargeFailedList() error {
+//	now := time.Now()
+//	err := Db.Debug().Model(&entity.RechargeRecord{}).Where("recharge_method = ? AND status = ? AND refuse_at < ?", 2, 1, now).
+//		Updates(map[string]interface{}{"status": 3, "fail_reason": "微信支付失败"}).Error
+//	if err != nil {
+//		return err
+//	}
+//	return nil
+//}

+ 34 - 0
app/dao/recruit_strategy_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type RecruitStrategyDao struct{}
+
+func (d RecruitStrategyDao) DeleteRecruitStrategyByProjectID(projectId string) error {
+	err := Db.Where("project_id = ?", projectId).Delete(&entity.RecruitStrategy{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d RecruitStrategyDao) CreateRecruitStrategy(recruitStrategys []entity.RecruitStrategy) error {
+	err := Db.Create(&recruitStrategys).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d RecruitStrategyDao) GetRecruitStrategyByProjectId(projectId string) ([]*entity.RecruitStrategy, error) {
+	var recruitStrategys []*entity.RecruitStrategy
+	err := Db.Model(entity.RecruitStrategy{}).Where("project_id = ?", projectId).Order("strategy_id asc").Find(&recruitStrategys).Error
+	if err != nil {
+		logrus.Errorf("[GetRecruitStrategyByProjectId] error query, err:%+v", err)
+		return nil, err
+	}
+	return recruitStrategys, nil
+}

+ 11 - 0
app/dao/region_info_dao.go

@@ -0,0 +1,11 @@
+package dao
+
+import "youngee_m_api/app/entity"
+
+type RegionInfoDao struct{}
+
+func (d RegionInfoDao) SelectRegion(selfCode int64) (string, error) {
+	var regionName string
+	err := Db.Model(&entity.RegionInfo{}).Where("self_code = ?", selfCode).Select("region_name").Find(&regionName).Error
+	return regionName, err
+}

+ 34 - 0
app/dao/reward_strategy_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type RewardStrategyDao struct{}
+
+func (d RewardStrategyDao) DeleteRewardStrategyBySelectionId(selectionId string) error {
+	err := Db.Where("selection_id = ?", selectionId).Delete(&entity.RewardStrategy{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d RewardStrategyDao) CreateRewardStrategy(rewardStrategys []entity.RewardStrategy) error {
+	err := Db.Create(&rewardStrategys).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d RewardStrategyDao) GetRewardStrategyBySelectionId(selectionId string) ([]*entity.RewardStrategy, error) {
+	var rewardStrategys []*entity.RewardStrategy
+	err := Db.Model(entity.RewardStrategy{}).Where("selection_id = ?", selectionId).Find(&rewardStrategys).Error
+	if err != nil {
+		logrus.Errorf("[GetRewardStrategyBySelectionId] error query, err:%+v", err)
+		return nil, err
+	}
+	return rewardStrategys, nil
+}

+ 71 - 0
app/dao/s_project_dao.go

@@ -0,0 +1,71 @@
+package dao
+
+import (
+	"youngee_m_api/app/entity"
+)
+
+type SProjectDao struct{}
+
+// 插入数据
+func (d SProjectDao) Insert(record *entity.SProjectInfo) error {
+	result := Db.Debug().Model(&entity.SProjectInfo{}).Create(&record)
+	return result.Error
+}
+
+// 根据种草id、邀约状态返回数据列表
+func (d SProjectDao) GetSProjectByStatus(projectId string, status int64, page int, pageSize int) ([]*entity.SProjectInfo, int64, error) {
+	var sProjectInfos []*entity.SProjectInfo
+	var total int64
+	offset := (page - 1) * pageSize
+	query := Db.Debug().Model(&entity.SProjectInfo{}).Where("project_id = ? AND s_project_status = ?", projectId, status)
+	query.Count(&total)
+	query = query.Select("supplier_id,  b_operator, b_operator_type")
+	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&sProjectInfos).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return sProjectInfos, total, nil
+}
+
+// 检查给定的服务商是否在该商家库中
+func (d SupplierDao) EnterpriseDatabaseCheck(enterpriseId string, supplierId int64) (bool, error) {
+	var count int64
+	err := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND supplier_id = ? AND cooperate_status != 2", enterpriseId, supplierId).Count(&count).Error
+	if err != nil {
+		return false, err
+	}
+	return count > 0, nil
+}
+
+// 获取指定商家的服务商库
+func (d SupplierDao) GetSupplierByEnterprise(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+	var total int64
+	offset := (page - 1) * pageSize
+	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", enterpriseId)
+	query.Count(&total)
+	query = query.Select("supplier_id, cooperate_num, upload_talent_num, cooperate_talent_num, b_operator, b_operator_type, agree_time")
+	err := query.Order("agree_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return enterpriseSupplierCooperates, total, nil
+}
+
+// 获取邀请待确认的服务商
+func (d SupplierDao) GetSupplierConfirmingList(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+	var total int64
+	offset := (page - 1) * pageSize
+	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", enterpriseId)
+	query.Count(&total)
+	query = query.Select("supplier_id,  b_operator, b_operator_type, cooperate_status, create_time")
+	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return enterpriseSupplierCooperates, total, nil
+}

+ 34 - 0
app/dao/sec_brief_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type SecBriefDao struct{}
+
+func (p SecBriefDao) DeleteSecBriefBySelectionId(selectionId string) error {
+	err := Db.Where("selection_id = ?", selectionId).Delete(entity.SecBrief{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p SecBriefDao) CreateSecBrief(briefInfo entity.SecBrief) error {
+	err := Db.Create(&briefInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p SecBriefDao) GetSelectionBriefInfo(selectionId string) ([]*entity.SecBrief, error) {
+	var selectionBriefInfos []*entity.SecBrief
+	err := Db.Model(entity.SecBrief{}).Where("selection_id = ?", selectionId).Find(&selectionBriefInfos).Error
+	if err != nil {
+		logrus.Errorf("[GetSelectionBriefInfo] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return selectionBriefInfos, nil
+}

+ 34 - 0
app/dao/sec_material_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type SecMaterialDao struct{}
+
+func (d SecMaterialDao) DeleteSecMaterialBySelectionId(selectionId string) error {
+	err := Db.Where("selection_id = ?", selectionId).Delete(entity.SecMaterial{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d SecMaterialDao) CreateSecMaterial(secExample entity.SecMaterial) error {
+	err := Db.Create(&secExample).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d SecMaterialDao) GetSelectionMaterialInfo(selectionId string) ([]*entity.SecMaterial, error) {
+	var selectionMaterialInfos []*entity.SecMaterial
+	err := Db.Model(entity.SecMaterial{}).Where("selection_id = ?", selectionId).Find(&selectionMaterialInfos).Error
+	if err != nil {
+		logrus.Errorf("[GetSelectionMaterialInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return selectionMaterialInfos, nil
+}

+ 34 - 0
app/dao/sec_task_info_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"youngee_m_api/app/entity"
+)
+
+type SecTaskInfoDao struct{}
+
+func (s SecTaskInfoDao) CountBySelectionId(selectionId string) (int64, error) {
+	var count int64
+	err := Db.Model(&entity.SecTaskInfo{}).Where("selection_id = ?", selectionId).Count(&count).Error
+	return count, err
+}
+
+// 获取带货子任务中指定悬赏阶段的数据
+func (s SecTaskInfoDao) GetRewardDetailByRewardStage(selectionId string, rewardStage int64, order int64, page int, pageSize int) ([]*entity.SecTaskInfo, int64, error) {
+	secTaskInfos := []*entity.SecTaskInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.SecTaskInfo{}).Where("selection_id = ? AND reward_stage = ?", selectionId, rewardStage)
+	query.Count(&total)
+	query = query.Select("talent_id, sale_actual, withdraw_date")
+	offset := (page - 1) * pageSize
+	var err error
+	if order == 1 {
+		err = query.Order("withdraw_date asc").Offset(offset).Limit(pageSize).Find(&secTaskInfos).Error
+	} else {
+		err = query.Order("withdraw_date desc").Offset(offset).Limit(pageSize).Find(&secTaskInfos).Error
+	}
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return secTaskInfos, total, nil
+}

+ 280 - 0
app/dao/selection_info_dao.go

@@ -0,0 +1,280 @@
+package dao
+
+import (
+	"errors"
+	"fmt"
+	"gorm.io/gorm"
+	"time"
+	"youngee_m_api/app/entity"
+	"youngee_m_api/app/vo"
+)
+
+type SelectionInfoDAO struct{}
+
+func (d SelectionInfoDAO) GetSelectionInfoById(selectionId string) (*entity.SelectionInfo, error) {
+	var selectionInfo entity.SelectionInfo
+	err := Db.Where("selection_id = ?", selectionId).First(&selectionInfo).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &selectionInfo, err
+}
+
+// 根据enterpriseId查询指定某天的所有带货数据
+func (d SelectionInfoDAO) GetSelectionInfoListOfDay(enterpriseId string, date time.Time) ([]entity.SelectionInfo, error) {
+	var selectionInfos []entity.SelectionInfo
+	// 构建查询
+	query := Db.Model(&entity.SelectionInfo{})
+	if enterpriseId != "" {
+		query = query.Where("enterprise_id = ?", enterpriseId)
+	}
+	// 将日期部分提取出来进行匹配
+	query = query.Where("DATE(created_at) = ?", date.Format("2006-01-02"))
+	err := query.Find(&selectionInfos).Error
+	return selectionInfos, err
+}
+
+// 创建带货任务
+func (d SelectionInfoDAO) CreateSelectionInfo(selectionInfo entity.SelectionInfo) error {
+	err := Db.Omit("submit_at", "pass_at", "pay_at", "finish_at", "auto_fail_at").Create(&selectionInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 更新带货任务
+func (d SelectionInfoDAO) UpdateSelectionInfo(selectionInfo entity.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
+	var selectionInfos []entity.SelectionInfo
+	var total int64
+	query := Db.Model(&entity.SelectionInfo{})
+	// 动态添加查询条件
+	//if param.SubAccountId == 0 {
+	//	if param.EnterpriseId == "" {
+	//		return reSelectionTaskPreviews, 0, errors.New("enterpriseId is empty")
+	//	}
+	//	query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	//} else {
+	//	query = query.Where("sub_account_id = ?", param.SubAccountId)
+	//}
+	if param.SelectionPlatform != 0 {
+		query = query.Where("platform = ?", param.SelectionPlatform)
+	}
+	if param.SelectionStatus != 0 {
+		query = query.Where("selection_status = ?", param.SelectionStatus)
+	}
+	// sample_mode 1、2、3分别表示免费领样(有领样策略)、垫付领样(3.0不用)、不提供样品(无领样策略)
+	if param.FreeFlag == 1 {
+		query = query.Where("sample_mode = ?", 1)
+	} else if param.FreeFlag == 2 {
+		query = query.Where("sample_mode = ?", 3)
+	}
+	// task_mode  1、2分别表示悬赏任务(有悬赏策略)、纯佣带货(无悬赏策略)
+	if param.RewardFlag == 1 {
+		query = query.Where("task_mode = ?", 1)
+	} else if param.RewardFlag == 2 {
+		query = query.Where("task_mode = ?", 2)
+	}
+	if param.SelectionId != "" {
+		query = query.Where("selection_id = ?", param.SelectionId)
+	}
+	if param.SelectionName != "" {
+		query = query.Where("selection_name LIKE ?", "%"+param.SelectionName+"%")
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, selection_id, platform, selection_status, created_at, task_ddl, sample_num, enroll_num, choose_num, product_id, estimated_cost")
+	offset := (param.Page - 1) * param.PageSize
+	if param.Order == 1 {
+		if err := query.Order("selection_status desc").Order("task_ddl asc").Offset(offset).Limit(param.PageSize).Find(&selectionInfos).Error; err != nil {
+			return nil, 0, err
+		}
+	} else {
+		if err := query.Order("selection_status asc").Order("task_ddl desc").Offset(offset).Limit(param.PageSize).Find(&selectionInfos).Error; err != nil {
+			return nil, 0, err
+		}
+	}
+
+	for _, selectionInfo := range selectionInfos {
+		reSelectionTaskPreview := vo.ReSelectionTaskPreview{
+			EnterpriseId:      selectionInfo.EnterpriseID,
+			SubAccountId:      selectionInfo.SubAccountId,
+			SelectionId:       selectionInfo.SelectionID,
+			SelectionPlatform: selectionInfo.Platform,
+			SelectionStatus:   selectionInfo.SelectionStatus,
+			CreatedAt:         selectionInfo.CreatedAt.Format("2006-01-02 15:04:05"),
+			TaskDdl:           selectionInfo.TaskDdl.Format("2006-01-02 15:04:05"),
+			SampleNum:         selectionInfo.SampleNum,
+			EnrollNum:         selectionInfo.EnrollNum,
+			ChooseNum:         selectionInfo.ChooseNum,
+			ProductId:         selectionInfo.ProductID,
+			Reward:            selectionInfo.EstimatedCost,
+		}
+		reSelectionTaskPreviews = append(reSelectionTaskPreviews, reSelectionTaskPreview)
+	}
+
+	return reSelectionTaskPreviews, total, nil
+}
+
+// 删除带货任务
+func (d SelectionInfoDAO) DeleteSelection(selectionId string) (*string, error) {
+	if selectionId == "" {
+		return &selectionId, nil
+	}
+	err := Db.Where("selection_id = ?", selectionId).Delete(&entity.SelectionInfo{}).Error
+	if err != nil {
+		return nil, err
+	}
+	return &selectionId, nil
+}
+
+// 获取草稿箱——电商带货任务列表
+func (d SelectionInfoDAO) GetSelectionDraftList(param *vo.SelectionDraftParam) ([]vo.ReSelectionTaskPreview, int64, error) {
+	var reSelectionTaskPreviews []vo.ReSelectionTaskPreview
+	var selectionInfos []entity.SelectionInfo
+	var total int64
+	query := Db.Model(&entity.SelectionInfo{}).Where("selection_status = ?", 1)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reSelectionTaskPreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.SelectionPlatform != 0 {
+		query = query.Where("platform = ?", param.SelectionPlatform)
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, selection_id, platform, created_at, product_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&selectionInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, selectionInfo := range selectionInfos {
+		reSelectionTaskPreview := vo.ReSelectionTaskPreview{
+			EnterpriseId:      selectionInfo.EnterpriseID,
+			SubAccountId:      selectionInfo.SubAccountId,
+			SelectionId:       selectionInfo.SelectionID,
+			SelectionPlatform: selectionInfo.Platform,
+			CreatedAt:         selectionInfo.CreatedAt.Format("2006-01-02 15:04:05"),
+			ProductId:         selectionInfo.ProductID,
+		}
+		reSelectionTaskPreviews = append(reSelectionTaskPreviews, reSelectionTaskPreview)
+	}
+
+	return reSelectionTaskPreviews, total, nil
+}
+
+// 获取电商带货悬赏任务中全部指定状态值的项目
+func (d SelectionInfoDAO) GetSelectionInfoList(value int64, fieldName string) ([]*entity.SelectionInfo, error) {
+	var selectionInfos []*entity.SelectionInfo
+	err := Db.Model(entity.SelectionInfo{}).Where(fmt.Sprintf("task_mode = ? AND %s = ? ", fieldName), 1, value).Find(&selectionInfos).Error
+	if err != nil {
+		return nil, err
+	}
+	return selectionInfos, nil
+}
+
+// 获取电商带货冻结中的任务
+func (d SelectionInfoDAO) GetSelectionFrozenList(enterpriseId string) ([]*entity.SelectionInfo, error) {
+	var selectionInfos []*entity.SelectionInfo
+	query := Db.Debug().Model(entity.SelectionInfo{})
+	query.Select("selection_id, product_id, enterprise_id, sub_account_id, platform, estimated_cost, pay_at") // 冻结金额:estimated_cost
+	err := query.Where(fmt.Sprintf("enterprise_id = ? AND (selection_status between 5 and 6) "), enterpriseId).Find(&selectionInfos).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return selectionInfos, nil
+		} else {
+			return nil, err
+		}
+	}
+	return selectionInfos, nil
+}
+
+// 获取电商带货冻结解除的任务
+func (d SelectionInfoDAO) GetSelectionFrozenCancelList(enterpriseId string) ([]*entity.SelectionInfo, error) {
+	var selectionInfos []*entity.SelectionInfo
+	query := Db.Debug().Model(entity.SelectionInfo{})
+	query.Select("selection_id, product_id, enterprise_id, sub_account_id, platform, settlement_amount, pay_at") // 解冻金额:settlement_amount
+	err := query.Where(fmt.Sprintf("enterprise_id = ? AND (selection_status between 7 and 8) "), enterpriseId).Find(&selectionInfos).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return selectionInfos, nil
+		} else {
+			return nil, err
+		}
+	}
+	return selectionInfos, nil
+}
+
+// 获取带货账单列表
+func (d SelectionInfoDAO) GetBillSelectionPreviews(param *vo.SelectionSearchParam) ([]vo.ReBillSelectionTaskPreview, int64, error) {
+	var reBillSelectionTaskPreviews []vo.ReBillSelectionTaskPreview
+	var selectionInfos []entity.SelectionInfo
+	var total int64
+	query := Db.Model(&entity.SelectionInfo{})
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reBillSelectionTaskPreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.SelectionPlatform != 0 {
+		query = query.Where("platform = ?", param.SelectionPlatform)
+	}
+	if param.SelectionStatus != 0 {
+		query = query.Where("selection_status = ?", param.SelectionStatus)
+	}
+	if param.SelectionId != "" {
+		query = query.Where("selection_id = ?", param.SelectionId)
+	}
+	if param.SelectionName != "" {
+		query = query.Where("selection_name LIKE ?", "%"+param.SelectionName+"%")
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, selection_id, platform, selection_status, created_at, task_ddl, product_id, settlement_amount")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&selectionInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, selectionInfo := range selectionInfos {
+		reBillSelectionTaskPreview := vo.ReBillSelectionTaskPreview{
+			EnterpriseId:      selectionInfo.EnterpriseID,
+			SubAccountId:      selectionInfo.SubAccountId,
+			SelectionId:       selectionInfo.SelectionID,
+			SelectionPlatform: selectionInfo.Platform,
+			SelectionStatus:   selectionInfo.SelectionStatus,
+			CreatedAt:         selectionInfo.CreatedAt.Format("2006-01-02 15:04:05"),
+			TaskDdl:           selectionInfo.TaskDdl.Format("2006-01-02 15:04:05"),
+			ProductId:         selectionInfo.ProductID,
+			CashAmount:        selectionInfo.SettlementAmount,
+		}
+		reBillSelectionTaskPreviews = append(reBillSelectionTaskPreviews, reBillSelectionTaskPreview)
+	}
+
+	return reBillSelectionTaskPreviews, total, nil
+}

+ 34 - 0
app/dao/selection_review_dao.go

@@ -0,0 +1,34 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type SelectionReviewDao struct{}
+
+func (p SelectionReviewDao) Create(reviewInfo *entity.ReviewSelection) error {
+	err := Db.Create(&reviewInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p SelectionReviewDao) GetSelectionReviewByStatus(status int64) ([]*entity.ReviewSelection, error) {
+	var reviewSelections []*entity.ReviewSelection
+	err := Db.Model(entity.ReviewSelection{}).Where("status = ?", status).Find(&reviewSelections).Error
+	if err != nil {
+		logrus.Errorf("[GetSelectionReviewByStatus] error query mysql, err:%+v", err)
+		return nil, err
+	}
+	return reviewSelections, nil
+}
+
+func (p SelectionReviewDao) UpdateSelectionReview(reviewSelection *entity.ReviewSelection) error {
+	err := Db.Debug().Model(&entity.ReviewSelection{}).Where("id = ?", reviewSelection.ID).Updates(reviewSelection).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 89 - 0
app/dao/store_dao.go

@@ -0,0 +1,89 @@
+package dao
+
+import (
+	"errors"
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type StoreDao struct{}
+
+func (d StoreDao) CreateStore(store entity.Store) (int64, error) {
+	err := Db.Model(&entity.Store{}).Create(&store).Error
+	if err != nil {
+		return 0, err
+	}
+	return store.StoreID, nil
+}
+
+func (d StoreDao) UpdateStore(store entity.Store) (int64, error) {
+	err := Db.Model(&entity.Store{}).Where("store_id = ?", store.StoreID).Updates(store).Error
+	if err != nil {
+		return 0, err
+	}
+	return store.StoreID, nil
+}
+
+func (d StoreDao) DeleteStore(storeId int64) error {
+	err := Db.Where("store_id = ?", storeId).Delete(&entity.Store{}).Error
+	return err
+}
+
+func (d StoreDao) GetStoreByID(storeId int64) (*entity.Store, error) {
+	var store entity.Store
+	err := Db.Debug().Where("store_id = ?", storeId).First(&store).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &store, nil
+}
+
+func (d StoreDao) GetStoresByEnterpriseID(enterpriseId string, page int, pageSize int) ([]entity.Store, int64, error) {
+	var stores []entity.Store
+	var total int64
+	query := Db.Model(&entity.Store{}).Where("enterprise_id = ? AND is_deleted = ?", enterpriseId, 0)
+	query.Count(&total)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	// 分页查询
+	err := query.Order("created_at desc").Offset(offset).Limit(pageSize).Find(&stores).Error
+	if err != nil {
+		return nil, 0, err
+	}
+	return stores, total, nil
+}
+
+func (d StoreDao) GetStoresByEnterpriseIDAndStoreName(enterpriseId string, storeName string, page int, pageSize int) ([]entity.Store, int64, error) {
+	var stores []entity.Store
+	var total int64
+	query := Db.Model(&entity.Store{}).Where("enterprise_id = ? AND is_deleted = ?", enterpriseId, 0)
+	if storeName != "" {
+		query = query.Where("store_name LIKE ?", "%"+storeName+"%")
+	}
+	query.Count(&total)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	// 分页查询
+	err := query.Order("created_at desc").Offset(offset).Limit(pageSize).Find(&stores).Error
+	if err != nil {
+		return nil, 0, err
+	}
+	return stores, total, nil
+}
+
+// 更新team_num字段值
+func (d StoreDao) IncrementTeamNum(storeId int64) error {
+	err := Db.Model(&entity.Store{}).Where("store_id = ?", storeId).Update("team_num", gorm.Expr("team_num + ?", 1)).Error
+	return err
+}
+
+// 获取所有门店类目
+func (d StoreDao) GetStoreCategory() ([]entity.StoreCategory, error) {
+	var storeCategory []entity.StoreCategory
+	err := Db.Model(&entity.StoreCategory{}).Find(&storeCategory).Error
+	return storeCategory, err
+}

+ 23 - 0
app/dao/sub_account_dao.go

@@ -0,0 +1,23 @@
+package dao
+
+import "youngee_m_api/app/entity"
+
+type SubAccountDao struct{}
+
+func (d SubAccountDao) GetSubAccount(subAccountId int64) (*entity.SubAccount, error) {
+	var subAccount entity.SubAccount
+	err := Db.Model(&entity.SubAccount{}).Where("sub_account_id = ?", subAccountId).Select("sub_account_name, user_id").First(&subAccount).Error
+	if err != nil {
+		return nil, err
+	}
+	return &subAccount, nil
+}
+
+//func (d SubAccountDao) GetSubAccountPhone(subAccountId int64) (string, error) {
+//	var phone string
+//	err := Db.Model(&entity.SubAccount{}).Where("sub_account_id = ?", subAccountId).Select("phone").First(&phone).Error
+//	if err != nil {
+//		return "", err
+//	}
+//	return phone, nil
+//}

+ 46 - 0
app/dao/supplier_dao.go

@@ -0,0 +1,46 @@
+package dao
+
+import (
+	"gorm.io/gorm"
+	"strconv"
+	"youngee_m_api/app/entity"
+)
+
+type SupplierDao struct{}
+
+func (d SupplierDao) GetSupplierInfoById(supplierId int64) (*entity.Supplier, error) {
+	var supplier entity.Supplier
+	err := Db.Debug().Model(&entity.Supplier{}).Where("supplier_id = ?", supplierId).First(&supplier).Error
+	if err != nil && err != gorm.ErrRecordNotFound {
+		return nil, err
+	}
+	return &supplier, nil
+}
+
+// 根据服务商名称/认证名搜索
+func (d SupplierDao) GetSuppliersByMsg(fieldName string) ([]*entity.Supplier, error) {
+	var suppliers []*entity.Supplier
+	supplierId, err := strconv.ParseInt(fieldName, 10, 64)
+	if err == nil {
+		err1 := Db.Debug().Model(&entity.Supplier{}).Where("supplier_id = ? AND supplier_type != 0", supplierId).First(&suppliers).Error
+		if err1 != nil && err1 != gorm.ErrRecordNotFound {
+			return nil, err1
+		}
+	} else {
+		err1 := Db.Debug().Model(&entity.Supplier{}).Where("supplier_name = ? OR company_name = ? OR name = ? AND supplier_type != 0", fieldName, fieldName, fieldName).Find(&suppliers).Error
+		if err1 != nil {
+			return nil, err
+		}
+	}
+
+	return suppliers, nil
+}
+
+func (d SupplierDao) GetSupplierPhone(supplierId int64) (string, error) {
+	var phone string
+	err := Db.Debug().Model(&entity.Supplier{}).Where("supplier_id = ?", supplierId).Select("phone_number").First(&phone).Error
+	if err != nil && err != gorm.ErrRecordNotFound {
+		return "", err
+	}
+	return phone, nil
+}

+ 39 - 0
app/dao/talent_info_dao.go

@@ -0,0 +1,39 @@
+package dao
+
+import (
+	"database/sql"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/app/entity"
+)
+
+type TalentInfoDao struct{}
+
+func (d TalentInfoDao) SelectTalentPhone(talentId string) (*string, error) {
+	var talentInfo *entity.YoungeeTalentInfo
+	err := Db.Model(entity.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&talentInfo).Error
+	if err != nil {
+		logrus.Errorf("[SelectTalentInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return &talentInfo.TalentPhoneNumber, nil
+}
+
+func (d TalentInfoDao) SelectTalentInfo(talentId string) (*entity.YoungeeTalentInfo, error) {
+	var talentInfo *entity.YoungeeTalentInfo
+	err := Db.Model(&entity.YoungeeTalentInfo{}).Where("id = ?", talentId).Find(&talentInfo).Error
+	if err != nil {
+		if err.Error() == sql.ErrNoRows.Error() {
+			return nil, nil
+		}
+		logrus.Errorf("[SelectTalentInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return talentInfo, nil
+}
+
+// 获取达人内容类型
+func (d TalentInfoDao) GetTalentCategory() ([]entity.TalentCategory, error) {
+	var talentCategory []entity.TalentCategory
+	err := Db.Model(&entity.TalentCategory{}).Find(&talentCategory).Error
+	return talentCategory, err
+}

+ 21 - 0
app/dao/task_logistics_dao.go

@@ -0,0 +1,21 @@
+package dao
+
+import (
+	"errors"
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type TaskLogisticsDao struct{}
+
+func (d TaskLogisticsDao) SelectTaskLogistics(taskId string) (*entity.TaskLogistics, error) {
+	var taskLogistics *entity.TaskLogistics
+	err := Db.Model(&entity.TaskLogistics{}).Where("task_id = ?", taskId).Find(&taskLogistics).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		}
+		return nil, err
+	}
+	return taskLogistics, nil
+}

+ 76 - 0
app/dao/team_buying_dao.go

@@ -0,0 +1,76 @@
+package dao
+
+import (
+	"errors"
+	"gorm.io/gorm"
+	"youngee_m_api/app/entity"
+)
+
+type TeamBuyingDao struct{}
+
+func (d TeamBuyingDao) CreateTeamBuying(teamBuying entity.TeamBuying) (int64, error) {
+	err := Db.Model(&entity.TeamBuying{}).Create(&teamBuying).Error
+	if err != nil {
+		return 0, err
+	}
+	return teamBuying.TeamBuyingID, nil
+}
+
+func (d TeamBuyingDao) UpdateTeamBuying(teamBuying entity.TeamBuying) (int64, error) {
+	err := Db.Model(&entity.TeamBuying{}).Where("team_buying_id = ?", teamBuying.TeamBuyingID).Updates(teamBuying).Error
+	if err != nil {
+		return 0, err
+	}
+	return teamBuying.TeamBuyingID, nil
+}
+
+func (d TeamBuyingDao) DeleteTeamBuying(teamBuyingId int64) error {
+	err := Db.Where("team_buying_id = ?", teamBuyingId).Delete(&entity.TeamBuying{}).Error
+	return err
+}
+
+func (d TeamBuyingDao) GetTeamBuyingByID(teamBuyingId int64) (*entity.TeamBuying, error) {
+	var teamBuying entity.TeamBuying
+	err := Db.Debug().Where("team_buying_id = ?", teamBuyingId).First(&teamBuying).Error
+	if err != nil {
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
+	}
+	return &teamBuying, nil
+}
+
+func (d TeamBuyingDao) GetTeamBuyingsByStoreId(storeId int64, page int, pageSize int) ([]entity.TeamBuying, int64, error) {
+	var teamBuyings []entity.TeamBuying
+	var total int64
+	query := Db.Model(&entity.TeamBuying{}).Where("store_id = ? AND is_deleted = ?", storeId, 0)
+	query.Count(&total)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	// 分页查询
+	err := Db.Model(&entity.TeamBuying{}).Where("store_id = ? AND is_deleted = ?", storeId, 0).Order("created_at desc").Offset(offset).Limit(pageSize).Find(&teamBuyings).Error
+	if err != nil {
+		return nil, 0, err
+	}
+	return teamBuyings, total, nil
+}
+
+func (d TeamBuyingDao) GetTeamBuyingsByStoreIdAndTeamBuyingTitle(storeId int64, teamBuyingTitle string, page int, pageSize int) ([]entity.TeamBuying, int64, error) {
+	var teamBuyings []entity.TeamBuying
+	var total int64
+	query := Db.Model(&entity.TeamBuying{}).Where("store_id = ? AND is_deleted = ?", storeId, 0)
+	if teamBuyingTitle != "" {
+		query = query.Where("team_buying_name LIKE ?", "%"+teamBuyingTitle+"%")
+	}
+	query.Count(&total)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	// 分页查询
+	err := Db.Model(&entity.TeamBuying{}).Where("store_id = ? AND is_deleted = ?", storeId, 0).Order("created_at desc").Offset(offset).Limit(pageSize).Find(&teamBuyings).Error
+	if err != nil {
+		return nil, 0, err
+	}
+	return teamBuyings, total, nil
+}

+ 23 - 0
app/dao/user_dao.go

@@ -0,0 +1,23 @@
+package dao
+
+import "youngee_m_api/app/entity"
+
+type UserDao struct{}
+
+func (d UserDao) GetPhoneByUserId(userId int64) (string, error) {
+	var user entity.User
+	err := Db.Model(&entity.User{}).Where("id = ?", userId).Select("phone").First(&user).Error
+	if err != nil {
+		return "", err
+	}
+	return user.Phone, nil
+}
+
+func (d UserDao) GetNameByUserId(userId int64) (string, error) {
+	var user entity.User
+	err := Db.Model(&entity.User{}).Where("id = ?", userId).Select("username").First(&user).Error
+	if err != nil {
+		return "", err
+	}
+	return user.Username, nil
+}

+ 32 - 0
app/entity/book_info.go

@@ -0,0 +1,32 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+// 种草任务初稿信息
+type BookInfo struct {
+	BookID            int64     `gorm:"column:book_id;primary_key;AUTO_INCREMENT"` // 探店id
+	TaskID            string    `gorm:"column:task_id;NOT NULL"`                   // 任务id
+	Day               time.Time `gorm:"column:day"`                                // 预计到店日期
+	Time              time.Time `gorm:"column:time"`                               // 预计到店时间
+	ReviseOpinion     string    `gorm:"column:revise_opinion"`                     // 反馈意见
+	IsSubmit          int64     `gorm:"column:is_submit;NOT NULL"`                 // 是否提交
+	IsReview          int64     `gorm:"column:is_review;default:0;NOT NULL"`       // 是否审核
+	IsOk              int64     `gorm:"column:is_ok;NOT NULL"`                     // 是否合格
+	CreateAt          time.Time `gorm:"column:create_at;NOT NULL"`                 // 创建时间
+	AgreeAt           time.Time `gorm:"column:agree_at"`                           // 同意时间
+	RejectAt          time.Time `gorm:"column:reject_at"`                          // 驳回时间
+	SubmitAt          time.Time `gorm:"column:submit_at"`                          // 提交时间
+	AutoAgreeAt       time.Time `gorm:"column:auto_agree_at"`                      // 初稿自动审核时间
+	AutoLinkBreakAt   time.Time `gorm:"column:auto_link_break_at"`                 // 链接违约自动处理时间
+	AutoSketchBreakAt time.Time `gorm:"column:auto_sketch_break_at"`               // 初稿违约自动处理时间
+	BOperator         string    `gorm:"column:b_operator"`                         // 商家确定达人操作人ID
+
+	BOperatorType int `gorm:"column:b_operator_type;default:0"` // 商家操作人类型,1商家用户,2商家子账号,3管理后台
+}
+
+func (m *BookInfo) TableName() string {
+	return "younggee_book_info"
+}

+ 12 - 0
app/entity/coop_platform.go

@@ -0,0 +1,12 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+// 合作平台表
+type CoopPlatform struct {
+	ID           int64  `gorm:"column:id;primary_key;AUTO_INCREMENT"` // id
+	PlatformIcon string `gorm:"column:platform_icon;NOT NULL"`        // 平台icon
+}
+
+func (m *CoopPlatform) TableName() string {
+	return "younggee_coop_platform"
+}

+ 30 - 0
app/entity/enterprise.go

@@ -0,0 +1,30 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type Enterprise struct {
+	EnterpriseID string `gorm:"column:enterprise_id"` // 企业id,用户ID的生成规则为:1(企业用户代码)+分秒数字+四位随机数字
+	Industry     int64  `gorm:"column:industry"`      // 行业,1-14分别代表能源、化工、材料、机械设备/军工、企业服务/造纸印刷、运输设备、旅游酒店、媒体/信息通信服务、批发/零售、消费品、卫生保健/医疗、金融、建材/建筑/房地产、公共事业
+	BusinessName string `gorm:"column:business_name"` // 公司或组织名称
+	TaxNumber    string `gorm:"column:tax_number"`
+	Address      string `gorm:"column:address"`
+
+	UserId           int64     `gorm:"column:user_id"`           // 对应用户id
+	Balance          float64   `gorm:"column:balance"`           // 账户余额
+	FrozenBalance    float64   `gorm:"column:frozen_balance"`    // 冻结余额
+	AvailableBalance float64   `gorm:"column:available_balance"` // 可用余额
+	BillableAmount   float64   `gorm:"column:billable_amount"`   // 可开票金额
+	Invoicing        float64   `gorm:"column:invoicing"`         // 开票中金额
+	Recharging       float64   `gorm:"column:recharging"`        // 充值中金额
+	CreatedAt        time.Time `gorm:"column:created_at"`        // 创建时间
+	UpdatedAt        time.Time `gorm:"column:updated_at"`        // 更新时间
+	AuthStatus       int64     `gorm:"column:auth_status"`
+	Phone            string    `gorm:"column:phone"`
+}
+
+func (m *Enterprise) TableName() string {
+	return "enterprise"
+}

+ 24 - 0
app/entity/enterprise_supplier_cooperate.go

@@ -0,0 +1,24 @@
+package entity
+
+import "time"
+
+type EnterpriseSupplierCooperate struct {
+	CooperateId        int64     `gorm:"column:cooperate_id;primary_key;AUTO_INCREMENT"` // 合作表主键ID
+	EnterpriseId       string    `gorm:"column:enterprise_id"`                           // 商家ID
+	SupplierId         int64     `gorm:"column:supplier_id"`                             // 服务商ID
+	CooperateNum       int64     `gorm:"column:cooperate_num"`                           // 受邀合作次数
+	UploadTalentNum    int64     `gorm:"column:upload_talent_num"`                       // 提报达人数量
+	CooperateTalentNum int64     `gorm:"column:cooperate_talent_num"`                    // 合作达人人数
+	SOperator          int64     `gorm:"column:s_operator"`                              // 服务商同意/拒绝邀约操作人
+	SOperatorType      int64     `gorm:"column:s_operator_type"`                         // 服务商操作人类型:1主账号,2子账号
+	BOperator          string    `gorm:"column:b_operator"`                              // 商家发起入库邀约人
+	BOperatorType      int64     `gorm:"column:b_operator_type"`                         // 商家发起入库邀约人类型:1主账号,2子账号
+	CooperateStatus    int64     `gorm:"column:cooperate_status"`                        // 邀约状态:1待同意,2已同意,3已拒绝
+	CreateTime         time.Time `gorm:"column:create_time"`                             // 合作邀约时间
+	AgreeTime          time.Time `gorm:"column:agree_time"`                              // 同意邀约时间
+	RejectTime         time.Time `gorm:"column:reject_time"`                             // 拒绝邀约时间
+}
+
+func (m *EnterpriseSupplierCooperate) TableName() string {
+	return "enterprise_supplier_cooperate"
+}

+ 20 - 0
app/entity/free_strategy.go

@@ -0,0 +1,20 @@
+package entity
+
+type FreeStrategy struct {
+	FreeStrategyId    int64  `gorm:"column:free_strategy_id;primary_key;AUTO_INCREMENT"` // 免费领样策略id
+	StrategyId        int64  `gorm:"column:strategy_id"`                                 // 策略编号
+	SelectionId       string `gorm:"column:selection_id"`                                // 带货任务id
+	FollowersLow      int64  `gorm:"column:followers_low"`                               // 达人粉丝数下限
+	FollowersUp       int64  `gorm:"column:followers_up"`                                // 达人粉丝数上限
+	SaleNum           int64  `gorm:"column:sale_num"`                                    // 近30天橱窗销量
+	StrategyStatus    int64  `gorm:"column:strategy_status"`                             // 招募策略状态
+	EnrollNum         int64  `gorm:"column:enroll_num"`                                  // 报名数量
+	ChooseNum         int64  `gorm:"column:choose_num"`                                  // 已选数量
+	BeforeDeliveryNum int64  `gorm:"column:before_delivery_num"`                         // 待发货数量
+	DeliveryNum       int64  `gorm:"column:delivery_num"`                                // 已发货数量
+	AfterDeliveryNum  int64  `gorm:"column:after_delivery_num"`                          // 已收货数量
+}
+
+func (m *FreeStrategy) TableName() string {
+	return "free_strategy"
+}

+ 28 - 0
app/entity/info_auto_default.go

@@ -0,0 +1,28 @@
+package entity
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+type InfoAutoDefault struct {
+	AutoDefaultID          int64 `gorm:"column:auto_default_id;primary_key;AUTO_INCREMENT"` // 自动处理规则id
+	EnterpriseId           int64 `gorm:"column:enterprise_id"`                              // 企业id
+	SketchReplaceNotUpload int64 `gorm:"column:sketch_replace_not_upload"`                  // 初稿违约 产品置换 未上传初稿
+	SketchReplaceTimeOut   int64 `gorm:"column:sketch_replace_time_out"`                    // 初稿违约 产品置换 超时未上传初稿
+	SketchOtherNotUpload   int64 `gorm:"column:sketch_other_not_upload"`                    // 初稿违约 自报价、固定稿费 未上传初稿
+	SketchOtherTimeOut     int64 `gorm:"column:sketch_other_time_out"`                      // 初稿违约 自报价、固定稿费 超时未上传初稿
+	ScriptReplaceNotUpload int64 `gorm:"column:script_replace_not_upload"`                  // 脚本违约 产品置换 未上传脚本
+	ScriptReplaceTimeOut   int64 `gorm:"column:script_replace_time_out"`                    // 脚本违约 产品置换 超时未上传脚本
+	ScriptOtherNotUpload   int64 `gorm:"column:script_other_not_upload"`                    // 脚本违约 自报价、固定稿费 未上传脚本
+	ScriptOtherTimeOut     int64 `gorm:"column:script_other_time_out"`                      // 脚本违约 自报价、固定稿费 超时未上传脚本
+	LinkReplaceNotUpload   int64 `gorm:"column:link_replace_not_upload"`                    // 链接违约 产品置换 未上传链接
+	LinkReplaceTimeOut     int64 `gorm:"column:link_replace_time_out"`                      // 链接违约 产品置换 超时未上传链接
+	LinkOtherNotUpload     int64 `gorm:"column:link_other_not_upload"`                      // 链接违约 自报价、固定稿费 未上传链接
+	LinkOtherTimeOut       int64 `gorm:"column:link_other_time_out"`                        // 链接违约 自报价、固定稿费 超时未上传链接
+	DataReplaceNotUpload   int64 `gorm:"column:data_replace_not_upload"`                    // 数据违约 产品置换 未上传数据
+	DataReplaceTimeOut     int64 `gorm:"column:data_replace_time_out"`                      // 数据违约 产品置换 超时未上传数据
+	DataOtherNotUpload     int64 `gorm:"column:data_other_not_upload"`                      // 数据违约 自报价、固定稿费 未上传数据
+	DataOtherTimeOut       int64 `gorm:"column:data_other_time_out"`                        // 数据违约 自报价、固定稿费 超时未上传数据
+}
+
+func (m *InfoAutoDefault) TableName() string {
+	return "info_auto_default_handle"
+}

+ 23 - 0
app/entity/info_auto_task.go

@@ -0,0 +1,23 @@
+package entity
+
+type InfoAutoTask struct {
+	AutoTaskID        int64 `gorm:"column:auto_task_id;primary_key;AUTO_INCREMENT"` // 自动处理规则id
+	EnterpriseId      int64 `gorm:"column:enterprise_id"`                           // 企业id
+	SignInOffline     int64 `gorm:"column:sign_in_offline"`                         // 线下探店自动签收时间
+	SignInVirtual     int64 `gorm:"column:sign_in_virtual"`                         // 虚拟产品测评自动签收时间
+	ReviewInMv        int64 `gorm:"column:review_in_mv"`                            // 视频形式的审稿处理
+	ReviewUnlimited   int64 `gorm:"column:review_unlimited"`                        // 不限形式的审稿处理
+	PostReview        int64 `gorm:"column:post_review"`                             // 发布审核自动处理
+	CaseClose         int64 `gorm:"column:case_close"`                              // 结案自动处理
+	Invalid           int64 `gorm:"column:invalid"`                                 // 全流程项目失效自动处理
+	DraftDefaultInPic int64 `gorm:"column:draft_default_in_pic"`                    // 图片初稿违约自动处理
+	DraftDefaultInMv  int64 `gorm:"column:draft_default_in_mv"`                     // 视频初稿违约自动处理
+	ScriptDefault     int64 `gorm:"column:script_default"`                          // 脚本违约自动处理
+	LinkBreach        int64 `gorm:"column:link_breach"`                             // 链接违约自动处理
+	CaseCloseDefault  int64 `gorm:"column:case_close_default"`                      // 结案违约自动处理
+	SelectionInvalid  int64 `gorm:"column:selection_invalid"`                       // 选品项目失效自动处理
+}
+
+func (m *InfoAutoTask) TableName() string {
+	return "info_auto_task"
+}

+ 27 - 0
app/entity/info_pricing_strategy.go

@@ -0,0 +1,27 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type InfoPricingStrategy struct {
+	ID            int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"` //  id
+	ProjectType   int64     `gorm:"column:project_type;NOT NULL"`         // 项目类型,0表示不限,1为全流程项目
+	StrategyId    string    `gorm:"column:strategyId;NOT NULL"`           // 定价策略编号
+	FeeForm       int64     `gorm:"column:fee_form;NOT NULL"`             // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
+	Platform      int64     `gorm:"column:platform;NOT NULL"`             // 项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
+	FansLow       int64     `gorm:"column:fans_low;NOT NULL"`             // 对应粉丝量下限
+	FansUp        int64     `gorm:"column:fans_up;NOT NULL"`              // 对应粉丝量上限
+	ServiceCharge float64   `gorm:"column:service_charge"`                // 服务费,稿费形式为产品置换时填写,可以为空
+	BaseOffer     float64   `gorm:"column:base_offer"`                    // 基础报价
+	Status        int64     `gorm:"column:status;NOT NULL"`               // 定价策略当前状态,0表示正常,1表示禁用
+	ServiceRate   int64     `gorm:"column:service_rate"`                  // 服务费率*1000,稿费形式为固定稿费和自报价时填写,可以为空
+	UpdateID      int64     `gorm:"column:update_id"`                     // 修改管理人员id,对应user表中主键
+	UpdateAt      time.Time `gorm:"column:update_at"`                     // 修改时间
+	CreateAt      time.Time `gorm:"column:create_at;NOT NULL"`            // 创建时间
+}
+
+func (m *InfoPricingStrategy) TableName() string {
+	return "info_pricing_strategy"
+}

+ 11 - 0
app/entity/info_product_category.go

@@ -0,0 +1,11 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+type InfoProductCategory struct {
+	ID              int64  `gorm:"column:id;primary_key;AUTO_INCREMENT"` // 商品类型id
+	ProductCategory string `gorm:"column:product_category;NOT NULL"`     // 商品类型
+}
+
+func (m *InfoProductCategory) TableName() string {
+	return "info_product_category"
+}

+ 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"
+}

+ 33 - 0
app/entity/invoice_record.go

@@ -0,0 +1,33 @@
+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"`                      // 账单列表
+	InvoiceUrl        string    `gorm:"column:invoice_url;NOT NULL"`                   // 发票
+}
+
+func (m *InvoiceRecord) TableName() string {
+	return "younggee_invoice_record"
+}

+ 20 - 0
app/entity/local_life_brief.go

@@ -0,0 +1,20 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type LocalLifeBrief struct {
+	LocalBriefID int64     `gorm:"column:local_brief_id;primary_key;AUTO_INCREMENT"` // 手卡id
+	FileUrl      string    `gorm:"column:file_url"`                                  // 文件url
+	FileUid      string    `gorm:"column:file_uid"`                                  // 文件uid
+	LocalID      string    `gorm:"column:local_id"`                                  // 所属本地生活id
+	CreatedAt    time.Time `gorm:"column:created_at"`                                // 创建时间
+	FileName     string    `gorm:"column:file_name"`                                 // 文件名称
+	Type         int64     `gorm:"column:type;NOT NULL"`                             // 手卡类型(1图片 2文档)
+}
+
+func (m *LocalLifeBrief) TableName() string {
+	return "local_life_brief"
+}

+ 59 - 0
app/entity/local_life_info.go

@@ -0,0 +1,59 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type LocalLifeInfo struct {
+	ID                  int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"`             // 本地生活表主键ID
+	LocalID             string    `gorm:"column:local_id;NOT NULL"`                         // 项目id
+	LocalType           int64     `gorm:"column:local_type"`                                // 项目类型,1代表全流程项目,2代表专项项目
+	LocalPlatform       int64     `gorm:"column:local_platform"`                            // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	ServiceChargeRate   float64   `gorm:"column:service_charge_rate;default:0.00;NOT NULL"` // 公开服务费率
+	StoreID             int64     `gorm:"column:store_id"`                                  // 关联门店id
+	StoreRelatedAt      time.Time `gorm:"column:store_related_at"`                          // 关联门店时间
+	TeamBuyingId        int64     `gorm:"column:team_buying_id"`                            // 关联团购id
+	TeamBuyingRelatedAt time.Time `gorm:"column:team_buying_related_at"`                    // 关联团购时间
+	PromoteBody         int64     `gorm:"column:promote_body"`                              // 推广主体(1门店 2团购)
+	Donate              int64     `gorm:"column:donate"`                                    // 赠送达人套餐(1有赠送 2无赠送)
+	LocalName           string    `gorm:"column:local_name"`                                // 任务标题
+	TalentType          string    `gorm:"column:talent_type"`                               // 达人类型(,分隔)
+	RecruitDdl          time.Time `gorm:"column:recruit_ddl"`                               // 招募截止时间
+	TaskForm            int64     `gorm:"column:task_form"`                                 // 任务形式,1-3分别代表商品寄拍、素材分发、虚拟产品测评
+	ContentType         int64     `gorm:"column:content_type"`                              // 内容形式,1代表图文,2代表视频
+	TaskDetail          string    `gorm:"column:task_detail"`                               // 任务详情
+	TaskStatus          int64     `gorm:"column:task_status"`                               // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、执行中、失效、已结案
+	EnterpriseID        string    `gorm:"column:enterprise_id"`                             // 所属企业id
+	SubAccountID        int64     `gorm:"column:sub_account_id;default:0;NOT NULL"`         // 子账号id
+	OperatorType        int64     `gorm:"column:operator_type;default:NULL"`                // 创建者类型,1商家主账号,2商家子账号
+	ApplyNum            int64     `gorm:"column:apply_num;default:0;NOT NULL"`              // 报名人数
+	RecruitNum          int64     `gorm:"column:recruit_num;default:0;NOT NULL"`            // 已招募人数
+	CreatedAt           time.Time `gorm:"column:created_at"`                                // 创建时间
+	UpdatedAt           time.Time `gorm:"column:updated_at"`                                // 修改时间
+	AutoFailAt          time.Time `gorm:"column:auto_fail_at"`                              // 失效自动处理时间
+	AutoTaskID          int64     `gorm:"column:auto_task_id;default:0;NOT NULL"`           // 定时任务id
+	AutoDefaultID       int64     `gorm:"column:auto_default_id;default:0;NOT NULL"`        // 违约状态id
+	FailReason          int64     `gorm:"column:fail_reason"`                               // 失效原因,1、2分别表示逾期未支付、项目存在风险
+	PaymentAmount       float64   `gorm:"column:payment_amount"`                            // 支付金额
+	PayAt               time.Time `gorm:"column:pay_at"`                                    // 支付时间
+	SubmitAt            time.Time `gorm:"column:submit_at"`                                 // 提交审核时间
+	PassAt              time.Time `gorm:"column:pass_at"`                                   // 审核通过时间
+	FinishAt            time.Time `gorm:"column:finish_at"`                                 // 结案时间
+	EstimatedCost       float64   `gorm:"column:estimated_cost"`                            // 预估成本
+	SettlementAmount    float64   `gorm:"column:settlement_amount"`                         // 结算金额
+	TotalRecruitNum     int64     `gorm:"column:total_recruit_num"`                         // 此任务各策略招募人数总和
+	Tools               string    `gorm:"column:tools"`                                     // 工具选择,1邀约招募 2结算账单 3样品物流 4审稿工具 5作品审查 6数据巡检(,分隔)
+	NeedReview          int64     `gorm:"column:need_review;default:0;NOT NULL"`            // 待审稿
+	NeedQuality         int64     `gorm:"column:need_quality;default:0;NOT NULL"`           // 待质检
+	NeedCalculate       int64     `gorm:"column:need_calculate;default:0;NOT NULL"`         // 待结算
+	NeedReserve         int64     `gorm:"column:need_reserve;default:0;NOT NULL"`           // 待预约
+	NeedConfirm         int64     `gorm:"column:need_confirm;default:0;NOT NULL"`           // 待确认
+	NeedExplore         int64     `gorm:"column:need_explore;NOT NULL"`                     // 待探店
+	ExploredNum         int64     `gorm:"column:explored_num;default:0;NOT NULL"`           // 已探店
+	InvoiceStatus       int64     `gorm:"column:invoice_status;default:0;NOT NULL"`         // 开票状态(1开票中 2已开票)
+}
+
+func (m *LocalLifeInfo) TableName() string {
+	return "younggee_local_life_info"
+}

+ 21 - 0
app/entity/local_life_material.go

@@ -0,0 +1,21 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+// 本地生活补充素材
+type LocalLifeMaterial struct {
+	MaterialID int64     `gorm:"column:material_id;primary_key;AUTO_INCREMENT"` // 本地生活素材id
+	FileUrl    string    `gorm:"column:file_url"`                               // 文件url
+	FileUid    string    `gorm:"column:file_uid"`                               // 文件uid
+	LocalID    string    `gorm:"column:local_id"`                               // 所属本地生活id
+	CreatedAt  time.Time `gorm:"column:created_at"`                             // 创建时间
+	FileName   string    `gorm:"column:file_name"`                              // 文件名称
+	Type       int64     `gorm:"column:type;NOT NULL"`                          // 素材类型(1图片 2视频)
+}
+
+func (m *LocalLifeMaterial) TableName() string {
+	return "local_life_material"
+}

+ 87 - 0
app/entity/local_life_task_info.go

@@ -0,0 +1,87 @@
+package entity
+
+// Code generated by sql2gorm. DO NOT EDIT.
+import "time"
+
+type LocalLifeTaskInfo struct {
+	TaskID                 string    `gorm:"column:task_id;primary_key"`                  // 任务id
+	LocalID                string    `gorm:"column:local_id;NOT NULL"`                    // 项目id
+	TalentID               string    `gorm:"column:talent_id;NOT NULL"`                   // 达人id
+	AccountID              int64     `gorm:"column:account_id;NOT NULL"`                  // 账号id
+	StrategyID             int64     `gorm:"column:strategy_id"`                          // 报名选择的招募策略id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap;NOT NULL"`   // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap;NOT NULL"`   // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap;NOT NULL"`       // 收货地址快照
+	TaskReward             string    `gorm:"column:task_reward;NOT NULL"`                 // 达人报酬(3.0未用)
+	SettleAmount           string    `gorm:"column:settle_amount;NOT NULL"`               // 达人实际所得(自动填充)(扣除违约扣款)
+	AllPayment             string    `gorm:"column:all_payment;NOT NULL"`                 // 企业支付(3.0未用)
+	RealPayment            string    `gorm:"column:real_payment;NOT NULL"`                // 企业实际支付(加上服务商的服务费)(扣除违约扣款)
+	ServiceRate            int64     `gorm:"column:service_rate"`                         // 服务费率,千分之
+	ServiceCharge          string    `gorm:"column:service_charge"`                       // 服务费
+	RealServiceCharge      string    `gorm:"column:real_service_charge"`                  // 服务商实际所得服务费(扣除违约)
+	FeeForm                int64     `gorm:"column:fee_form"`                             // 稿费形式,1,2,3分别代表产品置换、一口价、自报价
+	ErrBreakRate           int64     `gorm:"column:err_break_rate;default:0;NOT NULL"`    // 未上传类型违约扣款比例,百分之
+	ScriptBreakRate        int64     `gorm:"column:script_break_rate;default:0;NOT NULL"` // 脚本上传超时违约扣款比例,百分之
+	SketchBreakRate        int64     `gorm:"column:sketch_break_rate;default:0;NOT NULL"` // 初稿上传超时违约扣款比例,百分之
+	LinkBreakRate          int64     `gorm:"column:link_break_rate;default:0;NOT NULL"`   // 链接上传超时违约扣款比例,百分之
+	DataBreakRate          int64     `gorm:"column:data_break_rate;default:0;NOT NULL"`   // 数据上传超时违约扣款比例,百分之
+	TaskStage              int64     `gorm:"column:task_stage;NOT NULL"`                  // 任务阶段,1:已报名, 2:申请成功, 3:申请失败, 4:待预约探店, 5:预约确认中 6:  , 7:待传脚本, 8:脚本待审, 9:待传初稿, 10:初稿待审, 11:待传链接, 12:链接待审, 13:待传数据, 14:数据待审, 15:已结案, 16:解约, 17:终止合作(过渡态)
+	TaskStatus             int64     `gorm:"column:task_status;default:1;NOT NULL"`       // 商家任务状态 1待选 2已选 3落选
+	LogisticsStatus        int64     `gorm:"column:logistics_status;default:1"`           // 发货状态 1 待发货 2已发货 3 已签收
+	BookStatus             uint      `gorm:"column:book_status;default:1"`                // 预约探店状态 1-5分别代表待预约、已预约、待修改、已修改、已通过
+	SketchStatus           uint      `gorm:"column:sketch_status;default:1"`              // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	LinkStatus             uint      `gorm:"column:link_status;default:1"`                // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	DataStatus             uint      `gorm:"column:data_status;default:1"`                // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	CompleteStatus         int64     `gorm:"column:complete_status;default:1"`            // 结束方式 1未结束 2正常结束 3反选失败 4被解约
+	UpdateAt               time.Time `gorm:"column:update_at"`                            // 更新时间
+	CreateDate             time.Time `gorm:"column:create_date"`                          // 创建时间,即报名时间
+	SelectDate             time.Time `gorm:"column:select_date"`                          // 反选时间,即任务开始执行时间
+	DeliveryDate           time.Time `gorm:"column:delivery_date"`                        // 发货时间
+	CompleteDate           time.Time `gorm:"column:complete_date"`                        // 结束时间
+	WithdrawDate           time.Time `gorm:"column:withdraw_date"`                        // 提现时间
+	CurDefaultType         int64     `gorm:"column:cur_default_type"`                     // 当前违约类型 0未违约 1脚本超时违约 2脚本未上传违约 3初稿超时违约 4初稿未上传违约 5链接超时违约 6链接未上传违约 7数据超时违约 8数据未上传违约 9解约待处理 10解约
+	WithdrawStatus         int64     `gorm:"column:withdraw_status;default:1"`            // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamID             string    `gorm:"column:lead_team_id"`                         // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamID                 string    `gorm:"column:team_id"`                              // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	SettleStatus           int64     `gorm:"column:settle_status;default:1"`              // 结算状态,1、2分别表示待结算、已结算
+	TeamIncome             string    `gorm:"column:team_income"`                          // young之团团长现金收益
+	TeamPoint              int64     `gorm:"column:team_point"`                           // young之团团长积分收益
+	CurBreakAt             time.Time `gorm:"column:cur_break_at"`                         // 当前阶段截止时间
+	SupplierID             int64     `gorm:"column:supplier_id;default:0"`                // 服务商ID
+	SupplierStatus         int64     `gorm:"column:supplier_status;default:0"`            // 服务商任务状态 0表示达人来源非服务商 1待选 2已选 3落选
+	DraftFee               string    `gorm:"column:draft_fee;default:0.00"`               // 达人稿费,达人所见的稿费金额
+	SignedTime             time.Time `gorm:"column:signed_time"`                          // 签收时间
+	FansNum                int64     `gorm:"column:fans_num"`                             // 粉丝数
+	VoteAvg                int64     `gorm:"column:vote_avg"`                             // 平均点赞数
+	CommitAvg              int64     `gorm:"column:commit_avg"`                           // 平均评论数
+	BOperator              string    `gorm:"column:b_operator"`                           // 商家确定达人操作人ID
+	BOperatorType          int64     `gorm:"column:b_operator_type;default:0"`            // 商家操作人类型,1商家用户,2商家子账号,3管理后台
+	SOperator              int64     `gorm:"column:s_operator;default:0"`                 // 服务商提报达人操作人ID
+	SOperatorType          int64     `gorm:"column:s_operator_type;default:0"`            // 服务商操作人类型,1服务商主账号,2服务商子账号,3管理后台
+	OpenID                 string    `gorm:"column:open_id"`                              // 达人报名的快手唯一标识
+	SProjectID             int64     `gorm:"column:s_project_id"`                         // 服务商种草任务ID
+	SupportFee             string    `gorm:"column:support_fee"`                          // 提报价格(达人自报价经过计算后,)
+	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`                  // 未传初稿违约时间
+	SketchMissingStatus    int64     `gorm:"column:sketch_missing_status;default:0"`      // 未传初稿违约状态,0无违约,1有违约
+	LinkMissingTime        time.Time `gorm:"column:link_missing_time"`                    // 未发作品违约时间
+	LinkMissingStatus      int64     `gorm:"column:link_missing_status;default:0"`        // 未发作品违约状态,0无违约,1有违约
+	DataMissingTime        time.Time `gorm:"column:data_missing_time"`                    // 未传数据违约时间
+	DataMissingStatus      int64     `gorm:"column:data_missing_status;default:0"`        // 未传数据违约状态,0无违约,1有违约
+	TerminateOperatorType  int64     `gorm:"column:terminate_operator_type"`              // 终止合作操作人类型,1商家用户,2商家子账号,3管理后台
+	TerminateOperator      string    `gorm:"column:terminate_operator"`                   // 终止合作操作人ID
+	TerminateReason        string    `gorm:"column:terminate_reason"`                     // 终止理由
+	TerminateTime          time.Time `gorm:"column:terminate_time"`                       // 终止合作时间
+	CancelOperatorType     int64     `gorm:"column:cancel_operator_type"`                 // 解约操作人类型,1商家用户,2商家子账号,3管理后台
+	CancelOperator         string    `gorm:"column:cancel_operator"`                      // 解约操作人ID
+	CancelReason           string    `gorm:"column:cancel_reason"`                        // 解约原因
+	CancelTime             time.Time `gorm:"column:cancel_time"`                          // 解约时间
+	PlatformID             int64     `gorm:"column:platform_id;NOT NULL"`                 // 平台id
+	City                   string    `gorm:"column:city"`                                 // 所在城市
+	ReserveTime            time.Time `gorm:"column:reserve_time"`                         // 预约探店时间
+	ExploreTime            time.Time `gorm:"column:explore_time"`                         // 探店时间
+	FinishExploreTime      time.Time `gorm:"column:finish_explore_time"`                  // 完成探店时间
+}
+
+func (m *LocalLifeTaskInfo) TableName() string {
+	return "youngee_local_task_info"
+}

+ 31 - 0
app/entity/platform_kuaishou_user_info.go

@@ -0,0 +1,31 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type PlatformKuaishouUserInfo struct {
+	ID           int64     `gorm:"column:id;primary_key"` // id
+	OpenId       string    `gorm:"column:open_id;NOT NULL"`
+	PlatformId   int64     `gorm:"column:platform_id;NOT NULL"`
+	TalentId     string    `gorm:"column:talent_id;NOT NULL"`
+	Code         string    `gorm:"column:code;NOT NULL"`
+	AccessToken  string    `gorm:"column:access_token;NOT NULL"`
+	RefreshToken string    `gorm:"column:refresh_token;NOT NULL"`
+	NickName     string    `gorm:"column:nick_name;NOT NULL"`
+	HeadUri      string    `gorm:"column:head_uri;NOT NULL"`
+	Fan          string    `gorm:"column:fan;NOT NULL"`
+	Expired      int64     `gorm:"column:expired"`
+	SaleNumTotal int64     `gorm:"column:sale_num_total;NOT NULL"`
+	SaleNum30day int64     `gorm:"column:sale_num_30day;NOT NULL"`
+	CreateTime   time.Time `gorm:"column:create_time;NOT NULL"`
+	UpdateTime   time.Time `gorm:"column:update_time;NOT NULL"`
+	IsDelete     int64     `gorm:"column:is_delete;NOT NULL"`
+	LikeNum      int64     `gorm:"column:like_num;NOT NULL"`
+	VideoNum     int64     `gorm:"column:video_num;NOT NULL"`
+}
+
+func (m *PlatformKuaishouUserInfo) TableName() string {
+	return "platform_kuaishou_user_info"
+}

+ 26 - 0
app/entity/product.go

@@ -0,0 +1,26 @@
+package entity
+
+import "time"
+
+type Product struct {
+	ProductID           int64     `gorm:"primaryKey;autoIncrement" json:"product_id"` // 商品id
+	ProductName         string    `gorm:"column:product_name"`                        // 商品名称
+	ProductType         int64     `gorm:"column:product_type"`                        // 商品类型
+	ProductCategory     string    `gorm:"column:product_category"`                    // 商品类目1--20
+	ProductUrl          string    `gorm:"column:product_url"`                         // 商品链接,可为电商网址、公司官网、大众点评的店铺地址等可以说明商品信息或者品牌信息的线上地址;
+	EnterpriseID        string    `gorm:"column:enterprise_id"`                       // 所属企业id
+	SubAccountID        int64     `gorm:"column:sub_account_id"`                      // 子账号id
+	ProductPrice        float64   `gorm:"column:product_price"`                       // 商品价值
+	PublicCommission    float64   `gorm:"column:public_commission"`                   // 公开佣金
+	ExclusiveCommission float64   `gorm:"column:exclusive_commission"`                // 专属佣金
+	CommissionPrice     float64   `gorm:"column:commission_price"`                    // 佣金金额
+	ProductDetail       string    `gorm:"column:product_detail"`                      // 卖点总结
+	KuaishouProductId   string    `gorm:"column:kuaishou_product_id"`                 // 快手商品ID
+	SalesCount          string    `gorm:"column:sales_count"`                         // 商品30天销量
+	CreatedAt           time.Time `gorm:"column:created_at"`                          // 创建时间
+	UpdatedAt           time.Time `gorm:"column:updated_at"`                          // 更新时间
+}
+
+func (m *Product) TableName() string {
+	return "younggee_product"
+}

+ 23 - 0
app/entity/product_photo.go

@@ -0,0 +1,23 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+// 商品、门店、团购相关图片或视频
+type ProductPhoto struct {
+	ProductPhotoID   int64     `gorm:"column:product_photo_id;primary_key;AUTO_INCREMENT"` // 商品图片id
+	ProductID        int64     `gorm:"column:product_id"`                                  // 所属商品id
+	Symbol           int64     `gorm:"column:symbol"`                                      // 标志位 1为主图,2为轮播图,3为轮播图视频,4详情图,5详情图视频
+	PhotoUrl         string    `gorm:"column:photo_url"`                                   // 图片或视频url
+	PhotoUid         string    `gorm:"column:photo_uid"`
+	CreatedAt        time.Time `gorm:"column:created_at"`                   // 创建时间
+	ProductPhotoType int64     `gorm:"column:product_photo_type;default:1"` // 商品图片类型:1商品,2门店,3团购
+	StoreID          int64     `gorm:"column:store_id"`                     // 门店ID
+	TeamBuyingID     int64     `gorm:"column:team_buying_id"`               // 团购ID
+}
+
+func (m *ProductPhoto) TableName() string {
+	return "younggee_product_photo"
+}

+ 60 - 0
app/entity/project.go

@@ -0,0 +1,60 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type Project struct {
+	ID                int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"`  // 种草主键ID
+	ProjectId         string    `gorm:"column:project_id"`                     // 项目id 项目ID生成规则:年(2位)+一年中的第几天(3位)+5位数随机数,雪花算法也可,生成10位订单号
+	ProjectName       string    `gorm:"column:project_name"`                   // 项目名称
+	ProjectStatus     int64     `gorm:"column:project_status"`                 // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
+	ProjectType       int64     `gorm:"column:project_type"`                   // 项目类型,1代表全流程项目,2代表专项项目
+	ProjectPlatform   int64     `gorm:"column:project_platform"`               // 项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
+	ProjectForm       int64     `gorm:"column:project_form"`                   // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
+	TalentType        string    `gorm:"column:talent_type"`                    // 达人类型
+	RecruitDdl        time.Time `gorm:"column:recruit_ddl"`                    // 招募截止时间
+	ContentType       int64     `gorm:"column:content_type"`                   // 内容形式,1代表图文,2代表视频
+	ProjectDetail     string    `gorm:"column:project_detail"`                 // 项目详情
+	ApplyNum          int64     `gorm:"column:apply_num;default:0;NOT NULL"`   // 报名人数
+	RecruitNum        int64     `gorm:"column:recruit_num;default:0;NOT NULL"` // 已招募人数
+	EnterpriseID      string    `gorm:"column:enterprise_id"`                  // 所属企业id
+	SubAccountId      int64     `gorm:"column:sub_account_id"`                 // 子账号id
+	ProductID         int64     `gorm:"column:product_id"`                     // 关联商品id
+	ProductCategory   string    `gorm:"column:product_category"`               // 商品类目1--20
+	CreatedAt         time.Time `gorm:"column:created_at"`                     // 创建时间
+	UpdatedAt         time.Time `gorm:"column:updated_at"`                     // 修改时间
+	FeeForm           string    `gorm:"column:fee_form"`                       // 稿费形式列表
+	AutoFailAt        time.Time `gorm:"column:auto_fail_at"`                   // 失效自动处理时间
+	AutoTaskID        int64     `gorm:"column:auto_task_id;NOT NULL"`          // 定时任务id
+	AutoDefaultID     int64     `gorm:"column:auto_default_id;NOT NULL"`       // 违约状态id
+	PaymentAmount     float64   `gorm:"column:payment_amount"`                 // 支付金额
+	PayAt             time.Time `gorm:"column:pay_at"`                         // 支付时间
+	AutoScriptBreakAt time.Time `gorm:"column:auto_script_break_at"`           // 脚本违约自动处理时间
+	AutoSketchBreakAt time.Time `gorm:"column:auto_sketch_break_at"`           // 初稿违约自动处理时间
+	FailReason        int64     `gorm:"column:fail_reason"`                    // 失效原因,1、2分别表示逾期未支付、项目存在风险
+	PassAt            time.Time `gorm:"column:pass_at"`                        // 审核通过时间
+	FinishAt          time.Time `gorm:"column:finish_at"`                      // 结案时间
+	SubmitAt          time.Time `gorm:"column:submit_at"`                      // 结案时间
+	EstimatedCost     float64   `gorm:"column:estimated_cost"`                 // 预估成本
+	IsRead            int64     `gorm:"column:is_read"`                        // 是否已读
+	SettlementAmount  float64   `gorm:"column:settlement_amount"`              // 结算金额
+	ProductSnap       string    `gorm:"column:product_snap"`                   // 商品信息快照
+	ProductPhotoSnap  string    `gorm:"column:product_photo_snap"`             // 商品图片快照
+	NeedReview        int64     `gorm:"column:need_review"`                    // 待审稿
+	NeedQuality       int64     `gorm:"column:need_quality"`                   // 待质检
+	NeedCalculate     int64     `gorm:"column:need_calculate"`                 // 待结算
+	ServiceChargeRate float64   `gorm:"column:service_charge_rate"`            // 公开服务费率
+	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已开票)
+	BeforeDeliveryNum int64     `gorm:"column:before_delivery_num"`
+	DeliveryNum       int64     `gorm:"column:delivery_num"`
+	AfterDeliveryNum  int64     `gorm:"column:after_delivery_num"`
+}
+
+func (m *Project) TableName() string {
+	return "project_info"
+}

+ 20 - 0
app/entity/project_brief.go

@@ -0,0 +1,20 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type ProjectBrief struct {
+	ProjectBriefID int64     `gorm:"column:project_brief_id;primary_key;AUTO_INCREMENT"` // 项目id
+	FileUrl        string    `gorm:"column:file_url"`                                    // 图片url
+	FileName       string    `gorm:"column:file_name"`                                   // 文件名称
+	FileUid        string    `gorm:"column:file_uid"`
+	ProjectID      string    `gorm:"column:project_id"` // 所属项目id
+	CreatedAt      time.Time `gorm:"column:created_at"` // 创建时间
+	Type           int64     `gorm:"column:type"`       // 手卡类型(1图片 2文档)
+}
+
+func (m *ProjectBrief) TableName() string {
+	return "project_brief"
+}

+ 17 - 0
app/entity/project_material.go

@@ -0,0 +1,17 @@
+package entity
+
+import "time"
+
+type ProjectMaterial struct {
+	MaterialID int       `gorm:"column:material_id;primary_key;AUTO_INCREMENT"` // 种草任务素材id
+	FileUrl    string    `gorm:"column:file_url"`                               // 文件url
+	FileUid    string    `gorm:"column:file_uid"`                               // 文件uid
+	ProjectID  string    `gorm:"column:project_id"`                             // 所属项目id
+	CreatedAt  time.Time `gorm:"column:created_at"`                             // 创建时间
+	FileName   string    `gorm:"column:file_name"`                              // 文件名称
+	Type       int64     `gorm:"column:type"`                                   // 素材类型(1图片 2视频)
+}
+
+func (m *ProjectMaterial) TableName() string {
+	return "project_material"
+}

+ 61 - 0
app/entity/project_task_info.go

@@ -0,0 +1,61 @@
+package entity
+
+import (
+	"time"
+)
+
+type ProjectTaskInfo struct {
+	TaskID                 string    `gorm:"column:task_id;primary_key;AUTO_INCREMENT"`   // 任务id
+	ProjectID              string    `gorm:"column:project_id;NOT NULL"`                  // 项目id
+	TalentID               string    `gorm:"column:talent_id;NOT NULL"`                   // 达人id
+	AccountID              int       `gorm:"column:account_id;NOT NULL"`                  // 账号id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap;NOT NULL"`   // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap;NOT NULL"`   // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap;NOT NULL"`       // 收货地址快照
+	StrategyID             int       `gorm:"column:strategy_id"`                          // 报名选择的招募策略id
+	TaskReward             float64   `gorm:"column:task_reward;NOT NULL"`                 // 达人报酬
+	SettleAmount           float64   `gorm:"column:settle_amount;NOT NULL"`               // 达人实际所得(扣除违约扣款)
+	AllPayment             float64   `gorm:"column:all_payment;NOT NULL"`                 // 企业支付
+	RealPayment            float64   `gorm:"column:real_payment;NOT NULL"`                // 企业实际支付(扣除违约扣款)
+	ErrBreakRate           int       `gorm:"column:err_break_rate;default:0;NOT NULL"`    // 未上传类型违约扣款比例,百分之
+	ScriptBreakRate        int       `gorm:"column:script_break_rate;default:0;NOT NULL"` // 脚本上传超时违约扣款比例,百分之
+	SketchBreakRate        int       `gorm:"column:sketch_break_rate;default:0;NOT NULL"` // 初稿上传超时违约扣款比例,百分之
+	LinkBreakRate          int       `gorm:"column:link_break_rate;default:0;NOT NULL"`   // 链接上传超时违约扣款比例,百分之
+	DataBreakRate          int       `gorm:"column:data_break_rate;default:0;NOT NULL"`   // 数据上传超时违约扣款比例,百分之
+	FeeForm                int       `gorm:"column:fee_form;NOT NULL"`                    // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
+	ServiceCharge          float64   `gorm:"column:service_charge"`                       // 服务费
+	ServiceRate            int       `gorm:"column:service_rate"`                         // 服务费率,千分之
+	TaskStatus             int       `gorm:"column:task_status;default:1;NOT NULL"`       // 任务状态 1待选 2已选 3落选
+	TaskStage              int       `gorm:"column:task_stage;NOT NULL"`                  // 任务阶段,详情见info_task_stage表
+	CreateDate             time.Time `gorm:"column:create_date;NOT NULL"`                 // 创建时间
+	SelectDate             time.Time `gorm:"column:select_date"`                          // 反选时间
+	DeliveryDate           time.Time `gorm:"column:delivery_date"`                        // 发货时间
+	CompleteStatus         int       `gorm:"column:complete_status;default:1;NOT NULL"`   // 结束方式 1未结束 2正常结束 3反选失败 4被解约
+	CompleteDate           time.Time `gorm:"column:complete_date"`                        // 结束时间
+	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`           // 发货状态 1 待发货 2已发货 3 已签收
+	ScriptStatus           uint      `gorm:"column:script_status;default:1"`              // 脚本上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	SketchStatus           uint      `gorm:"column:sketch_status;default:1"`              // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               time.Time `gorm:"column:update_at"`                            // 更新时间
+	LinkStatus             uint      `gorm:"column:link_status;default:1"`                // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	DataStatus             uint      `gorm:"column:data_status;default:1"`                // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	CurDefaultType         int       `gorm:"column:cur_default_type"`                     // 任务当前处于的违约类型 0-8分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约
+	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`            // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	SettleStatus           int       `gorm:"column:settle_status;default:1"`              // 结算状态,1、2分别表示待结算、已结算
+	DraftFee               float64   `gorm:"column:draft_fee;NOT NULL"`                   // 达人稿费,达人所见的稿费金额
+	SignedTime             time.Time `gorm:"column:signed_time"`                          // 签收时间
+	TerminateTime          time.Time `gorm:"column:terminate_time"`
+	TerminateReason        string    `gorm:"column:terminate_reason"`
+	CancelTime             time.Time `gorm:"column:cancel_time"`
+	CancelReason           string    `gorm:"column:cancel_reason"`
+	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`
+	LinkMissingTime        time.Time `gorm:"column:link_missing_time"`
+	DataMissingTime        time.Time `gorm:"column:data_missing_time"`
+	TerminateOperatorType  int       `gorm:"column:terminate_operator_type;default:0;NOT NULL"`
+	TerminateOperator      string    `gorm:"column:terminate_operator"`
+	CancelOperatorType     int       `gorm:"column:cancel_operator_type;default:0;NOT NULL"`
+	CancelOperator         string    `gorm:"column:cancel_operator"`
+}
+
+func (m *ProjectTaskInfo) TableName() string {
+	return "youngee_task_info"
+}

+ 24 - 0
app/entity/recharge_record.go

@@ -0,0 +1,24 @@
+package entity
+
+import "time"
+
+type RechargeRecord struct {
+	ID                 int64     `gorm:"column:id;primary_key;column:id"`
+	RechargeID         string    `gorm:"column:recharge_id;unique_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"`                // 联系方式
+	RechargeMethod     int64     `gorm:"column:recharge_method;NOT NULL"`      // 充值方式:1为对公转账,2为支付宝在线支付,3为微信支付
+	Status             int64     `gorm:"column:status;NOT NULL"`               // 充值状态:0为充值待确认,1为充值已确认
+	InvoiceStatus      int       `gorm:"column:invoice_status;NOT NULL"`       // 开票状态:1为可开票,2为待开票,3为已开票
+	CommitAt           time.Time `gorm:"column:commit_at;NOT NULL"`            // 充值申请提交时间
+	ConfirmAt          time.Time `gorm:"column:confirm_at"`                    // 充值确认时间
+	FailReason         string    `gorm:"column:fail_reason;NOT NULL"`          // 失败原因
+	RefuseAt           time.Time `gorm:"column:refuse_at;NOT NULL"`            // 充值失败时间
+}
+
+func (m *RechargeRecord) TableName() string {
+	return "younggee_recharge_record"
+}

+ 34 - 0
app/entity/recruit_strategy.go

@@ -0,0 +1,34 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+type RecruitStrategy struct {
+	RecruitStrategyID int64   `gorm:"column:recruit_strategy_id;primary_key;AUTO_INCREMENT"` // 招募策略id
+	FeeForm           int64   `gorm:"column:fee_form"`                                       // 稿费形式,1-3分别代表产品置换、固定稿费、自报价
+	StrategyID        int64   `gorm:"column:strategy_id"`                                    // 策略id
+	FollowersLow      int64   `gorm:"column:followers_low"`                                  // 达人粉丝数下限
+	FollowersUp       int64   `gorm:"column:followers_up"`                                   // 达人粉丝数上限
+	RecruitNumber     int64   `gorm:"column:recruit_number"`                                 // 招募数量
+	Offer             float64 `gorm:"column:offer"`                                          // 报价
+	TOffer            float64 `gorm:"column:t_offer"`                                        // 达人所见报价
+	ProjectID         string  `gorm:"column:project_id"`                                     // 所属项目id
+	ServiceCharge     float64 `gorm:"column:service_charge"`                                 // 平台服务费,稿费形式为产品置换时必填
+	ServiceRate       float64 `gorm:"column:service_rate"`                                   // 服务费率
+	SelectedNumber    int64   `gorm:"column:selected_number;default:0"`                      // 已选数量,被企业选择的达人数量
+	WaitingNumber     int64   `gorm:"column:waiting_number;default:0"`                       // 待发货
+	DeliveredNumber   int64   `gorm:"column:delivered_number;default:0"`                     // 已发货
+	SignedNumber      int64   `gorm:"column:signed_number;default:0"`                        // 已签收
+	MaxOffer          int64   `gorm:"column:max_offer;default:0"`                            // 报价上限
+	MinOffer          int64   `gorm:"column:min_offer;default:0"`                            // 报价下限
+	FanNumber         int64   `gorm:"column:fan_number;default:0"`                           // 总粉丝量
+	PlayNumber        int64   `gorm:"column:play_number;default:0"`                          // 总播放量
+	LikeNumber        int64   `gorm:"column:like_number;default:0"`                          // 总点赞数
+	CollectNumber     int64   `gorm:"column:collect_number;default:0"`                       // 总收藏量
+	CommentNumber     int64   `gorm:"column:comment_number;default:0"`                       // 总评论数
+	FinishNumber      int64   `gorm:"column:finish_number;default:0"`                        // 结案数量
+	TotalOffer        float64 `gorm:"column:total_offer;default:0"`                          // 支付合计
+	StrategyType      int64   `gorm:"column:strategy_type;default:0"`                        // 策略类型,1为商家设置,2为服务商设置
+}
+
+func (m *RecruitStrategy) TableName() string {
+	return "recruit_strategy"
+}

+ 14 - 0
app/entity/region_info.go

@@ -0,0 +1,14 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+type RegionInfo struct {
+	RegionID    int64  `gorm:"column:region_id;primary_key;AUTO_INCREMENT"`
+	SelfCode    int64  `gorm:"column:self_code;NOT NULL"`
+	RegionLevel int64  `gorm:"column:region_level;NOT NULL"`
+	ParentCode  int64  `gorm:"column:parent_code"`
+	RegionName  string `gorm:"column:region_name;NOT NULL"`
+}
+
+func (m *RegionInfo) TableName() string {
+	return "info_region"
+}

+ 25 - 0
app/entity/review_local_life.go

@@ -0,0 +1,25 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+type ReviewLocalLife struct {
+	ID                  int64  `gorm:"column:id;primary_key;AUTO_INCREMENT"`   // 自增id
+	LocalID             string `gorm:"column:local_id;NOT NULL"`               // 本地生活id
+	TaskName            string `gorm:"column:task_name;NOT NULL"`              // 任务标题
+	TaskDetail          string `gorm:"column:task_detail;NOT NULL"`            // 任务详情
+	StoreMainPhoto      string `gorm:"column:store_main_photo;NOT NULL"`       // 门店主图
+	StoreName           string `gorm:"column:store_name;NOT NULL"`             // 门店标题
+	StoreDetail         string `gorm:"column:store_detail;NOT NULL"`           // 门店详情
+	TeamBuyingMainPhoto string `gorm:"column:team_buying_main_photo;NOT NULL"` // 团购主图
+	TeamBuyingName      string `gorm:"column:team_buying_name;NOT NULL"`       // 团购标题
+	TeamBuyingDetail    string `gorm:"column:team_buying_detail;NOT NULL"`     // 团购详情
+	Images              string `gorm:"column:images"`                          // 图片集(,分隔)
+	Videos              string `gorm:"column:videos"`                          // 视频集(,分隔)
+	VideoJobIds         string `gorm:"column:video_job_ids"`
+	Documents           string `gorm:"column:documents"` // 文档集(,分隔)
+	DocumentJobIds      string `gorm:"column:document_job_ids"`
+	Status              int64  `gorm:"column:status;default:0;NOT NULL"` // 状态(0未提交 1待审核 2审核通过 3审核未通过 4失效)
+}
+
+func (m *ReviewLocalLife) TableName() string {
+	return "review_local_life"
+}

+ 22 - 0
app/entity/review_project.go

@@ -0,0 +1,22 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+type ReviewProject struct {
+	ID             int64  `gorm:"column:id;primary_key;AUTO_INCREMENT"` // 自增id
+	ProjectID      string `gorm:"column:project_id;NOT NULL"`           // 种草id
+	TaskName       string `gorm:"column:task_name;NOT NULL"`            // 任务标题
+	TaskDetail     string `gorm:"column:task_detail;NOT NULL"`          // 任务详情
+	ProductName    string `gorm:"column:product_name;NOT NULL"`         // 商品标题
+	ProductDetail  string `gorm:"column:product_detail;NOT NULL"`       // 商品详情(卖点总结)
+	MainPhoto      string `gorm:"column:main_photo;NOT NULL"`           // 商品主图
+	Images         string `gorm:"column:images"`                        // 图片集(,分隔)
+	Videos         string `gorm:"column:videos"`                        // 视频集(,分隔)
+	VideoJobIds    string `gorm:"column:video_job_ids"`
+	Documents      string `gorm:"column:documents"` // 文档集(,分隔)
+	DocumentJobIds string `gorm:"column:document_job_ids"`
+	Status         int64  `gorm:"column:status;default:0;NOT NULL"` // 状态(0未提交 1待审核 2审核通过 3审核未通过 4失效)
+}
+
+func (m *ReviewProject) TableName() string {
+	return "review_project"
+}

+ 21 - 0
app/entity/review_selection.go

@@ -0,0 +1,21 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+type ReviewSelection struct {
+	ID             int64  `gorm:"column:id;primary_key;AUTO_INCREMENT"` // 自增id
+	SelectionID    string `gorm:"column:selection_id;NOT NULL"`         // 带货id
+	TaskName       string `gorm:"column:task_name;NOT NULL"`            // 任务标题
+	ProductName    string `gorm:"column:product_name;NOT NULL"`         // 商品标题
+	ProductDetail  string `gorm:"column:product_detail;NOT NULL"`       // 商品详情(卖点总结)
+	MainPhoto      string `gorm:"column:main_photo;NOT NULL"`           // 商品主图
+	Images         string `gorm:"column:images"`                        // 图片集(,分隔)
+	Videos         string `gorm:"column:videos"`                        // 视频集(,分隔)
+	VideoJobIds    string `gorm:"column:video_job_ids"`
+	Documents      string `gorm:"column:documents"` // 文档集(,分隔)
+	DocumentJobIds string `gorm:"column:document_job_ids"`
+	Status         int64  `gorm:"column:status;default:0;NOT NULL"` // 状态(0未提交 1待审核 2审核通过 3审核未通过 4失效)
+}
+
+func (m *ReviewSelection) TableName() string {
+	return "review_selection"
+}

+ 14 - 0
app/entity/reward_strategy.go

@@ -0,0 +1,14 @@
+package entity
+
+type RewardStrategy struct {
+	RewardStrategyId int64   `gorm:"column:reward_strategy_id;primary_key;AUTO_INCREMENT"` // 悬赏策略id
+	SelectionId      string  `gorm:"column:selection_id"`                                  // 带货任务id
+	Reward           float64 `gorm:"column:reward"`                                        // 悬赏池总金额
+	SaleActual       int64   `gorm:"column:sale_actual"`                                   // 实际带货销量
+	PerReward        float64 `gorm:"column:per_reward"`                                    // 每人可获得悬赏金
+	StrategyStatus   int64   `gorm:"column:strategy_status"`                               // 悬赏策略状态
+}
+
+func (m *RewardStrategy) TableName() string {
+	return "reward_strategy"
+}

+ 42 - 0
app/entity/s_project.go

@@ -0,0 +1,42 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+// 服务商加入商单的种草任务
+type SProjectInfo struct {
+	SProjectID          int64     `gorm:"column:s_project_id;primary_key;AUTO_INCREMENT"` // 服务商种草任务ID
+	ProjectID           string    `gorm:"column:project_id"`                              // 被服务商加入商单的原种草任务ID
+	ProductID           int64     `gorm:"column:product_id"`                              // 商品ID
+	ProjectName         string    `gorm:"column:project_name"`
+	ProjectStatus       int64     `gorm:"column:project_status"`
+	ProjectType         int64     `gorm:"column:project_type"`
+	ProjectPlatform     int64     `gorm:"column:project_platform"`
+	ProjectForm         int64     `gorm:"column:project_form"`
+	ContentType         int64     `gorm:"column:content_type"`
+	ShareCode           string    `gorm:"column:share_code"` // 分享码URL
+	EnterpriseID        string    `gorm:"column:enterprise_id"`
+	SupplierID          int64     `gorm:"column:supplier_id"`                        // 服务商ID
+	ApplyNum            int64     `gorm:"column:apply_num;default:0"`                // 报名人数
+	RecruitNum          int64     `gorm:"column:recruit_num;default:0"`              // 已招募人数
+	SettleNum           int64     `gorm:"column:settle_num;default:0"`               // 已结算人数
+	QuitNum             int64     `gorm:"column:quit_num;default:0"`                 // 已解约人数
+	SubAccountID        int64     `gorm:"column:sub_account_id;default:0"`           // 服务商子账号ID
+	ServiceCharge       string    `gorm:"column:service_charge;default:0.00"`        // 服务商预估可赚服务费
+	ServiceChargeActual string    `gorm:"column:service_charge_actual;default:0.00"` // 服务商实际可赚服务费
+	ServiceChargeSettle string    `gorm:"column:service_charge_settle"`              // 服务商已结算服务费
+	OperatorType        int64     `gorm:"column:operator_type;default:0"`            // 添加商单操作人类型,1为服务商主账号,2为服务商子账号
+	SProjectStatus      int64     `gorm:"column:s_project_status;default:0"`         // 服务商种草任务状态,1待确认,2已确认,3已拒绝
+	StrategyStatus      int64     `gorm:"column:strategy_status;default:0"`          // 定向种草任务是否替换招募策略
+	BOperator           string    `gorm:"column:b_operator"`                         // 商家发起入库邀约人
+	BOperatorType       int64     `gorm:"column:b_operator_type;default:0"`          // 商家发起入库邀约人类型:1主账号 2子账号
+	CreateTime          time.Time `gorm:"column:create_time"`                        // 创建时间
+	CreateStrategyID    int64     `gorm:"column:create_strategy_id"`                 // 服务商修改服务费操作人ID
+	CreateStrategyType  int64     `gorm:"column:create_strategy_type"`               // 服务商修改服务费操作人类型:1服务商主账号,2子账号
+}
+
+func (m *SProjectInfo) TableName() string {
+	return "younggee_s_project_info"
+}

+ 17 - 0
app/entity/sec_brief.go

@@ -0,0 +1,17 @@
+package entity
+
+import "time"
+
+type SecBrief struct {
+	SectionBriefID int       `gorm:"column:section_brief_id;primary_key;AUTO_INCREMENT"` // brief的Id
+	FileUrl        string    `gorm:"column:file_url"`                                    // 文件url
+	FileUid        string    `gorm:"column:file_uid"`                                    // 文件uid
+	SelectionID    string    `gorm:"column:selection_id"`                                // 所属选品id
+	CreatedAt      time.Time `gorm:"column:created_at"`                                  // 创建时间
+	FileName       string    `gorm:"column:file_name"`                                   // 文件名称
+	Type           int64     `gorm:"column:type"`                                        // 手卡类型(1图片 2文档)
+}
+
+func (m *SecBrief) TableName() string {
+	return "younggee_sec_brief"
+}

+ 17 - 0
app/entity/sec_material.go

@@ -0,0 +1,17 @@
+package entity
+
+import "time"
+
+type SecMaterial struct {
+	MaterialID  int       `gorm:"column:material_id;primary_key;AUTO_INCREMENT"` // 带货任务素材id
+	FileUrl     string    `gorm:"column:file_url"`                               // 文件url
+	FileUid     string    `gorm:"column:file_uid"`                               // 文件uid
+	SelectionID string    `gorm:"column:selection_id"`                           // 所属项目id
+	CreatedAt   time.Time `gorm:"column:created_at"`                             // 创建时间
+	FileName    string    `gorm:"column:file_name"`                              // 文件名称
+	Type        int64     `gorm:"column:type"`                                   // 素材类型(1图片 2视频)
+}
+
+func (m *SecMaterial) TableName() string {
+	return "younggee_sec_material"
+}

+ 46 - 0
app/entity/sec_task_info.go

@@ -0,0 +1,46 @@
+package entity
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+import (
+	"time"
+)
+
+type SecTaskInfo struct {
+	ID                     int64     `gorm:"column:id;primary_key"`              // 递增id
+	TaskID                 string    `gorm:"column:task_id"`                     // 选品任务id
+	SelectionID            string    `gorm:"column:selection_id"`                // 选品id
+	TalentID               string    `gorm:"column:talent_id"`                   // 达人id
+	AccountID              int64     `gorm:"column:account_id"`                  // 账号id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap"`   // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap"`   // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap"`       // 收货地址快照
+	TaskReward             string    `gorm:"column:task_reward"`                 //  达人赏金
+	TalentPayment          string    `gorm:"column:talent_payment"`              // 达人垫付金额
+	IsPayPayment           int64     `gorm:"column:is_pay_payment"`              // 企业是否返样品钱
+	IsPayReward            int64     `gorm:"column:is_pay_reward"`               // 企业是否结算悬赏
+	TaskMode               int64     `gorm:"column:task_mode"`                   // 任务形式,1、2分别表示纯佣带货、悬赏任务
+	SampleMode             int64     `gorm:"column:sample_mode"`                 // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
+	TaskStatus             int64     `gorm:"column:task_status;default:1"`       // 任务状态 1待选 2已选 3落选
+	TaskStage              int64     `gorm:"column:task_stage"`                  // 任务阶段,详情见info_sec_task_stage表
+	CreateDate             time.Time `gorm:"column:create_date"`                 // 创建时间
+	SelectDate             time.Time `gorm:"column:select_date"`                 // 反选时间
+	DeliveryDate           time.Time `gorm:"column:delivery_date"`               // 发货时间
+	CompleteDate           time.Time `gorm:"column:complete_date"`               // 结束时间
+	WithdrawDate           time.Time `gorm:"column:withdraw_date"`               // 提现时间
+	CompleteStatus         int64     `gorm:"column:complete_status;default:1"`   // 结束方式 1未结束 2正常结束 3反选失败
+	LogisticsStatus        int64     `gorm:"column:logistics_status;default:1"`  // 发货状态 1 待发货 2已发货 3 已签收
+	AssignmentStatus       uint64    `gorm:"column:assignment_status;default:1"` // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               time.Time `gorm:"column:update_at"`                   // 更新时间
+	WithdrawStatus         int64     `gorm:"column:withdraw_status;default:1"`   // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamID             string    `gorm:"column:lead_team_id"`                // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamID                 string    `gorm:"column:team_id"`                     // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	TeamIncome             int64     `gorm:"column:team_income"`                 // young之团团长现金收益
+	TeamPoint64            int64     `gorm:"column:team_point64"`                // young之团团长积分收益
+	SaleActual             int64     `gorm:"column:sale_actual"`                 // 实际带货量
+
+}
+
+func (m *SecTaskInfo) TableName() string {
+	return "younggee_sec_task_info"
+}

+ 53 - 0
app/entity/selection_info.go

@@ -0,0 +1,53 @@
+package entity
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+import (
+	"time"
+)
+
+type SelectionInfo struct {
+	ID               int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"` // 带货主键ID
+	SelectionID      string    `gorm:"column:selection_id"`                  // 选品项目id
+	SelectionName    string    `gorm:"column:selection_name"`                // 任务名称
+	EnterpriseID     string    `gorm:"column:enterprise_id"`                 // 所属企业id
+	SubAccountId     int64     `gorm:"column:sub_account_id"`                // 子账号id
+	ProductID        int64     `gorm:"column:product_id"`                    // 关联商品id
+	ProductCategory  string    `gorm:"column:product_category"`              // 商品类目1--20
+	SelectionStatus  int64     `gorm:"column:selection_status"`              // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
+	Platform         int64     `gorm:"column:platform"`                      // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	SampleNum        int64     `gorm:"column:sample_num"`                    // 样品数量
+	TaskDdl          time.Time `gorm:"column:task_ddl"`                      // 招募截止时间
+	ContentType      int64     `gorm:"column:content_type"`                  // 内容形式,1代表图文,2代表视频,3代表直播
+	TaskMode         int64     `gorm:"column:task_mode"`                     // 任务形式,1、2分别表示悬赏任务、纯佣带货
+	SampleMode       int64     `gorm:"column:sample_mode"`                   // 领样形式,1、2分别表示免费领样、垫付领样
+	ProductUrl       string    `gorm:"column:product_url"`                   // 带货链接
+	RemainNum        int64     `gorm:"column:remain_num"`                    // 剩余数量
+	CommissionRate   float64   `gorm:"column:commission_rate"`               // 佣金比例
+	EstimatedCost    float64   `gorm:"column:estimated_cost"`                // 预估成本
+	TaskReward       float64   `gorm:"column:task_reward"`                   // 任务悬赏
+	SampleCondition  string    `gorm:"column:sample_condition"`              // 领样条件
+	RewardCondition  string    `gorm:"column:reward_condition"`              // 返现悬赏条件
+	SettlementAmount float64   `gorm:"column:settlement_amount"`             // 结算金额
+	Detail           string    `gorm:"column:detail"`                        // 卖点总结
+	ProductSnap      string    `gorm:"column:product_snap"`                  // 商品信息快照
+	ProductPhotoSnap string    `gorm:"column:product_photo_snap"`            // 商品图片快照
+	CreatedAt        time.Time `gorm:"column:created_at"`                    // 创建时间
+	UpdatedAt        time.Time `gorm:"column:updated_at"`                    // 修改时间
+	SubmitAt         time.Time `gorm:"column:submit_at"`                     // 提交审核时间
+	PassAt           time.Time `gorm:"column:pass_at"`                       // 审核通过时间
+	FailReason       int64     `gorm:"column:fail_reason"`                   // 失效原因,1、2分别表示逾期未支付、项目存在风险
+	PayAt            time.Time `gorm:"column:pay_at"`                        // 支付时间
+	FinishAt         time.Time `gorm:"column:finish_at"`                     // 结案时间
+	IsRead           int64     `gorm:"column:is_read"`                       // 是否已读
+	AutoTaskID       int64     `gorm:"column:auto_task_id"`                  // 定时任务id
+	AutoFailAt       time.Time `gorm:"column:auto_fail_at"`                  // 失效自动处理时间
+	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 {
+	return "younggee_selection_info"
+}

+ 44 - 0
app/entity/selection_task_info.go

@@ -0,0 +1,44 @@
+package entity
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+import (
+	"time"
+)
+
+type SelectionTaskInfo struct {
+	ID                     int       `gorm:"column:id;primary_key"`              // 递增id
+	TaskID                 string    `gorm:"column:task_id"`                     // 选品任务id
+	SelectionID            string    `gorm:"column:selection_id"`                // 选品id
+	TalentID               string    `gorm:"column:talent_id"`                   // 达人id
+	AccountID              int       `gorm:"column:account_id"`                  // 账号id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap"`   // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap"`   // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap"`       // 收货地址快照
+	TaskReward             string    `gorm:"column:task_reward"`                 //  达人赏金
+	TalentPayment          string    `gorm:"column:talent_payment"`              // 达人垫付金额
+	IsPayPayment           int       `gorm:"column:is_pay_payment"`              // 企业是否返样品钱
+	IsPayReward            int       `gorm:"column:is_pay_reward"`               // 企业是否结算悬赏
+	TaskMode               int       `gorm:"column:task_mode"`                   // 任务形式,1、2分别表示纯佣带货、悬赏任务
+	SampleMode             int       `gorm:"column:sample_mode"`                 // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
+	TaskStatus             int       `gorm:"column:task_status;default:1"`       // 任务状态 1待选 2已选 3落选
+	TaskStage              int       `gorm:"column:task_stage"`                  // 任务阶段,详情见info_sec_task_stage表
+	CreateDate             time.Time `gorm:"column:create_date"`                 // 创建时间
+	SelectDate             time.Time `gorm:"column:select_date"`                 // 反选时间
+	DeliveryDate           time.Time `gorm:"column:delivery_date"`               // 发货时间
+	CompleteDate           time.Time `gorm:"column:complete_date"`               // 结束时间
+	WithdrawDate           time.Time `gorm:"column:withdraw_date"`               // 提现时间
+	CompleteStatus         int       `gorm:"column:complete_status;default:1"`   // 结束方式 1未结束 2正常结束 3反选失败
+	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`  // 发货状态 1 待发货 2已发货 3 已签收
+	AssignmentStatus       uint      `gorm:"column:assignment_status;default:1"` // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               time.Time `gorm:"column:update_at"`                   // 更新时间
+	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`   // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamID             string    `gorm:"column:lead_team_id"`                // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamID                 string    `gorm:"column:team_id"`                     // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	TeamIncome             int       `gorm:"column:team_income"`                 // young之团团长现金收益
+	TeamPoint              int       `gorm:"column:team_point"`                  // young之团团长积分收益
+}
+
+func (m *SelectionTaskInfo) TableName() string {
+	return "younggee_sec_task_info"
+}

+ 28 - 0
app/entity/store.go

@@ -0,0 +1,28 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type Store struct {
+	StoreID            int64     `gorm:"column:store_id;primary_key;AUTO_INCREMENT"` // 门店ID
+	StoreName          string    `gorm:"column:store_name;NOT NULL"`                 // 门店名称
+	StoreCategory      string    `gorm:"column:store_category;NOT NULL"`             // 门店类目(/分隔)
+	StoreType          int64     `gorm:"column:store_type;NOT NULL"`                 // 门店类型,1单门店,2连锁门店
+	StoreLocation      string    `gorm:"column:store_location;NOT NULL"`             // 门店地址
+	StoreDetail        string    `gorm:"column:store_detail"`                        // 门店特点
+	StoreLink          string    `gorm:"column:store_link"`                          // 分销链接
+	TeamNum            int64     `gorm:"column:team_num;NOT NULL"`                   // 包含团购套餐数
+	BelongEnterpriseID string    `gorm:"column:belong_enterprise_id"`                // 门店所属商家ID
+	CreatedAt          time.Time `gorm:"column:created_at;NOT NULL"`                 // 创建时间
+	IsDeleted          int64     `gorm:"column:is_deleted;default:0;NOT NULL"`       // 已删除(0否 1是)
+	OperateType        int64     `gorm:"column:operate_type;NOT NULL"`               // 操作人类型(1商家 2后台)
+	EnterpriseID       string    `gorm:"column:enterprise_id;NOT NULL"`              // 商家id
+	SubAccountID       int64     `gorm:"column:sub_account_id;default:0;NOT NULL"`   // 商家子账号id
+	UpdatedAt          time.Time `gorm:"column:updated_at"`                          // 更新时间
+}
+
+func (m *Store) TableName() string {
+	return "younggee_store"
+}

+ 13 - 0
app/entity/store_category.go

@@ -0,0 +1,13 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+// 门店类目表
+type StoreCategory struct {
+	ID       int64  `gorm:"column:id;primary_key;AUTO_INCREMENT"` // id
+	Category string `gorm:"column:category;NOT NULL"`             // 一级类目
+	Detail   string `gorm:"column:detail;NOT NULL"`               // 二级类目
+}
+
+func (m *StoreCategory) TableName() string {
+	return "younggee_store_category"
+}

+ 19 - 0
app/entity/sub_account.go

@@ -0,0 +1,19 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+type SubAccount struct {
+	SubAccountId   int64  `gorm:"sub_account_id"`   // 子账号ID
+	PhoneNumber    string `gorm:"phone_number"`     // 手机号
+	SubAccountName string `gorm:"sub_account_name"` // 名称
+	JobId          int64  `gorm:"job_id"`           // 岗位ID
+	EnterpriseId   string `gorm:"enterprise_id"`    // 所属商家账号ID
+	AccountStatus  int64  `gorm:"account_status"`   // 账户状态,1为正常,2为已停用
+	SubAccountType int64  `gorm:"sub_account_type"` // 子账号类型,1为商家端子账号,2为管理后台子账号,3为服务商端子账号
+	SuperAdminId   int64  `gorm:"super_admin_id"`   // 管理后台子账号创建者ID
+	UserId         int64  `gorm:"user_id"`          // 用户表中ID
+	SupplierId     int64  `gorm:"supplier_id"`      // 所属服务商ID
+}
+
+func (m *SubAccount) TableName() string {
+	return "younggee_sub_account"
+}

+ 20 - 0
app/entity/supplier.go

@@ -0,0 +1,20 @@
+package entity
+
+type Supplier struct {
+	SupplierID      int64  `gorm:"column:supplier_id"`      // 服务商ID
+	SupplierName    string `gorm:"column:supplier_name"`    // 服务商名称
+	PhoneNumber     string `gorm:"column:phone_number"`     // 手机号
+	BusinessLicense string `gorm:"column:business_license"` // 营业执照url
+	USCI            string `gorm:"column:usci"`             // 统一社会信用代码
+	CompanyName     string `gorm:"column:company_name"`     // 公司名称
+	IDFront         string `gorm:"column:id_front"`         // 身份证人像面url
+	IDBack          string `gorm:"column:id_back"`          // 身份证国徽面url
+	IDNumber        string `gorm:"column:id_number"`        // 身份证号
+	Name            string `gorm:"column:name"`             // 姓名
+	UserID          int64  `gorm:"column:user_id"`          // 用户表中的用户ID
+	SupplierType    int64  `gorm:"column:supplier_type"`    // 服务商用户类型,1为个人PR,2为机构
+}
+
+func (Supplier) TableName() string {
+	return "younggee_supplier"
+}

+ 12 - 0
app/entity/talent_category.go

@@ -0,0 +1,12 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+// 门店类目表
+type TalentCategory struct {
+	ID       int64  `gorm:"column:id;primary_key;AUTO_INCREMENT"` // id
+	Category string `gorm:"column:category;NOT NULL"`             // 类型
+}
+
+func (m *TalentCategory) TableName() string {
+	return "younggee_talent_category"
+}

+ 39 - 0
app/entity/talent_info.go

@@ -0,0 +1,39 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type YoungeeTalentInfo struct {
+	ID                string    `gorm:"column:id;primary_key"`            // 达人id
+	TalentWxOpenid    string    `gorm:"column:talent_wx_openid;NOT NULL"` // 达人的微信openid
+	Avatar            string    `gorm:"column:avatar;NOT NULL"`
+	TalentWxNickname  string    `gorm:"column:talent_wx_nickname"`           // 达人的微信昵称
+	TalentNickname    string    `gorm:"column:talent_nickname"`              // 达人昵称
+	Income            float64   `gorm:"column:income;default:0"`             // 收益总数
+	Withdrawing       float64   `gorm:"column:withdrawing;default:0"`        // 提现中金额
+	Canwithdraw       float64   `gorm:"column:canwithdraw;default:0"`        // 可提现金额
+	Withdrawed        float64   `gorm:"column:withdrawed;default:0"`         // 已提现金额
+	TalentPhoneNumber string    `gorm:"column:talent_phone_number"`          // 电话号码
+	TalentAgeBracket  int64     `gorm:"column:talent_age_bracket"`           // 年龄段,取tallent_age_bracket表id
+	TalentNationality int64     `gorm:"column:talent_nationality"`           // 国籍,取tallent_nationality表id
+	VisitStoreRegion  int64     `gorm:"column:visit_store_region"`           // 探店区域,取region_info表中的self_code
+	IsBindInfo        int64     `gorm:"column:is_bind_info;default:0"`       // 是否填写个人资料
+	IsBindLocation    int64     `gorm:"column:is_bind_location;default:0"`   // 是否绑定收货地址
+	IsBindBank        int64     `gorm:"column:is_bind_bank;default:0"`       // 是否绑定银行账户信息
+	InBlacklist       int64     `gorm:"column:in_blacklist;default:0"`       // 是否加入黑名单 0否 1是
+	TaskAll           int64     `gorm:"column:task_all;default:0"`           // 任务总数
+	TaskApply         int64     `gorm:"column:task_apply;default:0"`         // 报名任务数量
+	TaskExecute       int64     `gorm:"column:task_execute;default:0"`       // 执行中任务数量
+	TaskEnd           int64     `gorm:"column:task_end;default:0"`           // 结束任务数量
+	CreateDate        time.Time `gorm:"column:create_date;NOT NULL"`         // 创建时间
+	LastLoginDate     time.Time `gorm:"column:last_login_date;NOT NULL"`     // 最后登录时间
+	ApplyNum          int64     `gorm:"column:apply_num;default:5;NOT NULL"` // 剩余申请次数(每天更新)
+	UserType          int64     `gorm:"column:user_type"`
+	Sex               int64     `gorm:"column:sex"`
+}
+
+func (m *YoungeeTalentInfo) TableName() string {
+	return "youngee_talent_info"
+}

+ 29 - 0
app/entity/task_logistics.go

@@ -0,0 +1,29 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+// 物流表
+type TaskLogistics struct {
+	LogisticsID           int64     `gorm:"column:logistics_id;primary_key;AUTO_INCREMENT"` // 货物-id
+	CompanyName           string    `gorm:"column:company_name"`                            // 实物商品-物流公司名称
+	LogisticsNumber       string    `gorm:"column:logistics_number"`                        // 实物商品-物流单号
+	ExplorestoreStarttime time.Time `gorm:"column:explorestore_starttime"`                  // 线下探店-探店开始时间
+	ExplorestoreEndtime   time.Time `gorm:"column:explorestore_endtime"`                    // 线下探店-探店结束时间
+	ExplorestorePeriod    string    `gorm:"column:explorestore_period"`                     // 线下探店-探店持续时间
+	CouponCodeInformation string    `gorm:"column:coupon_code_information"`                 // 虚拟产品-券码信息
+	TaskID                string    `gorm:"column:task_id;NOT NULL"`                        // 任务id
+	DeliveryTime          time.Time `gorm:"column:delivery_time"`                           // 发货时间
+	ThingsType            int64     `gorm:"column:things_type;NOT NULL"`                    // 任务类型:1 实物,2:线下探店,3:虚拟产品
+	SignedTime            time.Time `gorm:"column:signed_time"`                             // 实物商品-签收时间
+	AutoSignAt            time.Time `gorm:"column:auto_sign_at"`                            // 自动签收时间
+	AutoScriptBreakAt     time.Time `gorm:"column:auto_script_break_at"`                    // 脚本违约自动处理时间
+	AutoSketchBreakAt     time.Time `gorm:"column:auto_sketch_break_at"`                    // 初稿违约自动处理时间
+	Status                int64     `gorm:"column:status;default:0"`                        // 签收状态,0为未签收,1为已签收
+}
+
+func (m *TaskLogistics) TableName() string {
+	return "youngee_task_logistics"
+}

+ 25 - 0
app/entity/team_buying.go

@@ -0,0 +1,25 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import "time"
+
+type TeamBuying struct {
+	TeamBuyingID       int64     `gorm:"column:team_buying_id;primary_key;AUTO_INCREMENT"` // 团购id
+	StoreID            int64     `gorm:"column:store_id;NOT NULL"`                         // 所属门店ID
+	TeamBuyingCategory string    `gorm:"column:team_buying_category;NOT NULL"`             // 团购类目(/分隔)
+	TeamBuyingName     string    `gorm:"column:team_buying_name;NOT NULL"`                 // 团购标题
+	TeamBuyingPrice    float64   `gorm:"column:team_buying_price;NOT NULL"`                // 团购售价
+	PublicCommission   int64     `gorm:"column:public_commission"`                         // 公开佣金%
+	TeamBuyingDetail   string    `gorm:"column:team_buying_detail;NOT NULL"`               // 团购详情
+	TeamBuyingLink     string    `gorm:"column:team_buying_link"`                          // 分销链接
+	CreatedAt          time.Time `gorm:"column:created_at;NOT NULL"`                       // 创建时间
+	IsDeleted          int64     `gorm:"column:is_deleted;default:0;NOT NULL"`             // 删除(0否 1是)
+	OperateType        int64     `gorm:"column:operate_type;NOT NULL"`                     // 操作人类型(1商家 2后台)
+	EnterpriseID       string    `gorm:"column:enterprise_id;NOT NULL"`                    // 商家id
+	SubAccountID       int64     `gorm:"column:sub_account_id;default:0;NOT NULL"`         // 商家子账号id
+	UpdatedAt          time.Time `gorm:"column:updated_at"`                                // 更新时间
+}
+
+func (m *TeamBuying) TableName() string {
+	return "younggee_team_buying"
+}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.