yuliang1112 2 anni fa
parent
commit
0d489fd771

+ 17 - 0
db/enterprise.go

@@ -20,3 +20,20 @@ func GetEnterpriseByEnterpriseID(ctx context.Context, EnterpriseID int64) (*gorm
 	}
 	return &enterprise, nil
 }
+
+// 支付-修改企业账户余额
+func UpdateEnterpriseBalance(ctx context.Context, EnterpriseID int64, 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
+	if err != nil {
+		return nil, err
+	}
+	enterprise := gorm_model.Enterprise{}
+	err = db.Model(gorm_model.Enterprise{}).Where("enterprise_id", EnterpriseID).Scan(&enterprise).Error
+	if err != nil {
+		return nil, err
+	}
+
+	return &enterprise.Balance, nil
+}

+ 13 - 1
db/finish.go

@@ -15,7 +15,7 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
-func GetTaskFinishList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskFinishInfo, int64, error) {
+func GetTaskFinishList(ctx context.Context, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskFinishInfo, int64, error) {
 	db := GetReadDB(ctx)
 	// 查询Task表信息
 	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_stage = 15")
@@ -122,3 +122,15 @@ func GetTaskFinishList(ctx context.Context, projectID string, pageSize, pageNum
 	}
 	return newTaskFinishs, totalTask, nil
 }
+
+func GetFinishData(ctx context.Context, projectID int64) ([]*gorm_model.RecruitStrategy, error) {
+	finishRecruitStrategy := []*gorm_model.RecruitStrategy{}
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	err := db.Debug().Model(gorm_model.RecruitStrategy{}).Where("project_id = ?", projectID).Scan(&finishRecruitStrategy).Order("strategy_id").Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	return finishRecruitStrategy, nil
+}

+ 29 - 0
db/pay_record.go

@@ -0,0 +1,29 @@
+package db
+
+import (
+	"context"
+	"time"
+	"youngee_m_api/model/gorm_model"
+
+	"github.com/sirupsen/logrus"
+)
+
+// CreatePayRecord 新增
+func CreatePayRecord(ctx context.Context, enterpriseId int64, payment float64, balance float64, payType int64, projectId int64) (*int64, error) {
+	db := GetReadDB(ctx)
+	payRecord := gorm_model.EnterprisePayRecord{
+		EnterpriseID: enterpriseId,
+		Payment:      payment,
+		Balance:      balance,
+		PayType:      payType,
+		PayAt:        time.Now(),
+		ProjectID:    projectId,
+	}
+	err := db.Create(&payRecord).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics db] call CreatePayRecord error,err:%+v", err)
+		return nil, err
+	}
+
+	return &payRecord.ID, nil
+}

+ 12 - 0
db/project.go

@@ -6,6 +6,7 @@ import (
 	"github.com/caixw/lib.go/conv"
 	"github.com/sirupsen/logrus"
 	"gorm.io/gorm"
+	"log"
 	"reflect"
 	"strconv"
 	"time"
@@ -79,6 +80,17 @@ func GetProjectDetail(ctx context.Context, projectID int64) (*gorm_model.Project
 	return ProjectDetail, nil
 }
 
+func UpdateProjectStatus(ctx context.Context, projectId int64, status int64) error {
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.ProjectInfo{}).
+		Where("project_id = ?", projectId).Update("project_status", status).Error
+	if err != nil {
+		log.Println("DB UpdateProjectStatus error :", err)
+		return err
+	}
+	return nil
+}
+
 func GetRecruitStrategys(ctx context.Context, ProjectID int64) ([]gorm_model.RecruitStrategy, error) {
 	db := GetReadDB(ctx)
 	RecruitStrategys := []gorm_model.RecruitStrategy{}

+ 19 - 0
db/task.go

@@ -91,3 +91,22 @@ func UpdateTaskStage(ctx context.Context, projectID int64, taskStatus int64, tas
 	}
 	return nil
 }
+
+func UpdateTaskSelectAtByProjectId(ctx context.Context, projectID int64, taskStatus int64) error {
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("project_id=? and task_status = ?", projectID, taskStatus).Update("select_date", time.Now()).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[UpdateTaskStage]2 error query mysql total, err:%+v", err)
+		return err
+	}
+	return nil
+}
+func UpdateTaskStageByProjectId(ctx context.Context, projectID int64, taskStatus int64, taskStage int64) error {
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("project_id=? and task_status = ?", projectID, taskStatus).Update("task_stage", taskStage).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[UpdateTaskStage]2 error query mysql total, err:%+v", err)
+		return err
+	}
+	return nil
+}

