mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 07:15:43 +00:00
feat(BE-281): adjustment sso redirect,adjustment response closing,adjustment uniformity
This commit is contained in:
@@ -54,6 +54,7 @@ type UniformityDetailDTO struct {
|
||||
Sampling UniformitySamplingDTO `json:"sampling"`
|
||||
Result UniformityResultDTO `json:"result"`
|
||||
Standard *UniformityStandardDTO `json:"standard"`
|
||||
LatestApproval *approvalDTO.ApprovalRelationDTO `json:"latest_approval"`
|
||||
UniformityDetails []UniformityDetailItemDTO `json:"uniformity_details"`
|
||||
}
|
||||
|
||||
@@ -63,6 +64,7 @@ type UniformityListDTO struct {
|
||||
LocationName string `json:"location_name"`
|
||||
FlockName string `json:"flock_name"`
|
||||
KandangName string `json:"kandang_name"`
|
||||
FileName string `json:"file_name"`
|
||||
AppliedAt *time.Time `json:"applied_at"`
|
||||
Week int `json:"week"`
|
||||
Status string `json:"status"`
|
||||
@@ -115,12 +117,19 @@ func ToUniformityDetailDTO(
|
||||
info.FileURL = documentURL
|
||||
}
|
||||
|
||||
var latestApproval *approvalDTO.ApprovalRelationDTO
|
||||
if entityData.LatestApproval != nil {
|
||||
mapped := approvalDTO.ToApprovalDTO(*entityData.LatestApproval)
|
||||
latestApproval = &mapped
|
||||
}
|
||||
|
||||
return UniformityDetailDTO{
|
||||
Id: entityData.Id,
|
||||
InfoUmum: info,
|
||||
Sampling: toUniformitySamplingDTO(calc),
|
||||
Result: toUniformityResultDTO(calc),
|
||||
Standard: standard,
|
||||
LatestApproval: latestApproval,
|
||||
UniformityDetails: toUniformityDetailItemsDTO(calc),
|
||||
}
|
||||
}
|
||||
@@ -163,9 +172,15 @@ func ToUniformityListDTOs(items []entity.ProjectFlockKandangUniformity) []Unifor
|
||||
func ToUniformityListDTOsWithStandard(
|
||||
items []entity.ProjectFlockKandangUniformity,
|
||||
standards map[uint]service.UniformityStandard,
|
||||
documentNames map[uint]string,
|
||||
) []UniformityListDTO {
|
||||
result := ToUniformityListDTOs(items)
|
||||
if len(result) == 0 || len(standards) == 0 {
|
||||
for i := range result {
|
||||
if name, ok := documentNames[result[i].Id]; ok {
|
||||
result[i].FileName = name
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -174,6 +189,9 @@ func ToUniformityListDTOsWithStandard(
|
||||
result[i].StandardMeanWeight = std.MeanWeight
|
||||
result[i].StandardUniformity = std.Uniformity
|
||||
}
|
||||
if name, ok := documentNames[result[i].Id]; ok {
|
||||
result[i].FileName = name
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user