zxc 4 years ago
parent
commit
10fbf816f8
  1. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java
  2. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java
  3. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java
  4. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java
  5. 98
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java

@ -24,8 +24,7 @@ public class AgencyIssueFormDTO implements Serializable {
private List<DataList> dataList;
@Data
public class DataList implements Serializable {
private static final long serialVersionUID = 1L;
public static class DataList{
/**
* 客户ID

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java

@ -24,8 +24,7 @@ public class GridProjectFormDTO implements Serializable {
private List<DataList> dataList;
@Data
public class DataList implements Serializable {
private static final long serialVersionUID = 1L;
public static class DataList{
/**
* 客户Id dim_customer.id

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java

@ -121,4 +121,21 @@ public interface BaseReportDao {
* @date 2021/6/25 10:37 上午
*/
void insertGridProject(@Param("list")List<GridProjectFormDTO.DataList> dataList);
/**
* @Description 删除组织议题数据
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/6/25 10:53 上午
*/
int delAgencyIssue(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 新增组织议题数据
* @Param dataList
* @author zxc
* @date 2021/6/25 10:54 上午
*/
void insertAgencyIssue(@Param("list")List<AgencyIssueFormDTO.DataList> dataList);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java

@ -203,7 +203,20 @@ public class BaseReportServiceImpl implements BaseReportService {
@Override
@Transactional(rollbackFor = Exception.class)
public void agencyIssue(AgencyIssueFormDTO formDTO) {
if (CollectionUtils.isEmpty(formDTO.getDataList())){
log.warn(String.format(BaseReportConstant.DATA_IS_NULL),"组织议题");
return;
}
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = baseReportDao.delAgencyIssue(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId());
} while (deleteNum > NumConstant.ZERO);
}
List<List<AgencyIssueFormDTO.DataList>> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
baseReportDao.insertAgencyIssue(p);
});
}
/**

98
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml

@ -308,4 +308,102 @@
AND date_id = #{dateId}
LIMIT 1000
</delete>
<!-- 删除组织议题数据 -->
<delete id="delAgencyIssue">
DELETE FROM fact_issue_agency_daily
WHERE customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<!-- 新增组织议题数据 -->
<insert id="insertAgencyIssue">
INSERt INTO fact_issue_agency_daily
(ID,
CUSTOMER_ID,
AGENCY_ID,
PID,
YEAR_ID,
QUARTER_ID,
MONTH_ID,
WEEK_ID,
DATE_ID,
ISSUE_INCR,
ISSUE_TOTAL,
SHIFT_PROJECT_INCR,
SHIFT_PROJECT_TOTAL,
SHIFT_PROJECT_PERCENT,
VOTING_INCR,
VOTING_TOTAL,
VOTING_PERCENT,
CLOSED_INCR,
CLOSED_RESOLVED_INCR,
CLOSED_UNRESOLVED_INCR,
CLOSED_TOTAL,
CLOSED_RESOLVED_TOTAL,
CLOSED_UNRESOLVED_TOTAL,
CLOSED_PERCENT,
CLOSED_RESOLVED_PERCENT,
CLOSED_UNRESOLVED_PERCENT,
CLOSED_CASE_INCR,
CLOSED_CASE_RESOLVED_INCR,
CLOSED_CASE_UNRESOLVED_INCR,
CLOSED_CASE_TOTAL,
CLOSED_CASE_RESOLVED_TOTAL,
CLOSED_CASE_UNRESOLVED_TOTAL,
CLOSED_CASE_RESOLVED_PERCENT,
CLOSED_CASE_UNRESOLVED_PERCENT,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
DEL_FLAG,
UPDATED_TIME)
VALUES
<foreach collection="list" item="i" separator=",">
(
REPLACE(UUID(), '-', ''),
#{i.customerId},
#{i.agencyId},
#{i.pid},
#{i.yearId},
#{i.quarterId},
#{i.monthId},
#{i.weekId},
#{i.dateId},
#{i.issueIncr},
#{i.issueTotal},
#{i.shiftProjectIncr},
#{i.shiftProjectTotal},
#{i.shiftProjectPercent},
#{i.votingIncr},
#{i.votingTotal},
#{i.votingPercent},
#{i.closedIncr},
#{i.closedResolvedIncr},
#{i.closedUnresolvedIncr},
#{i.closedTotal},
#{i.closedResolvedTotal},
#{i.closedUnresolvedTotal},
#{i.closedPercent},
#{i.closedResolvedPercent},
#{i.closedUnresolvedPercent},
#{i.closedCaseIncr},
#{i.closedCaseResolvedIncr},
#{i.closedCaseUnresolvedIncr},
#{i.closedCaseTotal},
#{i.closedCaseResolvedTotal},
#{i.closedCaseUnresolvedTotal},
#{i.closedCaseResolvedPercent},
#{i.closedCaseUnresolvedPercent},
0,
'BASE_REPORT',
NOW(),
'BASE_REPORT',
0,
NOW()
)
</foreach>
</insert>
</mapper>

Loading…
Cancel
Save