From e45b0edce83af2eded23eda828d94dd6cbb19ee0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 13:31:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/ScreenProjectGridDailyDTO.java | 7 ++++- .../screen/ScreenCustomerGridService.java | 3 +++ .../impl/ScreenCustomerGridServiceImpl.java | 6 +++++ .../epmet/service/impl/EIDimServiceImpl.java | 26 +++++++++++++++---- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java index c1f5f2ed12..60fdc4a14a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java @@ -55,6 +55,11 @@ public class ScreenProjectGridDailyDTO implements Serializable { */ private String gridId; + /** + * 网格id + */ + private String gridName; + /** * 网格所属的组织id */ @@ -149,4 +154,4 @@ public class ScreenProjectGridDailyDTO implements Serializable { this.delFlag = NumConstant.ZERO_STR; this.revision = NumConstant.ZERO; } -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index eeb24aad81..d19a8bfca8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -23,6 +23,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -104,4 +105,6 @@ public interface ScreenCustomerGridService extends BaseService selectBelongGridInfo(String customerId,String level); Integer updateCenterPointByName(String customerId, String title, List center); + + List selectGridInfoByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 7253d1bc1b..b7f23a6ba1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; @@ -199,4 +200,9 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectGridInfoByCustomerId(String customerId) { + return baseDao.selectGridInfoByCustomerId(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java index b80c287843..0633983ea4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java @@ -1,6 +1,6 @@ package com.epmet.service.impl; -import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.dto.screen.form.GridCenterPointForm; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; @@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; @Service public class EIDimServiceImpl implements EIDimService { @@ -132,14 +133,29 @@ public class EIDimServiceImpl implements EIDimService { @Override public Map updateCenterPointByName(GridCenterPointForm param) { //todo 怎么反向判断 左匹配 - List gridInfoList = screenCustomerGridService.selectAllGridInfo(param.getCustomerId()); + List gridInfos = screenCustomerGridService.selectGridInfoByCustomerId(param.getCustomerId()); Map result = new HashMap<>(); - param.getCenterDataList().forEach(o ->{ - Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + + + gridInfos.forEach(grid->{ + //客户id 和组织id 都相等 且 名字 包含关系时才修改 + if (grid.getCustomerId().equals(param.getCustomerId())){ + AtomicInteger integer = new AtomicInteger(0); + param.getCenterDataList().forEach(o ->{ + if (grid.getGridName().contains(o.getTitle())) { + Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + integer.addAndGet(effectRow); + } + result.put(grid.getGridId(),integer.intValue()); + }); + } + }); + /*param.getCenterDataList().forEach(o ->{ + Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(),param.getAgencyId(), o.getTitle(), o.getCenter()); if (integer == 0 || integer > 1){ result.put(o.getTitle(),integer); } - }); + });*/ return result; }