Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_screen_data_2.0

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java
master
yinzuomei 5 years ago
parent
commit
4c9c5da138
  1. 45
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java
  2. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java
  3. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  5. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
  6. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  7. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  8. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java
  9. 65
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java
  10. 45
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  11. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  12. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

45
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/16 1:27 下午
*/
@Data
public class IssueProcessInfoResultDTO implements Serializable {
private static final long serialVersionUID = 104679947108492259L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 机关ID
*/
private String agencyId;
/**
* 议题ID
*/
private String issueId;
/**
* 动作CODE
*/
private String actionCode;
/**
* 用户ID
*/
private String userId;
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java

@ -2,7 +2,12 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
@ -25,11 +30,19 @@ public class FactOriginController {
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@PostMapping("issueextract")
public Result issueExtract(){
@PostMapping("issueextractmain")
public Result issueExtractMain(){
String customerId = "3ef7e4bb195eb9e622d68b52509aa940";
String dateId = "20200811";
issueExtractService.issueExtractMain(customerId,dateId);
return new Result();
}
@PostMapping("issueextractlog")
public Result issueExtractLog(){
String customerId = "3ef7e4bb195eb9e622d68b52509aa940";
String dateId = "20200811";
issueExtractService.issueExtract(customerId,dateId);
issueExtractService.issueExtractLog(customerId,dateId);
return new Result();
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java

@ -42,4 +42,13 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
*/
void insertIssueLogList(@Param("issueLogList")List<IssueLogDailyFormDTO> issueLogList);
/**
* @Description 删除旧的记录
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 9:33 上午
*/
void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -49,5 +49,5 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @author zxc
* @date 2020/9/16 9:33 上午
*/
void deleteOldRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
void deleteOldMainRecord(@Param("customerId")String customerId, @Param("dateId")String dateId);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java

@ -1,6 +1,7 @@
package com.epmet.dao.issue;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
@ -113,5 +114,21 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
*/
List<IssueProjectDTO> selectIssueProjectList(@Param("customerId") String customerId);
/**
* @Description 查询议题信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -1,5 +1,6 @@
package com.epmet.service.Issue;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
@ -119,4 +120,13 @@ public interface IssueService {
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(String customerId,String dateId);
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(String customerId,String dateId);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.Issue.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.issue.StatsIssueDao;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
@ -93,4 +94,16 @@ public class IssueServiceImpl implements IssueService {
public List<IssueInfoResultDTO> selectIssueInfo(String customerId,String dateId) {
return statsIssueDao.selectIssueInfo(customerId, dateId);
}
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<IssueProcessInfoResultDTO> selectIssueProcessInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueProcessInfo(customerId, dateId);
}
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java

@ -7,12 +7,20 @@ package com.epmet.service.evaluationindex.extract;
public interface IssueExtractService {
/**
* @Description 议题抽取
* @Description 议题抽取(main)
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/15 2:02 下午
*/
Boolean issueExtract(String customerId,String dateId);
Boolean issueExtractMain(String customerId, String dateId);
/**
* @Description 议题抽取(log)
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 9:41 上午
*/
Boolean issueExtractLog(String customerId,String dateId);
}

65
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java

@ -1,15 +1,19 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.dto.form.TimeListResultDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.extract.FactOriginIssueMainDailyDTO;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.AgencyInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
@ -44,6 +48,8 @@ public class IssueExtractServiceImpl implements IssueExtractService {
private TopicService topicService;
@Autowired
private DimAgencyDao dimAgencyDao;
@Autowired
private FactOriginIssueLogDailyDao issueLogDailyDao;
/**
* @Description 议题抽取
@ -54,7 +60,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean issueExtract(String customerId, String dateId) {
public Boolean issueExtractMain(String customerId, String dateId) {
// 议题信息查询
List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId);
@ -125,9 +131,62 @@ public class IssueExtractServiceImpl implements IssueExtractService {
}
});
});
issueMainDailyDao.deleteOldRecord(customerId, dateId);
issueMainDailyDao.deleteOldMainRecord(customerId, dateId);
issueMainDailyDao.insertIssueMainList(result);
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean issueExtractLog(String customerId, String dateId) {
// 查询议题process
List<IssueProcessInfoResultDTO> listResult = issueService.selectIssueProcessInfo(customerId, dateId);
if (CollectionUtils.isEmpty(listResult)){
throw new RenException("查询查询议题process集合为空");
}
List<IssueLogDailyFormDTO> result = new ArrayList<>();
listResult.forEach(issueProcess -> {
IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class);
issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId());
result.add(issueLogDailyFormDTO);
});
// 动作操作人的身份标识是否是党员
List<String> userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList());
Map<String,Integer> map = userService.selectUserIsParty(userIds);
if (null != map){
result.forEach(r -> {
map.forEach((userId,isParty) -> {
if (r.getOperationUserId().equals(userId)){
r.setIsParty(isParty);
}
});
});
}
// 上级ID
List<String> agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList());
List<AgencyInfoResultDTO> agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds);
if (CollectionUtils.isEmpty(agencyInfoList)){
throw new RenException("查询组织上级ID集合为空......");
}
TimeListResultDTO timeList = DateUtils.getTimeList(dateId);
result.forEach(r -> {
r.setDateId(dateId);
r.setWeekId(timeList.getWeekId());
r.setMonthId(timeList.getMonthId());
r.setQuarterId(timeList.getQuarterId());
r.setYearId(timeList.getYearId());
agencyInfoList.forEach(agency -> {
if (r.getAgencyId().equals(agency.getAgencyId())){
r.setPid(agency.getPid());
}
});
});
issueLogDailyDao.deleteOldLogRecord(customerId, dateId);
issueLogDailyDao.insertIssueLogList(result);
return true;
}
}

45
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

@ -5,28 +5,44 @@
<!-- 议题记录附表插入 -->
<insert id="insertIssueLogList">
INSERT INTO fact_origin_issue_log_daily ( ID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, CUSTOMER_ID, USER_IDENTITY, USER_ID, CREATE_TOPIC_USER_ID, ISSUE_ID, TOPIC_ID, GRID_ID,
PID, AGENCY_ID, ISSUE_STATUS, TOPIC_USER_IDENTITY, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
INSERT INTO fact_origin_issue_log_daily (
ID,
CUSTOMER_ID,
GRID_ID,
PID,
AGENCY_ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
ISSUE_ID,
OPERATION_USER_ID,
ACTION_CODE,
IS_PARTY,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME)
VALUES
<foreach collection="issueLogList" item="item" index="index" separator=",">
(
REPLACE ( UUID(), '-', '' ),
#{item.customerId},
#{item.gridId},
#{item.pid},
#{item.agencyId},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.customerId},
#{item.userIdentity},
#{item.userId},
#{item.createTopicUserId},
#{item.issueId},
#{item.topicId},
#{item.gridId},
#{item.pid},
#{item.agencyId},
#{item.issueStatus},
#{item.topicUserIdentity},
#{item.operationUserId},
#{item.actionCode},
#{item.isParty},
#{item.delFlag},
#{item.revision},
#{item.createdBy},
@ -36,4 +52,9 @@
)
</foreach>
</insert>
<!-- 删除旧的记录 -->
<delete id="deleteOldLogRecord">
</delete>
</mapper>

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -58,12 +58,12 @@
</insert>
<!-- 删除旧的记录 -->
<delete id="deleteOldRecord">
<delete id="deleteOldMainRecord">
DELETE
FROM
fact_origin_issue_main_daily
fact_origin_issue_log_daily
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
AND DATE_ID = #{dateId}
</delete>
</mapper>

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

@ -199,4 +199,23 @@
AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
<!-- 查询议题process信息 -->
<select id="selectIssueProcessInfo" resultType="com.epmet.dto.extract.result.IssueProcessInfoResultDTO">
SELECT
i.GRID_ID AS gridId,
i.ORG_ID AS agencyId,
i.CUSTOMER_ID AS customerId,
ip.ISSUE_ID AS issueId,
ip.CREATED_BY AS userId,
ip.ISSUE_STATUS AS actionCode
FROM
issue_process ip
LEFT JOIN issue i ON i.id = ip.issue_id
WHERE
i.DEL_FLAG = '0'
AND ip.DEL_FLAG = '0'
AND i.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(i.CREATED_TIME,'%Y%m%d') = #{dateId}
</select>
</mapper>
Loading…
Cancel
Save