Browse Source

添加接口

“liushuai” 2 years ago
parent
commit
82a4f30f6d

+ 135 - 0
db/Settle.go

@@ -0,0 +1,135 @@
+package db
+
+import (
+	"context"
+	"fmt"
+	"github.com/issue9/conv"
+	"github.com/sirupsen/logrus"
+	"reflect"
+	"strings"
+	"youngee_b_api/model/common_model"
+	"youngee_b_api/model/gorm_model"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/pack"
+	"youngee_b_api/util"
+)
+
+// GetSpecialTaskSettleList 专项任务-查询上传链接的task list
+func GetSpecialTaskSettleList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskSettleInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+
+		if tag == "settle_status" {
+			fmt.Printf("Data %+v", value.Interface() == int64(0))
+			if value.Interface() == int64(0) {
+				db = db.Where("task_stage = 15 and settle_status = 1")
+			} else {
+				db = db.Where("task_stage = 15 and settle_status = 2")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskSettleList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+
+	// 查询链接
+	db1 := GetReadDB(ctx)
+	// db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
+	var LinkInfos []gorm_model.YounggeeLinkInfo
+	db1 = db1.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_submit= 1 AND is_ok = 1", taskIds)
+	err := db1.Find(&LinkInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
+	for _, LinkInfo := range LinkInfos {
+		LinkMap[LinkInfo.TaskID] = LinkInfo
+	}
+
+	// 查询数据
+	db2 := GetReadDB(ctx)
+	var DataInfos []gorm_model.YounggeeDataInfo
+	db2 = db2.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_submit= 1 AND is_ok = 1", taskIds)
+	err = db2.Find(&DataInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
+	for _, DataInfo := range DataInfos {
+		DataMap[DataInfo.TaskID] = DataInfo
+	}
+	// 查询总数
+	var totalData int64
+	if err := db2.Count(&totalData).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskSettleList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskSettles []*http_model.SpecialTaskSettle
+	var taskSettles []*http_model.SpecialTaskSettleInfo
+	var newTaskSettles []*http_model.SpecialTaskSettleInfo
+	for _, taskId := range taskIds {
+		TaskSettle := new(http_model.SpecialTaskSettle)
+		TaskSettle.Talent = taskMap[taskId]
+		TaskSettle.Data = DataMap[taskId]
+		TaskSettle.Link = LinkMap[taskId]
+		TaskSettles = append(TaskSettles, TaskSettle)
+	}
+
+	taskSettles = pack.SpecialTaskSettleToTaskInfo(TaskSettles)
+
+	for _, v := range taskSettles {
+		if platform_nickname == "" {
+			newTaskSettles = append(newTaskSettles, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskSettles = append(newTaskSettles, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskSettles = append(newTaskSettles, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskSettles, totalTask, nil
+}

+ 94 - 2
db/logistics.go

@@ -18,7 +18,7 @@ import (
 	"github.com/tidwall/gjson"
 )
 
-//新增
+// 新增
 func CreateLogistics(ctx context.Context, logistics gorm_model.YoungeeTaskLogistics, RecruitStrategyID int64) (*int64, error) {
 	db := GetReadDB(ctx)
 	err := db.Create(&logistics).Error
@@ -30,7 +30,7 @@ func CreateLogistics(ctx context.Context, logistics gorm_model.YoungeeTaskLogist
 	return &logistics.LogisticsID, nil
 }
 
-//修改接口
+// 修改接口
 func UpdateLogistics(ctx context.Context, logistics gorm_model.YoungeeTaskLogistics) (*int64, error) {
 	db := GetReadDB(ctx)
 	err := db.Model(&logistics).Where("task_id = ?", logistics.TaskID).Updates(logistics).Error
@@ -182,3 +182,95 @@ func GetRegion(ctx context.Context, regionCode int) string {
 	db4.Debug().Model(gorm_model.InfoRegion{}).Where("self_code = ?", conv.MustInt(cityCode, 0)).First(&city)
 	return province.RegionName + city.RegionName + infoRegion.RegionName
 }
+
+// GetSpecialTaskLogisticsList 查询专项包含物流信息的task list
+func GetSpecialTaskLogisticsList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskLogisticsInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and project_id = ?", projectID)
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platformNickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platformNickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialTaskLogisticsList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YoungeeTaskLogistics{})
+
+	var logisticsInfos []gorm_model.YoungeeTaskLogistics
+	db1 = db1.Model(gorm_model.YoungeeTaskLogistics{}).Where("task_id IN ?", taskIds).Find(&logisticsInfos)
+	logisticsMap := make(map[string]gorm_model.YoungeeTaskLogistics)
+	for _, logisticsInfo := range logisticsInfos {
+		logisticsMap[logisticsInfo.TaskID] = logisticsInfo
+	}
+	// 查询总数
+	var totalLogistics int64
+	if err := db1.Count(&totalLogistics).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialTaskLogisticsList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialTaskLogisticsList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskLogisticss []*http_model.SpecialTaskLogistics
+	var taskLogisticss []*http_model.SpecialTaskLogisticsInfo
+	var newTaskLogisticss []*http_model.SpecialTaskLogisticsInfo
+	for _, taskId := range taskIds {
+		TaskLogistics := new(http_model.SpecialTaskLogistics)
+		TaskLogistics.Talent = taskMap[taskId]
+		TaskLogistics.Logistics = logisticsMap[taskId]
+		TalentPostAddrSnap := TaskLogistics.Talent.TalentPostAddrSnap
+		regionCode, _ := strconv.Atoi(conv.MustString(gjson.Get(TalentPostAddrSnap, "region_code"), ""))
+		TaskLogistics.Region = GetRegion(ctx, regionCode)
+		TaskLogisticss = append(TaskLogisticss, TaskLogistics)
+	}
+	taskLogisticss = pack.SpecialTaskLogisticsToTaskInfo(TaskLogisticss)
+
+	for _, v := range taskLogisticss {
+		if platformNickname == "" {
+			newTaskLogisticss = append(newTaskLogisticss, v)
+		} else if strings.Contains(v.PlatformNickname, platformNickname) {
+			newTaskLogisticss = append(newTaskLogisticss, v)
+		} else if strings.Contains(v.TaskID, platformNickname) {
+			newTaskLogisticss = append(newTaskLogisticss, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskLogisticss, totalTask, nil
+}

+ 52 - 0
db/number_info.go

@@ -314,3 +314,55 @@ func GetSpecialDataNumber(ctx context.Context, projectId string) (*http_model.Ge
 	}
 	return &specialDataNumber, nil
 }
+
+func GetSpecialLogisticNumber(ctx context.Context, projectId string) (*http_model.GetSpecialLogisticNumberData, error) {
+	var specialLogisticNumberData http_model.GetSpecialLogisticNumberData
+	db := GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_stage != 3", projectId)
+	err := db.Where("task_status = 2").Count(&specialLogisticNumberData.DeliverNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialLogisticNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	db = GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2", projectId)
+	err = db.Where("logistics_status = 3").Count(&specialLogisticNumberData.SignedNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialLogisticNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	db = GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2", projectId)
+	err = db.Where("logistics_status = 1").Count(&specialLogisticNumberData.UndeliveredNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialLogisticNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	db = GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2", projectId)
+	err = db.Where("logistics_status = 2").Count(&specialLogisticNumberData.DeliveredNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialLogisticNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	return &specialLogisticNumberData, nil
+}
+
+func GetSpecialSettleNumber(ctx context.Context, projectId string) (*http_model.GetSpecialSettleNumberData, error) {
+	var specialSettleNumber http_model.GetSpecialSettleNumberData
+	db := GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2 and task_stage = 15", projectId)
+	err := db.Where("").Count(&specialSettleNumber.SettleNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialSettleNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	db = GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2 and task_stage = 15 and settle_status = 1", projectId)
+	err = db.Where("task_stage = 14").Count(&specialSettleNumber.UnsettleNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialSettleNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	db = GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2 and task_stage = 15 and settle_status = 2", projectId)
+	err = db.Where("task_stage > 14").Count(&specialSettleNumber.SettledNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialSettleNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	return &specialSettleNumber, nil
+}

+ 72 - 0
handler/createSpecialLogistics.go

@@ -0,0 +1,72 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapCreateSpecialLogisticsHandler(ctx *gin.Context) {
+	handler := newCreateSpecialLogisticsHandler(ctx)
+	baseRun(handler)
+}
+
+type CreateSpecialLogistics struct {
+	ctx  *gin.Context
+	req  *http_model.CreateSpecialLogisticsRequest
+	resp *http_model.CommonResponse
+}
+
+func (c CreateSpecialLogistics) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c CreateSpecialLogistics) getResponse() interface{} {
+	return c.resp
+}
+
+func (c CreateSpecialLogistics) getRequest() interface{} {
+	return c.req
+}
+
+func (c CreateSpecialLogistics) run() {
+	data := http_model.CreateSpecialLogisticsRequest{}
+	data = *c.req
+	isUpdate := data.IsUpdate
+	if isUpdate == 0 {
+		res, err := service.Logistics.CreateSpecialLogistics(c.ctx, data)
+		if err != nil {
+			logrus.Errorf("[CreateSpecialLogistics] call Create err:%+v\n", err)
+			util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+			logrus.Info("CreateSpecialLogistics fail,req:%+v", c.req)
+			return
+		}
+		c.resp.Message = "成功添加物流信息"
+		c.resp.Data = res
+	} else {
+		res, err := service.Logistics.UpdateSpecialLogistics(c.ctx, data)
+		if err != nil {
+			logrus.Errorf("[CreateSpecialLogistics] call Create err:%+v\n", err)
+			util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+			logrus.Info("CreateSpecialLogistics fail,req:%+v", c.req)
+			return
+		}
+		c.resp.Message = "成功修改物流信息"
+		c.resp.Data = res
+	}
+}
+
+func (c CreateSpecialLogistics) checkParam() error {
+	return nil
+}
+
+func newCreateSpecialLogisticsHandler(ctx *gin.Context) *CreateSpecialLogistics {
+	return &CreateSpecialLogistics{
+		ctx:  ctx,
+		req:  http_model.NewCreateSpecialLogisticsRequest(),
+		resp: http_model.NewCreateSpecialLogisticsResponse(),
+	}
+}

+ 56 - 0
handler/getEnterpriseBalance.go

@@ -0,0 +1,56 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/db"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/util"
+)
+
+func WrapGetEnterpriseBalanceHandler(ctx *gin.Context) {
+	handler := newGetEnterpriseBalanceHandler(ctx)
+	baseRun(handler)
+}
+
+type GetEnterpriseBalanceHandler struct {
+	ctx  *gin.Context
+	req  *http_model.GetEnterPriseBalanceRequest
+	resp *http_model.CommonResponse
+}
+
+func (g GetEnterpriseBalanceHandler) getContext() *gin.Context {
+	return g.ctx
+}
+
+func (g GetEnterpriseBalanceHandler) getResponse() interface{} {
+	return g.resp
+}
+
+func (g GetEnterpriseBalanceHandler) getRequest() interface{} {
+	return g.req
+}
+
+func (g GetEnterpriseBalanceHandler) run() {
+	data, err := db.GetEnterpriseBalance(g.ctx, g.req.EnterPriseId)
+	if err != nil {
+		logrus.Errorf("[GetEnterpriseBalanceHandler] call Show err:%+v\n", err)
+		util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, "")
+		logrus.Info("GetEnterpriseBalanceHandler fail,req:%+v", g.req)
+		return
+	}
+	g.resp.Data = data
+}
+
+func (g GetEnterpriseBalanceHandler) checkParam() error {
+	return nil
+}
+
+func newGetEnterpriseBalanceHandler(ctx *gin.Context) *GetEnterpriseBalanceHandler {
+	return &GetEnterpriseBalanceHandler{
+		ctx:  ctx,
+		req:  http_model.NewGetEnterpriseBalanceRequest(),
+		resp: http_model.NewGetEnterpriseBalanceResponse(),
+	}
+}

+ 72 - 0
handler/getSpecialLogisticList.go

@@ -0,0 +1,72 @@
+package handler
+
+import (
+	"errors"
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"github.com/issue9/conv"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/pack"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapGetSpecialLogisticListHandler(ctx *gin.Context) {
+	handler := GetSpecialLogisticListHandler(ctx)
+	baseRun(handler)
+}
+
+type GetSpecialLogisticList struct {
+	ctx  *gin.Context
+	req  *http_model.GetSpecialLogisticListRequest
+	resp *http_model.CommonResponse
+}
+
+func (g GetSpecialLogisticList) getContext() *gin.Context {
+	return g.ctx
+}
+
+func (g GetSpecialLogisticList) getResponse() interface{} {
+	return g.resp
+}
+
+func (g GetSpecialLogisticList) getRequest() interface{} {
+	return g.req
+}
+
+func (g GetSpecialLogisticList) run() {
+	conditions := pack.HttpSpecialProjectTaskRequestToCondition(g.req)
+	data, err := service.Project.GetSpecialProjectTaskList(g.ctx, g.req.ProjectId, g.req.PageSize, g.req.PageNum, conditions)
+	if err != nil {
+		logrus.WithContext(g.ctx).Errorf("[GetSpecialLogisticList] error GetProjectTaskList, err:%+v", err)
+		util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, consts.DefaultToast)
+		return
+	}
+	g.resp.Data = data
+}
+
+func (g GetSpecialLogisticList) checkParam() error {
+	var errs []error
+	if g.req.PageNum < 0 || g.req.PageSize <= 0 {
+		errs = append(errs, errors.New("page param error"))
+	}
+	g.req.PageNum--
+	g.req.ProjectId = util.IsNull(g.req.ProjectId)
+	if _, err := conv.Int64(g.req.ProjectId); err != nil {
+		errs = append(errs, err)
+	}
+	if len(errs) != 0 {
+		return fmt.Errorf("check param errs:%+v", errs)
+	}
+	return nil
+}
+
+func GetSpecialLogisticListHandler(ctx *gin.Context) *GetSpecialLogisticList {
+	return &GetSpecialLogisticList{
+		ctx:  ctx,
+		req:  http_model.NewGetSpecialLogisticListRequest(),
+		resp: http_model.NewGetSpecialLogisticListResponse(),
+	}
+}

+ 59 - 0
handler/getSpecialLogisticNumber.go

@@ -0,0 +1,59 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapGetSpecialLogisticNumberHandler(ctx *gin.Context) {
+	handler := GetSpecialLogisticNumberHandler(ctx)
+	baseRun(handler)
+}
+
+type GetSpecialLogisticNumber struct {
+	ctx  *gin.Context
+	req  *http_model.GetSpecialLogisticNumberRequest
+	resp *http_model.CommonResponse
+}
+
+func (g GetSpecialLogisticNumber) getContext() *gin.Context {
+	return g.ctx
+}
+
+func (g GetSpecialLogisticNumber) getResponse() interface{} {
+	return g.resp
+}
+
+func (g GetSpecialLogisticNumber) getRequest() interface{} {
+	return g.req
+}
+
+func (g GetSpecialLogisticNumber) run() {
+	data := http_model.GetSpecialLogisticNumberRequest{}
+	data = *g.req
+	res, err := service.Number.GetSpecialLogisticNumber(g.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetSpecialInviteNumberHandler] call GetSpecialInviteNumber err:%+v\n", err)
+		util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, "")
+		logrus.Info("GetSpecialInviteNumber fail,req:%+v", g.req)
+		return
+	}
+	g.resp.Message = ""
+	g.resp.Data = res
+}
+
+func (g GetSpecialLogisticNumber) checkParam() error {
+	return nil
+}
+
+func GetSpecialLogisticNumberHandler(ctx *gin.Context) *GetSpecialLogisticNumber {
+	return &GetSpecialLogisticNumber{
+		ctx:  ctx,
+		req:  http_model.NewGetSpecialLogisticNumberRequest(),
+		resp: http_model.NewGetSpecialLogisticNumberResponse(),
+	}
+}

+ 58 - 0
handler/getSpecialSettleNumber.go

@@ -0,0 +1,58 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapGetSpecialSettleNumberHandler(ctx *gin.Context) {
+	handler := newGetSpecialSettleNumberHandler(ctx)
+	baseRun(handler)
+}
+
+func newGetSpecialSettleNumberHandler(ctx *gin.Context) *GetSpecialSettleNumberHandler {
+	return &GetSpecialSettleNumberHandler{
+		req:  http_model.NewGetSpecialSettleNumberRequest(),
+		resp: http_model.NewGetSpecialSettleNumberResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetSpecialSettleNumberHandler struct {
+	req  *http_model.GetSpecialSettleNumberRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetSpecialSettleNumberHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *GetSpecialSettleNumberHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetSpecialSettleNumberHandler) getResponse() interface{} {
+	return h.resp
+}
+
+func (h *GetSpecialSettleNumberHandler) run() {
+	data := http_model.GetSpecialSettleNumberRequest{}
+	data = *h.req
+	res, err := service.Number.GetSpecialSettleNumber(h.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetSpecialSettleNumberHandler] call GetSpecialSettleNumber err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+		log.Info("GetSpecialSettleNumber fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Message = ""
+	h.resp.Data = res
+}
+
+func (h *GetSpecialSettleNumberHandler) checkParam() error {
+	return nil
+}

+ 58 - 0
handler/signForSpecialLogistic.go

@@ -0,0 +1,58 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapSignForSpecialLogisticHandler(ctx *gin.Context) {
+	handler := newSignForSpecialLogisticHandler(ctx)
+	baseRun(handler)
+}
+
+type SignForSpecialLogisticHandler struct {
+	ctx  *gin.Context
+	req  *http_model.SignForSpecialLogisticRequest
+	resp *http_model.CommonResponse
+}
+
+func (s SignForSpecialLogisticHandler) getContext() *gin.Context {
+	return s.ctx
+}
+
+func (s SignForSpecialLogisticHandler) getResponse() interface{} {
+	return s.resp
+}
+
+func (s SignForSpecialLogisticHandler) getRequest() interface{} {
+	return s.req
+}
+
+func (s SignForSpecialLogisticHandler) run() {
+	data := http_model.SignForSpecialLogisticRequest{}
+	data = *s.req
+	err := service.Logistics.SignForSpecialLogistic(s.ctx, data)
+	if err != nil {
+		logrus.Errorf("[SignForSpecialLogisticHandler] call Create err:%+v\n", err)
+		util.HandlerPackErrorResp(s.resp, consts.ErrorInternal, "")
+		logrus.Info("SignForSpecialLogisticHandler fail,req:%+v", s.req)
+		return
+	}
+	s.resp.Message = "物流状态更换成功"
+}
+
+func (s SignForSpecialLogisticHandler) checkParam() error {
+	return nil
+}
+
+func newSignForSpecialLogisticHandler(ctx *gin.Context) *SignForSpecialLogisticHandler {
+	return &SignForSpecialLogisticHandler{
+		ctx:  ctx,
+		req:  http_model.NewSignForSpecialLogisticRequest(),
+		resp: http_model.NewSignForSpecialLogisticResponse(),
+	}
+}

+ 56 - 0
handler/specialSettlePay.go

@@ -0,0 +1,56 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapSpecialSettlePayHandler(ctx *gin.Context) {
+	handler := newSpecialTaskSettlePayHandler(ctx)
+	baseRun(handler)
+}
+
+type SpecialTaskSettlePayHandler struct {
+	ctx  *gin.Context
+	req  *http_model.SpecialSettlePayRequest
+	resp *http_model.CommonResponse
+}
+
+func (s SpecialTaskSettlePayHandler) getContext() *gin.Context {
+	return s.ctx
+}
+
+func (s SpecialTaskSettlePayHandler) getResponse() interface{} {
+	return s.resp
+}
+
+func (s SpecialTaskSettlePayHandler) getRequest() interface{} {
+	return s.req
+}
+
+func (s SpecialTaskSettlePayHandler) run() {
+	err := service.ProjectPay.SpecialSettlePay(s.ctx, s.req)
+	if err != nil {
+		logrus.Errorf("[SpecialTaskSettlePayHandler] call Show err:%+v\n", err)
+		util.HandlerPackErrorResp(s.resp, consts.ErrorInternal, "")
+		logrus.Info("SpecialTaskSettlePayHandler fail,req:%+v", s.req)
+		return
+	}
+	s.resp.Message = "支付成功"
+}
+
+func (s SpecialTaskSettlePayHandler) checkParam() error {
+	return nil
+}
+
+func newSpecialTaskSettlePayHandler(ctx *gin.Context) *SpecialTaskSettlePayHandler {
+	return &SpecialTaskSettlePayHandler{
+		ctx:  ctx,
+		req:  http_model.NewSpecialSettlePayRequest(),
+		resp: http_model.NewSpecialSettlePayResponse(),
+	}
+}

+ 72 - 0
handler/specialTaskSettleList.go

@@ -0,0 +1,72 @@
+package handler
+
+import (
+	"errors"
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"github.com/issue9/conv"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/pack"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapSpecialTaskSettleListHandler(ctx *gin.Context) {
+	handler := newSpecialTaskSettleListHandler(ctx)
+	baseRun(handler)
+}
+
+func newSpecialTaskSettleListHandler(ctx *gin.Context) *SpecialTaskSettleListHandler {
+	return &SpecialTaskSettleListHandler{
+		req:  http_model.NewSpecialTaskSettleListRequest(),
+		resp: http_model.NewSpecialTaskSettleListResponse(),
+		ctx:  ctx,
+	}
+}
+
+type SpecialTaskSettleListHandler struct {
+	req  *http_model.SpecialTaskSettleListRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *SpecialTaskSettleListHandler) getRequest() interface{} {
+	return h.req
+}
+
+func (h *SpecialTaskSettleListHandler) getContext() *gin.Context {
+	return h.ctx
+}
+
+func (h *SpecialTaskSettleListHandler) getResponse() interface{} {
+	return h.resp
+}
+
+func (h *SpecialTaskSettleListHandler) run() {
+	conditions := pack.HttpSpecialTaskSettleListRequestToCondition(h.req)
+	data, err := service.SpecialTask.GetSpecialTaskSettleList(h.ctx, h.req.ProjectId, h.req.PageSize, h.req.PageNum, conditions)
+	if err != nil {
+		logrus.WithContext(h.ctx).Errorf("[TaskLogisticsListHandler] error GetProjectTaskList, err:%+v", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, consts.DefaultToast)
+		return
+	}
+	h.resp.Data = data
+}
+
+func (h *SpecialTaskSettleListHandler) checkParam() error {
+	var errs []error
+	if h.req.PageNum < 0 || h.req.PageSize <= 0 {
+		errs = append(errs, errors.New("page param error"))
+	}
+	h.req.PageNum--
+	h.req.SettleStatus = util.IsNull(h.req.SettleStatus)
+	if _, err := conv.Int64(h.req.SettleStatus); err != nil {
+		errs = append(errs, err)
+	}
+	if len(errs) != 0 {
+		return fmt.Errorf("check param errs:%+v", errs)
+	}
+	return nil
+}

+ 1 - 0
model/common_model/talent_condition.go

@@ -12,4 +12,5 @@ type TalentConditions struct {
 	StrategyId       int64  `condition:"strategy_id"`       // 策略ID
 	TaskId           string `condition:"task_id"`           // 任务ID
 	PlatformNickname string `condition:"platform_nickname"` // 账号昵称
+	SettleStatus     int64  `condition:"settle_status"`     // 结算状态
 }

+ 1 - 0
model/gorm_model/project_task.go

@@ -40,6 +40,7 @@ type YoungeeTaskInfo struct {
 	DataStatus             uint      `gorm:"column:data_status;default:1"`                // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
 	CurDefaultType         int       `gorm:"column:cur_default_type"`                     // 任务当前处于的违约类型 0-8分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约
 	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`            // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	SettleStatus           int       `gorm:"column:settle_status;default:1"`              // 结算状态,1、2分别表示待结算、已结算
 }
 
 func (m *YoungeeTaskInfo) TableName() string {

+ 29 - 0
model/http_model/CreateSpecialLogisticsRequest.go

@@ -0,0 +1,29 @@
+package http_model
+
+type CreateSpecialLogisticsRequest struct {
+	LogisticsID           int64  `json:"logistics_id"`            // 货物-id
+	CompanyName           string `json:"company_name"`            // 实物商品-物流公司名称
+	LogisticsNumber       string `json:"logistics_number"`        // 实物商品-物流单号
+	ExplorestoreStarttime string `json:"explorestore_starttime"`  // 线下探店-探店开始时间
+	ExplorestoreEndtime   string `json:"explorestore_endtime"`    // 线下探店-探店结束时间
+	ExplorestorePeriod    string `json:"explorestore_period"`     // 线下探店-探店持续时间
+	CouponCodeInformation string `json:"coupon_code_information"` // 虚拟产品-券码信息
+	TaskID                string `json:"task_id"`                 // 任务id
+	DeliveryTime          string `json:"delivery_time"`           // 发货时间
+	ThingsType            int    `json:"things_type"`             // 产品类型 1:实物, 2:虚拟产品,3:线下探店
+	IsUpdate              int    `json:"is_update"`               // 更新标志位 0:不更新 1:更新
+}
+
+type SpecialLogisticsData struct {
+	LogisticsID int64 `json:"logistics_id"` // 货物-id
+}
+
+func NewCreateSpecialLogisticsRequest() *CreateSpecialLogisticsRequest {
+	return new(CreateSpecialLogisticsRequest)
+}
+
+func NewCreateSpecialLogisticsResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(SpecialLogisticsData)
+	return resp
+}

+ 19 - 0
model/http_model/GetEnterPriseBalanceRequest.go

@@ -0,0 +1,19 @@
+package http_model
+
+type GetEnterPriseBalanceRequest struct {
+	EnterPriseId string `json:"enterprise_id"`
+}
+
+type BalanceData struct {
+	Balance float64 `json:"balance"`
+}
+
+func NewGetEnterpriseBalanceRequest() *GetEnterPriseBalanceRequest {
+	return new(GetEnterPriseBalanceRequest)
+}
+
+func NewGetEnterpriseBalanceResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(BalanceData)
+	return resp
+}

+ 67 - 0
model/http_model/GetSpecialLogisticList.go

@@ -0,0 +1,67 @@
+package http_model
+
+import (
+	"time"
+	"youngee_b_api/model/gorm_model"
+)
+
+type GetSpecialLogisticListRequest struct {
+	PageSize         int64  `json:"page_size"`
+	PageNum          int64  `json:"page_num"`
+	ProjectId        string `json:"project_id"`        // 项目ID
+	TaskId           string `json:"task_id"`           // 任务ID
+	LogisticsStatus  string `json:"logistics_status"`  // 任务状态
+	PlatformNickname string `json:"platform_nickname"` // 账号昵称
+}
+
+type SpecialTaskLogisticsPreview struct {
+	TaskID                string    `json:"task_id"`                // 任务ID
+	PlatformNickname      string    `json:"platform_nickname"`      // 账号昵称
+	DetailAddr            string    `json:"detail_addr"`            // 物流信息
+	FansCount             string    `json:"fans_count"`             // 粉丝数
+	CompanyName           string    `json:"company_name"`           // 物流公司
+	LogisticsNumber       string    `json:"logistics_number"`       // 物流单号
+	DeliveryTime          string    `json:"delivery_time"`          // 发货时间
+	ExplorestoreStarttime time.Time `json:"explorestore_starttime"` // 线下探店-探店开始时间
+	ExplorestoreEndtime   time.Time `json:"explorestore_endtime"`   // 线下探店-探店结束时间
+	ExplorestorePeriod    string    `json:"explorestore_period"`    // 线下探店-探店持续时间
+	SignedTime            string    `json:"signed_time"`            // 签收时间
+	CouponCode            string    `json:"coupon_code"`            // 券码信息
+}
+
+type SpecialTaskLogisticsInfo struct {
+	TaskID                string    `json:"task_id"`                // 任务ID
+	PlatformNickname      string    `json:"platform_nickname"`      // 账号昵称
+	FansCount             string    `json:"fans_count"`             // 粉丝数
+	DetailAddr            string    `json:"detail_addr"`            // 物流信息
+	CompanyName           string    `json:"company_name"`           // 物流公司
+	LogisticsNumber       string    `json:"logistics_number"`       // 物流单号
+	DeliveryTime          string    `json:"delivery_time"`          // 发货时间
+	SignedTime            string    `json:"signed_time"`            // 签收时间
+	ExplorestoreStarttime time.Time `json:"explorestore_starttime"` // 线下探店-探店开始时间
+	ExplorestoreEndtime   time.Time `json:"explorestore_endtime"`   // 线下探店-探店结束时间
+	ExplorestorePeriod    string    `json:"explorestore_period"`    // 线下探店-探店持续时间
+	CouponCode            string    `json:"coupon_code"`            // 券码信息
+}
+
+type SpecialTaskLogistics struct {
+	Talent    gorm_model.YoungeeTaskInfo
+	Logistics gorm_model.YoungeeTaskLogistics
+	Region    string
+	//Account   gorm_model.YoungeePlatformAccountInfo
+}
+
+type SpecialTaskLogisticsListData struct {
+	SpecialTaskLogisticsPreview []*SpecialTaskLogisticsPreview `json:"special_task_logistics_preview"`
+	Total                       string                         `json:"total"`
+}
+
+func NewGetSpecialLogisticListRequest() *GetSpecialLogisticListRequest {
+	return new(GetSpecialLogisticListRequest)
+}
+
+func NewGetSpecialLogisticListResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(SpecialTaskLogisticsListData)
+	return resp
+}

+ 22 - 0
model/http_model/GetSpecialLogisticNumber.go

@@ -0,0 +1,22 @@
+package http_model
+
+type GetSpecialLogisticNumberRequest struct {
+	ProjectId string `json:"project_id"` // 项目id
+}
+
+type GetSpecialLogisticNumberData struct {
+	DeliverNumber     int64 `json:"deliver_number"`     // 应发货数量
+	UndeliveredNumber int64 `json:"undelivered_number"` // 未发货数量
+	DeliveredNumber   int64 `json:"delivered_number"`   // 已发货数量
+	SignedNumber      int64 `json:"signed_number"`      // 已签收数量
+}
+
+func NewGetSpecialLogisticNumberRequest() *GetSpecialLogisticNumberRequest {
+	return new(GetSpecialLogisticNumberRequest)
+}
+
+func NewGetSpecialLogisticNumberResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetSpecialLogisticNumberData)
+	return resp
+}

+ 14 - 0
model/http_model/SignForSpecialLogisticRequest.go

@@ -0,0 +1,14 @@
+package http_model
+
+type SignForSpecialLogisticRequest struct {
+	TaskId string `json:"task_id"`
+}
+
+func NewSignForSpecialLogisticRequest() *SignForSpecialLogisticRequest {
+	return new(SignForSpecialLogisticRequest)
+}
+
+func NewSignForSpecialLogisticResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	return resp
+}

+ 15 - 0
model/http_model/SpecialSettlePayRequest.go

@@ -0,0 +1,15 @@
+package http_model
+
+type SpecialSettlePayRequest struct {
+	EnterPriseId string  `json:"enterprise_id"`
+	TaskId       string  `json:"task_id"`
+	Amount       float64 `json:"amount"`
+}
+
+func NewSpecialSettlePayRequest() *SpecialSettlePayRequest {
+	return new(SpecialSettlePayRequest)
+}
+
+func NewSpecialSettlePayResponse() *CommonResponse {
+	return new(CommonResponse)
+}

+ 78 - 0
model/http_model/SpecialTaskSettleList.go

@@ -0,0 +1,78 @@
+package http_model
+
+import (
+	"time"
+	"youngee_b_api/model/gorm_model"
+)
+
+type SpecialTaskSettleListRequest struct {
+	PageSize         int64  `json:"page_size"`
+	PageNum          int64  `json:"page_num"`
+	ProjectId        string `json:"project_id"`        // 项目ID
+	TaskId           string `json:"task_id"`           // 任务ID
+	SettleStatus     string `json:"settle_status"`     // 结算状态,待结算、已结算
+	PlatformNickname string `json:"platform_nickname"` // 账号昵称
+}
+
+type SpecialTaskSettlePreview struct {
+	TaskID           string  `json:"task_id"`           // 任务ID
+	PlatformNickname string  `json:"platform_nickname"` // 账号昵称
+	FansCount        string  `json:"fans_count"`        // 粉丝数
+	PlayNumber       int     `json:"play_number"`       // 播放量/阅读量
+	LikeNumber       int     `json:"like_number"`       // 点赞数
+	CommentNumber    int     `json:"comment_number"`    // 评论数
+	CollectNumber    int     `json:"collect_number"`    // 收藏数
+	LinkUrl          string  `json:"link_url"`          // 上传链接url
+	PhotoUrl         string  `json:"photo_url"`         // 数据截图url
+	AllPayment       float64 `json:"all_payment"`       // 企业支付
+	RealPayment      float64 `json:"real_payment"`      // 企业实际支付(扣除违约扣款)
+	Phone            string  `json:"phone"`             // 联系方式
+	SubmitAt         string  `json:"submit_at"`         // 提交时间
+	AgreeAt          string  `json:"agree_at"`          // 同意时间
+	ReviseOpinion    string  `json:"revise_opinion"`    // 审稿意见
+	UpdateAt         string  `json:"update_at"`         // 更新时间
+}
+
+type SpecialTaskSettleInfo struct {
+	TaskID           string    `json:"task_id"`           // 任务ID
+	PlatformNickname string    `json:"platform_nickname"` // 账号昵称
+	FansCount        string    `json:"fans_count"`        // 粉丝数
+	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"`    // 收藏数
+	LinkUrl          string    `json:"link_url"`          // 上传链接url
+	PhotoUrl         string    `json:"photo_url"`         // 数据截图url
+	AllPayment       float64   `json:"all_payment"`       // 企业支付
+	RealPayment      float64   `json:"real_payment"`      // 企业实际支付(扣除违约扣款)
+	ReviseOpinion    string    `json:"revise_opinion"`    // 审稿意见
+	Phone            string    `json:"phone"`             // 联系方式
+	CreateAt         time.Time `json:"create_at"`         // 创建时间
+	SubmitAt         time.Time `json:"submit_at"`         // 提交时间
+	AgreeAt          time.Time `json:"agree_at"`          // 同意时间
+	UpdateAt         time.Time `json:"update_at"`         // 更新时间
+	RejectAt         time.Time `json:"reject_at"`         // 拒绝时间
+	IsReview         int       `json:"is_review"`         // 是否审核
+}
+
+type SpecialTaskSettle struct {
+	Talent gorm_model.YoungeeTaskInfo
+	Data   gorm_model.YounggeeDataInfo
+	Link   gorm_model.YounggeeLinkInfo
+}
+
+type SpecialTaskSettleListData struct {
+	SpecialTaskSettlePreview []*SpecialTaskSettlePreview `json:"project_task_pre_view"`
+	Total                    string                      `json:"total"`
+}
+
+func NewSpecialTaskSettleListRequest() *SpecialTaskSettleListRequest {
+	return new(SpecialTaskSettleListRequest)
+}
+
+func NewSpecialTaskSettleListResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(SpecialTaskSettleListData)
+	return resp
+}

+ 21 - 0
model/http_model/getSpecialSettleNumber.go

@@ -0,0 +1,21 @@
+package http_model
+
+type GetSpecialSettleNumberRequest struct {
+	ProjectId string `json:"project_id"` // 项目id
+}
+
+type GetSpecialSettleNumberData struct {
+	SettleNumber   int64 `json:"settle_number"`   // 应结算数量
+	UnsettleNumber int64 `json:"unsettle_number"` // 待结算数量
+	SettledNumber  int64 `json:"settled_number"`  // 已结算数量
+}
+
+func NewGetSpecialSettleNumberRequest() *GetSpecialSettleNumberRequest {
+	return new(GetSpecialSettleNumberRequest)
+}
+
+func NewGetSpecialSettleNumberResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetSpecialSettleNumberData)
+	return resp
+}

+ 27 - 0
pack/special_task_script_list.go

@@ -59,3 +59,30 @@ func GetSpecialTaskScriptInfoStruct(SpecialTaskScript *http_model.SpecialTaskScr
 		IsReview:         SpecialTaskScript.Script.IsReview,
 	}
 }
+
+func GetSpecialTaskSettleInfoStruct(SpecialTaskSettle *http_model.SpecialTaskSettle) *http_model.SpecialTaskSettleInfo {
+	TalentPlatformInfoSnap := SpecialTaskSettle.Talent.TalentPlatformInfoSnap
+	TalentPersonalInfoSnap := SpecialTaskSettle.Talent.TalentPersonalInfoSnap
+	return &http_model.SpecialTaskSettleInfo{
+		TaskID:           SpecialTaskSettle.Talent.TaskID,
+		PlatformNickname: conv.MustString(gjson.Get(TalentPlatformInfoSnap, "platform_nickname"), ""),
+		FansCount:        conv.MustString(gjson.Get(TalentPlatformInfoSnap, "fans_count"), ""),
+		DataId:           SpecialTaskSettle.Data.DataID,
+		PlayNumber:       SpecialTaskSettle.Data.PlayNumber,
+		LikeNumber:       SpecialTaskSettle.Data.LikeNumber,
+		CommentNumber:    SpecialTaskSettle.Data.CommentNumber,
+		CollectNumber:    SpecialTaskSettle.Data.CollectNumber,
+		LinkUrl:          SpecialTaskSettle.Link.LinkUrl,
+		PhotoUrl:         SpecialTaskSettle.Data.PhotoUrl,
+		AllPayment:       SpecialTaskSettle.Talent.AllPayment,
+		RealPayment:      SpecialTaskSettle.Talent.RealPayment,
+		ReviseOpinion:    SpecialTaskSettle.Data.ReviseOpinion,
+		Phone:            conv.MustString(gjson.Get(TalentPersonalInfoSnap, "talent_phone_number"), ""),
+		CreateAt:         SpecialTaskSettle.Data.CreateAt,
+		SubmitAt:         SpecialTaskSettle.Data.SubmitAt,
+		AgreeAt:          SpecialTaskSettle.Data.AgreeAt,
+		UpdateAt:         SpecialTaskSettle.Talent.UpdateAt,
+		RejectAt:         SpecialTaskSettle.Data.RejectAt,
+		IsReview:         SpecialTaskSettle.Data.IsReview,
+	}
+}

+ 45 - 0
pack/special_task_settle_list.go

@@ -0,0 +1,45 @@
+package pack
+
+import (
+	"github.com/issue9/conv"
+	"youngee_b_api/model/http_model"
+)
+
+func MGormSpecialTaskSettleInfoListToHttpSpecialTaskSettlePreviewList(gormSpecialTaskSettleInfos []*http_model.SpecialTaskSettleInfo) []*http_model.SpecialTaskSettlePreview {
+	var httpProjectPreviews []*http_model.SpecialTaskSettlePreview
+	for _, gormSpecialTaskSettleInfo := range gormSpecialTaskSettleInfos {
+		httpSpecialTaskSettlePreview := MGormSpecialTaskSettleInfoToHttpSpecialTaskSettlePreview(gormSpecialTaskSettleInfo)
+		httpProjectPreviews = append(httpProjectPreviews, httpSpecialTaskSettlePreview)
+	}
+	return httpProjectPreviews
+}
+
+func MGormSpecialTaskSettleInfoToHttpSpecialTaskSettlePreview(SpecialTaskSettleInfo *http_model.SpecialTaskSettleInfo) *http_model.SpecialTaskSettlePreview {
+	return &http_model.SpecialTaskSettlePreview{
+		TaskID:           conv.MustString(SpecialTaskSettleInfo.TaskID, ""),
+		PlatformNickname: conv.MustString(SpecialTaskSettleInfo.PlatformNickname, ""),
+		FansCount:        conv.MustString(SpecialTaskSettleInfo.FansCount, ""),
+		PlayNumber:       SpecialTaskSettleInfo.PlayNumber,
+		LikeNumber:       SpecialTaskSettleInfo.LikeNumber,
+		CommentNumber:    SpecialTaskSettleInfo.CommentNumber,
+		CollectNumber:    SpecialTaskSettleInfo.CollectNumber,
+		LinkUrl:          SpecialTaskSettleInfo.LinkUrl,
+		PhotoUrl:         SpecialTaskSettleInfo.PhotoUrl,
+		AllPayment:       SpecialTaskSettleInfo.AllPayment,
+		RealPayment:      SpecialTaskSettleInfo.RealPayment,
+		ReviseOpinion:    SpecialTaskSettleInfo.ReviseOpinion,
+		Phone:            SpecialTaskSettleInfo.Phone,
+		SubmitAt:         conv.MustString(SpecialTaskSettleInfo.SubmitAt, "")[0:19],
+		AgreeAt:          conv.MustString(SpecialTaskSettleInfo.AgreeAt, "")[0:19],
+		UpdateAt:         conv.MustString(SpecialTaskSettleInfo.UpdateAt, "")[0:19],
+	}
+}
+
+func SpecialTaskSettleToTaskInfo(SpecialTaskSettles []*http_model.SpecialTaskSettle) []*http_model.SpecialTaskSettleInfo {
+	var SpecialTaskSettleInfos []*http_model.SpecialTaskSettleInfo
+	for _, SpecialTaskSettle := range SpecialTaskSettles {
+		SpecialTaskSettle := GetSpecialTaskSettleInfoStruct(SpecialTaskSettle)
+		SpecialTaskSettleInfos = append(SpecialTaskSettleInfos, SpecialTaskSettle)
+	}
+	return SpecialTaskSettleInfos
+}

+ 15 - 0
pack/special_task_settle_list_condition.go

@@ -0,0 +1,15 @@
+package pack
+
+import (
+	"github.com/issue9/conv"
+	"youngee_b_api/model/common_model"
+	"youngee_b_api/model/http_model"
+)
+
+func HttpSpecialTaskSettleListRequestToCondition(req *http_model.SpecialTaskSettleListRequest) *common_model.TalentConditions {
+	return &common_model.TalentConditions{
+		ProjectId:        req.ProjectId,
+		SettleStatus:     conv.MustInt64(req.SettleStatus, 0),
+		PlatformNickname: conv.MustString(req.PlatformNickname, ""),
+	}
+}

+ 68 - 0
pack/task_logistics_list.go

@@ -78,3 +78,71 @@ func GetTalentInfoStruct(TaskLogistics *http_model.TaskLogistics) *http_model.Ta
 		CouponCode:            TaskLogistics.Logistics.CouponCodeInformation,
 	}
 }
+
+func MGormSpecialTaskLogisticsInfoListToHttpTaskLogisticsPreviewList(gormTaskLogisticsInfos []*http_model.SpecialTaskLogisticsInfo) []*http_model.SpecialTaskLogisticsPreview {
+	var httpProjectPreviews []*http_model.SpecialTaskLogisticsPreview
+	for _, gormTaskLogisticsInfo := range gormTaskLogisticsInfos {
+		httpTaskLogisticsPreview := MGormSpecialTaskLogisticsInfoToHttpTaskLogisticsPreview(gormTaskLogisticsInfo)
+		httpProjectPreviews = append(httpProjectPreviews, httpTaskLogisticsPreview)
+	}
+	return httpProjectPreviews
+}
+
+func MGormSpecialTaskLogisticsInfoToHttpTaskLogisticsPreview(TaskLogisticsInfo *http_model.SpecialTaskLogisticsInfo) *http_model.SpecialTaskLogisticsPreview {
+	deliveryTime := conv.MustString(TaskLogisticsInfo.DeliveryTime, "")
+	deliveryTime = deliveryTime[0:19]
+	SignedTime := ""
+	if TaskLogisticsInfo.SignedTime == "" {
+		SignedTime = ""
+	} else {
+		SignedTime = TaskLogisticsInfo.SignedTime[:19]
+	}
+	return &http_model.SpecialTaskLogisticsPreview{
+		TaskID:                conv.MustString(TaskLogisticsInfo.TaskID, ""),
+		PlatformNickname:      conv.MustString(TaskLogisticsInfo.PlatformNickname, ""),
+		FansCount:             conv.MustString(TaskLogisticsInfo.FansCount, ""),
+		DetailAddr:            conv.MustString(TaskLogisticsInfo.DetailAddr, ""),
+		CompanyName:           conv.MustString(TaskLogisticsInfo.CompanyName, ""),
+		LogisticsNumber:       conv.MustString(TaskLogisticsInfo.LogisticsNumber, ""),
+		DeliveryTime:          deliveryTime,
+		ExplorestoreStarttime: TaskLogisticsInfo.ExplorestoreStarttime,
+		ExplorestoreEndtime:   TaskLogisticsInfo.ExplorestoreEndtime,
+		ExplorestorePeriod:    conv.MustString(TaskLogisticsInfo.ExplorestorePeriod, ""),
+		CouponCode:            conv.MustString(TaskLogisticsInfo.CouponCode, ""),
+		SignedTime:            SignedTime,
+	}
+}
+
+func SpecialTaskLogisticsToTaskInfo(TaskLogisticss []*http_model.SpecialTaskLogistics) []*http_model.SpecialTaskLogisticsInfo {
+	var TaskLogisticsInfos []*http_model.SpecialTaskLogisticsInfo
+	for _, TaskLogistics := range TaskLogisticss {
+		TaskLogistics := GetSpecialTalentInfoStruct(TaskLogistics)
+		TaskLogisticsInfos = append(TaskLogisticsInfos, TaskLogistics)
+	}
+	return TaskLogisticsInfos
+}
+
+func GetSpecialTalentInfoStruct(TaskLogistics *http_model.SpecialTaskLogistics) *http_model.SpecialTaskLogisticsInfo {
+	TalentPlatformInfoSnap := TaskLogistics.Talent.TalentPlatformInfoSnap
+	TalentPostAddrSnap := TaskLogistics.Talent.TalentPostAddrSnap
+	SignedTime := ""
+	if TaskLogistics.Logistics.SignedTime == nil {
+		SignedTime = ""
+	} else {
+		SignedTime = conv.MustString(TaskLogistics.Logistics.SignedTime, "")
+	}
+	return &http_model.SpecialTaskLogisticsInfo{
+		TaskID:                TaskLogistics.Talent.TaskID,
+		PlatformNickname:      conv.MustString(gjson.Get(TalentPlatformInfoSnap, "platform_nickname"), ""),
+		FansCount:             conv.MustString(gjson.Get(TalentPlatformInfoSnap, "fans_count"), ""),
+		DetailAddr:            conv.MustString(gjson.Get(TalentPostAddrSnap, "detail_addr"), "") + TaskLogistics.Region,
+		CompanyName:           TaskLogistics.Logistics.CompanyName,
+		LogisticsNumber:       TaskLogistics.Logistics.LogisticsNumber,
+		DeliveryTime:          conv.MustString(TaskLogistics.Logistics.DeliveryTime, ""),
+		ExplorestoreStarttime: TaskLogistics.Logistics.ExplorestoreStarttime,
+		ExplorestoreEndtime:   TaskLogistics.Logistics.ExplorestoreEndtime,
+		ExplorestorePeriod:    TaskLogistics.Logistics.ExplorestorePeriod,
+		CouponCode:            TaskLogistics.Logistics.CouponCodeInformation,
+		SignedTime:            SignedTime,
+	}
+}

+ 9 - 0
pack/task_logistics_list_conditions.go

@@ -16,3 +16,12 @@ func HttpTaskLogisticsListRequestToCondition(req *http_model.TaskLogisticsListRe
 		PlatformNickname: conv.MustString(req.PlatformNickname),
 	}
 }
+
+func HttpSpecialProjectTaskRequestToCondition(req *http_model.GetSpecialLogisticListRequest) *common_model.TalentConditions {
+	return &common_model.TalentConditions{
+		//ProjectId:        req.ProjectId,
+		LogisticsStatus:  conv.MustInt64(req.LogisticsStatus, 0),
+		TaskId:           conv.MustString(req.TaskId, ""),
+		PlatformNickname: conv.MustString(req.PlatformNickname, ""),
+	}
+}

+ 9 - 0
route/init.go

@@ -119,6 +119,15 @@ func InitRoute(r *gin.Engine) {
 		m.POST("/project/specialTaskDataList", handler.WrapSpecialTaskDataListHandler)             // 查询专项任务数据管理任务列表
 		m.POST("/project/specialTaskFinishDataList", handler.WrapSpecialTaskFinishDataListHandler) // 查询专项任务结案数据任务列表
 
+		m.POST("/project/getSpecialLogisticNumber", handler.WrapGetSpecialLogisticNumberHandler) // 查询专项任务发货管理任务数量
+		m.POST("/project/getSpecialLogisticList", handler.WrapGetSpecialLogisticListHandler)     // 查询专项任务发货管理任务列表
+		m.POST("/project/createSpecialLogistics", handler.WrapCreateSpecialLogisticsHandler)     // 创建专项创建物流信息
+		m.POST("/project/signForSpecialLogistic", handler.WrapSignForSpecialLogisticHandler)     // 签收专项创建物流订单
+		m.POST("/project/getSpecialSettleNumber", handler.WrapGetSpecialSettleNumberHandler)     // 查询专项任务结算管理任务数量
+		m.POST("/project/specialTaskSettleList", handler.WrapSpecialTaskSettleListHandler)       // 查询专项任务结算管理任务列表
+		m.POST("/project/getEnterpriseBalance", handler.WrapGetEnterpriseBalanceHandler)         // 查询当前账户所剩余额
+		m.POST("/project/specialSettlePay", handler.WrapSpecialSettlePayHandler)                 // 结算
+
 		m.POST("/project/getspecialfinishdata", handler.WrapGetSpecialFinishDataHandler) // 查询专项任务结案单结案数据
 		m.POST("/workspace/ddlproject", handler.WrapWorkspaceDDLprojectHandler)          // 工作台项目统计
 

+ 12 - 0
service/SpecialTask.go

@@ -87,3 +87,15 @@ func (p *specialTask) GetSpecialTaskFinishDataList(ctx *gin.Context, projectID s
 	TaskFinishListData.Total = conv.MustString(total)
 	return TaskFinishListData, nil
 }
+
+func (p *specialTask) GetSpecialTaskSettleList(ctx *gin.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) (*http_model.SpecialTaskSettleListData, error) {
+	TaskSettles, total, err := db.GetSpecialTaskSettleList(ctx, projectID, pageSize, pageNum, conditions)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[project service] call GetTaskSettleList error,err:%+v", err)
+		return nil, err
+	}
+	TaskSettleListData := new(http_model.SpecialTaskSettleListData)
+	TaskSettleListData.SpecialTaskSettlePreview = pack.MGormSpecialTaskSettleInfoListToHttpSpecialTaskSettlePreviewList(TaskSettles)
+	TaskSettleListData.Total = conv.MustString(total, "")
+	return TaskSettleListData, nil
+}

+ 148 - 0
service/logistics.go

@@ -221,3 +221,151 @@ func (*logistics) SignForReceipt(ctx *gin.Context, data http_model.SignForReceip
 
 	return nil
 }
+
+func (l *logistics) CreateSpecialLogistics(ctx context.Context, newLogistics http_model.CreateSpecialLogisticsRequest) (*http_model.SpecialLogisticsData, error) {
+	ThingsType := newLogistics.ThingsType
+	Logistics := gorm_model.YoungeeTaskLogistics{
+		LogisticsID:           newLogistics.LogisticsID,
+		TaskID:                newLogistics.TaskID,
+		ThingsType:            int64(ThingsType),
+		ExplorestoreStarttime: time.Now(),
+		ExplorestoreEndtime:   time.Now(),
+		DeliveryTime:          time.Now(),
+	}
+	//实物
+	if ThingsType == 1 {
+		Logistics.CompanyName = newLogistics.CompanyName
+		Logistics.LogisticsNumber = newLogistics.LogisticsNumber
+		Logistics.DeliveryTime = time.Now()
+	} else if ThingsType == 3 {
+		ExplorestoreStarttime, _ := time.ParseInLocation("2006-01-02 15:04:05", newLogistics.ExplorestoreStarttime, time.Local)
+		ExplorestoreEndtime, _ := time.ParseInLocation("2006-01-02 15:04:05", newLogistics.ExplorestoreEndtime, time.Local)
+		Logistics.ExplorestoreStarttime = ExplorestoreStarttime
+		Logistics.ExplorestoreEndtime = ExplorestoreEndtime
+	} else {
+		Logistics.CouponCodeInformation = newLogistics.CouponCodeInformation
+	}
+	logisticsID, err := db.CreateLogistics(ctx, Logistics, 0)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call CreateLogistics error,err:%+v", err)
+		return nil, err
+	}
+	// 修改task_info中发货时间
+	err = db.UpdateLogisticsDate(ctx, Logistics.TaskID)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call UpdateLogisticsDate error,err:%+v", err)
+		return nil, err
+	}
+	// 修改task_info中发货状态
+	err = db.UpdateLogisticsStatus(ctx, Logistics.TaskID, 2)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call UpdateLogisticsStatus error,err:%+v", err)
+		return nil, err
+	}
+	// 修改task_info中任务阶段
+	err = db.UpdateTaskStageByTaskId(ctx, Logistics.TaskID, 2, 5) //修改为待传初稿
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call UpdateLogisticsDate error,err:%+v", err)
+		return nil, err
+	}
+	// 记录任务日志-发货
+	err = db.CreateTaskLog(ctx, Logistics.TaskID, "发货时间")
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call CreateTaskLog error,err:%+v", err)
+		return nil, err
+	}
+	err = db.CreateMessageByTaskId(ctx, 8, 2, Logistics.TaskID)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call CreateMessageByTaskId error,err:%+v", err)
+		return nil, err
+	}
+	res := &http_model.SpecialLogisticsData{
+		LogisticsID: *logisticsID,
+	}
+	return res, nil
+}
+
+func (*logistics) UpdateSpecialLogistics(ctx context.Context, newLogistics http_model.CreateSpecialLogisticsRequest) (*http_model.SpecialLogisticsData, error) {
+	ThingsType := newLogistics.ThingsType
+	Logistics := gorm_model.YoungeeTaskLogistics{
+		LogisticsID:  newLogistics.LogisticsID,
+		TaskID:       newLogistics.TaskID,
+		ThingsType:   int64(ThingsType),
+		DeliveryTime: time.Now(),
+	}
+	//实物
+	if ThingsType == 1 {
+		Logistics.CompanyName = newLogistics.CompanyName
+		Logistics.LogisticsNumber = newLogistics.LogisticsNumber
+	} else if ThingsType == 3 {
+		ExplorestoreStarttime, _ := time.ParseInLocation("2006-01-02 15:04:05", newLogistics.ExplorestoreStarttime, time.Local)
+		ExplorestoreEndtime, _ := time.ParseInLocation("2006-01-02 15:04:05", newLogistics.ExplorestoreEndtime, time.Local)
+		Logistics.ExplorestoreStarttime = ExplorestoreStarttime
+		Logistics.ExplorestoreEndtime = ExplorestoreEndtime
+	} else {
+		Logistics.CouponCodeInformation = newLogistics.CouponCodeInformation
+	}
+	logisticsID, err := db.UpdateLogistics(ctx, Logistics)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call UpdateLogistics error,err:%+v", err)
+		return nil, err
+	}
+	res := &http_model.SpecialLogisticsData{
+		LogisticsID: *logisticsID,
+	}
+	return res, nil
+}
+
+func (l *logistics) SignForSpecialLogistic(ctx *gin.Context, logisticRequest http_model.SignForSpecialLogisticRequest) error {
+	projectId, err1 := db.GetProjectIdByTaskId(ctx, logisticRequest.TaskId)
+	if err1 != nil {
+		logrus.WithContext(ctx).Errorf("[project service] call GetProjectIdByTaskId error,err:%+v", err1)
+		return err1
+	}
+	// 签收时更新任务阶段
+	project, err3 := db.GetProjectDetail(ctx, *projectId)
+	if err3 != nil {
+		logrus.WithContext(ctx).Errorf("[project service] call GetPorjectDetail error,err:%+v", err3)
+		return err3
+	}
+	if project.ContentType == 1 {
+		err := db.UpdateTaskStageByProjectId(ctx, *projectId, 2, 9)
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateTaskStatusPaying error,err:%+v", err)
+			return err
+		}
+	} else {
+		err := db.UpdateTaskStageByProjectId(ctx, *projectId, 2, 7)
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateTaskStatusPaying error,err:%+v", err)
+			return err
+		}
+	}
+
+	taskId := logisticRequest.TaskId
+	err := db.UpdateLogisticsStatus(ctx, taskId, 3)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[project service] call UpdateLogisticsStatus error,err:%+v", err)
+		return err
+	}
+
+	// 签收时间
+	err = db.SignForReceipt(ctx, taskId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[project service] call SignForReceipt error,err:%+v", err)
+		return err
+	}
+
+	// 记录任务日志
+	err = db.CreateTaskLog(ctx, taskId, "签收时间")
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call CreateTaskLog error,err:%+v", err)
+		return err
+	}
+	err = db.CreateMessageByTaskId(ctx, 9, 2, taskId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[logistics service] call CreateMessageByTaskId error,err:%+v", err)
+		return err
+	}
+	return nil
+}

