From 73d4f5f0ace18aaffacc894f1ec294b3a0ef5c82 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 24 Nov 2021 17:32:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=88=9D=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcSocietyOrgController.java | 3 +- .../epmet/service/IcSocietyOrgService.java | 3 +- .../service/impl/IcSocietyOrgServiceImpl.java | 66 +++++++++++++++++-- .../dto/result/GetListPlaceOrgResultDTO.java | 5 +- .../GetListPlacePatrolRecordResultDTO.java | 5 +- ...tListPlacePatrolReviewRecordResultDTO.java | 5 +- .../GetListPlacePatrolTeamResultDTO.java | 5 +- .../PlacePatrolTeamDetailResultDTO.java | 3 +- .../epmet/dto/form/GetByRealNamesFormDTO.java | 26 ++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 7 ++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/CustomerStaffController.java | 9 +++ .../java/com/epmet/dao/CustomerStaffDao.java | 6 ++ .../epmet/service/CustomerStaffService.java | 6 ++ .../impl/CustomerStaffServiceImpl.java | 9 +++ .../resources/mapper/CustomerStaffDao.xml | 26 ++++++++ 16 files changed, 174 insertions(+), 15 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index de9749676a..3fe71d8b60 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -43,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -141,7 +142,7 @@ public class IcSocietyOrgController { * @Description 九小场所下组织列表导入---咱不能使用 程序未开发 **/ @PostMapping("import") - public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException { + public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException, ParseException { ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcSocietyOrgExcel.class); List failList = importResult.getFailList(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java index 0c5841b04a..f2646de029 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java @@ -27,6 +27,7 @@ import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.excel.IcSocietyOrgExcel; +import java.text.ParseException; import java.util.List; /** @@ -72,6 +73,6 @@ public interface IcSocietyOrgService extends BaseService { * @Author sun * @Description 九小场所下组织列表导入 **/ - List importExcel(String customerId, List result, String userId, List numList); + List importExcel(String customerId, List list, String staffId, List numList) throws ParseException; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index 1c6822e1c2..4e37c4cd50 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcSocietyOrgDao; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.*; @@ -46,9 +47,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; import java.util.stream.Collectors; /** @@ -179,7 +180,64 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl importExcel(String customerId, List result, String userId, List numList) { + public List importExcel(String customerId, List list, String staffId, List numList) throws ParseException { + //1.数据校验 只允许导入当前组织下社会组织 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + //组织名称不一样的数据舍弃 + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + IcSocietyOrgExcel obj = iterator.next(); + if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { + numList.add(obj.getRowNum()); + iterator.remove(); + } + } + if(CollectionUtils.isEmpty(list)){ + return numList; + } + + //2.查询绑定的管理员信息 + Set staffNames = list.stream().map(item -> item.getAdminStaffName().trim()).collect(Collectors.toSet()); + GetByRealNamesFormDTO dto = new GetByRealNamesFormDTO(); + dto.setCustomerId(customerId); + dto.setRealNames(staffNames); + Result> staffResult = epmetUserOpenFeignClient.getByRealNames(dto); + if (!staffResult.success()) { + throw new RenException("获取工作人员基础信息失败......"); + } + Map map = staffResult.getData().stream().collect(Collectors.toMap(CustomerStaffDTO::getRealName, CustomerStaffDTO::getUserId)); + + //3.遍历封装有效数据 + List houseEntityList = new ArrayList<>(); + Iterator iterator1 = list.iterator(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + while (iterator1.hasNext()) { + IcSocietyOrgExcel icHouseExcel = iterator1.next(); + IcSocietyOrgEntity entity = new IcSocietyOrgEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(staffInfoCache.getAgencyId()); + entity.setPids(staffInfoCache.getAgencyPIds()); + entity.setSocietyName(icHouseExcel.getSocietyName()); + entity.setServiceMatters(icHouseExcel.getServiceMatters()); + entity.setPersonInCharge(icHouseExcel.getPersonInCharge()); + entity.setMobile(icHouseExcel.getMobile()); + entity.setServiceStartTime(sdf.parse(icHouseExcel.getServiceStartTime())); + entity.setServiceEndTime(sdf.parse(icHouseExcel.getServiceEndTime())); + entity.setAdminStaffId(map.containsKey(icHouseExcel.getAdminStaffName().trim())?map.get(icHouseExcel.getAdminStaffName().trim()):""); + if ("".equals(entity.getAdminStaffId())) { + numList.add(icHouseExcel.getRowNum()); + iterator1.remove(); + continue; + } + entity.setAddress(icHouseExcel.getAddress()); + entity.setLongitude(icHouseExcel.getLongitude()); + entity.setLatitude(icHouseExcel.getLatitude()); + houseEntityList.add(entity); + } + + //3.批量保存数据 + insertBatch(houseEntityList); + return numList; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java index 2111d8ef30..ffa2b18b74 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -12,8 +13,8 @@ import java.util.List; @Data public class GetListPlaceOrgResultDTO implements Serializable { //集合总条数 - private Integer total; + private Integer total = 0; //社会组织信息 - private List list; + private List list = new ArrayList<>(); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java index 0ef22dfa52..1531ab2901 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -12,8 +13,8 @@ import java.util.List; @Data public class GetListPlacePatrolRecordResultDTO implements Serializable { //集合总条数 - private Integer total; + private Integer total = 0; //社会组织信息 - private List list; + private List list = new ArrayList<>(); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java index 9caca08bd1..08b9fe2461 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -12,8 +13,8 @@ import java.util.List; @Data public class GetListPlacePatrolReviewRecordResultDTO implements Serializable { //集合总条数 - private Integer total; + private Integer total = 0; //社会组织信息 - private List list; + private List list = new ArrayList<>(); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java index b2ce9018f6..e7dac5b53d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -12,8 +13,8 @@ import java.util.List; @Data public class GetListPlacePatrolTeamResultDTO implements Serializable { //集合总条数 - private Integer total; + private Integer total = 0; //社会组织信息 - private List list; + private List list = new ArrayList<>(); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java index 6869a2fb75..57ef081c5e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java @@ -4,6 +4,7 @@ import com.epmet.dto.IcPlacePatrolTeamStaffDTO; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -33,6 +34,6 @@ public class PlacePatrolTeamDetailResultDTO implements Serializable { //创建时间 private String time; //分队成员信息 - private List memberList; + private List memberList = new ArrayList<>(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java new file mode 100644 index 0000000000..80719e6737 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Set; + +/** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ +@NoArgsConstructor +@Data +public class GetByRealNamesFormDTO implements Serializable { + + private static final long serialVersionUID = -5220529162950147825L; + /** + * 客户Id + */ + private String customerId; + /** + * 工作人员姓名集合 + */ + private Set realNames; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 5637b6b765..6bf9a4466e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -653,4 +653,11 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/icresiuser/categorycount") Result>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO); + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + @GetMapping(value = "epmetuser/customerstaff/getbyrealnames") + Result> getByRealNames(@RequestBody GetByRealNamesFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index e339f2e83b..0a4d2c41d4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -474,4 +474,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result>> getHomeUserCategoryCount(IcResiUserDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeUserCategoryCount", formDTO); } + + @Override + public Result> getByRealNames(GetByRealNamesFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getByRealNames", formDTO); + } } 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 7aae42adea..256bbf7810 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 @@ -446,5 +446,14 @@ public class CustomerStaffController { return new Result(); } + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + @PostMapping(value = "getbyrealnames") + public Result> getByRealNames(@RequestBody GetByRealNamesFormDTO formDTO) { + return new Result>().ok(customerStaffService.getByRealNames(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 97e4bf7424..d0ce82f757 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -215,4 +215,10 @@ public interface CustomerStaffDao extends BaseDao { List listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List userIds); List selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId); + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + List getByRealNames(GetByRealNamesFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index bd4e8aae97..08916bfcc8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -335,4 +335,10 @@ public interface CustomerStaffService extends BaseService { * @author sun */ void enableStaff(EnableStaffFormDTO fromDTO); + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + List getByRealNames(GetByRealNamesFormDTO 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 8c880d86cd..03914fcd93 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 @@ -784,4 +784,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getByRealNames(GetByRealNamesFormDTO formDTO) { + return baseDao.getByRealNames(formDTO); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 4448cb0566..37c1b545c0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -426,4 +426,30 @@ and sr.STAFF_ID=#{userId} ) + + + From 6fcd4bd7ad55303ef17cb71322a328b845aaa0a5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Nov 2021 18:23:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 74af482075..d2f8f87352 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -358,7 +358,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { //dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。 screenProjectSettleService.updateProjectSatisfactionScore(customerId,dateId,null); }catch(Exception e){ - log.error("群众不满得分更新失败"); + log.error("群众不满得分更新失败,msg:{}", e); } } From 417cf42ecfa1838f42730d40fd633f54f6243c82 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Nov 2021 08:59:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcSocietyOrgDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml index 530744c278..46f1475d7d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml @@ -48,8 +48,8 @@