Browse Source

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

dev
yinzuomei 4 years ago
parent
commit
e1948c532a
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java
  3. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java
  4. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  5. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -47,6 +47,7 @@ public interface NumConstant {
BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100); BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100);
BigDecimal ZERO_DECIMAL = new BigDecimal(0); BigDecimal ZERO_DECIMAL = new BigDecimal(0);
int ONE_THOUSAND = 1000; int ONE_THOUSAND = 1000;
int TEN_THOUSAND = 10000;
int MAX = 99999999; int MAX = 99999999;
int EIGHTY_EIGHT = 88; int EIGHTY_EIGHT = 88;
int EIGHTY = 80; int EIGHTY = 80;

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java

@ -76,7 +76,7 @@ public class ShiBeiICJobController {
* @Author sun * @Author sun
* @Description 数据-项目-机关日()统计 * @Description 数据-项目-机关日()统计
**/ **/
private Result agencyProjectStats(String customerId, String dateId) { private void agencyProjectStats(String customerId, String dateId) {
try { try {
if (StringUtils.isNotBlank(dateId)) { if (StringUtils.isNotBlank(dateId)) {
dateId = DateUtils.format(DateUtils.parseDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); dateId = DateUtils.format(DateUtils.parseDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD));
@ -89,7 +89,7 @@ public class ShiBeiICJobController {
} catch (Exception e) { } catch (Exception e) {
log.error("市北-项目状态数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e); log.error("市北-项目状态数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e);
} }
return new Result(); new Result();
} }
private void extractUserPointData(String customerId, String dateId) { private void extractUserPointData(String customerId, String dateId) {

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

@ -25,6 +25,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.dao.evaluationindex.screen.ScreenPartyUserRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired; 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;
@ -61,7 +62,7 @@ public class ScreenPartyUserRankDataServiceImpl extends BaseServiceImpl<ScreenPa
do { do {
affectedRows = baseDao.deletePartyUserRankData(customerId); affectedRows = baseDao.deletePartyUserRankData(customerId);
} while (affectedRows > NumConstant.ZERO); } while (affectedRows > NumConstant.ZERO);
baseDao.insertBatch(dataList); ListUtils.partition(dataList,NumConstant.ONE_THOUSAND).forEach(part->baseDao.insertBatch(part));
} }
} }
} }

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

@ -1,6 +1,5 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ProjectConstant; import com.epmet.constant.ProjectConstant;
@ -80,8 +79,8 @@ public class StatsProjectServiceImpl implements StatsProjectService {
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) {
customerAgencyStats(formDTO.getCustomerId(), date); customerAgencyStats(formDTO.getCustomerId(), date);
} else { } else {
int pageNo = 1; int pageNo = NumConstant.ONE;
int pageSize = 100; int pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIdList = null; List<String> customerIdList = null;
do { do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
@ -185,10 +184,10 @@ public class StatsProjectServiceImpl implements StatsProjectService {
projectEntity.setCustomerId(customerId); projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(date); projectEntity.setCreatedTime(date);
projectEntity.setStatus(ProjectConstant.CLOSED); projectEntity.setStatus(ProjectConstant.CLOSED);
projectEntity.setPageSize(NumConstant.ONE_THOUSAND); projectEntity.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = NumConstant.ONE; int pageNo = NumConstant.ONE;
int size = NumConstant.ZERO; int size;
List<ProjectProcessEntity> processList = new ArrayList<>(); List<ProjectProcessEntity> processList = null;
do { do {
//1.一千条一循环查询节点数据,封装每个组织对应数据 //1.一千条一循环查询节点数据,封装每个组织对应数据
projectEntity.setPageNo(pageNo); projectEntity.setPageNo(pageNo);
@ -278,7 +277,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
} }
mapList.put(agency.getId(), entity); mapList.put(agency.getId(), entity);
} }
} while (size == NumConstant.ONE_THOUSAND); } while (size == projectEntity.getPageSize());
//二、再分页查询项目表数据,封装每个组织的已结案已解决总数、已结案未解决总数;日增量中已结案已解决总数、已结案未解决总数 //二、再分页查询项目表数据,封装每个组织的已结案已解决总数、已结案未解决总数;日增量中已结案已解决总数、已结案未解决总数
int num = NumConstant.ONE; int num = NumConstant.ONE;
@ -374,7 +373,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
} }
mapList.put(agency.getId(), entity); mapList.put(agency.getId(), entity);
} }
} while (size == NumConstant.ONE_THOUSAND); } while (size == projectEntity.getPageSize());
List<FactAgencyProjectDailyEntity> projectDateEntityList = new ArrayList<>(mapList.values()); List<FactAgencyProjectDailyEntity> projectDateEntityList = new ArrayList<>(mapList.values());
//三、批量保存数据,先删后增 //三、批量保存数据,先删后增

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -81,6 +81,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addFirstCategory(AddFirstCategoryFormDTO formDTO) { public void addFirstCategory(AddFirstCategoryFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) { if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) {
// 名称唯一 // 名称唯一
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在");
@ -105,6 +106,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void addChild(AddCategoryFormDTO formDTO) { public void addChild(AddCategoryFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
if(NumConstant.ZERO_STR.equals(formDTO.getParentCategoryCode())){ if(NumConstant.ZERO_STR.equals(formDTO.getParentCategoryCode())){
throw new RenException("添加一级分类,调用接口/heart/icresidemanddict/addfirst"); throw new RenException("添加一级分类,调用接口/heart/icresidemanddict/addfirst");
} }
@ -160,8 +162,9 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(UpdateFormDTO formDTO) { public void update(UpdateFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId()); IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId());
if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) { if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), formDTO.getLevel(), origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) {
// 名称唯一 // 名称唯一
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在");
} }

Loading…
Cancel
Save