+ 22 - 0
service/number_info.go

@@ -159,3 +159,25 @@ func (*number) GetSpecialFinishData(ctx context.Context, request http_model.GetS
 	}
 	return NumberData, nil
 }
+
+// 0411
+func (*number) GetSpecialLogisticNumber(ctx context.Context, request http_model.GetSpecialLogisticNumberRequest) (*http_model.GetSpecialLogisticNumberData, error) {
+	projectId := request.ProjectId
+	NumberData, err := db.GetSpecialLogisticNumber(ctx, projectId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Data service] call GetSpecialLogisticNumber error,err:%+v", err)
+		return nil, err
+	}
+	return NumberData, nil
+}
+
+func (*number) GetSpecialSettleNumber(ctx context.Context, request http_model.GetSpecialSettleNumberRequest) (*http_model.GetSpecialSettleNumberData, error) {
+	projectId := request.ProjectId
+	NumberData, err := db.GetSpecialSettleNumber(ctx, projectId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Number service] call GetSpecialSettleNumber error,err:%+v", err)
+		return nil, err
+	}
+
+	return NumberData, nil
+}

+ 12 - 0
service/project.go

@@ -610,3 +610,15 @@ func (p *project) GetServiceCharge(ctx *gin.Context, data http_model.GetServiceC
 	}
 	return &serviceFee, nil
 }
