...
|
...
|
@@ -11,6 +11,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/domainService"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
|
|
|
"sort"
|
|
|
"strings"
|
|
|
"time"
|
...
|
...
|
@@ -491,7 +492,20 @@ func (productGroupService *ProductGroupService) SearchProductGroupEmployeesV2(op |
|
|
productGroupRepository, _, _ := factory.FastPgProductGroup(transactionContext, 0)
|
|
|
mapUser, keyFunc := domainService.FindGroupMembers(productGroupRepository, cmd.CompanyId, cmd.OrgId, domain.WorkstationKey(cmd.WorkshopId, cmd.LineId, cmd.SectionId))
|
|
|
var results = dto.NewProductGroupEmployeesDtos()
|
|
|
results.LoadDtoV2(productGroups, mapUser, keyFunc)
|
|
|
|
|
|
userService := domainService.NewUserService()
|
|
|
checkUserEnableFunc := func(userId int) bool {
|
|
|
user, err := userService.User(userId)
|
|
|
if err != nil {
|
|
|
return false
|
|
|
}
|
|
|
if user.EnableStatus == int(domain.UserStatusEnable) {
|
|
|
return true
|
|
|
}
|
|
|
log.Logger.Debug(fmt.Sprintf("ID:%d 用户:%s 状态:%d 已被禁用,过滤", user.UserId, user.UserName, user.EnableStatus))
|
|
|
return false
|
|
|
}
|
|
|
results.LoadDtoV2(productGroups, mapUser, keyFunc, checkUserEnableFunc)
|
|
|
sort.Stable(results)
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
|