Browse Source

Merge branch 'dev_issue_category' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_issue_category

dev_shibei_match
sunyuchao 4 years ago
parent
commit
a6483e8021
  1. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java
  3. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java
  4. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java
  5. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java
  6. 48
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -2,6 +2,7 @@ package com.epmet.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -37,10 +38,7 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService; import com.epmet.service.evaluationindex.screen.*;
import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -49,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
@ -103,6 +102,11 @@ public class DemoController {
private GovernRankDataExtractService governRankDataExtractService; private GovernRankDataExtractService governRankDataExtractService;
@Autowired @Autowired
private OrgRankExtractService orgRankExtractService; private OrgRankExtractService orgRankExtractService;
@Autowired
private ScreenProjectSettleService screenProjectSettleService;
@Autowired
private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService;
@GetMapping("testAlarm") @GetMapping("testAlarm")
public void testAlarm() { public void testAlarm() {
//for (int i = 0; i < 20; i++) { //for (int i = 0; i < 20; i++) {
@ -815,8 +819,6 @@ public class DemoController {
return new Result(); return new Result();
}*/ }*/
@Autowired
private ScreenProjectSettleService screenProjectSettleService;
@PostMapping("project-test") @PostMapping("project-test")
public Result project(@RequestBody ScreenCentralZoneDataFormDTO param){ public Result project(@RequestBody ScreenCentralZoneDataFormDTO param){
screenProjectSettleService.extractScreenData(param); screenProjectSettleService.extractScreenData(param);
@ -828,4 +830,11 @@ public class DemoController {
System.out.println(monthId); System.out.println(monthId);
} }
} }
@PostMapping("extractProjectCategoryData")
public Result extractProjectCategoryData(@RequestParam("customerId") String customerId){
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
projectCategoryGridDailyService.extractProjectCategoryData(customerId,dateId);
return new Result();
}
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java

@ -18,10 +18,13 @@
package com.epmet.dao.evaluationindex.extract; package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 项目所属分类表 * 项目所属分类表
* *
@ -32,4 +35,12 @@ import org.apache.ibatis.annotations.Param;
public interface FactOriginProjectCategoryDailyDao extends BaseDao<FactOriginProjectCategoryDailyEntity> { public interface FactOriginProjectCategoryDailyDao extends BaseDao<FactOriginProjectCategoryDailyEntity> {
void deleteOldData(@Param("customerId") String customerId,@Param("dateId") String dateId); void deleteOldData(@Param("customerId") String customerId,@Param("dateId") String dateId);
/**
* @param customerId
* @author yinzuomei
* @description 计算当前客户下各个网格内各项目分类下项目数量
* @Date 2021/3/23 9:58
**/
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId);
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java

@ -19,8 +19,11 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
import java.util.List;
/** /**
* 项目所属分类表 * 项目所属分类表
* *
@ -36,4 +39,12 @@ public interface FactOriginProjectCategoryDailyService extends BaseService<FactO
* @Date 2021/3/22 15:28 * @Date 2021/3/22 15:28
*/ */
void extractProjectCategory(ExtractOriginFormDTO paramNew); void extractProjectCategory(ExtractOriginFormDTO paramNew);
/**
* @param customerId
* @author yinzuomei
* @description 计算当前客户下各个网格内各项目分类下项目数量
* @Date 2021/3/23 9:56
**/
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(String customerId);
} }

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectCategoryDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectCategoryDailyDao;
import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import com.epmet.service.Issue.IssueProjectCategoryDictService; import com.epmet.service.Issue.IssueProjectCategoryDictService;
@ -105,4 +106,17 @@ public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl<F
baseDao.deleteOldData(customerId, dateId); baseDao.deleteOldData(customerId, dateId);
insertBatch(result); insertBatch(result);
} }
/**
* @param customerId
* @author yinzuomei
* @description 计算当前客户下各个网格内各项目分类下项目数量
* @Date 2021/3/23 9:56
**/
@Override
public List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(String customerId) {
List<ScreenProjectCategoryGridDailyDTO> list=baseDao.selectListProjectCategoryGridDailyDTO(customerId);
return list;
}
} }

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

@ -30,8 +30,11 @@ import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryGridDailyService; import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryGridDailyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -46,10 +49,12 @@ import java.util.Map;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23 * @since v1.0.0 2021-02-23
*/ */
@Slf4j
@Service @Service
@DataSource(DataSourceConstant.EVALUATION_INDEX) @DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl<ScreenProjectCategoryGridDailyDao, ScreenProjectCategoryGridDailyEntity> implements ScreenProjectCategoryGridDailyService { public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl<ScreenProjectCategoryGridDailyDao, ScreenProjectCategoryGridDailyEntity> implements ScreenProjectCategoryGridDailyService {
@Autowired
private FactOriginProjectCategoryDailyService factOriginProjectCategoryDailyService;
@Override @Override
public PageData<ScreenProjectCategoryGridDailyDTO> page(Map<String, Object> params) { public PageData<ScreenProjectCategoryGridDailyDTO> page(Map<String, Object> params) {
@ -138,7 +143,9 @@ public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl<S
**/ **/
@Override @Override
public void extractProjectCategoryData(String customerId, String dateId) { public void extractProjectCategoryData(String customerId, String dateId) {
//todo List<ScreenProjectCategoryGridDailyDTO> listDTO= factOriginProjectCategoryDailyService.selectListProjectCategoryGridDailyDTO(customerId);
boolean insertRes=insertBatch(ConvertUtils.sourceToTarget(listDTO, ScreenProjectCategoryGridDailyEntity.class));
log.info("insertRes is {}",insertRes);
} }
} }

48
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml

@ -14,4 +14,52 @@
</if> </if>
</delete> </delete>
<!-- 计算当前客户下,各个网格内,各项目分类下项目数量 -->
<!-- 先算出二级分类的 + 一级分类 -->
<select id="selectListProjectCategoryGridDailyDTO" parameterType="map" resultType="com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO">
SELECT
c.CUSTOMER_ID,
c.CATEGORY_CODE,
c.`LEVEL`,
p.GRID_ID,
p.AGENCY_ID AS PID,
P.PIDS,
count(1)as projectTotal
FROM
fact_origin_project_category_daily c
LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0')
WHERE
c.DEL_FLAG = '0'
AND c.CUSTOMER_ID = #{customerId}
AND c.`LEVEL` = '2'
GROUP BY
c.CUSTOMER_ID,
c.CATEGORY_CODE,
c.`LEVEL`,
p.GRID_ID,
p.AGENCY_ID,
P.PIDS
union all
SELECT
c.CUSTOMER_ID,
left(c.CATEGORY_CODE, 4) as CATEGORY_CODE,
c.`LEVEL`,
p.GRID_ID,
p.AGENCY_ID AS PID,
P.PIDS,
count(distinct c.project_id)as projectTotal
FROM
fact_origin_project_category_daily c
LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0')
WHERE
c.DEL_FLAG = '0'
AND c.CUSTOMER_ID = #{customerId}
GROUP BY
c.CUSTOMER_ID,
left(c.CATEGORY_CODE, 4),
c.`LEVEL`,
p.GRID_ID,
p.AGENCY_ID,
P.PIDS
</select>
</mapper> </mapper>

Loading…
Cancel
Save