Procházet zdrojové kódy

项目id和企业id修改,专项部分修改

shenzekai před 2 roky
rodič
revize
63828b068e
64 změnil soubory, kde provedl 200 přidání a 143 odebrání
  1. 8 8
      db/enterprise.go
  2. 11 11
      db/invoice.go
  3. 6 6
      db/number_info.go
  4. 2 2
      db/pay_record.go
  5. 1 1
      db/product.go
  6. 13 11
      db/project.go
  7. 1 1
      db/project_photo.go
  8. 2 2
      db/recruit_strategy.go
  9. 2 2
      db/task.go
  10. 6 6
      db/workspace.go
  11. 0 4
      handler/SpecialTaskFinishDataList.go
  12. 1 3
      handler/SpecialTaskScriptList.go
  13. 0 3
      handler/SpecialTaskSketchList.go
  14. 22 0
      main_test.go
  15. 1 1
      model/common_model/talent_condition.go
  16. 1 1
      model/gorm_model/enterprise.go
  17. 1 1
      model/gorm_model/invoice_address.go
  18. 1 1
      model/gorm_model/invoice_info.go
  19. 1 1
      model/gorm_model/invoice_record.go
  20. 1 1
      model/gorm_model/pay_record.go
  21. 1 1
      model/gorm_model/product.go
  22. 2 2
      model/gorm_model/project.go
  23. 1 1
      model/gorm_model/project_photo.go
  24. 1 1
      model/gorm_model/project_task.go
  25. 1 1
      model/gorm_model/recharge.go
  26. 1 1
      model/gorm_model/recruit_strategy.go
  27. 1 1
      model/http_model/FeeDetailRequest.go
  28. 1 1
      model/http_model/data_accept.go
  29. 1 1
      model/http_model/data_number_info.go
  30. 1 1
      model/http_model/default_number_info.go
  31. 1 1
      model/http_model/finish_number.go
  32. 1 1
      model/http_model/full_project_list.go
  33. 1 1
      model/http_model/link_number_info.go
  34. 1 1
      model/http_model/logistic_number_info.go
  35. 6 6
      model/http_model/product_find.go
  36. 1 1
      model/http_model/project_create.go
  37. 2 2
      model/http_model/project_delete.go
  38. 1 1
      model/http_model/project_show.go
  39. 1 1
      model/http_model/project_update.go
  40. 2 2
      model/http_model/register.go
  41. 1 1
      model/http_model/review_number_info.go
  42. 1 1
      model/redis_model/auth.go
  43. 1 1
      pack/full_project.go
  44. 1 1
      pack/get_finish_data.go
  45. 1 1
      pack/special_task_data_list_condition.go
  46. 1 1
      pack/special_task_finishdata_list_condition.go
  47. 1 1
      pack/special_task_invite_list_condition.go
  48. 1 1
      pack/special_task_link_list_condition.go
  49. 1 1
      pack/special_task_script_list_condition.go
  50. 1 1
      pack/special_task_sketch_list_condition.go
  51. 1 1
      pack/task_data_list_conditions.go
  52. 4 4
      pack/task_default_list_conditions.go
  53. 1 1
      pack/task_finish_list_conditions.go
  54. 1 1
      pack/task_link_list_conditions.go
  55. 1 1
      pack/task_logistics_list_conditions.go
  56. 1 1
      pack/task_script_list_conditions.go
  57. 1 1
      pack/task_sketch_list_conditions.go
  58. 13 0
      service/enterprise.go
  59. 1 1
      service/logistics.go
  60. 3 3
      service/product.go
  61. 34 21
      service/project.go
  62. 2 2
      service/project_pay.go
  63. 2 2
      service/user.go
  64. 16 0
      util/type.go

+ 8 - 8
db/enterprise.go

@@ -14,7 +14,7 @@ import (
 	"gorm.io/gorm"
 )
 
