Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj' into dev

# Conflicts:
#	epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
dev_shibei_match
yinzuomei 4 years ago
parent
commit
a1c5ca0581
  1. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java
  2. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerAgencyCommonDTO.java
  3. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridCommonDTO.java
  4. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java
  5. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  6. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  7. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java
  8. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  9. 41
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java
  10. 135
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java
  11. 104
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml
  12. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  13. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
  14. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java
  15. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java
  16. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java
  17. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  18. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java
  19. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java
  21. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  22. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  23. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java
  24. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  25. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

9
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java

@ -13,8 +13,9 @@ import java.util.List;
*/
@Data
public class AgencyInfoDTO implements Serializable {
private String agencyId;
private String areaCode;
private List<String> subAgencyIds;
private List<String> subGridIds;
private String currentAgencyId;
private String currentAgencyName;
private String currentAreaCode;
private List<ScreenCustomerAgencyCommonDTO> subAgencies;
private List<ScreenCustomerGridCommonDTO> subGrids;
}

18
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerAgencyCommonDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* screen_customer_agency
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/13 15:31
*/
@Data
public class ScreenCustomerAgencyCommonDTO implements Serializable {
private static final long serialVersionUID = -6222325433226628163L;
private String agencyId;
private String agencyName;
}

18
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridCommonDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* screen_customer_grid
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/13 15:32
*/
@Data
public class ScreenCustomerGridCommonDTO implements Serializable {
private static final long serialVersionUID = -4405092094598416917L;
private String gridId;
private String gridName;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java

@ -31,4 +31,6 @@ public class WorkRecordSubRank implements Serializable {
* 组织次数
*/
private Integer participateTotal;
private String isDefault;
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.ScreenCustomerAgencyCommonDTO;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
@ -163,7 +164,7 @@ public interface ScreenCustomerAgencyDao {
**/
List<String> getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
List<String> selectSubAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
List<ScreenCustomerAgencyCommonDTO> selectSubAgencyIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
/**
* @Description 根据agencyId查询网格

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.ScreenCustomerGridCommonDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -81,5 +82,5 @@ public interface ScreenCustomerGridDao {
*/
List<TreeResultDTO> selectGridInfo(@Param("agencyId")String agencyId);
List<String> selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
List<ScreenCustomerGridCommonDTO> selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
}

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java

@ -55,16 +55,14 @@ public interface ScreenWorkRecordOrgDailyDao extends BaseDao<ScreenWorkRecordOrg
@Param("customerId")String customerId,
@Param("dateId")String dateId);
/**
* @param customerIds 当前客户+所有子客户 列表
* @author yinzuomei
* @description 查询最近一次上传的日期
* @Date 2021/2/27 19:31
**/
String selectLatestDateId(@Param("customerIds")List<String> customerIds);
WorkRecordSubRank selectCurrentAgency(@Param("agencyId") String agencyId,
@Param("dateId")String dateId,
@Param("typeCodeList")List<String> typeCodeList);
List<String> selectCustomerTypeCode(@Param("dataType")String dataType, @Param("customerId")String customerId);
WorkRecordSubRank selectUpToCalAgency(@Param("agencyId")String agencyId, @Param("dateId")String dateId,@Param("typeCodeList") List<String> typeCodeList);
List<WorkRecordSubRank> selectCurrentAgency(@Param("agencyId") String agencyId,
@Param("dataType")String dataType,
@Param("customerId")String customerId,
@Param("dateId")String dateId);
WorkRecordSubRank selectUpToCalGrid(@Param("gridId")String gridId, @Param("dateId")String dateId, @Param("typeCodeList")List<String> typeCodeList);
}

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -334,10 +334,10 @@ public class AgencyServiceImpl implements AgencyService {
@Override
public AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId) {
AgencyInfoDTO agencyInfoDTO=new AgencyInfoDTO();
agencyInfoDTO.setAgencyId(agencyId);
agencyInfoDTO.setAreaCode(areaCode);
agencyInfoDTO.setSubAgencyIds(screenCustomerAgencyDao.selectSubAgencyIds(areaCode,agencyId));
agencyInfoDTO.setSubGridIds(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId));
agencyInfoDTO.setCurrentAgencyId(agencyId);
agencyInfoDTO.setCurrentAreaCode(areaCode);
agencyInfoDTO.setSubAgencies(screenCustomerAgencyDao.selectSubAgencyIds(areaCode,agencyId));
agencyInfoDTO.setSubGrids(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId));
return agencyInfoDTO;
}

