yuliang1112 2 vuotta sitten
vanhempi
commit
4908aed337

+ 92 - 0
db/logistics.go

@@ -157,3 +157,95 @@ func ChangeLogisticsStatus(ctx context.Context, taskIds []string) error {
 	}
 	return nil
 }
+
+// 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
+}

+ 7 - 5
db/message.go

@@ -49,10 +49,12 @@ func CreateMessageByTaskId(ctx context.Context, messageId int, messageType int,
 func CreateMessage(ctx context.Context, messageId int, messageType int, talentId string, projectId string) error {
 	db := GetReadDB(ctx)
 	var projectName string
-	err := db.Model(gorm_model.ProjectInfo{}).Select("project_name").Where("project_id = ?", projectId).Find(&projectName).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[CreateMessageByTask] error read mysql, err:%+v", err)
-		return err
+	if projectId != "" {
+		err := db.Model(gorm_model.ProjectInfo{}).Select("project_name").Where("project_id = ?", projectId).Find(&projectName).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[CreateMessageByTask] error read mysql, err:%+v", err)
+			return err
+		}
 	}
 
 	messageInfo := gorm_model.YounggeeMessageInfo{
@@ -65,7 +67,7 @@ func CreateMessage(ctx context.Context, messageId int, messageType int, talentId
 		IsDeleted:   0,
 	}
 	db1 := GetReadDB(ctx)
-	err = db1.Model(gorm_model.YounggeeMessageInfo{}).Create(&messageInfo).Error
+	err := db1.Model(gorm_model.YounggeeMessageInfo{}).Create(&messageInfo).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[CreateMessageByTask] error create mysql, err:%+v", err)
 		return err

+ 29 - 1
db/number_info.go

@@ -40,7 +40,6 @@ func GetLogisticsNumberInfo(ctx context.Context, projectId string, strategyIds [
 			logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
 			return nil, err
 		}
-
 		LogisticsNumberInfoDataList.LogisticsNumberInfoList = append(LogisticsNumberInfoDataList.LogisticsNumberInfoList, &LogisticsNumberInfoData)
 	}
 	return &LogisticsNumberInfoDataList, nil
@@ -268,6 +267,35 @@ func GetSpecialInviteNumber(ctx context.Context, projectId string) (*http_model.
 	return &specialInviteNumberData, 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 GetSpecialReviewNumber(ctx context.Context, projectId string) (*http_model.GetSpecialReviewNumberData, error) {
 	var specialReviewNumber http_model.GetSpecialReviewNumberData
 	db := GetReadDB(ctx).Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2", projectId)

+ 6 - 2
db/user.go

@@ -362,8 +362,12 @@ func DeleteAccount(ctx context.Context, PlatformID, PlatformNickname, TalentId s
 	db = db.Debug().Where("talent_id = ? "+
 		"AND platform_nickname = ? "+
 		"AND platform_id = ?",
-		TalentId, PlatformNickname, PlatformID).First(&accountInfo)
-	err := db.Update("deleted", 1).Error
+		TalentId, PlatformNickname, PlatformID).Find(&accountInfo)
+	err := CreateMessage(context.Background(), 15, 2, accountInfo.TalentID, "")
+	if err != nil {
+		logrus.WithContext(context.Background()).Errorf("[user db] call CreateMessageByTaskId error,err:%+v", err)
+	}
+	err = db.Delete(&accountInfo).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[user db] call DeleteAccount error,err:%+v", err)
 		return err

+ 4 - 0
handler/SpecialTaskInviteList.go

@@ -36,12 +36,15 @@ type SpecialTaskInviteListHandler struct {
 func (h *SpecialTaskInviteListHandler) getRequest() interface{} {
 	return h.req
 }
+
 func (h *SpecialTaskInviteListHandler) getContext() *gin.Context {
 	return h.ctx
 }
+
 func (h *SpecialTaskInviteListHandler) getResponse() interface{} {
 	return h.resp
 }
+
 func (h *SpecialTaskInviteListHandler) run() {
 	conditions := pack.HttpSpecialTaskInviteListRequestToCondition(h.req)
 	data, err := service.SpecialTask.GetSpecialTaskInviteList(h.ctx, h.req.ProjectId, h.req.PageSize, h.req.PageNum, conditions)
@@ -52,6 +55,7 @@ func (h *SpecialTaskInviteListHandler) run() {
 	}
 	h.resp.Data = data
 }
+
 func (h *SpecialTaskInviteListHandler) checkParam() error {
 	var errs []error
 	if h.req.PageNum < 0 || h.req.PageSize <= 0 {

+ 72 - 0
handler/getSpecialLogisticList.go

@@ -0,0 +1,72 @@
+package handler
+
+import (
+	"errors"
+	"fmt"
+	"github.com/cstockton/go-conv"
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/pack"
+	"youngee_m_api/service"
+	"youngee_m_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_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_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(),
+	}
+}

+ 1 - 2
middleware/login_auth.go

@@ -1,7 +1,6 @@
 package middleware
 
 import (
-	"fmt"
 	"youngee_m_api/consts"
 	"youngee_m_api/model/redis_model"
 	"youngee_m_api/service"
@@ -15,7 +14,7 @@ import (
 func LoginAuthMiddleware(c *gin.Context) {
 	token := c.Request.Header.Get("Authorization")
 	if token != "" {
-		fmt.Println(token)
+		//fmt.Println(token)
 		if auth, err := service.LoginAuth.AuthToken(c, token); err == nil {
 			c.Set(consts.SessionAuthSchema, auth)
 			c.Next()

+ 5 - 3
model/gorm_model/project_photo.go

@@ -8,9 +8,11 @@ import (
 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      string    `gorm:"column:project_id"` // 所属项目id
-	CreatedAt      time.Time `gorm:"column:created_at"` // 创建时间
+	FileName       string    `gorm:"column:file_name"`                                   // 文件名称
+	FileType       string    `gorm:"column:file_type"`                                   // 文件类型
+	PhotoUid       string    `gorm:"column:photo_uid"`                                   // 文件uid
+	ProjectID      string    `gorm:"column:project_id"`                                  // 所属项目id
+	CreatedAt      time.Time `gorm:"column:created_at"`                                  // 创建时间
 }
 
 func (m *ProjectPhoto) TableName() string {

+ 67 - 0
model/http_model/GetSpecialLogisticList.go

@@ -0,0 +1,67 @@
+package http_model
+
+import (
+	"time"
+	"youngee_m_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
+}

+ 68 - 0
pack/task_logistics_list.go

@@ -77,3 +77,71 @@ func GetTalentInfoStruct(TaskLogistics *http_model.TaskLogistics) *http_model.Ta
 		SignedTime:            SignedTime,
 	}
 }
+
+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

@@ -15,3 +15,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, ""),
+	}
+}

+ 5 - 3
route/init.go

@@ -24,7 +24,7 @@ func InitRoute(r *gin.Engine) {
 	})
 	m := r.Group("/youngee/m")
 	{
-		m.Use(middleware.LoginAuthMiddleware)
+		//m.Use(middleware.LoginAuthMiddleware)
 		m.POST("/test", func(c *gin.Context) {
 			resp := http_model.CommonResponse{
 				Status:  0,
@@ -87,6 +87,8 @@ func InitRoute(r *gin.Engine) {
 		m.POST("/project/getlogisticsnumberinfo", handler.WrapGetLogisticsNumberInfoHandler)       // 获取物流数量
 		m.POST("/project/getfinishdata", handler.WrapGetFinishDataHandler)                         // 获取结案信息
 		m.POST("/project/getSpecialInviteNumber", handler.WrapGetSpecialInviteNumberHandler)       // 查询专项任务邀请管理任务数量
+		m.POST("/project/getSpecialLogisticNumber", handler.WrapGetSpecialLogisticNumberHandler)   // 查询专项任务发货管理任务数量
+		m.POST("/project/getSpecialLogisticList", handler.WrapGetSpecialLogisticListHandler)       // 查询专项任务发货管理任务列表
 		m.POST("/project/getSpecialReviewNumber", handler.WrapGetSpecialReviewNumberHandler)       // 查询专项任务审稿管理任务数量
 		m.POST("/project/getSpecialLinkNumber", handler.WrapGetSpecialLinkNumberHandler)           // 查询专项任务发布管理任务数量
 		m.POST("/project/getSpecialDataNumber", handler.WrapGetSpecialDataNumberHandler)           // 查询专项任务数据管理任务数量
@@ -110,8 +112,8 @@ func InitRoute(r *gin.Engine) {
 		u.POST("/creatorList", handler.WrapCreatorListHandler)       // 查找创作者信息
 		u.POST("/platformAccInfo", handler.WrapPlatformAccInfoHandler)
 		u.POST("/talentInfo", handler.WrapTalentInfoHandler)
-		u.POST("/accountInfo", handler.WrapAccountInfoHandler)
-		u.POST("/deleteAccount", handler.WrapDeleteAccountHandler)
+		u.POST("/accountInfo", handler.WrapAccountInfoHandler)     // 达人端账号信息
+		u.POST("/deleteAccount", handler.WrapDeleteAccountHandler) // 解绑达人端账号
 		u.POST("/getTaskRecord", handler.WrapGetTaskRecordHandler)
 		u.POST("/modifyAccInfo", handler.WrapModifyAccInfoHandler) // 更新用户账号信息
 	}

+ 1 - 1
service/kuaiDi100.go

@@ -65,7 +65,7 @@ func GetKDStatus(com, num string) string {
 
 	sign := strings.ToUpper(GetMD5Encode(paramjson + key + customer))
 
-	//POST请求需要三个参数,分别为customer(CustomerId)和sign(签名)和param(参数)
+	// POST请求需要三个参数,分别为customer(CustomerId)和sign(签名)和param(参数)
 	postRes, postErr := http.PostForm(postUrl, url.Values{"customer": {customer}, "sign": {sign}, "param": {paramjson}})
 	if postErr != nil {
 		fmt.Println("查询失败" + postErr.Error())

+ 12 - 1
service/number_info.go

@@ -108,7 +108,18 @@ func (*number) GetSpecialInviteNumber(ctx context.Context, request http_model.Ge
 	projectId := request.ProjectId
 	NumberData, err := db.GetSpecialInviteNumber(ctx, projectId)
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Data service] call CreateData error,err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[Data service] call GetSpecialInviteNumber error,err:%+v", err)
+		return nil, err
+	}
+
+	return NumberData, nil
+}
+
+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
 	}
 

+ 12 - 0
service/project.go

@@ -549,6 +549,18 @@ func (*project) GetTaskLogisticsList(ctx context.Context, projectID string, page
 	return TaskLogisticsListData, 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
+}
+
 func (*project) ChangeTaskStatus(ctx *gin.Context, data http_model.ProjectChangeTaskStatusRequest) interface{} {
 	fmt.Println("taskIds :", data.TaskIds)
 	fmt.Println("task_status :", data.TaskStatus)