- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.redis;
-
-import com.epmet.commons.tools.redis.RedisUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 客户部门表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-04-20
- */
-@Component
-public class CustomerDepartmentRedis {
- @Autowired
- private RedisUtils redisUtils;
-
- public void delete(Object[] ids) {
-
- }
-
- public void set(){
-
- }
-
- public String get(String id){
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java
deleted file mode 100644
index 3d69fe3ca8..0000000000
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridRedis.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.redis;
-
-import com.epmet.commons.tools.redis.RedisUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 客户网格表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-03-16
- */
-@Component
-public class CustomerGridRedis {
- @Autowired
- private RedisUtils redisUtils;
-
- public void delete(Object[] ids) {
-
- }
-
- public void set(){
-
- }
-
- public String get(String id){
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java
deleted file mode 100644
index e5d8d70e5e..0000000000
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.redis;
-
-import com.epmet.commons.tools.redis.RedisUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 党支部信息
- *
- * @author yinzuomei yinzuomei@elink-cn.com
- * @since v1.0.0 2020-06-17
- */
-@Component
-public class CustomerPartyBranchRedis {
- @Autowired
- private RedisUtils redisUtils;
-
- public void delete(Object[] ids) {
-
- }
-
- public void set(){
-
- }
-
- public String get(String id){
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java
deleted file mode 100644
index fa3f4c59f5..0000000000
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffAgencyRedis.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.redis;
-
-import com.epmet.commons.tools.redis.RedisUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 人员-机关单位关系表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-04-20
- */
-@Component
-public class CustomerStaffAgencyRedis {
- @Autowired
- private RedisUtils redisUtils;
-
- public void delete(Object[] ids) {
-
- }
-
- public void set(){
-
- }
-
- public String get(String id){
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java
deleted file mode 100644
index 3c8bfdb608..0000000000
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffDepartmentRedis.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.redis;
-
-import com.epmet.commons.tools.redis.RedisUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 部门人员关系表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-04-20
- */
-@Component
-public class CustomerStaffDepartmentRedis {
- @Autowired
- private RedisUtils redisUtils;
-
- public void delete(Object[] ids) {
-
- }
-
- public void set(){
-
- }
-
- public String get(String id){
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java
deleted file mode 100644
index 23b0eab20a..0000000000
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerStaffGridRedis.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.redis;
-
-import com.epmet.commons.tools.redis.RedisUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 网格人员关系表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-04-20
- */
-@Component
-public class CustomerStaffGridRedis {
- @Autowired
- private RedisUtils redisUtils;
-
- public void delete(Object[] ids) {
-
- }
-
- public void set(){
-
- }
-
- public String get(String id){
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java
deleted file mode 100644
index deb0f9f76a..0000000000
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.redis;
-
-import com.epmet.commons.tools.redis.RedisUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 工作人员调动记录表
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-08-27
- */
-@Component
-public class StaffTransferRecordRedis {
- @Autowired
- private RedisUtils redisUtils;
-
- public void delete(Object[] ids) {
-
- }
-
- public void set(){
-
- }
-
- public String get(String id){
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
index b15e6f17c3..4bfc4487d3 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
@@ -19,7 +19,6 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@@ -46,7 +45,6 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.CustomerAgencyRedis;
-import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerOrgParameterService;
@@ -547,14 +545,25 @@ public class AgencyServiceImpl implements AgencyService {
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setLevel(OrgInfoConstant.AGENCY);
}
+ if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())){
+ result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude()));
+ }
+ if (StringUtils.isNotBlank(customerAgencyEntity.getLongitude())){
+ result.setLongitude(new BigDecimal(customerAgencyEntity.getLongitude()));
+ }
if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)){
CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getOrgId());
result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class);
result.setName(entity.getOrganizationName());
result.setLevel(formDTO.getLevel());
result.setAgencyLevel(entity.getLevel());
- result.setLatitude(StringUtils.isBlank(entity.getLatitude()) ? new BigDecimal(customerAgencyEntity.getLatitude()) : new BigDecimal(entity.getLatitude()));
- result.setLongitude(StringUtils.isBlank(entity.getLongitude()) ? new BigDecimal(customerAgencyEntity.getLongitude()) : new BigDecimal(entity.getLongitude()));
+ //经纬度 如果本级没有则取根级组织的 根级没有就空着
+ if (StringUtils.isNotBlank(entity.getLatitude())){
+ result.setLatitude(new BigDecimal(entity.getLatitude()));
+ }
+ if (StringUtils.isNotBlank(entity.getLongitude())){
+ result.setLongitude(new BigDecimal(entity.getLongitude()));
+ }
if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)){
List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID);
if (CollectionUtils.isNotEmpty(son)){
@@ -576,12 +585,9 @@ public class AgencyServiceImpl implements AgencyService {
if (CollectionUtils.isNotEmpty(directlySub)){
dtoList.addAll(directlySub);
}
- if (CollectionUtils.isNotEmpty(dtoList)){
- MapOrgResultDTO finalResult1 = result;
- dtoList.forEach(d -> {
- d.setLatitude(StringUtils.isBlank(d.getLatitudeOrigin()) ? finalResult1.getLatitude() : new BigDecimal(d.getLatitudeOrigin()));
- d.setLongitude(StringUtils.isBlank(d.getLongitudeOrigin()) ? finalResult1.getLongitude() : new BigDecimal(d.getLongitudeOrigin()));
- });
+ for (MapSonOrgResultDTO d : dtoList) {
+ d.setLatitude(StringUtils.isBlank(d.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(d.getLatitudeOrigin()));
+ d.setLongitude(StringUtils.isBlank(d.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(d.getLongitudeOrigin()));
}
result.setChildren(dtoList);
}
@@ -591,15 +597,19 @@ public class AgencyServiceImpl implements AgencyService {
result.setName(entity.getGridName());
result.setLevel(formDTO.getLevel());
result.setAgencyLevel(OrgInfoConstant.GRID);
- result.setLatitude(StringUtils.isBlank(entity.getLatitude()) ? new BigDecimal(customerAgencyEntity.getLatitude()) : new BigDecimal(entity.getLatitude()));
- result.setLongitude(StringUtils.isBlank(entity.getLongitude()) ? new BigDecimal(customerAgencyEntity.getLongitude()) : new BigDecimal(entity.getLongitude()));
+ //经纬度 如果本级没有则取根级组织的 根级没有就空着
+ if (StringUtils.isNotBlank(entity.getLatitude())){
+ result.setLatitude(new BigDecimal(entity.getLatitude()));
+ }
+ if (StringUtils.isNotBlank(entity.getLongitude())){
+ result.setLongitude(new BigDecimal(entity.getLongitude()));
+ }
List son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD);
if (CollectionUtils.isNotEmpty(son)){
- MapOrgResultDTO finalResult2 = result;
- son.forEach(s -> {
- s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? finalResult2.getLatitude() : new BigDecimal(s.getLatitudeOrigin()));
- s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? finalResult2.getLongitude() : new BigDecimal(s.getLongitudeOrigin()));
- });
+ for (MapSonOrgResultDTO s : son) {
+ s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(s.getLatitudeOrigin()));
+ s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(s.getLongitudeOrigin()));
+ }
}
result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son);
}
@@ -686,4 +696,4 @@ public class AgencyServiceImpl implements AgencyService {
return insertEntity;
}
-}
\ No newline at end of file
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java
index a236f77464..63acec3171 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java
@@ -20,18 +20,16 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dto.CustomerDepartmentDTO;
import com.epmet.dto.result.DepartmentListResultDTO;
import com.epmet.entity.CustomerDepartmentEntity;
-import com.epmet.redis.CustomerDepartmentRedis;
import com.epmet.service.CustomerDepartmentService;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -41,7 +39,7 @@ import java.util.List;
import java.util.Map;
/**
- * 客户部门表
+ * 客户部门表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
@@ -49,9 +47,6 @@ import java.util.Map;
@Service
public class CustomerDepartmentServiceImpl extends BaseServiceImpl implements CustomerDepartmentService {
- @Autowired
- private CustomerDepartmentRedis customerDepartmentRedis;
-
@Override
public PageData page(Map params) {
IPage page = baseDao.selectPage(
@@ -125,4 +120,4 @@ public class CustomerDepartmentServiceImpl extends BaseServiceImpl> getGridListByGridIds(List gridIdList) {
Result> result = new Result>();
- if (gridIdList.size() < NumConstant.ONE) {
- logger.error("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!");
+ if (CollectionUtils.isEmpty(gridIdList)) {
+ logger.warn("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!");
return result;
}
List list = baseDao.selectGridByIds(gridIdList);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java
index d9afbc1abc..57a1277cb0 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerPartyBranchServiceImpl.java
@@ -32,7 +32,6 @@ import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.ListPartyBranchFormDTO;
import com.epmet.dto.result.ListPartyBranchResultDTO;
import com.epmet.entity.CustomerPartyBranchEntity;
-import com.epmet.redis.CustomerPartyBranchRedis;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.service.CustomerPartyBranchService;
@@ -59,8 +58,6 @@ import java.util.stream.Collectors;
@Service
public class CustomerPartyBranchServiceImpl extends BaseServiceImpl implements CustomerPartyBranchService {
- @Autowired
- private CustomerPartyBranchRedis customerPartyBranchRedis;
@Autowired
private CustomerGridService customerGridService;
@Autowired
@@ -171,4 +168,4 @@ public class CustomerPartyBranchServiceImpl extends BaseServiceImpl implements CustomerStaffAgencyService {
- @Autowired
- private CustomerStaffAgencyRedis customerStaffAgencyRedis;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
@@ -251,4 +248,4 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl implements CustomerStaffGridService {
- @Autowired
- private CustomerStaffGridRedis customerStaffGridRedis;
-
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@@ -193,4 +189,4 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl eventOrg(String userId) {
return baseDao.eventOrg(userId);
}
-}
\ No newline at end of file
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java
index 6ef500a018..62401ef4cc 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java
@@ -20,16 +20,14 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.StaffTransferRecordDao;
import com.epmet.dto.StaffTransferRecordDTO;
import com.epmet.entity.StaffTransferRecordEntity;
-import com.epmet.redis.StaffTransferRecordRedis;
import com.epmet.service.StaffTransferRecordService;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -46,9 +44,6 @@ import java.util.Map;
@Service
public class StaffTransferRecordServiceImpl extends BaseServiceImpl implements StaffTransferRecordService {
- @Autowired
- private StaffTransferRecordRedis staffTransferRecordRedis;
-
@Override
public PageData page(Map params) {
IPage page = baseDao.selectPage(
@@ -101,4 +96,4 @@ public class StaffTransferRecordServiceImpl extends BaseServiceImpl implements BaseDisputeProcessService {
@Resource
@@ -90,44 +92,50 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl deptMap, Map userMap, List list) {
- if (CollectionUtils.isNotEmpty(list)) {
+ if (CollectionUtils.isEmpty(list)) {
+ log.warn("no event data to save table base_conflicts_resolve");
+ return;
+ }
- List resolveList = list.stream().map(item -> {
- BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
- entity.setId(item.getId().concat("_PY"));
- entity.setCustomerId(item.getCustomerId());
- entity.setGridId(deptMap.get(item.getOrgId()));
- entity.setGridName(item.getOrgName());
- entity.setEventName(item.getEventName());
- entity.setHappenDate(item.getHappenDate());
- 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);
- }
- 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.setCreateDate(item.getReportTime());
- entity.setUpdateDate(new Date());
- entity.setStatus(item.getStatus());
- //业务不确定
- if (("03").equals(item.getStatus())) {
- entity.setSuccessfulOrNot("Y");
- }
- entity.setEventNo(("py_").concat(item.getId()));
- entity.setFirstEventCategory(item.getParentEventCategory());
- entity.setSource("01");
- entity.setSecondEventCategory(item.getEventCategory());
- entity.setResolveWay(item.getWaysOfResolving());
- entity.setResolveGridLevel(item.getCompleteLevel());
- entity.setResolveTime(item.getCompleteTime());
- return entity;
- }).collect(Collectors.toList());
+ List resolveList = list.stream().map(item -> {
+ BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
+ entity.setId(item.getId().concat("_PY"));
+ entity.setCustomerId(item.getCustomerId());
+ entity.setGridId(deptMap.get(item.getOrgId()));
+ entity.setGridName(item.getOrgName());
+ entity.setEventName(item.getEventName());
+ entity.setHappenDate(item.getHappenDate());
+ 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);
+ }
+ 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.setCreateDate(item.getReportTime());
+ entity.setUpdateDate(new Date());
+ entity.setStatus(item.getStatus());
+ //业务不确定
+ 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");
+ entity.setSecondEventCategory(item.getEventCategory());
+ entity.setResolveWay(item.getWaysOfResolving());
+ entity.setResolveGridLevel(item.getCompleteLevel());
+ entity.setResolveTime(item.getCompleteTime());
+ return entity;
+ }).collect(Collectors.toList());
- baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize());
- }
+ baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize());
}
}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
index 4f25fd2803..1695aaba09 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
@@ -3,6 +3,7 @@ package com.epmet.modules.topic.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@@ -255,6 +256,7 @@ public class ResiTopicController {
* @author wangc
* @date 2020.05.13 19:08
**/
+ @NoRepeatSubmit
@PostMapping("turnintoissuev2")
public Result turnIntoIssueV2(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicTurnIssueFromDTO topicTurnIssueFromDTO){
topicTurnIssueFromDTO.setUserId(tokenDto.getUserId());
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java
index de8c542864..44da2f6a91 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java
@@ -2,6 +2,8 @@ package com.epmet.dto.form;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
@@ -14,5 +16,9 @@ public class UserIdsFormDTO implements Serializable {
private static final long serialVersionUID = -6168528618954442905L;
+ @NotBlank(message = "客户ID不能为空")
+ private String customerId;
+
+ @NotEmpty(message = "工作人员Id 不能为空")
private List userIds;
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
index 531d6791ac..4be5398b9e 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
@@ -21,7 +21,6 @@ import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
-import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
@@ -40,12 +39,10 @@ import com.epmet.excel.CustomerStaffExcel;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerStaffService;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;
@@ -367,7 +364,8 @@ public class CustomerStaffController {
* @date 2020/8/13 1:45 下午
*/
@PostMapping("getstaffinfolist")
- public Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO){
+ public Result> getStaffInfoList(@RequestHeader("customerId") String customerId,@RequestBody UserIdsFormDTO formDTO){
+ formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result>().ok(customerStaffService.getStaffInfoList(formDTO));
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
index 648c0e8245..e97ba4e662 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
-import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
@@ -54,7 +53,6 @@ import com.epmet.feign.AuthFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
-import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerStaffService;
import com.epmet.service.GovStaffRoleService;
import com.epmet.service.StaffRoleService;
@@ -64,7 +62,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -603,7 +600,31 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getStaffInfoList(UserIdsFormDTO formDTO) {
List userIds = formDTO.getUserIds();
// 1. 根据userId查询人员基本信息
- List staffInfoList = customerStaffDao.getStaffInfoList(userIds);
+ List staffInfoList = new ArrayList<>();
+ userIds.forEach(staffId->{
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId);
+ if (staffInfo ==null){
+ log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db",formDTO.getCustomerId(), staffId);
+ return;
+ }
+ StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO();
+ resultDTO.setStaffId(staffId);
+ resultDTO.setStaffName(staffInfo.getRealName());
+ resultDTO.setHeadPhoto(staffInfo.getHeadPhoto());
+ resultDTO.setGender(staffInfo.getGender());
+
+ List roleInfoList = new ArrayList<>();
+ staffInfo.getRoleMap().forEach((key,value) ->{
+ RoleResultDTO dto = new RoleResultDTO();
+ dto.setRoleKey(key);
+ dto.setRoleName(value);
+ roleInfoList.add(dto);
+ });
+ resultDTO.setRoleList(roleInfoList);
+ staffInfoList.add(resultDTO);
+ });
+
+ /*List staffInfoList = customerStaffDao.getStaffInfoList(userIds);
if (staffInfoList.size() == NumConstant.ZERO){
return staffInfoList;
}
@@ -619,7 +640,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>> errorRows = new ThreadLocal<>();
+ String fileName;
+
+ // 判断是否有错误信息,以确定文件名
+ boolean hasError = false;
+ Map> tableAndErrorRows = errorRows.get();
+ for (Map.Entry> entry:tableAndErrorRows.entrySet()) {
+ if (entry.getValue().size() != 0) {
+ hasError = true;
+ }
+ }
- String fileName = "导入失败条目清单.xls";
+ if (hasError) {
+ fileName = "导入失败条目清单.xls";
+ } else {
+ fileName = "导入成功.xls";
+ }
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls
deleted file mode 100644
index 9afbfdd669..0000000000
Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls and /dev/null differ