...
|
...
|
@@ -251,6 +251,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
|
CooperationContractDescription: createCooperationContractCommand.CooperationContractDescription,
|
|
|
CooperationContractName: createCooperationContractCommand.CooperationContractName,
|
|
|
CooperationContractNumber: contractNumber,
|
|
|
CooperationProjectNumber: createCooperationContractCommand.CooperationProjectNumber,
|
|
|
CooperationContractUndertakerTypes: createCooperationContractCommand.CooperationContractUndertakerTypes,
|
|
|
CooperationContractSponsor: sponsor,
|
|
|
CooperationMode: cooperationMode,
|
...
|
...
|
@@ -500,6 +501,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
var cooperationContractRepository domain.CooperationContractRepository
|
|
|
if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
...
|
...
|
@@ -515,6 +517,38 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
if cooperationContract == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateCooperationContractCommand.CooperationContractId)))
|
|
|
}
|
|
|
// 用户REST服务初始化
|
|
|
var userService service.UserService
|
|
|
if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
userService = value
|
|
|
}
|
|
|
// 获取相关人
|
|
|
var relevantPeople []*domain.Relevant
|
|
|
for _, relevantPersonUid := range updateCooperationContractCommand.RelevantPeople {
|
|
|
var relevantDomain *domain.Relevant
|
|
|
relevantUid, _ := strconv.ParseInt(relevantPersonUid, 10, 64)
|
|
|
if data, err := userService.RelevantFrom(updateCooperationContractCommand.CompanyId, updateCooperationContractCommand.OrgId, relevantUid); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
relevantDomain = data
|
|
|
}
|
|
|
relevantPeople = append(relevantPeople, &domain.Relevant{
|
|
|
RelevantId: relevantDomain.RelevantId,
|
|
|
CooperationContractNumber: cooperationContract.CooperationContractNumber,
|
|
|
UserId: relevantDomain.UserId,
|
|
|
UserBaseId: relevantDomain.UserBaseId,
|
|
|
Org: relevantDomain.Org,
|
|
|
Orgs: relevantDomain.Orgs,
|
|
|
Department: relevantDomain.Department,
|
|
|
Roles: relevantDomain.Roles,
|
|
|
UserInfo: relevantDomain.UserInfo,
|
|
|
UserType: relevantDomain.UserType,
|
|
|
Status: relevantDomain.Status,
|
|
|
Company: relevantDomain.Company,
|
|
|
})
|
|
|
}
|
|
|
if err := cooperationContract.Update(tool_funs.SimpleStructToMap(updateCooperationContractCommand)); err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|