...
|
...
|
@@ -2,6 +2,7 @@ package dto |
|
|
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils/converter"
|
|
|
"strings"
|
|
|
)
|
|
|
|
...
|
...
|
@@ -19,6 +20,7 @@ type ProductGroupEmployeesDto struct { |
|
|
WorkOnDescription string `json:"workOn,omitempty"`
|
|
|
// 工作位置键值 (车间ID+'.'+生产线ID+'.'+工段ID)
|
|
|
//WorkStationId string `json:"workStationId,omitempty"`
|
|
|
UserNamePinyin string `json:"pinyin"`
|
|
|
}
|
|
|
|
|
|
func NewProductGroupEmployeesDto(group *domain.ProductGroup) []*ProductGroupEmployeesDto {
|
...
|
...
|
@@ -41,6 +43,9 @@ func NewGroupEmployee(group *domain.ProductGroup, u *domain.User) *ProductGroupE |
|
|
workOns := domain.WorkOnDescription(group.WorkOn)
|
|
|
item.WorkOnDescription = strings.Join(workOns, ",")
|
|
|
//item.WorkStationId = group.WorkStation.WorkStationId
|
|
|
if len(item.UserName) > 0 {
|
|
|
item.UserNamePinyin = converter.ToPinYin(item.UserName, "")
|
|
|
}
|
|
|
return item
|
|
|
}
|
|
|
|
...
|
...
|
@@ -72,3 +77,11 @@ func NewProductGroupEmployeesDtos() *ProductGroupEmployeesDtos { |
|
|
MapResult: make(map[int]*ProductGroupEmployeesDto),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (ms *ProductGroupEmployeesDtos) Len() int { return len(ms.Result) }
|
|
|
func (ms *ProductGroupEmployeesDtos) Less(i, j int) bool {
|
|
|
return ms.Result[i].UserNamePinyin < ms.Result[j].UserNamePinyin
|
|
|
}
|
|
|
func (ms *ProductGroupEmployeesDtos) Swap(i, j int) {
|
|
|
ms.Result[i], ms.Result[j] = ms.Result[j], ms.Result[i]
|
|
|
} |
...
|
...
|
|