+ 58 - 0
handler/get_finish_data.go

@@ -0,0 +1,58 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetFinishDataHandler(ctx *gin.Context) {
+	handler := newGetFinishDataHandler(ctx)
+	BaseRun(handler)
+}
+
+func newGetFinishDataHandler(ctx *gin.Context) *GetFinishDataHandler {
+	return &GetFinishDataHandler{
+		req:  http_model.NewGetFinishDataRequest(),
+		resp: http_model.NewGetFinishDataResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetFinishDataHandler struct {
+	req  *http_model.GetFinishDataRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetFinishDataHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *GetFinishDataHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetFinishDataHandler) getResponse() interface{} {
+	return h.resp
+}
+
+func (h *GetFinishDataHandler) run() {
+	data := http_model.GetFinishDataRequest{}
+	data = *h.req
+	res, err := service.Finish.GetFinishData(h.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetFinishDataHandler] call GetFinishData err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+		log.Info("GetFinishData fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Message = ""
+	h.resp.Data = res
+}
+
+func (h *GetFinishDataHandler) checkParam() error {
+	return nil
+}

+ 58 - 0
handler/logisitics_number_info.go

@@ -0,0 +1,58 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetLogisticsNumberInfoHandler(ctx *gin.Context) {
+	handler := newGetLogisticsNumberInfoHandler(ctx)
+	BaseRun(handler)
+}
+
+func newGetLogisticsNumberInfoHandler(ctx *gin.Context) *GetLogisticsNumberInfoHandler {
+	return &GetLogisticsNumberInfoHandler{
+		req:  http_model.NewGetLogisticsNumberInfoRequest(),
+		resp: http_model.NewGetLogisticsNumberInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetLogisticsNumberInfoHandler struct {
+	req  *http_model.GetLogisticsNumberInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetLogisticsNumberInfoHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *GetLogisticsNumberInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetLogisticsNumberInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+
+func (h *GetLogisticsNumberInfoHandler) run() {
+	data := http_model.GetLogisticsNumberInfoRequest{}
+	data = *h.req
+	res, err := service.Number.GetLogisticsNumberInfo(h.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetLogisticsNumberInfoHandler] call GetLogisticsNumberInfo err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+		log.Info("GetLogisticsNumberInfo fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Message = ""
+	h.resp.Data = res
+}
+
+func (h *GetLogisticsNumberInfoHandler) checkParam() error {
+	return nil
+}

+ 54 - 0
handler/project_pay.go

@@ -0,0 +1,54 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapProjectPayHandler(ctx *gin.Context) {
+	handler := newProjectPayHandler(ctx)
+	BaseRun(handler)
+}
+
+func newProjectPayHandler(ctx *gin.Context) *ProjectPayHandler {
+	return &ProjectPayHandler{
+		req:  http_model.NewProjectPayRequest(),
+		resp: http_model.NewProjectPayResponse(),
+		ctx:  ctx,
+	}
+}
+
+type ProjectPayHandler struct {
+	req  *http_model.ProjectPayRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *ProjectPayHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *ProjectPayHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *ProjectPayHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *ProjectPayHandler) run() {
+	enterpriseID := h.req.EnterpriseId
+	data := http_model.ProjectPayRequest{}
+	data = *h.req
+	record, err := service.ProjectPay.Pay(h.ctx, data, enterpriseID)
+	if err != nil {
+		logrus.WithContext(h.ctx).Errorf("[ProjectPayHandler] error Pay, err:%+v", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, consts.DefaultToast)
+		return
+	}
+	h.resp.Data = record
+}
+func (h *ProjectPayHandler) checkParam() error {
+	return nil
+}

+ 21 - 0
model/gorm_model/pay_record.go

@@ -0,0 +1,21 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package gorm_model
+
+import (
+	"time"
+)
+
+type EnterprisePayRecord struct {
+	ID           int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"` // id
+	Payment      float64   `gorm:"column:payment;NOT NULL"`              // 交易金额
+	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
+	PayAt        time.Time `gorm:"column:pay_at;NOT NULL"`               // 交易时间
+	ProjectID    int64     `gorm:"column:project_id"`                    // 支付的项目id
+}
+
+func (m *EnterprisePayRecord) TableName() string {
+	return "enterprise_pay_record"
+}

+ 43 - 0
model/http_model/get_finish_data.go

@@ -0,0 +1,43 @@
+package http_model
+
+type GetFinishDataRequest struct {
+	ProjectId string `json:"project_id"` // 项目id
+}
+
+type GetFinishDataInfo struct {
+	FeeForm         string `json:"fee_form"`         // 稿费形式,1-3分别代表产品置换、固定稿费、自报价
+	StrategyID      string `json:"strategy_id"`      // 策略id
+	FollowersLow    string `json:"followers_low"`    // 达人粉丝数下限
+	FollowersUp     string `json:"followers_up"`     // 达人粉丝数上限
+	RecruitNumber   string `json:"recruit_number"`   // 招募数量
+	Offer           string `json:"offer"`            // 报价
+	ProjectID       string `json:"project_id"`       // 所属项目id
+	ServiceCharge   string `json:"service_charge"`   // 平台服务费,稿费形式为产品置换时必填
+	SelectedNumber  string `json:"selected_number"`  // 已选数量,被企业选择的达人数量
+	WaitingNumber   string `json:"waiting_number"`   // 待发货
+	DeliveredNumber string `json:"delivered_number"` // 已发货
+	SignedNumber    string `json:"signed_number"`    // 已签收
+	MaxOffer        string `json:"max_offer"`        // 报价上限
+	MinOffer        string `json:"min_offer"`        // 报价下限
+	FanNumber       string `json:"fan_number"`       // 总粉丝量
+	PlayNumber      string `json:"play_number"`      // 总播放量
+	LikeNumber      string `json:"like_number"`      // 总点赞数
+	CollectNumber   string `json:"collect_number"`   // 总收藏量
+	CommentNumber   string `json:"comment_number"`   // 总评论数
+	FinishNumber    string `json:"finish_number"`    // 结案数量
+	TotalOffer      string `json:"total_offer"`      // 支付合计
+
+}
+
+type GetFinishData struct {
+	FinishRecruitStrategy []*GetFinishDataInfo `json:"finish_recruit_strategys"`
+}
+
+func NewGetFinishDataRequest() *GetFinishDataRequest {
+	return new(GetFinishDataRequest)
+}
+func NewGetFinishDataResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetFinishData)
+	return resp
+}

+ 20 - 0
model/http_model/project_pay.go

@@ -0,0 +1,20 @@
+package http_model
+
+type ProjectPayRequest struct {
+	ProjectID    string  `json:"project_id"`
+	PaySum       float64 `json:"pay_sum"`
+	EnterpriseId int64   `json:"enterprise_id"`
+}
+
+type ProjectPayData struct {
+	RecordId int64 `json:"record_id"`
+}
+
+func NewProjectPayRequest() *ProjectPayRequest {
+	return new(ProjectPayRequest)
+}
+func NewProjectPayResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(ProjectPayData)
+	return resp
+}

+ 16 - 13
model/http_model/task_finish.go

@@ -1,6 +1,7 @@
 package http_model
 
 import (
+	"time"
 	"youngee_m_api/model/gorm_model"
 )
 
@@ -26,23 +27,25 @@ type TaskFinishPreview struct {
 	CollectNumber     int     `json:"collect_number"`      // 收藏数
 	PhotoUrl          string  `json:"photo_url"`           // 数据截图url
 	RealPayment       float64 `json:"real_payment"`        // 企业实际支付(扣除违约扣款)
+	SubmitAt          string  `json:"submit_at"`           // 提交时间
 	LinkUrl           string  `json:"link_url"`            // 上传链接url
 }
 
 type TaskFinishInfo struct {
-	TaskID            int     `json:"task_id"`             // 任务ID
-	PlatformNickname  string  `json:"platform_nickname"`   // 账号昵称
-	FansCount         string  `json:"fans_count"`          // 粉丝数
-	RecruitStrategyID int     `json:"recruit_strategy_id"` // 招募策略ID
-	StrategyID        int     `json:"strategy_id"`         // 报名选择的招募策略id
-	DataId            int     `json:"data_id"`             // 数据ID
-	PlayNumber        int     `json:"play_number"`         // 播放量/阅读量
-	LikeNumber        int     `json:"like_number"`         // 点赞数
-	CommentNumber     int     `json:"comment_number"`      // 评论数
-	CollectNumber     int     `json:"collect_number"`      // 收藏数
-	PhotoUrl          string  `json:"photo_url"`           // 数据截图url
-	RealPayment       float64 `json:"real_payment"`        // 企业实际支付(扣除违约扣款)
-	LinkUrl           string  `json:"link_url"`            // 上传链接url
+	TaskID            int       `json:"task_id"`             // 任务ID
+	PlatformNickname  string    `json:"platform_nickname"`   // 账号昵称
+	FansCount         string    `json:"fans_count"`          // 粉丝数
+	RecruitStrategyID int       `json:"recruit_strategy_id"` // 招募策略ID
+	StrategyID        int       `json:"strategy_id"`         // 报名选择的招募策略id
+	DataId            int       `json:"data_id"`             // 数据ID
+	PlayNumber        int       `json:"play_number"`         // 播放量/阅读量
+	LikeNumber        int       `json:"like_number"`         // 点赞数
+	CommentNumber     int       `json:"comment_number"`      // 评论数
+	CollectNumber     int       `json:"collect_number"`      // 收藏数
+	PhotoUrl          string    `json:"photo_url"`           // 数据截图url
+	RealPayment       float64   `json:"real_payment"`        // 企业实际支付(扣除违约扣款)
+	LinkUrl           string    `json:"link_url"`            // 上传链接url
+	SubmitAt          time.Time `json:"submit_at"`           // 提交时间
 }
 
 type TaskFinish struct {

+ 42 - 0
pack/get_finish_data.go

@@ -0,0 +1,42 @@
+package pack
+
+import (
+	"github.com/caixw/lib.go/conv"
+	"youngee_m_api/model/gorm_model"
+	"youngee_m_api/model/http_model"
+)
+
+func MGormRecruitStrategyListToHttpGetFinishDataInfoList(gormRecruitStrategys []*gorm_model.RecruitStrategy) []*http_model.GetFinishDataInfo {
+	var httpGetFinishDataInfos []*http_model.GetFinishDataInfo
+	for _, gormRecruitStrategy := range gormRecruitStrategys {
+		httpGetFinishDataInfo := MGormRecruitStrategyToHttpGetFinishDataInfo(gormRecruitStrategy)
+		httpGetFinishDataInfos = append(httpGetFinishDataInfos, httpGetFinishDataInfo)
+	}
+	return httpGetFinishDataInfos
+}
+
+func MGormRecruitStrategyToHttpGetFinishDataInfo(RecruitStrategy *gorm_model.RecruitStrategy) *http_model.GetFinishDataInfo {
+	return &http_model.GetFinishDataInfo{
+		FeeForm:         conv.MustString(RecruitStrategy.FeeForm, ""),
+		StrategyID:      conv.MustString(RecruitStrategy.StrategyID, ""),
+		FollowersLow:    conv.MustString(RecruitStrategy.FollowersLow, ""),
+		FollowersUp:     conv.MustString(RecruitStrategy.FollowersUp, ""),
+		RecruitNumber:   conv.MustString(RecruitStrategy.RecruitNumber, ""),
+		Offer:           conv.MustString(RecruitStrategy.Offer, ""),
+		ProjectID:       conv.MustString(RecruitStrategy.ProjectID, ""),
+		ServiceCharge:   conv.MustString(RecruitStrategy.ServiceCharge, ""),
+		SelectedNumber:  conv.MustString(RecruitStrategy.SelectedNumber, ""),
+		WaitingNumber:   conv.MustString(RecruitStrategy.WaitingNumber, ""),
+		DeliveredNumber: conv.MustString(RecruitStrategy.DeliveredNumber, ""),
+		SignedNumber:    conv.MustString(RecruitStrategy.SignedNumber, ""),
+		MaxOffer:        conv.MustString(RecruitStrategy.MaxOffer, ""),
+		MinOffer:        conv.MustString(RecruitStrategy.MinOffer, ""),
+		FanNumber:       conv.MustString(RecruitStrategy.FanNumber, ""),
+		PlayNumber:      conv.MustString(RecruitStrategy.PlayNumber, ""),
+		LikeNumber:      conv.MustString(RecruitStrategy.LikeNumber, ""),
+		CollectNumber:   conv.MustString(RecruitStrategy.CollectNumber, ""),
+		CommentNumber:   conv.MustString(RecruitStrategy.CommentNumber, ""),
+		FinishNumber:    conv.MustString(RecruitStrategy.FinishNumber, ""),
+		TotalOffer:      conv.MustString(RecruitStrategy.TotalOffer, ""),
+	}
+}

+ 3 - 4
pack/task_finish_list_conditions.go

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

+ 29 - 26
route/init.go

@@ -42,6 +42,7 @@ func InitRoute(r *gin.Engine) {
 		m.POST("/product/create", handler.WrapCreateProductHandler)
 		m.POST("/product/find", handler.WrapFindProductHandler)
 		m.POST("/pay/paysum", handler.WrapPaySumHandler)
+		m.POST("/pay/projectpay", handler.WrapProjectPayHandler) // 支付
 		m.POST("/project/update", handler.WrapUpdateProjectHandler)
 		m.POST("/project/approve", handler.WrapApproveProjectHandler)
 		m.POST("/project/all", handler.WrapGetAllProjectHandler)
@@ -51,32 +52,34 @@ func InitRoute(r *gin.Engine) {
 		m.POST("/project/getdatanumberinfo", handler.WrapGetDataNumberInfoHandler)
 		m.POST("/project/getreviewnumberinfo", handler.WrapGetReviewNumberInfoHandler)
 		m.POST("/project/getdefaultnumberinfo", handler.WrapGetDefaultNumberInfoHandler)
-		m.POST("/project/tasklogisticslist", handler.WrapTaskLogisticsListHandler)         // 物流信息查询
-		m.POST("/project/createlogistics", handler.WrapCreateLogisticsHandler)             // 创建物流信息
-		m.POST("/project/signforreceipt", handler.WrapSignForReceiptHandler)               // 签收订单
-		m.POST("/project/taskscriptlist", handler.WrapTaskScriptListHandler)               // 查询脚本列表
-		m.POST("/project/scriptopinion", handler.WrapScriptOpinionHandler)                 // 脚本审核意见提交
-		m.POST("/project/acceptscript", handler.WrapAcceptScriptHandler)                   // 同意脚本
-		m.POST("/project/tasksketchlist", handler.WrapTaskSketchListHandler)               // 查询初稿列表
-		m.POST("/project/findsketchphoto", handler.WrapFindSketchPhotoHandler)             // 查询脚本配图和视频demo
-		m.POST("/project/sketchopinion", handler.WrapSketchOpinionHandler)                 // 脚本审核意见提交
-		m.POST("/project/acceptsketch", handler.WrapAcceptSketchHandler)                   // 同意脚本
-		m.POST("/project/tasklinklist", handler.WrapTaskLinkListHandler)                   // 查询链接列表
-		m.POST("/project/linkopinion", handler.WrapLinkOpinionHandler)                     // 链接审核意见提交
-		m.POST("/project/acceptlink", handler.WrapAcceptLinkHandler)                       // 同意链接
-		m.POST("/project/taskdatalist", handler.WrapTaskDataListHandler)                   // 查询数据列表
-		m.POST("/project/dataopinion", handler.WrapDataOpinionHandler)                     // 数据审核意见提交
-		m.POST("/project/acceptdata", handler.WrapAcceptDataHandler)                       // 同意数据
-		m.POST("/project/taskdefaultreviewlist", handler.WrapTaskDefaultReviewListHandler) // 查询违约列表-脚本、初稿、链接上传违约
-		m.POST("/project/taskdefaultdatalist", handler.WrapTaskDefaultDataListHandler)     // 查询违约列表-数据违约
-		m.POST("/project/taskteminatinglist", handler.WrapTaskTerminatingListHandler)      // 查询违约列表-解约待处理
-		m.POST("/project/taskteminatedlist", handler.WrapTaskTerminatedListHandler)        // 查询违约列表-解约
-		m.POST("/project/taskteminate", handler.WrapTaskTerminateHandler)                  // 解约
-		m.POST("/project/getsketchinfo", handler.WrapGetSketchInfoHandler)                 // 获取初稿
-		m.POST("/project/taskfinishlist", handler.WrapTaskFinishListHandler)               // 查询违约列表-数据违约
-		m.POST("/project/getfinishnumberinfo", handler.WrapGetFinishNumberInfoHandler)     // 获取结案数量
-		m.POST("/project/getProduceRecords", handler.WrapGetProjectRecordsHandler)         // 获取项目记录
-		m.POST("/project/recruit/getservicecharge", handler.WrapGetServiceChargeHandler)   // 获取产品置换服务费
+		m.POST("/project/tasklogisticslist", handler.WrapTaskLogisticsListHandler)           // 物流信息查询
+		m.POST("/project/createlogistics", handler.WrapCreateLogisticsHandler)               // 创建物流信息
+		m.POST("/project/signforreceipt", handler.WrapSignForReceiptHandler)                 // 签收订单
+		m.POST("/project/taskscriptlist", handler.WrapTaskScriptListHandler)                 // 查询脚本列表
+		m.POST("/project/scriptopinion", handler.WrapScriptOpinionHandler)                   // 脚本审核意见提交
+		m.POST("/project/acceptscript", handler.WrapAcceptScriptHandler)                     // 同意脚本
+		m.POST("/project/tasksketchlist", handler.WrapTaskSketchListHandler)                 // 查询初稿列表
+		m.POST("/project/findsketchphoto", handler.WrapFindSketchPhotoHandler)               // 查询脚本配图和视频demo
+		m.POST("/project/sketchopinion", handler.WrapSketchOpinionHandler)                   // 脚本审核意见提交
+		m.POST("/project/acceptsketch", handler.WrapAcceptSketchHandler)                     // 同意脚本
+		m.POST("/project/tasklinklist", handler.WrapTaskLinkListHandler)                     // 查询链接列表
+		m.POST("/project/linkopinion", handler.WrapLinkOpinionHandler)                       // 链接审核意见提交
+		m.POST("/project/acceptlink", handler.WrapAcceptLinkHandler)                         // 同意链接
+		m.POST("/project/taskdatalist", handler.WrapTaskDataListHandler)                     // 查询数据列表
+		m.POST("/project/dataopinion", handler.WrapDataOpinionHandler)                       // 数据审核意见提交
+		m.POST("/project/acceptdata", handler.WrapAcceptDataHandler)                         // 同意数据
+		m.POST("/project/taskdefaultreviewlist", handler.WrapTaskDefaultReviewListHandler)   // 查询违约列表-脚本、初稿、链接上传违约
+		m.POST("/project/taskdefaultdatalist", handler.WrapTaskDefaultDataListHandler)       // 查询违约列表-数据违约
+		m.POST("/project/taskteminatinglist", handler.WrapTaskTerminatingListHandler)        // 查询违约列表-解约待处理
+		m.POST("/project/taskteminatedlist", handler.WrapTaskTerminatedListHandler)          // 查询违约列表-解约
+		m.POST("/project/taskteminate", handler.WrapTaskTerminateHandler)                    // 解约
+		m.POST("/project/getsketchinfo", handler.WrapGetSketchInfoHandler)                   // 获取初稿
+		m.POST("/project/taskfinishlist", handler.WrapTaskFinishListHandler)                 // 查询违约列表-数据违约
+		m.POST("/project/getfinishnumberinfo", handler.WrapGetFinishNumberInfoHandler)       // 获取结案数量
+		m.POST("/project/getProduceRecords", handler.WrapGetProjectRecordsHandler)           // 获取项目记录
+		m.POST("/project/recruit/getservicecharge", handler.WrapGetServiceChargeHandler)     // 获取产品置换服务费
+		m.POST("/project/getlogisticsnumberinfo", handler.WrapGetLogisticsNumberInfoHandler) // 获取物流数量
+		m.POST("/project/getfinishdata", handler.WrapGetFinishDataHandler)                   // 获取结案信息
 	}
 	u := r.Group("/youngee/m/user")
 	{

+ 29 - 0
service/finish.go

@@ -0,0 +1,29 @@
+package service
+
+import (
+	"context"
+	"github.com/caixw/lib.go/conv"
+	"youngee_m_api/db"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/pack"
+
+	"github.com/sirupsen/logrus"
+)
+
+var Finish *finish
+
+type finish struct {
+}
+
+// GetFinishData FinishOpinion 在上传脚本表上提交修改意见
+func (*finish) GetFinishData(ctx context.Context, request http_model.GetFinishDataRequest) (*http_model.GetFinishData, error) {
+	finishRecruitStrategyList, err := db.GetFinishData(ctx, conv.MustInt64(request.ProjectId, 0))
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Finish service] call CreateFinish error,err:%+v", err)
+		return nil, err
+	}
+
+	res := new(http_model.GetFinishData)
+	res.FinishRecruitStrategy = pack.MGormRecruitStrategyListToHttpGetFinishDataInfoList(finishRecruitStrategyList)
+	return res, nil
+}

+ 15 - 0
service/number_info.go

@@ -89,3 +89,18 @@ func (*number) GetFinishNumberInfo(ctx context.Context, request http_model.GetFi
 
 	return NumberData, nil
 }
+
+func (*number) GetLogisticsNumberInfo(ctx context.Context, request http_model.GetLogisticsNumberInfoRequest) (*http_model.GetLogisticsNumberInfoData, error) {
+	var StrategyIdList []int64
+	StrategyIds := strings.Split(request.StrategyIds, ",")
+	for _, strategyId := range StrategyIds {
+		StrategyIdList = append(StrategyIdList, conv.MustInt64(strategyId, 0))
+	}
+	NumberData, err := db.GetLogisticsNumberInfo(ctx, request.ProjectId, StrategyIdList)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Data service] call CreateData error,err:%+v", err)
+		return nil, err
+	}
+
+	return NumberData, nil
+}

+ 1 - 1
service/project.go

@@ -561,7 +561,7 @@ func (p *project) GetTaskDataList(ctx *gin.Context, projectID string, pageSize,
 }
 
 func (p *project) GetTaskFinishList(ctx *gin.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) (*http_model.TaskFinishListData, error) {
-	TaskFinishs, total, err := db.GetTaskFinishList(ctx, projectID, pageSize, pageNum, conditions)
+	TaskFinishs, total, err := db.GetTaskFinishList(ctx, pageSize, pageNum, conditions)
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[project service] call GetTaskFinishList error,err:%+v", err)
 		return nil, err

+ 50 - 0
service/project_pay.go

@@ -0,0 +1,50 @@
+package service
+
+import (
+	"context"
+	"github.com/caixw/lib.go/conv"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/db"
+	"youngee_m_api/model/http_model"
+)
+
+var ProjectPay *projectPay
+
+type projectPay struct {
+}
+
+func (*projectPay) Pay(ctx context.Context, projectPay http_model.ProjectPayRequest, enterpriseID int64) (*int64, error) {
+	// 修改企业账户金额
+	balance, err := db.UpdateEnterpriseBalance(ctx, enterpriseID, 0, -projectPay.PaySum, projectPay.PaySum)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateEnterpriseBalance error,err:%+v", err)
+		return nil, err
+	}
+
+	// 修改项目状态为执行中
+	err = db.UpdateProjectStatus(ctx, conv.MustInt64(projectPay.ProjectID, 0), 9)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateEnterpriseBalance error,err:%+v", err)
+		return nil, err
+	}
+
+	// 插入支付记录
+	recordId, err1 := db.CreatePayRecord(ctx, enterpriseID, projectPay.PaySum, *balance, 2, conv.MustInt64(projectPay.ProjectID, 0))
+	if err1 != nil {
+		logrus.WithContext(ctx).Errorf("[projectPay service] call CreatePayRecord error,err:%+v", err)
+		return nil, err1
+	}
+
+	// 支付更新任务状态
+	err = db.UpdateTaskSelectAtByProjectId(ctx, conv.MustInt64(projectPay.ProjectID, 0), 2)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateTaskStatusPaying error,err:%+v", err)
+		return nil, err
+	}
+	err = db.UpdateTaskStageByProjectId(ctx, conv.MustInt64(projectPay.ProjectID, 0), 2, 4)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateTaskStatusPaying error,err:%+v", err)
+		return nil, err
+	}
+	return recordId, nil
+}