From e69d596c1cb1111de003dbf242b5a4eea75e7862 Mon Sep 17 00:00:00 2001 From: HAHA Date: Wed, 18 May 2022 16:44:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D-=E6=8C=89?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=BB=9F=E8=AE=A1=E6=95=B0=E9=87=8F=E5=8F=8A?= =?UTF-8?q?=E5=8D=A0=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PartyTypepercentFormDTO.java | 22 +++++ .../dto/result/PartyTypepercentResultDTO.java | 33 +++++++ .../controller/IcPartyUnitController.java | 48 +++++++---- .../java/com/epmet/dao/IcPartyUnitDao.java | 19 ++++- .../com/epmet/service/IcPartyUnitService.java | 17 +++- .../service/impl/IcPartyUnitServiceImpl.java | 85 +++++++++++-------- .../main/resources/mapper/IcPartyUnitDao.xml | 13 +++ 7 files changed, 179 insertions(+), 58 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java new file mode 100644 index 0000000000..f5bdb317af --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyTypepercentFormDTO { + + private static final long serialVersionUID = -3833404131164761022L; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空") + private String agencyId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java new file mode 100644 index 0000000000..34bc09d38b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PartyTypepercentResultDTO { + + private static final long serialVersionUID = -5256798094892121661L; + + /** + * 联建单位类型 + */ + private String label; + + /** + * 数量 + */ + private String value; + + /** + * 联建单位编码 + */ + private String code; + + /** + * 联建单位数量占比(%) + */ + private String percent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index b7ac5fe912..0cf4da7683 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -33,12 +33,10 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcPartyUnitDTO; -import com.epmet.dto.form.ImportTaskCommonFormDTO; -import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.form.PartyUnitFormDTO; -import com.epmet.dto.form.PartyUnitListbriefFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -88,14 +86,14 @@ public class IcPartyUnitController { @PostMapping("list") - public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO){ + public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); PageData page = icPartyUnitService.search(formDTO); return new Result>().ok(page); } @PostMapping("detail") - public Result get(@RequestBody IcPartyUnitDTO formDTO){ + public Result get(@RequestBody IcPartyUnitDTO formDTO) { AssertUtils.isBlank(formDTO.getId(), "id"); IcPartyUnitDTO data = icPartyUnitService.get(formDTO.getId()); return new Result().ok(data); @@ -103,7 +101,7 @@ public class IcPartyUnitController { @PostMapping("save") @NoRepeatSubmit - public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto){ + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto) { //效验数据 dto.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -112,7 +110,7 @@ public class IcPartyUnitController { } @PostMapping("delete") - public Result delete(@RequestBody IcPartyUnitDTO dto){ + public Result delete(@RequestBody IcPartyUnitDTO dto) { //效验数据 AssertUtils.isBlank(dto.getId(), "id"); icPartyUnitService.delete(dto.getId()); @@ -152,21 +150,22 @@ public class IcPartyUnitController { * @return */ @PostMapping("servicelist") - public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); } @PostMapping("option") - public Result> option(@RequestBody IcPartyUnitDTO dto){ + public Result> option(@RequestBody IcPartyUnitDTO dto) { AssertUtils.isBlank(dto.getAgencyId(), "agencyId"); return new Result>().ok(icPartyUnitService.option(dto)); } /** * 数据导入 + * * @Param tokenDto * @Param response * @Param file @@ -218,7 +217,7 @@ public class IcPartyUnitController { * @Date 2021/12/8 14:52 */ @PostMapping("typestatistics") - public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO){ + public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(icPartyUnitService.typeStatistics(formDTO)); } @@ -231,7 +230,7 @@ public class IcPartyUnitController { * @Date 2021/12/9 10:11 */ @PostMapping("distribution") - public Result> distribution(@RequestBody PartyActivityFormDTO formDTO){ + public Result> distribution(@RequestBody PartyActivityFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(icPartyUnitService.distribution(formDTO)); } @@ -245,12 +244,27 @@ public class IcPartyUnitController { * @date 2022/5/18 13:54 */ @PostMapping("/listbrief") - public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form,@LoginUser TokenDto tokenDto){ + public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); - PageData data = icPartyUnitService.getListbrief(form,tokenDto); + PageData data = icPartyUnitService.getListbrief(form, tokenDto); return new Result().ok(data); } + /** + * 联建单位-按分类统计数量及占比 + * + * @param form + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/18 16:42 + */ + @PostMapping("/statistics/typepercent") + public Result> getTypepercent(@RequestBody PartyTypepercentFormDTO form) { + ValidatorUtils.validateEntity(form); + List dto = icPartyUnitService.getTypepercent(form); + return new Result>().ok(dto); + } + /** * 计算区域化党建单位的群众满意度 * @@ -258,8 +272,8 @@ public class IcPartyUnitController { * @return */ @PostMapping("cal-partyunit-satisfation") - public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO,ServerSatisfactionCalFormDTO.AddUserInternalGroup.class); + public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ServerSatisfactionCalFormDTO.AddUserInternalGroup.class); icPartyUnitService.calPartyUnitSatisfation(formDTO); return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index d96e45e96b..e9f4559434 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -19,7 +19,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.form.PartyTypepercentFormDTO; import com.epmet.dto.form.PartyUnitListbriefFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -41,22 +43,24 @@ public interface IcPartyUnitDao extends BaseDao { /** * 需求指派,选择区域化党建单位,调用此接口 + * * @param agencyIds * @param unitName * @return */ List selectListByAgencyId(@Param("agencyIds") List agencyIds, @Param("unitName") String unitName, - @Param("customerId")String customerId); + @Param("customerId") String customerId); /** * 单位分类统计 + * * @Param agencyId * @Return {@link java.util.List} * @Author zhaoqifeng * @Date 2021/12/8 15:25 */ - List getTypeStatistics(@Param("agencyId")String agencyId); + List getTypeStatistics(@Param("agencyId") String agencyId); /** * @Description 联建单位分布 @@ -65,7 +69,7 @@ public interface IcPartyUnitDao extends BaseDao { * @Author zhaoqifeng * @Date 2021/12/9 14:24 */ - List getDistribution(@Param("agencyId")String agencyId); + List getDistribution(@Param("agencyId") String agencyId); int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); @@ -77,5 +81,12 @@ public interface IcPartyUnitDao extends BaseDao { * @author LZN * @date 2022/5/18 13:54 */ - List getListbrief(PartyUnitListbriefFormDTO form,String customerId); + List getListbrief(PartyUnitListbriefFormDTO form, String customerId); + + /** + * 联建单位-按分类统计数量及占比 + * + * @param agencyId + */ + List getTypepercent(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index 4469073a2c..5a5cb36416 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -24,9 +24,11 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.PartyTypepercentFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -83,7 +85,7 @@ public interface IcPartyUnitService extends BaseService { * @author generator * @date 2021-11-19 */ - void save(TokenDto tokenDto, IcPartyUnitDTO dto); + void save(TokenDto tokenDto, IcPartyUnitDTO dto); /** @@ -126,6 +128,7 @@ public interface IcPartyUnitService extends BaseService { /** * 导入数据 + * * @Param tokenDto * @Param response * @Param file @@ -146,6 +149,7 @@ public interface IcPartyUnitService extends BaseService { /** * 联建单位分布 + * * @Param formDTO * @Return {@link List< PartyUnitDistributionResultDTO>} * @Author zhaoqifeng @@ -155,6 +159,7 @@ public interface IcPartyUnitService extends BaseService { /** * 计算区域化党建单位的群众满意度 + * * @param formDTO */ void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO); @@ -163,7 +168,15 @@ public interface IcPartyUnitService extends BaseService { /** * 联建单位-简要信息列表 + * + * @param form + */ + PageData getListbrief(PartyUnitListbriefFormDTO form, TokenDto tokenDto); + + /** + * 联建单位-按分类统计数量及占比 + * * @param form */ - PageData getListbrief(PartyUnitListbriefFormDTO form,TokenDto tokenDto); + List getTypepercent(PartyTypepercentFormDTO form); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 45ce4bc831..429652da58 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -39,7 +39,9 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils; @@ -48,11 +50,9 @@ import com.epmet.constant.UserDemandConstant; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPartyUnitDao; import com.epmet.dto.IcPartyUnitDTO; -import com.epmet.dto.form.ImportTaskCommonFormDTO; -import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.form.PartyUnitFormDTO; -import com.epmet.dto.form.PartyUnitListbriefFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.UploadImgResultDTO; @@ -128,10 +128,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); PageInfo pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 - List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { @@ -142,12 +142,12 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } - if(StringUtils.isBlank(item.getSatisfaction())){ + if (StringUtils.isBlank(item.getSatisfaction())) { item.setSatisfaction(StrConstant.HYPHEN); - }else{ - item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + } else { + item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2, BigDecimal.ROUND_HALF_UP).toString()); } - item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId())); + item.setScore(null == pointMap.get(item.getId()) ? NumConstant.ZERO : pointMap.get(item.getId())); }); return new PageData<>(dtoList, pageInfo.getTotal()); } @@ -164,10 +164,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 - List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { @@ -178,13 +178,13 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } - item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId())); + item.setScore(null == pointMap.get(item.getId()) ? NumConstant.ZERO : pointMap.get(item.getId())); }); return dtoList; } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -200,14 +200,14 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); - dto.setScore(null == pointMap.get(id)?NumConstant.ZERO:pointMap.get(id)); + dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id)); } return dto; } @Override @Transactional(rollbackFor = Exception.class) - public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { + public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { IcPartyUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitEntity.class); CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); entity.setAgencyId(staff.getAgencyId()); @@ -219,7 +219,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); - if(StringUtils.isBlank(entity.getId())) { + if (StringUtils.isBlank(entity.getId())) { if (CollectionUtils.isNotEmpty(list)) { throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); } @@ -258,19 +258,19 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl} * @Author zhaoqifeng * @Date 2021/11/22 14:35 @@ -347,8 +347,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //1.数据校验 Iterator iterator = result.iterator(); while (iterator.hasNext()) { @@ -519,6 +519,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl distribution(PartyActivityFormDTO formDTO) { - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); List list = baseDao.getDistribution(formDTO.getAgencyId()); if (CollectionUtils.isEmpty(list)) { return Collections.emptyList(); @@ -573,35 +574,49 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(),formDTO.getServiceType()); + List list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); for (ServiceStatDTO serviceStatDTO : list) { if (0 != serviceStatDTO.getDemandCount()) { BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); - baseDao.updateSatisfaction(serviceStatDTO.getServerId(),result); + baseDao.updateSatisfaction(serviceStatDTO.getServerId(), result); } } } @Override public List queryListById(List partyUnitIds) { - if(CollectionUtils.isNotEmpty(partyUnitIds)){ + if (CollectionUtils.isNotEmpty(partyUnitIds)) { return baseDao.selectBatchIds(partyUnitIds); } return Collections.EMPTY_LIST; } @Override - public PageData getListbrief(PartyUnitListbriefFormDTO form,TokenDto tokenDto) { - PageHelper.startPage(form.getPageNo(),form.getPageSize()); - List dto = baseDao.getListbrief(form,tokenDto.getCustomerId()); - PageInfo info = new PageInfo<>(dto); - return new PageData<>(dto,info.getTotal()); + public PageData getListbrief(PartyUnitListbriefFormDTO form, TokenDto tokenDto) { + PageHelper.startPage(form.getPageNo(), form.getPageSize()); + List dto = baseDao.getListbrief(form, tokenDto.getCustomerId()); + PageInfo info = new PageInfo<>(dto); + return new PageData<>(dto, info.getTotal()); + } + + @Override + public List getTypepercent(PartyTypepercentFormDTO form) { + List dto = baseDao.getTypepercent(form.getAgencyId()); + int total = 0; + for (PartyTypepercentResultDTO item : dto) { + total = Integer.parseInt(item.getValue()) + total; + } + for (PartyTypepercentResultDTO item : dto) { + item.setPercent((Integer.parseInt(item.getValue()) * 100) / total + "%"); + } + return dto; } private String getServiceMatter(Map map, String matter) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index 0295be0c07..2938ee960e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -110,6 +110,19 @@ order by a.CREATED_TIME + update ic_party_unit