|
|
|
@ -17,10 +17,7 @@
|
|
|
|
|
*/
|
|
|
|
|
package cn.topiam.employee.console.service.app.impl;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
import cn.topiam.employee.common.entity.app.AppGroupAssociationEntity;
|
|
|
|
|
import cn.topiam.employee.common.repository.app.AppGroupAssociationRepository;
|
|
|
|
@ -52,6 +49,7 @@ import cn.topiam.employee.support.util.BeanUtils;
|
|
|
|
|
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import static cn.topiam.employee.support.repository.domain.BaseEntity.LAST_MODIFIED_BY;
|
|
|
|
|
import static cn.topiam.employee.support.repository.domain.BaseEntity.LAST_MODIFIED_TIME;
|
|
|
|
@ -93,8 +91,13 @@ public class AppServiceImpl implements AppService {
|
|
|
|
|
public AppCreateResult createApp(AppCreateParam param) {
|
|
|
|
|
ApplicationService applicationService = applicationServiceLoader
|
|
|
|
|
.getApplicationService(param.getTemplate());
|
|
|
|
|
String appId = applicationService.create(param.getName(), param.getIcon(),
|
|
|
|
|
param.getRemark(), param.getGroupIds());
|
|
|
|
|
String appId;
|
|
|
|
|
if (!CollectionUtils.isEmpty(param.getGroupIds())) {
|
|
|
|
|
appId = applicationService.create(param.getName(), param.getIcon(), param.getRemark(),
|
|
|
|
|
param.getGroupIds());
|
|
|
|
|
} else {
|
|
|
|
|
appId = applicationService.create(param.getName(), param.getIcon(), param.getRemark());
|
|
|
|
|
}
|
|
|
|
|
AuditContext.setTarget(Target.builder().id(appId).type(TargetType.APPLICATION).build());
|
|
|
|
|
return new AppCreateResult(appId);
|
|
|
|
|
}
|
|
|
|
|