...
|
...
|
@@ -3,11 +3,12 @@ package service |
|
|
import (
|
|
|
"crypto/sha1"
|
|
|
"fmt"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/dto"
|
...
|
...
|
@@ -286,10 +287,15 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand * |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
cooperationDeadline := time.Time{}
|
|
|
if cooperationUserAddCommand.CooperationDeadline > 0 {
|
|
|
cooperationDeadline = time.Unix(cooperationUserAddCommand.CooperationDeadline/1e3, 0)
|
|
|
}
|
|
|
|
|
|
result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{
|
|
|
CompanyId: cooperationUserAddCommand.Operator.CompanyId,
|
|
|
CooperationCompany: cooperationUserAddCommand.CooperationCompany,
|
|
|
CooperationDeadline: time.Unix(cooperationUserAddCommand.CooperationDeadline/1000, 0),
|
|
|
CooperationDeadline: cooperationDeadline,
|
|
|
Email: cooperationUserAddCommand.Email,
|
|
|
EnableStatus: cooperationUserAddCommand.EnableStatus,
|
|
|
UserCode: cooperationUserAddCommand.UsersCode,
|
...
|
...
|
@@ -342,7 +348,10 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
deadline := result.CooperationInfo.CooperationDeadline.Unix()
|
|
|
var deadline int64
|
|
|
if !result.CooperationInfo.CooperationDeadline.IsZero() {
|
|
|
deadline = result.CooperationInfo.CooperationDeadline.Unix()
|
|
|
}
|
|
|
userInfo := dto.CooperationUserInfo{
|
|
|
UserId: strconv.Itoa(result.UserId),
|
|
|
UserCode: result.UserCode,
|
...
|
...
|
@@ -382,7 +391,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * |
|
|
item = dto.CooperationUserItem{
|
|
|
CooperationCompany: v.CooperationInfo.CooperationCompany,
|
|
|
UserId: strconv.Itoa(v.UserId),
|
|
|
CooperationDeadline: v.CooperationInfo.CooperationDeadline.Format("2006-01-02"),
|
|
|
CooperationDeadline: "",
|
|
|
Phone: v.UserInfo.Phone,
|
|
|
EnableStatus: v.EnableStatus,
|
|
|
UserCode: v.UserCode,
|
...
|
...
|
@@ -390,6 +399,10 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * |
|
|
OrgName: v.Org.OrgName,
|
|
|
OrgId: strconv.Itoa(v.Org.OrgId),
|
|
|
}
|
|
|
if !v.CooperationInfo.CooperationDeadline.IsZero() {
|
|
|
item.CooperationDeadline = v.CooperationInfo.CooperationDeadline.Format("2006-01-02")
|
|
|
}
|
|
|
|
|
|
listData = append(listData, item)
|
|
|
}
|
|
|
return cnt, listData, err
|
...
|
...
|
|