|
|
@ -3,19 +3,18 @@ package com.epmet.service.impl; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.ModuleConstant; |
|
|
|
import com.epmet.dto.form.CommonGridIdFormDTO; |
|
|
|
import com.epmet.dto.form.StaffSinDeptFormDTO; |
|
|
|
import com.epmet.dto.form.StaffSinGridFormDTO; |
|
|
|
import com.epmet.dto.form.UserIdsFormDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.StaffSinDeptResultDTO; |
|
|
|
import com.epmet.dto.result.StaffSinGridResultDTO; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.service.OpenUpService; |
|
|
|
import org.bouncycastle.math.raw.Mod; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
@ -43,7 +42,7 @@ public class OpenUpServiceImpl implements OpenUpService { |
|
|
|
commonGridId.setUserId(""); |
|
|
|
Result<List<String>> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); |
|
|
|
if (!gridStaffs.success()){ |
|
|
|
throw new RenException(ModuleConstant.ERROR_GOV_ORG); |
|
|
|
throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID); |
|
|
|
} |
|
|
|
List<String> userIds = gridStaffs.getData(); |
|
|
|
UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); |
|
|
@ -63,6 +62,26 @@ public class OpenUpServiceImpl implements OpenUpService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<StaffSinDeptResultDTO> staffSinDept(StaffSinDeptFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
DepartmentIdFormDTO departmentId = new DepartmentIdFormDTO(); |
|
|
|
departmentId.setDepartmentId(formDTO.getDepartmentId()); |
|
|
|
Result<List<String>> departmentStaffs = govOrgOpenFeignClient.getDepartmentStaffs(departmentId); |
|
|
|
if (!departmentStaffs.success()){ |
|
|
|
throw new RenException(ModuleConstant.ERROR_GOV_ORG_DEPARTMENT); |
|
|
|
} |
|
|
|
List<String> userIds = departmentStaffs.getData(); |
|
|
|
UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); |
|
|
|
userIdsForm.setUserIds(userIds); |
|
|
|
Result<List<StaffSinGridResultDTO>> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); |
|
|
|
if (!staffInfoList.success()){ |
|
|
|
throw new RenException(ModuleConstant.ERROR_EPMET_USER); |
|
|
|
} |
|
|
|
List<StaffSinGridResultDTO> data = staffInfoList.getData(); |
|
|
|
List<StaffSinDeptResultDTO> result = new ArrayList<>(); |
|
|
|
data.forEach(staff -> { |
|
|
|
StaffSinDeptResultDTO dept = new StaffSinDeptResultDTO(); |
|
|
|
BeanUtils.copyProperties(staff,dept); |
|
|
|
result.add(dept); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|