|
@@ -10,21 +10,30 @@ import com.dragoninfo.dcuc.app.facade.IResourceFacade;
|
|
|
import com.dragoninfo.dcuc.auth.auth.async.PermssionServiceUpdateEventBus;
|
|
|
import com.dragoninfo.dcuc.auth.auth.bpo.ServiceAuthResultBPO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.AppServiceCodeDto;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthResultDTO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthFlow;
|
|
|
import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthResult;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.po.ServiceAuthResultPO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.service.IPermissionUpdateService;
|
|
|
import com.dragoninfo.dcuc.auth.auth.service.IServiceAuthResultService;
|
|
|
import com.dragoninfo.dcuc.auth.auth.vo.ServiceAuthenticationResVO;
|
|
|
import com.dragoninfo.dcuc.auth.util.DcucConstantsUtil;
|
|
|
+import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
|
|
|
import com.dragonsoft.duceap.base.enums.BooleanEnum;
|
|
|
import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
|
|
|
+import com.dragonsoft.duceap.core.entity.page.PageRequest;
|
|
|
import com.dragonsoft.duceap.core.search.Searchable;
|
|
|
import com.dragonsoft.duceap.core.search.enums.SearchOperator;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import springfox.documentation.service.ResponseMessage;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
@@ -223,4 +232,79 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
|
|
|
return redisValue;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseDTO saveServiceAuthResult(ServiceAuthResultDTO dto){
|
|
|
+ try{
|
|
|
+ ServiceAuthResult result=new ServiceAuthResult();
|
|
|
+ BeanUtils.copyProperties(dto,result);
|
|
|
+ this.saveAuthResult(result);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("save ServiceAuthResult error :",e);
|
|
|
+ return ResponseDTO.fail("保存失败",new Object());
|
|
|
+ }
|
|
|
+ return ResponseDTO.success("保存成功",null);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ * @param id
|
|
|
+ * @return ResponseDTO
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseDTO delServiceAuthResult(String id){
|
|
|
+ ServiceAuthResult result = serviceAuthResultBPO.get(id);
|
|
|
+ result.setDeleted(BooleanEnum.TRUE.value);
|
|
|
+ serviceAuthResultBPO.update(result);
|
|
|
+ return ResponseDTO.success("删除成功",null);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseDTO updateServiceAuthResult(ServiceAuthResultDTO dto){
|
|
|
+ ServiceAuthResult result=serviceAuthResultBPO.get(dto.getId());
|
|
|
+ BeanUtils.copyProperties(result,dto);
|
|
|
+ result.setUpdateTime(new Date());
|
|
|
+ serviceAuthResultBPO.update(result);
|
|
|
+ return ResponseDTO.success("修改成功",null);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param searchable
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<ServiceAuthResultDTO> serviceAuthResultPage(Searchable searchable){
|
|
|
+ searchable.addSearchFilter("deleted", SearchOperator.eq, BooleanEnum.FALSE.getValue());
|
|
|
+ Page<ServiceAuthResultPO> paging = serviceAuthResultBPO.serviceAuthResultPage(searchable);
|
|
|
+ List<ServiceAuthResultDTO> dtos=new ArrayList<>();
|
|
|
+ paging.forEach(item->{
|
|
|
+ ServiceAuthResultDTO dto=new ServiceAuthResultDTO();
|
|
|
+ BeanUtils.copyProperties(item,dto);
|
|
|
+ dtos.add(dto);
|
|
|
+ });
|
|
|
+ Pageable newPageable = new PageRequest(paging.getNumber(), paging.getSize());
|
|
|
+ PageImpl<ServiceAuthResultDTO> pageResult = new PageImpl<>(dtos, newPageable, paging.getTotalElements());
|
|
|
+ return pageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ServiceAuthResultDTO getDetail(String id) {
|
|
|
+ ServiceAuthResult result=serviceAuthResultBPO.get(id);
|
|
|
+ ServiceAuthResultDTO dto=new ServiceAuthResultDTO();
|
|
|
+ BeanUtils.copyProperties(result,dto);
|
|
|
+ return dto;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|