41
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java

@ -18,7 +18,6 @@
package com.epmet.datareport.service.plugins;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO;
import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO;
@ -39,16 +38,6 @@ import java.util.Map;
*/
public interface ScreenWorkRecordOrgDailyService extends BaseService<ScreenWorkRecordOrgDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenWorkRecordOrgDailyDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenWorkRecordOrgDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
@ -69,36 +58,6 @@ public interface ScreenWorkRecordOrgDailyService extends BaseService<ScreenWorkR
*/
ScreenWorkRecordOrgDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenWorkRecordOrgDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenWorkRecordOrgDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO);
/**

135
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java

@ -19,14 +19,11 @@ package com.epmet.datareport.service.plugins.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao;
import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao;
@ -36,8 +33,9 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.dto.ScreenCustomerAgencyCommonDTO;
import com.epmet.dto.ScreenCustomerGridCommonDTO;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO;
import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO;
import com.epmet.plugins.form.WorkRecordRankFormDTO;
@ -48,7 +46,6 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@ -75,16 +72,6 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
private ScreenCustomerWorkRecordDictDao screenCustomerWorkRecordDictDao;
@Autowired
private ScreenWorkRecordOrgMonthlyDao screenWorkRecordOrgMonthlyDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Override
public PageData<ScreenWorkRecordOrgDailyDTO> page(Map<String, Object> params) {
IPage<ScreenWorkRecordOrgDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenWorkRecordOrgDailyDTO.class);
}
@Override
public List<ScreenWorkRecordOrgDailyDTO> list(Map<String, Object> params) {
@ -108,65 +95,65 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordOrgDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenWorkRecordOrgDailyDTO dto) {
ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenWorkRecordOrgDailyDTO dto) {
ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO) {
List<String> customerIds=new ArrayList<>();
Result<List<String>> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());
// log.info("根据customerId查询其所有下级子客户id result: "+JSON.toJSONString(result));
if (result.success() && CollectionUtils.isNotEmpty(result.getData())) {
customerIds.addAll(result.getData());
}
customerIds.add(formDTO.getCustomerId());
String dateId= baseDao.selectLatestDateId(customerIds);
if(StringUtils.isBlank(dateId)){
dateId= com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE);
log.warn("dateId 赋值为"+dateId+" ; selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds));
}
//默认截止到前一天
String dateId= com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE);
WorkRecordRankResultDTO returnDto = new WorkRecordRankResultDTO();
AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId());
// log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO));
//当前组织的自身的数据
List<WorkRecordSubRank> currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(),
formDTO.getDataType(),
formDTO.getCustomerId(),
dateId);
//下级所有组织
List<WorkRecordSubRank> subAgencyRankList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? baseDao.selectSubList(
agencyInfoDTO.getSubAgencyIds(),
formDTO.getDataType(),
formDTO.getCustomerId(),
dateId) : new ArrayList<>();
//直属网格
List<WorkRecordSubRank> subGridList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? baseDao.selectSubGridList(
agencyInfoDTO.getSubGridIds(),
formDTO.getDataType(),
formDTO.getCustomerId(),
dateId) : new ArrayList<>();
log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO));
//随手记类型编码;对应screen_customer_work_record_dict的资源编码
List<String> typeCodeList=baseDao.selectCustomerTypeCode(formDTO.getDataType(),formDTO.getCustomerId());
if(CollectionUtils.isEmpty(typeCodeList)){
log.warn(String.format("当前customerId=%s,screen_customer_work_record_dict 为空"));
}
//1)、当前组织的自身的数据
WorkRecordSubRank currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(),dateId,typeCodeList);
//2)、下级所有组织
List<WorkRecordSubRank> subAgencyRankList = new ArrayList<>();
for(ScreenCustomerAgencyCommonDTO agencyCommonDTO:agencyInfoDTO.getSubAgencies()){
WorkRecordSubRank agencyRes= baseDao.selectUpToCalAgency(agencyCommonDTO.getAgencyId(),dateId,typeCodeList);
if(null !=agencyRes){
subAgencyRankList.add(agencyRes);
}else{
WorkRecordSubRank agencyDefault=new WorkRecordSubRank();
agencyDefault.setOrgId(agencyCommonDTO.getAgencyId());
agencyDefault.setName(agencyCommonDTO.getAgencyName());
agencyDefault.setParticipateTotal(0);
agencyDefault.setParticipateUserTotal(0);
agencyDefault.setIsDefault("yes");
subAgencyRankList.add(agencyDefault);
}
}
//3)、直属网格
List<WorkRecordSubRank> subGridList=new ArrayList<>();
for(ScreenCustomerGridCommonDTO gridCommonDTO:agencyInfoDTO.getSubGrids()){
WorkRecordSubRank gridRes=baseDao.selectUpToCalGrid(gridCommonDTO.getGridId(),dateId,typeCodeList);
if (null != gridRes) {
subGridList.add(gridRes);
} else {
WorkRecordSubRank gridResDefault = new WorkRecordSubRank();
gridResDefault.setOrgId(gridCommonDTO.getGridId());
gridResDefault.setName(gridCommonDTO.getGridName());
gridResDefault.setParticipateTotal(0);
gridResDefault.setParticipateUserTotal(0);
gridResDefault.setIsDefault("yes");
subAgencyRankList.add(gridResDefault);
}
}
if(CollectionUtils.isNotEmpty(subAgencyRankList)){
returnDto.getSubRankList().addAll(subAgencyRankList);
}
if(CollectionUtils.isNotEmpty(subGridList)){
returnDto.getSubRankList().addAll(subGridList);
}
returnDto.getSubRankList().addAll(subAgencyRankList);
returnDto.getSubRankList().addAll(subGridList);
// log.info("returnDto.getSubRankList()="+returnDto.getSubRankList());
int participateUserTotal = 0;
int participateTotal = 0;
@ -174,11 +161,9 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
participateUserTotal += subAgency.getParticipateUserTotal();
participateTotal += subAgency.getParticipateTotal();
}
if (CollectionUtils.isNotEmpty(currentAgency)) {
for (WorkRecordSubRank m : currentAgency) {
participateUserTotal += m.getParticipateUserTotal();
participateTotal += m.getParticipateTotal();
}
if (null != currentAgency) {
participateUserTotal += currentAgency.getParticipateUserTotal();
participateTotal += currentAgency.getParticipateTotal();
}
returnDto.setParticipateTotal(participateTotal);
returnDto.setParticipateUserTotal(participateUserTotal);
@ -262,9 +247,9 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId());
List<String> orgIds = new ArrayList<>();
orgIds.addAll(agencyInfoDTO.getSubAgencyIds());
orgIds.add(agencyInfoDTO.getAgencyId());
orgIds.addAll(agencyInfoDTO.getSubGridIds());
orgIds.addAll(agencyInfoDTO.getSubAgencies().stream().map(agency->agency.getAgencyId()).collect(Collectors.toSet()));
orgIds.add(agencyInfoDTO.getCurrentAgencyId());
orgIds.addAll(agencyInfoDTO.getSubGrids().stream().map(grid->grid.getGridId()).collect(Collectors.toSet()));
List<VoluntaryServiceTrendDTO> list = screenWorkRecordOrgMonthlyDao.selectVoluntaryServiceTrendDTO(formDTO.getCustomerId(),
orgIds,
monthIdList.get(NumConstant.ZERO),

104
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

@ -3,19 +3,6 @@
<mapper namespace="com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao">
<select id="selectLatestDateId" resultType="java.lang.String" parameterType="map">
SELECT
max( m.DATE_ID ) AS maxDateId
FROM
screen_work_record_org_daily m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID in
<foreach item="customerId" collection="customerIds" open="(" separator="," close=")">
#{customerId}
</foreach>
</select>
<select id="selectSubList" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.AGENCY_ID AS orgId,
@ -91,33 +78,76 @@
</select>
<select id="selectCurrentAgency" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
SELECT
sca.AGENCY_ID AS orgId,
sca.AGENCY_NAME AS `NAME`,
IFNULL( sum( temp.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( temp.ORGANIZE_TOTAL ), 0 ) AS participateTotal
IFNULL( sum( m.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( m.ORGANIZE_TOTAL ), 0 ) AS participateTotal
FROM
screen_customer_agency sca
left join (
select m.* from screen_work_record_org_daily m
where m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
and m.TYPE_CODE in(
select distinct dict.RESOURCE_CODE
from screen_customer_work_record_dict dict
where dict.DEL_FLAG = '0'
and dict.`LEVEL`='1'
AND dict.DATA_TYPE =#{dataType}
and dict.CUSTOMER_ID=#{customerId}
)
and org_id =#{agencyId}
)temp on(sca.AGENCY_ID = temp.ORG_ID)
screen_work_record_org_daily m
inner join screen_customer_agency sca
on(m.ORG_ID=sca.AGENCY_ID)
WHERE
sca.DEL_FLAG = '0'
AND sca.AGENCY_ID=#{agencyId}
group by sca.AGENCY_ID,sca.AGENCY_NAME
ORDER BY
participateUserTotal DESC,
participateTotal DESC
m.DEL_FLAG = '0'
and sca.DEL_FLAG='0'
AND m.DATE_ID = #{dateId}
AND m.org_id = #{agencyId}
AND m.TYPE_CODE IN
<foreach item="typeCode" collection="typeCodeList" open="(" separator="," close=")">
#{typeCode}
</foreach>
</select>
<select id="selectCustomerTypeCode" parameterType="map" resultType="java.lang.String">
select distinct dict.RESOURCE_CODE
from screen_customer_work_record_dict dict
where dict.DEL_FLAG = '0'
and dict.`LEVEL`='1'
AND dict.DATA_TYPE =#{dataType}
and dict.CUSTOMER_ID=#{customerId}
</select>
<select id="selectUpToCalAgency" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.AGENCY_ID AS orgId,
sca.AGENCY_NAME AS `NAME`,
sum( m.PARTICIPATE_USER_TOTAL ) AS participateUserTotal,
sum( m.ORGANIZE_TOTAL ) AS participateTotal
FROM
screen_work_record_org_daily m
inner join screen_customer_agency sca
on(m.ORG_ID=sca.AGENCY_ID
and sca.DEL_FLAG='0'
AND sca.pids like concat('%',#{agencyId},'%')
)
WHERE
m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
AND m.TYPE_CODE IN
<foreach item="typeCode" collection="typeCodeList" open="(" separator="," close=")">
#{typeCode}
</foreach>
</select>
<select id="selectUpToCalGrid" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.GRID_ID AS orgId,
sca.grid_name AS `NAME`,
sum( m.PARTICIPATE_USER_TOTAL ) AS participateUserTotal,
sum( m.ORGANIZE_TOTAL ) AS participateTotal
FROM
screen_work_record_org_daily m
inner join screen_customer_grid scg
on(m.ORG_ID=scg.grid_id
and scg.DEL_FLAG='0'
AND scg.ALL_PARENT_IDS like concat('%',#{agencyId},'%')
)
WHERE
m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
AND m.TYPE_CODE IN
<foreach item="typeCode" collection="typeCodeList" open="(" separator="," close=")">
#{typeCode}
</foreach>
</select>
</mapper>

5
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -305,9 +305,10 @@
</choose>
</select>
<select id="selectSubAgencyIds" parameterType="map" resultType="java.lang.String">
<select id="selectSubAgencyIds" parameterType="map" resultType="com.epmet.dto.ScreenCustomerAgencyCommonDTO">
SELECT
sca.AGENCY_ID as orgId
sca.AGENCY_ID as agencyId,
sca.AGENCY_NAME as agencyName
FROM
screen_customer_agency sca
WHERE

5
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml

@ -122,9 +122,10 @@
GROUP BY scg.PARENT_AGENCY_ID
</select>
<select id="selectSubGridIds" parameterType="map" resultType="java.lang.String">
<select id="selectSubGridIds" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridCommonDTO">
SELECT
m.GRID_ID as orgId
m.GRID_ID as gridId,
m.grid_name as gridName
FROM
screen_customer_grid m
where m.DEL_FLAG = '0'

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java

@ -1,6 +1,6 @@
package com.epmet.dto.indexcal;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import lombok.Data;
import java.io.Serializable;

8
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java

@ -18,6 +18,14 @@ public class ScreenWorkRecordCommonFormDTO implements Serializable {
* 组织Id或者网格id
*/
private String orgId;
/**
* org_id的上级
*/
private String pid;
/**
* org_id的所有上级英文冒号或者顿号隔开都可
*/
private String pids;
/**
* 组织名称或者网格名

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java

@ -15,11 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
package com.epmet.dto.screen;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -18,11 +18,11 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectGridDailyDTO;
import com.epmet.dto.screencoll.form.CustomerGridFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java

@ -1,8 +1,8 @@
package com.epmet.service.evaluationindex.indexcal;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.support.normalizing.batch.CalculateResult;
import com.epmet.support.normalizing.batch.IndexInputVO;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -19,8 +19,8 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDa
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.*;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java

@ -16,7 +16,6 @@ import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.*;
import com.epmet.dao.evaluationindex.screen.*;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.result.AgencyMonthCountResultDTO;
import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
@ -24,6 +23,7 @@ import com.epmet.dto.indexcal.DeptScoreDTO;
import com.epmet.dto.indexcollect.form.*;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO;
import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -19,10 +19,10 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectGridDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
@ -102,7 +102,7 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @author zxc
* @date 2021/3/23 下午4:02
*/
List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId,String level);
List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId, String level);
Integer updateCenterPointByName(String customerId, String title, List<Double> center);

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -26,10 +26,10 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectGridDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java

