|
|
@ -58,6 +58,7 @@ import java.io.InputStream; |
|
|
|
import java.io.PrintWriter; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.UUID; |
|
|
@ -232,12 +233,12 @@ public class IcPartyMemberController implements ResultDataResolver { |
|
|
|
*/ |
|
|
|
@PostMapping("partymembereducationstatistics") |
|
|
|
public Result<List<OptionDataResultDTO>> partyMemberEducationStatistics(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFormDTO formDTO) { |
|
|
|
if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); |
|
|
|
if (null == staffInfo) { |
|
|
|
throw new EpmetException("获取工作人员信息失败"); |
|
|
|
if(StringUtils.isBlank(formDTO.getOrgId())){ |
|
|
|
IcPartyOrgEntity org = setOrgId(tokenDto); |
|
|
|
if (null == org) { |
|
|
|
return new Result<List<OptionDataResultDTO>>().ok(new ArrayList<>()); |
|
|
|
} |
|
|
|
formDTO.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
formDTO.setOrgId(org.getId()); |
|
|
|
} |
|
|
|
return new Result<List<OptionDataResultDTO>>().ok(icPartyMemberService.partyMemberEducationStatistics(formDTO)); |
|
|
|
} |
|
|
@ -253,21 +254,11 @@ public class IcPartyMemberController implements ResultDataResolver { |
|
|
|
@MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) |
|
|
|
public Result<PageData<PartyMemberAgeResultDTO>> partyMemberAgelist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { |
|
|
|
if(StringUtils.isBlank(formDTO.getOrgId())){ |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); |
|
|
|
if (null == staffInfo) { |
|
|
|
throw new EpmetException("获取工作人员信息失败"); |
|
|
|
} |
|
|
|
//获取工作人员所属组织同级的党组织
|
|
|
|
LambdaQueryWrapper<IcPartyOrgEntity> orgWrapper = new LambdaQueryWrapper<>(); |
|
|
|
orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); |
|
|
|
orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); |
|
|
|
orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); |
|
|
|
IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper); |
|
|
|
IcPartyOrgEntity org = setOrgId(tokenDto); |
|
|
|
if (null == org) { |
|
|
|
return new Result<PageData<PartyMemberAgeResultDTO>>().ok(new PageData<>(Collections.emptyList(), 0)); |
|
|
|
} |
|
|
|
formDTO.setOrgId(org.getId()); |
|
|
|
// formDTO.setAgencyId(staffInfo.getAgencyId());
|
|
|
|
} |
|
|
|
return new Result<PageData<PartyMemberAgeResultDTO>>().ok(icPartyMemberService.getPartyMemberAgeList(formDTO)); |
|
|
|
} |
|
|
@ -282,12 +273,12 @@ public class IcPartyMemberController implements ResultDataResolver { |
|
|
|
@PostMapping("partymembereducationlist") |
|
|
|
@MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) |
|
|
|
public Result<PageData<PartyMemberEducationResultDTO>> partyMemberEducationlist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) { |
|
|
|
if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); |
|
|
|
if (null == staffInfo) { |
|
|
|
throw new EpmetException("获取工作人员信息失败"); |
|
|
|
if(StringUtils.isBlank(formDTO.getOrgId())){ |
|
|
|
IcPartyOrgEntity org = setOrgId(tokenDto); |
|
|
|
if (null == org) { |
|
|
|
return new Result<PageData<PartyMemberEducationResultDTO>>().ok(new PageData<>(Collections.emptyList(), 0)); |
|
|
|
} |
|
|
|
formDTO.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
formDTO.setOrgId(org.getId()); |
|
|
|
} |
|
|
|
return new Result<PageData<PartyMemberEducationResultDTO>>().ok(icPartyMemberService.getPartyMemberEducationList(formDTO)); |
|
|
|
} |
|
|
@ -301,16 +292,36 @@ public class IcPartyMemberController implements ResultDataResolver { |
|
|
|
*/ |
|
|
|
@PostMapping("partymemberagestatistics") |
|
|
|
public Result<List<OptionDataResultDTO>> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) { |
|
|
|
if(StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getAgencyId())){ |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); |
|
|
|
if (null == staffInfo) { |
|
|
|
throw new EpmetException("获取工作人员信息失败"); |
|
|
|
if(StringUtils.isBlank(formDTO.getOrgId())){ |
|
|
|
IcPartyOrgEntity org = setOrgId(tokenDto); |
|
|
|
if (null == org) { |
|
|
|
return new Result<List<OptionDataResultDTO>>().ok(new ArrayList<>()); |
|
|
|
} |
|
|
|
formDTO.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
formDTO.setOrgId(org.getId()); |
|
|
|
} |
|
|
|
return new Result<List<OptionDataResultDTO>>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 组装党组织信息 |
|
|
|
* @author wangtong |
|
|
|
* @date 2022/7/8 16:46 |
|
|
|
* @params [tokenDto, formDTO] |
|
|
|
* @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity |
|
|
|
*/ |
|
|
|
public IcPartyOrgEntity setOrgId(TokenDto tokenDto){ |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); |
|
|
|
if (null == staffInfo) { |
|
|
|
throw new EpmetException("获取工作人员信息失败"); |
|
|
|
} |
|
|
|
//获取工作人员所属组织同级的党组织
|
|
|
|
LambdaQueryWrapper<IcPartyOrgEntity> orgWrapper = new LambdaQueryWrapper<>(); |
|
|
|
orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId()); |
|
|
|
orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); |
|
|
|
orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); |
|
|
|
return icPartyOrgDao.selectOne(orgWrapper); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "downloadTemplate", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
public void downloadTemplate(HttpServletResponse response) throws IOException { |
|
|
|