-func CreateEnterprise(ctx context.Context, newEnterprise gorm_model.Enterprise) (*int64, error) {
+func CreateEnterprise(ctx context.Context, newEnterprise gorm_model.Enterprise) (*string, error) {
 	db := GetReadDB(ctx)
 	err := db.Create(&newEnterprise).Error
 	if err != nil {
@@ -39,7 +39,7 @@ func GetEnterpriseByUID(ctx context.Context, userID int64) (*gorm_model.Enterpri
 }
 
 // GetEnterpriseByEnterpriseID 企业ID查找
-func GetEnterpriseByEnterpriseID(ctx context.Context, EnterpriseID int64) (*gorm_model.Enterprise, error) {
+func GetEnterpriseByEnterpriseID(ctx context.Context, EnterpriseID string) (*gorm_model.Enterprise, error) {
 	db := GetReadDB(ctx)
 	enterprise := gorm_model.Enterprise{}
 	err := db.Where("enterprise_id = ?", EnterpriseID).First(&enterprise).Error
@@ -54,7 +54,7 @@ func GetEnterpriseByEnterpriseID(ctx context.Context, EnterpriseID int64) (*gorm
 }
 
 // GetEnterpriseBalance 获取企业可用余额等信息
-func GetEnterpriseBalance(ctx context.Context, EnterpriseID int64) (*http_model.EnterpriseBalanceData, error) {
+func GetEnterpriseBalance(ctx context.Context, EnterpriseID string) (*http_model.EnterpriseBalanceData, error) {
 	db := GetReadDB(ctx)
 	enterprise := gorm_model.Enterprise{}
 	err := db.Where("enterprise_id = ?", EnterpriseID).First(&enterprise).Error
@@ -92,7 +92,7 @@ func GetEnterpriseBalance(ctx context.Context, EnterpriseID int64) (*http_model.
 }
 
 // 支付-修改企业账户余额
-func UpdateEnterpriseBalance(ctx context.Context, EnterpriseID int64, balance float64, availableBalance float64, frozenBalance float64) (*float64, error) {
+func UpdateEnterpriseBalance(ctx context.Context, EnterpriseID string, balance float64, availableBalance float64, frozenBalance float64) (*float64, error) {
 	db := GetReadDB(ctx)
 	err := db.Model(gorm_model.Enterprise{}).Where("enterprise_id", EnterpriseID).
 		Updates(map[string]interface{}{"balance": gorm.Expr("balance + ?", balance), "available_balance": gorm.Expr("available_balance + ?", availableBalance), "frozen_balance": gorm.Expr("frozen_balance + ?", frozenBalance)}).Error
@@ -108,7 +108,7 @@ func UpdateEnterpriseBalance(ctx context.Context, EnterpriseID int64, balance fl
 	return &enterprise.Balance, nil
 }
 
-func MakeRechargeId(ctx context.Context, EnterpriseID int64) string {
+func MakeRechargeId(ctx context.Context, EnterpriseID string) string {
 	db := GetReadDB(ctx)
 	// 1、年月日
 	year := time.Now().Year()
@@ -146,7 +146,7 @@ func MakeRechargeId(ctx context.Context, EnterpriseID int64) string {
 	return rechargeIdPrefix + last
 }
 
-func RechargeAmount(ctx context.Context, EnterpriseID int64, Amount float64, phone string) error {
+func RechargeAmount(ctx context.Context, EnterpriseID string, Amount float64, phone string) error {
 	db := GetReadDB(ctx)
 	err := db.Model(gorm_model.Enterprise{}).Where("enterprise_id", EnterpriseID).
 		Updates(map[string]interface{}{"balance": gorm.Expr("balance + ?", Amount), "available_balance": gorm.Expr("available_balance + ?", Amount)}).Error
@@ -177,7 +177,7 @@ func RechargeAmount(ctx context.Context, EnterpriseID int64, Amount float64, pho
 	return nil
 }
 
-func TransferToPublic(ctx context.Context, Amount float64, phone string, EnterpriseID int64, transferVoucherUrl string) error {
+func TransferToPublic(ctx context.Context, Amount float64, phone string, EnterpriseID string, transferVoucherUrl string) error {
 	db := GetReadDB(ctx)
 	rechargeId := MakeRechargeId(ctx, EnterpriseID)
 	fmt.Println("Amount:", Amount)
@@ -206,7 +206,7 @@ func TransferToPublic(ctx context.Context, Amount float64, phone string, Enterpr
 	return nil
 }
 
-func UpdateEnterprise(ctx context.Context, EnterpriseID int64, BusinessName string) error {
+func UpdateEnterprise(ctx context.Context, EnterpriseID string, BusinessName string) error {
 	db := GetReadDB(ctx)
 	err := db.Model(gorm_model.Enterprise{}).Where("enterprise_id=?", EnterpriseID).Update("business_name", BusinessName).Error
 	if err != nil {

+ 11 - 11
db/invoice.go

@@ -13,7 +13,7 @@ import (
 	"youngee_b_api/util"
 )
 
-func AddReceiveAddress(ctx context.Context, enterpriseId int64, req *http_model.AddReceiveAddressRequest) error {
+func AddReceiveAddress(ctx context.Context, enterpriseId string, req *http_model.AddReceiveAddressRequest) error {
 	db := GetReadDB(ctx)
 	return db.Debug().Model(gorm_model.YounggeeInvoiceAddress{}).Create(&gorm_model.YounggeeInvoiceAddress{
 		EnterpriseID: enterpriseId,
@@ -25,7 +25,7 @@ func AddReceiveAddress(ctx context.Context, enterpriseId int64, req *http_model.
 	}).Error
 }
 
-func AddReceiveInfo(ctx context.Context, enterpriseId int64, req *http_model.AddReceiveInfoRequest) error {
+func AddReceiveInfo(ctx context.Context, enterpriseId string, req *http_model.AddReceiveInfoRequest) error {
 	db := GetReadDB(ctx)
 	return db.Debug().Model(gorm_model.YounggeeInvoiceInfo{}).Create(&gorm_model.YounggeeInvoiceInfo{
 		EnterpriseID:      enterpriseId,
@@ -41,7 +41,7 @@ func AddReceiveInfo(ctx context.Context, enterpriseId int64, req *http_model.Add
 	}).Error
 }
 
-func GetReceiveAddress(ctx context.Context, enterpriseId int64) (*http_model.ReceiveAddressData, error) {
+func GetReceiveAddress(ctx context.Context, enterpriseId string) (*http_model.ReceiveAddressData, error) {
 	db := GetReadDB(ctx)
 	var InvoiceAddress []*gorm_model.YounggeeInvoiceAddress
 	db = db.Debug().Model(gorm_model.YounggeeInvoiceAddress{}).Where(
@@ -62,7 +62,7 @@ func GetReceiveAddress(ctx context.Context, enterpriseId int64) (*http_model.Rec
 	return &receiveAddress, nil
 }
 
-func GetReceiveInfo(ctx context.Context, enterpriseId int64) (*http_model.ReceiveInfoData, error) {
+func GetReceiveInfo(ctx context.Context, enterpriseId string) (*http_model.ReceiveInfoData, error) {
 	db := GetReadDB(ctx)
 	var InvoiceInfo []*gorm_model.YounggeeInvoiceInfo
 	db = db.Debug().Model(gorm_model.YounggeeInvoiceInfo{}).Where(
@@ -87,7 +87,7 @@ func GetReceiveInfo(ctx context.Context, enterpriseId int64) (*http_model.Receiv
 	return &ReceiveInfoData, nil
 }
 
-func OperateReceiveInfo(ctx context.Context, enterpriseId int64, req *http_model.OperateReceiveInfoRequest) error {
+func OperateReceiveInfo(ctx context.Context, enterpriseId string, req *http_model.OperateReceiveInfoRequest) error {
 	db := GetReadDB(ctx)
 	if req.OperateType == 2 {
 		return db.Debug().Delete(&gorm_model.YounggeeInvoiceInfo{}, req.InvoiceId).Error
@@ -106,7 +106,7 @@ func OperateReceiveInfo(ctx context.Context, enterpriseId int64, req *http_model
 		}).Error
 }
 
-func OperateReceiveAddress(ctx context.Context, enterpriseId int64, req *http_model.OperateReceiveAddressRequest) error {
+func OperateReceiveAddress(ctx context.Context, enterpriseId string, req *http_model.OperateReceiveAddressRequest) error {
 	db := GetReadDB(ctx)
 	if req.OperateType == 2 {
 		return db.Debug().Delete(&gorm_model.YounggeeInvoiceAddress{}, req.AddressID).Error
@@ -121,7 +121,7 @@ func OperateReceiveAddress(ctx context.Context, enterpriseId int64, req *http_mo
 		}).Error
 }
 
-func AddInvoiceRecord(ctx context.Context, enterpriseId int64, req *http_model.AddInvoiceRecordRequest) error {
+func AddInvoiceRecord(ctx context.Context, enterpriseId string, req *http_model.AddInvoiceRecordRequest) error {
 	invoiceInfo := gorm_model.YounggeeInvoiceInfo{}
 	//fmt.Println("req:", req)
 	//fmt.Println("invoice_id", req.InvoiceID)
@@ -161,7 +161,7 @@ func AddInvoiceRecord(ctx context.Context, enterpriseId int64, req *http_model.A
 	}).Error
 }
 
-func GetBillingId(ctx context.Context, enterpriseId int64) string {
+func GetBillingId(ctx context.Context, enterpriseId string) string {
 	db := GetReadDB(ctx)
 	// 1、年月日
 	year := time.Now().Year()
@@ -210,12 +210,12 @@ func GetInvoiceRecords(ctx context.Context, req *http_model.GetInvoiceRecordRequ
 		logrus.WithContext(ctx).Errorf("[GetInvoiceRecords] error query mysql limit, err:%+v", err)
 		return nil, err
 	}
-	var enterpriseIds []int64
+	var enterpriseIds []string
 	for _, invoiceRecord := range invoiceRecords {
 		enterpriseIds = append(enterpriseIds, invoiceRecord.EnterpriseID)
 	}
-	util.RemoveRepByMap(enterpriseIds)
-	enterpriseIdToUserInfoMap := make(map[int64]gorm_model.Enterprise)
+	util.RemoveStrRepByMap(enterpriseIds)
+	enterpriseIdToUserInfoMap := make(map[string]gorm_model.Enterprise)
 	db1 := GetReadDB(ctx)
 	for _, v := range enterpriseIds {
 		enterpriseInfo := gorm_model.Enterprise{}

+ 6 - 6
db/number_info.go

@@ -8,7 +8,7 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
-func GetLogisticsNumberInfo(ctx context.Context, projectId int64, strategyIds []int64) (*http_model.GetLogisticsNumberInfoData, error) {
+func GetLogisticsNumberInfo(ctx context.Context, projectId string, strategyIds []int64) (*http_model.GetLogisticsNumberInfoData, error) {
 	var LogisticsNumberInfoDataList http_model.GetLogisticsNumberInfoData
 
 	for _, strategyId := range strategyIds {
@@ -44,7 +44,7 @@ func GetLogisticsNumberInfo(ctx context.Context, projectId int64, strategyIds []
 	return &LogisticsNumberInfoDataList, nil
 }
 
-func GetReviewNumberInfo(ctx context.Context, projectId int64, strategyIds []int64) (*http_model.GetReviewNumberInfoData, error) {
+func GetReviewNumberInfo(ctx context.Context, projectId string, strategyIds []int64) (*http_model.GetReviewNumberInfoData, error) {
 	var ReviewNumberInfoDataList http_model.GetReviewNumberInfoData
 
 	for _, strategyId := range strategyIds {
@@ -86,7 +86,7 @@ func GetReviewNumberInfo(ctx context.Context, projectId int64, strategyIds []int
 	return &ReviewNumberInfoDataList, nil
 }
 
-func GetLinkNumberInfo(ctx context.Context, projectId int64, strategyIds []int64) (*http_model.GetLinkNumberInfoData, error) {
+func GetLinkNumberInfo(ctx context.Context, projectId string, strategyIds []int64) (*http_model.GetLinkNumberInfoData, error) {
 	var LinkNumberInfoDataList http_model.GetLinkNumberInfoData
 
 	for _, strategyId := range strategyIds {
@@ -116,7 +116,7 @@ func GetLinkNumberInfo(ctx context.Context, projectId int64, strategyIds []int64
 	return &LinkNumberInfoDataList, nil
 }
 
-func GetDataNumberInfo(ctx context.Context, projectId int64, strategyIds []int64) (*http_model.GetDataNumberInfoData, error) {
+func GetDataNumberInfo(ctx context.Context, projectId string, strategyIds []int64) (*http_model.GetDataNumberInfoData, error) {
 	var DataNumberInfoDataList http_model.GetDataNumberInfoData
 
 	for _, strategyId := range strategyIds {
@@ -146,7 +146,7 @@ func GetDataNumberInfo(ctx context.Context, projectId int64, strategyIds []int64
 	return &DataNumberInfoDataList, nil
 }
 
-func GetDefaultNumberInfo(ctx context.Context, projectId int64, strategyIds []int64) (*http_model.GetDefaultNumberInfoData, error) {
+func GetDefaultNumberInfo(ctx context.Context, projectId string, strategyIds []int64) (*http_model.GetDefaultNumberInfoData, error) {
 	var DefaultNumberInfoDataList http_model.GetDefaultNumberInfoData
 
 	for _, strategyId := range strategyIds {
@@ -194,7 +194,7 @@ func GetDefaultNumberInfo(ctx context.Context, projectId int64, strategyIds []in
 	return &DefaultNumberInfoDataList, nil
 }
 
-func GetFinishNumberInfo(ctx context.Context, projectId int64, strategyIds []int64) (*http_model.GetFinishNumberInfoData, error) {
+func GetFinishNumberInfo(ctx context.Context, projectId string, strategyIds []int64) (*http_model.GetFinishNumberInfoData, error) {
 	var FinishNumberInfoDataList http_model.GetFinishNumberInfoData
 
 	for _, strategyId := range strategyIds {

+ 2 - 2
db/pay_record.go

@@ -13,7 +13,7 @@ import (
 )
 
 // CreatePayRecord 新增
-func CreatePayRecord(ctx context.Context, enterpriseId int64, payment float64, balance float64, payType int64, projectId int64) (*int64, error) {
+func CreatePayRecord(ctx context.Context, enterpriseId string, payment float64, balance float64, payType int64, projectId int64) (*int64, error) {
 	db := GetReadDB(ctx)
 	payRecord := gorm_model.EnterprisePayRecord{
 		EnterpriseID: enterpriseId,
@@ -32,7 +32,7 @@ func CreatePayRecord(ctx context.Context, enterpriseId int64, payment float64, b
 	return &payRecord.ID, nil
 }
 
-func GetRechargeRecord(ctx context.Context, enterpriseID int64, confirmAt string, method int) (*http_model.RechargeRecordPreview, error) {
+func GetRechargeRecord(ctx context.Context, enterpriseID string, confirmAt string, method int) (*http_model.RechargeRecordPreview, error) {
 	db := GetReadDB(ctx)
 	// 根据企业id过滤
 	db = db.Debug().Model(gorm_model.YounggeeRechargeRecord{}).Where("enterprise_id = ?", enterpriseID)

+ 1 - 1
db/product.go

@@ -25,7 +25,7 @@ func UpdateProduct(ctx context.Context, product gorm_model.YounggeeProduct) (*in
 	return &product.ProductID, nil
 }
 
-func GetProductByEnterpriseID(ctx context.Context, enterpriseID int64) ([]gorm_model.YounggeeProduct, error) {
+func GetProductByEnterpriseID(ctx context.Context, enterpriseID string) ([]gorm_model.YounggeeProduct, error) {
 	db := GetReadDB(ctx)
 	products := []gorm_model.YounggeeProduct{}
 	err := db.Where("enterprise_id = ?", enterpriseID).Find(&products).Error

+ 13 - 11
db/project.go

@@ -19,7 +19,7 @@ import (
 	"gorm.io/gorm"
 )
 
-func CreateProject(ctx context.Context, projectInfo gorm_model.ProjectInfo) (*int64, error) {
+func CreateProject(ctx context.Context, projectInfo gorm_model.ProjectInfo) (*string, error) {
 	db := GetWriteDB(ctx)
 	err := db.Create(&projectInfo).Error
 	if err != nil {
@@ -27,7 +27,7 @@ func CreateProject(ctx context.Context, projectInfo gorm_model.ProjectInfo) (*in
 	}
 	return &projectInfo.ProjectID, nil
 }
-func UpdateProject(ctx context.Context, project gorm_model.ProjectInfo) (*int64, error) {
+func UpdateProject(ctx context.Context, project gorm_model.ProjectInfo) (*string, error) {
 	db := GetReadDB(ctx)
 	err := db.Model(&project).Updates(project).Error
 	if err != nil {
@@ -36,7 +36,7 @@ func UpdateProject(ctx context.Context, project gorm_model.ProjectInfo) (*int64,
 	return &project.ProjectID, nil
 }
 
-func DeleteProject(ctx context.Context, projectID int64) (*int64, error) {
+func DeleteProject(ctx context.Context, projectID string) (*string, error) {
 	db := GetReadDB(ctx)
 	err := db.Where("project_id = ?", projectID).Delete(&gorm_model.ProjectInfo{}).Error
 	if err != nil {
@@ -45,7 +45,7 @@ func DeleteProject(ctx context.Context, projectID int64) (*int64, error) {
 	return &projectID, nil
 }
 
-func GetFullProjectList(ctx context.Context, enterpriseID int64, pageSize, pageNum int32, condition *common_model.ProjectCondition) ([]*gorm_model.ProjectInfo, int64, error) {
+func GetFullProjectList(ctx context.Context, enterpriseID string, pageSize, pageNum int32, condition *common_model.ProjectCondition) ([]*gorm_model.ProjectInfo, int64, error) {
 	db := GetReadDB(ctx)
 	// 根据企业id过滤
 	db = db.Debug().Model(gorm_model.ProjectInfo{}).Where("enterprise_id = ? and project_status <> 1", enterpriseID)
@@ -83,7 +83,7 @@ func GetFullProjectList(ctx context.Context, enterpriseID int64, pageSize, pageN
 	return fullProjects, total, nil
 }
 
-func GetProjectDraftList(ctx context.Context, enterpriseID int64, pageSize, pageNum int32, condition *common_model.ProjectCondition) ([]*gorm_model.ProjectInfo, int64, error) {
+func GetProjectDraftList(ctx context.Context, enterpriseID string, pageSize, pageNum int32, condition *common_model.ProjectCondition) ([]*gorm_model.ProjectInfo, int64, error) {
 	db := GetReadDB(ctx)
 	// 根据企业id过滤
 	db = db.Debug().Model(gorm_model.ProjectInfo{}).Where("enterprise_id = ?", enterpriseID)
@@ -178,9 +178,10 @@ func GetProjectTaskList(ctx context.Context, projectID string, pageSize, pageNum
 	return newTaskDatas, totalTask, nil
 }
 
-func GetProjectDetail(ctx context.Context, projectID int64) (*gorm_model.ProjectInfo, error) {
+func GetProjectDetail(ctx context.Context, projectID string) (*gorm_model.ProjectInfo, error) {
 	db := GetReadDB(ctx)
 	var ProjectDetail *gorm_model.ProjectInfo
+	//fmt.Printf("项目ID:%+v", projectID)
 	err := db.Where("project_id = ?", projectID).First(&ProjectDetail).Error
 	if err != nil {
 		if err == gorm.ErrRecordNotFound {
@@ -189,10 +190,11 @@ func GetProjectDetail(ctx context.Context, projectID int64) (*gorm_model.Project
 			return nil, err
 		}
 	}
+	//fmt.Printf("项目详情:%+v", ProjectDetail)
 	return ProjectDetail, nil
 }
 
-func GetProjectPhoto(ctx context.Context, ProjectID int64) ([]gorm_model.ProjectPhoto, error) {
+func GetProjectPhoto(ctx context.Context, ProjectID string) ([]gorm_model.ProjectPhoto, error) {
 	db := GetReadDB(ctx)
 	ProjectPhoto := []gorm_model.ProjectPhoto{}
 	err := db.Where("project_id=?", ProjectID).Find(&ProjectPhoto).Error
@@ -202,7 +204,7 @@ func GetProjectPhoto(ctx context.Context, ProjectID int64) ([]gorm_model.Project
 	return ProjectPhoto, nil
 }
 
-func GetRecruitStrategys(ctx context.Context, ProjectID int64) ([]gorm_model.RecruitStrategy, error) {
+func GetRecruitStrategys(ctx context.Context, ProjectID string) ([]gorm_model.RecruitStrategy, error) {
 	db := GetReadDB(ctx)
 	RecruitStrategys := []gorm_model.RecruitStrategy{}
 	err := db.Where("project_id=?", ProjectID).Find(&RecruitStrategys).Error
@@ -223,7 +225,7 @@ func UpdateProjectStatus(ctx context.Context, projectId int64, status int64) err
 	return nil
 }
 
-func GetFeeDetail(ctx context.Context, enterpriseID int64, EndTime string) (*http_model.FeeDetailPreview, error) {
+func GetFeeDetail(ctx context.Context, enterpriseID string, EndTime string) (*http_model.FeeDetailPreview, error) {
 	db := GetReadDB(ctx)
 	// 根据企业id过滤
 	db = db.Debug().Model(gorm_model.ProjectInfo{}).Where("enterprise_id = ? AND project_status = 10", enterpriseID)
@@ -245,7 +247,7 @@ func GetFeeDetail(ctx context.Context, enterpriseID int64, EndTime string) (*htt
 	return &FeeDetailPreview, nil
 }
 
-func SetProjectFinish(ctx context.Context, projectId int64) error {
+func SetProjectFinish(ctx context.Context, projectId string) error {
 	db := GetReadDB(ctx)
 	// 1. 更新项目状态为已结束
 	err := db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", projectId).Updates(map[string]interface{}{"project_status": 10}).Error
@@ -283,7 +285,7 @@ func SetProjectFinish(ctx context.Context, projectId int64) error {
 	return nil
 }
 
-func GetCreatingNumber(ctx context.Context, enterpriseID int64) (*int64, error) {
+func GetCreatingNumber(ctx context.Context, enterpriseID string) (*int64, error) {
 	db := GetReadDB(ctx)
 	var creatingNumber int64
 	err := db.Model(gorm_model.ProjectInfo{}).Where("enterprise_id = ? and project_status = 1", enterpriseID).Count(&creatingNumber).Error

+ 1 - 1
db/project_photo.go

@@ -13,7 +13,7 @@ func CreateProjectPhoto(ctx context.Context, projectPhotos []gorm_model.ProjectP
 	}
 	return nil
 }
-func DeleteProjectPhotoByProjecttID(ctx context.Context, productID int64) error {
+func DeleteProjectPhotoByProjecttID(ctx context.Context, productID string) error {
 	db := GetReadDB(ctx)
 	err := db.Where("project_id = ?", productID).Delete(&gorm_model.ProjectPhoto{}).Error
 	if err != nil {

+ 2 - 2
db/recruit_strategy.go

@@ -17,7 +17,7 @@ func CreateRecruitStrategy(ctx context.Context, recruitStrategys []gorm_model.Re
 	return nil
 }
 
-func DeleteRecruitStrategyByProjectID(ctx context.Context, projectID int64) error {
+func DeleteRecruitStrategyByProjectID(ctx context.Context, projectID string) error {
 	db := GetReadDB(ctx)
 	err := db.Where("project_id = ?", projectID).Delete(&gorm_model.RecruitStrategy{}).Error
 	if err != nil {
@@ -56,7 +56,7 @@ func UpdateLogisticsNumber(ctx context.Context, RecruitStrategyID int64, deliver
 	return nil
 }
 
-func GetRecruitStrategyIdByTS(ctx context.Context, projectId int, strategyID int64) (*int64, error) {
+func GetRecruitStrategyIdByTS(ctx context.Context, projectId string, strategyID int64) (*int64, error) {
 	db := GetReadDB(ctx)
 	RecruitStrategy := &gorm_model.RecruitStrategy{}
 	err := db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? AND strategy_id = ?", projectId, strategyID).Scan(RecruitStrategy).Error

+ 2 - 2
db/task.go

@@ -52,7 +52,7 @@ func UpdateLogisticsDate(ctx context.Context, taskID int64) error {
 	return nil
 }
 
-func GetProjectIdByTaskId(ctx context.Context, taskID int64) (*int, error) {
+func GetProjectIdByTaskId(ctx context.Context, taskID int64) (*string, error) {
 	db := GetReadDB(ctx)
 	task := &gorm_model.YoungeeTaskInfo{}
 	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskID).Scan(task).Error
@@ -140,7 +140,7 @@ func UpdateTaskStageByTaskId(ctx context.Context, taskID int64, taskStatus int64
 	return nil
 }
 
-func GetUnfinishedTaskNumber(ctx context.Context, projectID int64) (*int64, error) {
+func GetUnfinishedTaskNumber(ctx context.Context, projectID string) (*int64, error) {
 	var unFinishedTaskNumber int64
 	db := GetReadDB(ctx)
 	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2 and task_stage < 15", projectID).Count(&unFinishedTaskNumber).Error

+ 6 - 6
db/workspace.go

@@ -11,7 +11,7 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
-func GetWorkspaceNums(ctx context.Context, enterpriseID int64) (*http_model.WorkspaceNums, error) {
+func GetWorkspaceNums(ctx context.Context, enterpriseID string) (*http_model.WorkspaceNums, error) {
 	var workspaceNums http_model.WorkspaceNums
 	var PaymentPending, DraftNum, RecruitingFullNum, ExecutionSpecNum, ExecutionFullNum int64
 	db := GetReadDB(ctx)
@@ -46,7 +46,7 @@ func GetWorkspaceNums(ctx context.Context, enterpriseID int64) (*http_model.Work
 	return &workspaceNums, nil
 }
 
-func GetWorkspaceDDLproject(ctx context.Context, enterpriseID, pageSize, pageNum int64) (*http_model.WorkspaceDDLprojectdata, error) {
+func GetWorkspaceDDLproject(ctx context.Context, enterpriseID string, pageSize, pageNum int64) (*http_model.WorkspaceDDLprojectdata, error) {
 	var projectInfos []gorm_model.ProjectInfo
 	//DDLproject := http_model.WorkspaceDDLprojectdata{}
 	db := GetReadDB(ctx)
@@ -71,7 +71,7 @@ func GetWorkspaceDDLproject(ctx context.Context, enterpriseID, pageSize, pageNum
 	wsDDLprojectData.Total = conv.MustString(total)
 	for _, projectInfo := range projectInfos {
 		DDLProjectPreview := new(http_model.DDLProjectPreview)
-		DDLProjectPreview.ProjectId = conv.MustString(projectInfo.ProjectID)
+		DDLProjectPreview.ProjectId = projectInfo.ProjectID
 		DDLProjectPreview.ProjectForm = conv.MustString(projectInfo.ProjectForm)
 		DDLProjectPreview.ProjectName = projectInfo.ProjectName
 		DDLProjectPreview.ProjectStatus = conv.MustString(projectInfo.ProjectStatus)
@@ -93,12 +93,12 @@ func GetWorkspaceDDLproject(ctx context.Context, enterpriseID, pageSize, pageNum
 	return &wsDDLprojectData, nil
 }
 
-func GetWorkspaceBarNums(ctx context.Context, enterpriseID, projectType int64) (*http_model.WorkspaceBarNums, error) {
+func GetWorkspaceBarNums(ctx context.Context, enterpriseID string, projectType int64) (*http_model.WorkspaceBarNums, error) {
 	var workspaceNums http_model.WorkspaceBarNums
 	var DataPendingNum, LinkPendingNum, SketchPendingNum, ScriptPendingNum, AccSelecting, ShipmentPendingNum, ShippedNum int64
 	fmt.Printf("TypeShow %+v", projectType)
 	//先查企业所属的全部项目
-	var RecruitingProjectIDs []int64
+	var RecruitingProjectIDs []string
 	db := GetReadDB(ctx)
 	db = db.Debug().Model(gorm_model.ProjectInfo{}).Select("project_id").Where("enterprise_id = ? AND project_type = ?  AND project_status = 4", enterpriseID, projectType).Find(&RecruitingProjectIDs)
 
@@ -114,7 +114,7 @@ func GetWorkspaceBarNums(ctx context.Context, enterpriseID, projectType int64) (
 	}
 
 	//执行中都是状态9 再次过滤
-	var ExecutingProjectIDs []int64
+	var ExecutingProjectIDs []string
 
 	db = GetReadDB(ctx)
 	db = db.Debug().Model(gorm_model.ProjectInfo{}).Select("project_id").Where("enterprise_id = ? AND project_type = ?  AND project_status = 9", enterpriseID, projectType).Find(&ExecutingProjectIDs)

+ 0 - 4
handler/SpecialTaskFinishDataList.go

@@ -10,7 +10,6 @@ import (
 	"youngee_b_api/util"
 
 	"github.com/gin-gonic/gin"
-	"github.com/issue9/conv"
 	"github.com/sirupsen/logrus"
 )
 
@@ -59,9 +58,6 @@ func (h *SpecialTaskFinishDataListHandler) checkParam() error {
 	}
 	h.req.PageNum--
 	h.req.ProjectId = util.IsNull(h.req.ProjectId)
-	if _, err := conv.Int64(h.req.ProjectId); err != nil {
-		errs = append(errs, err)
-	}
 	if len(errs) != 0 {
 		return fmt.Errorf("check param errs:%+v", errs)
 	}

+ 1 - 3
handler/SpecialTaskScriptList.go

@@ -59,9 +59,7 @@ func (h *SpecialTaskScriptListHandler) checkParam() error {
 	}
 	h.req.PageNum--
 	h.req.ProjectId = util.IsNull(h.req.ProjectId)
-	if _, err := conv.Int64(h.req.ProjectId); err != nil {
-		errs = append(errs, err)
-	}
+
 	h.req.ScriptStatus = util.IsNull(h.req.ScriptStatus)
 	if _, err := conv.Int64(h.req.ScriptStatus); err != nil {
 		errs = append(errs, err)

+ 0 - 3
handler/SpecialTaskSketchList.go

@@ -59,9 +59,6 @@ func (h *SpecialTaskSketchListHandler) checkParam() error {
 	}
 	h.req.PageNum--
 	h.req.ProjectId = util.IsNull(h.req.ProjectId)
-	if _, err := conv.Int64(h.req.ProjectId); err != nil {
-		errs = append(errs, err)
-	}
 	h.req.SketchStatus = util.IsNull(h.req.SketchStatus)
 	if _, err := conv.Int64(h.req.SketchStatus); err != nil {
 		errs = append(errs, err)

+ 22 - 0
main_test.go

@@ -1,11 +1,33 @@
 package main
 
 import (
+	"fmt"
+	"github.com/issue9/conv"
+	"math/rand"
 	"testing"
+	"time"
 )
 
 func TestGormUser(t *testing.T) {
+	rand.Seed(time.Now().UnixNano())
+	res := conv.MustString(rand.Intn(100000-10000) + 10000)
+	th := conv.MustString(time.Now().Hour())
+	tm := conv.MustString(time.Now().Minute())
+	if len(tm) < 2 {
+		tm = "0" + tm
+	}
+	if len(tm) < 2 {
+		th = "0" + th
+	}
 
+	//td := conv.MustString(time.Now().Day())
+	//for {
+	//	if len(td) == 3 {
+	//		break
+	//	}
+	//	td = "0" + td
+	//}
+	fmt.Println("1" + th + tm + res)
 }
 
 // func TestDbCreateEnterprise(t *testing.T) {

+ 1 - 1
model/common_model/talent_condition.go

@@ -1,7 +1,7 @@
 package common_model
 
 type TalentConditions struct {
-	ProjectId        int64  `condition:"project_id"`        // 项目ID
+	ProjectId        string `condition:"project_id"`        // 项目ID
 	TaskStatus       int64  `condition:"task_status"`       // 任务状态
 	LogisticsStatus  int64  `condition:"logistics_status"`  // 物流状态
 	ScriptStatus     int64  `condition:"script_status"`     // 脚本状态

+ 1 - 1
model/gorm_model/enterprise.go

@@ -6,7 +6,7 @@ import (
 )
 
 type Enterprise struct {
-	EnterpriseID     int64     `gorm:"column:enterprise_id"`     // 企业id
+	EnterpriseID     string     `gorm:"column:enterprise_id"`     // 企业id,用户ID的生成规则为:1(企业用户代码)+分秒数字+四位随机数字
 	Industry         int64     `gorm:"column:industry"`          // 行业,1-14分别代表能源、化工、材料、机械设备/军工、企业服务/造纸印刷、运输设备、旅游酒店、媒体/信息通信服务、批发/零售、消费品、卫生保健/医疗、金融、建材/建筑/房地产、公共事业
 	BusinessName     string    `gorm:"column:business_name"`     // 公司或组织名称
 	UserID           int64     `gorm:"column:user_id"`           // 对应用户id

+ 1 - 1
model/gorm_model/invoice_address.go

@@ -6,7 +6,7 @@ import "time"
 
 type YounggeeInvoiceAddress struct {
 	AddressID    int64     `gorm:"column:address_id;primary_key;AUTO_INCREMENT"` // 发票收件地址id
-	EnterpriseID int64     `gorm:"column:enterprise_id;NOT NULL"`                // 企业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"`                      // 详细地址

+ 1 - 1
model/gorm_model/invoice_info.go

@@ -6,7 +6,7 @@ import "time"
 
 type YounggeeInvoiceInfo struct {
 	InvoiceID         int64     `gorm:"column:invoice_id;primary_key;AUTO_INCREMENT"` // 发票信息id
-	EnterpriseID      int64     `gorm:"column:enterprise_id;NOT NULL"`                // 企业id
+	EnterpriseID      string    `gorm:"column:enterprise_id;NOT NULL"`                // 企业id
 	HeadType          string    `gorm:"column:head_type;NOT NULL"`                    // 抬头类型
 	InvoiceHeader     string    `gorm:"column:invoice_header;NOT NULL"`               // 发票抬头
 	InvoiceType       string    `gorm:"column:invoice_type;NOT NULL"`                 // 发票类型

+ 1 - 1
model/gorm_model/invoice_record.go

@@ -8,7 +8,7 @@ import (
 
 type YounggeeInvoiceRecord struct {
 	BillingID      string     `gorm:"column:billing_id;primary_key"`  // 开票订单ID
-	EnterpriseID   int64      `gorm:"column:enterprise_id;NOT NULL"`  // 企业id
+	EnterpriseID   string      `gorm:"column:enterprise_id;NOT NULL"`  // 企业id
 	InvoiceType    string     `gorm:"column:invoice_type;NOT NULL"`   // 发票类型
 	InvoiceAmount  float64    `gorm:"column:invoice_amount;NOT NULL"` // 开票金额
 	InvoiceSnap    string     `gorm:"column:invoice_snap;NOT NULL"`   // 开票信息快照

+ 1 - 1
model/gorm_model/pay_record.go

@@ -11,7 +11,7 @@ type EnterprisePayRecord struct {
 	Balance      float64   `gorm:"column:balance"`                       // 交易后账户可用余额
 	PayType      int64     `gorm:"column:pay_type;NOT NULL"`             // 交易类型,1表示充值,2表示支付
 	RechargeType int64     `gorm:"column:recharge_type"`                 // 充值方式,1表示在线交易,2表示对公转账
-	EnterpriseID int64     `gorm:"column:enterprise_id;NOT NULL"`        // 企业id
+	EnterpriseID string     `gorm:"column:enterprise_id;NOT NULL"`        // 企业id
 	PayAt        time.Time `gorm:"column:pay_at;NOT NULL"`               // 交易时间
 	ProjectID    int64     `gorm:"column:project_id"`                    // 支付的项目id
 }

+ 1 - 1
model/gorm_model/product.go

@@ -13,7 +13,7 @@ type YounggeeProduct struct {
 	ProductPrice  float64     `gorm:"column:product_price"`                         // 商品价值
 	ProductDetail string    `gorm:"column:product_detail"`
 	ProductUrl    string    `gorm:"column:product_url"`   // 商品链接,可为电商网址、公司官网、大众点评的店铺地址等可以说明商品信息或者品牌信息的线上地址;
-	EnterpriseID  int64       `gorm:"column:enterprise_id"` // 所属企业id
+	EnterpriseID  string      `gorm:"column:enterprise_id"` // 所属企业id
 	CreatedAt     time.Time `gorm:"column:created_at"`    // 创建时间
 	UpdatedAt     time.Time `gorm:"column:updated_at"`    // 更新时间
 	BrandName     string    `gorm:"column:brand_name"`

+ 2 - 2
model/gorm_model/project.go

@@ -6,7 +6,7 @@ import (
 )
 
 type ProjectInfo struct {
-	ProjectID         int64      `gorm:"column:project_id;primary_key;AUTO_INCREMENT"` // 项目id
+	ProjectID         string      `gorm:"column:project_id;primary_key;AUTO_INCREMENT"` // 项目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代表专项项目
@@ -18,7 +18,7 @@ type ProjectInfo struct {
 	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      int64      `gorm:"column:enterprise_id"`                         // 所属企业id
+	EnterpriseID      string      `gorm:"column:enterprise_id"`                         // 所属企业id
 	ProductID         int64      `gorm:"column:product_id"`                            // 关联商品id
 	CreatedAt         *time.Time `gorm:"column:created_at"`                            // 创建时间
 	UpdatedAt         *time.Time `gorm:"column:updated_at"`                            // 修改时间

+ 1 - 1
model/gorm_model/project_photo.go

@@ -9,7 +9,7 @@ type ProjectPhoto struct {
 	ProjectPhotoID int64       `gorm:"column:project_photo_id;primary_key;AUTO_INCREMENT"` // 项目图片id
 	PhotoUrl       string    `gorm:"column:photo_url"`                                   // 图片url
 	PhotoUid       string    `gorm:"column:photo_uid"`
-	ProjectID      int64       `gorm:"column:project_id"` // 所属项目id
+	ProjectID      string       `gorm:"column:project_id"` // 所属项目id
 	CreatedAt      time.Time `gorm:"column:created_at"` // 创建时间
 }
 

+ 1 - 1
model/gorm_model/project_task.go

@@ -7,7 +7,7 @@ import (
 
 type YoungeeTaskInfo struct {
 	TaskID                 int       `gorm:"column:task_id;primary_key;AUTO_INCREMENT"`             // 任务id
-	ProjectID              int       `gorm:"column:project_id;NOT NULL"`                            // 项目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"`             // 达人平台信息快照

+ 1 - 1
model/gorm_model/recharge.go

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

+ 1 - 1
model/gorm_model/recruit_strategy.go

@@ -11,7 +11,7 @@ type RecruitStrategy struct {
 	RecruitNumber     int64    `gorm:"column:recruit_number"`                                 // 招募数量
 	Offer             float64 `gorm:"column:offer"`                                          // 报价
 	TOffer            float64 `gorm:"column:t_offer"`                                        // 达人所见报价
-	ProjectID         int64    `gorm:"column:project_id"`                                     // 所属项目id
+	ProjectID         string   `gorm:"column:project_id"`                                     // 所属项目id
 	ServiceCharge     float64    `gorm:"column:service_charge"`                                 // 平台服务费,稿费形式为产品置换时必填
 	SelectedNumber    int64    `gorm:"column:selected_number;default:0"`                      // 已选数量,被企业选择的达人数量
 	WaitingNumber     int64    `gorm:"column:waiting_number;default:0"`                       // 待发货

+ 1 - 1
model/http_model/FeeDetailRequest.go

@@ -5,7 +5,7 @@ type FeeDetailRequest struct {
 }
 
 type FeeDetailData struct {
-	ProjectID   int64  `json:"project_id"`
+	ProjectID   string `json:"project_id"`
 	ProjectName string `json:"project_name"`
 	ProjectType string `json:"project_type"`
 	Payment     string `json:"payment"`

+ 1 - 1
model/http_model/data_accept.go

@@ -3,7 +3,7 @@ package http_model
 type AcceptDataRequest struct {
 	Payment   float64 `json:"payment"`      //招募策略id
 	TaskIds   string  `json:"task_id_list"` //任务id列表
-	ProjectId int64   `json:"project_id"`   //项目id
+	ProjectId string  `json:"project_id"`   //项目id
 }
 
 type AcceptDataData struct {

+ 1 - 1
model/http_model/data_number_info.go

@@ -1,7 +1,7 @@
 package http_model
 
 type GetDataNumberInfoRequest struct {
-	ProjectId   int64  `json:"project_id"`   // 项目id
+	ProjectId   string `json:"project_id"`   // 项目id
 	StrategyIds string `json:"strategy_ids"` // 招募策略id列表
 }
 

+ 1 - 1
model/http_model/default_number_info.go

@@ -1,7 +1,7 @@
 package http_model
 
 type GetDefaultNumberInfoRequest struct {
-	ProjectId   int64  `json:"project_id"`   // 项目id
+	ProjectId   string `json:"project_id"`   // 项目id
 	StrategyIds string `json:"strategy_ids"` // 招募策略id列表
 }
 

+ 1 - 1
model/http_model/finish_number.go

@@ -1,7 +1,7 @@
 package http_model
 
 type GetFinishNumberInfoRequest struct {
-	ProjectId   int64  `json:"project_id"`   // 项目id
+	ProjectId   string `json:"project_id"`   // 项目id
 	StrategyIds string `json:"strategy_ids"` // 招募策略id列表
 }
 

+ 1 - 1
model/http_model/full_project_list.go

@@ -13,7 +13,7 @@ type FullProjectListRequest struct {
 	ProjectUpdated     string `json:"project_updated"`      // 最后操作时间
 }
 type FullProjectPreview struct {
-	ProjectId          string `json:"project_id"`           // 项目ID
+	ProjectId          string `json:"project_id"`           //
 	ProjectName        string `json:"project_name"`         // 项目名
 	ProjectStatus      string `json:"project_status"`       // 项目状态
 	ProjectPlatform    string `json:"project_platform"`     // 项目平台

+ 1 - 1
model/http_model/link_number_info.go

@@ -1,7 +1,7 @@
 package http_model
 
 type GetLinkNumberInfoRequest struct {
-	ProjectId   int64  `json:"project_id"`   // 项目id
+	ProjectId   string `json:"project_id"`   // 项目id
 	StrategyIds string `json:"strategy_ids"` // 招募策略id列表
 }
 

+ 1 - 1
model/http_model/logistic_number_info.go

@@ -1,7 +1,7 @@
 package http_model
 
 type GetLogisticsNumberInfoRequest struct {
-	ProjectId   int64  `json:"project_id"`   // 项目id
+	ProjectId   string `json:"project_id"`   // 项目id
 	StrategyIds string `json:"strategy_ids"` // 招募策略id列表
 }
 

+ 6 - 6
model/http_model/product_find.go

@@ -12,14 +12,14 @@ type ProductPhoto struct {
 
 type FindProductData struct {
 	ProductID     int64          `json:"product_id"`
-	ProductName   string         `json:"product_name"`   // 商品名称
-	ProductType   int64          `json:"product_type"`   // 商品类型
-	ShopAddress   string         `json:"shop_address"`   // 店铺地址,商品类型为线下品牌时需填写
-	ProductPrice  float64        `json:"product_price"`  // 商品价值
-	ProductDetail string         `json:"product_detail"` // 商品详情
+	ProductName   string         `json:"product_name"`  // 商品名称
+	ProductType   int64          `json:"product_type"`  // 商品类型
+	ShopAddress   string         `json:"shop_address"`  // 店铺地址,商品类型为线下品牌时需填写
+	ProductPrice  float64        `json:"product_price"` // 商品价值
+	ProductDetail string         `json:"product_detail"`
 	ProductPhotos []ProductPhoto `json:"product_photos"` // 商品图片列表
 	ProductUrl    string         `json:"product_url"`    // 商品链接,可为电商网址、公司官网、大众点评的店铺地址等可以说明商品信息或者品牌信息的线上地址;
-	EnterpriseID  int64          `json:"enterprise_id"`  // 所属企业id
+	EnterpriseID  string         `json:"enterprise_id"`  // 所属企业id
 	BrandName     string         `json:"brand_name"`     // 品牌名称
 }
 

+ 1 - 1
model/http_model/project_create.go

@@ -32,7 +32,7 @@ type CreateProjectRequest struct {
 }
 
 type CreateProjectData struct {
-	ProjectID int64 `json:"Project_id"` // 项目id
+	ProjectID string `json:"Project_id"` // 项目id
 }
 
 func NewCreateProjectRequest() *CreateProjectRequest {

+ 2 - 2
model/http_model/project_delete.go

@@ -1,10 +1,10 @@
 package http_model
 
 type DeleteProjectRequest struct {
-	ProjectID int64 `json:"Project_id"` // 项目id
+	ProjectID string `json:"Project_id"` // 项目id
 }
 type DeleteProjectData struct {
-	ProjectID int64 `json:"Project_id"` // 项目id
+	ProjectID string `json:"Project_id"` // 项目id
 }
 
 func NewDeleteProjectRequest() *DeleteProjectRequest {

+ 1 - 1
model/http_model/project_show.go

@@ -51,7 +51,7 @@ type ShowProjectData struct {
 }
 
 type ShowProjectRequest struct {
-	ProjectID int64 `json:"Project_id"` // 项目id
+	ProjectID string `json:"Project_id"` // 项目id
 }
 
 func NewShowProjectRequest() *ShowProjectRequest {

+ 1 - 1
model/http_model/project_update.go

@@ -31,7 +31,7 @@ type UpdateProjectRequest struct {
 }
 
 type UpdateProjectData struct {
-	ProjectID int64 `json:"Project_id"` // 项目id
+	ProjectID string `json:"Project_id"` // 项目id
 }
 
 func NewUpdateProjectRequest() *UpdateProjectRequest {

+ 2 - 2
model/http_model/register.go

@@ -12,8 +12,8 @@ type RegisterRequest struct {
 }
 
 type RegisterData struct {
-	UserID       int64 `json:"user_id"`       // 用户id
-	EnterpriseId int64 `json:"enterprise_id"` // 企业id
+	UserID       int64  `json:"user_id"`       // 用户id
+	EnterpriseId string `json:"enterprise_id"` // 企业id
 }
 
 func NewRegisterRequest() *RegisterRequest {

+ 1 - 1
model/http_model/review_number_info.go

@@ -1,7 +1,7 @@
 package http_model
 
 type GetReviewNumberInfoRequest struct {
-	ProjectId   int64  `json:"project_id"`   // 项目id
+	ProjectId   string `json:"project_id"`   // 项目id
 	StrategyIds string `json:"strategy_ids"` // 招募策略id列表
 }
 

+ 1 - 1
model/redis_model/auth.go

@@ -10,5 +10,5 @@ type Auth struct {
 	Role         string `json:"role"`      // 角色 1,超级管理员; 2,管理员;3,企业用户
 	Email        string `json:"email"`     // 电子邮件
 	Token        string `json:"token"`
-	EnterpriseID int64  `json:"enterprise_id"`
+	EnterpriseID string `json:"enterprise_id"`
 }

+ 1 - 1
pack/full_project.go

@@ -20,7 +20,7 @@ func GormFullProjectToHttpFullProjectPreview(gormProjectInfo *gorm_model.Project
 	updatedTime := conv.MustString(gormProjectInfo.UpdatedAt)
 	updatedTime = updatedTime[0:19]
 	return &http_model.FullProjectPreview{
-		ProjectId:          conv.MustString(gormProjectInfo.ProjectID),
+		ProjectId:          gormProjectInfo.ProjectID,
 		ProjectName:        gormProjectInfo.ProjectName,
 		ProjectStatus:      consts.GetProjectStatus(gormProjectInfo.ProjectStatus),
 		ProjectPlatform:    consts.GetProjectPlatform(gormProjectInfo.ProjectPlatform),

+ 1 - 1
pack/get_finish_data.go

@@ -24,7 +24,7 @@ func MGormRecruitStrategyToHttpGetFinishDataInfo(RecruitStrategy *gorm_model.Rec
 		FollowersUp:     conv.MustString(RecruitStrategy.FollowersUp),
 		RecruitNumber:   conv.MustString(RecruitStrategy.RecruitNumber),
 		Offer:           conv.MustString(RecruitStrategy.Offer),
-		ProjectID:       conv.MustString(RecruitStrategy.ProjectID),
+		ProjectID:       RecruitStrategy.ProjectID,
 		ServiceCharge:   conv.MustString(RecruitStrategy.ServiceCharge),
 		SelectedNumber:  conv.MustString(RecruitStrategy.SelectedNumber),
 		WaitingNumber:   conv.MustString(RecruitStrategy.WaitingNumber),

+ 1 - 1
pack/special_task_data_list_condition.go

@@ -9,7 +9,7 @@ import (
 
 func HttpSpecialTaskDataListRequestToCondition(req *http_model.SpecialTaskDataListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:        conv.MustInt64(req.ProjectId),
+		ProjectId:        req.ProjectId,
 		DataStatus:       conv.MustInt64(req.DataStatus),
 		PlatformNickname: conv.MustString(req.PlatformNickname),
 	}

+ 1 - 1
pack/special_task_finishdata_list_condition.go

@@ -9,7 +9,7 @@ import (
 
 func HttpSpecialTaskFinishDataListRequestToCondition(req *http_model.SpecialTaskFinishDataListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:        conv.MustInt64(req.ProjectId),
+		ProjectId:        req.ProjectId,
 		PlatformNickname: conv.MustString(req.PlatformNickname),
 	}
 }

+ 1 - 1
pack/special_task_invite_list_condition.go

@@ -11,7 +11,7 @@ import (
 func HttpSpecialTaskInviteListRequestToCondition(req *http_model.SpecialTaskInviteListRequest) *common_model.TalentConditions {
 	fmt.Printf("初稿转换 %+v", req)
 	return &common_model.TalentConditions{
-		ProjectId:        conv.MustInt64(req.ProjectId),
+		ProjectId:        req.ProjectId,
 		TaskStatus:       conv.MustInt64(req.TaskStatus),
 		PlatformNickname: conv.MustString(req.PlatformNickname),
 	}

+ 1 - 1
pack/special_task_link_list_condition.go

@@ -9,7 +9,7 @@ import (
 
 func HttpSpecialTaskLinkListRequestToCondition(req *http_model.SpecialTaskLinkListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:        conv.MustInt64(req.ProjectId),
+		ProjectId:        req.ProjectId,
 		LinkStatus:       conv.MustInt64(req.LinkStatus),
 		PlatformNickname: conv.MustString(req.PlatformNickname),
 	}

+ 1 - 1
pack/special_task_script_list_condition.go

@@ -9,7 +9,7 @@ import (
 
 func HttpSpecialTaskScriptListRequestToCondition(req *http_model.SpecialTaskScriptListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:        conv.MustInt64(req.ProjectId),
+		ProjectId:        req.ProjectId,
 		ScriptStatus:     conv.MustInt64(req.ScriptStatus),
 		PlatformNickname: conv.MustString(req.PlatformNickname),
 	}

+ 1 - 1
pack/special_task_sketch_list_condition.go

@@ -9,7 +9,7 @@ import (
 
 func HttpSpecialTaskSketchListRequestToCondition(req *http_model.SpecialTaskSketchListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:        conv.MustInt64(req.ProjectId),
+		ProjectId:        req.ProjectId,
 		SketchStatus:     conv.MustInt64(req.SketchStatus),
 		PlatformNickname: conv.MustString(req.PlatformNickname),
 	}

+ 1 - 1
pack/task_data_list_conditions.go

@@ -11,7 +11,7 @@ import (
 func HttpTaskDataListRequestToCondition(req *http_model.TaskDataListRequest) *common_model.TalentConditions {
 	fmt.Printf("初稿转换 %+v", req)
 	return &common_model.TalentConditions{
-		ProjectId:  conv.MustInt64(req.ProjectId),
+		ProjectId:  req.ProjectId,
 		DataStatus: conv.MustInt64(req.DataStatus),
 		StrategyId: conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),

+ 4 - 4
pack/task_default_list_conditions.go

@@ -9,7 +9,7 @@ import (
 
 func HttpTaskDefaultReviewListRequestToCondition(req *http_model.TaskDefaultReviewListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:     conv.MustInt64(req.ProjectId),
+		ProjectId:     req.ProjectId,
 		DefaultStatus: conv.MustInt64(req.DefaultStatus),
 		StrategyId:    conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),
@@ -19,7 +19,7 @@ func HttpTaskDefaultReviewListRequestToCondition(req *http_model.TaskDefaultRevi
 
 func HttpTaskDefaultDataListRequestToCondition(req *http_model.TaskDefaultDataListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:     conv.MustInt64(req.ProjectId),
+		ProjectId:     req.ProjectId,
 		DefaultStatus: conv.MustInt64(req.DefaultStatus),
 		StrategyId:    conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),
@@ -29,7 +29,7 @@ func HttpTaskDefaultDataListRequestToCondition(req *http_model.TaskDefaultDataLi
 
 func HttpTaskTerminatingListRequestToCondition(req *http_model.TaskTerminatingListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:     conv.MustInt64(req.ProjectId),
+		ProjectId:     req.ProjectId,
 		DefaultStatus: conv.MustInt64(req.DefaultStatus),
 		StrategyId:    conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),
@@ -39,7 +39,7 @@ func HttpTaskTerminatingListRequestToCondition(req *http_model.TaskTerminatingLi
 
 func HttpTaskTerminatedListRequestToCondition(req *http_model.TaskTerminatedListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:     conv.MustInt64(req.ProjectId),
+		ProjectId:     req.ProjectId,
 		DefaultStatus: conv.MustInt64(req.DefaultStatus),
 		StrategyId:    conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),

+ 1 - 1
pack/task_finish_list_conditions.go

@@ -11,7 +11,7 @@ import (
 func HttpTaskFinishListRequestToCondition(req *http_model.TaskFinishListRequest) *common_model.TalentConditions {
 	fmt.Printf("初稿转换 %+v", req)
 	return &common_model.TalentConditions{
-		ProjectId:  conv.MustInt64(req.ProjectId),
+		ProjectId:  req.ProjectId,
 		StrategyId: conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),
 		PlatformNickname: conv.MustString(req.PlatformNickname),

+ 1 - 1
pack/task_link_list_conditions.go

@@ -11,7 +11,7 @@ import (
 func HttpTaskLinkListRequestToCondition(req *http_model.TaskLinkListRequest) *common_model.TalentConditions {
 	fmt.Printf("链接转换 %+v", req)
 	return &common_model.TalentConditions{
-		ProjectId:  conv.MustInt64(req.ProjectId),
+		ProjectId:  req.ProjectId,
 		LinkStatus: conv.MustInt64(req.LinkStatus),
 		StrategyId: conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),

+ 1 - 1
pack/task_logistics_list_conditions.go

@@ -9,7 +9,7 @@ import (
 
 func HttpTaskLogisticsListRequestToCondition(req *http_model.TaskLogisticsListRequest) *common_model.TalentConditions {
 	return &common_model.TalentConditions{
-		ProjectId:       conv.MustInt64(req.ProjectId),
+		ProjectId:       req.ProjectId,
 		LogisticsStatus: conv.MustInt64(req.LogisticsStatus),
 		StrategyId:      conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),

+ 1 - 1
pack/task_script_list_conditions.go

@@ -11,7 +11,7 @@ import (
 func HttpTaskScriptListRequestToCondition(req *http_model.TaskScriptListRequest) *common_model.TalentConditions {
 	fmt.Printf("%+v", req)
 	return &common_model.TalentConditions{
-		ProjectId:    conv.MustInt64(req.ProjectId),
+		ProjectId:    req.ProjectId,
 		ScriptStatus: conv.MustInt64(req.ScriptStatus),
 		StrategyId:   conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),

+ 1 - 1
pack/task_sketch_list_conditions.go

@@ -11,7 +11,7 @@ import (
 func HttpTaskSketchListRequestToCondition(req *http_model.TaskSketchListRequest) *common_model.TalentConditions {
 	fmt.Printf("初稿转换 %+v", req)
 	return &common_model.TalentConditions{
-		ProjectId:    conv.MustInt64(req.ProjectId),
+		ProjectId:    req.ProjectId,
 		SketchStatus: conv.MustInt64(req.SketchStatus),
 		StrategyId:   conv.MustInt64(req.StrategyId),
 		// TaskId:           conv.MustString(req.TaskId),

+ 13 - 0
service/enterprise.go

@@ -2,6 +2,8 @@ package service
 
 import (
 	"context"
+	"github.com/issue9/conv"
+	"math/rand"
 	"time"
 	"youngee_b_api/db"
 	"youngee_b_api/model/gorm_model"
@@ -31,7 +33,18 @@ func (*enterprise) CreateEnterpriseUser(ctx context.Context, newEnterprise http_
 		log.Infof("[CreateEnterpriseUser] fail,err:%+v", err)
 		return nil, err
 	} else {
+		rand.Seed(time.Now().UnixNano())
+		th := conv.MustString(time.Now().Hour())
+		tm := conv.MustString(time.Now().Minute())
+		if len(tm) < 2 {
+			tm = "0" + tm
+		}
+		if len(tm) < 2 {
+			th = "0" + th
+		}
+		ShowEnterpriseID := "1" + th + tm + conv.MustString(rand.Intn(10000-1000)+1000)
 		enterprise := &gorm_model.Enterprise{
+			EnterpriseID:     ShowEnterpriseID,
 			Industry:         newEnterprise.Industry,
 			BusinessName:     newEnterprise.BusinessName,
 			UserID:           *userId,

+ 1 - 1
service/logistics.go

@@ -147,7 +147,7 @@ func (*logistics) SignForReceipt(ctx *gin.Context, data http_model.SignForReceip
 		return err1
 	}
 	// 签收时更新任务阶段
-	project, err3 := db.GetProjectDetail(ctx, conv.MustInt64(*projectId))
+	project, err3 := db.GetProjectDetail(ctx, *projectId)
 	if err3 != nil {
 		logrus.WithContext(ctx).Errorf("[project service] call GetPorjectDetail error,err:%+v", err3)
 		return err3

+ 3 - 3
service/product.go

@@ -13,7 +13,7 @@ var Product *product
 type product struct {
 }
 
-func (*product) Create(ctx context.Context, newProduct http_model.CreateProductRequest, enterpriseID int64) (*http_model.CreateProductData, error) {
+func (*product) Create(ctx context.Context, newProduct http_model.CreateProductRequest, enterpriseID string) (*http_model.CreateProductData, error) {
 	product := gorm_model.YounggeeProduct{
 		ProductName:   newProduct.ProductName,
 		ProductType:   newProduct.ProductType,
@@ -50,7 +50,7 @@ func (*product) Create(ctx context.Context, newProduct http_model.CreateProductR
 	return res, nil
 }
 
-func (*product) Update(ctx context.Context, newProduct http_model.CreateProductRequest, enterpriseID int64) (*http_model.CreateProductData, error) {
+func (*product) Update(ctx context.Context, newProduct http_model.CreateProductRequest, enterpriseID string) (*http_model.CreateProductData, error) {
 	product := gorm_model.YounggeeProduct{
 		ProductID:     newProduct.ProductId,
 		ProductName:   newProduct.ProductName,
@@ -94,7 +94,7 @@ func (*product) Update(ctx context.Context, newProduct http_model.CreateProductR
 	return res, nil
 }
 
-func (*product) FindAll(ctx context.Context, enterpriseID int64) (*http_model.FindAllProductData, error) {
+func (*product) FindAll(ctx context.Context, enterpriseID string) (*http_model.FindAllProductData, error) {
 	products, err := db.GetProductByEnterpriseID(ctx, enterpriseID)
 	if err != nil {
 		// 数据库查询error

+ 34 - 21
service/project.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"encoding/json"
 	"fmt"
+	"math/rand"
 	"strconv"
 	"strings"
 	"time"
@@ -25,7 +26,7 @@ var Project *project
 type project struct {
 }
 
-func (*project) Create(ctx context.Context, newProject http_model.CreateProjectRequest, enterpriseID int64) (*http_model.CreateProjectData, error) {
+func (*project) Create(ctx context.Context, newProject http_model.CreateProjectRequest, enterpriseID string) (*http_model.CreateProjectData, error) {
 	// build gorm_model.ProjectInfo
 	// 查询关联商品信息
 	product, err := db.GetProductByID(ctx, newProject.ProductID)
@@ -35,7 +36,7 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
 	productPhotos, err := db.GetProductPhotoByProductID(ctx, newProject.ProductID)
 	productInfoToJson, _ := json.Marshal(product)
 	productPhotosToJson, _ := json.Marshal(productPhotos)
-	fmt.Println("productPhotosToJson:", productPhotosToJson)
+	//fmt.Println("productPhotosToJson:", productPhotosToJson)
 	AutoTaskID, err := db.GetLastAutoTaskID()
 	if err != nil {
 		return nil, err
@@ -67,9 +68,19 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
 	feeFroms := strings.Join(feeFrom, ",")
 	//fmt.Printf("创建项目new %+v", newProject)
 	RecruitDdl, _ := time.ParseInLocation("2006-01-02 15:04:05", newProject.RecruitDdl, time.Local)
+	fmt.Println("Create RecruitDdl:", newProject.RecruitDdl, RecruitDdl)
 	projectInfo := gorm_model.ProjectInfo{}
+	rand.Seed(time.Now().UnixNano())
+	td := conv.MustString(time.Now().Day())
+	for {
+		if len(td) == 3 {
+			break
+		}
+		td = "0" + td
+	}
 	if newProject.ProjectType == int64(1) {
 		projectInfo = gorm_model.ProjectInfo{
+			ProjectID:        conv.MustString(time.Now().Year())[2:] + td + conv.MustString(rand.Intn(100000-10000)+10000),
 			ProjectName:      projectName,
 			ProjectStatus:    1,
 			ProjectType:      newProject.ProjectType,
@@ -91,12 +102,14 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
 		}
 	} else {
 		projectInfo = gorm_model.ProjectInfo{
-			ProjectName:      projectName,
-			ProjectStatus:    1,
-			ProjectType:      newProject.ProjectType,
-			TalentType:       "[]",
-			ProjectPlatform:  newProject.ProjectPlatform,
-			ProjectForm:      newProject.ProjectForm,
+			ProjectID:       conv.MustString(time.Now().Year())[2:] + td + conv.MustString(rand.Intn(100000-10000)+10000),
+			ProjectName:     projectName,
+			ProjectStatus:   1,
+			ProjectType:     newProject.ProjectType,
+			TalentType:      "[]",
+			ProjectPlatform: newProject.ProjectPlatform,
+			ProjectForm:     newProject.ProjectForm,
+			//RecruitDdl:       &RecruitDdl,
 			ProjectDetail:    newProject.ProjectDetail,
 			ContentType:      newProject.ContentType,
 			EnterpriseID:     enterpriseID,
@@ -168,10 +181,10 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
 	//fmt.Printf("%+v", res)
 	return res, nil
 }
-func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectRequest, enterpriseID int64) (*http_model.UpdateProjectData, error) {
-	//fmt.Println("RecruitDdl:", newProject.RecruitDdl)
+func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectRequest, enterpriseID string) (*http_model.UpdateProjectData, error) {
 	RecruitDdl, _ := time.ParseInLocation("2006-01-02 15:04:05", newProject.RecruitDdl, time.Local)
-	oldProject, err3 := db.GetProjectDetail(ctx, conv.MustInt64(newProject.ProjectID))
+	fmt.Println("Update RecruitDdl:", newProject.RecruitDdl, RecruitDdl)
+	oldProject, err3 := db.GetProjectDetail(ctx, newProject.ProjectID)
 	if err3 != nil {
 		return nil, err3
 	}
@@ -196,7 +209,7 @@ func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectR
 	}
 	feeFroms := strings.Join(feeFrom, ",")
 	project := gorm_model.ProjectInfo{
-		ProjectID:     conv.MustInt64(newProject.ProjectID),
+		ProjectID:     newProject.ProjectID,
 		RecruitDdl:    &RecruitDdl,
 		TalentType:    newProject.TalentType,
 		ContentType:   conv.MustInt64(newProject.ContentType),
@@ -216,7 +229,7 @@ func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectR
 	if err != nil {
 		return nil, err
 	}
-	fmt.Printf("照片:\t %+v", newProject.ProjectPhotos)
+	//fmt.Printf("照片:\t %+v", newProject.ProjectPhotos)
 	if len(newProject.ProjectPhotos) != 0 {
 		// 新增图片
 		projectPhotos := []gorm_model.ProjectPhoto{}
@@ -238,8 +251,8 @@ func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectR
 	if err != nil {
 		return nil, err
 	}
-	//fmt.Printf("策略:\t %+v", newProject.RecruitStrategys)
-	if newProject.RecruitStrategys != nil {
+	fmt.Printf("策略:\t %+v", newProject.RecruitStrategys)
+	if newProject.RecruitStrategys != nil && newProject.ProjectType == int64(1) {
 		// 新增策略
 		RecruitStrategys := []gorm_model.RecruitStrategy{}
 		for _, Strategy := range newProject.RecruitStrategys {
@@ -264,7 +277,7 @@ func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectR
 				TOffer:        Strategy.TOffer,
 				ProjectID:     project.ProjectID,
 			}
-			fmt.Printf("Offer:\t %+v", Strategy.Offer)
+			//fmt.Printf("Offer:\t %+v", Strategy.Offer)
 			RecruitStrategys = append(RecruitStrategys, RecruitStrategy)
 		}
 		err = db.CreateRecruitStrategy(ctx, RecruitStrategys)
@@ -278,7 +291,7 @@ func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectR
 	return res, nil
 }
 
-func (*project) Delete(ctx context.Context, projectID int64) (*http_model.DeleteProjectData, error) {
+func (*project) Delete(ctx context.Context, projectID string) (*http_model.DeleteProjectData, error) {
 	// 删除该项目之前的所有图片
 	err := db.DeleteProjectPhotoByProjecttID(ctx, projectID)
 	if err != nil {
@@ -300,7 +313,7 @@ func (*project) Delete(ctx context.Context, projectID int64) (*http_model.Delete
 	return res, nil
 }
 
-func (*project) GetFullProjectList(ctx context.Context, enterpriseID int64, pageSize, pageNum int32, condition *common_model.ProjectCondition) (*http_model.FullProjectListData, error) {
+func (*project) GetFullProjectList(ctx context.Context, enterpriseID string, pageSize, pageNum int32, condition *common_model.ProjectCondition) (*http_model.FullProjectListData, error) {
 
 	fullProjects, total, err := db.GetFullProjectList(ctx, enterpriseID, pageSize, pageNum, condition)
 	if err != nil {
@@ -313,7 +326,7 @@ func (*project) GetFullProjectList(ctx context.Context, enterpriseID int64, page
 	return fullProjectListData, nil
 }
 
-func (*project) GetProjectDraftList(ctx context.Context, enterpriseID int64, pageSize, pageNum int32, condition *common_model.ProjectCondition) (*http_model.ProjectDraftListData, error) {
+func (*project) GetProjectDraftList(ctx context.Context, enterpriseID string, pageSize, pageNum int32, condition *common_model.ProjectCondition) (*http_model.ProjectDraftListData, error) {
 
 	ProjectDrafts, total, err := db.GetProjectDraftList(ctx, enterpriseID, pageSize, pageNum, condition)
 	if err != nil {
@@ -338,7 +351,7 @@ func (*project) GetProjectTaskList(ctx context.Context, projectID string, pageSi
 	return projectTaskListData, nil
 }
 
-func (*project) GetPorjectDetail(ctx context.Context, projectID int64) (*http_model.ShowProjectData, error) {
+func (*project) GetPorjectDetail(ctx context.Context, projectID string) (*http_model.ShowProjectData, error) {
 	project, err := db.GetProjectDetail(ctx, projectID)
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[project service] call GetPorjectDetail error,err:%+v", err)
@@ -380,7 +393,7 @@ func (*project) GetPorjectDetail(ctx context.Context, projectID int64) (*http_mo
 		ProductPhotoInfo: conv.MustString(project.ProductPhotoSnap),
 	}
 	Strategys, err := db.GetRecruitStrategys(ctx, projectID)
-	fmt.Println("招募策略:", Strategys)
+	//fmt.Println("招募策略:", Strategys)
 	if err != nil {
 		logrus.WithContext(ctx).Error()
 		return nil, err

+ 2 - 2
service/project_pay.go

@@ -14,7 +14,7 @@ var ProjectPay *projectPay
 type projectPay struct {
 }
 
-func (*projectPay) Pay(ctx context.Context, projectPay http_model.ProjectPayRequest, enterpriseID int64) (*int64, error) {
+func (*projectPay) Pay(ctx context.Context, projectPay http_model.ProjectPayRequest, enterpriseID string) (*int64, error) {
 	// 修改企业账户金额
 	balance, err := db.UpdateEnterpriseBalance(ctx, enterpriseID, 0, -projectPay.PaySum, projectPay.PaySum)
 	if err != nil {
@@ -37,7 +37,7 @@ func (*projectPay) Pay(ctx context.Context, projectPay http_model.ProjectPayRequ
 	}
 
 	// 支付更新任务状态
-	project, err2 := db.GetProjectDetail(ctx, conv.MustInt64(projectPay.ProjectID))
+	project, err2 := db.GetProjectDetail(ctx, projectPay.ProjectID)
 	if err2 != nil {
 		logrus.WithContext(ctx).Errorf("[project service] call GetPorjectDetail error,err:%+v", err)
 		return nil, err2

+ 2 - 2
service/user.go

@@ -16,7 +16,7 @@ type user struct {
 	EnterpriseID int64  //企业ID
 }
 
-func (*user) Update(ctx context.Context, newUser http_model.UpdateUserInfoRequest, ID int64, enterpriseID int64) error {
+func (*user) Update(ctx context.Context, newUser http_model.UpdateUserInfoRequest, ID int64, enterpriseID string) error {
 	_, err := db.UpdateUser(ctx, ID, newUser.Username, newUser.Email)
 	if err != nil {
 		return err
@@ -28,7 +28,7 @@ func (*user) Update(ctx context.Context, newUser http_model.UpdateUserInfoReques
 	return nil
 }
 
-func (*user) Find(ctx context.Context, EnterpriseID int64, ID int64) (*http_model.FindUserInfoData, error) {
+func (*user) Find(ctx context.Context, EnterpriseID string, ID int64) (*http_model.FindUserInfoData, error) {
 	enterprise, err := db.GetEnterpriseByEnterpriseID(ctx, EnterpriseID)
 	if err != nil {
 		return nil, err

+ 16 - 0
util/type.go

@@ -111,3 +111,19 @@ func RemoveRepByMap(slc []int64) []int64 {
 	}
 	return result
 }
+
+func RemoveStrRepByMap(slc []string) []string {
+	if len(slc) == 0 {
+		return slc
+	}
+	var result []string
+	tempMap := map[string]byte{} // 存放不重复主键
+	for _, e := range slc {
+		l := len(tempMap)
+		tempMap[e] = 0
+		if len(tempMap) != l { // 加入map后,map长度变化,则元素不重复
+			result = append(result, e)
+		}
+	}
+	return result
+}