@ -30,8 +30,8 @@ import com.epmet.constant.PingYinConstant;
import com.epmet.constant.ScreenConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao;
import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml

@ -65,7 +65,7 @@
</select>
<!-- 查询客户下网格信息 -->
<select id="selectListByCustomerId" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectListByCustomerId" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
m.GRID_ID,
m.CUSTOMER_ID,
@ -78,7 +78,7 @@
</select>
<!-- 分页查询网格列表 -->
<select id="pageListByCustomerId" resultType="com.epmet.dto.ScreenCustomerGridDTO" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO">
<select id="pageListByCustomerId" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO">
SELECT
m.GRID_ID,
m.CUSTOMER_ID,
@ -93,7 +93,7 @@
</select>
<!-- -->
<select id="selectParentAgencyId" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectParentAgencyId" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
PARENT_AGENCY_ID,
ALL_PARENT_IDS
@ -104,7 +104,7 @@
AND m.GRID_ID = #{gridId}
</select>
<select id="selectListMismatchGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectListMismatchGridInfo" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
GRID_ID gridId,
GRID_NAME gridName,
@ -130,7 +130,7 @@
</if>
</select>
<select id="selectListGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectListGridInfo" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
GRID_ID gridId,
GRID_NAME gridName,
@ -361,7 +361,7 @@
</select>
<!-- 查询直属网格信息 -->
<select id="selectBelongGridInfo" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectBelongGridInfo" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
sca.AGENCY_ID AS PID,
sca.PIDS,

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

@ -17,6 +17,8 @@
customer_id,
DATE_ID,
org_id,
pid,
pids,
org_name,
meeting_code,
type_code,
@ -36,6 +38,8 @@
#{customerId},
#{dateId},
#{item.orgId},
#{item.pid},
#{item.pids},
#{item.orgName},
#{item.meetingCode},
#{item.typeCode},

Loading…
Cancel
Save