+
+func (*project) GetSpecialProjectTaskList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) (*http_model.SpecialTaskLogisticsListData, error) {
+	SpecialTaskLogisticsListDatas, total, err := db.GetSpecialTaskLogisticsList(ctx, projectID, pageSize, pageNum, conditions)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[project service] call GetSpecialProjectTaskList error,err:%+v", err)
+		return nil, err
+	}
+	TaskLogisticsListData := new(http_model.SpecialTaskLogisticsListData)
+	TaskLogisticsListData.SpecialTaskLogisticsPreview = pack.MGormSpecialTaskLogisticsInfoListToHttpTaskLogisticsPreviewList(SpecialTaskLogisticsListDatas)
+	TaskLogisticsListData.Total = conv.MustString(total, "")
+	return TaskLogisticsListData, nil
+}

+ 52 - 0
service/project_pay.go

@@ -2,8 +2,13 @@ package service
 
 import (
 	"context"
+	"errors"
 	"fmt"
+	"github.com/gin-gonic/gin"
+	"gorm.io/gorm"
+	"time"
 	"youngee_b_api/db"
+	"youngee_b_api/model/gorm_model"
 	"youngee_b_api/model/http_model"
 
 	"github.com/sirupsen/logrus"
@@ -92,3 +97,50 @@ func (*projectPay) Pay(ctx context.Context, projectPay http_model.ProjectPayRequ
 
 	return recordId, nil
 }
+
+func (p *projectPay) SpecialSettlePay(ctx *gin.Context, req *http_model.SpecialSettlePayRequest) error {
+	DB := db.GetReadDB(ctx)
+	err := DB.Transaction(func(tx *gorm.DB) error {
+		var balance float64
+		err := tx.Model(&gorm_model.Enterprise{}).Select("balance").Where("enterprise_id = ?", req.EnterPriseId).Find(&balance).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
+			return err
+		}
+		if balance < req.Amount {
+			return errors.New("余额不足")
+		}
+		err = tx.Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", req.TaskId).Updates(gorm_model.YoungeeTaskInfo{
+			TaskReward:   req.Amount,
+			SettleAmount: req.Amount,
+			AllPayment:   req.Amount,
+			RealPayment:  req.Amount,
+			SettleStatus: 2,
+		}).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
+			return err
+		}
+		err = tx.Model(&gorm_model.Enterprise{}).Where("enterprise_id = ?", req.EnterPriseId).
+			Updates(map[string]interface{}{"balance": gorm.Expr("balance - ?", req.Amount), "available_balance": gorm.Expr("available_balance - ?", req.Amount),
+				"updated_at": time.Now()}).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
+			return err
+		}
+		talentId := ""
+		err = tx.Model(&gorm_model.YoungeeTaskInfo{}).Select("talent_id").Where("task_id = ?", req.TaskId).Find(&talentId).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
+			return err
+		}
+		err = tx.Model(&gorm_model.YoungeeTalentInfo{}).Where("id = ?", talentId).
+			Updates(map[string]interface{}{"income": gorm.Expr("income + ?", req.Amount), "canwithdraw": gorm.Expr("canwithdraw + ?", req.Amount)}).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
+			return err
+		}
+		return nil
+	})
+	return err
+}