Browse Source

/userdemand/category-analysis

feature/teamB_zz_wgh
yinzuomei 3 years ago
parent
commit
94c94694b2
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DemandAnalysisLegendEnum.java
  2. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  3. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DemandAnalysisLegendEnum.java

@ -5,7 +5,7 @@ public enum DemandAnalysisLegendEnum {
/** /**
* 环境变量枚举 * 环境变量枚举
*/ */
VOLUNTEER("volunteer", "志愿者"), VOLUNTEER("ic_user_volunteer", "志愿者"),
PARTY_UNIT("party_unit", "联建单位"), PARTY_UNIT("party_unit", "联建单位"),
COMMUNITY_ORG("community_org", "社区自组织"), COMMUNITY_ORG("community_org", "社区自组织"),
UNFINISHED("unfinished", "未完成"), UNFINISHED("unfinished", "未完成"),

17
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -955,6 +955,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
SubCodeFormDTO subCodeFormDTO=new SubCodeFormDTO(); SubCodeFormDTO subCodeFormDTO=new SubCodeFormDTO();
subCodeFormDTO.setCustomerId(formDTO.getCusotmerId()); subCodeFormDTO.setCustomerId(formDTO.getCusotmerId());
subCodeFormDTO.setParentCategoryCode(NumConstant.ZERO_STR); subCodeFormDTO.setParentCategoryCode(NumConstant.ZERO_STR);
// subCodeFormDTO.setCategoryName("特殊群体照料");
List<OptionDTO> firstCategoryList=demandDictService.querySubCodeList(subCodeFormDTO); List<OptionDTO> firstCategoryList=demandDictService.querySubCodeList(subCodeFormDTO);
if(CollectionUtils.isEmpty(firstCategoryList)){ if(CollectionUtils.isEmpty(firstCategoryList)){
return new CategoryAnalysisResDTO(Collections.EMPTY_LIST,Collections.EMPTY_LIST); return new CategoryAnalysisResDTO(Collections.EMPTY_LIST,Collections.EMPTY_LIST);
@ -1032,25 +1033,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//遍历之前构造好的图例 //遍历之前构造好的图例
for(CategoryAnalysisDetail resultDetail:result.getDetail()){ for(CategoryAnalysisDetail resultDetail:result.getDetail()){
if(MapUtils.isNotEmpty(detailMap)){
Iterator<String> iter = detailMap.keySet().iterator();
String key = "";
while (iter.hasNext()) {
key = iter.next();
if(key.contains(resultDetail.getLegendCode())){
resultDetail.setTotalService(detailMap.get(resultDetail.getLegendCode()).getTotalService());
resultDetail.setServiceDemandTotal(detailMap.get(resultDetail.getLegendCode()).getServiceDemandTotal());
}
}
}
}
/*for(CategoryAnalysisDetail resultDetail:result.getDetail()){
if(detailMap.containsKey(resultDetail.getLegendCode())&&null!=detailMap.get(resultDetail.getLegendCode())){ if(detailMap.containsKey(resultDetail.getLegendCode())&&null!=detailMap.get(resultDetail.getLegendCode())){
resultDetail.setTotalService(detailMap.get(resultDetail.getLegendCode()).getTotalService()); resultDetail.setTotalService(detailMap.get(resultDetail.getLegendCode()).getTotalService());
resultDetail.setServiceDemandTotal(detailMap.get(resultDetail.getLegendCode()).getServiceDemandTotal()); resultDetail.setServiceDemandTotal(detailMap.get(resultDetail.getLegendCode()).getServiceDemandTotal());
} }
}*/ }
} }

28
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -389,6 +389,7 @@
when s.SERVICE_TYPE='social_org' then '社会组织' when s.SERVICE_TYPE='social_org' then '社会组织'
when s.SERVICE_TYPE='community_org' then '社区自组织' when s.SERVICE_TYPE='community_org' then '社区自组织'
when s.SERVICE_TYPE='party_unit' then '区域化党建单位' when s.SERVICE_TYPE='party_unit' then '区域化党建单位'
when s.SERVICE_TYPE='ic_user_volunteer' then '志愿者'
end end
)as legendName, )as legendName,
count(s.DEMAND_REC_ID) as serviceDemandTotal, count(s.DEMAND_REC_ID) as serviceDemandTotal,
@ -406,6 +407,7 @@
<if test="null != orgType and orgType == 'agency' "> <if test="null != orgType and orgType == 'agency' ">
and m.GRID_PIDS like concat(#{gridPids},'%') and m.GRID_PIDS like concat(#{gridPids},'%')
</if> </if>
and s.SERVICE_TYPE not like '%volunteer%'
and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') &gt;= #{startDateId} and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') &gt;= #{startDateId}
and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') &lt;= #{endDateId} and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') &lt;= #{endDateId}
and m.CATEGORY_CODE like concat(#{categoryCode},'%') and m.CATEGORY_CODE like concat(#{categoryCode},'%')
@ -413,6 +415,32 @@
union all union all
select
#{categoryCode} as categoryCode,
'ic_user_volunteer' as legendCode,
'志愿者' as legendName,
count(s.DEMAND_REC_ID) as serviceDemandTotal,
count(distinct s.SERVER_ID) as totalService
from ic_user_demand_service s
inner join ic_user_demand_rec m
on(s.DEMAND_REC_ID=m.ID)
where s.DEL_FLAG='0'
and m.DEL_FLAG='0'
and m.`STATUS`='finished'
and m.CUSTOMER_ID=#{customerId}
<if test="null != orgType and orgType == 'grid' ">
and m.GRID_ID=#{orgId}
</if>
<if test="null != orgType and orgType == 'agency' ">
and m.GRID_PIDS like concat(#{gridPids},'%')
</if>
and s.SERVICE_TYPE like '%volunteer%'
and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') &gt;= #{startDateId}
and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') &lt;= #{endDateId}
and m.CATEGORY_CODE like concat(#{categoryCode},'%')
union all
select select
#{categoryCode} as categoryCode, #{categoryCode} as categoryCode,
'unfinished' as legendCode, 'unfinished' as legendCode,

Loading…
Cancel
Save