jianjun 4 years ago
parent
commit
24df6b0d99
  1. 43
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  2. 22
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

43
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -198,7 +198,7 @@
</select>
<select id="getSelfProject" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
da.ID,
da.ID AS "agencyId",
SUM( sum ) AS "sum",
SUM( count ) AS "count"
FROM
@ -252,7 +252,7 @@
</select>
<select id="getResolveProject" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
da.ID,
da.ID AS "agencyId",
SUM( sum ) AS "sum",
SUM( count ) AS "count"
FROM
@ -900,42 +900,7 @@
</select>
<select id="getSelfProjectDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.AGENCY_ID,
a.count AS "sum",
IFNULL(b.count,0) AS "count"
FROM
(SELECT
da.ID AS AGENCY_ID,
COUNT( fm.ID ) AS "count"
FROM
fact_origin_project_main_daily fm
INNER JOIN dim_agency da ON fm.PIDS LIKE CONCAT( '%', da.ID, '%' )
AND da.`LEVEL` = #{level}
WHERE
fm.PROJECT_STATUS = 'closed'
AND fm.CUSTOMER_ID = #{customerId}
AND fm.DATE_ID &lt;= #{dateId}
GROUP BY
da.ID) a
LEFT JOIN
(SELECT
da.ID AS AGENCY_ID,
COUNT( fm.ID ) AS "count"
FROM
fact_origin_project_main_daily fm
INNER JOIN dim_agency da ON fm.PIDS LIKE CONCAT( '%', da.ID, '%' )
AND da.`LEVEL` = #{level}
WHERE
fm.PROJECT_STATUS = 'closed'
AND fm.CUSTOMER_ID = #{customerId}
AND fm.DATE_ID &lt;= #{dateId}
AND fm.FINISH_ORG_IDS LIKE CONCAT('%', fm.AGENCY_ID,'%')
GROUP BY
da.ID) b
ON a.AGENCY_ID = b.AGENCY_ID
SELECT
da.ID,
da.ID AS "agencyId",
SUM( sum ) AS "sum",
SUM( count ) AS "count"
FROM
@ -989,7 +954,7 @@
</select>
<select id="getResolveProjectDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
da.ID,
da.ID AS "agencyId",
SUM( sum ) AS "sum",
SUM( count ) AS "count"
FROM

22
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.opendata.service.BaseConflictsResolveService;
import com.epmet.opendata.service.BaseDisputeProcessService;
import com.epmet.opendata.service.ExDeptService;
import com.epmet.opendata.service.ExUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -47,6 +48,7 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Slf4j
@Service
public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputeProcessDao, BaseDisputeProcessEntity> implements BaseDisputeProcessService {
@Resource
@ -90,7 +92,10 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
}
private void saveEvent(EventInfoFormDTO formDTO, Map<String, Integer> deptMap, Map<String, Integer> userMap, List<EventInfoResultDTO> list) {
if (CollectionUtils.isNotEmpty(list)) {
if (CollectionUtils.isEmpty(list)) {
log.warn("no event data to save table base_conflicts_resolve");
return;
}
List<BaseConflictsResolveEntity> resolveList = list.stream().map(item -> {
BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
@ -103,13 +108,13 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
entity.setHappenPlace(item.getHappenPlace());
String eventDescription = item.getEventDescription();
//如果不为空 长度控制1000以内
if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND){
eventDescription = eventDescription.substring(NumConstant.ZERO,NumConstant.ONE_THOUSAND);
if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND) {
eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.ONE_THOUSAND);
}
entity.setEventDescription(eventDescription);
entity.setLng(null == item.getLng()?null:item.getLng().toPlainString());
entity.setLat(null == item.getLat()?null:item.getLat().toPlainString());
entity.setCreateBy(null == userMap.get(item.getReporterId())?null:String.valueOf(userMap.get(item.getReporterId())));
entity.setLng(null == item.getLng() ? null : item.getLng().toPlainString());
entity.setLat(null == item.getLat() ? null : item.getLat().toPlainString());
entity.setCreateBy(null == userMap.get(item.getReporterId()) ? null : String.valueOf(userMap.get(item.getReporterId())));
entity.setCreateDate(item.getReportTime());
entity.setUpdateDate(new Date());
entity.setStatus(item.getStatus());
@ -117,6 +122,10 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
if (("03").equals(item.getStatus())) {
entity.setSuccessfulOrNot("Y");
}
//业务不包含 一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2)
if ("03".equals(item.getParentEventCategory())) {
entity.setNumberInvolved(NumConstant.TWO);
}
entity.setEventNo(("py_").concat(item.getId()));
entity.setFirstEventCategory(item.getParentEventCategory());
entity.setSource("01");
@ -129,5 +138,4 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize());
}
}
}

Loading…
Cancel
Save