From 8281ad1adbb16957853912249512f86adf8db335 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 Jan 2022 16:11:28 +0800 Subject: [PATCH 01/83] =?UTF-8?q?=E8=B0=83=E5=8A=A8=E3=80=81=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E8=AE=B0=E5=BD=95=E3=80=81=E5=8F=98=E6=9B=B4=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/IcUserChangeDetailedDTO.java | 137 +++++++++++ .../com/epmet/dto/IcUserChangeRecordDTO.java | 131 ++++++++++ .../epmet/dto/IcUserTransferRecordDTO.java | 231 ++++++++++++++++++ .../IcUserChangeDetailedController.java | 41 ++++ .../IcUserChangeRecordController.java | 40 +++ .../IcUserTransferRecordController.java | 40 +++ .../epmet/dao/IcUserChangeDetailedDao.java | 34 +++ .../com/epmet/dao/IcUserChangeRecordDao.java | 33 +++ .../epmet/dao/IcUserTransferRecordDao.java | 33 +++ .../entity/IcUserChangeDetailedEntity.java | 104 ++++++++ .../entity/IcUserChangeRecordEntity.java | 100 ++++++++ .../entity/IcUserTransferRecordEntity.java | 200 +++++++++++++++ .../service/IcUserChangeDetailedService.java | 32 +++ .../service/IcUserChangeRecordService.java | 31 +++ .../service/IcUserTransferRecordService.java | 31 +++ .../impl/IcUserChangeDetailedServiceImpl.java | 37 +++ .../impl/IcUserChangeRecordServiceImpl.java | 36 +++ .../impl/IcUserTransferRecordServiceImpl.java | 36 +++ .../mapper/IcUserChangeDetailedDao.xml | 7 + .../mapper/IcUserChangeRecordDao.xml | 7 + .../mapper/IcUserTransferRecordDao.xml | 7 + 21 files changed, 1348 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserTransferRecordDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeDetailedController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserTransferRecordEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java new file mode 100644 index 0000000000..2c5203eddd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java @@ -0,0 +1,137 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 变更明细表 +[一条变更记录对应多条人员类别数据] + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Data +public class IcUserChangeDetailedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 字段名【18类对应的ic_resi_user表字段名】 + */ + private String icUserChangeRecordId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 小区Id + */ + private String neighborHoodId; + + /** + * 楼栋Id + */ + private String buildingId; + + /** + * 单元Id + */ + private String buildingUnitId; + + /** + * 房屋Id + */ + private String houseId; + + /** + * 变更人Id + */ + private String icUserId; + + /** + * 操作类型【add:新增 category:类别变动 in:迁入 out:迁出】 + */ + private String type; + + /** + * 操作类型名称【add:新增 category:类别变动 in:迁入 out:迁出】 + */ + private String typeName; + + /** + * 字段名【18类对应的ic_resi_user表字段名】 + */ + private String fieldName; + + /** + * 当前类别的值 + */ + private Integer value; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java new file mode 100644 index 0000000000..e9f4e3ff91 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java @@ -0,0 +1,131 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Data +public class IcUserChangeRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 调动表Id【只有调动记录此列才有值】 + */ + private String icUserTransferRecordId; + + /** + * 当前所属客户Id + */ + private String customerId; + + /** + * 操作人Id【customer_staff表userId】 + */ + private String operatorId; + + /** + * 被操作人Id【ic_resi_user表id】 + */ + private String icUserId; + + /** + * 操作人名称【customer_staff表real_name】 + */ + private String operatorName; + + /** + * 被操作人名称【ic_resi_user表name】 + */ + private String icUserName; + + /** + * 操作类型【add:新增 category:类别变动 transfer】 + */ + private String type; + + /** + * 操作类型名称【add:新增 category:类别变动 transfer:迁出】 + */ + private String typeName; + + /** + * 变更前文字描述 + */ + private String beforeChangeName; + + /** + * 变更后文字描述 + */ + private String afterChangeName; + + /** + * 调整时间 + */ + private Date changeTime; + + /** + * 备注说明 + */ + private String remark; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserTransferRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserTransferRecordDTO.java new file mode 100644 index 0000000000..1b6992a53c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserTransferRecordDTO.java @@ -0,0 +1,231 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Data +public class IcUserTransferRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 被调动人Id【ic_resi_user表id】 + */ + private String icUserId; + + /** + * 调动(工作)人员Id【customer_staff表userId】 + */ + private String operatorId; + + /** + * 被调动人名称【ic_resi_user表name】 + */ + private String icUserName; + + /** + * 调动(工作)人员名称【customer_staff表real_name】 + */ + private String operatorName; + + /** + * 调动前客户Id + */ + private String oldCustomerId; + + /** + * 调动后客户Id + */ + private String newCustomerId; + + /** + * 调动前组织Id + */ + private String oldAgencyId; + + /** + * 调动后组织Id + */ + private String newAgencyId; + + /** + * 调动前组织名称 + */ + private String oldAgencyName; + + /** + * 调动后组织名称 + */ + private String newAgencyName; + + /** + * 调动前网格Id + */ + private String oldGridId; + + /** + * 调动后网格Id + */ + private String newGridId; + + /** + * 调动前网格名称 + */ + private String oldGridName; + + /** + * 调动后网格名称 + */ + private String newGridName; + + /** + * 调动前小区Id + */ + private String oldNeighborHoodId; + + /** + * 调动后小区Id + */ + private String newNeighborHoodId; + + /** + * 调动前小区名称 + */ + private String oldNeighborHoodName; + + /** + * 调动后小区名称 + */ + private String newNeighborHoodName; + + /** + * 调动前楼栋Id + */ + private String oldBuildingId; + + /** + * 调动后楼栋Id + */ + private String newBuildingId; + + /** + * 调动前楼栋名称 + */ + private String oldBuildingName; + + /** + * 调动后楼栋名称 + */ + private String newBuildingName; + + /** + * 调动前单元Id + */ + private String oldBuildingUnitId; + + /** + * 调动后单元Id + */ + private String newBuildingUnitId; + + /** + * 调动前单元名称 + */ + private String oldBuildingUnitName; + + /** + * 调动后单元名称 + */ + private String newBuildingUnitName; + + /** + * 调动前房屋Id + */ + private String oldHouseId; + + /** + * 调动后房屋Id + */ + private String newHouseId; + + /** + * 调动前房屋名称 + */ + private String oldHouseName; + + /** + * 调动后房屋名称 + */ + private String newHouseName; + + /** + * 调动时间 + */ + private Date transferTime; + + /** + * 备注说明 + */ + private String remark; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeDetailedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeDetailedController.java new file mode 100644 index 0000000000..66f3488eef --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeDetailedController.java @@ -0,0 +1,41 @@ +/** + * 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.controller; + +import com.epmet.service.IcUserChangeDetailedService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 变更明细表 +[一条变更记录对应多条人员类别数据] + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@RestController +@RequestMapping("icuserchangedetailed") +public class IcUserChangeDetailedController { + + @Autowired + private IcUserChangeDetailedService icUserChangeDetailedService; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java new file mode 100644 index 0000000000..6da9c5b6cf --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java @@ -0,0 +1,40 @@ +/** + * 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.controller; + +import com.epmet.service.IcUserChangeRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 居民变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@RestController +@RequestMapping("icuserchangerecord") +public class IcUserChangeRecordController { + + @Autowired + private IcUserChangeRecordService icUserChangeRecordService; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java new file mode 100644 index 0000000000..ead153c8cf --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java @@ -0,0 +1,40 @@ +/** + * 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.controller; + +import com.epmet.service.IcUserTransferRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 居民调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@RestController +@RequestMapping("icusertransferrecord") +public class IcUserTransferRecordController { + + @Autowired + private IcUserTransferRecordService icUserTransferRecordService; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java new file mode 100644 index 0000000000..6ba4093056 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java @@ -0,0 +1,34 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserChangeDetailedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 变更明细表 +[一条变更记录对应多条人员类别数据] + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Mapper +public interface IcUserChangeDetailedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java new file mode 100644 index 0000000000..f552d6798a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserChangeRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Mapper +public interface IcUserChangeRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java new file mode 100644 index 0000000000..dacd67bd6c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java @@ -0,0 +1,33 @@ +/** + * 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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcUserTransferRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Mapper +public interface IcUserTransferRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java new file mode 100644 index 0000000000..e230fbfd2a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java @@ -0,0 +1,104 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 变更明细表 +[一条变更记录对应多条人员类别数据] + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_change_detailed") +public class IcUserChangeDetailedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 字段名【18类对应的ic_resi_user表字段名】 + */ + private String icUserChangeRecordId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 小区Id + */ + private String neighborHoodId; + + /** + * 楼栋Id + */ + private String buildingId; + + /** + * 单元Id + */ + private String buildingUnitId; + + /** + * 房屋Id + */ + private String houseId; + + /** + * 变更人Id + */ + private String icUserId; + + /** + * 操作类型【add:新增 category:类别变动 in:迁入 out:迁出】 + */ + private String type; + + /** + * 操作类型名称【add:新增 category:类别变动 in:迁入 out:迁出】 + */ + private String typeName; + + /** + * 字段名【18类对应的ic_resi_user表字段名】 + */ + private String fieldName; + + /** + * 当前类别的值 + */ + private Integer value; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java new file mode 100644 index 0000000000..eaf7226588 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java @@ -0,0 +1,100 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_change_record") +public class IcUserChangeRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 调动表Id【只有调动记录此列才有值】 + */ + private String icUserTransferRecordId; + + /** + * 当前所属客户Id + */ + private String customerId; + + /** + * 操作人Id【customer_staff表userId】 + */ + private String operatorId; + + /** + * 被操作人Id【ic_resi_user表id】 + */ + private String icUserId; + + /** + * 操作人名称【customer_staff表real_name】 + */ + private String operatorName; + + /** + * 被操作人名称【ic_resi_user表name】 + */ + private String icUserName; + + /** + * 操作类型【add:新增 category:类别变动 transfer】 + */ + private String type; + + /** + * 操作类型名称【add:新增 category:类别变动 transfer:迁出】 + */ + private String typeName; + + /** + * 变更前文字描述 + */ + private String beforeChangeName; + + /** + * 变更后文字描述 + */ + private String afterChangeName; + + /** + * 调整时间 + */ + private Date changeTime; + + /** + * 备注说明 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserTransferRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserTransferRecordEntity.java new file mode 100644 index 0000000000..6c57607ff8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserTransferRecordEntity.java @@ -0,0 +1,200 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_transfer_record") +public class IcUserTransferRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 被调动人Id【ic_resi_user表id】 + */ + private String icUserId; + + /** + * 调动(工作)人员Id【customer_staff表userId】 + */ + private String operatorId; + + /** + * 被调动人名称【ic_resi_user表name】 + */ + private String icUserName; + + /** + * 调动(工作)人员名称【customer_staff表real_name】 + */ + private String operatorName; + + /** + * 调动前客户Id + */ + private String oldCustomerId; + + /** + * 调动后客户Id + */ + private String newCustomerId; + + /** + * 调动前组织Id + */ + private String oldAgencyId; + + /** + * 调动后组织Id + */ + private String newAgencyId; + + /** + * 调动前组织名称 + */ + private String oldAgencyName; + + /** + * 调动后组织名称 + */ + private String newAgencyName; + + /** + * 调动前网格Id + */ + private String oldGridId; + + /** + * 调动后网格Id + */ + private String newGridId; + + /** + * 调动前网格名称 + */ + private String oldGridName; + + /** + * 调动后网格名称 + */ + private String newGridName; + + /** + * 调动前小区Id + */ + private String oldNeighborHoodId; + + /** + * 调动后小区Id + */ + private String newNeighborHoodId; + + /** + * 调动前小区名称 + */ + private String oldNeighborHoodName; + + /** + * 调动后小区名称 + */ + private String newNeighborHoodName; + + /** + * 调动前楼栋Id + */ + private String oldBuildingId; + + /** + * 调动后楼栋Id + */ + private String newBuildingId; + + /** + * 调动前楼栋名称 + */ + private String oldBuildingName; + + /** + * 调动后楼栋名称 + */ + private String newBuildingName; + + /** + * 调动前单元Id + */ + private String oldBuildingUnitId; + + /** + * 调动后单元Id + */ + private String newBuildingUnitId; + + /** + * 调动前单元名称 + */ + private String oldBuildingUnitName; + + /** + * 调动后单元名称 + */ + private String newBuildingUnitName; + + /** + * 调动前房屋Id + */ + private String oldHouseId; + + /** + * 调动后房屋Id + */ + private String newHouseId; + + /** + * 调动前房屋名称 + */ + private String oldHouseName; + + /** + * 调动后房屋名称 + */ + private String newHouseName; + + /** + * 调动时间 + */ + private Date transferTime; + + /** + * 备注说明 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java new file mode 100644 index 0000000000..859a324c82 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java @@ -0,0 +1,32 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.IcUserChangeDetailedEntity; + +/** + * 变更明细表 +[一条变更记录对应多条人员类别数据] + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +public interface IcUserChangeDetailedService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java new file mode 100644 index 0000000000..61ba776f9e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java @@ -0,0 +1,31 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.IcUserChangeRecordEntity; + +/** + * 居民变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +public interface IcUserChangeRecordService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java new file mode 100644 index 0000000000..5ce1565dcf --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java @@ -0,0 +1,31 @@ +/** + * 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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.IcUserTransferRecordEntity; + +/** + * 居民调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +public interface IcUserTransferRecordService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java new file mode 100644 index 0000000000..6bff100276 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java @@ -0,0 +1,37 @@ +/** + * 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.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcUserChangeDetailedDao; +import com.epmet.entity.IcUserChangeDetailedEntity; +import com.epmet.service.IcUserChangeDetailedService; +import org.springframework.stereotype.Service; + +/** + * 变更明细表 +[一条变更记录对应多条人员类别数据] + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Service +public class IcUserChangeDetailedServiceImpl extends BaseServiceImpl implements IcUserChangeDetailedService { + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java new file mode 100644 index 0000000000..92589c9bfc --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -0,0 +1,36 @@ +/** + * 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.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcUserChangeRecordDao; +import com.epmet.entity.IcUserChangeRecordEntity; +import com.epmet.service.IcUserChangeRecordService; +import org.springframework.stereotype.Service; + +/** + * 居民变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Service +public class IcUserChangeRecordServiceImpl extends BaseServiceImpl implements IcUserChangeRecordService { + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java new file mode 100644 index 0000000000..4e06314238 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java @@ -0,0 +1,36 @@ +/** + * 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.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcUserTransferRecordDao; +import com.epmet.entity.IcUserTransferRecordEntity; +import com.epmet.service.IcUserTransferRecordService; +import org.springframework.stereotype.Service; + +/** + * 居民调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-14 + */ +@Service +public class IcUserTransferRecordServiceImpl extends BaseServiceImpl implements IcUserTransferRecordService { + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml new file mode 100644 index 0000000000..acb4aa197b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml new file mode 100644 index 0000000000..6632dd653c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml new file mode 100644 index 0000000000..be24ced9be --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 83ee95ed2409aca5745581cf6b760d7dbee88156 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 14 Jan 2022 16:26:17 +0800 Subject: [PATCH 02/83] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E6=9F=A5=E8=AF=A2-=E6=90=9C=E7=B4=A2=E6=88=BF?= =?UTF-8?q?=E5=B1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ListIcNeighborHoodFormDTO.java | 5 ++ .../com/epmet/controller/HouseController.java | 47 ++++++++++++++++++- .../main/java/com/epmet/dao/IcHouseDao.java | 7 ++- .../java/com/epmet/service/HouseService.java | 9 +++- .../epmet/service/impl/HouseServiceImpl.java | 42 ++++++++++++----- .../src/main/resources/mapper/IcHouseDao.xml | 36 ++++++++++---- 6 files changed, 122 insertions(+), 24 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java index 80b95263b6..402c86c868 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java @@ -76,5 +76,10 @@ public class ListIcNeighborHoodFormDTO implements Serializable{ */ private String neighborHoodId; + /** + * 搜索关键词,社区查询,搜索输入的关键词 + */ + private String keyword; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 7b6c7e44c0..1edcfe206d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -34,6 +34,7 @@ import com.epmet.excel.IcHouseExcel; import com.epmet.service.HouseService; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; @@ -64,11 +65,55 @@ public class HouseController { public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO); - IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(formDTO); + + String queryScene = "house_manage"; + + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(formDTO.getBuildingId(), formDTO.getOwnerName(), + formDTO.getOwnerPhone(), null, + null, queryScene, + formDTO.getPageNo(), formDTO.getPageSize()); return new Result().ok(icNeighborHoodResultDTO); } + /** + *@Description 社区查询-搜索房屋 + *@Author wangxianzhang + *@Date 2022/1/14 11:00 上午 + *@Param + *@return + */ + @PostMapping("search") + public Result searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO) { + String keyword = formDTO.getKeyword(); + if (StringUtils.isBlank(keyword)) { + IcNeighborHoodResultDTO r = new IcNeighborHoodResultDTO(); + r.setTotal(0); + r.setList(new ArrayList<>()); + return new Result().ok(r); + } + + String neighborhoodName; + String buildingName; + + int commaIndex = keyword.indexOf(","); + if (commaIndex != -1) { + neighborhoodName = keyword.substring(0, commaIndex); + buildingName = keyword.substring(commaIndex + 1); + } else { + neighborhoodName = keyword; + buildingName = null; + } + + // 使用场景:社区查询 + String scene = "community_search"; + + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, null, null, + neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize()); + + return new Result().ok(icNeighborHoodResultDTO); + } + @NoRepeatSubmit @PostMapping("houseadd") public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index 1553cccc9d..a974510a38 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -47,7 +47,12 @@ public interface IcHouseDao extends BaseDao { // @Param("building") IcBuildingEntity building, // @Param("house") IcHouseEntity house); IPage> searchHouseByPage(IPage page, - @Param("house") IcHouseEntity house); + @Param("buildingId") String buildingId, + @Param("ownerName") String ownerName, + @Param("ownerPhone") String ownerPhone, + @Param("neighborHoodName") String neighborHoodName, + @Param("buildingName") String buildingName, + @Param("queryScene") String queryScene); List searchAllHouse(@Param("house") IcHouseEntity house); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index 48ab8c7d1b..e92fbd0e57 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -49,7 +49,14 @@ public interface HouseService { List importExcel(String customerId, List list, String staffId, List numList); - IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO); + IcNeighborHoodResultDTO listNeighborhood(String buildingId, + String ownerName, + String ownerPhone, + String neighborHoodName, + String buildingName, + String queryScene, + Integer pageNo, + Integer pageSize); void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 69a2000d97..6f072441f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -207,12 +207,29 @@ public class HouseServiceImpl implements HouseService { } @Override - public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) { + public IcNeighborHoodResultDTO listNeighborhood(String buildingId, + String ownerName, + String ownerPhone, + String neighborHoodName, + String buildingName, + String queryScene, + Integer pageNo, + Integer pageSize) { IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); //如果类型是house 查房屋 - IPage> resultMap = searchHouse(formDTO); - result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); - result.setList(resultMap.getRecords()); + //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); + + IPage page = new Page(pageNo,pageSize); + + IPage> mapIPage = icHouseDao.searchHouseByPage(page, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene); + List> records = mapIPage.getRecords(); + records.forEach(item->{ + item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); + item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey"))); + }); + + result.setTotal(Long.valueOf(mapIPage.getTotal()).intValue()); + result.setList(records); return result; } @@ -247,20 +264,23 @@ public class HouseServiceImpl implements HouseService { return icHouseExcels; } - private IPage> searchHouse(ListIcNeighborHoodFormDTO formDTO) { - IPage page = new Page(formDTO.getPageNo(),formDTO.getPageSize()); - - IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); - house.setDelFlag("0"); + /*private IPage> searchHouse(String buildingId, + String ownerName, + String ownerPhone, + String neighborHoodName, + String buildingName, + Integer pageNo, + Integer pageSize) { + IPage page = new Page(pageNo,pageSize); - IPage> mapIPage = icHouseDao.searchHouseByPage(page, house); + IPage> mapIPage = icHouseDao.searchHouseByPage(page, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName); List> records = mapIPage.getRecords(); records.forEach(item->{ item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey"))); }); return mapIPage; - } + }*/ @Override public List queryListHouseInfo(Set houseIdList) { diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index f997a5cf3a..ab84f43e0f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -130,21 +130,37 @@ LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0' - - AND a.BUILDING_ID = #{house.buildingId} + + AND a.BUILDING_ID = #{buildingId} - - AND a.OWNER_NAME like concat('%',#{house.ownerName},'%') + + AND a.OWNER_NAME like concat('%',#{ownerName},'%') - - AND a.OWNER_PHONE like concat('%',#{house.ownerPhone},'%') + + AND a.OWNER_PHONE like concat('%',#{ownerPhone},'%') - - AND a.DEL_FLAG = #{house.delFlag} + + AND c.NEIGHBOR_HOOD_NAME like CONCAT('%',#{neighborHoodName},'%') + + + AND b.BUILDING_NAME like CONCAT('%',#{buildingName},'%') - - ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME + /*排序规则:如果是社区查询则根据小区、楼栋、单元、房屋名字分别升序排序*/ + + + ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk) ASC, + CONVERT(b.BUILDING_NAME USING gbk) ASC, + CONVERT(d.UNIT_NAME USING gbk) ASC, + CONVERT(a.HOUSE_NAME using gbk) ASC + + + ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME + + + ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME + + + SELECT + d.id AS categoryId, + d.CATEGORY_NAME AS categoryName, + d.AWARD_POINT AS awardPoint, + d.USABLE_FLAG AS usableFlag + FROM + ic_service_item_dict d + WHERE + d.DEL_FLAG = '0' + AND d.CUSTOMER_ID = #{customerId} + ORDER BY + d.SORT DESC + + + \ No newline at end of file From e24d9db24de54dbb1740b7c83e28b6b0df2b7c7b Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 17 Jan 2022 12:50:41 +0800 Subject: [PATCH 06/83] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E6=9F=A5=E8=AF=A2-=E6=90=9C=E7=B4=A2=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复: 2.社区查询-搜索房屋 --- .../form/demand/PageListAnalysisFormDTO.java | 5 + .../form/demand/UserDemandPageFormDTO.java | 5 + .../controller/IcUserDemandRecController.java | 43 ++++- .../epmet/service/IcUserDemandRecService.java | 10 ++ .../impl/IcUserDemandRecServiceImpl.java | 151 +++++++++++------- .../resources/mapper/IcUserDemandRecDao.xml | 7 + .../com/epmet/controller/HouseController.java | 27 +++- .../main/java/com/epmet/dao/IcHouseDao.java | 1 + .../java/com/epmet/service/HouseService.java | 3 +- .../epmet/service/impl/HouseServiceImpl.java | 32 +++- .../src/main/resources/mapper/IcHouseDao.xml | 4 +- 11 files changed, 222 insertions(+), 66 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java index 2eb55979b1..dea90b14ad 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java @@ -53,4 +53,9 @@ public class PageListAnalysisFormDTO implements Serializable { * 数据分析-服务措施分析排除,已取消 */ private String excludeStatus; + + /** + * 搜索关键词 + */ + private String keyword; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java index a574bb3100..bfeb9203e2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java @@ -74,4 +74,9 @@ public class UserDemandPageFormDTO extends PageFormDTO implements Serializable { * 希望截止 */ private String wantServiceEndTime; + + /** + * 搜索关键词 + */ + private String keyword; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 0eb686a401..019771d846 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -21,8 +21,12 @@ import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -30,12 +34,16 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; +import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; @@ -57,7 +65,7 @@ import java.util.List; @Slf4j @RestController @RequestMapping("userdemand") -public class IcUserDemandRecController { +public class IcUserDemandRecController implements ResultDataResolver { @Autowired private IcUserDemandRecService icUserDemandRecService; @@ -71,6 +79,8 @@ public class IcUserDemandRecController { private IcPartyUnitService icPartyUnitService; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; /** * 根据服务方类型查询 下拉框 @@ -321,5 +331,36 @@ public class IcUserDemandRecController { return new Result().ok(icUserDemandRecService.categoryAnalysis(formDTO)); } + /** + * 搜索需求。根据需求人精确搜索;需求方、需求内容模糊搜索 + * @return + */ + @PostMapping("search") + public Result search(@RequestBody UserDemandPageFormDTO input, @LoginUser TokenDto loginUser) { + ValidatorUtils.validateEntity(input); + String keyword = input.getKeyword(); + Integer pageNo = input.getPageNo(); + Integer pageSize = input.getPageSize(); + + if (StringUtils.isBlank(keyword)) { + return new Result(); + } + + LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO(); + form.setApp(loginUser.getApp()); + form.setClient(loginUser.getClient()); + form.setUserId(loginUser.getUserId()); + + LoginUserDetailsResultDTO loginUserDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form), + ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【社区查询】查找当前人所属组织失败", + null); + + PageData page = icUserDemandRecService.search(loginUser.getCustomerId(), loginUserDetail.getAgencyId(), keyword, pageNo, pageSize); + + return new Result().ok(page); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index da3fd68cdf..336cd21999 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -214,4 +214,14 @@ public interface IcUserDemandRecService extends BaseService search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 34f7f2070f..f7034a63ee 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -22,12 +22,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -77,7 +79,7 @@ import java.util.stream.Collectors; */ @Slf4j @Service -public class IcUserDemandRecServiceImpl extends BaseServiceImpl implements IcUserDemandRecService { +public class IcUserDemandRecServiceImpl extends BaseServiceImpl implements IcUserDemandRecService, ResultDataResolver { @Autowired private IcUserDemandOperateLogDao operateLogDao; @Autowired @@ -792,67 +794,76 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); - Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); - List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); - Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); - - //2、查询分类名称 - List categoryCodes=list.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); - List dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes); - Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + fillDemandsInfo(list, formDTO.getCustomerId()); + } + return new PageData<>(list, total); + } - //3、查询志愿者 - // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; - Map userInfoMap=new HashMap<>(); - Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); - if(CollectionUtils.isNotEmpty(userIdList)){ - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); - if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); - } - userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + /** + * 填充需求信息 + * @param demandList 需求列表 + * @param customerId 客户id + */ + public void fillDemandsInfo(List demandList, String customerId) { + //1、查询网格信息 + List gridIds=demandList.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); + Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); + + //2、查询分类名称 + List categoryCodes=demandList.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); + List dictList=demandDictService.listByCodes(customerId,categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + //3、查询志愿者 + // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + Map userInfoMap=new HashMap<>(); + Set userIdList=demandList.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + if(CollectionUtils.isNotEmpty(userIdList)){ + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); + if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); } + userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + } - for(DemandRecResultDTO res:list){ - if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { - res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); - } + for(DemandRecResultDTO res:demandList){ + if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { + res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); + } - if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { - res.setCategoryName(dictMap.get(res.getCategoryCode())); - } - res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode())); - if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { - res.setServiceName(userInfoMap.get(res.getServerId())); - } - //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help - //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished - //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; - switch (res.getServiceType()) - { - case UserDemandConstant.PARTY_UNIT: - res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); - break; - case UserDemandConstant.SOCIAL_ORG: - res.setServiceShowName(res.getServiceName().concat("(社会组织)")); - break; - case UserDemandConstant.COMMUNITY_ORG: - res.setServiceShowName(res.getServiceName().concat("(社区自组织)")); - break; - case UserDemandConstant.VOLUNTEER: - res.setServiceShowName(res.getServiceName().concat("(志愿者)")); - break; - default: - res.setServiceShowName(res.getServiceName()); - log.warn("serviceType 错误"); - break; - } - res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId())); + if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { + res.setCategoryName(dictMap.get(res.getCategoryCode())); + } + res.setFirstCategoryName(demandDictService.getCategoryName(customerId, res.getFirstCategoryCode())); + if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { + res.setServiceName(userInfoMap.get(res.getServerId())); } + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + switch (res.getServiceType()) + { + case UserDemandConstant.PARTY_UNIT: + res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); + break; + case UserDemandConstant.SOCIAL_ORG: + res.setServiceShowName(res.getServiceName().concat("(社会组织)")); + break; + case UserDemandConstant.COMMUNITY_ORG: + res.setServiceShowName(res.getServiceName().concat("(社区自组织)")); + break; + case UserDemandConstant.VOLUNTEER: + res.setServiceShowName(res.getServiceName().concat("(志愿者)")); + break; + default: + res.setServiceShowName(res.getServiceName()); + log.warn("serviceType 错误"); + break; + } + res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId())); } - return new PageData<>(list, total); } /** @@ -1603,7 +1614,35 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize) { + CustomerAgencyDTO agency = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败", null); + + if (agency == null) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败"); + } + + String gridPids; + if(NumConstant.ZERO_STR.equals(agency.getPid())){ + gridPids = agencyId; + }else{ + gridPids = agency.getPids().concat(StrConstant.COLON).concat(agencyId); + } + PageListAnalysisFormDTO queryForm = new PageListAnalysisFormDTO(); + queryForm.setCustomerId(customerId); + queryForm.setGridPids(gridPids); + queryForm.setKeyword(keyword); + + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.pageListAnalysis(queryForm); + + // 填充信息 + fillDemandsInfo(list, customerId); + + return new PageData<>(list, new PageInfo<>(list).getTotal()); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 4bb193f075..b59fa44be5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -325,6 +325,13 @@ and r.STATUS !=#{excludeStatus} + + AND ( + r.DEMAND_USER_NAME = #{keyword} + OR match(r.CONTENT) against (#{keyword} in boolean mode ) + OR s.SERVER_NAME like CONCAT('%',#{keyword},'%') + ) + order by r.WANT_SERVICE_TIME desc,r.REPORT_TIME asc diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 1edcfe206d..44593788a9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -22,15 +22,22 @@ import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.IcHouseFormDTO; import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.excel.IcHouseExcel; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.HouseService; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; @@ -55,11 +62,14 @@ import java.util.stream.Collectors; @Slf4j @RestController @RequestMapping("house") -public class HouseController { +public class HouseController implements ResultDataResolver { @Autowired private HouseService houseService; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + @PostMapping("houselist") public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ @@ -68,7 +78,7 @@ public class HouseController { String queryScene = "house_manage"; - IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(formDTO.getBuildingId(), formDTO.getOwnerName(), + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(), formDTO.getOwnerPhone(), null, null, queryScene, formDTO.getPageNo(), formDTO.getPageSize()); @@ -84,7 +94,7 @@ public class HouseController { *@return */ @PostMapping("search") - public Result searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO) { + public Result searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO, @LoginUser TokenDto loginUser) { String keyword = formDTO.getKeyword(); if (StringUtils.isBlank(keyword)) { IcNeighborHoodResultDTO r = new IcNeighborHoodResultDTO(); @@ -108,7 +118,16 @@ public class HouseController { // 使用场景:社区查询 String scene = "community_search"; - IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, null, null, + LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO(); + form.setUserId(loginUser.getUserId()); + form.setClient(loginUser.getClient()); + form.setApp(loginUser.getApp()); + LoginUserDetailsResultDTO loginUserDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form), ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + "【社区查询-查询房屋】查询当前staff所在组织信息失败", + null); + + IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null, neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize()); return new Result().ok(icNeighborHoodResultDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index a974510a38..93c5af18e5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -47,6 +47,7 @@ public interface IcHouseDao extends BaseDao { // @Param("building") IcBuildingEntity building, // @Param("house") IcHouseEntity house); IPage> searchHouseByPage(IPage page, + @Param("pids") String pids, @Param("buildingId") String buildingId, @Param("ownerName") String ownerName, @Param("ownerPhone") String ownerPhone, diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index e92fbd0e57..ac7f28dbbc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -49,7 +49,8 @@ public interface HouseService { List importExcel(String customerId, List list, String staffId, List numList); - IcNeighborHoodResultDTO listNeighborhood(String buildingId, + IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, + String buildingId, String ownerName, String ownerPhone, String neighborHoodName, diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 6f072441f9..90a46acfc0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -3,15 +3,21 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dao.IcHouseDao; import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.IcBuildingUnitDTO; import com.epmet.dto.IcHouseDTO; @@ -24,6 +30,7 @@ import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; import com.epmet.excel.IcHouseExcel; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.HouseService; import com.epmet.service.IcBuildingService; import com.epmet.service.IcBuildingUnitService; @@ -42,7 +49,7 @@ import java.util.stream.Collectors; @Slf4j @Service -public class HouseServiceImpl implements HouseService { +public class HouseServiceImpl implements HouseService, ResultDataResolver { @@ -60,6 +67,8 @@ public class HouseServiceImpl implements HouseService { private IcBuildingUnitDao icBuildingUnitDao; @Resource private IcHouseDao icHouseDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; @Override @Transactional(rollbackFor = Exception.class) @@ -207,7 +216,8 @@ public class HouseServiceImpl implements HouseService { } @Override - public IcNeighborHoodResultDTO listNeighborhood(String buildingId, + public IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, + String buildingId, String ownerName, String ownerPhone, String neighborHoodName, @@ -219,9 +229,25 @@ public class HouseServiceImpl implements HouseService { //如果类型是house 查房屋 //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); + // 查询pids + CustomerAgencyDTO agency = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(ancestorAgencyId), ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败", null); + + if (agency == null) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败"); + } + + String pids; + + if(NumConstant.ZERO_STR.equals(agency.getPid())){ + pids = ancestorAgencyId; + }else{ + pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId); + } + IPage page = new Page(pageNo,pageSize); - IPage> mapIPage = icHouseDao.searchHouseByPage(page, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene); + IPage> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene); List> records = mapIPage.getRecords(); records.forEach(item->{ item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index ab84f43e0f..b5a8b72a25 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -129,7 +129,9 @@ LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0' - + + AND c.AGENCY_PIDS like CONCAT(#{pids},'%') + AND a.BUILDING_ID = #{buildingId} From f7c717741df960e69a16e8593e69c11ed489dfa4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 17 Jan 2022 13:36:04 +0800 Subject: [PATCH 07/83] =?UTF-8?q?=E6=96=B0=E5=BB=BAservice=5Fitem=5Fdict?= =?UTF-8?q?=E3=80=81=E9=9C=80=E6=B1=82=E5=88=86=E7=B1=BB=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=A7=AF=E5=88=86+=E5=85=B1=E5=BB=BA?= =?UTF-8?q?=E9=83=A8=E5=88=86=E3=80=82=E5=88=A0=E9=99=A4=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E8=AE=B0=E5=BD=95sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.8__service_item_dict.sql | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql new file mode 100644 index 0000000000..098a4965fb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql @@ -0,0 +1,117 @@ +CREATE TABLE `ic_service_item_dict` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `PARENT_CODE` varchar(32) NOT NULL COMMENT '父级,一级默认为0', + `CATEGORY_CODE` varchar(32) NOT NULL COMMENT '分类编码', + `CATEGORY_NAME` varchar(255) NOT NULL COMMENT '分类名称', + `LEVEL` int(11) NOT NULL COMMENT '级别', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `SORT` int(10) unsigned NOT NULL COMMENT '排序', + `USABLE_FLAG` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1可用,0不可用', + `AWARD_POINT` int(11) NOT NULL COMMENT '奖励积分', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + UNIQUE KEY `uk_dict_value` (`CATEGORY_CODE`,`CUSTOMER_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='服务事项分类字典表'; + + +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', '0', '1001', '积极配合社区安全巡查员进行场所消防、安全等方面的检查,并具备必须的安全意识及设备设施', 1, NULL, 1, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', '0', '1002', '积极参与社区举办的各类生产生活安全培训讲座等', 1, NULL, 2, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', '0', '1003', '定期开展内部自检自查,安全培训及演练,紧绷安全生产生活弦', 1, NULL, 3, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', '0', '1004', '社区困难群体生活帮扶', 1, NULL, 4, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', '0', '1005', '社区低保、伤残等困难家庭子女学习辅导', 1, NULL, 5, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', '0', '1006', '未成年人兴趣培养', 1, NULL, 6, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', '0', '1007', '楼道基础设施维护', 1, NULL, 7, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('8', 'default', '0', '1008', '健康知识专业讲座', 1, NULL, 8, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('9', 'default', '0', '1009', '老年人现代智能设备培训', 1, NULL, 9, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', 'default', '0', '1010', '空巢老人志愿帮扶', 1, NULL, 10, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('11', 'default', '0', '1011', '法律专业问题咨询', 1, NULL, 11, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('12', 'default', '0', '1012', '矛盾调解专业法律顾问', 1, NULL, 12, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('13', 'default', '0', '1013', '居民紧急自救、他救技能', 1, NULL, 13, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('14', 'default', '0', '1014', '少儿安全意识培养', 1, NULL, 14, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('15', 'default', '0', '1015', '文化队伍的培育和提升', 1, NULL, 15, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('16', 'default', '0', '1016', '老年群体的心理辅导', 1, NULL, 16, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('17', 'default', '0', '1017', '丰富多样的文体活动', 1, NULL, 17, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('18', 'default', '0', '1018', '失业人员技能培训', 1, NULL, 18, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('19', 'default', '0', '1019', '青年人文化活动的开展', 1, NULL, 19, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('20', 'default', '0', '1020', '亲子教育课堂', 1, NULL, 20, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('21', 'default', '0', '1021', '未成年人“家风”培育', 1, NULL, 21, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); +INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('22', 'default', '0', '1022', '和谐邻里活动开展', 1, NULL, 22, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12'); + + + +-- 共建单位及九小场所共建 统一删除 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于服务事项分类" +where CATEGORY_CODE='1010' or PARENT_CODE='1010'; + +-- 居民积分统一从需求分类中移除 +-- 1、民生服务 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1002' or PARENT_CODE='1002'; +-- 2、便民服务 +-- 2.1便民服务-参与日常矛盾调解并取得一定成效 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='10030001' or PARENT_CODE='10030001'; +-- 2.2便民服务-爱心敲门,自愿与社区高龄、独居、孤寡、残障等人员结对子,参与日常探望、帮扶 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='10030004' or PARENT_CODE='10030004'; +-- 2.3便民服务-收集反馈社区特殊群体(高龄、残障、独居等)生活需求,并协助社区共同落实解决。 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='10030005' or PARENT_CODE='10030005'; +-- 3、城市建设 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1004' or PARENT_CODE='1004'; +-- 4、社区建设 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1005' or PARENT_CODE='1005'; +-- 5、社区自治 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1006' or PARENT_CODE='1006'; +-- 6、思想建设 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1008' or PARENT_CODE='1008'; +-- 7、文化娱乐 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1009' or PARENT_CODE='1009'; +-- 8、社会治安 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1013' or PARENT_CODE='1013'; +-- 9、消防安全 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1014' or PARENT_CODE='1014'; +-- 10、文化体育 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1015' or PARENT_CODE='1015'; +-- 11、慈善募捐 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1020' or PARENT_CODE='1020'; +-- 12、其他 +update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分" +where CATEGORY_CODE='1022' or PARENT_CODE='1022'; + + + +-- 删除需求记录、服务记录、评价记录 +update ic_user_demand_rec +set DEL_FLAG='1',UPDATED_TIME=NOW(),UPDATED_BY='删除分类' +where CATEGORY_CODE in ( + select distinct m.CATEGORY_CODE + from ic_resi_demand_dict m where m.DEL_FLAG='1' + and m.CUSTOMER_ID!='default' +); +update ic_user_demand_service set DEL_FLAG='1',UPDATED_TIME=NOW() +where DEMAND_REC_ID in( + select m.id from ic_user_demand_rec m where m.DEL_FLAG='1' +); +update ic_user_demand_satisfaction set DEL_FLAG='1',UPDATED_TIME=NOW() +WHERE DEMAND_REC_ID IN( + select m.id from ic_user_demand_rec m where m.DEL_FLAG='1' +); + + + From 9fa6f058606be89ad735b404e01ac28d56012b44 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Jan 2022 13:40:28 +0800 Subject: [PATCH 08/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=B8=B8=E7=94=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/AddOftenUseFunctionFormDTO.java | 26 ++++++++++ .../result/OftenUseFunctionListResultDTO.java | 41 +++++++++++++++ .../IcOftenUseFunctionController.java | 36 +++++++++---- .../com/epmet/dao/IcOftenUseFunctionDao.java | 23 ++++++++- .../service/IcOftenUseFunctionService.java | 30 ++++++----- .../impl/IcOftenUseFunctionServiceImpl.java | 43 +++++++++++++--- .../mapper/IcOftenUseFunctionDao.xml | 20 ++++++++ .../form/EditIndividualCategoryFormDTO.java | 26 ++++++++++ .../IndividualCategoryListResultDTO.java | 36 +++++++++++++ .../IcIndividualCategoryManageController.java | 36 +++++++++---- .../dao/IcIndividualCategoryManageDao.java | 23 ++++++++- .../IcIndividualCategoryManageService.java | 29 ++++++----- ...IcIndividualCategoryManageServiceImpl.java | 51 ++++++++++++------- .../mapper/IcIndividualCategoryManageDao.xml | 16 ++++++ 14 files changed, 360 insertions(+), 76 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java new file mode 100644 index 0000000000..f03b2a2cf0 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 10:09 上午 + * @DESC + */ +@Data +public class AddOftenUseFunctionFormDTO implements Serializable { + + private static final long serialVersionUID = -8044386389656626183L; + + public interface AddOftenUseFunctionForm{} + + @NotBlank(message = "menuId不能为空", groups = AddOftenUseFunctionForm.class) + private String menuId; + + @NotNull(message = "sort不能为空", groups = AddOftenUseFunctionForm.class) + private Integer sort; +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java new file mode 100644 index 0000000000..73ff018a10 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 9:41 上午 + * @DESC + */ +@Data +public class OftenUseFunctionListResultDTO implements Serializable { + + private static final long serialVersionUID = 8561818114575776804L; + + /** + * 跳转url + */ + private String url; + + /** + * 菜单ID + */ + private String menuId; + + /** + * 菜单名字 + */ + private String menuName; + + /** + * 图标 + */ + private String icon; + + /** + * 排序 + */ + private String sort; +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java index b852a732f2..07f036e90a 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java @@ -1,15 +1,21 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcOftenUseFunctionDTO; +import com.epmet.dto.form.AddOftenUseFunctionFormDTO; +import com.epmet.dto.result.OftenUseFunctionListResultDTO; import com.epmet.service.IcOftenUseFunctionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 常用功能 * @@ -23,19 +29,27 @@ public class IcOftenUseFunctionController { @Autowired private IcOftenUseFunctionService icOftenUseFunctionService; - @PostMapping - public Result save(@RequestBody IcOftenUseFunctionDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icOftenUseFunctionService.save(dto); - return new Result(); + /** + * @Description 【社区查询】常用功能查询 + * @param tokenDto + * @author zxc + * @date 2022/1/17 9:47 上午 + */ + @PostMapping("oftenusefunctionlist") + public Result> oftenUseFunctionList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icOftenUseFunctionService.oftenUseFunctionList(tokenDto)); } - @PutMapping - public Result update(@RequestBody IcOftenUseFunctionDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icOftenUseFunctionService.update(dto); + /** + * @Description 【社区查询】常用功能添加(就是修改) + * @param formDTOS + * @param tokenDto + * @author zxc + * @date 2022/1/17 10:13 上午 + */ + @PostMapping("addoftenusefunction") + public Result addOftenUseFunction(@RequestBody List formDTOS, @LoginUser TokenDto tokenDto){ + icOftenUseFunctionService.addOftenUseFunction(formDTOS, tokenDto); return new Result(); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java index 9c1a1e4a21..ee0cec00e9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/IcOftenUseFunctionDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.OftenUseFunctionListResultDTO; import com.epmet.entity.IcOftenUseFunctionEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 常用功能 @@ -29,5 +33,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcOftenUseFunctionDao extends BaseDao { - + + /** + * @Description 【社区查询】常用功能查询 + * @param userId + * @author zxc + * @date 2022/1/17 10:06 上午 + */ + List oftenUseFunctionList(@Param("userId")String userId); + + /** + * @Description 删除旧数据 + * @param userId + * @param customerId + * @author zxc + * @date 2022/1/17 10:25 上午 + */ + void deleteOldData(@Param("userId")String userId,@Param("customerId")String customerId); + } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java index 440e229478..8d0c15b59c 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/IcOftenUseFunctionService.java @@ -18,9 +18,14 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcOftenUseFunctionDTO; +import com.epmet.dto.form.AddOftenUseFunctionFormDTO; +import com.epmet.dto.result.OftenUseFunctionListResultDTO; import com.epmet.entity.IcOftenUseFunctionEntity; +import java.util.List; + /** * 常用功能 * @@ -30,22 +35,19 @@ import com.epmet.entity.IcOftenUseFunctionEntity; public interface IcOftenUseFunctionService extends BaseService { /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-01-17 + * @Description 【社区查询】常用功能查询 + * @param tokenDto + * @author zxc + * @date 2022/1/17 9:47 上午 */ - void save(IcOftenUseFunctionDTO dto); + List oftenUseFunctionList(TokenDto tokenDto); /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-01-17 + * @Description 【社区查询】常用功能添加(就是修改) + * @param formDTOS + * @param tokenDto + * @author zxc + * @date 2022/1/17 10:13 上午 */ - void update(IcOftenUseFunctionDTO dto); + void addOftenUseFunction(List formDTOS, TokenDto tokenDto); } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java index b695a925ff..f12a56feef 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/IcOftenUseFunctionServiceImpl.java @@ -18,14 +18,21 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcOftenUseFunctionDao; import com.epmet.dto.IcOftenUseFunctionDTO; +import com.epmet.dto.form.AddOftenUseFunctionFormDTO; +import com.epmet.dto.result.OftenUseFunctionListResultDTO; import com.epmet.entity.IcOftenUseFunctionEntity; import com.epmet.service.IcOftenUseFunctionService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.List; + /** * 常用功能 * @@ -35,18 +42,40 @@ import org.springframework.transaction.annotation.Transactional; @Service public class IcOftenUseFunctionServiceImpl extends BaseServiceImpl implements IcOftenUseFunctionService { + /** + * @Description 【社区查询】常用功能查询 + * @param tokenDto + * @author zxc + * @date 2022/1/17 9:47 上午 + */ @Override - @Transactional(rollbackFor = Exception.class) - public void save(IcOftenUseFunctionDTO dto) { - IcOftenUseFunctionEntity entity = ConvertUtils.sourceToTarget(dto, IcOftenUseFunctionEntity.class); - insert(entity); + public List oftenUseFunctionList(TokenDto tokenDto) { + List result = baseDao.oftenUseFunctionList(tokenDto.getUserId()); + if (CollectionUtils.isNotEmpty(result)){ + return result; + } + return new ArrayList<>(); } + /** + * @Description 【社区查询】常用功能添加(就是修改) + * @param formDTOS + * @param tokenDto + * @author zxc + * @date 2022/1/17 10:13 上午 + */ @Override @Transactional(rollbackFor = Exception.class) - public void update(IcOftenUseFunctionDTO dto) { - IcOftenUseFunctionEntity entity = ConvertUtils.sourceToTarget(dto, IcOftenUseFunctionEntity.class); - updateById(entity); + public void addOftenUseFunction(List formDTOS, TokenDto tokenDto) { + if (CollectionUtils.isNotEmpty(formDTOS)){ + baseDao.deleteOldData(tokenDto.getUserId(),tokenDto.getCustomerId()); + List entities = ConvertUtils.sourceToTarget(formDTOS, IcOftenUseFunctionEntity.class); + entities.forEach(e -> { + e.setCustomerId(tokenDto.getCustomerId()); + e.setUserId(tokenDto.getUserId()); + }); + insertBatch(entities); + } } } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml index 78574bd371..5f25af85fc 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml @@ -3,5 +3,25 @@ + + + DELETE FROM ic_often_use_function WHERE USER_ID = #{userId} AND CUSTOMER_ID = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java new file mode 100644 index 0000000000..b41d1d04df --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 10:59 上午 + * @DESC + */ +@Data +public class EditIndividualCategoryFormDTO implements Serializable { + + private static final long serialVersionUID = -3492393795553841513L; + + public interface EditIndividualCategoryForm{} + + @NotBlank(message = "columnId不能为空",groups = EditIndividualCategoryForm.class) + private String columnId; + + @NotNull(message = "sort不能为空",groups = EditIndividualCategoryForm.class) + private Integer sort; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java new file mode 100644 index 0000000000..4089a151df --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 10:52 上午 + * @DESC + */ +@Data +public class IndividualCategoryListResultDTO implements Serializable { + + private static final long serialVersionUID = -3294223041971531203L; + + /** + * 标签 + */ + private String label; + + /** + * 图片 + */ + private String managementIcon; + + /** + * 字段名 + */ + private String columnName; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java index 44fe329111..cd3122cd47 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java @@ -1,15 +1,21 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcIndividualCategoryManageDTO; +import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.service.IcIndividualCategoryManageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 个人分类管理 * @@ -23,19 +29,27 @@ public class IcIndividualCategoryManageController { @Autowired private IcIndividualCategoryManageService icIndividualCategoryManageService; - @PostMapping - public Result save(@RequestBody IcIndividualCategoryManageDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icIndividualCategoryManageService.save(dto); - return new Result(); + /** + * @Description 【人员分类管理】查询个人分类列表 + * @param tokenDto + * @author zxc + * @date 2022/1/17 10:55 上午 + */ + @PostMapping("individualcategorylist") + public Result> individualCategoryList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icIndividualCategoryManageService.individualCategoryList(tokenDto)); } - @PutMapping - public Result update(@RequestBody IcIndividualCategoryManageDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icIndividualCategoryManageService.update(dto); + /** + * @Description 【人员分类管理】个人分类修改(添加修改一个接口) + * @param formDTOS + * @param tokenDto + * @author zxc + * @date 2022/1/17 11:04 上午 + */ + @PostMapping("editindividualcategory") + public Result editIndividualCategory(@RequestBody List formDTOS,@LoginUser TokenDto tokenDto){ + icIndividualCategoryManageService.editIndividualCategory(formDTOS,tokenDto); return new Result(); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java index cdc466058b..772cfc7e73 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcIndividualCategoryManageDao.java @@ -1,8 +1,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.entity.IcIndividualCategoryManageEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 个人分类管理 @@ -12,5 +16,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcIndividualCategoryManageDao extends BaseDao { - + + /** + * @Description 删除旧数据 + * @param userId + * @param customerId + * @author zxc + * @date 2022/1/17 11:10 上午 + */ + void deleteOldData(@Param("userId")String userId,@Param("customerId")String customerId); + + /** + * @Description 【人员分类管理】查询个人分类列表 + * @param userId + * @author zxc + * @date 2022/1/17 1:25 下午 + */ + List individualCategoryList(@Param("userId")String userId); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java index e21285817c..4b15339377 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java @@ -2,7 +2,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcIndividualCategoryManageDTO; +import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.entity.IcIndividualCategoryManageEntity; import java.util.List; @@ -17,22 +20,20 @@ import java.util.Map; public interface IcIndividualCategoryManageService extends BaseService { /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-01-17 + * @Description 【人员分类管理】查询个人分类列表 + * @param tokenDto + * @author zxc + * @date 2022/1/17 10:55 上午 */ - void save(IcIndividualCategoryManageDTO dto); + List individualCategoryList(TokenDto tokenDto); /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-01-17 + * @Description 【人员分类管理】个人分类修改(添加修改一个接口) + * @param formDTOS + * @param tokenDto + * @author zxc + * @date 2022/1/17 11:04 上午 */ - void update(IcIndividualCategoryManageDTO dto); + void editIndividualCategory(List formDTOS, TokenDto tokenDto); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java index 073cbc82b4..c684c8c36e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java @@ -1,23 +1,19 @@ 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.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcIndividualCategoryManageDao; -import com.epmet.dto.IcIndividualCategoryManageDTO; +import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.entity.IcIndividualCategoryManageEntity; import com.epmet.service.IcIndividualCategoryManageService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; -import java.util.Map; /** * 个人分类管理 @@ -28,18 +24,39 @@ import java.util.Map; @Service public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl implements IcIndividualCategoryManageService { + /** + * @Description 【人员分类管理】查询个人分类列表 + * @param tokenDto + * @author zxc + * @date 2022/1/17 10:55 上午 + */ @Override - @Transactional(rollbackFor = Exception.class) - public void save(IcIndividualCategoryManageDTO dto) { - IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class); - insert(entity); + public List individualCategoryList(TokenDto tokenDto) { + List result = baseDao.individualCategoryList(tokenDto.getUserId()); + if (CollectionUtils.isNotEmpty(result)){ + return result; + } + return new ArrayList<>(); } + /** + * @Description 【人员分类管理】个人分类修改(添加修改一个接口) + * @param formDTOS + * @param tokenDto + * @author zxc + * @date 2022/1/17 11:04 上午 + */ @Override @Transactional(rollbackFor = Exception.class) - public void update(IcIndividualCategoryManageDTO dto) { - IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class); - updateById(entity); + public void editIndividualCategory(List formDTOS, TokenDto tokenDto) { + if (CollectionUtils.isNotEmpty(formDTOS)){ + baseDao.deleteOldData(tokenDto.getUserId(),tokenDto.getCustomerId()); + List entities = ConvertUtils.sourceToTarget(formDTOS, IcIndividualCategoryManageEntity.class); + entities.forEach(e -> { + e.setCustomerId(tokenDto.getCustomerId()); + e.setUserId(tokenDto.getUserId()); + }); + insertBatch(entities); + } } - } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml index abb3d01e4a..926e0a8baf 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml @@ -3,5 +3,21 @@ + + + DELETE FROM ic_individual_category_manage WHERE USER_ID = #{userId} AND CUSTOMER_ID = #{customerId} + + + \ No newline at end of file From e895d2315c30d4cbed1d71fbbb3ec97756fc1e3f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 17 Jan 2022 14:51:36 +0800 Subject: [PATCH 09/83] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E6=9F=A5=E8=AF=A2-=E6=90=9C=E7=B4=A2=E5=B1=85?= =?UTF-8?q?=E6=B0=91=20/icresiuser/search?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcUserDemandRecController.java | 4 ++- .../com/epmet/controller/HouseController.java | 1 + .../epmet/dto/form/IcResiUserPageFormDTO.java | 6 ++++ .../controller/IcResiUserController.java | 28 +++++++++++++++++++ .../java/com/epmet/dao/IcResiUserDao.java | 3 +- .../service/impl/IcResiUserServiceImpl.java | 5 ++-- .../main/resources/mapper/IcResiUserDao.xml | 7 +++++ 7 files changed, 49 insertions(+), 5 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 019771d846..e3e9cde3b8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -66,7 +66,7 @@ import java.util.List; @RestController @RequestMapping("userdemand") public class IcUserDemandRecController implements ResultDataResolver { - + @Autowired private IcUserDemandRecService icUserDemandRecService; @Autowired @@ -346,6 +346,8 @@ public class IcUserDemandRecController implements ResultDataResolver { return new Result(); } + keyword = keyword.trim(); + LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO(); form.setApp(loginUser.getApp()); form.setClient(loginUser.getClient()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 44593788a9..f593287e77 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -103,6 +103,7 @@ public class HouseController implements ResultDataResolver { return new Result().ok(r); } + keyword = keyword.trim(); String neighborhoodName; String buildingName; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java index bf75ed325f..462353b404 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java @@ -37,5 +37,11 @@ public class IcResiUserPageFormDTO implements Serializable { @NotBlank(message = "当前用户id不能为空", groups = AddUserInternalGroup.class) private String staffId; + + /** + * 关键词 + */ + private String keyword; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 395a5d40b9..dd6cf7ef7e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -640,4 +640,32 @@ public class IcResiUserController { } return new Result<>(); } + + /** + * 【社区查询】搜索居民们 + * @param input + * @return + */ + @PostMapping("search") + public Result>> searchResi(@RequestBody IcResiUserPageFormDTO input, @LoginUser TokenDto loginUser) { + if (StringUtils.isBlank(input.getKeyword())) { + PageData> r = new PageData>(new ArrayList<>(), 0); + return new Result>>().ok(r); + } + + input.setKeyword(input.getKeyword().trim()); + input.setCustomerId(loginUser.getCustomerId()); + input.setStaffId(loginUser.getUserId()); + input.setFormCode("resi_base_info"); + if (input.getPageNo() == null) { + input.setPageNo(1); + } + + if (input.getPageSize() == null) { + input.setPageSize(20); + } + + PageData> r = icResiUserService.pageResiMap(input); + return new Result>>().ok(r); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index f1822e93f2..3a9cffbf7e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -59,7 +59,8 @@ public interface IcResiUserDao extends BaseDao { @Param("subTables") List subTables, @Param("currentStaffAgencyId")String currentStaffAgencyId, @Param("staffOrgPath") String staffOrgPath, - @Param("resultTableName")String resultTableName); + @Param("resultTableName")String resultTableName, + @Param("keyword") String keyword); /** * 查询主表 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 70f34f2849..cfa57f050e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -348,15 +348,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> list=baseDao.selectListResiMap(formDTO.getCustomerId(), formDTO.getFormCode(), formDTO.getConditions(), resultColumns, subTables,staffInfoCacheResult.getAgencyId(), - staffOrgPath,null); + staffOrgPath,null, formDTO.getKeyword()); pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size()); pageInfo.setList(list); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 6b07136f1c..9d07548103 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -51,6 +51,13 @@ AND ${resultTableName}.ID IS NOT NULL + + AND ( + NAME = #{keyword} + or MOBILE = #{keyword} + or ID_CARD = #{keyword} + ) + and ic_resi_user.customer_id=#{customerId} and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%')) From 2632dd99ca9f42087dcccdb7c170f7b52c436086 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 17 Jan 2022 15:45:11 +0800 Subject: [PATCH 10/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=B0=83=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/epmetuser/IcResiUserEntity.java | 5 + .../epmet/feign/GovOrgOpenFeignClient.java | 7 + .../GovOrgOpenFeignClientFallback.java | 12 +- .../controller/CustomerAgencyController.java | 10 + .../epmet/service/CustomerAgencyService.java | 7 + .../impl/CustomerAgencyServiceImpl.java | 32 +++ .../feign/OperCustomizeOpenFeignClient.java | 7 + .../OperCustomizeOpenFeignClientFallback.java | 5 + .../IcResiCategoryWarnConfigController.java | 9 + .../IcResiCategoryWarnConfigService.java | 6 + .../IcResiCategoryWarnConfigServiceImpl.java | 14 ++ .../java/com/epmet/dto/IcResiUserDTO.java | 5 + .../epmet/dto/IcUserChangeDetailedDTO.java | 2 +- .../com/epmet/dto/IcUserChangeRecordDTO.java | 4 +- .../IcUserTransferRecordController.java | 23 ++ .../java/com/epmet/dao/IcResiUserDao.java | 2 + .../com/epmet/entity/IcResiUserEntity.java | 5 + .../entity/IcUserChangeDetailedEntity.java | 2 +- .../entity/IcUserChangeRecordEntity.java | 4 +- .../service/IcUserTransferRecordService.java | 7 + .../impl/IcUserTransferRecordServiceImpl.java | 229 ++++++++++++++++++ .../main/resources/mapper/IcResiUserDao.xml | 28 +++ 22 files changed, 418 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java index e40441101d..657b37bb14 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java @@ -440,6 +440,11 @@ public class IcResiUserEntity extends BaseEpmetEntity { */ private String jtxxRemakes; + /** + * 用户状态【0:正常 1:转出】 + */ + private String status; + /** * 预留字段1 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 9bd7bfb642..497cae9547 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -576,4 +576,11 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customeragency/configcustomerareacode") Result configCustomerAreaCode(@RequestBody CustomerAreaCodeFormDTO formDTO); + + /** + * @Author sun + * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 + **/ + @PostMapping(value = "/gov/org/customeragency/icresiuserorgmsg") + Result icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index c3ddd39202..d4330f90d0 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -362,11 +362,21 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { /** * 运营端-客户管理,修改客户信息,调用gov-org服务,修改组织区划开关,修改根组织areaCode入参。 * - * @param areaCodeFormDTO + * @param formDTO * @return */ @Override public Result configCustomerAreaCode(CustomerAreaCodeFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "configCustomerAreaCode", formDTO); } + + /** + * @Author sun + * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 + **/ + @Override + public Result icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "icResiUserOrgMsg", formDTO); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index d826060c2d..db2a0eec32 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -395,4 +395,14 @@ public class CustomerAgencyController { customerAgencyService.configCustomerAreaCode(formDTO); return new Result(); } + + /** + * @Author sun + * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 + **/ + @PostMapping(value = "icresiuserorgmsg") + Result icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO) { + return new Result().ok(customerAgencyService.icResiUserOrgMsg(formDTO)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 3e7406594e..3e4f44cd36 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -276,4 +276,11 @@ public interface CustomerAgencyService extends BaseService * @return */ void configCustomerAreaCode(CustomerAreaCodeFormDTO formDTO); + + /** + * @Author sun + * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 + **/ + IcResiUserOrgMsgResultDTO icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 0cb99364a8..372aafa390 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -98,6 +98,14 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input); + /** + * @author sun + * @Description 获取客户居民类别预警配置表数据 + */ + @PostMapping("/oper/customize/icresicategorywarnconfig/categorywarnconfiglist/{customerId}") + Result> categoryWarnConfigList(@PathVariable String customerId); + } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index da282124bb..9e4b5eca25 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -109,4 +109,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> listOptionsByItemConditions(IcFormOptionsQueryFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listOptionsByItemConditions", input); } + + @Override + public Result> categoryWarnConfigList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "categoryWarnConfigList", customerId); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java index 5e1ac6667b..004912ec40 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryWarnConfigController.java @@ -91,4 +91,13 @@ public class IcResiCategoryWarnConfigController { ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryWarnConfigExcel.class); } + /** + * @author sun + * @Description 获取客户居民类别预警配置表数据 + */ + @PostMapping("categorywarnconfiglist/{customerId}") + Result> categoryWarnConfigList(@PathVariable String customerId) { + return new Result>().ok(icResiCategoryWarnConfigService.categoryWarnConfigList(customerId)); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java index bef9c7360f..adc78df071 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryWarnConfigService.java @@ -92,4 +92,10 @@ public interface IcResiCategoryWarnConfigService extends BaseService categoryWarnConfigList(String customerId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java index 3235b04f0d..9559cf07f0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryWarnConfigServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -101,4 +102,17 @@ public class IcResiCategoryWarnConfigServiceImpl extends BaseServiceImpl categoryWarnConfigList(String customerId) { + LambdaQueryWrapper wrapperWarn = new LambdaQueryWrapper<>(); + wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, customerId); + wrapperWarn.orderByAsc(IcResiCategoryWarnConfigEntity::getSort); + List entityList = baseDao.selectList(wrapperWarn); + return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java index 62fa0e45cf..72769ea31e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java @@ -448,6 +448,11 @@ public class IcResiUserDTO implements Serializable { */ private String jtxxRemakes; + /** + * 用户状态【0:正常 1:转出】 + */ + private String status; + /** * 删除标识 0.未删除 1.已删除 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java index 2c5203eddd..2220f907f5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java @@ -45,7 +45,7 @@ public class IcUserChangeDetailedDTO implements Serializable { private String customerId; /** - * 字段名【18类对应的ic_resi_user表字段名】 + * 变更记录表主键【ic_user_change_record.id】 */ private String icUserChangeRecordId; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java index e9f4e3ff91..5e4818d8f8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeRecordDTO.java @@ -69,12 +69,12 @@ public class IcUserChangeRecordDTO implements Serializable { private String icUserName; /** - * 操作类型【add:新增 category:类别变动 transfer】 + * 操作类型【add:新增 category:类别 transfer:调动】 */ private String type; /** - * 操作类型名称【add:新增 category:类别变动 transfer:迁出】 + * 操作类型名称【add:新增 category:类别 transfer:调动】 */ private String typeName; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java index ead153c8cf..bb45818970 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserTransferRecordController.java @@ -17,8 +17,16 @@ package com.epmet.controller; +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; +import com.epmet.dto.form.IcResiUserTransferFormDTO; import com.epmet.service.IcUserTransferRecordService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -37,4 +45,19 @@ public class IcUserTransferRecordController { private IcUserTransferRecordService icUserTransferRecordService; + /** + * @Author sun + * @Description 【基础信息】人员调动 + **/ + @NoRepeatSubmit + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserTransferFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcResiUserTransferFormDTO.TransferAdd.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + icUserTransferRecordService.add(formDTO); + return new Result(); + } + + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 3a9cffbf7e..db5f3aa613 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -229,4 +229,6 @@ public interface IcResiUserDao extends BaseDao { @Param("code") String code); List listIcResiInfosByUserIds(@Param("userIds") List userIds); + + Map getCategoryListMap(@Param("icUserId") String icUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java index f647871525..4a25a479af 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java @@ -440,6 +440,11 @@ public class IcResiUserEntity extends BaseEpmetEntity { */ private String jtxxRemakes; + /** + * 用户状态【0:正常 1:转出】 + */ + private String status; + /** * 预留字段1 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java index e230fbfd2a..35608feae9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java @@ -42,7 +42,7 @@ public class IcUserChangeDetailedEntity extends BaseEpmetEntity { private String customerId; /** - * 字段名【18类对应的ic_resi_user表字段名】 + * 变更记录表主键【ic_user_change_record.id】 */ private String icUserChangeRecordId; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java index eaf7226588..82b964d104 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeRecordEntity.java @@ -68,12 +68,12 @@ public class IcUserChangeRecordEntity extends BaseEpmetEntity { private String icUserName; /** - * 操作类型【add:新增 category:类别变动 transfer】 + * 操作类型【add:新增 category:类别 transfer:调动】 */ private String type; /** - * 操作类型名称【add:新增 category:类别变动 transfer:迁出】 + * 操作类型名称【add:新增 category:类别 transfer:调动】 */ private String typeName; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java index 5ce1565dcf..4d1d25f952 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java @@ -18,6 +18,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.IcResiUserTransferFormDTO; import com.epmet.entity.IcUserTransferRecordEntity; /** @@ -28,4 +29,10 @@ import com.epmet.entity.IcUserTransferRecordEntity; */ public interface IcUserTransferRecordService extends BaseService { + /** + * @Author sun + * @Description 【基础信息】人员调动 + **/ + void add(IcResiUserTransferFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index 4e06314238..2f7dafb468 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java @@ -18,11 +18,35 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcResiUserDao; import com.epmet.dao.IcUserTransferRecordDao; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.IcResiUserOrgMsgFormDTO; +import com.epmet.dto.form.IcResiUserTransferFormDTO; +import com.epmet.dto.result.IcResiUserOrgMsgResultDTO; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.entity.IcUserChangeDetailedEntity; +import com.epmet.entity.IcUserChangeRecordEntity; import com.epmet.entity.IcUserTransferRecordEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcUserChangeDetailedService; +import com.epmet.service.IcUserChangeRecordService; import com.epmet.service.IcUserTransferRecordService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + /** * 居民调动记录表 * @@ -31,6 +55,211 @@ import org.springframework.stereotype.Service; */ @Service public class IcUserTransferRecordServiceImpl extends BaseServiceImpl implements IcUserTransferRecordService { + private Logger log = LoggerFactory.getLogger(IcUserTransferRecordServiceImpl.class); + @Autowired + private IcResiUserDao icResiUserDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcUserChangeRecordService icUserChangeRecordService; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private IcUserChangeDetailedService icUserChangeDetailedService; + + /** + * @Author sun + * @Description 【基础信息】人员调动 + **/ + @Override + public void add(IcResiUserTransferFormDTO formDTO) { + //1.判断被调动人员是否有效 + IcResiUserDTO resiUserDTO = icResiUserDao.selectIdByIdCard(formDTO.getCustomerId(), null, formDTO.getIcUserId()); + if (null == resiUserDTO) { + throw new RenException("9000", "人员调动失败,被调动人不存在!"); + } + + //2.查询人员调动前的组织、网格、小区、楼栋、单元、房屋信息 + IcResiUserOrgMsgFormDTO orgMsgFormDTO1 = new IcResiUserOrgMsgFormDTO(); + orgMsgFormDTO1.setCustomerId(resiUserDTO.getCustomerId()); + orgMsgFormDTO1.setAgencyId(resiUserDTO.getAgencyId()); + orgMsgFormDTO1.setGridId(resiUserDTO.getGridId()); + orgMsgFormDTO1.setNeighborHoodId(resiUserDTO.getVillageId()); + orgMsgFormDTO1.setBuildingId(resiUserDTO.getBuildId()); + orgMsgFormDTO1.setBuildingUnitId(resiUserDTO.getUnitId()); + orgMsgFormDTO1.setHouseId(resiUserDTO.getHomeId()); + Result result1 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO1); + if (!result1.success() || null == result1.getData().getAgencyDTO() || null == result1.getData().getGridDTO() || null == result1.getData().getNeighborHoodDTO() + || null == result1.getData().getBuildingDTO() || null == result1.getData().getBuildingUnitDTO() || null == result1.getData().getHouseDTO()) { + log.warn("查找被调动人调动前的组织、网格、小区、楼栋、单元、房屋信息失败"); + throw new RenException("9000", "获取被调动人基础信息失败"); + } + + //3.查询人员调动后的组织、网格、小区、楼栋、单元、房屋信息 + IcResiUserOrgMsgFormDTO orgMsgFormDTO2 = new IcResiUserOrgMsgFormDTO(); + orgMsgFormDTO2.setCustomerId(formDTO.getCustomerId()); + orgMsgFormDTO2.setAgencyId(formDTO.getNewAgencyId()); + orgMsgFormDTO2.setGridId(formDTO.getNewGridId()); + orgMsgFormDTO2.setNeighborHoodId(formDTO.getNewNeighborHoodId()); + orgMsgFormDTO2.setBuildingId(formDTO.getNewBuildingId()); + orgMsgFormDTO2.setBuildingUnitId(formDTO.getNewBuildingUnitId()); + orgMsgFormDTO2.setHouseId(formDTO.getNewHouseId()); + Result result2 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO2); + if (!result2.success() || null == result2.getData().getAgencyDTO() || null == result2.getData().getGridDTO() || null == result2.getData().getNeighborHoodDTO() + || null == result2.getData().getBuildingDTO() || null == result2.getData().getBuildingUnitDTO() || null == result2.getData().getHouseDTO()) { + log.warn("查找被调动人调动后的组织、网格、小区、楼栋、单元、房屋信息失败"); + throw new RenException("9000", "获取被调动人基础信息失败"); + } + + //4.修改被调动人所属各维度信息或人员状态信息 + IcResiUserEntity userEntity = new IcResiUserEntity(); + userEntity.setId(formDTO.getIcUserId()); + if ("out".equals(formDTO.getType())) { + //4-1.转到客户外修改基础信息表人员信息状态 + userEntity.setStatus("1"); + } else { + //4-2.客户内部流转修改所属各维度信息 + userEntity.setAgencyId(formDTO.getNewAgencyId()); + userEntity.setGridId(formDTO.getNewGridId()); + userEntity.setVillageId(formDTO.getNewNeighborHoodId()); + userEntity.setBuildId(formDTO.getNewBuildingId()); + userEntity.setUnitId(formDTO.getNewBuildingUnitId()); + userEntity.setHomeId(formDTO.getNewHouseId()); + } + icResiUserDao.updateById(userEntity); + + //5.生成调动记录 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + IcUserTransferRecordEntity recordEntity = saveTransferRecord(staffInfoCache, formDTO, resiUserDTO, result1.getData(), result2.getData()); + insert(recordEntity); + + //6.生成调动前后的变更记录、变更明细 + //6-1.变更记录 + IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); + changeRecordEntity.setIcUserTransferRecordId(recordEntity.getId()); + if ("in".equals(formDTO.getType())) { + changeRecordEntity.setCustomerId(resiUserDTO.getCustomerId()); + } + changeRecordEntity.setOperatorId(formDTO.getStaffId()); + changeRecordEntity.setIcUserId(formDTO.getIcUserId()); + changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); + changeRecordEntity.setIcUserName(resiUserDTO.getName()); + changeRecordEntity.setType("transfer"); + changeRecordEntity.setTypeName("调动"); + StringBuffer beforeName = new StringBuffer(); + beforeName.append(result1.getData().getAgencyDTO().getOrganizationName()).append("-").append(result1.getData().getGridDTO().getGridName()).append("-") + .append(result1.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result1.getData().getBuildingDTO().getBuildingName()).append("-") + .append(result1.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result1.getData().getHouseDTO().getHouseName()); + changeRecordEntity.setBeforeChangeName(beforeName.toString()); + StringBuffer afterName = new StringBuffer(); + afterName.append(result2.getData().getAgencyDTO().getOrganizationName()).append("-").append(result2.getData().getGridDTO().getGridName()).append("-") + .append(result2.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result2.getData().getBuildingDTO().getBuildingName()).append("-") + .append(result2.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result2.getData().getHouseDTO().getHouseName()); + changeRecordEntity.setAfterChangeName(afterName.toString()); + changeRecordEntity.setChangeTime(formDTO.getTransferTime()); + changeRecordEntity.setRemark(formDTO.getRemark()); + icUserChangeRecordService.insert(changeRecordEntity); + //6-2.变更明细【类别明细迁出组织的-1,迁入组织的1】 + Result> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(formDTO.getCustomerId()); + if (!resultList.success()) { + throw new RuntimeException("人员调动,获取客户居民类别预警配置表数据失败"); + } + Map map = icResiUserDao.getCategoryListMap(formDTO.getIcUserId()); + List changeDetailedEntityList = saveChangeDetailed(resultList.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO); + icUserChangeDetailedService.insertBatch(changeDetailedEntityList); + + } + + /** + * @Author sun + * @Description 调动记录 + **/ + private IcUserTransferRecordEntity saveTransferRecord(CustomerStaffInfoCacheResult staffInfoCache, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO, IcResiUserOrgMsgResultDTO result1, IcResiUserOrgMsgResultDTO result2) { + IcUserTransferRecordEntity recordEntity = new IcUserTransferRecordEntity(); + recordEntity.setIcUserId(formDTO.getIcUserId()); + recordEntity.setOperatorId(formDTO.getStaffId()); + recordEntity.setIcUserName(resiUserDTO.getName()); + recordEntity.setOperatorName(null == staffInfoCache ? "" : staffInfoCache.getRealName()); + recordEntity.setOldCustomerId(formDTO.getCustomerId()); + if ("in".equals(formDTO.getType())) { + recordEntity.setNewCustomerId(resiUserDTO.getCustomerId()); + } + recordEntity.setOldAgencyId(resiUserDTO.getAgencyId()); + recordEntity.setNewAgencyId(formDTO.getNewAgencyId()); + recordEntity.setOldAgencyName(result1.getAgencyDTO().getOrganizationName()); + recordEntity.setNewAgencyName(result2.getAgencyDTO().getOrganizationName()); + recordEntity.setOldGridId(resiUserDTO.getGridId()); + recordEntity.setNewGridId(formDTO.getNewGridId()); + recordEntity.setOldGridName(result1.getGridDTO().getGridName()); + recordEntity.setNewGridName(result2.getGridDTO().getGridName()); + recordEntity.setOldNeighborHoodId(resiUserDTO.getVillageId()); + recordEntity.setNewNeighborHoodId(formDTO.getNewNeighborHoodId()); + recordEntity.setOldNeighborHoodName(result1.getNeighborHoodDTO().getNeighborHoodName()); + recordEntity.setNewNeighborHoodName(result2.getNeighborHoodDTO().getNeighborHoodName()); + recordEntity.setOldBuildingId(resiUserDTO.getBuildId()); + recordEntity.setNewBuildingId(formDTO.getNewBuildingId()); + recordEntity.setOldBuildingName(result1.getBuildingDTO().getBuildingName()); + recordEntity.setNewBuildingName(result2.getBuildingDTO().getBuildingName()); + recordEntity.setOldBuildingUnitId(resiUserDTO.getUnitId()); + recordEntity.setNewBuildingUnitId(formDTO.getNewBuildingUnitId()); + recordEntity.setOldBuildingUnitName(result1.getBuildingUnitDTO().getUnitName()); + recordEntity.setNewBuildingUnitName(result2.getBuildingUnitDTO().getUnitName()); + recordEntity.setOldHouseId(resiUserDTO.getHomeId()); + recordEntity.setNewHouseId(formDTO.getNewHouseId()); + recordEntity.setOldHouseName(result1.getHouseDTO().getHouseName()); + recordEntity.setNewHouseName(result2.getHouseDTO().getHouseName()); + recordEntity.setTransferTime(formDTO.getTransferTime()); + recordEntity.setRemark(formDTO.getRemark()); + return recordEntity; + } + /** + * @Author sun + * @Description 变更明细 + **/ + private List saveChangeDetailed(List configList, Map map, String icUserChangeRecordId, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO) { + List list = new ArrayList<>(); + IcUserChangeDetailedEntity outEntity = null; + IcUserChangeDetailedEntity inEntity = null; + for (IcResiCategoryWarnConfigDTO cf : configList) { + if ("1".equals(map.get(cf.getColumnName()))) { + //迁出 + outEntity = new IcUserChangeDetailedEntity(); + outEntity.setCustomerId(formDTO.getCustomerId()); + outEntity.setIcUserChangeRecordId(icUserChangeRecordId); + outEntity.setAgencyId(resiUserDTO.getAgencyId()); + outEntity.setGridId(resiUserDTO.getGridId()); + outEntity.setNeighborHoodId(resiUserDTO.getVillageId()); + outEntity.setBuildingId(resiUserDTO.getBuildId()); + outEntity.setBuildingUnitId(resiUserDTO.getUnitId()); + outEntity.setHouseId(resiUserDTO.getHomeId()); + outEntity.setIcUserId(formDTO.getIcUserId()); + outEntity.setType("out"); + outEntity.setTypeName("迁出"); + outEntity.setFieldName(cf.getColumnName()); + outEntity.setValue(-1); + list.add(outEntity); + //迁入 + if ("in".equals(formDTO.getType())) { + inEntity = new IcUserChangeDetailedEntity(); + inEntity.setCustomerId(formDTO.getCustomerId()); + inEntity.setIcUserChangeRecordId(icUserChangeRecordId); + inEntity.setAgencyId(formDTO.getNewAgencyId()); + inEntity.setGridId(formDTO.getNewGridId()); + inEntity.setNeighborHoodId(formDTO.getNewNeighborHoodId()); + inEntity.setBuildingId(formDTO.getNewBuildingId()); + inEntity.setBuildingUnitId(formDTO.getNewBuildingUnitId()); + inEntity.setHouseId(formDTO.getNewHouseId()); + inEntity.setIcUserId(formDTO.getIcUserId()); + inEntity.setType("in"); + inEntity.setTypeName("迁入"); + inEntity.setFieldName(cf.getColumnName()); + inEntity.setValue(1); + list.add(inEntity); + } + } + } + return list; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 9d07548103..ba5276177a 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -513,4 +513,32 @@ #{userId} + + + From ab11db590d96db31ae872844a8efe4526857f960 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Jan 2022 16:00:32 +0800 Subject: [PATCH 11/83] =?UTF-8?q?=E9=A2=84=E8=AD=A6pie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/PersonWarnLeftPieDTO.java | 26 +++++++++ .../result/PersonWarnLeftPieResultDTO.java | 48 +++++++++++++++++ .../controller/IcStatsResiWarnController.java | 14 +++++ .../com/epmet/dao/IcStatsResiWarnDao.java | 10 ++++ .../epmet/service/IcStatsResiWarnService.java | 10 ++++ .../impl/IcStatsResiWarnServiceImpl.java | 53 ++++++++++++++++++- .../resources/mapper/IcStatsResiWarnDao.xml | 16 ++++++ 7 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java new file mode 100644 index 0000000000..d6feeb3c18 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/PersonWarnLeftPieDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 3:27 下午 + * @DESC + */ +@Data +public class PersonWarnLeftPieDTO implements Serializable { + + private static final long serialVersionUID = 337571869959815613L; + + private Integer count; + + private String configId; + + public PersonWarnLeftPieDTO() { + this.count = NumConstant.ZERO; + this.configId = ""; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java new file mode 100644 index 0000000000..44d714a318 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnLeftPieResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/1/17 2:33 下午 + * @DESC + */ +@Data +public class PersonWarnLeftPieResultDTO implements Serializable { + + private static final long serialVersionUID = -111604873581992490L; + + private Integer total; + + private List list; + + public PersonWarnLeftPieResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } + + @Data + public static class PersonWarnLeftPie{ + + @JsonIgnore + private String configId; + + private String typeName; + + private String typeCode; + + private Integer typeCount; + + public PersonWarnLeftPie() { + this.typeName = ""; + this.typeCode = ""; + this.typeCount = NumConstant.ZERO; + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java index f0b9860e45..5b681b639b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcStatsResiWarnController.java @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcStatsResiWarnDTO; +import com.epmet.dto.result.PersonWarnLeftPieResultDTO; import com.epmet.excel.IcStatsResiWarnExcel; import com.epmet.service.IcStatsResiWarnService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +94,15 @@ public class IcStatsResiWarnController { ExcelUtils.exportExcelToTarget(response, null, list, IcStatsResiWarnExcel.class); } + /** + * @Description 【社区查询】人员预警饼图 + * @param tokenDto + * @author zxc + * @date 2022/1/17 2:39 下午 + */ + @PostMapping("personwarn/leftpie") + public Result personWarnLeftPie(@LoginUser TokenDto tokenDto){ + return new Result().ok(icStatsResiWarnService.personWarnLeftPie(tokenDto)); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java index ef9fac802c..aeb0c2ca82 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.PersonWarnLeftPieDTO; import com.epmet.entity.IcStatsResiWarnEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -58,4 +59,13 @@ public interface IcStatsResiWarnDao extends BaseDao { @Param("columnName") String columnName, @Param("icStatsResiWarn") IcStatsResiWarnEntity icStatsResiWarn); + /** + * @Description 查询分类下的人数 + * @param configIds + * @param agencyId + * @author zxc + * @date 2022/1/17 3:30 下午 + */ + List selectCategoryCount(@Param("configIds") List configIds,@Param("agencyId")String agencyId); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java index 6a0592adbe..b63f35a59e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcStatsResiWarnService.java @@ -19,7 +19,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcStatsResiWarnDTO; +import com.epmet.dto.result.PersonWarnLeftPieResultDTO; import com.epmet.entity.IcStatsResiWarnEntity; import java.util.List; @@ -92,4 +94,12 @@ public interface IcStatsResiWarnService extends BaseService implements IcStatsResiWarnService { @Autowired - private IcStatsResiWarnRedis icStatsResiWarnRedis; + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; @Override public PageData page(Map params) { @@ -101,4 +113,43 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl> listResult = operCustomizeOpenFeignClient.resiCategoryWarnList(tokenDto.getCustomerId()); + if (!listResult.success()){ + throw new EpmetException("查询设置预警的分类失败..."); + } + PersonWarnLeftPieResultDTO result = new PersonWarnLeftPieResultDTO(); + if (CollectionUtils.isEmpty(listResult.getData())){ + return result; + } + List configList = listResult.getData(); + List list = new ArrayList<>(); + configList.forEach(c -> { + PersonWarnLeftPieResultDTO.PersonWarnLeftPie p = new PersonWarnLeftPieResultDTO.PersonWarnLeftPie(); + p.setTypeName(c.getLabel()); + p.setTypeCode(c.getColumnName()); + p.setConfigId(c.getId()); + list.add(p); + }); + List dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getId()).collect(Collectors.toList()), staffInfo.getAgencyId()); + if (CollectionUtils.isNotEmpty(dtos)){ + list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount()))); + } + result.setTotal(list.stream().collect(Collectors.summingInt(PersonWarnLeftPieResultDTO.PersonWarnLeftPie::getTypeCount))); + result.setList(list); + return result; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index 4a4a2a6cc3..683938f80e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -131,4 +131,20 @@ and AGENCY_ID = #{icStatsResiWarn.agencyId} and GRID_ID =#{icStatsResiWarn.gridId} and VILLAGE_ID=#{icStatsResiWarn.neighborHoodId} and BUILD_ID=#{icStatsResiWarn.buildingId} group by AGENCY_ID,GRID_ID,VILLAGE_ID,BUILD_ID + + + \ No newline at end of file From 84fa402af1b948e3c0fdf73752823a409302c173 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 17 Jan 2022 16:25:34 +0800 Subject: [PATCH 12/83] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/IcResiUserOrgMsgFormDTO.java | 44 ++++++++++++ .../dto/result/IcResiUserOrgMsgResultDTO.java | 60 ++++++++++++++++ .../dto/form/IcResiUserTransferFormDTO.java | 69 +++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java new file mode 100644 index 0000000000..28338a15a4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcResiUserOrgMsgFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form; + + +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询组织、网格、小区、楼栋、单元、房屋信息 + */ +@Data +public class IcResiUserOrgMsgFormDTO implements Serializable { + + /** + * 客户ID + */ + private String customerId; + /** + * 组织Id + */ + private String agencyId; + /** + * 网格Id + */ + private String gridId; + /** + * 小区Id + */ + private String neighborHoodId; + /** + * 楼宇Id + */ + private String buildingId; + /** + * 单元Id + */ + private String buildingUnitId; + /** + * 房屋Id + */ + private String houseId; + + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java new file mode 100644 index 0000000000..cefb9eed05 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcResiUserOrgMsgResultDTO.java @@ -0,0 +1,60 @@ +/** + * 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.dto.result; + +import com.epmet.dto.*; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 查询组织、网格、小区、楼栋、单元、房屋信息 + * + * @author sun + */ +@Data +public class IcResiUserOrgMsgResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织信息 + */ + private CustomerAgencyDTO agencyDTO; + /** + * 组织信息 + */ + private CustomerGridDTO gridDTO; + /** + * 组织信息 + */ + private IcNeighborHoodDTO neighborHoodDTO; + /** + * 组织信息 + */ + private IcBuildingDTO buildingDTO; + /** + * 组织信息 + */ + private IcBuildingUnitDTO buildingUnitDTO; + /** + * 组织信息 + */ + private IcHouseDTO houseDTO; +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java new file mode 100644 index 0000000000..9245fa0a51 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 【基础信息】人员调动 + * @Author sun + */ +@Data +public class IcResiUserTransferFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + public interface TransferAdd extends CustomerClientShowGroup {} + + /** + * 被调动人ID + */ + @NotBlank(message = "被调动人Id不能为空" , groups = TransferAdd.class) + private String icUserId; + /** + * 操作类型【客户外out,客户内in】 + */ + @NotBlank(message = "操作类型不能为空" , groups = TransferAdd.class) + private String type; + /** + * 调动到的组织Id + */ + private String newAgencyId; + /** + * 调动到的网格Id + */ + private String newGridId; + /** + * 调动到的小区ID + */ + private String newNeighborHoodId; + /** + * 调动到的楼宇Id + */ + private String newBuildingId; + /** + * 调动到的单元Id + */ + private String newBuildingUnitId; + /** + * 调动到的房屋Id + */ + private String newHouseId; + /** + * 调动时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @NotNull(message = "调动时间不能为空" , groups = TransferAdd.class) + private Date transferTime; + /** + * 备注 + */ + private String remark; + + //token中信息 + private String customerId; + private String staffId; +} From 1e3a21386755f518035b3cd1c17c69e337760d8c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 17 Jan 2022 17:19:16 +0800 Subject: [PATCH 13/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4=E5=88=A4=E6=96=AD=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E8=AF=81=E5=8F=B7=E5=94=AF=E4=B8=80=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E3=80=81=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E6=98=8E=E7=BB=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IcResiUserServiceImpl.java | 84 ++++++++++++++++--- 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index cfa57f050e..93d7eaefca 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -54,9 +54,13 @@ import com.epmet.dto.form.*; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; +import com.epmet.entity.IcUserChangeDetailedEntity; +import com.epmet.entity.IcUserChangeRecordEntity; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.*; import com.epmet.service.IcResiUserService; +import com.epmet.service.IcUserChangeDetailedService; +import com.epmet.service.IcUserChangeRecordService; import com.epmet.service.UserService; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; @@ -106,6 +110,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -162,9 +170,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl { + String name = ""; + LinkedHashMap map = new LinkedHashMap<>(); + for (IcResiUserFormDTO d : formDTO) { if ("ic_resi_user".equals(d.getTableName())) { - LinkedHashMap map = d.getList().get(0); + map = d.getList().get(0); + name = map.get("NAME"); map.put("id", resiUserId); map.put("customer_id", tokenDto.getCustomerId()); map.put("created_by", tokenDto.getUserId()); @@ -195,26 +206,79 @@ public class IcResiUserServiceImpl extends BaseServiceImpl { if (!"ic_resi_user".equals(d.getTableName())) { - for (LinkedHashMap map : d.getList()) { - map.put("id", UUID.randomUUID().toString().replaceAll("-", "")); - map.put("ic_resi_user", resiUserId); - map.put("customer_id", tokenDto.getCustomerId()); - map.put("created_by", tokenDto.getUserId()); - map.put("updated_by", tokenDto.getUserId()); + for (LinkedHashMap hash : d.getList()) { + hash.put("id", UUID.randomUUID().toString().replaceAll("-", "")); + hash.put("ic_resi_user", resiUserId); + hash.put("customer_id", tokenDto.getCustomerId()); + hash.put("created_by", tokenDto.getUserId()); + hash.put("updated_by", tokenDto.getUserId()); //字表新增数据 - baseDao.add(d.getTableName(), map); + baseDao.add(d.getTableName(), hash); } } }); + //3.变更记录表和变更记录明细表新增数据 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + //3-1.变更记录表 + IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); + changeRecordEntity.setCustomerId(tokenDto.getCustomerId()); + changeRecordEntity.setOperatorId(tokenDto.getUserId()); + changeRecordEntity.setIcUserId(resiUserId); + changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); + changeRecordEntity.setIcUserName(name); + changeRecordEntity.setType("add"); + changeRecordEntity.setTypeName("新增"); + changeRecordEntity.setBeforeChangeName("-"); + changeRecordEntity.setAfterChangeName("-"); + changeRecordEntity.setChangeTime(new java.util.Date()); + icUserChangeRecordService.insert(changeRecordEntity); + //3-2.变更明细表 + List changeDetailedEntityList = saveChangeRecord(tokenDto, map, resiUserId, changeRecordEntity.getId()); + icUserChangeDetailedService.insertBatch(changeDetailedEntityList); + return resiUserId; } + /** + * @Author sun + * @Description 变更明细表 + **/ + private List saveChangeRecord(TokenDto tokenDto, LinkedHashMap map, String icUserId, String icUserChangeRecordId) { + List list = new ArrayList<>(); + Result> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(tokenDto.getCustomerId()); + if (!resultList.success()) { + throw new RuntimeException("人员新增,获取客户居民类别预警配置表数据失败"); + } + IcUserChangeDetailedEntity outEntity = null; + for (IcResiCategoryWarnConfigDTO cf : resultList.getData()) { + if (map.containsKey(cf.getColumnName()) && "1".equals(map.get(cf.getColumnName()))) { + //新增 + outEntity = new IcUserChangeDetailedEntity(); + outEntity.setCustomerId(tokenDto.getCustomerId()); + outEntity.setIcUserChangeRecordId(icUserChangeRecordId); + outEntity.setAgencyId(map.get("AGENCY_ID")); + outEntity.setGridId(map.get("GRID_ID")); + outEntity.setNeighborHoodId(map.get("VILLAGE_ID")); + outEntity.setBuildingId(map.get("BUILD_ID")); + outEntity.setBuildingUnitId(map.get("UNIT_ID")); + outEntity.setHouseId(map.get("HOME_ID")); + outEntity.setIcUserId(icUserId); + outEntity.setType("add"); + outEntity.setTypeName("新增"); + outEntity.setFieldName(cf.getColumnName()); + outEntity.setValue(1); + list.add(outEntity); + } + } + return list; + } + /** * @Author sun * @Description 党建互联平台--修改居民信息 From ca3f532dbd4ec50740bf4d30cad03e8f0d268780 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 Jan 2022 09:25:17 +0800 Subject: [PATCH 14/83] =?UTF-8?q?=E3=80=90=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=91=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcResiUserChangeRecordFormDTO.java | 32 +++++++++++++++++++ .../result/IcUserChangeRecordResultDTO.java | 20 ++++++++++++ .../IcUserChangeRecordController.java | 16 ++++++++++ .../com/epmet/dao/IcUserChangeRecordDao.java | 11 ++++++- .../service/IcUserChangeRecordService.java | 7 ++++ .../impl/IcUserChangeRecordServiceImpl.java | 22 +++++++++++++ .../mapper/IcUserChangeRecordDao.xml | 22 +++++++++++++ 7 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java new file mode 100644 index 0000000000..9d8167fd86 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserChangeRecordFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 【基础信息】变更记录 + * @Author sun + */ +@Data +public class IcResiUserChangeRecordFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + public interface ChangeRecord extends CustomerClientShowGroup {} + + /** + * 字段对应表名 + */ + @NotBlank(message = "人员Id不能为空" , groups = ChangeRecord.class) + private String icUserId; + + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java new file mode 100644 index 0000000000..872c619cea --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserChangeRecordResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcUserChangeRecordDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 【基础信息】变更记录 + * @Author sun + */ +@Data +public class IcUserChangeRecordResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + //集合总条数 + private Integer total = 0; + //变更记录 + private List list; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java index 6da9c5b6cf..fc11027e8f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java @@ -17,8 +17,15 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.form.IcResiUserTransferFormDTO; +import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.service.IcUserChangeRecordService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -36,5 +43,14 @@ public class IcUserChangeRecordController { @Autowired private IcUserChangeRecordService icUserChangeRecordService; + /** + * @Author sun + * @Description 【基础信息】变更记录 + **/ + @PostMapping("list") + public Result list(@RequestBody IcResiUserChangeRecordFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcResiUserTransferFormDTO.TransferAdd.class); + return new Result().ok(icUserChangeRecordService.list(formDTO)); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java index f552d6798a..d0079ab6eb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcUserChangeRecordDTO; import com.epmet.entity.IcUserChangeRecordEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 居民变更记录表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcUserChangeRecordDao extends BaseDao { - + + /** + * @Author sun + * @Description 查询居民变更记录 + **/ + List getList(@Param("icUserId") String icUserId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java index 61ba776f9e..8032331a16 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java @@ -18,6 +18,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.entity.IcUserChangeRecordEntity; /** @@ -28,4 +30,9 @@ import com.epmet.entity.IcUserChangeRecordEntity; */ public interface IcUserChangeRecordService extends BaseService { + /** + * @Author sun + * @Description 【基础信息】变更记录 + **/ + IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 92589c9bfc..4b61577545 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -19,9 +19,15 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.IcUserChangeRecordDao; +import com.epmet.dto.IcUserChangeRecordDTO; +import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.entity.IcUserChangeRecordEntity; import com.epmet.service.IcUserChangeRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; /** * 居民变更记录表 @@ -32,5 +38,21 @@ import org.springframework.stereotype.Service; @Service public class IcUserChangeRecordServiceImpl extends BaseServiceImpl implements IcUserChangeRecordService { + /** + * @Author sun + * @Description 【基础信息】变更记录 + **/ + @Override + public IcUserChangeRecordResultDTO list(IcResiUserChangeRecordFormDTO formDTO) { + IcUserChangeRecordResultDTO resultDTO = new IcUserChangeRecordResultDTO(); + PageInfo result = + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO.getIcUserId())); + if (CollectionUtils.isEmpty(result.getList())) { + return resultDTO; + } + resultDTO.setTotal((int) result.getTotal()); + resultDTO.setList(result.getList()); + return resultDTO; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 6632dd653c..7c606296e0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -3,5 +3,27 @@ + \ No newline at end of file From 65b1bce49b1f18a67b8f770ddbd6d62b6d230ce0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 09:58:44 +0800 Subject: [PATCH 15/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E5=88=97=E8=A1=A8=E5=B0=8F=E6=9E=B6=E5=AD=90?= =?UTF-8?q?=20=E4=BA=BA=E5=91=98=E7=B1=BB=E5=88=AB=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E5=B8=B8=E7=94=A8=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/AddOftenUseFunctionFormDTO.java | 6 +- .../PackageAddOftenUseFunctionFormDTO.java | 27 ++++++++ .../IcOftenUseFunctionController.java | 3 + .../form/EditIndividualCategoryFormDTO.java | 6 +- .../PackageEditIndividualCategoryFormDTO.java | 27 ++++++++ .../IcIndividualCategoryManageController.java | 3 + .../dto/form/PersonWarnRightListFormDTO.java | 25 +++++++ .../result/PersonWarnRightListResultDTO.java | 68 +++++++++++++++++++ .../controller/IcResiUserController.java | 13 ++++ .../com/epmet/service/IcResiUserService.java | 10 +++ .../service/impl/IcResiUserServiceImpl.java | 12 ++++ 11 files changed, 192 insertions(+), 8 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java index f03b2a2cf0..d4e5f13356 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AddOftenUseFunctionFormDTO.java @@ -16,11 +16,9 @@ public class AddOftenUseFunctionFormDTO implements Serializable { private static final long serialVersionUID = -8044386389656626183L; - public interface AddOftenUseFunctionForm{} - - @NotBlank(message = "menuId不能为空", groups = AddOftenUseFunctionForm.class) + @NotBlank(message = "menuId不能为空",groups = PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class) private String menuId; - @NotNull(message = "sort不能为空", groups = AddOftenUseFunctionForm.class) + @NotNull(message = "sort不能为空",groups = PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class) private Integer sort; } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java new file mode 100644 index 0000000000..f34c326b3d --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/PackageAddOftenUseFunctionFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/1/17 5:20 下午 + * @DESC + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PackageAddOftenUseFunctionFormDTO implements Serializable { + + public interface PackageAddOftenUseFunctionForm{} + + @Valid + public List list; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java index 07f036e90a..6d89deab21 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/IcOftenUseFunctionController.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcOftenUseFunctionDTO; import com.epmet.dto.form.AddOftenUseFunctionFormDTO; +import com.epmet.dto.form.PackageAddOftenUseFunctionFormDTO; import com.epmet.dto.result.OftenUseFunctionListResultDTO; import com.epmet.service.IcOftenUseFunctionService; import org.springframework.beans.factory.annotation.Autowired; @@ -49,6 +50,8 @@ public class IcOftenUseFunctionController { */ @PostMapping("addoftenusefunction") public Result addOftenUseFunction(@RequestBody List formDTOS, @LoginUser TokenDto tokenDto){ + PackageAddOftenUseFunctionFormDTO fo = new PackageAddOftenUseFunctionFormDTO(formDTOS); + ValidatorUtils.validateEntity(fo, PackageAddOftenUseFunctionFormDTO.PackageAddOftenUseFunctionForm.class); icOftenUseFunctionService.addOftenUseFunction(formDTOS, tokenDto); return new Result(); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java index b41d1d04df..95cd149d83 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/EditIndividualCategoryFormDTO.java @@ -16,11 +16,9 @@ public class EditIndividualCategoryFormDTO implements Serializable { private static final long serialVersionUID = -3492393795553841513L; - public interface EditIndividualCategoryForm{} - - @NotBlank(message = "columnId不能为空",groups = EditIndividualCategoryForm.class) + @NotBlank(message = "columnId不能为空",groups = PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class) private String columnId; - @NotNull(message = "sort不能为空",groups = EditIndividualCategoryForm.class) + @NotNull(message = "sort不能为空",groups = PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class) private Integer sort; } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java new file mode 100644 index 0000000000..862c6fe88e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PackageEditIndividualCategoryFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.Valid; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/1/17 5:49 下午 + * @DESC + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PackageEditIndividualCategoryFormDTO implements Serializable { + + private static final long serialVersionUID = -6112833952805305270L; + + public interface PackageEditIndividualCategoryForm{} + + @Valid + private List list; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java index cd3122cd47..5a902c2c99 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcIndividualCategoryManageDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.form.PackageEditIndividualCategoryFormDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.service.IcIndividualCategoryManageService; import org.springframework.beans.factory.annotation.Autowired; @@ -49,6 +50,8 @@ public class IcIndividualCategoryManageController { */ @PostMapping("editindividualcategory") public Result editIndividualCategory(@RequestBody List formDTOS,@LoginUser TokenDto tokenDto){ + PackageEditIndividualCategoryFormDTO formDTO = new PackageEditIndividualCategoryFormDTO(formDTOS); + ValidatorUtils.validateEntity(formDTO,PackageEditIndividualCategoryFormDTO.PackageEditIndividualCategoryForm.class); icIndividualCategoryManageService.editIndividualCategory(formDTOS,tokenDto); return new Result(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java new file mode 100644 index 0000000000..977390e31a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 4:13 下午 + * @DESC + */ +@Data +public class PersonWarnRightListFormDTO implements Serializable { + + private static final long serialVersionUID = -3561699479212127370L; + + public interface PersonWarnRightListForm{} + + @NotNull(message = "pageNo不能为空",groups = PersonWarnRightListForm.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空",groups = PersonWarnRightListForm.class) + private Integer pageSize; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java new file mode 100644 index 0000000000..031f0e6c3d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/1/17 4:16 下午 + * @DESC + */ +@Data +public class PersonWarnRightListResultDTO implements Serializable { + + private static final long serialVersionUID = -9181230625228226662L; + + private Integer total; + + private List list; + + public PersonWarnRightListResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } + + @Data + public static class PersonWarnRightList{ + + /** + * 类型 + */ + private List type; + + /** + * 所属网格 + */ + private String gridName; + + /** + * 姓名 + */ + private String name; + + /** + * 所属家庭 + */ + private String family; + + /** + * 电话 + */ + private String mobile; + + private String userId; + + public PersonWarnRightList() { + this.type = new ArrayList<>(); + this.gridName = ""; + this.name = ""; + this.family = ""; + this.mobile = ""; + this.userId = ""; + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index dd6cf7ef7e..0c573c1049 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -668,4 +668,17 @@ public class IcResiUserController { PageData> r = icResiUserService.pageResiMap(input); return new Result>>().ok(r); } + + /** + * @Description 【社区查询】人员预警右侧列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/1/17 4:25 下午 + */ + @PostMapping("personwarn/rightlist") + public Result personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class); + return new Result().ok(icResiUserService.personWarnRightList(formDTO,tokenDto)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 16d2aaf0d9..dc2c2a76d5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -199,4 +199,14 @@ public interface IcResiUserService extends BaseService { * @return */ IcResiUserDTO get(String icResiUserId); + + /** + * @Description 【社区查询】人员预警右侧列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/1/17 4:25 下午 + */ + PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 93d7eaefca..217283da6a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -1006,6 +1006,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl Date: Tue, 18 Jan 2022 10:27:38 +0800 Subject: [PATCH 16/83] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=88=86=E7=B1=BB=E9=85=8D=E7=BD=AEshow?= =?UTF-8?q?=E7=9A=84=E5=B9=B6warn=E7=AD=89=E4=BA=8E1=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tomerCategoryShowAndWarnListResultDTO.java | 54 +++++++++++++++++++ .../feign/OperCustomizeOpenFeignClient.java | 9 ++++ .../OperCustomizeOpenFeignClientFallback.java | 7 ++- .../ResiCategoryStatsConfigController.java | 11 ++++ .../dao/IcResiCategoryStatsConfigDao.java | 9 ++++ .../IcResiCategoryStatsConfigService.java | 10 ++++ .../IcResiCategoryStatsConfigServiceImpl.java | 22 ++++++-- .../mapper/IcResiCategoryStatsConfigDao.xml | 21 ++++++++ 8 files changed, 138 insertions(+), 5 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java new file mode 100644 index 0000000000..237966afc3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerCategoryShowAndWarnListResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/18 10:04 上午 + * @DESC + */ +@Data +public class CustomerCategoryShowAndWarnListResultDTO implements Serializable { + + /** + * 居民类别配置表ID + */ + private String statsConfigId; + + /** + * 居民类别预警配置表ID + */ + private String warnConfigId; + + /** + * 字段名 + */ + private String columnName; + + /** + * 标签 + */ + private String label; + + /** + * 管理平台分类图标 + */ + private String managementIcon; + + /** + * 数据平台分类图标 + */ + private String dataIcon; + + /** + * 房屋显示分类图标 + */ + private String houseShowIcon; + + private Integer level1; + private Integer level2; + private Integer level3; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 4a404fdb34..8cdf6e39de 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -109,6 +109,15 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") Result> resiCategoryWarnList(@RequestParam String customerId); + /** + * @Description 获取客户下人员分类配置显示的,预警配置的 + * @param customerId + * @author zxc + * @date 2022/1/18 10:07 上午 + */ + @PostMapping("/oper/customize/resicategorystatsconfig/getcustomercategoryshowandwarnlist") + Result> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId); + @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid") Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto); diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 9e4b5eca25..fde2def25e 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -95,7 +95,12 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId); } - @Override + @Override + public Result> getCustomerCategoryShowAndWarnList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerCategoryShowAndWarnList",customerId); + } + + @Override public Result resiCategoryWarnInfoById(IcResiCategoryWarnConfigDTO dto) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnInfoById",dto); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java index 99b6299afa..f43e75bf97 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java @@ -34,6 +34,7 @@ import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; +import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO; import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; import com.epmet.entity.IcResiCategoryStatsConfigEntity; import com.epmet.entity.IcResiCategoryWarnConfigEntity; @@ -164,5 +165,15 @@ public class ResiCategoryStatsConfigController { return new Result().ok(ConvertUtils.sourceToTarget(icResiCategoryWarnConfigDao.selectById(dto.getId()),IcResiCategoryWarnConfigDTO.class)); } + /** + * @Description 获取客户下人员分类配置显示的,预警配置的 + * @param customerId + * @author zxc + * @date 2022/1/18 10:07 上午 + */ + @PostMapping("getcustomercategoryshowandwarnlist") + public Result> getCustomerCategoryShowAndWarnList(@RequestParam("customerId")String customerId){ + return new Result>().ok(icResiCategoryStatsConfigService.getCustomerCategoryShowAndWarnList(customerId)); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java index 95fd7c9222..3ba17512ec 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcResiCategoryStatsConfigDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO; import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; import com.epmet.entity.IcResiCategoryStatsConfigEntity; import org.apache.ibatis.annotations.Mapper; @@ -43,4 +44,12 @@ public interface IcResiCategoryStatsConfigDao extends BaseDao listInfo(@Param("customerId") String customerId, @Param("isWarn") Integer isWarn, @Param("level") Integer level); IcResiCategoryStatsConfigResultDTO info(@Param("id") String id,@Param("customerId") String customerId); + + /** + * @Description 获取客户下人员分类配置显示的,预警配置的 + * @param customerId + * @author zxc + * @date 2022/1/18 10:09 上午 + */ + List getCustomerCategoryShowAndWarnList(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java index aa99453387..f9092491aa 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO; import com.epmet.entity.IcResiCategoryStatsConfigEntity; import java.util.List; @@ -101,4 +102,13 @@ public interface IcResiCategoryStatsConfigService extends BaseService getCategoryList(IcResiCategoryStatsConfigDTO dto); + + /** + * @Description 获取客户下人员分类配置显示的,预警配置的 + * @param customerId + * @author zxc + * @date 2022/1/18 10:07 上午 + */ + List getCustomerCategoryShowAndWarnList(String customerId); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java index d0183a03f9..d5bfdbd521 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java @@ -26,18 +26,17 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcResiCategoryStatsConfigDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO; import com.epmet.entity.IcResiCategoryStatsConfigEntity; import com.epmet.redis.IcResiCategoryStatsConfigRedis; import com.epmet.service.IcResiCategoryStatsConfigService; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 居民类别配置表 @@ -123,4 +122,19 @@ public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl getCustomerCategoryShowAndWarnList(String customerId) { + List result = baseDao.getCustomerCategoryShowAndWarnList(customerId); + if (CollectionUtils.isNotEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml index f3afd11c49..2493d1a14c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml @@ -71,5 +71,26 @@ and a.id = #{id} + + + \ No newline at end of file From e54ded8341f4e651f94d84ee5b618f680b019981 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 11:00:37 +0800 Subject: [PATCH 17/83] =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcStatsResiWarnServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java index efd18fb2c6..c540ac1723 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.dao.IcStatsResiWarnDao; import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcStatsResiWarnDTO; import com.epmet.dto.PersonWarnLeftPieDTO; +import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO; import com.epmet.dto.result.PersonWarnLeftPieResultDTO; import com.epmet.entity.IcStatsResiWarnEntity; import com.epmet.feign.OperCustomizeOpenFeignClient; @@ -126,7 +127,7 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl> listResult = operCustomizeOpenFeignClient.resiCategoryWarnList(tokenDto.getCustomerId()); + Result> listResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId()); if (!listResult.success()){ throw new EpmetException("查询设置预警的分类失败..."); } @@ -134,16 +135,16 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl configList = listResult.getData(); + List configList = listResult.getData(); List list = new ArrayList<>(); configList.forEach(c -> { PersonWarnLeftPieResultDTO.PersonWarnLeftPie p = new PersonWarnLeftPieResultDTO.PersonWarnLeftPie(); p.setTypeName(c.getLabel()); p.setTypeCode(c.getColumnName()); - p.setConfigId(c.getId()); + p.setConfigId(c.getWarnConfigId()); list.add(p); }); - List dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getId()).collect(Collectors.toList()), staffInfo.getAgencyId()); + List dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList()), staffInfo.getAgencyId()); if (CollectionUtils.isNotEmpty(dtos)){ list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount()))); } From 94adfbfada70c0300ea054a575e42274d01a7a96 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 18 Jan 2022 11:07:53 +0800 Subject: [PATCH 18/83] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E6=90=9C=E7=B4=A2=EF=BC=8Ckeyword=E6=9D=A1=E4=BB=B6sq?= =?UTF-8?q?l=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiUserDao.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index ba5276177a..d2cf1d73aa 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -51,13 +51,6 @@ AND ${resultTableName}.ID IS NOT NULL - - AND ( - NAME = #{keyword} - or MOBILE = #{keyword} - or ID_CARD = #{keyword} - ) - and ic_resi_user.customer_id=#{customerId} and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%')) @@ -129,6 +122,13 @@ + + AND ( + NAME = #{keyword} + or MOBILE = #{keyword} + or ID_CARD = #{keyword} + ) + group by IC_RESI_USER.id order by ic_resi_user.CREATED_TIME desc From b5871e0a218aa7f5a7ec2535675b5786f34af332 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 Jan 2022 13:27:56 +0800 Subject: [PATCH 19/83] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90=E5=8F=98=E6=9B=B4=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E3=80=81=E5=8F=98=E6=9B=B4=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/IcResiUserTransferFormDTO.java | 2 + .../service/impl/IcResiUserServiceImpl.java | 92 ++++++++++++++++++- .../impl/IcUserTransferRecordServiceImpl.java | 33 ++++--- 3 files changed, 109 insertions(+), 18 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java index 9245fa0a51..7b840a83aa 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserTransferFormDTO.java @@ -63,6 +63,8 @@ public class IcResiUserTransferFormDTO implements Serializable { */ private String remark; + //标识,默认为true,为false表示是居民信息修改调用了人员调动的接口,只需要生成调动记录,不涉及修改基础信息 + private Boolean idEdit = true; //token中信息 private String customerId; private String staffId; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 217283da6a..91192dcf42 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -58,10 +58,7 @@ import com.epmet.entity.IcUserChangeDetailedEntity; import com.epmet.entity.IcUserChangeRecordEntity; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.*; -import com.epmet.service.IcResiUserService; -import com.epmet.service.IcUserChangeDetailedService; -import com.epmet.service.IcUserChangeRecordService; -import com.epmet.service.UserService; +import com.epmet.service.*; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -114,6 +111,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -317,6 +316,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl", resiUserId)); } + //2022-1-18 信息修改判断基础信息表人员网格、小区、楼栋、单元、房屋维度数据以及十八类的类别数据是否变化,相应生成变更记录和变更明细数据 sun start + icUserChangeRecord(tokenDto, entity, map); + //2022-1-18 sun end //2.更新主表数据 if (map.size() > NumConstant.ONE) { map.put("updated_by", tokenDto.getUserId()); @@ -347,6 +349,88 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map) { + Date date = (Date) new java.util.Date(); + //1.判断维度数据是否修改【网格、小区、楼栋、单元、房间有变化则先走人员调动逻辑】 + if ((map.containsKey("GRID_ID") && !entity.getGridId().equals(map.get("GRID_ID"))) || (map.containsKey("VILLAGE_ID") && !entity.getVillageId().equals(map.get("VILLAGE_ID"))) + || (map.containsKey("BUILD_ID") && !entity.getBuildId().equals(map.get("BUILD_ID"))) || (map.containsKey("UNIT_ID") && !entity.getUnitId().equals(map.get("UNIT_ID"))) + || (map.containsKey("HOME_ID") && !entity.getHomeId().equals(map.get("HOME_ID")))) { + IcResiUserTransferFormDTO formDTO = new IcResiUserTransferFormDTO(); + formDTO.setIcUserId(entity.getId()); + formDTO.setType("in"); + formDTO.setNewAgencyId(entity.getAgencyId()); + formDTO.setNewGridId(map.containsKey("GRID_ID") ? map.get("GRID_ID") : entity.getGridId()); + formDTO.setNewNeighborHoodId(map.containsKey("VILLAGE_ID") ? map.get("VILLAGE_ID") : entity.getVillageId()); + formDTO.setNewBuildingId(map.containsKey("BUILD_ID") ? map.get("BUILD_ID") : entity.getBuildId()); + formDTO.setNewBuildingUnitId(map.containsKey("UNIT_ID") ? map.get("UNIT_ID") : entity.getUnitId()); + formDTO.setNewHouseId(map.containsKey("HOME_ID") ? map.get("HOME_ID") : entity.getHomeId()); + formDTO.setTransferTime(date); + formDTO.setIdEdit(false); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + icUserTransferRecordService.add(formDTO); + } + //2.判断类别数据是否修改[类别修改的变更明细里边存修改后的新值,是就存1否就存-1] + Result> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(tokenDto.getCustomerId()); + if (!resultList.success()) { + throw new RuntimeException("居民信息修改,获取客户居民类别预警配置表数据失败"); + } + //修改前数据库居民十八类信息值 + Map hash = icResiUserDao.getCategoryListMap(entity.getId()); + //封装变更记录和变更明细数据 + //变更记录 + IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); + StringBuffer beforeChangeName = new StringBuffer(""); + StringBuffer afterChangeName = new StringBuffer(""); + //变更明细 + List list = new ArrayList<>(); + IcUserChangeDetailedEntity categoryEntity = null; + for (IcResiCategoryWarnConfigDTO dto : resultList.getData()) { + String oldValue = hash.get(dto.getColumnName()); + if (map.containsKey(dto.getColumnName()) && !oldValue.equals(map.get(dto.getColumnName()))) { + //类别修改后的值 + String newVlaue = map.get(dto.getColumnName()); + beforeChangeName.append(dto.getLabel()).append(":").append("1".equals(oldValue) ? "是" : "否").append(";"); + afterChangeName.append(dto.getLabel()).append(":").append("1".equals(newVlaue) ? "是" : "否").append(";"); + //变更明细里边存修改后的新值,是就存1否就存-1 + categoryEntity = new IcUserChangeDetailedEntity(); + categoryEntity.setCustomerId(tokenDto.getCustomerId()); + categoryEntity.setAgencyId(entity.getAgencyId()); + categoryEntity.setGridId(map.containsKey("GRID_ID") ? map.get("GRID_ID") : entity.getGridId()); + categoryEntity.setNeighborHoodId(map.containsKey("VILLAGE_ID") ? map.get("VILLAGE_ID") : entity.getVillageId()); + categoryEntity.setBuildingId(map.containsKey("BUILD_ID") ? map.get("BUILD_ID") : entity.getBuildId()); + categoryEntity.setBuildingUnitId(map.containsKey("UNIT_ID") ? map.get("UNIT_ID") : entity.getUnitId()); + categoryEntity.setHouseId(map.containsKey("HOME_ID") ? map.get("HOME_ID") : entity.getHomeId()); + categoryEntity.setIcUserId(entity.getId()); + categoryEntity.setType("category"); + categoryEntity.setTypeName("类别"); + categoryEntity.setFieldName(dto.getColumnName()); + categoryEntity.setValue("1".equals(newVlaue) ? 1 : -1); + list.add(categoryEntity); + } + } + //变更记录 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + changeRecordEntity.setCustomerId(tokenDto.getCustomerId()); + changeRecordEntity.setOperatorId(tokenDto.getUserId()); + changeRecordEntity.setIcUserId(entity.getId()); + changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); + changeRecordEntity.setIcUserName(map.containsKey("NAME") ? map.get("NAME") : entity.getName()); + changeRecordEntity.setType("category"); + changeRecordEntity.setTypeName("类别"); + changeRecordEntity.setBeforeChangeName(beforeChangeName.toString()); + changeRecordEntity.setAfterChangeName(afterChangeName.toString()); + changeRecordEntity.setChangeTime(date); + icUserChangeRecordService.insert(changeRecordEntity); + + list.forEach(l -> l.setIcUserChangeRecordId(changeRecordEntity.getId())); + icUserChangeDetailedService.insertBatch(list); + } + /** * @param homeId * @Description 获取房间内人员 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index 2f7dafb468..e2616d2842 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java @@ -42,6 +42,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -72,6 +73,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl Date: Tue, 18 Jan 2022 14:24:09 +0800 Subject: [PATCH 20/83] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=EF=BC=8C=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/enums/DateEnum.java | 72 +++++++++++ .../epmet/dto/IcPartyUnitCompletionDTO.java | 115 ++++++++++++++++++ .../com/epmet/dto/form/CompletionFormDTO.java | 18 +++ .../epmet/dto/form/PointRecordFormDTO.java | 39 ++++++ .../com/epmet/dto/result/PointRecordDTO.java | 44 +++++++ .../dto/result/PointRecordResultDTO.java | 21 ++++ .../IcPartyUnitCompletionController.java | 50 ++++++++ .../controller/IcUserDemandRecController.java | 18 ++- .../epmet/dao/IcPartyUnitCompletionDao.java | 16 +++ .../com/epmet/dao/IcUserDemandRecDao.java | 17 ++- .../entity/IcPartyUnitCompletionEntity.java | 71 +++++++++++ .../service/IcPartyUnitCompletionService.java | 46 +++++++ .../epmet/service/IcUserDemandRecService.java | 11 ++ .../IcPartyUnitCompletionServiceImpl.java | 86 +++++++++++++ .../impl/IcUserDemandRecServiceImpl.java | 40 ++++++ .../db/migration/V0.0.9__add_icompletion.sql | 22 ++++ .../mapper/IcPartyUnitCompletionDao.xml | 27 ++++ .../resources/mapper/IcUserDemandRecDao.xml | 46 +++++++ 18 files changed, 755 insertions(+), 4 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java new file mode 100644 index 0000000000..7ffdda964f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java @@ -0,0 +1,72 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +import java.util.Objects; + +/** + * @author Administrator + */ + +public enum DateEnum { + /** + * 月份相关枚举 + */ + JAN("01", "1月"), + FEB("02", "2月"), + MAR("03", "3月"), + APR("04", "4月"), + MAY("05", "5月"), + JUN("06", "6月"), + JUL("07", "7月"), + AUG("08", "8月"), + SEP("09", "9月"), + OCT("10", "10月"), + NOV("11", "11月"), + DEC("12", "12月"), + /** + * 季度相关枚举 + */ + Q1("Q1", "第一季度"), + Q2("Q2", "第二季度"), + Q3("Q3", "第三季度"), + Q4("Q4", "第四季度"), + + + UN_KNOWN("0", "未知"); + + private String code; + private String name; + + + DateEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + DateEnum[] dateEnums = values(); + for (DateEnum dateEnum : dateEnums) { + if (Objects.equals(dateEnum.getCode(), code)) { + return dateEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java new file mode 100644 index 0000000000..1c7080f4a7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java @@ -0,0 +1,115 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +public class IcPartyUnitCompletionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位ID + */ + @NotNull(message = "单位ID不能为空",groups = AddGroup.class) + private String unitId; + + /** + * 类型 monthly月度,quarter季度 + */ + @NotNull(message = "类型不能为空",groups = AddGroup.class) + private String type; + + /** + * 评分 百分制 + */ + @NotNull(message = "评分不能为空",groups = AddGroup.class) + private String score; + + /** + * 完成情况1已完成,0未完成 + */ + @NotNull(message = "完成情况不能为空",groups = AddGroup.class) + private String status; + + /** + * 年份 + */ + @NotNull(message = "年份不能为空",groups = AddGroup.class) + private String year; + + /** + * 月或季度 + */ + @NotNull(message = "月或季度",groups = AddGroup.class) + private String monthQuarter; + + private String monthQuarterName; + + /** + * 时间 + */ + private String recordDate; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java new file mode 100644 index 0000000000..181074d3b9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/17 15:46 + */ +@Data +public class CompletionFormDTO implements Serializable { + private static final long serialVersionUID = 4925867264241549310L; + private String unitId; + private Integer pageNo = 1; + private Integer pageSize = 10; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java new file mode 100644 index 0000000000..bacdc786f6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/18 9:34 + */ +@NoArgsConstructor +@Data +public class PointRecordFormDTO implements Serializable { + private static final long serialVersionUID = -5200348821951188343L; + /** + * 服务方类型:社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit + */ + private String serviceType; + /** + * 服务方ID + */ + private String serviceId; + /** + * 开始时间 + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private String startTime; + /** + * 结束时间 + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private String endTime; + private Integer pageNo = 1; + private Integer pageSize = 10; + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java new file mode 100644 index 0000000000..b9c2c1e787 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/18 9:30 + */ +@NoArgsConstructor +@Data +public class PointRecordDTO implements Serializable { + private static final long serialVersionUID = 8562346042241117055L; + /** + * 需求类型 + */ + @JsonIgnore + private String categoryCode; + private String categoryName; + /** + * 需求人 + */ + private String demandUserName; + /** + * 需求内容 + */ + private String content; + /** + * 发放积分时间 + */ + private String pointTime; + /** + * 评价 + */ + private String score; + /** + * 积分 + */ + private String point; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java new file mode 100644 index 0000000000..52efbfa253 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.page.PageData; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/18 9:28 + */ +@NoArgsConstructor +@Data +public class PointRecordResultDTO implements Serializable { + private static final long serialVersionUID = -2359756064125925616L; + private Integer totalPoint; + private PageData page; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java new file mode 100644 index 0000000000..42dc75a6c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java @@ -0,0 +1,50 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyUnitCompletionDTO; +import com.epmet.dto.form.CompletionFormDTO; +import com.epmet.service.IcPartyUnitCompletionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@RestController +@RequestMapping("icpartyunitcompletion") +public class IcPartyUnitCompletionController { + + @Autowired + private IcPartyUnitCompletionService icPartyUnitCompletionService; + + @PostMapping("list") + public Result> page(@RequestParam CompletionFormDTO formDTO){ + PageData page = icPartyUnitCompletionService.page(formDTO); + return new Result>().ok(page); + } + + @PostMapping("save") + public Result save(@RequestBody IcPartyUnitCompletionDTO dto){ + //效验数据 + if (StringUtils.isBlank(dto.getUnitId())) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + } + icPartyUnitCompletionService.save(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody IcPartyUnitCompletionDTO dto){ + icPartyUnitCompletionService.delete(dto.getId()); + return new Result(); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index e3e9cde3b8..1d14501080 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -25,7 +25,6 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -35,9 +34,11 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.form.PointRecordFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.PointRecordResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -364,5 +365,20 @@ public class IcUserDemandRecController implements ResultDataResolver { return new Result().ok(page); } + /** + * 组织单位积分记录 + * + * @Param formDTO + * @Return {@link Result< PointRecordResultDTO>} + * @Author zhaoqifeng + * @Date 2022/1/18 9:45 + */ + @PostMapping("recordList") + public Result pointRecordList(@LoginUser TokenDto tokenDto, @RequestBody PointRecordFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + PointRecordResultDTO result = icUserDemandRecService.pointRecordList(formDTO); + return new Result().ok(result); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java new file mode 100644 index 0000000000..d99bd42168 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPartyUnitCompletionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Mapper +public interface IcPartyUnitCompletionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 27eaa8c689..60b437ceb5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -19,13 +19,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.PointRecordFormDTO; import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; import com.epmet.dto.form.demand.PageListAnalysisFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; +import com.epmet.dto.result.PointRecordDTO; import com.epmet.dto.result.demand.*; -import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.dto.result.demand.IcResiUserReportDemandRes; -import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcUserDemandRecEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -118,4 +117,16 @@ public interface IcUserDemandRecDao extends BaseDao { @Param("type")String type); int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult); + + /** + * 组织单位积分记录 + * + * @Param formDTO + * @Return {@link List< PointRecordDTO>} + * @Author zhaoqifeng + * @Date 2022/1/18 10:33 + */ + List getPointRecordList(PointRecordFormDTO formDTO); + + int getTotalPoint(PointRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java new file mode 100644 index 0000000000..ea4a22feb4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java @@ -0,0 +1,71 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_unit_completion") +public class IcPartyUnitCompletionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位ID + */ + private String unitId; + + /** + * 类型 monthly月度,quarter季度 + */ + private String type; + + /** + * 评分 百分制 + */ + private String score; + + /** + * 完成情况1已完成,0未完成 + */ + private String status; + + /** + * 年份 + */ + private String year; + + /** + * 月或季度 + */ + private String monthQuarter; + + /** + * 时间 + */ + private String recordDate; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java new file mode 100644 index 0000000000..730da2c6ea --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java @@ -0,0 +1,46 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPartyUnitCompletionDTO; +import com.epmet.dto.form.CompletionFormDTO; +import com.epmet.entity.IcPartyUnitCompletionEntity; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +public interface IcPartyUnitCompletionService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2022-01-17 + */ + PageData page(CompletionFormDTO formDTO); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-17 + */ + void save(IcPartyUnitCompletionDTO dto); + + /** + * 删除 + * + * @param id + * @return void + * @author generator + * @date 2022-01-17 + */ + void delete(String id); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 336cd21999..6497e96139 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -20,7 +20,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.PointRecordFormDTO; import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.PointRecordResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.entity.IcUserDemandRecEntity; @@ -224,4 +226,13 @@ public interface IcUserDemandRecService extends BaseService search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize); + + /** + * 组织单位积分记录 + * @Param formDTO + * @Return {@link PointRecordResultDTO} + * @Author zhaoqifeng + * @Date 2022/1/18 9:45 + */ + PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java new file mode 100644 index 0000000000..ebfd7fd8c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java @@ -0,0 +1,86 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.DateEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcPartyUnitCompletionDao; +import com.epmet.dto.IcPartyUnitCompletionDTO; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.CompletionFormDTO; +import com.epmet.entity.IcPartyUnitCompletionEntity; +import com.epmet.service.IcPartyUnitCompletionService; +import com.epmet.service.IcPartyUnitService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Service +public class IcPartyUnitCompletionServiceImpl extends BaseServiceImpl implements IcPartyUnitCompletionService { + + @Resource + private IcPartyUnitService icPartyUnitService; + + @Override + public PageData page(CompletionFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getUnitId())) { + return new PageData<>(Collections.emptyList(), NumConstant.ZERO); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitCompletionEntity::getUnitId, formDTO.getUnitId()); + wrapper.orderByDesc(IcPartyUnitCompletionEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitCompletionDTO.class); + + if(CollectionUtils.isNotEmpty(dtoList)) { + dtoList.forEach(item -> { + item.setMonthQuarterName(DateEnum.getName(item.getMonthQuarter())); + }); + } + + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyUnitCompletionDTO dto) { + IcPartyUnitCompletionEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitCompletionEntity.class); + if (StringUtils.isNotBlank(dto.getYear()) && StringUtils.isNotBlank(dto.getMonthQuarter())) { + entity.setRecordDate(dto.getYear().concat(dto.getMonthQuarter())); + } + if(StringUtils.isBlank(dto.getId())) { + IcPartyUnitDTO unity = icPartyUnitService.get(dto.getUnitId()); + entity.setCustomerId(unity.getCustomerId()); + entity.setAgencyId(unity.getAgencyId()); + entity.setPids(unity.getPids()); + insert(entity); + } else { + updateById(entity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index f7034a63ee..4bf7846cd0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -1644,5 +1644,45 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(list, new PageInfo<>(list).getTotal()); } + + /** + * 组织单位积分记录 + * + * @param formDTO + * @Param formDTO + * @Return {@link PointRecordResultDTO} + * @Author zhaoqifeng + * @Date 2022/1/18 9:45 + */ + @Override + public PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO) { + PointRecordResultDTO result = new PointRecordResultDTO(); + + if (StringUtils.isBlank(formDTO.getServiceId())) { + result.setTotalPoint(NumConstant.ZERO); + result.setPage(new PageData<>(Collections.emptyList(), NumConstant.ZERO)); + } + + //总积分 + result.setTotalPoint(baseDao.getTotalPoint(formDTO)); + //分页查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPointRecordList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + //查询分类名称 + List categoryCodes = list.stream().map(PointRecordDTO::getCategoryCode).collect(Collectors.toList()); + List dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + list.forEach(item -> { + if (dictMap.containsKey(item.getCategoryCode())) { + item.setCategoryName(dictMap.get(item.getCategoryCode())); + } + }); + } + result.setPage(new PageData<>(list, pageInfo.getTotal())); + + return result; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql new file mode 100644 index 0000000000..7493e63f53 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql @@ -0,0 +1,22 @@ +CREATE TABLE `ic_party_unit_completion` +( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PIDS` varchar(255) NOT NULL, + `UNIT_ID` varchar(64) NOT NULL COMMENT '单位ID', + `TYPE` varchar(10) NOT NULL COMMENT '类型 monthly月度,quarter季度', + `SCORE` varchar(5) NOT NULL COMMENT '评分 百分制', + `STATUS` varchar(1) NOT NULL COMMENT '完成情况1已完成,0未完成', + `YEAR` varchar(4) NOT NULL COMMENT '年份', + `MONTH_QUARTER` varchar(4) NOT NULL COMMENT '月或季度', + `RECORD_DATE` varchar(12) NOT NULL COMMENT '时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='联建单位完成情况'; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml new file mode 100644 index 0000000000..2dd26ab7a2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index b59fa44be5..eb1260f58b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -572,4 +572,50 @@ UPDATED_TIME=NOW() where id=#{demandRecId} + + + \ No newline at end of file From 3956d3e5b889edb48a34c03ee3a440d2a42f7fa3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Jan 2022 14:50:21 +0800 Subject: [PATCH 21/83] zancun --- .../epmet/constant/DataSourceConstant.java | 1 + .../customize/IcResiCategoryConfigDTO.java | 18 +++ .../IcUserCategoryAnalysisDailyFormDTO.java | 32 ++++ .../dto/user/result/OrgIcUserTotalDTO.java | 12 ++ .../data-statistical-server/pom.xml | 26 +++ .../com/epmet/controller/IcController.java | 76 +++++++++ .../IcResiCategoryStatsConfigDao.java | 14 ++ .../FactIcuserCategoryAnalysisDailyDao.java | 20 +++ .../main/java/com/epmet/dao/user/UserDao.java | 9 ++ ...FactIcuserCategoryAnalysisDailyEntity.java | 71 ++++++++ .../IcResiCategoryStatsConfigService.java | 22 +++ .../IcResiCategoryStatsConfigServiceImpl.java | 40 +++++ .../screen/ScreenCustomerGridService.java | 3 + .../impl/ScreenCustomerGridServiceImpl.java | 9 ++ ...actIcuserCategoryAnalysisDailyService.java | 20 +++ ...cuserCategoryAnalysisDailyServiceImpl.java | 153 ++++++++++++++++++ .../com/epmet/service/user/UserService.java | 19 +++ .../service/user/impl/UserServiceImpl.java | 75 +++++++++ .../src/main/resources/bootstrap.yml | 5 + .../IcResiCategoryStatsConfigDao.xml | 23 +++ .../FactIcuserCategoryAnalysisDailyDao.xml | 13 ++ .../main/resources/mapper/user/UserDao.xml | 51 ++++++ 22 files changed, 712 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java index 064104b9b2..1ae7002dc4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -15,4 +15,5 @@ public interface DataSourceConstant { String PARTY_MEMBER = "partyMember"; String EPMET_HEART="epmetHeart"; String EPMET_POINT = "epmetPoint"; + String OPER_CUSTOMIZE="operCustomize"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java new file mode 100644 index 0000000000..ea519b9b20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.customize; + +import lombok.Data; + +import java.io.Serializable; + + + +@Data +public class IcResiCategoryConfigDTO implements Serializable { + private String configId; + /** + * 列名 + */ + private String columnName; + + private String itemLabel; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java new file mode 100644 index 0000000000..4804125448 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import java.io.Serializable; + +/** + * 数字社区-人员类别分析,按天计算,入参 + * 以下参数都可以为空 + */ +@Data +public class IcUserCategoryAnalysisDailyFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + private String customerId; + @Length(max = 8, message = "日期格式:yyyyMMdd", groups = AddUserInternalGroup.class) + private String dateId; + + /** + * 开始时间 + */ + @Length(max = 8, message = "开始日期日期格式:yyyyMMdd", groups = AddUserInternalGroup.class) + private String startDate; + /** + * 结束时间 + */ + @Length(max = 8, message = "截止日期格式:yyyyMMdd", groups = AddUserInternalGroup.class) + private String endDate; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java new file mode 100644 index 0000000000..b7360d975d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class OrgIcUserTotalDTO implements Serializable { + private String orgId; + private Integer total; + private String columnName; +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 6c21774ece..8b145da840 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -260,6 +260,13 @@ epmet_point_user EpmEt-db-UsEr + + + + + epmet_oper_customize_user + EpmEt-db-UsEr + 0 192.168.1.140 @@ -382,6 +389,13 @@ epmet_point_user EpmEt-db-UsEr + + + + + epmet_oper_customize_user + EpmEt-db-UsEr + 0 192.168.1.140 @@ -504,6 +518,12 @@ epmet elink@833066 + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -622,6 +642,12 @@ epmet_point_user EpmEt-db-UsEr + + + + epmet_oper_customize_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java new file mode 100644 index 0000000000..5f93d62c1e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java @@ -0,0 +1,76 @@ +package com.epmet.controller; + + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.extract.form.IcUserCategoryAnalysisDailyFormDTO; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 数字社区相关统计任务可以放这,目前只有人员类别分析 + * @Author yinzuomei + * @Date 2022/01/17 + * @Version 1.0 + */ +@RestController +@RequestMapping("ic") +public class IcController { + + @Autowired + private FactIcuserCategoryAnalysisDailyService userCategoryAnalysisDailyService; + @Autowired + private DimCustomerService dimCustomerService; + + /** + * 数字社区-基础信息-人员类别分析-每个类别的人员总数、较上月迁入迁出人数 + * 说明:安调统计,截止到当前dateId的党员总数;+30:迁入党员+之前的居民在本月内变更为党员身份的;-10:在本月丢失党员身份的人+迁出的人 + * @return + */ + @PostMapping("/user/category-analysis-daily") + public Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcUserCategoryAnalysisDailyFormDTO.AddUserInternalGroup.class); + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerIds.add(formDTO.getCustomerId()); + } else { + //未指定客户,则查询dim_customer表 + customerIds = dimCustomerService.selectCustomerIdPage(NumConstant.ONE, NumConstant.ONE_THOUSAND); + } + if (CollectionUtils.isNotEmpty(customerIds)) { + customerIds.forEach(customerId -> { + if (StringUtils.isNotBlank(formDTO.getStartDate()) && StringUtils.isNotBlank(formDTO.getEndDate())) { + //[a,b]yyyyMMdd + List daysBetween = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate()); + daysBetween.forEach(dateId -> { + //计算网格维度的数据 + userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId); + }); + } else if (StringUtils.isNotBlank(formDTO.getDateId())) { + //计算网格维度的数据 + userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, formDTO.getDateId()); + } else { + //计算网格维度的数据 + //当前时间的前一天yyyyMMdd + String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); + userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId); + } + }); + } + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java new file mode 100644 index 0000000000..43b78b9b73 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java @@ -0,0 +1,14 @@ +package com.epmet.dao.customize; + + +import com.epmet.dto.customize.IcResiCategoryConfigDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface IcResiCategoryStatsConfigDao { + + + List queryDataColumn(String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java new file mode 100644 index 0000000000..2b963f71d5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 人员类别分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Mapper +public interface FactIcuserCategoryAnalysisDailyDao extends BaseDao { + + int limitDelete(@Param("customerId")String customerId, + @Param("dateId")String dateId, + @Param("orgType")String orgType); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 547cc164b7..a6ecca8319 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -269,5 +269,14 @@ public interface UserDao { List filterUserIds(@Param("userIds") List userIds, @Param("roleKey") String roleKey); List selectRoutineWorkListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List selectCountForGrid(@Param("customerId") String customerId, + @Param("columnName") String columnName); + + OrgIcUserTotalDTO selectCountForAgency(@Param("customerId") String customerId, + @Param("columnName") String columnName, + @Param("agencyId") String agencyId); + + List selectGridIcUserCategoryTotal(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java new file mode 100644 index 0000000000..d1db22e1e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java @@ -0,0 +1,71 @@ +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 人员类别分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_icuser_category_analysis_daily") +public class FactIcuserCategoryAnalysisDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 预警配置ID + */ + private String configId; + + /** + * 当前数据是截止到XXX的:yyyyMMdd + */ + private String dateId; + + /** + * 网格id或者组织id + */ + private String orgId; + + /** + * grid或者agency + */ + private String orgType; + + /** + * orgid的上级 + */ + private String pid; + + /** + * orgid的所有上级 + */ + private String pids; + + /** + * 当前类别总人数 + */ + private Integer total; + + /** + * 较上月迁出 + */ + private Integer qcIncr; + + /** + * 较上月迁入 + */ + private Integer qrIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java new file mode 100644 index 0000000000..dfbaa5b85a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java @@ -0,0 +1,22 @@ +package com.epmet.service.customize; + + +import com.epmet.dto.customize.IcResiCategoryConfigDTO; + +import java.util.List; + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +public interface IcResiCategoryStatsConfigService { + + /** + * 返回用于数据分析的列名+居民类别配置表的id + * @param customerId + * @return + */ + List queryDataColumn(String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java new file mode 100644 index 0000000000..2aba7c4480 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.service.customize.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.customize.IcResiCategoryStatsConfigDao; +import com.epmet.dto.customize.IcResiCategoryConfigDTO; +import com.epmet.service.customize.IcResiCategoryStatsConfigService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 居民类别配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Slf4j +@DataSource(DataSourceConstant.OPER_CUSTOMIZE) +@Service +public class IcResiCategoryStatsConfigServiceImpl implements IcResiCategoryStatsConfigService{ + + @Autowired + private IcResiCategoryStatsConfigDao baseDao; + + + /** + * 返回用于数据分析的列名+居民类别配置表的id + * + * @param customerId + * @return + */ + @Override + public List queryDataColumn(String customerId) { + return baseDao.queryDataColumn(customerId); + } +} 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 e7e08d78b2..5ea9362398 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 @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; @@ -136,4 +137,6 @@ public interface ScreenCustomerGridService extends BaseService getByCustomerId(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 edf9ef160f..fe3f1a863e 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 @@ -29,6 +29,7 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.DimLastSyncRecordDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; @@ -290,4 +291,12 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl getByCustomerId(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenCustomerGridEntity::getCustomerId, customerId); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list,CustomerGridDTO.class); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java new file mode 100644 index 0000000000..afa940d37b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java @@ -0,0 +1,20 @@ +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity; + +/** + * 人员类别分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +public interface FactIcuserCategoryAnalysisDailyService extends BaseService { + /** + * 数字社区-基础信息-人员类别分析-每个类别的人员总数、较上月迁入迁出人数 + * 网格 + * @param customerId + * @param dateId + */ + void statUserCategoryGridDaily(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java new file mode 100644 index 0000000000..9384c21423 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java @@ -0,0 +1,153 @@ +package com.epmet.service.stats.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.OrgTypeEnum; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.FactIcuserCategoryAnalysisDailyDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.customize.IcResiCategoryConfigDTO; +import com.epmet.dto.user.result.OrgIcUserTotalDTO; +import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity; +import com.epmet.service.customize.IcResiCategoryStatsConfigService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 人员类别分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.STATS) +public class FactIcuserCategoryAnalysisDailyServiceImpl extends BaseServiceImpl implements FactIcuserCategoryAnalysisDailyService { + + @Autowired + private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; + @Autowired + private ScreenCustomerAgencyService agencyService; + @Autowired + private ScreenCustomerGridService gridService; + @Autowired + private UserService userService; + /** + * 数字社区-基础信息-人员类别分析-每个类别的人员总数、较上月迁入迁出人数 + * + * @param customerId + * @param dateId + */ + @Override + public void statUserCategoryGridDaily(String customerId, String dateId) { + //查询出所有用语数据分析的类别column_name,没有则不计算 + List columnList=icResiCategoryStatsConfigService.queryDataColumn(customerId); + if(CollectionUtils.isEmpty(columnList)){ + return; + } + // //所有网格和组织查询出来 + // List agencyDTOList=agencyService.getByCustomerId(customerId); + List gridDTOList=gridService.getByCustomerId(customerId); + //网格维度、组织维度初始好数据 + List initList=constructInitValue(customerId,dateId,gridDTOList,columnList); + if(CollectionUtils.isEmpty(initList)){ + return; + } + // 批量插入数据 + + + //删除旧数据 + clearOldDatas(customerId,dateId,OrgTypeEnum.GRID.getCode()); + } + + private void clearOldDatas(String customerId, String dateId,String orgType) { + int deleteNum; + do { + //每次删除1000条 + deleteNum = baseDao.limitDelete(customerId,dateId,orgType); + } while (deleteNum != NumConstant.ZERO); + } + + /** + * + * @param customerId + * @param dateId yyyyMMdd + * @param gridDTOList 当前客户下所有的网格 + * @param columnList 所有需要分析的类别对应的ic_resi_user的列名,目前只有18类 + * @return + */ + private List constructInitValue(String customerId,String dateId, List gridDTOList,List columnList) { + List list=new ArrayList<>(); + if(CollectionUtils.isEmpty(gridDTOList)){ + //没有配置的类别,退出吧 + return list; + } + + //1、total + // 查询明细ic_user_change_detailed变更明细表,各个网格的各个分类的总人数 + Map> totalMapList=userService.calGridIcUserTotal(customerId,dateId); + + String monthId=dateId.substring(NumConstant.ZERO,NumConstant.SIX); + String startDate=monthId.concat("01"); + String endDate=dateId; + + //2、迁入+30:eg:dateId:20211226, [20211201,20211226],类别sum值=1的 + Map> qrList=userService.calGridIcUserQr(customerId,dateId); + + //3、迁出 -10 :eg:dateId:20211226, [20211201,20211226],类别sum值 !=1的 + Map> qrList=userService.calGridIcUserQr(customerId,dateId); + + for(IcResiCategoryConfigDTO config:columnList){ + gridDTOList.forEach(grid->{ + FactIcuserCategoryAnalysisDailyEntity gridData=new FactIcuserCategoryAnalysisDailyEntity(); + gridData.setCustomerId(customerId); + gridData.setConfigId(config.getConfigId()); + gridData.setDateId(dateId); + gridData.setOrgId(grid.getId()); + gridData.setOrgType(OrgTypeEnum.GRID.getCode()); + gridData.setPid(StringUtils.isNotBlank(grid.getPid())?grid.getPid(): NumConstant.ZERO_STR); + gridData.setPids(grid.getPids()); + + boolean zeroFlag=true; + if(MapUtils.isNotEmpty(totalMapList)&&totalMapList.containsKey(grid.getId())){ + //当前网格下,有的类别 + List crrentGrid=totalMapList.get(grid.getId()); + if(CollectionUtils.isNotEmpty(crrentGrid)){ + //各个类别对应的数 + Map categoryTotalMap=crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); + if(MapUtils.isNotEmpty(categoryTotalMap)&&categoryTotalMap.containsKey(config.getColumnName())){ + zeroFlag=false; + gridData.setTotal(categoryTotalMap.get(config.getColumnName())); + } + } + } + if(zeroFlag){ + gridData.setTotal(NumConstant.ZERO); + } + gridData.setQcIncr(NumConstant.ZERO); + gridData.setQrIncr(NumConstant.ZERO); + list.add(gridData); + }); + } + return list; + } + + public static void main(String[] args) { + String dateId="20211225"; + System.out.println(dateId.substring(0,6)); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 29e5e6d149..522e6eeaa5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -157,4 +157,23 @@ public interface UserService { * @return */ List selectRoutineWorkListByDateId(String customerId, String dateId); + + Map selectCountForGrid(String customerId, String columnName); + + /** + * + * @param customerId + * @param columnName + * @param agencyIds + * @return + */ + Map selectCountForGrid(String customerId, String columnName, List agencyIds); + + /** + * + * @param customerId + * @param dateId 截止到这一天的,各个网格下,每个分类的总人数 + * @return + */ + Map> calGridIcUserTotal(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index f6c78dbfb0..007cad7e2b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -1126,4 +1126,79 @@ public class UserServiceImpl implements UserService { public List selectRoutineWorkListByDateId(String customerId, String dateId) { return userDao.selectRoutineWorkListByDateId(customerId, dateId); } + + /** + * + * @param customerId + * @param columnName + * @return 截止到目前,每个网格内,某个分类的总人数 + */ + @Override + public Map selectCountForGrid(String customerId, String columnName) { + Map map = new HashMap<>(); + List list = userDao.selectCountForGrid(customerId, columnName); + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) { + map = list.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getOrgId, OrgIcUserTotalDTO::getTotal)); + } + return map; + } + + /** + * @param customerId + * @param columnName + * @param agencyIds + * @return 截止到目前,各个组织内,某个分类的总人数 + */ + @Override + public Map selectCountForGrid(String customerId, String columnName, List agencyIds) { + Map map = new HashMap<>(); + if (CollectionUtils.isEmpty(agencyIds)) { + return map; + } + List list = new ArrayList<>(); + for (String agencyId:agencyIds) { + OrgIcUserTotalDTO dto=new OrgIcUserTotalDTO(); + dto.setOrgId(agencyId); + OrgIcUserTotalDTO totalDto=userDao.selectCountForAgency(customerId,columnName,agencyId); + dto.setTotal(null!=totalDto?totalDto.getTotal():NumConstant.ZERO); + list.add(dto); + } + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) { + map = list.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getOrgId, OrgIcUserTotalDTO::getTotal)); + } + return map; + } + + /** + * @param customerId + * @param dateId 截止到这一天的,各个网格下,每个分类的总人数 + * @return + */ + @Override + public Map> calGridIcUserTotal(String customerId, String dateId) { + Map> resultMap=new HashMap<>(); + List list=userDao.selectGridIcUserCategoryTotal(customerId,dateId); + if(CollectionUtils.isEmpty(list)){ + return resultMap; + } + // list 数据 + // gridId columnName total + // 1001 IS_DBH 1 + // 1001 IS_PARTY 1 + // 1002 IS_DBH 1 + // 1002 IS_ENSURE_HOUSE 1 + // 1003 IS_VETERANS 1 + // 1004 IS_PARTY 1 + for(OrgIcUserTotalDTO dto:list){ + if(resultMap.containsKey(dto.getOrgId())){ + resultMap.get(dto.getOrgId()).add(dto); + continue; + } + List newList=new ArrayList<>(); + newList.add(dto); + resultMap.put(dto.getOrgId(),newList); + } + return resultMap; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 1f2089ea27..c70278a240 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -188,6 +188,11 @@ dynamic: url: @datasource.druid.epmetPoint.url@ username: @datasource.druid.epmetPoint.username@ password: @datasource.druid.epmetPoint.password@ + operCustomize: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.operCustomize.url@ + username: @datasource.druid.operCustomize.username@ + password: @datasource.druid.operCustomize.password@ thread: # 线程池配置 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml new file mode 100644 index 0000000000..566e6f2c9d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml new file mode 100644 index 0000000000..01f0963249 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml @@ -0,0 +1,13 @@ + + + + + + + delete from fact_icuser_category_analysis_daily + where CUSTOMER_ID = #{customerId} + and date_id=#{dateId} + and org_type=#{orgType} + limit 1000 + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 6e8e25fefa..7bec8ecc7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -1074,4 +1074,55 @@ + + + + + From f8d07b907fa157f84d702bc0a52936dd14b3a674 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 18 Jan 2022 15:10:29 +0800 Subject: [PATCH 22/83] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=EF=BC=8C=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/PointRecordFormDTO.java | 5 +++-- .../epmet/controller/IcPartyUnitCompletionController.java | 2 +- .../src/main/java/com/epmet/dao/IcUserDemandRecDao.java | 2 +- .../com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 4 ++-- .../src/main/resources/mapper/IcUserDemandRecDao.xml | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java index bacdc786f6..3e809dccab 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java @@ -5,6 +5,7 @@ import lombok.NoArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; +import java.util.Date; /** * @Description @@ -27,12 +28,12 @@ public class PointRecordFormDTO implements Serializable { * 开始时间 */ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - private String startTime; + private Date startTime; /** * 结束时间 */ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - private String endTime; + private Date endTime; private Integer pageNo = 1; private Integer pageSize = 10; private String customerId; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java index 42dc75a6c1..b49c577f00 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java @@ -27,7 +27,7 @@ public class IcPartyUnitCompletionController { private IcPartyUnitCompletionService icPartyUnitCompletionService; @PostMapping("list") - public Result> page(@RequestParam CompletionFormDTO formDTO){ + public Result> page(@RequestBody CompletionFormDTO formDTO){ PageData page = icPartyUnitCompletionService.page(formDTO); return new Result>().ok(page); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 60b437ceb5..fa34fd7497 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -128,5 +128,5 @@ public interface IcUserDemandRecDao extends BaseDao { */ List getPointRecordList(PointRecordFormDTO formDTO); - int getTotalPoint(PointRecordFormDTO formDTO); + Integer getTotalPoint(PointRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 4bf7846cd0..591d08130c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -1662,9 +1662,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(Collections.emptyList(), NumConstant.ZERO)); } - + Integer total = baseDao.getTotalPoint(formDTO); //总积分 - result.setTotalPoint(baseDao.getTotalPoint(formDTO)); + result.setTotalPoint(null == total?NumConstant.ZERO:total); //分页查询 PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = baseDao.getPointRecordList(formDTO); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index eb1260f58b..486f1eade4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -591,10 +591,10 @@ a.DEL_FLAG = '0' AND a.`STATUS` = 'finished' AND a.EVALUATE_FLAG = 1 - + AND c.EVALUATE_TIME >= #{startTime} - + AND c.EVALUATE_TIME <= #{endTime} ORDER BY c.EVALUATE_TIME DESC From 0dca38f956ee22f69fa14d5ff87a8806fe352d3e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 15:43:39 +0800 Subject: [PATCH 23/83] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PersonWarnRightListResultDTO.java | 7 ++ .../java/com/epmet/dao/IcResiUserDao.java | 2 + .../service/impl/IcResiUserServiceImpl.java | 66 ++++++++++++++++++- .../main/resources/mapper/IcResiUserDao.xml | 19 ++++++ 4 files changed, 93 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java index 031f0e6c3d..c98b26cbec 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -39,6 +40,9 @@ public class PersonWarnRightListResultDTO implements Serializable { */ private String gridName; + @JsonIgnore + private String gridId; + /** * 姓名 */ @@ -49,6 +53,9 @@ public class PersonWarnRightListResultDTO implements Serializable { */ private String family; + @JsonIgnore + private String homeId; + /** * 电话 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index db5f3aa613..bc292276a2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -231,4 +231,6 @@ public interface IcResiUserDao extends BaseDao { List listIcResiInfosByUserIds(@Param("userIds") List userIds); Map getCategoryListMap(@Param("icUserId") String icUserId); + + List> selectResiUsers(@Param("types")List types,@Param("orgId")String orgId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 91192dcf42..745b8cf907 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -1099,7 +1099,71 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> configListResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId()); + if (!configListResult.success()){ + throw new EpmetException("查询居民分类配置失败..."); + } + PersonWarnRightListResultDTO result = new PersonWarnRightListResultDTO(); + if (CollectionUtils.isEmpty(configListResult.getData())){ + return result; + } + List configList = configListResult.getData(); + PageInfo> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(configList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId())); + List> list = pageInfo.getList(); + if (CollectionUtils.isEmpty(list)) { + return result; + } + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + List userList = disposeCategory(list, configList); + Result> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet())); + if (!houseInfosResult.success()){ + throw new EpmetException("查询房屋信息失败..."); + } + List houseInfos = houseInfosResult.getData(); + userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> { + String name = h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName(); + u.setFamily(name); + })); + result.setList(userList); + return result; + } + + /** + * @Description 居民分类 和 网格名 处理 + * @param list + * @param configList + * @author zxc + * @date 2022/1/18 3:22 下午 + */ + public List disposeCategory(List> list,List configList){ + List userList = new ArrayList<>(); + list.forEach(l -> { + PersonWarnRightListResultDTO.PersonWarnRightList dto = ConvertUtils.mapToEntity(l, PersonWarnRightListResultDTO.PersonWarnRightList.class); + // 分类名字 + List types = new ArrayList<>(); + configList.forEach(c -> { + l.forEach((k,v) -> { + if (c.getColumnName().equals(k) && null != v && v.equals(NumConstant.ONE_STR)){ + types.add(c.getLabel()); + } + }); + }); + // 只显示有类别的居民 + if (CollectionUtils.isNotEmpty(types)){ + dto.setType(types); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null == gridInfo){ + throw new EpmetException(String.format("查询网格信息失败%s",dto.getGridId())); + } + dto.setGridName(gridInfo.getGridNamePath()); + userList.add(dto); + } + }); + return userList; } /** diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index d2cf1d73aa..dbba0456fc 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -540,5 +540,24 @@ del_flag = '0' AND id = #{icUserId} + From ddf1828b8fe6444bf2dfa1e5c998812fcade66a7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 15:45:50 +0800 Subject: [PATCH 24/83] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/IcResiUserServiceImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 745b8cf907..0e4630e9db 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -1124,10 +1124,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl houseInfos = houseInfosResult.getData(); - userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> { - String name = h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName(); - u.setFamily(name); - })); + userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName()))); result.setList(userList); return result; } From 9abbd5ed913a4e4cb64e5add45491edf25fb2115 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 18 Jan 2022 15:49:27 +0800 Subject: [PATCH 25/83] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=EF=BC=8C=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcUserDemandRecDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 486f1eade4..eb1260f58b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -591,10 +591,10 @@ a.DEL_FLAG = '0' AND a.`STATUS` = 'finished' AND a.EVALUATE_FLAG = 1 - + AND c.EVALUATE_TIME >= #{startTime} - + AND c.EVALUATE_TIME <= #{endTime} ORDER BY c.EVALUATE_TIME DESC From fb2bdcb0e1d9af838f5e32f3768a54fe4d6739ee Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 Jan 2022 15:57:58 +0800 Subject: [PATCH 26/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E3=80=81=E4=BA=BA=E5=91=98=E8=B0=83=E5=8A=A8=E3=80=81=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E8=AE=B0=E5=BD=95=E3=80=81=E5=8F=98=E6=9B=B4=E6=98=8E?= =?UTF-8?q?=E7=BB=86sql=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.23__ic_user_transfer_and_change.sql | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.23__ic_user_transfer_and_change.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.23__ic_user_transfer_and_change.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.23__ic_user_transfer_and_change.sql new file mode 100644 index 0000000000..0ec0f9e094 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.23__ic_user_transfer_and_change.sql @@ -0,0 +1,96 @@ + +ALTER TABLE `ic_resi_user` +ADD COLUMN `STATUS` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户状态【0:正常 1:转出】' AFTER `JTXX_REMAKES`; + +ALTER TABLE `ic_resi_user` +DROP INDEX `customer_idcard_unique`; + +CREATE TABLE `ic_user_transfer_record` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `IC_USER_ID` varchar(64) NOT NULL COMMENT '被调动人Id【ic_resi_user表id】', + `OPERATOR_ID` varchar(64) NOT NULL COMMENT '调动(工作)人员Id【customer_staff表userId】', + `IC_USER_NAME` varchar(64) NOT NULL COMMENT '被调动人名称【ic_resi_user表name】', + `OPERATOR_NAME` varchar(64) NOT NULL COMMENT '调动(工作)人员名称【customer_staff表real_name】', + `OLD_CUSTOMER_ID` varchar(64) NOT NULL COMMENT '调动前客户Id', + `NEW_CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '调动后客户Id', + `OLD_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '调动前组织Id', + `NEW_AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '调动后组织Id', + `OLD_AGENCY_NAME` varchar(64) DEFAULT NULL COMMENT '调动前组织名称', + `NEW_AGENCY_NAME` varchar(255) DEFAULT NULL COMMENT '调动后组织名称', + `OLD_GRID_ID` varchar(64) DEFAULT NULL COMMENT '调动前网格Id', + `NEW_GRID_ID` varchar(64) DEFAULT NULL COMMENT '调动后网格Id', + `OLD_GRID_NAME` varchar(255) DEFAULT NULL COMMENT '调动前网格名称', + `NEW_GRID_NAME` varchar(255) DEFAULT NULL COMMENT '调动后网格名称', + `OLD_NEIGHBOR_HOOD_ID` varchar(64) DEFAULT NULL COMMENT '调动前小区Id', + `NEW_NEIGHBOR_HOOD_ID` varchar(64) DEFAULT NULL COMMENT '调动后小区Id', + `OLD_NEIGHBOR_HOOD_NAME` varchar(255) DEFAULT NULL COMMENT '调动前小区名称', + `NEW_NEIGHBOR_HOOD_NAME` varchar(255) DEFAULT NULL COMMENT '调动后小区名称', + `OLD_BUILDING_ID` varchar(64) DEFAULT NULL COMMENT '调动前楼栋Id', + `NEW_BUILDING_ID` varchar(64) DEFAULT NULL COMMENT '调动后楼栋Id', + `OLD_BUILDING_NAME` varchar(255) DEFAULT NULL COMMENT '调动前楼栋名称', + `NEW_BUILDING_NAME` varchar(255) DEFAULT NULL COMMENT '调动后楼栋名称', + `OLD_BUILDING_UNIT_ID` varchar(64) DEFAULT NULL COMMENT '调动前单元Id', + `NEW_BUILDING_UNIT_ID` varchar(64) DEFAULT NULL COMMENT '调动后单元Id', + `OLD_BUILDING_UNIT_NAME` varchar(255) DEFAULT NULL COMMENT '调动前单元名称', + `NEW_BUILDING_UNIT_NAME` varchar(255) DEFAULT NULL COMMENT '调动后单元名称', + `OLD_HOUSE_ID` varchar(64) DEFAULT NULL COMMENT '调动前房屋Id', + `NEW_HOUSE_ID` varchar(64) DEFAULT NULL COMMENT '调动后房屋Id', + `OLD_HOUSE_NAME` varchar(255) DEFAULT NULL COMMENT '调动前房屋名称', + `NEW_HOUSE_NAME` varchar(255) DEFAULT NULL COMMENT '调动后房屋名称', + `TRANSFER_TIME` datetime NOT NULL COMMENT '调动时间', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注说明', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='居民调动记录表'; + +CREATE TABLE `ic_user_change_record` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `IC_USER_TRANSFER_RECORD_ID` varchar(64) DEFAULT NULL COMMENT '调动表Id【只有调动记录此列才有值】', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '当前所属客户Id[迁出客户的此列没值]', + `OPERATOR_ID` varchar(64) NOT NULL COMMENT '操作人Id【customer_staff表userId】', + `IC_USER_ID` varchar(64) NOT NULL COMMENT '被操作人Id【ic_resi_user表id】', + `OPERATOR_NAME` varchar(64) NOT NULL COMMENT '操作人名称【customer_staff表real_name】', + `IC_USER_NAME` varchar(64) NOT NULL COMMENT '被操作人名称【ic_resi_user表name】', + `TYPE` varchar(64) NOT NULL COMMENT '操作类型【add:新增 category:类别 transfer:调动】', + `TYPE_NAME` varchar(64) NOT NULL COMMENT '操作类型名称【add:新增 category:类别 transfer:调动】', + `BEFORE_CHANGE_NAME` varchar(512) DEFAULT NULL COMMENT '变更前文字描述', + `AFTER_CHANGE_NAME` varchar(512) DEFAULT NULL COMMENT '变更后文字描述', + `CHANGE_TIME` datetime NOT NULL COMMENT '调整时间', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注说明', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='居民变更记录表'; + +CREATE TABLE `ic_user_change_detailed` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `IC_USER_CHANGE_RECORD_ID` varchar(64) NOT NULL COMMENT '变更记录表主键【ic_user_change_record.id】', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织Id', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格Id', + `NEIGHBOR_HOOD_ID` varchar(64) NOT NULL COMMENT '小区Id', + `BUILDING_ID` varchar(64) NOT NULL COMMENT '楼栋Id', + `BUILDING_UNIT_ID` varchar(64) NOT NULL COMMENT '单元Id', + `HOUSE_ID` varchar(64) NOT NULL COMMENT '房屋Id', + `IC_USER_ID` varchar(64) NOT NULL COMMENT '变更人Id', + `TYPE` varchar(255) NOT NULL COMMENT '操作类型【add:新增 category:类别 in:迁入 out:迁出】', + `TYPE_NAME` varchar(255) NOT NULL COMMENT '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', + `FIELD_NAME` varchar(64) NOT NULL COMMENT '字段名【18类对应的ic_resi_user表字段名】', + `VALUE` int(3) NOT NULL COMMENT '当前类别的值', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='变更明细表\r\n[一条变更记录对应多条人员类别数据]'; \ No newline at end of file From cbe0ff7d87db9ef459d1de66476e99f015db87b3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 16:09:31 +0800 Subject: [PATCH 27/83] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 4 +++ .../com/epmet/dto/result/HouseInfoDTO.java | 5 +++ .../main/java/com/epmet/dao/IcHouseDao.java | 2 ++ .../java/com/epmet/redis/IcHouseRedis.java | 35 +++++++++++++++++++ .../epmet/service/impl/HouseServiceImpl.java | 10 +++++- .../src/main/resources/mapper/IcHouseDao.xml | 24 +++++++++++++ 6 files changed, 79 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index f3c669d7cd..1390ed7a3a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -636,4 +636,8 @@ public class RedisKeys { public static String getOrgTreeCacheKey(String agencyId) { return rootPrefix.concat("org:temp:orgtree").concat(agencyId); } + + public static String getHouseInfoCacheKey(String houseId){ + return rootPrefix.concat("house:").concat(houseId); + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index 853558739b..312befe6ca 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -71,4 +71,9 @@ public class HouseInfoDTO implements Serializable { * 楼的纬度 */ private String buildingLatitude; + + /** + * 小区名+楼栋名+单元名+房屋名 + */ + private String allName; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index 93c5af18e5..a394aaaef5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -59,6 +59,8 @@ public interface IcHouseDao extends BaseDao { List queryHouseInfo(@Param("houseIdList") Set houseIdList); + HouseInfoDTO queryHouseInfoByHouseId(@Param("houseId") String houseId); + /** * @Description 查询房屋信息 * @param idCard diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java index 9159c6eb88..f5b7b8639b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java @@ -17,9 +17,17 @@ package com.epmet.redis; +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcHouseDao; +import com.epmet.dto.result.HouseInfoDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.Map; /** * 房屋信息 @@ -32,6 +40,9 @@ public class IcHouseRedis { @Autowired private RedisUtils redisUtils; + @Autowired + private IcHouseDao icHouseDao; + public void delete(Object[] ids) { } @@ -44,4 +55,28 @@ public class IcHouseRedis { return null; } + /** + * @Description 往缓存放房屋信息 + * @param houseId + * @param map + * @author zxc + * @date 2022/1/18 3:55 下午 + */ + public void setHouseInfo(String houseId, Map map){ + String key = RedisKeys.getHouseInfoCacheKey(houseId); + redisUtils.hMSet(key, map); + } + + public HouseInfoDTO getHouseInfo(String houseId){ + String key = RedisKeys.getHouseInfoCacheKey(houseId); + Map map = redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(map)){ + return ConvertUtils.mapToEntity(map,HouseInfoDTO.class); + } + HouseInfoDTO houseInfo = icHouseDao.queryHouseInfoByHouseId(houseId); + Map result = BeanUtil.beanToMap(houseInfo, false, true); + setHouseInfo(houseId,result); + return houseInfo; + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 90a46acfc0..551cd9a82f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.tools.constant.NumConstant; @@ -31,6 +32,7 @@ import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; import com.epmet.excel.IcHouseExcel; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.redis.IcHouseRedis; import com.epmet.service.HouseService; import com.epmet.service.IcBuildingService; import com.epmet.service.IcBuildingUnitService; @@ -69,6 +71,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { private IcHouseDao icHouseDao; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcHouseRedis icHouseRedis; @Override @Transactional(rollbackFor = Exception.class) @@ -313,6 +317,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { if(org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)){ return new ArrayList<>(); } - return icHouseDao.queryHouseInfo(houseIdList); + List result = new ArrayList<>(); + houseIdList.forEach(h -> { + result.add(icHouseRedis.getHouseInfo(h)); + }); + return result; } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index b5a8b72a25..900d34ba66 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -300,4 +300,28 @@ and ih.id !=#{houseId} + From af777cb478b6f12ddbab43918d5c522a768597f3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Jan 2022 16:19:20 +0800 Subject: [PATCH 28/83] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dao/user/UserDao.java | 5 + ...FactIcuserCategoryAnalysisDailyEntity.java | 5 +- .../screen/ScreenCustomerGridService.java | 3 +- .../impl/ScreenCustomerGridServiceImpl.java | 6 +- ...cuserCategoryAnalysisDailyServiceImpl.java | 145 ++++++++++++------ .../com/epmet/service/user/UserService.java | 10 ++ .../service/user/impl/UserServiceImpl.java | 26 ++++ .../main/resources/mapper/user/UserDao.xml | 35 ++++- 8 files changed, 176 insertions(+), 59 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index a6ecca8319..58c9b870ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -278,5 +278,10 @@ public interface UserDao { @Param("agencyId") String agencyId); List selectGridIcUserCategoryTotal(@Param("customerId")String customerId, @Param("dateId")String dateId); + + List selectGridIcUserCategoryIncr(@Param("customerId")String customerId, + @Param("startDate")String startDate, + @Param("endDate")String endDate, + @Param("type")String type); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java index d1db22e1e9..ff98e8bea5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java @@ -27,7 +27,10 @@ public class FactIcuserCategoryAnalysisDailyEntity extends BaseEpmetEntity { * 预警配置ID */ private String configId; - + /** + * 类别列名,对个数据太麻烦了,在这个表存一下 + */ + private String columnName; /** * 当前数据是截止到XXX的:yyyyMMdd */ 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 5ea9362398..053dee1079 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 @@ -19,7 +19,6 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; @@ -138,5 +137,5 @@ public interface ScreenCustomerGridService extends BaseService getByCustomerId(String customerId); + List getByCustomerId(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 fe3f1a863e..d184f762d1 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 @@ -29,7 +29,6 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.DimLastSyncRecordDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; -import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; @@ -293,10 +292,9 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl getByCustomerId(String customerId) { + public List getByCustomerId(String customerId) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(ScreenCustomerGridEntity::getCustomerId, customerId); - List list = baseDao.selectList(wrapper); - return ConvertUtils.sourceToTarget(list,CustomerGridDTO.class); + return baseDao.selectList(wrapper); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java index 9384c21423..a3d0b5ab26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java @@ -6,15 +6,16 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactIcuserCategoryAnalysisDailyDao; -import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.customize.IcResiCategoryConfigDTO; import com.epmet.dto.user.result.OrgIcUserTotalDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity; import com.epmet.service.customize.IcResiCategoryStatsConfigService; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService; import com.epmet.service.user.UserService; +import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -45,7 +46,8 @@ public class FactIcuserCategoryAnalysisDailyServiceImpl extends BaseServiceImpl< @Autowired private ScreenCustomerGridService gridService; @Autowired - private UserService userService; + private UserService userService; + /** * 数字社区-基础信息-人员类别分析-每个类别的人员总数、较上月迁入迁出人数 * @@ -55,99 +57,142 @@ public class FactIcuserCategoryAnalysisDailyServiceImpl extends BaseServiceImpl< @Override public void statUserCategoryGridDaily(String customerId, String dateId) { //查询出所有用语数据分析的类别column_name,没有则不计算 - List columnList=icResiCategoryStatsConfigService.queryDataColumn(customerId); - if(CollectionUtils.isEmpty(columnList)){ + List columnList = icResiCategoryStatsConfigService.queryDataColumn(customerId); + if (CollectionUtils.isEmpty(columnList)) { + return; + } + //所有网格查询出来 + List gridDTOList = gridService.getByCustomerId(customerId); + if (CollectionUtils.isEmpty(gridDTOList)) { return; } - // //所有网格和组织查询出来 - // List agencyDTOList=agencyService.getByCustomerId(customerId); - List gridDTOList=gridService.getByCustomerId(customerId); //网格维度、组织维度初始好数据 - List initList=constructInitValue(customerId,dateId,gridDTOList,columnList); - if(CollectionUtils.isEmpty(initList)){ + List initList = constructInitValue(customerId, dateId, gridDTOList, columnList); + if (CollectionUtils.isEmpty(initList)) { return; } - // 批量插入数据 - - + //当这3个数都为0的时候不插入数据库了 + List insertList = initList.stream().filter(entity -> (null != entity.getTotal() && entity.getTotal() > 0) + || (null != entity.getQcIncr() && entity.getQcIncr() > 0) + || (null != entity.getQrIncr() && entity.getQrIncr() > 0)).collect(Collectors.toList()); //删除旧数据 - clearOldDatas(customerId,dateId,OrgTypeEnum.GRID.getCode()); + clearOldDatas(customerId, dateId, OrgTypeEnum.GRID.getCode()); + // 批量插入数据 + Lists.partition(insertList, NumConstant.ONE_HUNDRED).forEach(list -> { + insertBatch(list); + }); } - private void clearOldDatas(String customerId, String dateId,String orgType) { + /** + * 删除旧数据 + * + * @param customerId + * @param dateId + * @param orgType grid、agency + */ + private void clearOldDatas(String customerId, String dateId, String orgType) { int deleteNum; do { //每次删除1000条 - deleteNum = baseDao.limitDelete(customerId,dateId,orgType); + deleteNum = baseDao.limitDelete(customerId, dateId, orgType); } while (deleteNum != NumConstant.ZERO); } /** - * * @param customerId - * @param dateId yyyyMMdd + * @param dateId yyyyMMdd * @param gridDTOList 当前客户下所有的网格 - * @param columnList 所有需要分析的类别对应的ic_resi_user的列名,目前只有18类 + * @param columnList 所有需要分析的类别对应的ic_resi_user的列名,目前只有18类 * @return */ - private List constructInitValue(String customerId,String dateId, List gridDTOList,List columnList) { - List list=new ArrayList<>(); - if(CollectionUtils.isEmpty(gridDTOList)){ - //没有配置的类别,退出吧 - return list; - } + private List constructInitValue(String customerId, String dateId, List gridDTOList, List columnList) { + List list = new ArrayList<>(); //1、total // 查询明细ic_user_change_detailed变更明细表,各个网格的各个分类的总人数 - Map> totalMapList=userService.calGridIcUserTotal(customerId,dateId); + Map> totalMapList = userService.calGridIcUserTotal(customerId, dateId); - String monthId=dateId.substring(NumConstant.ZERO,NumConstant.SIX); - String startDate=monthId.concat("01"); - String endDate=dateId; + String monthId = dateId.substring(NumConstant.ZERO, NumConstant.SIX); + String startDate = monthId.concat("01"); + String endDate = dateId; //2、迁入+30:eg:dateId:20211226, [20211201,20211226],类别sum值=1的 - Map> qrList=userService.calGridIcUserQr(customerId,dateId); + Map> qrList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qr"); //3、迁出 -10 :eg:dateId:20211226, [20211201,20211226],类别sum值 !=1的 - Map> qrList=userService.calGridIcUserQr(customerId,dateId); + Map> qcList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qc"); - for(IcResiCategoryConfigDTO config:columnList){ - gridDTOList.forEach(grid->{ - FactIcuserCategoryAnalysisDailyEntity gridData=new FactIcuserCategoryAnalysisDailyEntity(); + for (IcResiCategoryConfigDTO config : columnList) { + gridDTOList.forEach(grid -> { + FactIcuserCategoryAnalysisDailyEntity gridData = new FactIcuserCategoryAnalysisDailyEntity(); gridData.setCustomerId(customerId); gridData.setConfigId(config.getConfigId()); + gridData.setColumnName(config.getColumnName()); gridData.setDateId(dateId); - gridData.setOrgId(grid.getId()); + gridData.setOrgId(grid.getGridId()); gridData.setOrgType(OrgTypeEnum.GRID.getCode()); - gridData.setPid(StringUtils.isNotBlank(grid.getPid())?grid.getPid(): NumConstant.ZERO_STR); - gridData.setPids(grid.getPids()); + gridData.setPid(StringUtils.isNotBlank(grid.getParentAgencyId()) ? grid.getParentAgencyId() : NumConstant.ZERO_STR); + gridData.setPids(grid.getAllParentIds()); - boolean zeroFlag=true; - if(MapUtils.isNotEmpty(totalMapList)&&totalMapList.containsKey(grid.getId())){ + //截止到目前累计值 + boolean totalZeroFlag = true; + if (MapUtils.isNotEmpty(totalMapList) && totalMapList.containsKey(grid.getGridId())) { //当前网格下,有的类别 - List crrentGrid=totalMapList.get(grid.getId()); - if(CollectionUtils.isNotEmpty(crrentGrid)){ + List crrentGrid = totalMapList.get(grid.getGridId()); + if (CollectionUtils.isNotEmpty(crrentGrid)) { //各个类别对应的数 - Map categoryTotalMap=crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); - if(MapUtils.isNotEmpty(categoryTotalMap)&&categoryTotalMap.containsKey(config.getColumnName())){ - zeroFlag=false; + Map categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); + if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) { + totalZeroFlag = false; gridData.setTotal(categoryTotalMap.get(config.getColumnName())); } } } - if(zeroFlag){ + if (totalZeroFlag) { gridData.setTotal(NumConstant.ZERO); } - gridData.setQcIncr(NumConstant.ZERO); - gridData.setQrIncr(NumConstant.ZERO); + + //较上月迁入 + boolean incrZeroFlag = true; + if (MapUtils.isNotEmpty(qrList) && qrList.containsKey(grid.getGridId())) { + //当前网格下,有的类别 + List crrentGrid = qrList.get(grid.getGridId()); + if (CollectionUtils.isNotEmpty(crrentGrid)) { + //各个类别对应的数 + Map categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); + if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) { + incrZeroFlag = false; + gridData.setQrIncr(categoryTotalMap.get(config.getColumnName())); + } + } + } + if (incrZeroFlag) { + gridData.setQrIncr(NumConstant.ZERO); + } + + // 较上月迁出: + boolean qcZeroFlag = true; + if (MapUtils.isNotEmpty(qcList) && qcList.containsKey(grid.getGridId())) { + //当前网格下,有的类别 + List crrentGridQc = qcList.get(grid.getGridId()); + if (CollectionUtils.isNotEmpty(crrentGridQc)) { + //各个类别对应的数 + Map categoryTotalMap = crrentGridQc.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2)); + if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) { + qcZeroFlag = false; + gridData.setQcIncr(categoryTotalMap.get(config.getColumnName())); + } + } + } + if (qcZeroFlag) { + gridData.setQcIncr(NumConstant.ZERO); + } + list.add(gridData); }); } return list; } - public static void main(String[] args) { - String dateId="20211225"; - System.out.println(dateId.substring(0,6)); - } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 522e6eeaa5..69482594fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -176,4 +176,14 @@ public interface UserService { * @return */ Map> calGridIcUserTotal(String customerId, String dateId); + + /** + * + * @param customerId + * @param startDate :变动时间在此范围内的 yyyyMMdd + * @param endDate :yyyyMMdd + * @param type:qr:迁入;qc:迁出 + * @return + */ + Map> calGridIcUserIncr(String customerId, String startDate, String endDate, String type); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 007cad7e2b..06c94a0392 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -1201,4 +1201,30 @@ public class UserServiceImpl implements UserService { return resultMap; } + /** + * @param customerId + * @param startDate :变动时间在此范围内的 yyyyMMdd + * @param endDate :yyyyMMdd + * @param type :qr:迁入;qc:迁出 + * @return + */ + @Override + public Map> calGridIcUserIncr(String customerId, String startDate, String endDate, String type) { + Map> resultMap=new HashMap<>(); + List list=userDao.selectGridIcUserCategoryIncr(customerId,startDate,endDate,type); + if(CollectionUtils.isEmpty(list)){ + return resultMap; + } + for(OrgIcUserTotalDTO dto:list){ + if(resultMap.containsKey(dto.getOrgId())){ + resultMap.get(dto.getOrgId()).add(dto); + continue; + } + List newList=new ArrayList<>(); + newList.add(dto); + resultMap.put(dto.getOrgId(),newList); + } + return resultMap; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 7bec8ecc7b..11d9e4aaef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -1107,7 +1107,7 @@ select temp.orgId, temp.FIELD_NAME as columnName, - count(distinct temp.IC_USER_ID) as total + count(temp.IC_USER_ID) as total from ( SELECT d.GRID_ID as orgId, @@ -1120,9 +1120,40 @@ d.DEL_FLAG = '0' AND d.CUSTOMER_ID = #{customerId} AND DATE_FORMAT( d.CREATED_TIME, '%Y%m%d' ) <= #{dateId} - group by d.orgId,d.IC_USER_ID,d.FIELD_NAME + group by d.GRID_ID,d.IC_USER_ID,d.FIELD_NAME )temp where temp.result=1 group by temp.orgId,temp.FIELD_NAME + + + From 3cbb59cd91320a640893b67939b9bd2365e23742 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 16:27:19 +0800 Subject: [PATCH 29/83] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/redis/RedisKeys.java | 4 ++-- .../epmet/service/impl/IcUserDemandRecServiceImpl.java | 4 ++-- .../main/java/com/epmet/dto/result/HouseInfoDTO.java | 2 ++ .../java/com/epmet/feign/GovOrgOpenFeignClient.java | 2 +- .../feign/fallback/GovOrgOpenFeignClientFallback.java | 4 ++-- .../java/com/epmet/controller/HouseController.java | 4 ++-- .../src/main/java/com/epmet/redis/IcHouseRedis.java | 10 +++++----- .../src/main/java/com/epmet/service/HouseService.java | 2 +- .../java/com/epmet/service/impl/HouseServiceImpl.java | 4 ++-- .../src/main/resources/mapper/IcHouseDao.xml | 1 + .../com/epmet/service/impl/IcResiUserServiceImpl.java | 4 ++-- 11 files changed, 22 insertions(+), 19 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 1390ed7a3a..dc3fb232bc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -637,7 +637,7 @@ public class RedisKeys { return rootPrefix.concat("org:temp:orgtree").concat(agencyId); } - public static String getHouseInfoCacheKey(String houseId){ - return rootPrefix.concat("house:").concat(houseId); + public static String getHouseInfoCacheKey(String houseId,String customerId){ + return rootPrefix.concat("house:").concat(customerId).concat(":").concat(houseId); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 591d08130c..ffb5bac51c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -154,7 +154,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl houseIds=new HashSet<>(); houseIds.add(updateEntity.getDemandUserHouseId()); - Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); + Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,dto.getCustomerId()); if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){ throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes)); } @@ -223,7 +223,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl houseIds=new HashSet<>(); houseIds.add(insertEntity.getDemandUserHouseId()); - Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); + Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds, fromDTO.getCustomerId()); if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){ throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes)); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index 312befe6ca..3a3ca19096 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -76,4 +76,6 @@ public class HouseInfoDTO implements Serializable { * 小区名+楼栋名+单元名+房屋名 */ private String allName; + + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 497cae9547..9293546170 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -460,7 +460,7 @@ public interface GovOrgOpenFeignClient { Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); @PostMapping(value = "/gov/org/house/queryListHouseInfo",consumes = MediaType.APPLICATION_JSON_VALUE) - Result> queryListHouseInfo(@RequestBody Set houseIds); + Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index d4330f90d0..7b245ec735 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -276,8 +276,8 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { } @Override - public Result> queryListHouseInfo(Set houseIds) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds); + public Result> queryListHouseInfo(Set houseIds ,String customerId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds, customerId); } @Override diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index f593287e77..cd54f15e64 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -229,7 +229,7 @@ public class HouseController implements ResultDataResolver { } @PostMapping( "queryListHouseInfo") - Result> queryListHouseInfo(@RequestBody Set houseIds){ - return new Result>().ok(houseService.queryListHouseInfo(houseIds)); + Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId){ + return new Result>().ok(houseService.queryListHouseInfo(houseIds,customerId)); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java index f5b7b8639b..4f3ece54a8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java @@ -62,20 +62,20 @@ public class IcHouseRedis { * @author zxc * @date 2022/1/18 3:55 下午 */ - public void setHouseInfo(String houseId, Map map){ - String key = RedisKeys.getHouseInfoCacheKey(houseId); + public void setHouseInfo(String houseId, Map map,String customerId){ + String key = RedisKeys.getHouseInfoCacheKey(houseId,customerId); redisUtils.hMSet(key, map); } - public HouseInfoDTO getHouseInfo(String houseId){ - String key = RedisKeys.getHouseInfoCacheKey(houseId); + public HouseInfoDTO getHouseInfo(String houseId,String customerId){ + String key = RedisKeys.getHouseInfoCacheKey(houseId,customerId); Map map = redisUtils.hGetAll(key); if (!CollectionUtils.isEmpty(map)){ return ConvertUtils.mapToEntity(map,HouseInfoDTO.class); } HouseInfoDTO houseInfo = icHouseDao.queryHouseInfoByHouseId(houseId); Map result = BeanUtil.beanToMap(houseInfo, false, true); - setHouseInfo(houseId,result); + setHouseInfo(houseId,result,houseInfo.getCustomerId()); return houseInfo; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index ac7f28dbbc..ad5d1d69cb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -61,5 +61,5 @@ public interface HouseService { void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception; - List queryListHouseInfo(Set houseIds); + List queryListHouseInfo(Set houseIds, String customerId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 551cd9a82f..d8ad9630ef 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -313,13 +313,13 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { }*/ @Override - public List queryListHouseInfo(Set houseIdList) { + public List queryListHouseInfo(Set houseIdList, String customerId) { if(org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)){ return new ArrayList<>(); } List result = new ArrayList<>(); houseIdList.forEach(h -> { - result.add(icHouseRedis.getHouseInfo(h)); + result.add(icHouseRedis.getHouseInfo(h,customerId)); }); return result; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 900d34ba66..7411fb6575 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -315,6 +315,7 @@ IFNULL(ih.HOUSE_NAME,'') as HOUSE_NAME, IFNULL(ib.LONGITUDE,'') as buildingLongitude, IFNULL(ib.LATITUDE,'') as buildingLatitude, + ih.CUSTOMER_ID AS customerId, concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName FROM ic_house ih left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id ) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 0e4630e9db..4e02d02cea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -526,7 +526,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); //查询房子名称 - Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); + Result> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId()); List houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); Map houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); for (Map resultMap : list) { @@ -1119,7 +1119,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl userList = disposeCategory(list, configList); - Result> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet())); + Result> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet()),tokenDto.getCustomerId()); if (!houseInfosResult.success()){ throw new EpmetException("查询房屋信息失败..."); } From e54149303efbc4cf040dc977791cd5484370dbb1 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 Jan 2022 16:32:11 +0800 Subject: [PATCH 30/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CustomerAgencyServiceImpl.java | 8 +-- .../service/impl/IcResiUserServiceImpl.java | 37 +++++----- .../impl/IcUserTransferRecordServiceImpl.java | 71 ++++++++++--------- 3 files changed, 62 insertions(+), 54 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 372aafa390..7403df24f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -1387,10 +1387,10 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl map) { - Date date = (Date) new java.util.Date(); + java.util.Date date = new java.util.Date(); //1.判断维度数据是否修改【网格、小区、楼栋、单元、房间有变化则先走人员调动逻辑】 if ((map.containsKey("GRID_ID") && !entity.getGridId().equals(map.get("GRID_ID"))) || (map.containsKey("VILLAGE_ID") && !entity.getVillageId().equals(map.get("VILLAGE_ID"))) || (map.containsKey("BUILD_ID") && !entity.getBuildId().equals(map.get("BUILD_ID"))) || (map.containsKey("UNIT_ID") && !entity.getUnitId().equals(map.get("UNIT_ID"))) @@ -413,22 +413,25 @@ public class IcResiUserServiceImpl extends BaseServiceImpl l.setIcUserChangeRecordId(changeRecordEntity.getId())); - icUserChangeDetailedService.insertBatch(list); + //居民信息修改中有类别修改的才会生成变更记录和变更明细 + if (list.size() > NumConstant.ZERO) { + //变更记录 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + changeRecordEntity.setCustomerId(tokenDto.getCustomerId()); + changeRecordEntity.setOperatorId(tokenDto.getUserId()); + changeRecordEntity.setIcUserId(entity.getId()); + changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); + changeRecordEntity.setIcUserName(map.containsKey("NAME") ? map.get("NAME") : entity.getName()); + changeRecordEntity.setType("category"); + changeRecordEntity.setTypeName("类别"); + changeRecordEntity.setBeforeChangeName(beforeChangeName.toString()); + changeRecordEntity.setAfterChangeName(afterChangeName.toString()); + changeRecordEntity.setChangeTime(date); + icUserChangeRecordService.insert(changeRecordEntity); + + list.forEach(l -> l.setIcUserChangeRecordId(changeRecordEntity.getId())); + icUserChangeDetailedService.insertBatch(list); + } } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index e2616d2842..1d994dd30c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java @@ -98,22 +98,24 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl result2 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO2); - if (!result2.success() || null == result2.getData().getAgencyDTO() || null == result2.getData().getGridDTO() || null == result2.getData().getNeighborHoodDTO() - || null == result2.getData().getBuildingDTO() || null == result2.getData().getBuildingUnitDTO() || null == result2.getData().getHouseDTO()) { - log.warn("查找被调动人调动后的组织、网格、小区、楼栋、单元、房屋信息失败"); - throw new RenException("9000", "获取被调动人基础信息失败"); + Result result2 = new Result<>(); + if("in".equals(formDTO.getType())){ + IcResiUserOrgMsgFormDTO orgMsgFormDTO2 = new IcResiUserOrgMsgFormDTO(); + orgMsgFormDTO2.setCustomerId(formDTO.getCustomerId()); + orgMsgFormDTO2.setAgencyId(formDTO.getNewAgencyId()); + orgMsgFormDTO2.setGridId(formDTO.getNewGridId()); + orgMsgFormDTO2.setNeighborHoodId(formDTO.getNewNeighborHoodId()); + orgMsgFormDTO2.setBuildingId(formDTO.getNewBuildingId()); + orgMsgFormDTO2.setBuildingUnitId(formDTO.getNewBuildingUnitId()); + orgMsgFormDTO2.setHouseId(formDTO.getNewHouseId()); + result2 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO2); + if (!result2.success() || null == result2.getData().getAgencyDTO() || null == result2.getData().getGridDTO() || null == result2.getData().getNeighborHoodDTO() + || null == result2.getData().getBuildingDTO() || null == result2.getData().getBuildingUnitDTO() || null == result2.getData().getHouseDTO()) { + log.warn("查找被调动人调动后的组织、网格、小区、楼栋、单元、房屋信息失败"); + throw new RenException("9000", "获取被调动人基础信息失败"); + } } - //4.修改被调动人所属各维度信息或人员状态信息 if (formDTO.getIdEdit()) { IcResiUserEntity userEntity = new IcResiUserEntity(); @@ -156,10 +158,12 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl Date: Tue, 18 Jan 2022 16:37:09 +0800 Subject: [PATCH 31/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=B1=BB=E5=88=AB=E5=AD=97=E5=85=B8=E8=A1=A8?= =?UTF-8?q?=EF=BC=9A=E8=BF=81=E5=85=A5=EF=BC=8C=E8=BF=81=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=EF=BC=8C=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.10__add_icuserchangetype_dict.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql new file mode 100644 index 0000000000..52b0043f7f --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql @@ -0,0 +1,7 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355574648180737', 'ic_user_change_type', '人员变动类型', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 17, 0, 0, '1', '2022-01-18 16:28:23', '1', '2022-01-18 16:28:42'); + + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355968996642817', 1483355574648180737, '迁出', 'out', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 4, 0, 0, '1', '2022-01-18 16:29:57', '1', '2022-01-18 16:29:57'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355899824181249', 1483355574648180737, '迁入', 'in', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 3, 0, 0, '1', '2022-01-18 16:29:41', '1', '2022-01-18 16:29:41'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355832321052673', 1483355574648180737, '类别', 'category', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 2, 0, 0, '1', '2022-01-18 16:29:25', '1', '2022-01-18 16:29:25'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355752541196290', 1483355574648180737, '新增', 'add', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 1, 0, 0, '1', '2022-01-18 16:29:05', '1', '2022-01-18 16:29:05'); \ No newline at end of file From 415863852bbcb9cecc16dbfefd34e50c1086afe3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 16:51:52 +0800 Subject: [PATCH 32/83] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcResiUserServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 988a5c6eb0..fdd4137135 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -1127,7 +1127,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl houseInfos = houseInfosResult.getData(); - userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName()))); + userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getAllName()))); result.setList(userList); return result; } From 1319a1d65bd91d319aa66364d90d886c5d28dc3b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 Jan 2022 17:27:09 +0800 Subject: [PATCH 33/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8=E5=A2=9E=E5=8A=A0pids=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/IcUserChangeDetailedDTO.java | 5 +++++ .../epmet/entity/IcUserChangeDetailedEntity.java | 5 +++++ .../service/impl/IcResiUserServiceImpl.java | 7 +++++++ .../impl/IcUserTransferRecordServiceImpl.java | 16 ++++++++++++++++ .../migration/V0.0.24__alter_change_detailed.sql | 3 +++ 5 files changed, 36 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java index 2220f907f5..cc4ed1a405 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java @@ -49,6 +49,11 @@ public class IcUserChangeDetailedDTO implements Serializable { */ private String icUserChangeRecordId; + /** + * 组织的所有上级Id + */ + private String pids; + /** * 组织Id */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java index 35608feae9..f60a5d1e36 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java @@ -46,6 +46,11 @@ public class IcUserChangeDetailedEntity extends BaseEpmetEntity { */ private String icUserChangeRecordId; + /** + * 组织的所有上级Id + */ + private String pids; + /** * 组织Id */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index fdd4137135..28036d3a59 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; @@ -254,6 +255,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = new ArrayList<>(); IcUserChangeDetailedEntity outEntity = null; IcUserChangeDetailedEntity inEntity = null; + AgencyInfoCache oldAgencyInfo = CustomerOrgRedis.getAgencyInfo(resiUserDTO.getAgencyId()); + if (null == oldAgencyInfo) { + throw new EpmetException(String.format("查询组织信息失败%s", resiUserDTO.getAgencyId())); + } + AgencyInfoCache newAgencyInfo = new AgencyInfoCache(); + if ("in".equals(formDTO.getType())) { + newAgencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getNewAgencyId()); + if (null == newAgencyInfo) { + throw new EpmetException(String.format("查询组织信息失败%s", formDTO.getNewAgencyId())); + } + } for (IcResiCategoryWarnConfigDTO cf : configList) { if ("1".equals(map.get(cf.getColumnName()))) { //迁出 outEntity = new IcUserChangeDetailedEntity(); outEntity.setCustomerId(formDTO.getCustomerId()); outEntity.setIcUserChangeRecordId(icUserChangeRecordId); + outEntity.setPids(oldAgencyInfo.getPids()); outEntity.setAgencyId(resiUserDTO.getAgencyId()); outEntity.setGridId(resiUserDTO.getGridId()); outEntity.setNeighborHoodId(resiUserDTO.getVillageId()); @@ -254,6 +269,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl Date: Tue, 18 Jan 2022 18:08:39 +0800 Subject: [PATCH 34/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E5=88=86=E6=9E=90=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcUsercategoryAnalysisFormDTO.java | 42 +++++++++++++ .../IcUsercategoryAnalysisResultDTO.java | 33 ++++++++++ .../IcUserChangeRecordController.java | 14 +++++ .../com/epmet/dao/IcUserChangeRecordDao.java | 4 ++ .../service/IcUserChangeRecordService.java | 10 +++ .../impl/IcUserChangeRecordServiceImpl.java | 63 +++++++++++++++++++ .../mapper/IcUserChangeRecordDao.xml | 29 +++++++++ 7 files changed, 195 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUsercategoryAnalysisFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUsercategoryAnalysisResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUsercategoryAnalysisFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUsercategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..5e448e6ad8 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUsercategoryAnalysisFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 数字社区-人员类别分析 入参DTO + * 某个类别的迁入、迁出、新增、类别列表 + */ +@Data +public class IcUsercategoryAnalysisFormDTO implements Serializable { + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + @NotBlank(message = "请选择查看某个人员类别",groups =AddUserShowGroup.class ) + private String categoryKey; + + @NotBlank(message = "dateId不能为空",groups =AddUserInternalGroup.class ) + @Length(min = 8, max = 8,message = "dateId格式:yyyyMMdd",groups =AddUserInternalGroup.class) + private String dateId; + + private String type; + + @NotNull(message = "页码pageNo不能为空",groups =AddUserInternalGroup.class ) + private Integer pageNo; + @NotNull(message = "页量pageSize不能为空",groups =AddUserInternalGroup.class ) + private Integer pageSize; + + @NotBlank(message = "请选择查看某个组织或网格",groups =AddUserShowGroup.class ) + private String orgId; + @NotBlank(message = "orgType不能为空",groups =AddUserInternalGroup.class ) + private String orgType; + + private String startDate; + private String endDate; + +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUsercategoryAnalysisResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUsercategoryAnalysisResultDTO.java new file mode 100644 index 0000000000..ac3ff1a3b2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUsercategoryAnalysisResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 人员类别分析 + * 列表返参 + */ +@Data +public class IcUsercategoryAnalysisResultDTO implements Serializable { + private static final long serialVersionUID = 8071180665763717817L; + private String icUserId; + private String name; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date changeTime; + private String typeName; + private String type; + private String gridName; + private String address; + + // @JsonIgnore + private String buildingId; + // @JsonIgnore + private String gridId; + // @JsonIgnore + private Integer value; + // @JsonIgnore + private String fieldName; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java index fc11027e8f..5ab2dae1eb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java @@ -17,11 +17,14 @@ package com.epmet.controller; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; import com.epmet.dto.form.IcResiUserTransferFormDTO; +import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; +import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; import com.epmet.service.IcUserChangeRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -53,4 +56,15 @@ public class IcUserChangeRecordController { return new Result().ok(icUserChangeRecordService.list(formDTO)); } + /** + * 人员类别分析 + * @param formDTO + * @return + */ + // /epmetuser/icuserchangerecord/category-analysis-list + @PostMapping("category-analysis-list") + public Result> categoryAnalysisList(@RequestBody IcUsercategoryAnalysisFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,IcUsercategoryAnalysisFormDTO.AddUserShowGroup.class,IcUsercategoryAnalysisFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icUserChangeRecordService.categoryAnalysisList(formDTO)); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java index d0079ab6eb..0e82f9564e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java @@ -19,6 +19,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcUserChangeRecordDTO; +import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; +import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; import com.epmet.entity.IcUserChangeRecordEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -39,4 +41,6 @@ public interface IcUserChangeRecordDao extends BaseDao * @Description 查询居民变更记录 **/ List getList(@Param("icUserId") String icUserId); + + List categoryAnalysisList(IcUsercategoryAnalysisFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java index 8032331a16..252c5abd94 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java @@ -18,8 +18,11 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; +import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; import com.epmet.entity.IcUserChangeRecordEntity; /** @@ -35,4 +38,11 @@ public interface IcUserChangeRecordService extends BaseService categoryAnalysisList(IcUsercategoryAnalysisFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 4b61577545..9f764e9c05 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -18,17 +18,34 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcUserChangeRecordDao; import com.epmet.dto.IcUserChangeRecordDTO; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; +import com.epmet.dto.result.AllGridsByUserIdResultDTO; +import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; +import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; import com.epmet.entity.IcUserChangeRecordEntity; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcUserChangeRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; + /** * 居民变更记录表 * @@ -37,6 +54,9 @@ import org.springframework.util.CollectionUtils; */ @Service public class IcUserChangeRecordServiceImpl extends BaseServiceImpl implements IcUserChangeRecordService { + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + /** * @Author sun @@ -55,4 +75,47 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl categoryAnalysisList(IcUsercategoryAnalysisFormDTO formDTO) { + formDTO.setEndDate(formDTO.getDateId()); + String monthId = formDTO.getDateId().substring(NumConstant.ZERO, NumConstant.SIX); + formDTO.setStartDate(monthId.concat("01")); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.categoryAnalysisList(formDTO)); + List list = pageInfo.getList(); + if (!CollectionUtils.isEmpty(list)) { + //获取网格信息 + Set gridIds = list.stream().map(IcUsercategoryAnalysisResultDTO::getGridId).collect(Collectors.toSet()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(new ArrayList<>(gridIds)); + List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); + //获取楼栋信息 + Set buildingIds = list.stream().map(IcUsercategoryAnalysisResultDTO::getBuildingId).collect(Collectors.toSet()); + Result> buildRes = govOrgOpenFeignClient.buildingListByIds(new ArrayList<>(buildingIds)); + List buildInfoList = buildRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(buildRes.getData()) ? buildRes.getData() : new ArrayList<>(); + Map buildInfoMap = buildInfoList.stream().collect(Collectors.toMap(BuildingResultDTO::getBuildingId, Function.identity())); + list.forEach(resultDto -> { + //赋值小区名+楼栋名 + if (null != buildInfoMap && buildInfoMap.containsKey(resultDto.getBuildingId())) { + resultDto.setAddress(buildInfoMap.get(resultDto.getBuildingId()).getNeighborhoodName().concat(buildInfoMap.get(resultDto.getBuildingId()).getBuildingName())); + } else { + resultDto.setAddress(StrConstant.EPMETY_STR); + } + //赋值XXX-xxx网格名 + if (null != gridInfoMap && gridInfoMap.containsKey(resultDto.getGridId())) { + resultDto.setGridName(gridInfoMap.get(resultDto.getGridId()).getGridName()); + } else { + resultDto.setGridName(StrConstant.EPMETY_STR); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 7c606296e0..6ef762b208 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -26,4 +26,33 @@ ORDER BY change_time DESC, type ASC + + \ No newline at end of file From 6cfe2b37e87fe0df5aa61f71cbc6e30d088ede18 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Jan 2022 10:32:51 +0800 Subject: [PATCH 35/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E5=88=86=E6=9E=90-3=E4=B8=AA=E6=95=B0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIcuserCategoryAnalysisDailyDTO.java | 110 ++++++++++++++++++ .../epmetuser/form/IcUserCategoryFormDTO.java | 37 ++++++ .../result/IcUserCategoryResultDTO.java | 50 ++++++++ .../controller/IcUserController.java | 42 +++++++ .../dataaggre/dao/datastats/DataStatsDao.java | 10 +- .../dao/opercustomize/CustomerFootBarDao.java | 2 + .../service/datastats/DataStatsService.java | 5 + .../datastats/impl/DataStatsServiceImpl.java | 19 ++- .../service/epmetuser/EpmetUserService.java | 7 ++ .../epmetuser/impl/EpmetUserServiceImpl.java | 64 +++++++++- .../opercustomize/CustomerFootBarService.java | 9 ++ .../impl/CustomerFootBarServiceImpl.java | 14 ++- .../mapper/datastats/DatsStatsDao.xml | 36 ++++++ .../opercustomize/CustomerFootBarDao.xml | 15 +++ 14 files changed, 415 insertions(+), 5 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/FactIcuserCategoryAnalysisDailyDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcUserCategoryFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcUserCategoryResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/FactIcuserCategoryAnalysisDailyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/FactIcuserCategoryAnalysisDailyDTO.java new file mode 100644 index 0000000000..f88dfcd4db --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/FactIcuserCategoryAnalysisDailyDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dataaggre.dto.epmetuser; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 人员类别分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +public class FactIcuserCategoryAnalysisDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(人员类别分析表) + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 预警配置ID + */ + private String configId; + + /** + * 类别列名,对个数据太麻烦了,在这个表存一下 + */ + private String columnName; + + /** + * 当前数据是截止到XXX的:yyyyMMdd + */ + private String dateId; + + /** + * 网格id或者组织id + */ + private String orgId; + + /** + * grid或者agency + */ + private String orgType; + + /** + * orgid的上级 + */ + private String pid; + + /** + * orgid的所有上级 + */ + private String pids; + + /** + * 当前类别总人数 + */ + private Integer total; + + /** + * 较上月迁出 + */ + private Integer qcIncr; + + /** + * 较上月迁入 + */ + private Integer qrIncr; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcUserCategoryFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcUserCategoryFormDTO.java new file mode 100644 index 0000000000..a979ee68a6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcUserCategoryFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 人员类别分析 入参 + */ +@Data +public class IcUserCategoryFormDTO implements Serializable { + private static final long serialVersionUID = 2834180692632036316L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "请选择查看某个组织或网格", groups = AddUserShowGroup.class) + private String orgId; + + @NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class) + private String orgType; + + @NotBlank(message = "dateId不能为空", groups = AddUserInternalGroup.class) + @Length(min = 8, max = 8, message = "dateId格式:yyyyMMdd", groups = AddUserInternalGroup.class) + private String dateId; + + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcUserCategoryResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcUserCategoryResultDTO.java new file mode 100644 index 0000000000..08d4d30b7b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcUserCategoryResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +/** + * 人员类别分析-返参DTO + */ +@Data +public class IcUserCategoryResultDTO implements Serializable { + private static final long serialVersionUID = -2150403803220667018L; + + /** + * 居民类别配置主键 + */ + // @JsonIgnore + private String configId; + /** + * 当前类别对应的列名 + */ + private String categoryKey; + /** + * 类别名称 + */ + private String categoryName; + /** + * 类别图标 + */ + private String dataIcon; + + + + /** + * 当前类别下总人数 + */ + private Integer total=0; + + /** + * 桥上月迁入 + */ + private Integer immigration=0; + + /** + * 较上月迁出 + */ + private Integer emigration=0; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java new file mode 100644 index 0000000000..15c0473ba0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java @@ -0,0 +1,42 @@ +package com.epmet.dataaggre.controller; + + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.epmetuser.form.IcUserCategoryFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; +import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("icuser") +public class IcUserController { + + @Autowired + private EpmetUserService epmetUserService; + + + /** + * 【人员类别分析】-各类别人数 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("category-data") + public Result> queryIcUserCategoryData(@LoginUser TokenDto tokenDto, @RequestBody IcUserCategoryFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, IcUserCategoryFormDTO.AddUserShowGroup.class, IcUserCategoryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(epmetUserService.queryIcUserCategoryData(formDTO)); + } + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 237432f5c2..309d5432d9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -22,10 +22,10 @@ import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO; import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; @@ -349,4 +349,12 @@ public interface DataStatsDao { * @author sun */ List getProjectMonthIncr(ProjectTotalFormDTO formDTO); + + List queryGridIcUserCategoryData(@Param("orgId") String orgId, + @Param("dateId") String dateId, + @Param("configIds") List configIds); + + List queryAgencyIcUserCategoryData(@Param("gridPids") String gridPids, + @Param("dateId") String dateId, + @Param("configIds") List configIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java index 4d5ab737b5..674d6de835 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java @@ -20,6 +20,7 @@ package com.epmet.dataaggre.dao.opercustomize; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -59,4 +60,5 @@ public interface CustomerFootBarDao extends BaseDao { */ CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey); + List queryCustomerIcResiCategoryStatsConfig(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 3d21ac929d..23a33137ab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -3,6 +3,7 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.datastats.form.*; import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO; import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; @@ -279,4 +280,8 @@ public interface DataStatsService { String startDateID, String endDateID, Boolean needCount); + + List queryGridIcUserCategoryData(String orgId, String dateId, List configIds); + + List queryAgencyIcUserCategoryData(String gridPids, String dateId, List configIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index a8fb5ee168..79465829b7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -16,7 +16,8 @@ import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.datastats.form.*; import com.epmet.dataaggre.dto.datastats.result.*; -import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; + import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO; + import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; @@ -2170,4 +2171,20 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve PageHelper.startPage(pageNo, pageSize, needCount); return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID); } + + @Override + public List queryGridIcUserCategoryData(String orgId, String dateId, List configIds) { + if(CollectionUtils.isEmpty(configIds)||StringUtils.isBlank(orgId)){ + return new ArrayList<>(); + } + return dataStatsDao.queryGridIcUserCategoryData(orgId,dateId,configIds); + } + + @Override + public List queryAgencyIcUserCategoryData(String gridPids, String dateId, List configIds) { + if(CollectionUtils.isEmpty(configIds)||StringUtils.isBlank(gridPids)){ + return new ArrayList<>(); + } + return dataStatsDao.queryAgencyIcUserCategoryData(gridPids,dateId,configIds); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index a1509063c1..ed93a19d5a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -175,4 +175,11 @@ public interface EpmetUserService { * @return */ List listStaffsByIds(List userIdsPart); + + /** + * 【人员类别分析】-各类别人数 + * @param formDTO + * @return + */ + List queryIcUserCategoryData(IcUserCategoryFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 7f9809a052..c5da95a3fa 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -11,9 +11,11 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.BadgeConstant; +import com.epmet.constant.OrgInfoConstant; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.*; import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO; +import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO; import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO; import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO; import com.epmet.dataaggre.dto.epmetuser.form.*; @@ -30,18 +32,21 @@ import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO; import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; -import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity; +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govproject.GovProjectService; +import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.result.StaffRoleResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -84,6 +89,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private GovStaffRoleDao govStaffRoleDao; @Resource private IcResiUserDao icResiUserDao; + @Resource + private CustomerFootBarService customerFootBarService; /** * @Description 根据UserIds查询 @@ -742,4 +749,59 @@ public class EpmetUserServiceImpl implements EpmetUserService { return customerStaffDao.selectList(query); } + + /** + * 【人员类别分析】-各类别人数 + * + * @param formDTO + * @return + */ + @Override + public List queryIcUserCategoryData(IcUserCategoryFormDTO formDTO) { + // 1、 先查询出居民类别配置(状态为显示) + List resList=customerFootBarService.queryCustomerIcResiCategoryStatsConfig(formDTO.getCustomerId()); + if(CollectionUtils.isNotEmpty(resList)){ + //所有类别初始值为0 todo + List configIds=resList.stream().map(IcUserCategoryResultDTO::getConfigId).collect(Collectors.toList()); + if(OrgInfoConstant.GRID.equals(formDTO.getOrgType())){ + List list=dataStatsService.queryGridIcUserCategoryData(formDTO.getOrgId(),formDTO.getDateId(),configIds); + if(CollectionUtils.isNotEmpty(list)){ + Map configMap = list.stream().collect(Collectors.toMap(FactIcuserCategoryAnalysisDailyDTO::getConfigId, m -> m, (k1, k2) -> k1)); + resList.forEach(resDto->{ + if(MapUtils.isNotEmpty(configMap)&&configMap.containsKey(resDto.getConfigId())){ + FactIcuserCategoryAnalysisDailyDTO dailyDTO=configMap.get(resDto.getConfigId()); + resDto.setTotal(dailyDTO.getTotal()); + resDto.setImmigration(dailyDTO.getQrIncr()); + resDto.setEmigration(dailyDTO.getQcIncr()); + } + }); + } + }else if(OrgInfoConstant.AGENCY.equals(formDTO.getOrgType())){ + CustomerAgencyEntity agencyEntity=govOrgService.getAgencyInfo(formDTO.getOrgId()); + String gridPids=""; + if(NumConstant.ZERO_STR.equals(agencyEntity.getPid())){ + // 当前组织是根组织 + gridPids=formDTO.getOrgId(); + }else { + gridPids=agencyEntity.getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId()); + } + List list = dataStatsService.queryAgencyIcUserCategoryData(gridPids, formDTO.getDateId(), configIds); + if(CollectionUtils.isNotEmpty(list)){ + Map configMap = list.stream().collect(Collectors.toMap(FactIcuserCategoryAnalysisDailyDTO::getConfigId, m -> m, (k1, k2) -> k1)); + resList.forEach(resDto->{ + if(MapUtils.isNotEmpty(configMap)&&configMap.containsKey(resDto.getConfigId())){ + FactIcuserCategoryAnalysisDailyDTO dailyDTO=configMap.get(resDto.getConfigId()); + resDto.setTotal(dailyDTO.getTotal()); + resDto.setImmigration(dailyDTO.getQrIncr()); + resDto.setEmigration(dailyDTO.getQcIncr()); + } + }); + } + } + } + return resList; + } + + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java index 810122f74c..b4b996eb49 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java @@ -20,8 +20,11 @@ package com.epmet.dataaggre.service.opercustomize; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; +import java.util.List; + /** * APP底部菜单栏信息 * @@ -40,4 +43,10 @@ public interface CustomerFootBarService extends BaseService queryCustomerIcResiCategoryStatsConfig(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java index d301e23b16..a0fd9b7b5d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java @@ -27,7 +27,7 @@ import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao; import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; -import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO; import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; import com.epmet.dataaggre.service.opercrm.CustomerParameterService; @@ -39,7 +39,6 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.List; -import java.util.Set; /** @@ -114,4 +113,15 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl queryCustomerIcResiCategoryStatsConfig(String customerId) { + return baseDao.queryCustomerIcResiCategoryStatsConfig(customerId); + } + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 681c057922..fa315b0aa1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -1107,4 +1107,40 @@ ORDER BY month_id ASC + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml index 51340127fc..dc44858528 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml @@ -39,4 +39,19 @@ AND C.DISPLAY='1' + \ No newline at end of file From 943f3530c5b2ac9897064a5983383f337f2b87d4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Jan 2022 10:52:30 +0800 Subject: [PATCH 36/83] =?UTF-8?q?=E7=B1=BB=E5=88=AB=E5=88=86=E6=9E=90?= =?UTF-8?q?=EF=BC=8C=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmetuser/impl/EpmetUserServiceImpl.java | 1 - .../feign/DataStatisticalOpenFeignClient.java | 8 ++--- ...ataStatisticalOpenFeignClientFallBack.java | 10 +++--- .../task/IcUserCategoryAnalysisTask.java | 34 +++++++++++++++++++ 4 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IcUserCategoryAnalysisTask.java diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index c5da95a3fa..19bebf11f1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -761,7 +761,6 @@ public class EpmetUserServiceImpl implements EpmetUserService { // 1、 先查询出居民类别配置(状态为显示) List resList=customerFootBarService.queryCustomerIcResiCategoryStatsConfig(formDTO.getCustomerId()); if(CollectionUtils.isNotEmpty(resList)){ - //所有类别初始值为0 todo List configIds=resList.stream().map(IcUserCategoryResultDTO::getConfigId).collect(Collectors.toList()); if(OrgInfoConstant.GRID.equals(formDTO.getOrgType())){ List list=dataStatsService.queryGridIcUserCategoryData(formDTO.getOrgId(),formDTO.getDateId(),configIds); diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index dab2edf301..c1c77c88ec 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.basereport.result.EventInfoResultDTO; -import com.epmet.dto.extract.form.BizDataFormDTO; -import com.epmet.dto.extract.form.ExtractIndexFormDTO; -import com.epmet.dto.extract.form.ExtractOriginFormDTO; -import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; @@ -353,4 +350,7 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping("/data/stats/demand/volunteer/daily") Result statsVolunteerDemandServicesDaily(@RequestParam(value = "customer-id", required = false) String customerId); + + @PostMapping("/data/stats/ic/user/category-analysis-daily") + Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 56fea9c03f..302124c871 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -6,10 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.basereport.result.EventInfoResultDTO; -import com.epmet.dto.extract.form.BizDataFormDTO; -import com.epmet.dto.extract.form.ExtractIndexFormDTO; -import com.epmet.dto.extract.form.ExtractOriginFormDTO; -import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; @@ -339,4 +336,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result statsVolunteerDemandServicesDaily(String customerId) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statsVolunteerDemandServicesDaily", customerId); } + + @Override + public Result statUserCategoryDaily(IcUserCategoryAnalysisDailyFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statUserCategoryDaily", formDTO); + } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IcUserCategoryAnalysisTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IcUserCategoryAnalysisTask.java new file mode 100644 index 0000000000..c0c5b8ee9b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IcUserCategoryAnalysisTask.java @@ -0,0 +1,34 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.IcUserCategoryAnalysisDailyFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + +@Slf4j +@Component("icUserCategoryAnalysisTask") +public class IcUserCategoryAnalysisTask implements ITask { + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public void run(String params) { + log.info("icUserCategoryAnalysisTask定时任务正在执行,参数为:{}", params); + IcUserCategoryAnalysisDailyFormDTO formDTO = new IcUserCategoryAnalysisDailyFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, IcUserCategoryAnalysisDailyFormDTO.class); + } + Result result = dataStatisticalOpenFeignClient.statUserCategoryDaily(formDTO); + if (result.success()) { + log.info("icUserCategoryAnalysisTask定时任务正在执行定时任务执行成功"); + } else { + log.warn("icUserCategoryAnalysisTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} From ecd1b062b6a5ae8d2540d1ff2f0966b23f2a3d23 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 19 Jan 2022 12:56:34 +0800 Subject: [PATCH 37/83] =?UTF-8?q?fix:=20=E7=A4=BE=E5=8C=BA=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=87=B4=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/HouseServiceImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 90a46acfc0..6614f9aad3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -31,10 +31,7 @@ import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; import com.epmet.excel.IcHouseExcel; import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.service.HouseService; -import com.epmet.service.IcBuildingService; -import com.epmet.service.IcBuildingUnitService; -import com.epmet.service.IcHouseService; +import com.epmet.service.*; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -69,6 +66,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { private IcHouseDao icHouseDao; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private AgencyService agencyservice; + @Override @Transactional(rollbackFor = Exception.class) @@ -230,11 +230,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); // 查询pids - CustomerAgencyDTO agency = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(ancestorAgencyId), ServiceConstant.GOV_ORG_SERVER, - EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败", null); + CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId); if (agency == null) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); } String pids; From d563ac9e319f9ce20b170f750cc35183fc4b718b Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 19 Jan 2022 13:35:06 +0800 Subject: [PATCH 38/83] fix --- .../epmet/service/impl/HouseServiceImpl.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index f1307a997d..4c809cb812 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.service.IcHouseService; import com.epmet.service.*; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -238,18 +239,20 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); // 查询pids - CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId); + String pids = null; + if (StringUtils.isNotBlank(ancestorAgencyId)) { + CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId); - if (agency == null) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); - } + if (agency == null) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); + } - String pids; - if(NumConstant.ZERO_STR.equals(agency.getPid())){ - pids = ancestorAgencyId; - }else{ - pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId); + if (NumConstant.ZERO_STR.equals(agency.getPid())) { + pids = ancestorAgencyId; + } else { + pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId); + } } IPage page = new Page(pageNo,pageSize); From f339dd6bd955710a8e8232315b63013d1b9d421c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Jan 2022 13:57:22 +0800 Subject: [PATCH 39/83] type --- .../src/main/resources/mapper/IcUserChangeRecordDao.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 6ef762b208..8dc8770dcb 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -43,6 +43,9 @@ on(d.IC_USER_CHANGE_RECORD_ID=r.id and r.DEL_FLAG='0') where d.DEL_FLAG='0' and d.FIELD_NAME=#{categoryKey} + + and d.type=#{type} + and (d.AGENCY_ID=#{orgId} or d.pids like concat('%',#{orgId},'%')) From e40b0ca92caaa56d5c1e28e167c78ab04183a85f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 19 Jan 2022 14:52:32 +0800 Subject: [PATCH 40/83] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E5=92=8C=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E6=98=8E=E7=BB=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcUserChangeRecordInitFormDTO.java | 20 +++ .../IcUserChangeRecordController.java | 13 ++ .../java/com/epmet/dao/IcResiUserDao.java | 4 + .../epmet/dao/IcUserChangeDetailedDao.java | 8 +- .../com/epmet/dao/IcUserChangeRecordDao.java | 6 + .../service/IcUserChangeDetailedService.java | 5 + .../service/IcUserChangeRecordService.java | 9 ++ .../impl/IcUserChangeDetailedServiceImpl.java | 9 +- .../impl/IcUserChangeRecordServiceImpl.java | 142 +++++++++++++++++- .../main/resources/mapper/IcResiUserDao.xml | 45 ++++++ .../mapper/IcUserChangeDetailedDao.xml | 8 + .../mapper/IcUserChangeRecordDao.xml | 10 ++ 12 files changed, 273 insertions(+), 6 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java new file mode 100644 index 0000000000..0e7a105fe1 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【基础信息】变更记录 + * @Author sun + */ +@Data +public class IcUserChangeRecordInitFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 客户Id + */ + private String customerId; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java index 5ab2dae1eb..7e77f5b6ab 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; import com.epmet.dto.form.IcResiUserTransferFormDTO; +import com.epmet.dto.form.IcUserChangeRecordInitFormDTO; import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; @@ -32,6 +33,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.text.ParseException; + /** * 居民变更记录表 @@ -67,4 +70,14 @@ public class IcUserChangeRecordController { ValidatorUtils.validateEntity(formDTO,IcUsercategoryAnalysisFormDTO.AddUserShowGroup.class,IcUsercategoryAnalysisFormDTO.AddUserInternalGroup.class); return new Result>().ok(icUserChangeRecordService.categoryAnalysisList(formDTO)); } + /** + * @Author sun + * @Description 历史居民数据生成变更记录和变更明细数据 + **/ + @PostMapping("icuserchangerecordinit") + public Result icUserChangeRecordInit(@RequestBody IcUserChangeRecordInitFormDTO formDTO) throws ParseException { + icUserChangeRecordService.icUserChangeRecordInit(formDTO); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index bc292276a2..2419e678f6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -233,4 +233,8 @@ public interface IcResiUserDao extends BaseDao { Map getCategoryListMap(@Param("icUserId") String icUserId); List> selectResiUsers(@Param("types")List types,@Param("orgId")String orgId); + + List icUserCustomerIds(); + + List> getIcUserList(@Param("customerId") String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java index 6ba4093056..b78f1077e2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.IcUserChangeDetailedEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 变更明细表 @@ -30,5 +31,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcUserChangeDetailedDao extends BaseDao { - + + /** + * @Author sun + * @Description 删除客户是新增类型的变更明细历史数据 + **/ + void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java index 0e82f9564e..9e9b0b06af 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java @@ -43,4 +43,10 @@ public interface IcUserChangeRecordDao extends BaseDao List getList(@Param("icUserId") String icUserId); List categoryAnalysisList(IcUsercategoryAnalysisFormDTO formDTO); + + /** + * @Author sun + * @Description 删除客户是新增类型的变更历史数据 + **/ + void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java index 859a324c82..04f01d63a1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java @@ -29,4 +29,9 @@ import com.epmet.entity.IcUserChangeDetailedEntity; */ public interface IcUserChangeDetailedService extends BaseService { + /** + * @Author sun + * @Description 删除客户是新增类型的变更明细历史数据 + **/ + void delByCustomerId(String customerId, String type); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java index 252c5abd94..a75d3a1fe1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java @@ -20,11 +20,14 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.form.IcUserChangeRecordInitFormDTO; import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; import com.epmet.entity.IcUserChangeRecordEntity; +import java.text.ParseException; + /** * 居民变更记录表 * @@ -45,4 +48,10 @@ public interface IcUserChangeRecordService extends BaseService categoryAnalysisList(IcUsercategoryAnalysisFormDTO formDTO); + + /** + * @Author sun + * @Description 历史居民数据生成变更记录和变更明细数据 + **/ + void icUserChangeRecordInit(IcUserChangeRecordInitFormDTO formDTO) throws ParseException; } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java index 6bff100276..c6ffcb3c14 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java @@ -33,5 +33,12 @@ import org.springframework.stereotype.Service; @Service public class IcUserChangeDetailedServiceImpl extends BaseServiceImpl implements IcUserChangeDetailedService { - + /** + * @Author sun + * @Description 删除客户是新增类型的变更明细历史数据 + **/ + @Override + public void delByCustomerId(String customerId, String type) { + baseDao.delByCustomerId(customerId, type); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 9f764e9c05..7a882e807e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -20,29 +20,39 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcResiUserDao; import com.epmet.dao.IcUserChangeRecordDao; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcUserChangeRecordDTO; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.form.IcUserChangeRecordInitFormDTO; import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; +import com.epmet.entity.IcUserChangeDetailedEntity; import com.epmet.entity.IcUserChangeRecordEntity; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcUserChangeDetailedService; import com.epmet.service.IcUserChangeRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -53,9 +63,18 @@ import java.util.stream.Collectors; * @since v1.0.0 2022-01-14 */ @Service +@Slf4j public class IcUserChangeRecordServiceImpl extends BaseServiceImpl implements IcUserChangeRecordService { @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiUserDao icResiUserDao; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private IcUserChangeRecordService icUserChangeRecordService; + @Autowired + private IcUserChangeDetailedService icUserChangeDetailedService; /** @@ -118,4 +137,119 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + /** + * @Author sun + * @Description 历史居民数据生成变更记录和变更明细数据 + **/ + @Override + public void icUserChangeRecordInit(IcUserChangeRecordInitFormDTO formDTO) throws ParseException { + //1.有客户id按客户执行,没有的按ic_resi_user表有效客户执行 + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + initIcUserChange(formDTO.getCustomerId()); + } else { + List customerIdList = icResiUserDao.icUserCustomerIds(); + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + initIcUserChange(customerId); + } catch (Exception e) { + log.error("初始客户居民变更记录数据失败,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } + + /** + * @Author sun + * @Description 按客户初始化客户下居民的变更记录、变更明细数据 + **/ + @Transactional(rollbackFor = Exception.class) + public void initIcUserChange(String customerId) throws ParseException { + log.info("开始初始客户下居民的变更记录和变更明细数据,客户Id->"+customerId); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + //1.获取客户居民类别预警配置表数据 + Result> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(customerId); + if (!resultList.success()) { + throw new RuntimeException("居民信息修改,获取客户居民类别预警配置表数据失败"); + } + List changeList = new ArrayList<>(); + IcUserChangeRecordEntity change = null; + List detailedList = new ArrayList<>(); + IcUserChangeDetailedEntity detailed = null; + //存放工作人员姓名 + Map hash = new HashMap<>(); + //2.分批处理客户下居民数据 + int pageNo = NumConstant.ONE; + List> icUserList = new ArrayList<>(); + do { + //一千条一循环查询客户下居民数据 + PageHelper.startPage(pageNo, NumConstant.ONE_THOUSAND); + icUserList = icResiUserDao.getIcUserList(customerId); + pageNo++; + + //3.遍历封装数据 + for (Map map : icUserList){ + //存放一个人的类别为是的变更明细数据 + List subList = new ArrayList<>(); + String changeId = UUID.randomUUID().toString().replaceAll("-", ""); + for (IcResiCategoryWarnConfigDTO dto : resultList.getData()){ + if(map.containsKey(dto.getColumnName())&&"1".equals(map.get(dto.getColumnName()))){ + detailed = new IcUserChangeDetailedEntity(); + detailed.setCustomerId(customerId); + detailed.setIcUserChangeRecordId(changeId); + detailed.setPids(map.get("PIDS")); + detailed.setAgencyId(map.get("AGENCY_ID")); + detailed.setGridId(map.get("GRID_ID")); + detailed.setNeighborHoodId(map.get("VILLAGE_ID")); + detailed.setBuildingId(map.get("BUILD_ID")); + detailed.setBuildingUnitId(map.get("UNIT_ID")); + detailed.setHouseId(map.get("HOME_ID")); + detailed.setIcUserId(map.get("HOME_ID")); + detailed.setType("add"); + detailed.setTypeName("新增"); + detailed.setFieldName(dto.getColumnName()); + detailed.setValue(1); + detailed.setCreatedBy(map.get("CREATED_BY")); + detailed.setCreatedTime(sdf.parse(map.get("CREATED_TIME"))); + detailed.setUpdatedBy("APP_USER"); + detailed.setUpdatedTime(new Date()); + subList.add(detailed); + } + } + if (subList.size() > NumConstant.ZERO) { + detailedList.addAll(subList); + if (!hash.containsKey(map.get("CREATED_BY"))) { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, map.get("CREATED_BY")); + //被删除或被移除的工作人员,名字为空 + hash.put(map.get("CREATED_BY"), null != staffInfoCache ? staffInfoCache.getRealName() : ""); + } + change = new IcUserChangeRecordEntity(); + change.setId(changeId); + change.setCustomerId(customerId); + change.setOperatorId(map.get("CREATED_BY")); + change.setIcUserId(map.get("ID")); + change.setOperatorName(hash.get(map.get("CREATED_BY"))); + change.setIcUserName(map.get("NAME")); + change.setType("add"); + change.setTypeName("新增"); + change.setBeforeChangeName("-"); + change.setAfterChangeName("-"); + change.setChangeTime(sdf.parse(map.get("CREATED_TIME"))); + change.setCreatedBy(map.get("CREATED_BY")); + change.setCreatedTime(sdf.parse(map.get("CREATED_TIME"))); + change.setUpdatedBy("APP_USER"); + change.setUpdatedTime(new Date()); + changeList.add(change); + } + } + } while (icUserList.size() == NumConstant.ONE_THOUSAND); + //4.批量新增数据,先删后增【只删除新增节点的历史数据】 + baseDao.delByCustomerId(customerId, "add"); + icUserChangeDetailedService.delByCustomerId(customerId, "add"); + icUserChangeRecordService.insertBatch(changeList); + icUserChangeDetailedService.insertBatch(detailedList); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index dbba0456fc..1e91222ee2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -560,4 +560,49 @@ ORDER BY CREATED_TIME DESC + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml index acb4aa197b..24fe11c678 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml @@ -3,5 +3,13 @@ + + DELETE + FROM + ic_user_change_detailed + WHERE + CUSTOMER_ID = #{customerId} + AND type = #{type} + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 8dc8770dcb..80bd84eccb 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -58,4 +58,14 @@ order by d.CREATED_TIME asc,d.id asc + + + DELETE + FROM + ic_user_change_record + WHERE + CUSTOMER_ID = #{customerId} + AND type = #{type} + + \ No newline at end of file From 55df17060c65e4ff36389e3fd036abcc92ce599f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 19 Jan 2022 15:10:14 +0800 Subject: [PATCH 41/83] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=B1=85=E6=B0=91=E5=AF=BC=E5=85=A5=EF=BC=8C=E4=B8=BB?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E7=B1=BB=E5=88=AB=E5=8F=98=E6=9B=B4=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ResiCategoryItemResultDTO.java | 17 ++ .../feign/OperCustomizeOpenFeignClient.java | 7 + .../OperCustomizeOpenFeignClientFallback.java | 5 + .../controller/IcFormItemController.java | 17 +- .../com/epmet/service/IcFormItemService.java | 12 +- .../service/impl/IcFormItemServiceImpl.java | 32 ++- .../epmet/bean/ResiImportCategoryData.java | 51 ++++ .../com/epmet/bean/ResiImportChangedData.java | 20 ++ .../ResiImportResiCategoryChangedCache.java | 30 +++ .../java/com/epmet/dao/IcResiUserDao.java | 2 + .../impl/IcResiUserImportServiceImpl.java | 239 ++++++++++++++++-- .../main/resources/mapper/IcResiUserDao.xml | 10 + 12 files changed, 408 insertions(+), 34 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java new file mode 100644 index 0000000000..8ab985676e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @ClassName ResiCategoryItemResultDTO + * @Description 居民类别item查询结果 + * @Author wangxianzhang + * @Date 2022/1/18 4:43 下午 + */ +@Data +public class ResiCategoryItemResultDTO { + + private String columnName; + private String label; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 8cdf6e39de..0ccbfa1655 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -145,4 +145,11 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/icresicategorywarnconfig/categorywarnconfiglist/{customerId}") Result> categoryWarnConfigList(@PathVariable String customerId); + /** + * 查询客户下的居民类别item列表 + * @param customerId + * @return + */ + @PostMapping("/oper/customize/icformitem/resi-category-items/list") + Result> listResiCategoryItems(@RequestParam("customer-id") String customerId); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index fde2def25e..9dec3f4afe 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -119,4 +119,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> categoryWarnConfigList(String customerId) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "categoryWarnConfigList", customerId); } + + @Override + public Result> listResiCategoryItems(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listResiCategoryItems", customerId); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java index 1cfe0d4276..f38a16f323 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java @@ -19,12 +19,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.ResiCategoryItemResultDTO; import com.epmet.service.IcFormItemService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -51,4 +49,15 @@ public class IcFormItemController { return new Result>().ok(icFormItemService.getMustColumn(customerId)); } + /** + * 查询客户下的居民类别item列表 + * @param customerId + * @return + */ + @PostMapping("resi-category-items/list") + public Result> listResiCategoryItems(@RequestParam("customer-id") String customerId) { + List r = icFormItemService.listResiCategoryItems(customerId); + return new Result().ok(r); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java index 575e31d6b1..f9eb17f8e3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -19,10 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.form.CustomerFormQueryDTO; -import com.epmet.dto.result.ColumnTableNameResultDTO; -import com.epmet.dto.result.ConditionResultDTO; -import com.epmet.dto.result.IcFormResColumnDTO; -import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcFormItemEntity; import java.util.List; @@ -58,4 +55,11 @@ public interface IcFormItemService extends BaseService { * @Description 居民信息新增查询各表必填字段 **/ List getMustColumn(String customerId); + + /** + * 查询 + * @param customerId + * @return + */ + List listResiCategoryItems(String customerId); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java index 00c79db52c..697aaca89e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -27,10 +28,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcFormItemDao; import com.epmet.dto.IcFormItemDTO; import com.epmet.dto.form.CustomerFormQueryDTO; -import com.epmet.dto.result.ColumnTableNameResultDTO; -import com.epmet.dto.result.ConditionResultDTO; -import com.epmet.dto.result.IcFormResColumnDTO; -import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcFormItemEntity; import com.epmet.service.IcFormItemService; import org.apache.commons.lang3.StringUtils; @@ -39,6 +37,8 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 表单项 @@ -118,4 +118,28 @@ public class IcFormItemServiceImpl extends BaseServiceImpl listResiCategoryItems(String customerId) { + + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcFormItemEntity::getCustomerId, customerId); + query.eq(IcFormItemEntity::getDataAnalyse, 1); + + List categoryItems = baseDao.selectList(query); + + // 如果该客户没配置,那么使用默认配置 + if (CollectionUtils.isEmpty(categoryItems)) { + LambdaQueryWrapper query1 = new LambdaQueryWrapper<>(); + query1.eq(IcFormItemEntity::getDataAnalyse, 1); + query1.eq(IcFormItemEntity::getCustomerId, "default"); + categoryItems = baseDao.selectList(query1); + } + + return categoryItems.stream().map((e) -> { + ResiCategoryItemResultDTO d = new ResiCategoryItemResultDTO(); + d.setColumnName(e.getColumnName()); + d.setLabel(e.getLabel()); + return d; + }).collect(Collectors.toList()); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java new file mode 100644 index 0000000000..436be52b29 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java @@ -0,0 +1,51 @@ +package com.epmet.bean; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * @ClassName ResiImportTransferOldDim + * @Description TODO + * @Author wangxianzhang + * @Date 2022/1/18 5:53 下午 + */ +@Data +public class ResiImportCategoryData { + + private String agencyId; + private String gridId; + private String villageId; + private String buildId; + private String unitId; + private String homeId; + + /** + * key:居民类别在ic_resi_user表中的列名 + * value:居民类别的值。0:否,1:是 + */ + private Map categories = new HashMap<>(); + + public ResiImportCategoryData() { + } + + public ResiImportCategoryData(String agencyId, String gridId, String villageId, String buildId, String unitId, String homeId, Map categories) { + this.agencyId = agencyId; + this.gridId = gridId; + this.villageId = villageId; + this.buildId = buildId; + this.unitId = unitId; + this.homeId = homeId; + this.categories = categories; + } + + public ResiImportCategoryData(String agencyId, String gridId, String villageId, String buildId, String unitId, String homeId) { + this.agencyId = agencyId; + this.gridId = gridId; + this.villageId = villageId; + this.buildId = buildId; + this.unitId = unitId; + this.homeId = homeId; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java new file mode 100644 index 0000000000..ff74a880a0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java @@ -0,0 +1,20 @@ +package com.epmet.bean; + +import lombok.Data; + +/** + * @ClassName ResiImportTransferCache + * @Description TODO + * @Author wangxianzhang + * @Date 2022/1/18 5:51 下午 + */ +@Data +public class ResiImportChangedData { + private ResiImportCategoryData oldData = new ResiImportCategoryData(); + private ResiImportCategoryData newData = new ResiImportCategoryData(); + + public ResiImportChangedData(ResiImportCategoryData oldData, ResiImportCategoryData newData) { + this.oldData = oldData; + this.newData = newData; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java new file mode 100644 index 0000000000..6203c917a9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java @@ -0,0 +1,30 @@ +package com.epmet.bean; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * 导入操作中,居民信息操作的分类bean + */ +@Data +public class ResiImportResiCategoryChangedCache { + + /** + * 新增居民 + * Map> + */ + private Map newResis = new HashMap<>(); + + /** + * 调动的居民 + */ + private Map transferedResis = new HashMap<>(); + + /** + * 类别变更的居民 + */ + private Map categoryChangedResis = new HashMap<>(); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index bc292276a2..482a2f4cc1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -232,5 +232,7 @@ public interface IcResiUserDao extends BaseDao { Map getCategoryListMap(@Param("icUserId") String icUserId); + Map selectResiInfoMap(@Param("idCard") String idCard); + List> selectResiUsers(@Param("types")List types,@Param("orgId")String orgId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 0b554c980e..43e3263c94 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -6,6 +6,9 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcelFactory; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.bean.ResiImportCategoryData; +import com.epmet.bean.ResiImportResiCategoryChangedCache; +import com.epmet.bean.ResiImportChangedData; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; @@ -22,12 +25,14 @@ import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.FormItemResult; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.OptionDTO; +import com.epmet.dto.result.ResiCategoryItemResultDTO; import com.epmet.entity.IcResiUserEntity; import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.handler.DynamicEasyExcelListener; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.IcResiUserImportService; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; @@ -61,6 +66,16 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res public static final ThreadLocal>> errorRows = new ThreadLocal<>(); public static final ThreadLocal>> skipedRows = new ThreadLocal<>(); + /** + * 类别发生变更的居民 + */ + public static final ThreadLocal categoryChangedResi = new ThreadLocal<>(); + + /** + * 居民类别items列表 + */ + public static final ThreadLocal> resiCategoryItemsCache = new ThreadLocal<>(); + /** * key: itemId * value: @@ -85,6 +100,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res @Autowired private IcResiUserDao icResiUserDao; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + /** * @description 列信息封装 * @@ -168,6 +186,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res */ @Override public void importIcResiInfoFromExcel(List formItemList, String excelPathName, HttpServletResponse response) { + String loginUserId = loginUserUtil.getLoginUserId(); String loginUserApp = loginUserUtil.getLoginUserApp(); String loginUserClient = loginUserUtil.getLoginUserClient(); @@ -185,7 +204,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String customerId = agencyInfo.getCustomerId(); try { - initThreadLocalRowsStorage(); + initImportThreadLocal(customerId); // 上传主表信息 importIcResiBaseInfoFromExcel(formItemList,excelPathName, IcResiUserTableEnum.IC_RESI_USER.getSheetNo(), IcResiUserTableEnum.IC_RESI_USER.getHeadRowNo(), @@ -209,11 +228,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } } - //String errors = JSON.toJSONString(errorRows.get()); - //String skipeds = JSON.toJSONString(skipedRows.get()); - - //log.error(errors); - //log.error(skipeds); + // 执行人员类别变更记录 + Map newResis = categoryChangedResi.get().getNewResis(); + Map categoryChangedResis = categoryChangedResi.get().getCategoryChangedResis(); + Map transferedResis = categoryChangedResi.get().getTransferedResis(); try { downLoadResults(response); @@ -223,25 +241,42 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } finally { skipedRows.remove(); errorRows.remove(); + categoryChangedResi.remove(); + resiCategoryItemsCache.remove(); itemIdAndOptionsCache.invalidateAll(); } } /** - * 暂存rows信息初始化 + * threadLocal初始化 */ - private void initThreadLocalRowsStorage() { + private void initImportThreadLocal(String customerId) { + // 跳过的,不导入的行 Map> skipedRowsMap = new LinkedHashMap<>(); for (IcResiUserTableEnum e : IcResiUserTableEnum.values()) { skipedRowsMap.put(e.getTableName(), new LinkedList<>()); } skipedRows.set(skipedRowsMap); + // 错误信息 Map> errorRowsMap = new LinkedHashMap<>(); for (IcResiUserTableEnum e : IcResiUserTableEnum.values()) { errorRowsMap.put(e.getTableName(), new LinkedList<>()); } errorRows.set(errorRowsMap); + + // 居民类别信息 + ResiImportResiCategoryChangedCache c = new ResiImportResiCategoryChangedCache(); + categoryChangedResi.set(c); + + List resiCategoryItems = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listResiCategoryItems(customerId), + ServiceConstant.OPER_CUSTOMIZE_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + String.format("【居民信息导入】查询居民类别items失败,customerId:%s", customerId), + "居民信息导入失败"); + + List l = resiCategoryItems.stream().map(ResiCategoryItemResultDTO::getColumnName).collect(Collectors.toList()); + resiCategoryItemsCache.set(l); } /** @@ -374,26 +409,45 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String idCard = columnAndValues.get("ID_CARD"); LambdaQueryWrapper idCardQuery = new LambdaQueryWrapper<>(); idCardQuery.eq(IcResiUserEntity::getIdCard, idCard); - IcResiUserEntity resiBaseInfo = icResiUserDao.selectOne(idCardQuery); + //IcResiUserEntity resiBaseInfo = icResiUserDao.selectOne(idCardQuery); + + Map existingResiMap = icResiUserDao.selectResiInfoMap(idCard); + + if (existingResiMap != null) { + // 修改居民信息 + icResiUserDao.upTable(tableName, existingResiMap.get("ID"), columnAndValues); - if (resiBaseInfo != null) { - icResiUserDao.upTable(tableName, resiBaseInfo.getId(), columnAndValues); + // 任意组织维度一个发生变化,则放到调动居民缓存中 + ResiImportChangedData transferData; + if ((transferData = this.getResiImportTrasferData(existingResiMap, columnAndValues)) != null) { + categoryChangedResi.get().getTransferedResis().put(existingResiMap.get("ID"), transferData); + } else { + // 组织维度没有发生变化,看是否有居民类型变更 + ResiImportChangedData d = getResiImportCategoryChangedData(existingResiMap, columnAndValues); + if (d != null) { + categoryChangedResi.get().getCategoryChangedResis().put(existingResiMap.get("ID"), d); + } + } } else { + // 新增居民 columnAndValues.put("CREATED_BY", currentUserId); columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); icResiUserDao.add(tableName, columnAndValues); - } - //if (icResiUserDao.selectCount(idCardQuery) > 0) { - // //log.info("身份证号为【{}】的居民信息已存在,跳过导入", idCard); - // SkipedRow skipedRow = new SkipedRow(); - // skipedRow.setName(columnAndValues.get("NAME")); - // skipedRow.setIdCard(idCard); - // skipedRow.setInfo("身份证号已存在,跳过导入"); - // skipedRow.setTableName(tableName); - // skipedRows.get().get(IcResiUserTableEnums.IC_RESI_USER.getTableName()).add(skipedRow); - // continue; - //} + Map categories = resiCategoryItemsCache.get() + .stream() + .filter((categoryColumnName) -> "1".equals(columnAndValues.get(categoryColumnName))) + .collect(Collectors.toMap((k) -> k, (k) -> columnAndValues.get(k))); + + categoryChangedResi.get().getNewResis().put(columnAndValues.get("ID"), + new ResiImportCategoryData(columnAndValues.get("AGENCY_ID"), + columnAndValues.get("GRID_ID"), + columnAndValues.get("VILLAGE_ID"), + columnAndValues.get("BUILD_ID"), + columnAndValues.get("UNIT_ID"), + columnAndValues.get("HOME_ID"), + categories)); + } } catch (Exception e) { String errorMsg; @@ -950,4 +1004,145 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res workbook.write(response.getOutputStream()); } + + public ResiImportCategoryData generateResiImportChangeData(String agencyId, String gridId, String villageId, String buildId, String unitId, + String homeId , Map categories) { + ResiImportCategoryData ricd = new ResiImportCategoryData(); + ricd.setAgencyId(agencyId); + ricd.setBuildId(buildId); + ricd.setGridId(gridId); + ricd.setVillageId(villageId); + ricd.setUnitId(unitId); + ricd.setHomeId(homeId); + ricd.setCategories(categories); + return ricd; + } + + ///** + // * 判断是否有组织维度的变化 + // * @param existingResiMap + // * @param newResiMap + // * @return + // */ + //public boolean isOrgDimChanged(Map existingResiMap, Map newResiMap) { + // return !existingResiMap.get("AGENCY_ID").equals(newResiMap.get("AGENCY_ID")) + // || !existingResiMap.get("GRID_ID").equals(newResiMap.get("GRID_ID")) + // || !existingResiMap.get("VILLAGE_ID").equals(newResiMap.get("VILLAGE_ID")) + // || !existingResiMap.get("BUILD_ID").equals(newResiMap.get("BUILD_ID")) + // || !existingResiMap.get("UNIT_ID").equals(newResiMap.get("UNIT_ID")) + // || !existingResiMap.get("HOME_ID").equals(newResiMap.get("HOME_ID")) + //} + + /** + * 生成导入调动数据 + * @param existingResiMap + * @param newResiMap + * @return + */ + private ResiImportChangedData getResiImportTrasferData(Map existingResiMap, Map newResiMap) { + + // 维度未变化,则返回null + if (existingResiMap.get("AGENCY_ID").equals(newResiMap.get("AGENCY_ID")) + && existingResiMap.get("GRID_ID").equals(newResiMap.get("GRID_ID")) + && existingResiMap.get("VILLAGE_ID").equals(newResiMap.get("VILLAGE_ID")) + && existingResiMap.get("BUILD_ID").equals(newResiMap.get("BUILD_ID")) + && existingResiMap.get("UNIT_ID").equals(newResiMap.get("UNIT_ID")) + && existingResiMap.get("HOME_ID").equals(newResiMap.get("HOME_ID"))) { + + return null; + } + + HashMap existingResiCategories = new HashMap<>(); + HashMap newResiCategories = new HashMap<>(); + + for (String categoryColumnName : resiCategoryItemsCache.get()) { + String oldCategoryValue = existingResiMap.get(categoryColumnName); + String newCategoryValue = newResiMap.get(categoryColumnName); + + if (StringUtils.isNotBlank(oldCategoryValue) && "1".equals(oldCategoryValue)) { + existingResiCategories.put(categoryColumnName, oldCategoryValue); + } + + if (StringUtils.isNotBlank(newCategoryValue) && "1".equals(newCategoryValue)) { + newResiCategories.put(categoryColumnName, newResiMap.get(categoryColumnName)); + } + } + + ResiImportCategoryData oldOne = new ResiImportCategoryData( + existingResiMap.get("AGENCY_ID"), + existingResiMap.get("GRID_ID"), + existingResiMap.get("VILLAGE_ID"), + existingResiMap.get("BUILD_ID"), + existingResiMap.get("UNIT_ID"), + existingResiMap.get("HOME_ID"), + existingResiCategories); + + ResiImportCategoryData newOne = new ResiImportCategoryData(existingResiMap.get("AGENCY_ID"), + newResiMap.get("GRID_ID"), + newResiMap.get("VILLAGE_ID"), + newResiMap.get("BUILD_ID"), + newResiMap.get("UNIT_ID"), + newResiMap.get("HOME_ID"), + newResiCategories); + + return new ResiImportChangedData(oldOne, newOne); + } + + /** + * 类别变更的居民信息封装 + * @param existingResiMap + * @param newResiMap + * @return + */ + private ResiImportChangedData getResiImportCategoryChangedData(Map existingResiMap, Map newResiMap) { + // 发生变化的类别列明 + HashMap oldCategories = new HashMap<>(); + HashMap newCategories = new HashMap<>(); + + List categoryColumnNames = resiCategoryItemsCache.get(); + for (String categoryColumnName : categoryColumnNames) { + String existingColumnValue = existingResiMap.get(categoryColumnName); + String newColumnValue = newResiMap.get(categoryColumnName); + + if (StringUtils.isAllBlank(existingColumnValue, newColumnValue)) { + // 都为空,则没发生变化 + continue; + } else if (StringUtils.isNoneBlank(existingColumnValue, newColumnValue)) { + // 都不为空,则执行比较 + if (!existingColumnValue.equals(newColumnValue)) { + oldCategories.put(categoryColumnName, existingColumnValue); + newCategories.put(categoryColumnName, newColumnValue); + continue; + } + } else { + // 一个为空一个不为空,则发生变化 + oldCategories.put(categoryColumnName, existingColumnValue); + newCategories.put(categoryColumnName, newColumnValue); + } + + } + + if (oldCategories.size() == 0) { + return null; + } + + ResiImportCategoryData oldOne = new ResiImportCategoryData( + existingResiMap.get("AGENCY_ID"), + existingResiMap.get("GRID_ID"), + existingResiMap.get("VILLAGE_ID"), + existingResiMap.get("BUILD_ID"), + existingResiMap.get("UNIT_ID"), + existingResiMap.get("HOME_ID"), + oldCategories); + + ResiImportCategoryData newOne = new ResiImportCategoryData(existingResiMap.get("AGENCY_ID"), + newResiMap.get("GRID_ID"), + newResiMap.get("VILLAGE_ID"), + newResiMap.get("BUILD_ID"), + newResiMap.get("UNIT_ID"), + newResiMap.get("HOME_ID"), + newCategories); + + return new ResiImportChangedData(oldOne, newOne); + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index dbba0456fc..157471a680 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -560,4 +560,14 @@ ORDER BY CREATED_TIME DESC + + + From ba8461dd33889b2ac4b66bf6439938d9a2532170 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Jan 2022 15:48:41 +0800 Subject: [PATCH 42/83] =?UTF-8?q?-10=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/user/UserDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 11d9e4aaef..0c8a18627c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -1152,7 +1152,7 @@ and temp.result=1 - and temp.result !=1 + and temp.result = -1 group by temp.orgId,temp.FIELD_NAME From 4bda9cc7829baab33d7289f3c393ef735d90bab3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 20 Jan 2022 09:55:32 +0800 Subject: [PATCH 43/83] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E5=92=8C=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E6=98=8E=E7=BB=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcUserChangeRecordServiceImpl.java | 2 +- .../main/resources/mapper/IcResiUserDao.xml | 73 ++++++++++--------- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 7a882e807e..4241e3428b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -180,7 +180,7 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl hash = new HashMap<>(); - //2.分批处理客户下居民数据 + //2.分批处理客户下居民数据【只查询在变更记录表不存在新增节点的居民】 int pageNo = NumConstant.ONE; List> icUserList = new ArrayList<>(); do { diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 99031d8f5e..5ef3c54d15 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -576,43 +576,46 @@ From 1ac84de0ffb12c44b66bd42859bc4f90f5ae34a7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Jan 2022 10:30:56 +0800 Subject: [PATCH 44/83] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AAID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/IndividualCategoryListResultDTO.java | 2 ++ .../main/resources/mapper/IcIndividualCategoryManageDao.xml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java index 4089a151df..cbfc8b5718 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java @@ -33,4 +33,6 @@ public class IndividualCategoryListResultDTO implements Serializable { * 排序 */ private Integer sort; + + private String id; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml index 926e0a8baf..68036233b5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml @@ -14,7 +14,8 @@ cm.SORT, sc.LABEL, sc.MANAGEMENT_ICON, - sc.COLUMN_NAME + sc.COLUMN_NAME, + sc.id AS id FROM ic_individual_category_manage cm INNER JOIN ic_resi_category_stats_config sc ON (sc.ID = cm.COLUMN_ID AND sc.DEL_FLAG = '0' AND `STATUS` = 'show') WHERE cm.DEL_FLAG = 0 From 833521d1d4ff06c41bac3f185623f5e5cfb51c7d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 20 Jan 2022 10:32:04 +0800 Subject: [PATCH 45/83] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=81=94=E5=BB=BA?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E6=97=B6=EF=BC=8C=E6=9C=8D=E5=8A=A1=E4=BA=8B?= =?UTF-8?q?=E9=A1=B9=E5=88=97=E8=A1=A8=EF=BC=8C=E6=8E=A5=E5=8F=A3=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=EF=BC=9A/api/heart/serviceitem/dict-list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IcServiceItemDictController.java | 14 +++++++++++ .../service/IcServiceItemDictService.java | 10 ++++++++ .../impl/IcServiceItemDictServiceImpl.java | 25 +++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java index d2f9f6d412..d6234d4a2c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; import com.epmet.service.IcServiceItemDictService; import org.springframework.beans.factory.annotation.Autowired; @@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 服务事项分类字典表 * @@ -68,4 +71,15 @@ public class IcServiceItemDictController { icServiceItemDictService.updateStatus(formDTO); return new Result(); } + + /** + * 新增联建单位,查询服务事项列表 + * + * @param tokenDto + * @return + */ + @PostMapping("dict-list") + public Result> queryDictList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icServiceItemDictService.queryDictList(tokenDto.getCustomerId())); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java index a93e50aaff..fc671c3cdc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java @@ -22,9 +22,12 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; import com.epmet.entity.IcServiceItemDictEntity; +import java.util.List; + /** * 服务事项分类字典表 * @@ -52,4 +55,11 @@ public interface IcServiceItemDictService extends BaseService queryDictList(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index 4235d282c5..1868076ade 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.dao.IcServiceItemDictDao; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; import com.epmet.entity.IcServiceItemDictEntity; import com.epmet.service.IcServiceItemDictService; @@ -37,6 +38,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -122,5 +124,28 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl queryDictList(String customerId) { + List resultList=new ArrayList<>(); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcServiceItemDictEntity::getCustomerId, customerId) + .orderByAsc(IcServiceItemDictEntity::getSort); + List list=baseDao.selectList(query); + for(IcServiceItemDictEntity entity:list){ + OptionDTO optionDTO=new OptionDTO(); + optionDTO.setLabel(entity.getCategoryName()); + optionDTO.setValue(entity.getCategoryCode()); + optionDTO.setAwardPoint(entity.getAwardPoint()); + resultList.add(optionDTO); + } + return resultList; + } + } \ No newline at end of file From f9c71352f288d0634d1788176aa866a14dcaa1bc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 20 Jan 2022 11:05:04 +0800 Subject: [PATCH 46/83] =?UTF-8?q?=E8=81=94=E5=BB=BA=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E7=94=A8=E5=88=B0=E6=9C=8D=E5=8A=A1=E4=BA=8B=E9=A1=B9=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9=EF=BC=8C=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2ic=5Fservice=5Fitem=5Fdict?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/ActConstant.java | 5 --- .../service/impl/ActInfoServiceImpl.java | 19 ++++----- .../impl/IcPartyActivityServiceImpl.java | 29 +++++--------- .../service/impl/IcPartyUnitServiceImpl.java | 26 ++++++------ .../service/impl/WorkActDraftServiceImpl.java | 13 ++---- .../service/impl/WorkActServiceImpl.java | 40 ++++++++----------- 6 files changed, 48 insertions(+), 84 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index ce1d187bf2..9855cee625 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -169,9 +169,4 @@ public interface ActConstant { * 活动类型-联建活动 */ String PARTY = "party"; - - /** - * 服务事项code - */ - String SERVICE_MATTER_CODE = "1010"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 983c4834a2..e595bdd0c6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -35,17 +35,14 @@ import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.HeartUserInfoDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.IcPartyUnitDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.resi.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActUserRelationEntity; -import com.epmet.service.ActInfoService; -import com.epmet.service.ActUserRelationService; -import com.epmet.service.IcPartyUnitService; -import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.*; import com.epmet.utils.CaculateDistance; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -77,9 +74,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -260,11 +257,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - detailResultDTO.setServiceMatterName(categoryMap.get(detailResultDTO.getServiceMatter())); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + detailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(detailResultDTO.getServiceMatter()) ? categoryMap.get(detailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(detailResultDTO.getUnitId())) { //获取单位名称 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 67391ef70c..cdfa84d5e2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -35,14 +35,13 @@ import com.epmet.dao.IcPartyActivityDao; import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.result.ActivityStatisticsDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyActivityEntity; import com.epmet.excel.IcPartyActivityImportExcel; import com.epmet.service.IcPartyActivityService; import com.epmet.service.IcPartyUnitService; -import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcServiceItemDictService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -71,11 +70,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyActivityFormDTO formDTO) { @@ -159,10 +155,9 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList=icServiceItemDictService.queryDictList(entity.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); //获取单位名称 @@ -225,10 +220,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取联建单位 IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); unitDTO.setAgencyId(staffInfoCache.getAgencyId()); @@ -369,10 +362,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取服务事项字典 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(tokenDto.getCustomerId()); - codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //数据组装 dtoList.forEach(dto -> { dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 3850acd354..383b5e58fa 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -45,7 +45,6 @@ import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceStatDTO; @@ -54,6 +53,7 @@ import com.epmet.excel.IcPartyUnitImportExcel; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPartyUnitService; import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcServiceItemDictService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -87,7 +87,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl search(PartyUnitFormDTO formDTO) { @@ -104,10 +105,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode("1010"); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 + List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(item -> { item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { @@ -138,10 +139,9 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode("1010"); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 + List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); dtoList.forEach(item -> { item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { @@ -312,10 +312,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //1.数据校验 Iterator iterator = result.iterator(); while (iterator.hasNext()) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index 6e2a67aa17..5572a48f48 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.LatestActInfoDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.work.ActPreviewFormDTO; import com.epmet.dto.form.work.DraftActContentFormDTO; import com.epmet.dto.form.work.DraftActInfoFormDTO; @@ -43,14 +42,10 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { @Autowired private LatestActContentService latestActContentService; @Resource - private IcResiDemandDictService icResiDemandDictService; + private IcServiceItemDictService icServiceItemDictService; @Resource private IcPartyUnitService icPartyUnitService; - /** - * 服务事项code - */ - private static final String SERVICE_MATTER_CODE = "1010"; /** * @return com.epmet.dto.form.work.PublishActInitResultDTO @@ -142,10 +137,8 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); actPreviewResultDTO.setServiceMatterName(categoryMap.get(actPreviewResultDTO.getServiceMatter())); } if (StringUtils.isNotBlank(actPreviewResultDTO.getUnitId())) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index e113d72019..7b076059b9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -25,7 +25,6 @@ import com.epmet.dto.*; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.WxSubscribeMessageFormDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.work.*; import com.epmet.dto.result.ActSponsorResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -34,6 +33,7 @@ import com.epmet.entity.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -99,10 +99,9 @@ public class WorkActServiceImpl implements WorkActService { @Resource private IcPartyActivityService icPartyActivityService; @Resource - private IcResiDemandDictService icResiDemandDictService; - @Resource private IcPartyUnitService icPartyUnitService; - + @Resource + private IcServiceItemDictService icServiceItemDictService; /** @@ -782,11 +781,10 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(customerId); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter())); + List serviceItemList = icServiceItemDictService.queryDictList(customerId); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + canceledActDetailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(canceledActDetailResultDTO.getServiceMatter()) ? + categoryMap.get(canceledActDetailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) { //获取单位名称 @@ -840,11 +838,9 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(resultDTO.getUnitId())) { //获取单位名称 @@ -921,11 +917,9 @@ public class WorkActServiceImpl implements WorkActService { } if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(customerId); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + List serviceItemList=icServiceItemDictService.queryDictList(customerId); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(resultDTO.getUnitId())) { //获取单位名称 @@ -1317,11 +1311,9 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(customerId); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + List serviceItemList=icServiceItemDictService.queryDictList(customerId); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(resultDTO.getUnitId())) { //获取单位名称 From 11162c3cd902aed6279722c299c188f5cbcb7c68 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 20 Jan 2022 14:10:33 +0800 Subject: [PATCH 47/83] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=BA=8B=E9=A1=B9?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D=E7=BD=AE=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E8=81=94=E5=BB=BA=E6=B4=BB=E5=8A=A8=EF=BC=88=E6=80=BB=E7=BB=93?= =?UTF-8?q?=EF=BC=89=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=96=B0=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=8F=91=E5=B8=83=E7=9A=84=E8=81=94=E5=BB=BA?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=94=B9=E4=B8=BA=E6=96=B0=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.10__update_service_item.sql | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql new file mode 100644 index 0000000000..e07a359452 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql @@ -0,0 +1,49 @@ +-- 服务事项从需求分类字典表中抽离出来了,对应历史数据修改如下 +-- 1、联建单位的服务事项置空 +update ic_party_unit set SERVICE_MATTER =''; +-- 2、联建活动的服务事项修改为新的编码 +update ic_party_activity set SERVICE_MATTER='1006' where SERVICE_MATTER = '10100006'; +update ic_party_activity set SERVICE_MATTER='1008' where SERVICE_MATTER = '10100008'; +update ic_party_activity set SERVICE_MATTER='1002' where SERVICE_MATTER = '10100002'; +update ic_party_activity set SERVICE_MATTER='1009' where SERVICE_MATTER = '10100009'; +update ic_party_activity set SERVICE_MATTER='1017' where SERVICE_MATTER = '10100017'; +update ic_party_activity set SERVICE_MATTER='1021' where SERVICE_MATTER = '10100021'; +update ic_party_activity set SERVICE_MATTER='1015' where SERVICE_MATTER = '10100015'; +update ic_party_activity set SERVICE_MATTER='1011' where SERVICE_MATTER = '10100011'; +update ic_party_activity set SERVICE_MATTER='1018' where SERVICE_MATTER = '10100018'; +update ic_party_activity set SERVICE_MATTER='1005' where SERVICE_MATTER = '10100005'; +update ic_party_activity set SERVICE_MATTER='1010' where SERVICE_MATTER = '10100010'; +update ic_party_activity set SERVICE_MATTER='1003' where SERVICE_MATTER = '10100003'; +update ic_party_activity set SERVICE_MATTER='1020' where SERVICE_MATTER = '10100020'; +update ic_party_activity set SERVICE_MATTER='1022' where SERVICE_MATTER = '10100022'; +update ic_party_activity set SERVICE_MATTER='1014' where SERVICE_MATTER = '10100014'; +update ic_party_activity set SERVICE_MATTER='1007' where SERVICE_MATTER = '10100007'; +update ic_party_activity set SERVICE_MATTER='1001' where SERVICE_MATTER = '10100001'; +update ic_party_activity set SERVICE_MATTER='1004' where SERVICE_MATTER = '10100004'; +update ic_party_activity set SERVICE_MATTER='1016' where SERVICE_MATTER = '10100016'; +update ic_party_activity set SERVICE_MATTER='1013' where SERVICE_MATTER = '10100013'; +update ic_party_activity set SERVICE_MATTER='1012' where SERVICE_MATTER = '10100012'; +update ic_party_activity set SERVICE_MATTER='1019' where SERVICE_MATTER = '10100019'; +-- 3、爱心互助-活动类型为联建活动,对应的服务事项编码改为新的 +update act_info set SERVICE_MATTER='1006' where ACT_TYPE='party' and SERVICE_MATTER='10100006' ; +update act_info set SERVICE_MATTER='1008' where ACT_TYPE='party' and SERVICE_MATTER='10100008' ; +update act_info set SERVICE_MATTER='1002' where ACT_TYPE='party' and SERVICE_MATTER='10100002' ; +update act_info set SERVICE_MATTER='1009' where ACT_TYPE='party' and SERVICE_MATTER='10100009' ; +update act_info set SERVICE_MATTER='1017' where ACT_TYPE='party' and SERVICE_MATTER='10100017' ; +update act_info set SERVICE_MATTER='1021' where ACT_TYPE='party' and SERVICE_MATTER='10100021' ; +update act_info set SERVICE_MATTER='1015' where ACT_TYPE='party' and SERVICE_MATTER='10100015' ; +update act_info set SERVICE_MATTER='1011' where ACT_TYPE='party' and SERVICE_MATTER='10100011' ; +update act_info set SERVICE_MATTER='1018' where ACT_TYPE='party' and SERVICE_MATTER='10100018' ; +update act_info set SERVICE_MATTER='1005' where ACT_TYPE='party' and SERVICE_MATTER='10100005' ; +update act_info set SERVICE_MATTER='1010' where ACT_TYPE='party' and SERVICE_MATTER='10100010' ; +update act_info set SERVICE_MATTER='1003' where ACT_TYPE='party' and SERVICE_MATTER='10100003' ; +update act_info set SERVICE_MATTER='1020' where ACT_TYPE='party' and SERVICE_MATTER='10100020' ; +update act_info set SERVICE_MATTER='1022' where ACT_TYPE='party' and SERVICE_MATTER='10100022' ; +update act_info set SERVICE_MATTER='1014' where ACT_TYPE='party' and SERVICE_MATTER='10100014' ; +update act_info set SERVICE_MATTER='1007' where ACT_TYPE='party' and SERVICE_MATTER='10100007' ; +update act_info set SERVICE_MATTER='1001' where ACT_TYPE='party' and SERVICE_MATTER='10100001' ; +update act_info set SERVICE_MATTER='1004' where ACT_TYPE='party' and SERVICE_MATTER='10100004' ; +update act_info set SERVICE_MATTER='1016' where ACT_TYPE='party' and SERVICE_MATTER='10100016' ; +update act_info set SERVICE_MATTER='1013' where ACT_TYPE='party' and SERVICE_MATTER='10100013' ; +update act_info set SERVICE_MATTER='1012' where ACT_TYPE='party' and SERVICE_MATTER='10100012' ; +update act_info set SERVICE_MATTER='1019' where ACT_TYPE='party' and SERVICE_MATTER='10100019' ; \ No newline at end of file From 68e48b972ea2074b3cf6c4a04cf775c00de6811a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Jan 2022 14:37:03 +0800 Subject: [PATCH 48/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndividualCategoryAllListResultDTO.java | 43 +++++++++++++ .../IndividualCategoryListResultDTO.java | 3 + .../IcIndividualCategoryManageController.java | 12 ++++ .../IcIndividualCategoryManageService.java | 9 +++ ...IcIndividualCategoryManageServiceImpl.java | 64 ++++++++++++++++++- .../epmet/dto/form/StatsResiListFormDTO.java | 2 + .../epmet/feign/EpmetUserOpenFeignClient.java | 8 ++- .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/StatsResiWarnController.java | 15 ++++- .../epmet/service/StatsResiWarnService.java | 3 + .../impl/StatsResiWarnServiceImpl.java | 6 ++ 11 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java new file mode 100644 index 0000000000..0251e83f7f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 10:52 上午 + * @DESC + */ +@Data +public class IndividualCategoryAllListResultDTO implements Serializable { + + private static final long serialVersionUID = -3294223041221531203L; + + /** + * 标签 + */ + private String label; + + /** + * 图片 + */ + private String managementIcon; + + /** + * 字段名 + */ + private String columnName; + + /** + * 排序 + */ + private Integer sort; + + private String id; + + /** + * 是否选中 true:是;false:否 + */ + private boolean isSelected = false; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java index cbfc8b5718..7a7f7d51cc 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -35,4 +36,6 @@ public class IndividualCategoryListResultDTO implements Serializable { private Integer sort; private String id; + + private Integer count = NumConstant.ZERO; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java index 5a902c2c99..9c90d1bb9b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcIndividualCategoryManageDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; import com.epmet.dto.form.PackageEditIndividualCategoryFormDTO; +import com.epmet.dto.result.IndividualCategoryAllListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.service.IcIndividualCategoryManageService; import org.springframework.beans.factory.annotation.Autowired; @@ -56,4 +57,15 @@ public class IcIndividualCategoryManageController { return new Result(); } + /** + * @Description 查询客户下人员分类,并且赋值本人选中的 + * @param tokenDto + * @author zxc + * @date 2022/1/20 10:44 上午 + */ + @PostMapping("individualcategoryalllist") + public Result> individualCategoryAllList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icIndividualCategoryManageService.individualCategoryAllList(tokenDto)); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java index 4b15339377..f688fea29d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcIndividualCategoryManageDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.result.IndividualCategoryAllListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.entity.IcIndividualCategoryManageEntity; @@ -36,4 +37,12 @@ public interface IcIndividualCategoryManageService extends BaseService formDTOS, TokenDto tokenDto); + /** + * @Description 查询客户下人员分类,并且赋值本人选中的 + * @param tokenDto + * @author zxc + * @date 2022/1/20 10:44 上午 + */ + List individualCategoryAllList(TokenDto tokenDto); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java index c684c8c36e..68529e158c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java @@ -1,14 +1,27 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcIndividualCategoryManageDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.StatsResiListFormDTO; +import com.epmet.dto.result.IcStatsResiResultDTO; +import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IndividualCategoryAllListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.entity.IcIndividualCategoryManageEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.IcIndividualCategoryManageService; import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -24,6 +37,11 @@ import java.util.List; @Service public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl implements IcIndividualCategoryManageService { + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + /** * @Description 【人员分类管理】查询个人分类列表 * @param tokenDto @@ -32,10 +50,30 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl individualCategoryList(TokenDto tokenDto) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException(String.format("查询工作人员%s信息失败...",tokenDto.getUserId())); + } + StatsResiListFormDTO formDTO = new StatsResiListFormDTO(); + formDTO.setId(staffInfo.getAgencyId()); + formDTO.setLevel("agency"); + formDTO.setCustomerId(tokenDto.getCustomerId()); + Result> list = userOpenFeignClient.getPersonCategoryList(formDTO); + if (!list.success()){ + throw new EpmetException("查询人员分类下人数失败..."); + } + List datas = list.getData(); List result = baseDao.individualCategoryList(tokenDto.getUserId()); - if (CollectionUtils.isNotEmpty(result)){ + if (CollectionUtils.isNotEmpty(datas) && CollectionUtils.isNotEmpty(result)){ + result.forEach( r -> datas.stream().filter( d -> d.getId().equals(r.getId())).forEach(d -> r.setCount(d.getCount()))); + return result; + } + if (CollectionUtils.isEmpty(datas) && CollectionUtils.isNotEmpty(result)){ return result; } + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } return new ArrayList<>(); } @@ -59,4 +97,28 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl individualCategoryAllList(TokenDto tokenDto) { + IcResiCategoryStatsConfigFormDTO formDTO = new IcResiCategoryStatsConfigFormDTO(); + Result> listResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(formDTO); + if (!listResult.success()){ + throw new EpmetException("查询客户下的人员类别失败..."); + } + if (CollectionUtils.isEmpty(listResult.getData())){ + return new ArrayList<>(); + } + List result = ConvertUtils.sourceToTarget(listResult.getData(), IndividualCategoryAllListResultDTO.class); + List configs = baseDao.individualCategoryList(tokenDto.getUserId()); + if (CollectionUtils.isNotEmpty(configs)){ + result.forEach(r -> configs.stream().filter(c -> c.getColumnName().equals(r.getColumnName())).forEach(c -> r.setSelected(true))); + } + return result; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java index 1bb20c647a..131322a8a6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java @@ -43,4 +43,6 @@ public class StatsResiListFormDTO implements Serializable { @NotBlank(message = "level不能为空") private String level; + private String customerId; + } \ No newline at end of file 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 9c57423628..1b9ac976c6 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 @@ -1,6 +1,7 @@ package com.epmet.feign; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; @@ -24,8 +25,8 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -// @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) + @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) public interface EpmetUserOpenFeignClient { /** @@ -708,4 +709,7 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/userbaseinfo/resirelationinfo") Result resiRelationInfo(@RequestParam("userId")String userId); + @PostMapping("/epmetuser/statsresiwarn/list2") + Result> getPersonCategoryList(@RequestBody StatsResiListFormDTO 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 b434b30806..bde8bf2e8c 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 @@ -522,4 +522,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result resiRelationInfo(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "resiRelationInfo", userId); } + + @Override + public Result> getPersonCategoryList(StatsResiListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPersonCategoryList", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java index 8e36190cf0..1be35d69b5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -60,12 +60,23 @@ public class StatsResiWarnController { private StatsResiWarnService statsResiWarnService; @PostMapping("list") - public Result list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ + public Result> list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO); String customerId = tokenDto.getCustomerId(); List icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel()); - return new Result().ok(icStatsResiResultDTOList); + return new Result>().ok(icStatsResiResultDTOList); + } + /** + * @Description 内部调了list + * @param formDTO + * @author zxc + * @date 2022/1/20 2:11 下午 + */ + @PostMapping("list2") + public Result> list2(@RequestBody StatsResiListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(statsResiWarnService.list2(formDTO)); } @PostMapping("buildingwarnlist") diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java index 37a85105bb..941421fc33 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java @@ -17,6 +17,7 @@ package com.epmet.service; +import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; @@ -38,6 +39,8 @@ public interface StatsResiWarnService{ List list(String customerId,String id, String level); + List list2(StatsResiListFormDTO formDTO); + void resiWarn(String customerId); void resiWarnByOne(String customerId,String userId); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 3b12bcd10d..122fca634e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.dao.IcStatsResiWarnDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; import com.epmet.entity.IcStatsResiWarnEntity; @@ -193,6 +194,11 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { return result; } + @Override + public List list2(StatsResiListFormDTO formDTO) { + return this.list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel()); + } + /** * 统计 */ From 786c30f0f79e5b3a41fa240595077002d9fa46f5 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 20 Jan 2022 15:17:07 +0800 Subject: [PATCH 49/83] . --- .../resources/db/migration/V0.0.24__alter_change_detailed.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql index 69dda6d4de..bf2a78fe05 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql @@ -1,3 +1,3 @@ ALTER TABLE `ic_user_change_detailed` -ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ''组织的所有上级Id'' AFTER `IC_USER_CHANGE_RECORD_ID`; +ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织的所有上级Id' AFTER `IC_USER_CHANGE_RECORD_ID`; From 918811e179d0244e54fcc230b9987e90ad80090c Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Jan 2022 15:41:19 +0800 Subject: [PATCH 50/83] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9E=9A=E4=B8=BE=E7=B1=BB=20IcFormCodeEnum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/IcFormCodeEnum.java | 46 +++++++++++++++++++ .../epmet/dto/form/CustomerFormQueryDTO.java | 3 ++ .../entity/IcFormQueryBuilderEntity.java | 2 + .../epmet/dto/form/DelIcResiUserFormDTO.java | 3 +- .../epmet/dto/form/DynamicQueryFormDTO.java | 3 +- .../controller/IcResiUserController.java | 16 +++---- .../service/impl/IcResiUserServiceImpl.java | 2 +- .../service/impl/VolunteerServiceImpl.java | 6 +-- .../test/IcResiUserControllerTest.java | 3 +- 9 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java new file mode 100644 index 0000000000..9ed48a90e4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java @@ -0,0 +1,46 @@ +package com.epmet.commons.tools.enums; + +/** + * desc:数字社区平台-表单配置枚举类 + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum IcFormCodeEnum { + /** + * 表单code枚举 + */ + RESI_BASE_INFO("resi_base_info", "居民信息"), + + ; + + private String code; + private String name; + + + + IcFormCodeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static IcFormCodeEnum getEnum(String code) { + IcFormCodeEnum[] values = IcFormCodeEnum.values(); + for (IcFormCodeEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java index 8759909f38..1978e3660d 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java @@ -16,6 +16,9 @@ public class CustomerFormQueryDTO implements Serializable { // 获取表单相关信息 public interface GetFormInfoGroup {} + /** + * @see com.epmet.commons.tools.enums.IcFormCodeEnum + */ @NotBlank(message = "formCode不能为空,居民信息默认传:resi_base_info",groups = { AddUserInternalGroup.class, GetFormInfoGroup.class} ) private String formCode; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java index f8255baa01..4713b01dd3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java @@ -47,6 +47,8 @@ public class IcFormQueryBuilderEntity extends BaseEpmetEntity { /** * ic_form.form_code,举例:resi_base_info + * @see com.epmet.commons.tools.enums.IcFormCodeEnum + * */ private String formCode; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java index 3b6ff7d195..558bb88b7f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -21,6 +22,6 @@ public class DelIcResiUserFormDTO implements Serializable { private String icResiUserId; @NotBlank(message = "token获取的customerId不能为空", groups = IdGroup.class) private String customerId; - private String formCode="resi_base_info"; + private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java index 42e163838b..809c00be18 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,7 +15,7 @@ import java.util.List; @Data public class DynamicQueryFormDTO implements Serializable { private String customerId; - private String formCode="resi_base_info"; + private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode(); @NotBlank(message = "resultTableName不能为空") private String resultTableName; private List conditions; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 0c573c1049..4abb7124ac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -91,9 +92,6 @@ import java.util.stream.Collectors; @RequestMapping("icresiuser") public class IcResiUserController { - //todo 枚举吧 - private static final String IC_RESI_FORM_CODE = "resi_base_info"; - /** * 居民上传临时目录 */ @@ -312,7 +310,7 @@ public class IcResiUserController { Set stopSearchSet = new HashSet<>(); //获取表单项 - List resiFormAllItems = icResiUserService.listFormItems(customerId, IC_RESI_FORM_CODE); + List resiFormAllItems = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode()); Map allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o)); Map map = new HashMap<>(); allItemMap.values().forEach(item->{ @@ -436,7 +434,7 @@ public class IcResiUserController { savePath = IC_RESI_UPLOAD_DIR.resolve(fileName); IOUtils.copy(file.getInputStream(), new FileOutputStream(savePath.toString())); - List formItemList = icResiUserService.listFormItems(customerId,IC_RESI_FORM_CODE); + List formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode()); icResiUserImportService.importIcResiInfoFromExcel(formItemList, savePath.toString(), response); } catch (IOException e) { String errorMsg = ExceptionUtils.getErrorStackTrace(e); @@ -444,7 +442,9 @@ public class IcResiUserController { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } finally { try { - Files.delete(savePath); + if (savePath != null){ + Files.delete(savePath); + } } catch (IOException e) { log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); } @@ -491,7 +491,7 @@ public class IcResiUserController { @NotNull private CustomerFormResultDTO getResiFormAddItems(String customerId) { CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); - queryDTO.setFormCode("resi_base_info"); + queryDTO.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); queryDTO.setCustomerId(customerId); Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); if (resultForm == null || !resultForm.success() || resultForm.getData() == null) { @@ -656,7 +656,7 @@ public class IcResiUserController { input.setKeyword(input.getKeyword().trim()); input.setCustomerId(loginUser.getCustomerId()); input.setStaffId(loginUser.getUserId()); - input.setFormCode("resi_base_info"); + input.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); if (input.getPageNo() == null) { input.setPageNo(1); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 28036d3a59..62c9bc2cff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -1181,7 +1181,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getVolunteerCategoryOptions(String customerId) { IcFormOptionsQueryFormDTO optionsQuery = new IcFormOptionsQueryFormDTO(); optionsQuery.setCustomerId(customerId); - optionsQuery.setFormCode("resi_base_info"); + optionsQuery.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); optionsQuery.setLabel("志愿者类别"); List categorieDtos = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsQuery), ServiceConstant.OPER_CUSTOMIZE_SERVER, diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java index a25f7d2ad7..1272b57629 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.feign.ResultDataResolver; @@ -16,13 +17,12 @@ import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.VolunteerService; +import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.google.common.collect.Lists; - import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -68,7 +68,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve // 2.补充图例 IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); optionsForm.setCustomerId(customerId); - optionsForm.setFormCode("resi_base_info"); + optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); optionsForm.setLabel("志愿者类别"); String errorMsg = "【志愿者分布】查询志愿者图例失败"; diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java index 4bf7b1c16c..9afcaf00d0 100644 --- a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.export.ExcelExportService; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; @@ -61,7 +62,7 @@ public class IcResiUserControllerTest { @NotNull private CustomerFormResultDTO getResiFormItems(String customerId) { CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); - queryDTO.setFormCode("resi_base_info"); + queryDTO.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); queryDTO.setCustomerId(customerId); Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){ From d7ee2182582b7c14162d2fd89b3540d0d8945068 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Jan 2022 17:44:11 +0800 Subject: [PATCH 51/83] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/IcResiUserController.java | 6 +++--- .../java/com/epmet/service/impl/IcResiUserServiceImpl.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 4abb7124ac..ddc1eed9c6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -649,7 +649,7 @@ public class IcResiUserController { @PostMapping("search") public Result>> searchResi(@RequestBody IcResiUserPageFormDTO input, @LoginUser TokenDto loginUser) { if (StringUtils.isBlank(input.getKeyword())) { - PageData> r = new PageData>(new ArrayList<>(), 0); + PageData> r = new PageData>(new ArrayList<>(), NumConstant.ZERO_L); return new Result>>().ok(r); } @@ -658,11 +658,11 @@ public class IcResiUserController { input.setStaffId(loginUser.getUserId()); input.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); if (input.getPageNo() == null) { - input.setPageNo(1); + input.setPageNo(NumConstant.ONE); } if (input.getPageSize() == null) { - input.setPageSize(20); + input.setPageSize(NumConstant.TWENTY); } PageData> r = icResiUserService.pageResiMap(input); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 62c9bc2cff..8ccf84a9bb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -476,7 +476,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> pageResiMap(IcResiUserPageFormDTO formDTO) { CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); - String staffOrgPath=StrConstant.EPMETY_STR; + String staffOrgPath; if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){ staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); }else{ @@ -542,14 +542,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl resultMap : list) { String gridIdValue = null != resultMap.get(UserConstant.GRID_ID) ? resultMap.get(UserConstant.GRID_ID).toString() : StrConstant.EPMETY_STR; resultMap.put("GRID_ID_VALUE", gridIdValue); - if (null != gridInfoMap && gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) { + if (gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) { //GRID_NAME resultMap.put(UserConstant.GRID_ID, gridInfoMap.get(gridIdValue).getGridName()); } String homeId = null != resultMap.get(UserConstant.HOME_ID) ? resultMap.get(UserConstant.HOME_ID).toString() : StrConstant.EPMETY_STR; resultMap.put("HOME_ID_VALUE", homeId); - if (null != houseInfoMap && houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) { + if (houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) { HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId); String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR; resultMap.put("BUILD_NAME", buildName); From 5500927187bbe90ea177912a1bae2b0bc0e3cc7a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 20 Jan 2022 17:55:52 +0800 Subject: [PATCH 52/83] =?UTF-8?q?=E4=BB=8E=E8=B7=9F=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=9F=A5=E8=AF=A2=E7=BB=84=E7=BB=87=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/AgencydetailFormDTO.java | 3 +- .../controller/CustomerAgencyController.java | 10 ++++++ .../epmet/service/CustomerAgencyService.java | 5 +++ .../impl/CustomerAgencyServiceImpl.java | 35 +++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java index 9383b68e93..8aa8482fdb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencydetailFormDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -36,7 +37,7 @@ public class AgencydetailFormDTO implements Serializable { /** * 内部错误分组 * */ - public interface AddUserInternalGroup{} + public interface AddUserInternalGroup extends CustomerClientShowGroup {} /** * 机关组织Id diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index db2a0eec32..e097d3b38d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -405,4 +405,14 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.icResiUserOrgMsg(formDTO)); } + /** + * @Description根据组织Id查询扇形组织网格树 + * @author sun + **/ + @PostMapping("rootagencygridtree") + public Result rootAgencyGridTree(@RequestBody AgencydetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencydetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(customerAgencyService.rootAgencyGridTree(formDTO.getAgencyId())); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 3e4f44cd36..855fae6038 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -283,4 +283,9 @@ public interface CustomerAgencyService extends BaseService **/ IcResiUserOrgMsgResultDTO icResiUserOrgMsg(IcResiUserOrgMsgFormDTO formDTO); + /** + * @Description根据组织Id查询扇形组织网格树 + * @author sun + **/ + AgencyTreeResultDTO rootAgencyGridTree(String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 7403df24f9..db8174b51d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -30,6 +30,8 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; @@ -1401,4 +1403,37 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl Date: Fri, 21 Jan 2022 09:16:01 +0800 Subject: [PATCH 53/83] =?UTF-8?q?=E6=8A=8A=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=94=B9=E4=B8=BA1w=20=E6=AF=8F=E6=AC=A1=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IcResiUserController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index ddc1eed9c6..ff63a672dc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -343,7 +343,7 @@ public class IcResiUserController { .collect(Collectors.toList()); List> resiResultList = null; - pageFormDTO.setPageSize(NumConstant.FIVE_HUNDRED); + pageFormDTO.setPageSize(NumConstant.TEN_THOUSAND); for (IcResiUserTableEnum tableEnum : resiTableList) { String tableName = tableEnum.getTableName(); pageFormDTO.setPageNo(NumConstant.ONE); From 7501695a20a2345c2d3e68418a520e5814c1a955 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Jan 2022 09:26:38 +0800 Subject: [PATCH 54/83] bug --- .../java/com/epmet/dao/IcServiceItemDictDao.java | 2 ++ .../service/impl/IcServiceItemDictServiceImpl.java | 7 +++---- .../main/resources/mapper/IcServiceItemDictDao.xml | 13 +++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java index 5837b45aea..1e1fd873c9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java @@ -34,4 +34,6 @@ import java.util.List; public interface IcServiceItemDictDao extends BaseDao { List pageList(String customerId); + + IcServiceItemDictEntity selectMax(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index 1868076ade..2d5e5a530d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -74,6 +74,7 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl nameQuery = new LambdaQueryWrapper<>(); nameQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId()) @@ -90,10 +91,8 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl maxQuery = new LambdaQueryWrapper<>(); - maxQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId()) - .orderByDesc(IcServiceItemDictEntity::getCategoryCode).last("limit 1"); - IcServiceItemDictEntity max = baseDao.selectOne(maxQuery); + //如果说当前查询的编码是1022,但是库里面1023已经存在且del_flag='0'。这个时候新增的编码为1023就会报错。 + IcServiceItemDictEntity max = baseDao.selectMax(formDTO.getCustomerId()); // 获取编码 IcServiceItemDictEntity insert = new IcServiceItemDictEntity(); insert.setCustomerId(formDTO.getCustomerId()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml index f89b3c6a83..787ccb9d66 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml @@ -18,4 +18,17 @@ d.SORT DESC + \ No newline at end of file From 7eec8535bd87932b429e6024b2ceca10bd3a529f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 21 Jan 2022 09:59:58 +0800 Subject: [PATCH 55/83] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=B1=85=E6=B0=91=E5=AF=BC=E5=85=A5,=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=9A=84=E8=B0=83=E5=8A=A8=E5=92=8C=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E7=9A=84=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/feign/GovOrgOpenFeignClient.java | 8 + .../GovOrgOpenFeignClientFallback.java | 4 + .../impl/IcResiUserImportServiceImpl.java | 610 ++++++++++++++++-- .../impl/IcUserTransferRecordServiceImpl.java | 2 +- 4 files changed, 556 insertions(+), 68 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 9293546170..6c31c72c8d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -583,4 +583,12 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping(value = "/gov/org/customeragency/icresiuserorgmsg") Result icResiUserOrgMsg(@RequestBody IcResiUserOrgMsgFormDTO formDTO); + + /** + * 查询单元 + * @param id + * @return + */ + @GetMapping("/gov/org/icbuildingunit/{id}") + Result getUnitById(@PathVariable("id") String id); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 7b245ec735..2ce6993f47 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -379,4 +379,8 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "icResiUserOrgMsg", formDTO); } + @Override + public Result getUnitById(String id) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getUnitById", id); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 43e3263c94..7e8a5166e1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -11,29 +11,35 @@ import com.epmet.bean.ResiImportResiCategoryChangedCache; import com.epmet.bean.ResiImportChangedData; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcResiUserDao; +import com.epmet.dao.IcUserChangeDetailedDao; +import com.epmet.dao.IcUserChangeRecordDao; +import com.epmet.dao.IcUserTransferRecordDao; import com.epmet.dto.*; -import com.epmet.dto.form.GridOptionFormDTO; -import com.epmet.dto.form.HouseFormDTO; -import com.epmet.dto.form.LoginUserDetailsFormDTO; -import com.epmet.dto.result.FormItemResult; -import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.dto.result.OptionDTO; -import com.epmet.dto.result.ResiCategoryItemResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; +import com.epmet.entity.IcUserChangeDetailedEntity; +import com.epmet.entity.IcUserChangeRecordEntity; +import com.epmet.entity.IcUserTransferRecordEntity; import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.handler.DynamicEasyExcelListener; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; -import com.epmet.service.IcResiUserImportService; +import com.epmet.service.*; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.Data; @@ -74,7 +80,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res /** * 居民类别items列表 */ - public static final ThreadLocal> resiCategoryItemsCache = new ThreadLocal<>(); + public static final ThreadLocal> resiCategoryItemsCache = new ThreadLocal<>(); /** * key: itemId @@ -103,6 +109,19 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res @Autowired private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private IcUserChangeRecordDao icUserChangeRecordDao; + + @Autowired + private IcUserChangeDetailedDao icUserChangeDetailedDao; + + @Autowired + private IcUserTransferRecordDao icUserTransferRecordDao; + + @Autowired + private UserService userService; + + /** * @description 列信息封装 * @@ -196,10 +215,11 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res userForm.setClient(loginUserClient); userForm.setUserId(loginUserId); - LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(userForm), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); - String currUserAgencyId = loginUserDetails.getAgencyId(); + String currUserAgencyId = userService.getLoginUserDetails( + loginUserUtil.getLoginUserApp(), + loginUserUtil.getLoginUserClient(), + loginUserUtil.getLoginUserId()).getAgencyId(); - //String excelPathName = "/opt/test/基础信息表/resi_info.xls"; CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(currUserAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); String customerId = agencyInfo.getCustomerId(); @@ -230,9 +250,15 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 执行人员类别变更记录 Map newResis = categoryChangedResi.get().getNewResis(); + // todo 此处没测试 Map categoryChangedResis = categoryChangedResi.get().getCategoryChangedResis(); Map transferedResis = categoryChangedResi.get().getTransferedResis(); + //保存调动或者变更记录 + saveNewResiCategoryRecord(newResis); + saveResiCategoryChangedRecord(categoryChangedResis); + saveTransferedResiRecord(transferedResis); + try { downLoadResults(response); } catch (IOException e) { @@ -275,8 +301,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String.format("【居民信息导入】查询居民类别items失败,customerId:%s", customerId), "居民信息导入失败"); - List l = resiCategoryItems.stream().map(ResiCategoryItemResultDTO::getColumnName).collect(Collectors.toList()); - resiCategoryItemsCache.set(l); + Map columnNameAndLabel = resiCategoryItems.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel())); + + resiCategoryItemsCache.set(columnNameAndLabel); } /** @@ -434,7 +461,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); icResiUserDao.add(tableName, columnAndValues); - Map categories = resiCategoryItemsCache.get() + Map categories = resiCategoryItemsCache.get().keySet() .stream() .filter((categoryColumnName) -> "1".equals(columnAndValues.get(categoryColumnName))) .collect(Collectors.toMap((k) -> k, (k) -> columnAndValues.get(k))); @@ -507,19 +534,6 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String icResiId = icResiUserBaseInfo.getId(); - //if (CollectionUtils.isNotEmpty(icResiUserDao.selectSubTableRecords(customerId, icResiId, targetTableName))) { - // log.info("身份证号为【{}】的居民【{}】信息已存在,跳过导入", idCard, targetTableName); - // - // SkipedRow skipedRow = new SkipedRow(); - // skipedRow.setName(columnAndValues.get("NAME")); - // skipedRow.setIdCard(columnAndValues.get("ID_CARD")); - // skipedRow.setInfo("信息已存在,跳过导入"); - // skipedRow.setTableName(targetTableName); - // skipedRows.get().get(targetTableName).add(skipedRow); - // - // continue; - //} - columnAndValues.put("IC_RESI_USER", icResiId); columnAndValues.put("CUSTOMER_ID", loginUserUtil.getLoginUserCustomerId()); columnAndValues.put("UPDATED_BY", currentUserId); @@ -543,6 +557,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res icResiUserDao.add(targetTableName, columnAndValues); } + // 保存到类别变更缓存中 + saveSubTableInfoToCategoryChangedResiCache(icResiId, Objects.requireNonNull(IcResiUserTableEnum.getObjectByTableName(targetTableName)).getMainTableFlagColumnName()); + } catch (Exception e) { String errorMsg; if (e instanceof RenException) { @@ -1005,36 +1022,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res workbook.write(response.getOutputStream()); } - public ResiImportCategoryData generateResiImportChangeData(String agencyId, String gridId, String villageId, String buildId, String unitId, - String homeId , Map categories) { - ResiImportCategoryData ricd = new ResiImportCategoryData(); - ricd.setAgencyId(agencyId); - ricd.setBuildId(buildId); - ricd.setGridId(gridId); - ricd.setVillageId(villageId); - ricd.setUnitId(unitId); - ricd.setHomeId(homeId); - ricd.setCategories(categories); - return ricd; - } - - ///** - // * 判断是否有组织维度的变化 - // * @param existingResiMap - // * @param newResiMap - // * @return - // */ - //public boolean isOrgDimChanged(Map existingResiMap, Map newResiMap) { - // return !existingResiMap.get("AGENCY_ID").equals(newResiMap.get("AGENCY_ID")) - // || !existingResiMap.get("GRID_ID").equals(newResiMap.get("GRID_ID")) - // || !existingResiMap.get("VILLAGE_ID").equals(newResiMap.get("VILLAGE_ID")) - // || !existingResiMap.get("BUILD_ID").equals(newResiMap.get("BUILD_ID")) - // || !existingResiMap.get("UNIT_ID").equals(newResiMap.get("UNIT_ID")) - // || !existingResiMap.get("HOME_ID").equals(newResiMap.get("HOME_ID")) - //} - /** * 生成导入调动数据 + * 1.新老数据中,只要状态是1的,都放入缓存 * @param existingResiMap * @param newResiMap * @return @@ -1055,7 +1045,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res HashMap existingResiCategories = new HashMap<>(); HashMap newResiCategories = new HashMap<>(); - for (String categoryColumnName : resiCategoryItemsCache.get()) { + for (String categoryColumnName : resiCategoryItemsCache.get().keySet()) { String oldCategoryValue = existingResiMap.get(categoryColumnName); String newCategoryValue = newResiMap.get(categoryColumnName); @@ -1077,7 +1067,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res existingResiMap.get("HOME_ID"), existingResiCategories); - ResiImportCategoryData newOne = new ResiImportCategoryData(existingResiMap.get("AGENCY_ID"), + ResiImportCategoryData newOne = new ResiImportCategoryData( + existingResiMap.get("AGENCY_ID"), newResiMap.get("GRID_ID"), newResiMap.get("VILLAGE_ID"), newResiMap.get("BUILD_ID"), @@ -1090,6 +1081,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res /** * 类别变更的居民信息封装 + * 1. * @param existingResiMap * @param newResiMap * @return @@ -1099,7 +1091,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res HashMap oldCategories = new HashMap<>(); HashMap newCategories = new HashMap<>(); - List categoryColumnNames = resiCategoryItemsCache.get(); + Set categoryColumnNames = resiCategoryItemsCache.get().keySet(); for (String categoryColumnName : categoryColumnNames) { String existingColumnValue = existingResiMap.get(categoryColumnName); String newColumnValue = newResiMap.get(categoryColumnName); @@ -1107,19 +1099,16 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res if (StringUtils.isAllBlank(existingColumnValue, newColumnValue)) { // 都为空,则没发生变化 continue; - } else if (StringUtils.isNoneBlank(existingColumnValue, newColumnValue)) { - // 都不为空,则执行比较 + } else { + // 先转为0再对比 + if (StringUtils.isBlank(existingColumnValue)) existingColumnValue = "0"; + if (StringUtils.isBlank(newColumnValue)) newColumnValue = "0"; + if (!existingColumnValue.equals(newColumnValue)) { oldCategories.put(categoryColumnName, existingColumnValue); newCategories.put(categoryColumnName, newColumnValue); - continue; } - } else { - // 一个为空一个不为空,则发生变化 - oldCategories.put(categoryColumnName, existingColumnValue); - newCategories.put(categoryColumnName, newColumnValue); } - } if (oldCategories.size() == 0) { @@ -1145,4 +1134,491 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res return new ResiImportChangedData(oldOne, newOne); } + + /** + * + * @param icResiId 居民id + * @param columnName 该项信息在主表的列名 + */ + private void saveSubTableInfoToCategoryChangedResiCache(String icResiId, String columnName) { + + ResiImportResiCategoryChangedCache cc = categoryChangedResi.get(); + Map newResis = cc.getNewResis(); + Map categoryChangedResis = cc.getCategoryChangedResis(); + Map transferedResis = cc.getTransferedResis(); + + ResiImportCategoryData newResi = newResis.get(icResiId); + if (newResi != null) { + //说明是新增居民 + newResi.getCategories().put(columnName, "1"); + return; + } + + ResiImportChangedData categoryChangedData = categoryChangedResis.get(icResiId); + if (categoryChangedData != null) { + // 说明是类别变更的居民 + Map oldCategories = categoryChangedData.getOldData().getCategories(); + Map newCategories = categoryChangedData.getNewData().getCategories(); + + if (!oldCategories.containsKey(columnName)) { + // 没有这个类别,说明旧数据中是0,新数据中也是0,新数据改成1 + oldCategories.put(columnName, "0"); + newCategories.put(columnName, "1"); + } else { + // 有这个类别,说明旧数据中是1,新数据中是0,新数据改成1,最后保存的时候,需要判断,新旧都是1,那么不创建变更记录 + newCategories.put(columnName, "1"); + } + return; + } + + ResiImportChangedData transferedData = transferedResis.get(icResiId); + if (transferedData != null) { + // 说明是发生调动的居民,旧数据不用管了,新数据改成1 + Map newCategories = transferedData.getNewData().getCategories(); + newCategories.put(columnName, "1"); + return; + } + + // 非新增,非调动,那么就是居民类别变更的,只不过变更的数据不在主sheet中,而在附sheet中 + ResiImportCategoryData oldOne = new ResiImportCategoryData(); + ResiImportCategoryData newOne = new ResiImportCategoryData(); + + oldOne.getCategories().put(columnName, "0"); + newOne.getCategories().put(columnName, "1"); + + ResiImportChangedData cd = new ResiImportChangedData(oldOne, newOne); + categoryChangedResis.put(icResiId, cd); + } + + /** + * 居民类别变更record + */ + public void saveResiCategoryChangedRecord(Map categoryChangedResis) { + + Date now = new Date(); + + CustomerStaffInfoCacheResult operator = CustomerStaffRedis.getStaffInfo(loginUserUtil.getLoginUserCustomerId(), loginUserUtil.getLoginUserId()); + + // 循环当前居民的所有类别的map + for (Map.Entry entry : categoryChangedResis.entrySet()) { + String resiId = entry.getKey(); + + ResiImportCategoryData oldData = entry.getValue().getOldData(); + ResiImportCategoryData newData = entry.getValue().getNewData(); + Map oldCategories = oldData.getCategories(); + Map newCategories = newData.getCategories(); + + StringBuilder sbBefore = new StringBuilder(""); + StringBuilder sbAfter = new StringBuilder(""); + + //主表的语言描述 + for (Map.Entry newEntry : newCategories.entrySet()) { + String columnName = newEntry.getKey(); + String newColumnValue = newEntry.getValue(); + String oldColumnValue = oldCategories.get(columnName); + + if (newColumnValue.equals(oldColumnValue)) { + continue; + } + + String beforeValueName = "0".equals(oldColumnValue) ? "否" : "是"; + String newValueName = "0".equals(newColumnValue) ? "否" : "是"; + + String label = resiCategoryItemsCache.get().get(columnName); + + sbBefore.append(label).append(":").append(beforeValueName).append("\n"); + sbAfter.append(label).append(":").append(newValueName).append("\n"); + } + + // 生成changeRecord并存入 + IcResiUserEntity resiInfo = icResiUserDao.selectById(resiId); + IcUserChangeRecordEntity changeRecord = fillChangeRecord(loginUserUtil.getLoginUserCustomerId(), resiId, resiInfo.getName(), null, loginUserUtil.getLoginUserId(), + operator.getRealName() , sbBefore.toString(), sbAfter.toString(), "category", "类别", "", now); + icUserChangeRecordDao.insert(changeRecord); + + for (Map.Entry columnEntry : newCategories.entrySet()) { + String newValue = columnEntry.getValue(); + String oldValue = oldCategories.get(columnEntry.getKey()); + oldValue = oldValue == null ? "0" : oldValue; + + if (newValue.equals(oldValue)) { + // 新旧值相等,跳过 + continue; + } + + int value = newValue.equals("1") && oldValue.equals("0") ? 1 : -1; + + + IcUserChangeDetailedEntity newDetail = fillChangeDetail(loginUserUtil.getLoginUserCustomerId(), resiId, changeRecord.getId(), newData.getAgencyId(), + newData.getGridId(), newData.getVillageId(), newData.getBuildId(), newData.getUnitId(), + newData.getHomeId(), "category", "类别", columnEntry.getKey(), value, resiInfo.getPids()); + + icUserChangeDetailedDao.insert(newDetail); + } + } + } + + /** + * 保存新增居民类别记录 + * @param newResis + */ + public void saveNewResiCategoryRecord(Map newResis) { + Date now = new Date(); + + CustomerStaffInfoCacheResult operator = CustomerStaffRedis.getStaffInfo(loginUserUtil.getLoginUserCustomerId(), loginUserUtil.getLoginUserId()); + + for (Map.Entry resi : newResis.entrySet()) { + String resiId = resi.getKey(); + ResiImportCategoryData data = resi.getValue(); + + IcResiUserEntity resiInfo = icResiUserDao.selectById(resiId); + + // 插入changeRecord + IcUserChangeRecordEntity changeRecord = fillChangeRecord(loginUserUtil.getLoginUserCustomerId(), resiId, resiInfo.getName(), null, + loginUserUtil.getLoginUserId(), operator.getRealName(), "-", "-", + "add", "新增", "", now); + icUserChangeRecordDao.insert(changeRecord); + + // 插入changeDetail + for (Map.Entry column : data.getCategories().entrySet()) { + IcUserChangeDetailedEntity changedetail = fillChangeDetail(loginUserUtil.getLoginUserCustomerId(), resiId, changeRecord.getId(), data.getAgencyId(), + data.getGridId(), data.getVillageId(), data.getBuildId(), data.getUnitId(), + data.getHomeId(), "add", "新增", column.getKey(), 1, resiInfo.getPids()); + + icUserChangeDetailedDao.insert(changedetail); + } + } + + } + + /** + * 调动居民变更记录 + * @param transferedResis + */ + public void saveTransferedResiRecord(Map transferedResis) { + Date now = new Date(); + for (Map.Entry resi : transferedResis.entrySet()) { + String customerId = loginUserUtil.getLoginUserCustomerId(); + + String resiId = resi.getKey(); + ResiImportCategoryData oldData = resi.getValue().getOldData(); + ResiImportCategoryData newData = resi.getValue().getNewData(); + + StringBuilder sbBefore = new StringBuilder(); + StringBuilder sbAfter = new StringBuilder(); + + String oldAgencyId = oldData.getAgencyId(); + String oldGridId = oldData.getGridId(); + String oldvillageId = oldData.getVillageId(); + String oldBuildId = oldData.getBuildId(); + String oldUnitId = oldData.getUnitId(); + String oldHomeId = oldData.getHomeId(); + // + String newAgencyId = newData.getAgencyId(); + String newGridId = newData.getGridId(); + String newvillageId = newData.getVillageId(); + String newBuildId = newData.getBuildId(); + String newUnitId = newData.getUnitId(); + String newHomeId = newData.getHomeId(); + + IcResiUserOrgMsgFormDTO oldOrgFormDTO = new IcResiUserOrgMsgFormDTO(); + oldOrgFormDTO.setCustomerId(customerId); + oldOrgFormDTO.setAgencyId(oldData.getAgencyId()); + oldOrgFormDTO.setGridId(oldData.getGridId()); + oldOrgFormDTO.setNeighborHoodId(oldData.getVillageId()); + oldOrgFormDTO.setBuildingId(oldData.getBuildId()); + oldOrgFormDTO.setBuildingUnitId(oldData.getUnitId()); + oldOrgFormDTO.setHouseId(oldData.getHomeId()); + Result oldOrgInfoRst = govOrgOpenFeignClient.icResiUserOrgMsg(oldOrgFormDTO); + + IcResiUserOrgMsgFormDTO newOrgInfo = new IcResiUserOrgMsgFormDTO(); + newOrgInfo.setCustomerId(customerId); + newOrgInfo.setAgencyId(newData.getAgencyId()); + newOrgInfo.setGridId(newData.getGridId()); + newOrgInfo.setNeighborHoodId(newData.getVillageId()); + newOrgInfo.setBuildingId(newData.getBuildId()); + newOrgInfo.setBuildingUnitId(newData.getUnitId()); + newOrgInfo.setHouseId(newData.getHomeId()); + Result newOrgInfoRst = govOrgOpenFeignClient.icResiUserOrgMsg(newOrgInfo); + + IcResiUserOrgMsgResultDTO oldOrg = null; + IcResiUserOrgMsgResultDTO newOrg = null; + + if (oldOrgInfoRst.success()) { + oldOrg = oldOrgInfoRst.getData(); + } + + if (newOrgInfoRst.success()) { + newOrg = newOrgInfoRst.getData(); + } + + // 生成中文描述 + if (oldOrg != null) { + CustomerGridDTO gridDTO = oldOrg.getGridDTO(); + IcNeighborHoodDTO neighborHoodDTO = oldOrg.getNeighborHoodDTO(); + IcBuildingDTO buildingDTO = oldOrg.getBuildingDTO(); + IcBuildingUnitDTO buildingUnitDTO = oldOrg.getBuildingUnitDTO(); + IcHouseDTO houseDTO = oldOrg.getHouseDTO(); + + if (gridDTO != null) { + sbBefore.append(gridDTO.getGridName()); + } + if (neighborHoodDTO != null) { + sbBefore.append("-").append(neighborHoodDTO.getNeighborHoodName()); + } + if (buildingDTO != null) { + sbBefore.append("-").append(buildingDTO.getBuildingName()); + } + if (buildingUnitDTO != null) { + sbBefore.append("-").append(buildingUnitDTO.getUnitName()); + } + if (houseDTO != null) { + sbBefore.append("-").append(houseDTO.getHouseName()); + } + } + + if (newOrg != null) { + CustomerGridDTO gridDTO = newOrg.getGridDTO(); + IcNeighborHoodDTO neighborHoodDTO = newOrg.getNeighborHoodDTO(); + IcBuildingDTO buildingDTO = newOrg.getBuildingDTO(); + IcBuildingUnitDTO buildingUnitDTO = newOrg.getBuildingUnitDTO(); + IcHouseDTO houseDTO = newOrg.getHouseDTO(); + + if (gridDTO != null) { + sbAfter.append(gridDTO.getGridName()); + } + if (neighborHoodDTO != null) { + sbAfter.append("-").append(neighborHoodDTO.getNeighborHoodName()); + } + if (buildingDTO != null) { + sbAfter.append("-").append(buildingDTO.getBuildingName()); + } + if (buildingUnitDTO != null) { + sbAfter.append("-").append(buildingUnitDTO.getUnitName()); + } + if (houseDTO != null) { + sbAfter.append("-").append(houseDTO.getHouseName()); + } + } + + CustomerStaffInfoCacheResult operator = CustomerStaffRedis.getStaffInfo(customerId, loginUserUtil.getLoginUserId()); + + IcResiUserEntity resiInfo = icResiUserDao.selectById(resiId); + + // 保存 transferRecord + IcUserTransferRecordEntity transferRecord = fillTransferRecord(resiInfo, operator, customerId, oldAgencyId, oldGridId, + oldvillageId, oldBuildId, oldUnitId, oldHomeId, customerId, + newAgencyId, newGridId, newvillageId, newBuildId, newUnitId, newHomeId, oldOrg, newOrg); + icUserTransferRecordDao.insert(transferRecord); + + // 保存 changeRecord + IcUserChangeRecordEntity changeRecord = fillChangeRecord(customerId, resiId, resiInfo.getName(), transferRecord.getId(), operator.getStaffId(), + operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "transfer", "调动", "", now); + icUserChangeRecordDao.insert(changeRecord); + + // 保存 changeDetail + for (Map.Entry oldCategories : oldData.getCategories().entrySet()) { + String key = oldCategories.getKey(); + String value = oldCategories.getValue(); + + // 之前是这个类型,那这个类型需要-1 + IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, changeRecord.getId(), oldData.getAgencyId(), + oldData.getGridId(), oldData.getVillageId(), oldData.getBuildId(), oldData.getUnitId(), + oldData.getHomeId(), "category", "调动", key, -1, resiInfo.getPids()); + + icUserChangeDetailedDao.insert(changeDetail); + } + + for (Map.Entry newCategories : newData.getCategories().entrySet()) { + String key = newCategories.getKey(); + String value = newCategories.getValue(); + + // 现在是这个类型,这个类型要+1 + IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, changeRecord.getId(), newData.getAgencyId(), + newData.getGridId(), newData.getVillageId(), newData.getBuildId(), newData.getUnitId(), + newData.getHomeId(), "category", "调动", key, 1, resiInfo.getPids()); + + icUserChangeDetailedDao.insert(changeDetail); + } + } + } + + /** + * 填充变更明细 + * @param customerId + * @param resiId + * @param changeRecordId + * @param agencyId + * @param gridId + * @param neighborhoodId + * @param buildingId + * @param initId + * @param houseId + * @param type + * @param typeName + * @param fieldName + * @param value + * @param pids + * @return + */ + private IcUserChangeDetailedEntity fillChangeDetail(String customerId, String resiId, String changeRecordId, String agencyId, String gridId, + String neighborhoodId, String buildingId, String initId, String houseId, + String type, String typeName, String fieldName, Integer value, String pids) { + IcUserChangeDetailedEntity detail = new IcUserChangeDetailedEntity(); + detail.setCustomerId(customerId); + detail.setIcUserChangeRecordId(changeRecordId); + detail.setPids(pids); + detail.setAgencyId(agencyId); + detail.setGridId(gridId); + detail.setNeighborHoodId(neighborhoodId); + detail.setBuildingId(buildingId); + detail.setBuildingUnitId(initId); + detail.setHouseId(houseId); + detail.setIcUserId(resiId); + detail.setType(type); + detail.setTypeName(typeName); + detail.setFieldName(fieldName); + detail.setValue(value); + return detail; + } + + /** + * 填充变更记录 + * @param customerId + * @param resiId + * @param resiName + * @param transferRecordId + * @param operatorId + * @param operatorName + * @param beforeChangeName + * @param afterChangeName + * @param type + * @param typeName + * @param remark + * @param changeTime + * @return + */ + private IcUserChangeRecordEntity fillChangeRecord(String customerId, String resiId, String resiName, String transferRecordId, + String operatorId, String operatorName, String beforeChangeName, String afterChangeName, + String type, String typeName, String remark, Date changeTime) { + IcUserChangeRecordEntity changeRecord = new IcUserChangeRecordEntity(); + changeRecord.setAfterChangeName(afterChangeName); + changeRecord.setBeforeChangeName(beforeChangeName); + changeRecord.setChangeTime(changeTime); + changeRecord.setCustomerId(customerId); + changeRecord.setIcUserId(resiId); + changeRecord.setIcUserName(resiName); + changeRecord.setIcUserTransferRecordId(transferRecordId); + changeRecord.setOperatorId(operatorId); + changeRecord.setOperatorName(operatorName); + changeRecord.setRemark(remark); + changeRecord.setType(type); + changeRecord.setTypeName(typeName); + + return changeRecord; + } + + /** + * 填充调动记录 + * @param resiInfo + * @param operator + * @param oldCustomerId + * @param oldAgencyId + * @param oldGridId + * @param oldVillageId + * @param oldBuildId + * @param oldUnitId + * @param oldHomeId + * @param newCustomerId + * @param newAgencyId + * @param newGridId + * @param newVillageId + * @param newBuildId + * @param newUnitId + * @param newHomeId + * @return + */ + private IcUserTransferRecordEntity fillTransferRecord(IcResiUserEntity resiInfo, CustomerStaffInfoCacheResult operator, String oldCustomerId, String oldAgencyId, String oldGridId, + String oldVillageId, String oldBuildId, String oldUnitId, String oldHomeId, String newCustomerId, + String newAgencyId, String newGridId, String newVillageId, String newBuildId, String newUnitId, + String newHomeId, IcResiUserOrgMsgResultDTO oldOrg, IcResiUserOrgMsgResultDTO newOrg) { + + IcUserTransferRecordEntity recordEntity = new IcUserTransferRecordEntity(); + recordEntity.setIcUserId(resiInfo.getId()); + recordEntity.setOperatorId(operator.getStaffId()); + recordEntity.setIcUserName(resiInfo.getName()); + recordEntity.setOperatorName(operator.getRealName()); + recordEntity.setOldCustomerId(oldCustomerId); + recordEntity.setOldAgencyId(oldAgencyId); + recordEntity.setOldAgencyName(oldOrg != null ? oldOrg.getAgencyDTO().getOrganizationName() : ""); + recordEntity.setOldGridId(oldGridId); + recordEntity.setOldGridName(oldOrg != null ? oldOrg.getGridDTO().getGridName() : ""); + recordEntity.setOldNeighborHoodId(oldVillageId); + recordEntity.setOldNeighborHoodName(oldOrg != null ? oldOrg.getNeighborHoodDTO().getNeighborHoodName() : ""); + recordEntity.setOldBuildingId(oldBuildId); + recordEntity.setOldBuildingName(oldOrg != null ? oldOrg.getBuildingDTO().getBuildingName() : ""); + recordEntity.setOldBuildingUnitId(oldUnitId); + recordEntity.setOldBuildingUnitName(oldOrg != null ? oldOrg.getBuildingUnitDTO().getUnitName() : ""); + recordEntity.setOldHouseId(oldHomeId); + recordEntity.setOldHouseName(oldOrg != null ? oldOrg.getHouseDTO().getHouseName() : ""); + recordEntity.setTransferTime(new Date()); + recordEntity.setRemark(""); + recordEntity.setNewCustomerId(newCustomerId); + recordEntity.setNewAgencyId(newAgencyId); + recordEntity.setNewAgencyName(newOrg != null ? newOrg.getAgencyDTO().getOrganizationName(): ""); + recordEntity.setNewGridId(newGridId); + recordEntity.setNewGridName(newOrg != null ? newOrg.getGridDTO().getGridName(): ""); + recordEntity.setNewNeighborHoodId(newVillageId); + recordEntity.setNewNeighborHoodName(newOrg != null ? newOrg.getNeighborHoodDTO().getNeighborHoodName(): ""); + recordEntity.setNewBuildingId(newBuildId); + recordEntity.setNewBuildingName(newOrg != null ? newOrg.getBuildingDTO().getBuildingName(): ""); + recordEntity.setNewBuildingUnitId(newUnitId); + recordEntity.setNewBuildingUnitName(newOrg != null ? newOrg.getBuildingUnitDTO().getUnitName(): ""); + recordEntity.setNewHouseId(newHomeId); + recordEntity.setNewHouseName(newOrg != null ? newOrg.getHouseDTO().getHouseName(): ""); + + return recordEntity; + } + + + + + //private IcUserTransferRecordEntity fillTransferRecord(String resiId, String resiName, String operatorId, String operatorName, String oldCustomerId, + // String oldAgencyId, String oldAgencyName, String oldGridId, String oldGridName, String neighborhoodId, + // String neighborhoodName, String oldBuildingId, String oldBuildingName, ) { + + //IcUserTransferRecordEntity recordEntity = new IcUserTransferRecordEntity(); + //recordEntity.setIcUserId(); + //recordEntity.setOperatorId(); + //recordEntity.setIcUserName(); + //recordEntity.setOperatorName(); + //recordEntity.setOldCustomerId(); + //recordEntity.setOldAgencyId(); + //recordEntity.setOldAgencyName(); + //recordEntity.setOldGridId(); + //recordEntity.setOldGridName(); + //recordEntity.setOldNeighborHoodId(); + //recordEntity.setOldNeighborHoodName(); + //recordEntity.setOldBuildingId(); + //recordEntity.setOldBuildingName(); + //recordEntity.setOldBuildingUnitId(); + //recordEntity.setOldBuildingUnitName(); + //recordEntity.setOldHouseId(); + //recordEntity.setOldHouseName(); + //recordEntity.setTransferTime(); + //recordEntity.setRemark(); + //recordEntity.setNewCustomerId(); + //recordEntity.setNewAgencyId(); + //recordEntity.setNewAgencyName(); + //recordEntity.setNewGridId(); + //recordEntity.setNewGridName(); + //recordEntity.setNewNeighborHoodId(); + //recordEntity.setNewNeighborHoodName(); + //recordEntity.setNewBuildingId(); + //recordEntity.setNewBuildingName(); + //recordEntity.setNewBuildingUnitId(); + //recordEntity.setNewBuildingUnitName(); + //recordEntity.setNewHouseId(); + //recordEntity.setNewHouseName(); + //} } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index 1e61c9cf54..9d1470f253 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java @@ -186,7 +186,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl Date: Fri, 21 Jan 2022 13:58:45 +0800 Subject: [PATCH 56/83] =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndividualCategoryListResultDTO.java | 4 +++ ...IcIndividualCategoryManageServiceImpl.java | 36 ++++++++----------- .../mapper/IcIndividualCategoryManageDao.xml | 4 ++- .../dto/form/CategoryCountListFormDTO.java | 21 +++++++++++ .../result/CategoryCountListResultDTO.java | 20 +++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 2 +- .../EpmetUserOpenFeignClientFallback.java | 2 +- .../controller/StatsResiWarnController.java | 7 ++-- .../epmet/service/StatsResiWarnService.java | 4 ++- .../impl/StatsResiWarnServiceImpl.java | 13 +++++-- .../resources/mapper/IcStatsResiWarnDao.xml | 2 +- 11 files changed, 84 insertions(+), 31 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CategoryCountListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CategoryCountListResultDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java index 7a7f7d51cc..968987940e 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -37,5 +38,8 @@ public class IndividualCategoryListResultDTO implements Serializable { private String id; + @JsonIgnore + private String warnConfigId; + private Integer count = NumConstant.ZERO; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java index 68529e158c..57091b8795 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java @@ -9,13 +9,11 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcIndividualCategoryManageDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; +import com.epmet.dto.form.CategoryCountListFormDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; -import com.epmet.dto.result.IcStatsResiResultDTO; -import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; -import com.epmet.dto.result.IndividualCategoryAllListResultDTO; -import com.epmet.dto.result.IndividualCategoryListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcIndividualCategoryManageEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; @@ -27,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * 个人分类管理 @@ -54,27 +53,22 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl> list = userOpenFeignClient.getPersonCategoryList(formDTO); - if (!list.success()){ - throw new EpmetException("查询人员分类下人数失败..."); - } - List datas = list.getData(); List result = baseDao.individualCategoryList(tokenDto.getUserId()); - if (CollectionUtils.isNotEmpty(datas) && CollectionUtils.isNotEmpty(result)){ - result.forEach( r -> datas.stream().filter( d -> d.getId().equals(r.getId())).forEach(d -> r.setCount(d.getCount()))); - return result; - } - if (CollectionUtils.isEmpty(datas) && CollectionUtils.isNotEmpty(result)){ - return result; - } if (CollectionUtils.isEmpty(result)){ return new ArrayList<>(); } - return new ArrayList<>(); + CategoryCountListFormDTO formDTO = new CategoryCountListFormDTO(); + formDTO.setConfigList(result.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList())); + formDTO.setOrgId(staffInfo.getAgencyId()); + Result> list = userOpenFeignClient.getPersonCategoryList(formDTO); + if (!list.success()){ + throw new EpmetException("查询人员分类下人数失败..."); + } + List datas = list.getData(); + if (CollectionUtils.isNotEmpty(datas)){ + result.forEach( r -> datas.stream().filter( d -> d.getConfigId().equals(r.getId())).forEach(d -> r.setCount(d.getCount()))); + } + return result; } /** diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml index 68036233b5..8979fb442c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml @@ -15,9 +15,11 @@ sc.LABEL, sc.MANAGEMENT_ICON, sc.COLUMN_NAME, - sc.id AS id + sc.id AS id, + wc.ID AS warnConfigId FROM ic_individual_category_manage cm INNER JOIN ic_resi_category_stats_config sc ON (sc.ID = cm.COLUMN_ID AND sc.DEL_FLAG = '0' AND `STATUS` = 'show') + INNER JOIN ic_resi_category_warn_config wc ON (sc.COLUMN_NAME = wc.COLUMN_NAME AND wc.DEL_FLAG = '0' AND wc.CUSTOMER_ID = sc.CUSTOMER_ID) WHERE cm.DEL_FLAG = 0 AND cm.USER_ID = #{userId} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CategoryCountListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CategoryCountListFormDTO.java new file mode 100644 index 0000000000..86a236a47c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CategoryCountListFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/1/21 1:43 下午 + * @DESC + */ +@Data +public class CategoryCountListFormDTO implements Serializable { + + private static final long serialVersionUID = 1563081091285509142L; + + private List configList; + + private String orgId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CategoryCountListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CategoryCountListResultDTO.java new file mode 100644 index 0000000000..375cb1ad1e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CategoryCountListResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/21 1:44 下午 + * @DESC + */ +@Data +public class CategoryCountListResultDTO implements Serializable { + + private static final long serialVersionUID = -8441192101441016588L; + + private String configId; + + private Integer count; +} 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 1b9ac976c6..14377b7fe9 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 @@ -710,6 +710,6 @@ public interface EpmetUserOpenFeignClient { Result resiRelationInfo(@RequestParam("userId")String userId); @PostMapping("/epmetuser/statsresiwarn/list2") - Result> getPersonCategoryList(@RequestBody StatsResiListFormDTO formDTO); + Result> getPersonCategoryList(@RequestBody CategoryCountListFormDTO 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 bde8bf2e8c..5bd1aa581e 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 @@ -524,7 +524,7 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien } @Override - public Result> getPersonCategoryList(StatsResiListFormDTO formDTO) { + public Result> getPersonCategoryList(CategoryCountListFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPersonCategoryList", formDTO); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java index 1be35d69b5..e02214518a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -22,9 +22,11 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CategoryCountListFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.form.StatsResiWarnCountFormDTO; import com.epmet.dto.form.StatsResiWarnFormDTO; +import com.epmet.dto.result.CategoryCountListResultDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; @@ -74,9 +76,8 @@ public class StatsResiWarnController { * @date 2022/1/20 2:11 下午 */ @PostMapping("list2") - public Result> list2(@RequestBody StatsResiListFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO); - return new Result>().ok(statsResiWarnService.list2(formDTO)); + public Result> list2(@RequestBody CategoryCountListFormDTO formDTO){ + return new Result>().ok(statsResiWarnService.list2(formDTO)); } @PostMapping("buildingwarnlist") diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java index 941421fc33..2b8dcf8263 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java @@ -17,7 +17,9 @@ package com.epmet.service; +import com.epmet.dto.form.CategoryCountListFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; +import com.epmet.dto.result.CategoryCountListResultDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; @@ -39,7 +41,7 @@ public interface StatsResiWarnService{ List list(String customerId,String id, String level); - List list2(StatsResiListFormDTO formDTO); + List list2(CategoryCountListFormDTO formDTO); void resiWarn(String customerId); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 122fca634e..10710e8437 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -9,6 +9,8 @@ import com.epmet.dao.IcResiUserDao; import com.epmet.dao.IcStatsResiWarnDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO; +import com.epmet.dto.PersonWarnLeftPieDTO; +import com.epmet.dto.form.CategoryCountListFormDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.result.*; @@ -195,8 +197,15 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { } @Override - public List list2(StatsResiListFormDTO formDTO) { - return this.list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel()); + public List list2(CategoryCountListFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getConfigList())){ + return new ArrayList<>(); + } + List result = icStatsResiWarnDao.selectCategoryCount(formDTO.getConfigList(), formDTO.getOrgId()); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return ConvertUtils.sourceToTarget(result,CategoryCountListResultDTO.class); } /** diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index 683938f80e..b1a900968b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -136,7 +136,7 @@ From 910cd64bb3007198730ebf568db17dc972b993e1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 21 Jan 2022 15:49:34 +0800 Subject: [PATCH 61/83] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.6__ic_often_use_function.sql | 40 +++++++++++++++++++ ...V0.0.13__ic_individual_category_manage.sql | 40 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.6__ic_often_use_function.sql create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.13__ic_individual_category_manage.sql diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.6__ic_often_use_function.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.6__ic_often_use_function.sql new file mode 100644 index 0000000000..3d22c6aa0a --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.6__ic_often_use_function.sql @@ -0,0 +1,40 @@ +/* + Navicat Premium Data Transfer + + Source Server : 140 + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : 192.168.1.140:3306 + Source Schema : epmet_gov_access + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 21/01/2022 15:46:57 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for ic_often_use_function +-- ---------------------------- +DROP TABLE IF EXISTS `ic_often_use_function`; +CREATE TABLE `ic_often_use_function` ( + `ID` varchar(32) NOT NULL, + `CUSTOMER_ID` varchar(255) NOT NULL COMMENT '客户ID', + `USER_ID` varchar(255) NOT NULL COMMENT '用户ID', + `MENU_ID` varchar(255) NOT NULL COMMENT '菜单ID', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标记', + `REVISION` varchar(32) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + KEY `user_id` (`USER_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='常用功能'; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.13__ic_individual_category_manage.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.13__ic_individual_category_manage.sql new file mode 100644 index 0000000000..31753118ea --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.13__ic_individual_category_manage.sql @@ -0,0 +1,40 @@ +/* + Navicat Premium Data Transfer + + Source Server : 140 + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : 192.168.1.140:3306 + Source Schema : epmet_oper_customize + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 21/01/2022 15:46:35 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for ic_individual_category_manage +-- ---------------------------- +DROP TABLE IF EXISTS `ic_individual_category_manage`; +CREATE TABLE `ic_individual_category_manage` ( + `ID` varchar(32) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(255) NOT NULL COMMENT '客户ID', + `USER_ID` varchar(255) NOT NULL COMMENT '用户ID', + `COLUMN_ID` varchar(255) DEFAULT NULL, + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标记', + `REVISION` varchar(32) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + KEY `user_id` (`USER_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人分类管理'; + +SET FOREIGN_KEY_CHECKS = 1; From acebd6ce3edef3c9cac053d9780a2dfedd87871c Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 21 Jan 2022 16:28:38 +0800 Subject: [PATCH 62/83] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcResiUserServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 8ccf84a9bb..bfc3d234c8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -18,7 +18,6 @@ package com.epmet.service.impl; import cn.hutool.core.bean.BeanUtil; -import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -523,7 +522,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl gridIds = new ArrayList<>(); Set houseIds = new HashSet<>(); for (Map map : list) { - log.warn(JSON.toJSONString(map)); if (map.containsKey(UserConstant.GRID_ID) && null != map.get(UserConstant.GRID_ID) && StringUtils.isNotBlank(map.get(UserConstant.GRID_ID).toString())) { gridIds.add(map.get(UserConstant.GRID_ID).toString()); } From 1d2d5abb1f12cf8d911cd3eedc33a1740ae96b24 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 21 Jan 2022 16:36:41 +0800 Subject: [PATCH 63/83] =?UTF-8?q?user=E5=8D=87=E7=BA=A7=E5=86=85=E5=AD=98?= =?UTF-8?q?=20512?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 4 ++-- epmet-user/epmet-user-server/deploy/docker-compose-test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 1db18cea79..b5421e4e4e 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -9,10 +9,10 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-user.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./epmet-user.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 300M \ No newline at end of file + memory: 560M diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index d1d7ce6667..5537d14081 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml @@ -9,10 +9,10 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-user.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./epmet-user.jar" restart: "unless-stopped" deploy: resources: limits: cpus: '0.1' - memory: 300M \ No newline at end of file + memory: 560M From 24dad6271a6438d2ad788e83c640390962dcc172 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 21 Jan 2022 16:49:15 +0800 Subject: [PATCH 64/83] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/IcPartyUnitDTO.java | 5 +++++ .../CommunitySelfOrganizationListDTO.java | 6 +++++- .../result/GetListSocietyOrgResultDTO.java | 4 ++++ .../com/epmet/dto/result/ServicePointDTO.java | 17 ++++++++++++++++ .../dto/result/SocietyOrgListResultDTO.java | 2 +- .../com/epmet/dao/IcUserDemandRecDao.java | 11 ++++++++++ .../epmet/service/IcUserDemandRecService.java | 12 +++++++++++ ...cCommunitySelfOrganizationServiceImpl.java | 5 +++++ .../service/impl/IcPartyUnitServiceImpl.java | 11 +++++++++- .../service/impl/IcSocietyOrgServiceImpl.java | 13 +++++++++--- .../impl/IcUserDemandRecServiceImpl.java | 20 +++++++++++++++++++ .../resources/mapper/IcUserDemandRecDao.xml | 20 +++++++++++++++++++ 12 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java index 1782ddf316..ef85be1d31 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java @@ -115,6 +115,11 @@ public class IcPartyUnitDTO implements Serializable { */ private String satisfaction; + /** + * 评分 + */ + private Integer score; + /** * 备注 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java index 47b2c02df8..522da610d1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java @@ -67,7 +67,10 @@ public class CommunitySelfOrganizationListDTO implements Serializable { * 社区自组织ID */ private String orgId; - + /** + * 积分 + */ + private Integer score; /** * 社区自组织人员 */ @@ -84,6 +87,7 @@ public class CommunitySelfOrganizationListDTO implements Serializable { this.longitude = ""; this.latitude = ""; this.orgId = ""; + this.score = NumConstant.ZERO; this.organizationPersonnel = new ArrayList<>(); } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java index 376078ab10..0130b246a7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java @@ -68,6 +68,10 @@ public class GetListSocietyOrgResultDTO implements Serializable { private String longitude; //维度 private String latitude; + /** + * 积分 + */ + private Integer score; } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java new file mode 100644 index 0000000000..5f043c1f16 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/21 15:47 + */ +@Data +public class ServicePointDTO implements Serializable { + private static final long serialVersionUID = -1127819263685687151L; + private String serviceId; + private Integer point; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java index 1650882b84..38a081d2bc 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java @@ -59,5 +59,5 @@ public class SocietyOrgListResultDTO implements Serializable { private String longitude; //维度 private String latitude; - + private Integer score; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index fa34fd7497..f3781ceea6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; import com.epmet.dto.form.demand.PageListAnalysisFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; import com.epmet.dto.result.PointRecordDTO; +import com.epmet.dto.result.ServicePointDTO; import com.epmet.dto.result.demand.*; import com.epmet.entity.IcUserDemandRecEntity; import org.apache.ibatis.annotations.Mapper; @@ -129,4 +130,14 @@ public interface IcUserDemandRecDao extends BaseDao { List getPointRecordList(PointRecordFormDTO formDTO); Integer getTotalPoint(PointRecordFormDTO formDTO); + + /** + * 组织单位积分 + * @Param agencyId + * @Param serviceType + * @Return {@link List< ServicePointDTO>} + * @Author zhaoqifeng + * @Date 2022/1/21 15:53 + */ + List getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 6497e96139..5e86b438ed 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -27,6 +27,7 @@ import com.epmet.dto.result.demand.*; import com.epmet.entity.IcUserDemandRecEntity; import java.util.List; +import java.util.Map; /** * 居民需求记录表 @@ -235,4 +236,15 @@ public interface IcUserDemandRecService extends BaseService} + * @Author zhaoqifeng + * @Date 2022/1/21 16:02 + */ + Map getServicePoint(String customerId, String serviceType); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java index 1bc6fae202..5176518aa2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.IcCommunitySelfOrganizationConstant; +import com.epmet.constant.UserDemandConstant; import com.epmet.dao.IcCommunitySelfOrganizationDao; import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; @@ -279,6 +280,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(tokenDto.getCustomerId(), UserDemandConstant.COMMUNITY_ORG); formDTO.setAgencyId(staffInfo.getAgencyId()); formDTO.setCustomerId(tokenDto.getCustomerId()); final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE}; @@ -290,6 +293,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl { l.setSort(i[NumConstant.ZERO]); i[NumConstant.ZERO]++; + l.setScore(null == pointMap.get(l.getOrgId())?NumConstant.ZERO:pointMap.get(l.getOrgId())); }); result.setList(objectPageInfo.getList()); } @@ -301,6 +305,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl sort = new AtomicReference<>(NumConstant.ONE); resultDTOs.forEach(r -> { r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); + r.setScore(null == pointMap.get(r.getOrgId())?NumConstant.ZERO:pointMap.get(r.getOrgId())); }); result.setList(resultDTOs); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 383b5e58fa..a41e154560 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.UserDemandConstant; import com.epmet.dao.IcPartyUnitDao; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; @@ -108,7 +109,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - + //获取单位积分 + Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { @@ -122,6 +124,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl(dtoList, pageInfo.getTotal()); } @@ -142,6 +145,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //获取单位积分 + Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { @@ -150,6 +155,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } + item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId())); }); return dtoList; } @@ -168,7 +174,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); + dto.setScore(null == pointMap.get(id)?NumConstant.ZERO:pointMap.get(id)); } return dto; } 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 5d2a554c60..e0470c14dd 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 @@ -25,12 +25,16 @@ import com.epmet.commons.tools.exception.RenException; 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.constant.UserDemandConstant; import com.epmet.dao.IcSocietyOrgDao; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.IcSocietyOrgDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.result.*; +import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.OrgInfoResultDTO; +import com.epmet.dto.result.SocietyOrgListResultDTO; +import com.epmet.dto.result.StaffSinGridResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.excel.IcSocietyOrgExcel; @@ -127,7 +131,8 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.SOCIAL_ORG); //2.查询被绑定管理员信息 UserIdsFormDTO dto = new UserIdsFormDTO(); List staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList()); @@ -150,7 +155,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName()))); - + result.getList().forEach(item -> { + item.setScore(null == pointMap.get(item.getSocietyId())?NumConstant.ZERO:pointMap.get(item.getSocietyId())); + }); resultDTO.setList(result.getList()); return resultDTO; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index ffb5bac51c..73e4e939f6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -1684,5 +1684,25 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2022/1/21 16:02 + */ + @Override + public Map getServicePoint(String customerId, String serviceType) { + List list = baseDao.getServicePoint(customerId, serviceType); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(ServicePointDTO::getServiceId, ServicePointDTO::getPoint)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index eb1260f58b..7ea8f22256 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -618,4 +618,24 @@ AND c.EVALUATE_TIME <= #{endTime} + + \ No newline at end of file From 63562c4404a08486e4188519c89418267f667522 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 21 Jan 2022 17:00:03 +0800 Subject: [PATCH 65/83] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/result/ServicePointDTO.java | 2 +- .../java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java index 5f043c1f16..771da76d64 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java @@ -12,6 +12,6 @@ import java.io.Serializable; @Data public class ServicePointDTO implements Serializable { private static final long serialVersionUID = -1127819263685687151L; - private String serviceId; + private String serverId; private Integer point; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 73e4e939f6..433f118f42 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -1702,7 +1702,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl Date: Fri, 21 Jan 2022 17:19:55 +0800 Subject: [PATCH 66/83] =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=94=B9=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IcIndividualCategoryManageServiceImpl.java | 16 ++++++++++------ .../epmet/feign/EpmetUserOpenFeignClient.java | 2 +- .../EpmetUserOpenFeignClientFallback.java | 2 +- .../controller/StatsResiWarnController.java | 4 ++-- .../com/epmet/service/StatsResiWarnService.java | 2 +- .../service/impl/StatsResiWarnServiceImpl.java | 11 ++--------- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java index cd8de6e447..5eeb6ba23a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java @@ -57,16 +57,20 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl(); } - CategoryCountListFormDTO formDTO = new CategoryCountListFormDTO(); - formDTO.setConfigList(result.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList())); - formDTO.setOrgId(staffInfo.getAgencyId()); - Result> list = userOpenFeignClient.getPersonCategoryList(formDTO); + StatsResiListFormDTO formDTO = new StatsResiListFormDTO(); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setLevel("agency"); + formDTO.setId(staffInfo.getAgencyId()); + Result> list = userOpenFeignClient.getPersonCategoryList(formDTO); if (!list.success()){ throw new EpmetException("查询人员分类下人数失败..."); } - List datas = list.getData(); + List datas = list.getData(); + if (CollectionUtils.isEmpty(datas)){ + return result; + } if (CollectionUtils.isNotEmpty(datas)){ - result.forEach( r -> datas.stream().filter( d -> d.getConfigId().equals(r.getWarnConfigId())).forEach(d -> r.setCount(d.getCount()))); + result.forEach( r -> datas.stream().filter( d -> d.getId().equals(r.getId())).forEach(d -> r.setCount(d.getCount()))); } return result; } 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 9c0dd42e93..9cfd689cfc 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 @@ -710,6 +710,6 @@ public interface EpmetUserOpenFeignClient { Result resiRelationInfo(@RequestParam("userId")String userId); @PostMapping("/epmetuser/statsresiwarn/list2") - Result> getPersonCategoryList(@RequestBody CategoryCountListFormDTO formDTO); + Result> getPersonCategoryList(@RequestBody StatsResiListFormDTO 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 5bd1aa581e..bde8bf2e8c 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 @@ -524,7 +524,7 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien } @Override - public Result> getPersonCategoryList(CategoryCountListFormDTO formDTO) { + public Result> getPersonCategoryList(StatsResiListFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPersonCategoryList", formDTO); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java index e02214518a..33855a2b2c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -76,8 +76,8 @@ public class StatsResiWarnController { * @date 2022/1/20 2:11 下午 */ @PostMapping("list2") - public Result> list2(@RequestBody CategoryCountListFormDTO formDTO){ - return new Result>().ok(statsResiWarnService.list2(formDTO)); + public Result> list2(@RequestBody StatsResiListFormDTO formDTO){ + return new Result>().ok(statsResiWarnService.list2(formDTO)); } @PostMapping("buildingwarnlist") diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java index 2b8dcf8263..f0c4e5f5f5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java @@ -41,7 +41,7 @@ public interface StatsResiWarnService{ List list(String customerId,String id, String level); - List list2(CategoryCountListFormDTO formDTO); + List list2(StatsResiListFormDTO formDTO); void resiWarn(String customerId); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 10710e8437..4d357ec43f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -197,15 +197,8 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { } @Override - public List list2(CategoryCountListFormDTO formDTO) { - if (CollectionUtils.isEmpty(formDTO.getConfigList())){ - return new ArrayList<>(); - } - List result = icStatsResiWarnDao.selectCategoryCount(formDTO.getConfigList(), formDTO.getOrgId()); - if (CollectionUtils.isEmpty(result)){ - return new ArrayList<>(); - } - return ConvertUtils.sourceToTarget(result,CategoryCountListResultDTO.class); + public List list2(StatsResiListFormDTO formDTO) { + return list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel()); } /** From a8aef62c406ebdbc3b080ef7d481b994f5e38ae4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 21 Jan 2022 17:24:31 +0800 Subject: [PATCH 67/83] =?UTF-8?q?=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcResiUserServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index b9c876cbb7..fddb3f1f43 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; From 182ae42e4d6b58df667cd6dd7d27936ed6a17b35 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 24 Jan 2022 10:39:34 +0800 Subject: [PATCH 68/83] =?UTF-8?q?userwarnlist=E6=97=A7=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/IcStatsResiWarnUserResultDTO.java | 1 + .../dto/result/UserWarnNameListResultDTO.java | 24 ++++++++++++++++++ .../com/epmet/dao/IcStatsResiWarnDao.java | 6 +++++ .../impl/StatsResiWarnServiceImpl.java | 25 ++++++++++++++----- .../resources/mapper/IcStatsResiWarnDao.xml | 25 +++++++++++++++++++ 5 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWarnNameListResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java index 4cd3332dca..63d55d69c0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java @@ -43,5 +43,6 @@ public class IcStatsResiWarnUserResultDTO implements Serializable { private String neighborhoodName; private String buildingName; private String residentNames; + private List userList; } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWarnNameListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWarnNameListResultDTO.java new file mode 100644 index 0000000000..f1d6690b46 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWarnNameListResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/24 10:25 上午 + * @DESC + */ +@Data +public class UserWarnNameListResultDTO implements Serializable { + + private static final long serialVersionUID = 6695538440686292540L; + + @JsonIgnore + private String buildingId; + + private String residentName; + + private String userId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java index aeb0c2ca82..086bf7ca0f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.PersonWarnLeftPieDTO; +import com.epmet.dto.result.UserWarnNameListResultDTO; import com.epmet.entity.IcStatsResiWarnEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,6 +44,11 @@ public interface IcStatsResiWarnDao extends BaseDao { @Param("tableName") String tableName, @Param("columnName") String columnName); + List userWarnListDTO(@Param("customerId") String customerId, + @Param("buildingIdList") List buildingIdList, + @Param("tableName") String tableName, + @Param("columnName") String columnName); + Integer countListByLevelAndCol( @Param("customerId") String customerId, @Param("tableName") String tableName, diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 4d357ec43f..5947a62259 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -159,12 +159,25 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { IcResiCategoryWarnConfigDTO icResiCategoryWarnConfigDTO = warnResult.getData(); //根据buildingID,tableName he columnName获取名字 - List> maps = icStatsResiWarnDao.userWarnList(customerId,buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); - result.forEach(item->{ - item.setConfigId(configId); - List> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList()); - item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames")); - }); +// List> maps = icStatsResiWarnDao.userWarnList(customerId,buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); + List dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); +// result.forEach(item->{ +// item.setConfigId(configId); +// List> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList()); +// item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames")); +// }); + if (!CollectionUtils.isEmpty(dtos)){ + Map> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); + result.forEach(item->{ + item.setConfigId(configId); + groupByBuild.forEach((k,v) -> { + if (item.getBuildingId().equals(k)){ + item.setUserList(v); + } + }); + }); + } + return mapResult; } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index b1a900968b..bc3b4e769a 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -147,4 +147,29 @@ ) GROUP BY CONFIG_ID + + + \ No newline at end of file From 69407626f21674d8545ab62adde376367001e62f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 24 Jan 2022 14:13:48 +0800 Subject: [PATCH 69/83] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E6=90=9C=E7=B4=A2(=E5=B1=85=E6=B0=91)=EF=BC=9Aconditi?= =?UTF-8?q?ons=E4=B8=BAnull=E7=9A=84bug=202.=E7=A4=BE=E5=8C=BA=E6=90=9C?= =?UTF-8?q?=E7=B4=A2(=E6=88=BF=E5=B1=8B)=EF=BC=9A=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-org-server/src/main/resources/mapper/IcHouseDao.xml | 2 +- .../main/java/com/epmet/controller/IcResiUserController.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 7411fb6575..01e2276fac 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -130,7 +130,7 @@ LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0' - AND c.AGENCY_PIDS like CONCAT(#{pids},'%') + AND CONCAT(c.AGENCY_PIDS,':',c.AGENCY_ID) like CONCAT(#{pids},'%') AND a.BUILDING_ID = #{buildingId} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 9c2113a603..1350ce159f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -660,6 +660,7 @@ public class IcResiUserController { input.setCustomerId(loginUser.getCustomerId()); input.setStaffId(loginUser.getUserId()); input.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); + input.setConditions(new ArrayList<>()); if (input.getPageNo() == null) { input.setPageNo(NumConstant.ONE); } From 10c1766501ba0e4ef85df2c1444c207d764415dc Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 25 Jan 2022 10:59:38 +0800 Subject: [PATCH 70/83] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E5=AF=BC=E5=85=A5excel=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E3=80=81=E4=BB=A5=E5=8F=8A=E6=B3=A8=E9=87=8A=E7=9A=84=E4=B8=B0?= =?UTF-8?q?=E5=AF=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcResiUserImportServiceImpl.java | 165 +++++++++--------- 1 file changed, 80 insertions(+), 85 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 7e8a5166e1..89e4161d90 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -17,9 +17,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; -import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; -import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcResiUserDao; @@ -73,14 +71,14 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res public static final ThreadLocal>> skipedRows = new ThreadLocal<>(); /** - * 类别发生变更的居民 + * 导入的居民中,新增或者变动的居民 */ - public static final ThreadLocal categoryChangedResi = new ThreadLocal<>(); + public static final ThreadLocal newlyChangedResi = new ThreadLocal<>(); /** - * 居民类别items列表 + * 居民类别items列表。 */ - public static final ThreadLocal> resiCategoryItemsCache = new ThreadLocal<>(); + public static final ThreadLocal> resiCategoryColumnNameAndLabel = new ThreadLocal<>(); /** * key: itemId @@ -249,10 +247,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } // 执行人员类别变更记录 - Map newResis = categoryChangedResi.get().getNewResis(); - // todo 此处没测试 - Map categoryChangedResis = categoryChangedResi.get().getCategoryChangedResis(); - Map transferedResis = categoryChangedResi.get().getTransferedResis(); + Map newResis = newlyOrChangedResi.get().getNewResis(); + Map categoryChangedResis = newlyOrChangedResi.get().getCategoryChangedResis(); + Map transferedResis = newlyOrChangedResi.get().getTransferedResis(); //保存调动或者变更记录 saveNewResiCategoryRecord(newResis); @@ -267,8 +264,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } finally { skipedRows.remove(); errorRows.remove(); - categoryChangedResi.remove(); - resiCategoryItemsCache.remove(); + newlyOrChangedResi.remove(); + resiCategoryColumnNameAndLabel.remove(); itemIdAndOptionsCache.invalidateAll(); } } @@ -293,7 +290,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 居民类别信息 ResiImportResiCategoryChangedCache c = new ResiImportResiCategoryChangedCache(); - categoryChangedResi.set(c); + newlyOrChangedResi.set(c); List resiCategoryItems = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listResiCategoryItems(customerId), ServiceConstant.OPER_CUSTOMIZE_SERVER, @@ -303,7 +300,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res Map columnNameAndLabel = resiCategoryItems.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel())); - resiCategoryItemsCache.set(columnNameAndLabel); + resiCategoryColumnNameAndLabel.set(columnNameAndLabel); } /** @@ -326,16 +323,17 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res List> headList = readListener.getHeadList(); List> dataList = readListener.getDataList(); - Map> headers = mergeHead(headList); + // 合并多级表头到一个list中,key为列序号 + Map> headers = mergeMultiLevelHeadLabels(headList); - // 清洗表头数据 - Map abandonedHeaders = washHeaders(headers, formItemList); + // 清洗表头数据,通过items剔除,并且得到options + Map abandonedHeaders = removeAndGetOptionsFromHeaders(headers, formItemList); - //合并多级表头 - HashMap> combinedHeaders = combineHeaders(headers); + // 交换表头信息,以label连起来的string作为key,列号的列表作为value + HashMap> combinedHeaders = exchangeKeyAndValueOfHeaders(headers); - // 得到客户配置item数据 - Map formItemMap = formItemList.stream().collect( + // 得到客户配置item数据。<"兴趣爱好:兴趣特长", item对象> + Map customizedLabelCompbinedItemsMap = formItemList.stream().collect( Collectors.toMap(formItem -> { String groupLabel = formItem.getGroupLabel(); String label = formItem.getLabel(); @@ -346,10 +344,11 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } }, formItem -> formItem) ); - Map headerColumnWrapper = convertExcelHeaders2DBColumnWrappers(formItemMap, combinedHeaders, dataList, abandonedHeaders); + + Map itemIdAndColumnWrapper = convertExcelHeaders2DBColumnWrappers(customizedLabelCompbinedItemsMap, combinedHeaders); // 持久化 - persistIcResiBaseInfo(headerColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, currUserAgencyPids, currentUserId, tableName); + persistIcResiBaseInfo(itemIdAndColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, currUserAgencyPids, currentUserId, tableName); return headers; } @@ -374,15 +373,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res List> headList = readListener.getHeadList(); List> dataList = readListener.getDataList(); - Map> headers = mergeHead(headList); + Map> headers = mergeMultiLevelHeadLabels(headList); - // 清洗表头数据 - Map abandonedHeaders = washHeaders(headers, formItemList); + Map abandonedHeaders = removeAndGetOptionsFromHeaders(headers, formItemList); - //合并多级表头 - HashMap> combinedHeaders = combineHeaders(headers); + HashMap> combinedHeaders = exchangeKeyAndValueOfHeaders(headers); - // 得到客户配置item数据 Map formItemMap = formItemList.stream().collect( Collectors.toMap(formItem -> { String groupLabel = formItem.getGroupLabel(); @@ -394,19 +390,19 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } }, formItem -> formItem) ); - Map headerColumnWrapper = convertExcelHeaders2DBColumnWrappers(formItemMap, combinedHeaders, dataList, abandonedHeaders); + Map headerColumnWrapper = convertExcelHeaders2DBColumnWrappers(formItemMap, combinedHeaders); persistIcResiExtraInfo(headerColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, currentUserId, targetTableName, customerId); return headerColumnWrapper; } /** * 持久化IC居民基础信息 - * @param headerColumnWrapper 数据库列包装信息 + * @param itemIdAndColumnWrapper 数据库列包装信息 * @param dataRows 数据行集合 * @param currUserAgencyId 当前用户的组织id * @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 */ - private void persistIcResiBaseInfo(Map headerColumnWrapper, List> dataRows, + private void persistIcResiBaseInfo(Map itemIdAndColumnWrapper, List> dataRows, String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, String currUserAgencyPids, String currentUserId, String tableName) { @@ -415,8 +411,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res LinkedHashMap columnAndValues = new LinkedHashMap<>(); try { - convertColumnWrappers2Map4Persist(headerColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues); + convertColumnWrappers2Map4Persist(itemIdAndColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues); + // 因为还没有读取子sheet,所以这些居民类别没有办法获取,先默认设置成0,后面读取子sheet的时候再更新 columnAndValues.put("IS_ENSURE_HOUSE", "0"); columnAndValues.put("IS_OLD_PEOPLE", "0"); columnAndValues.put("IS_PARTY", "0"); @@ -447,12 +444,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 任意组织维度一个发生变化,则放到调动居民缓存中 ResiImportChangedData transferData; if ((transferData = this.getResiImportTrasferData(existingResiMap, columnAndValues)) != null) { - categoryChangedResi.get().getTransferedResis().put(existingResiMap.get("ID"), transferData); + newlyOrChangedResi.get().getTransferedResis().put(existingResiMap.get("ID"), transferData); } else { // 组织维度没有发生变化,看是否有居民类型变更 ResiImportChangedData d = getResiImportCategoryChangedData(existingResiMap, columnAndValues); if (d != null) { - categoryChangedResi.get().getCategoryChangedResis().put(existingResiMap.get("ID"), d); + newlyOrChangedResi.get().getCategoryChangedResis().put(existingResiMap.get("ID"), d); } } } else { @@ -461,19 +458,20 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); icResiUserDao.add(tableName, columnAndValues); - Map categories = resiCategoryItemsCache.get().keySet() + // 过滤出本居民含有哪些类别 + Map resiCategories = resiCategoryColumnNameAndLabel.get().keySet() .stream() .filter((categoryColumnName) -> "1".equals(columnAndValues.get(categoryColumnName))) .collect(Collectors.toMap((k) -> k, (k) -> columnAndValues.get(k))); - categoryChangedResi.get().getNewResis().put(columnAndValues.get("ID"), + newlyOrChangedResi.get().getNewResis().put(columnAndValues.get("ID"), new ResiImportCategoryData(columnAndValues.get("AGENCY_ID"), columnAndValues.get("GRID_ID"), columnAndValues.get("VILLAGE_ID"), columnAndValues.get("BUILD_ID"), columnAndValues.get("UNIT_ID"), columnAndValues.get("HOME_ID"), - categories)); + resiCategories)); } } catch (Exception e) { @@ -604,13 +602,13 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res /** * 将当前行数据转化成LinkedHashMap,供后续插入 - * @param headerColumnWrapper 当前行的ColumnWrapper,每一个ColumnWrapper元素都是当前行中的一个列 + * @param itemIdAndColumnWrappers 当前行的ColumnWrapper,每一个ColumnWrapper元素都是当前行中的一个列,key:itemId * @param row 当前行数据 * @param currUserAgencyId 当前用户所属机构ID * @param checkBoxOptionColumnIdxAndLabel 复选框options列表。key:列号,value:复选框中文 * @param target 要将数据放到哪个对象中 */ - private void convertColumnWrappers2Map4Persist(Map headerColumnWrapper, Map row, + private void convertColumnWrappers2Map4Persist(Map itemIdAndColumnWrappers, Map row, String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, LinkedHashMap target) { @@ -618,9 +616,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res List errorColumnNames = new LinkedList<>(); - for (Map.Entry columnWrapperEntry : headerColumnWrapper.entrySet()) { + for (Map.Entry itemIdAndColumnWrapper : itemIdAndColumnWrappers.entrySet()) { - ColumnWrapper columnWrapper = columnWrapperEntry.getValue(); + ColumnWrapper columnWrapper = itemIdAndColumnWrapper.getValue(); if ("input".equals(columnWrapper.getItemType()) || "textarea".equals(columnWrapper.getItemType()) || "datepicker".equals(columnWrapper.getItemType()) @@ -646,10 +644,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res columnWrapper.setColValue(colValue); } else { // remote类型。优先从缓存取 - Map optionsOfItem = itemIdAndOptionsCache.getIfPresent(columnWrapperEntry.getKey()); + Map optionsOfItem = itemIdAndOptionsCache.getIfPresent(itemIdAndColumnWrapper.getKey()); if (optionsOfItem == null || optionsOfItem.size() == 0) { - optionsOfItem = listRemoteOptions(headerColumnWrapper, columnWrapper.getOptionSourceValue(), currUserAgencyId, "saveorupdate"); - itemIdAndOptionsCache.put(columnWrapperEntry.getKey(), optionsOfItem); + optionsOfItem = listRemoteOptions(itemIdAndColumnWrappers, columnWrapper.getOptionSourceValue(), currUserAgencyId, "saveorupdate"); + itemIdAndOptionsCache.put(itemIdAndColumnWrapper.getKey(), optionsOfItem); } String colValue = optionsOfItem.get(cellContent); columnWrapper.setColValue(colValue); @@ -674,22 +672,22 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } /** - * @description 合并头 + * @description 调换表头信息。将中文label做key,列号list作value(因为复选框的原因,会出现相同的label对应多个列号,以兴趣特长为例) * - * @param headers - * @return + * @param headers 例: <38:[兴趣爱好,兴趣特长]> <39:[兴趣爱好,兴趣特长]> <40:[兴趣爱好,兴趣特长]>... + * @return <"兴趣爱好,兴趣特长":[38,39,40...]> * @author wxz * @date 2021.10.28 21:27:18 */ - private HashMap> combineHeaders(Map> headers) { + private HashMap> exchangeKeyAndValueOfHeaders(Map> headers) { HashMap> itemAndColIndexs = new LinkedHashMap<>(); headers.forEach((k, v) -> { - String tempKey = String.join(":", v); - List colIndexs = itemAndColIndexs.get(tempKey); + String combinedHeaderLabels = String.join(":", v); + List colIndexs = itemAndColIndexs.get(combinedHeaderLabels); if (colIndexs == null) { colIndexs = new ArrayList<>(); - itemAndColIndexs.put(tempKey, colIndexs); + itemAndColIndexs.put(combinedHeaderLabels, colIndexs); } colIndexs.add(k); }); @@ -698,56 +696,54 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } /** - * @description 洗头 + * @description 复选框在excel中体现为多个列,他们在oper_customize.items表中不存在,所以要从headers中剔除这部分。然后将剔除的部分返回 * - * @param headers - * @param items - * @return + * @param headers excel表头。 <列号:中文label列表> + * @param items customize库中查询出来的,items的列表 + * @return 被移除的options * @author wxz * @date 2021.10.28 21:07:12 */ - private Map washHeaders(Map> headers, List items) { + private Map removeAndGetOptionsFromHeaders(Map> headers, List items) { List itemLabels = items.stream().map(i -> i.getLabel()).collect(Collectors.toList()); - Map abandonedHeaders = new HashMap<>(); + Map abandonedOptions = new HashMap<>(); for (Map.Entry> entry:headers.entrySet()) { - Integer colIdx = entry.getKey(); - List v = entry.getValue(); - int lastPartIndex = v.size() - 1; - String lastValuePart = v.get(lastPartIndex); - if (!itemLabels.contains(lastValuePart)) { + Integer columnIndex = entry.getKey(); + List headerLabels = entry.getValue(); + int lastLevelHeaderLevel = headerLabels.size() - 1; + // 最后一集header的中文label + String lastLevelHeaderLabel = headerLabels.get(lastLevelHeaderLevel); + if (!itemLabels.contains(lastLevelHeaderLabel)) { // 该部分为options,它的上一级是item,那么去掉options这一级 - v.remove(lastPartIndex); - abandonedHeaders.put(colIdx, lastValuePart); + headerLabels.remove(lastLevelHeaderLevel); + abandonedOptions.put(columnIndex, lastLevelHeaderLabel); } } - return abandonedHeaders; + return abandonedOptions; } /** * @description 数据整合,将excel表头汉字信息转化成ColumnWrapper列封装数据 * * key:itemId * * value:ColumnWrapper列包装信息 - * @param formItemMap item map + * @param customizedLabelCompbinedItemsMap item map * key:itemId; * value: 合并之后的head字符串,例如:健康信息:监护人 * @param combinedHeaders 合并之后的head信息。 * key:合并之后head字符串(例如:党员信息:入党时间); * value:列号组成的列表(例如[1,2,3]) - * @param datas - * @param abandonedHeaders - * @return + * @return key:itemId;value:columnWrapper */ - private Map convertExcelHeaders2DBColumnWrappers(Map formItemMap, Map> combinedHeaders, - List> datas, Map abandonedHeaders) { + private Map convertExcelHeaders2DBColumnWrappers(Map customizedLabelCompbinedItemsMap, Map> combinedHeaders) { // HashMap> tables = new HashMap<>(); Map columns = new LinkedHashMap<>(combinedHeaders.size()); - for (Map.Entry> entry : combinedHeaders.entrySet()) { - String combinedHeader = entry.getKey(); + for (Map.Entry> labelAndColumnIndexs : combinedHeaders.entrySet()) { + String combinedHeader = labelAndColumnIndexs.getKey(); - FormItemResult item = formItemMap.get(combinedHeader); + FormItemResult item = customizedLabelCompbinedItemsMap.get(combinedHeader); if (item == null) { // 如果数据库中没有该项,可能是用户自己定义的项,忽略 @@ -766,7 +762,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String combinedLabel = StringUtils.isBlank(groupLabel) ? item.getLabel() : groupLabel.concat(":").concat(item.getLabel()); columnWrapper.setCombinedLabel(combinedLabel); columnWrapper.setColumnName((columnNum == null || columnNum == 0) ? columnName : columnName + columnNum); - columnWrapper.setColIndex(entry.getValue()); + columnWrapper.setColIndex(labelAndColumnIndexs.getValue()); columnWrapper.setRequired(item.getRequired()); columnWrapper.setOptionSourceType(item.getOptionSourceType()); @@ -802,15 +798,14 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } /** - * @description 合并表头 - * Map> + * @description 合并多级表头,竖着将多级表头放入同一个list,然后以列号为key,list为value,放入map * - * @param headList - * @return + * @param headList 表头列表,每一个元素都是一行表头。Map结构:<列号:某级表头中文> + * @return 表头列表,Map结构:<列号:[一级表头中文,二级表头中文,三级表头中文]> * @author wxz * @date 2021.10.27 16:17:34 */ - private Map> mergeHead(List> headList) { + private Map> mergeMultiLevelHeadLabels(List> headList) { Map lastNotNullHeads = new LinkedHashMap<>(); @@ -1045,7 +1040,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res HashMap existingResiCategories = new HashMap<>(); HashMap newResiCategories = new HashMap<>(); - for (String categoryColumnName : resiCategoryItemsCache.get().keySet()) { + for (String categoryColumnName : resiCategoryColumnNameAndLabel.get().keySet()) { String oldCategoryValue = existingResiMap.get(categoryColumnName); String newCategoryValue = newResiMap.get(categoryColumnName); @@ -1091,7 +1086,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res HashMap oldCategories = new HashMap<>(); HashMap newCategories = new HashMap<>(); - Set categoryColumnNames = resiCategoryItemsCache.get().keySet(); + Set categoryColumnNames = resiCategoryColumnNameAndLabel.get().keySet(); for (String categoryColumnName : categoryColumnNames) { String existingColumnValue = existingResiMap.get(categoryColumnName); String newColumnValue = newResiMap.get(categoryColumnName); @@ -1142,7 +1137,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res */ private void saveSubTableInfoToCategoryChangedResiCache(String icResiId, String columnName) { - ResiImportResiCategoryChangedCache cc = categoryChangedResi.get(); + ResiImportResiCategoryChangedCache cc = newlyOrChangedResi.get(); Map newResis = cc.getNewResis(); Map categoryChangedResis = cc.getCategoryChangedResis(); Map transferedResis = cc.getTransferedResis(); @@ -1224,7 +1219,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String beforeValueName = "0".equals(oldColumnValue) ? "否" : "是"; String newValueName = "0".equals(newColumnValue) ? "否" : "是"; - String label = resiCategoryItemsCache.get().get(columnName); + String label = resiCategoryColumnNameAndLabel.get().get(columnName); sbBefore.append(label).append(":").append(beforeValueName).append("\n"); sbAfter.append(label).append(":").append(newValueName).append("\n"); From cf5f86dd793607e1788608297af4978b25c3a6c8 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 25 Jan 2022 11:06:48 +0800 Subject: [PATCH 71/83] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=94=99=E8=AF=AF=EF=BC=8C=E7=BC=96=E8=AF=91=E4=B8=8D?= =?UTF-8?q?=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcResiUserImportServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 89e4161d90..8bc57fdc3b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -73,7 +73,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res /** * 导入的居民中,新增或者变动的居民 */ - public static final ThreadLocal newlyChangedResi = new ThreadLocal<>(); + public static final ThreadLocal newlyOrChangedResi = new ThreadLocal<>(); /** * 居民类别items列表。 From caf71e1e3b8fcac51c5187e9b1a6a6f18754346f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 25 Jan 2022 19:33:48 +0800 Subject: [PATCH 72/83] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=201.=E8=B0=83?= =?UTF-8?q?=E5=8A=A8=E5=B1=85=E6=B0=91=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E5=A2=9E=E5=8A=A0=E4=BA=86=E8=B0=83=E5=8A=A8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E6=B2=A1=E5=A2=9E=E5=8A=A0=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcResiUserImportServiceImpl.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 8bc57fdc3b..fa540e5334 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -1406,32 +1406,38 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res newAgencyId, newGridId, newvillageId, newBuildId, newUnitId, newHomeId, oldOrg, newOrg); icUserTransferRecordDao.insert(transferRecord); - // 保存 changeRecord - IcUserChangeRecordEntity changeRecord = fillChangeRecord(customerId, resiId, resiInfo.getName(), transferRecord.getId(), operator.getStaffId(), + // 保存 调动changeRecord + IcUserChangeRecordEntity transferChangeRecord = fillChangeRecord(customerId, resiId, resiInfo.getName(), transferRecord.getId(), operator.getStaffId(), operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "transfer", "调动", "", now); - icUserChangeRecordDao.insert(changeRecord); + icUserChangeRecordDao.insert(transferChangeRecord); + + // 保存 类别变更changeRecord + IcUserChangeRecordEntity categoryChangeRecord = fillChangeRecord(customerId, resiId, resiInfo.getName(), transferRecord.getId(), operator.getStaffId(), + operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "category", "类别", "", now); + icUserChangeRecordDao.insert(categoryChangeRecord); // 保存 changeDetail for (Map.Entry oldCategories : oldData.getCategories().entrySet()) { String key = oldCategories.getKey(); - String value = oldCategories.getValue(); + // String value = oldCategories.getValue(); // 之前是这个类型,那这个类型需要-1 - IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, changeRecord.getId(), oldData.getAgencyId(), + IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, categoryChangeRecord.getId(), oldData.getAgencyId(), oldData.getGridId(), oldData.getVillageId(), oldData.getBuildId(), oldData.getUnitId(), - oldData.getHomeId(), "category", "调动", key, -1, resiInfo.getPids()); + oldData.getHomeId(), categoryChangeRecord.getType(), categoryChangeRecord.getTypeName(), key, -1, resiInfo.getPids()); icUserChangeDetailedDao.insert(changeDetail); } + // 保存 changeDetail for (Map.Entry newCategories : newData.getCategories().entrySet()) { String key = newCategories.getKey(); - String value = newCategories.getValue(); + // String value = newCategories.getValue(); // 现在是这个类型,这个类型要+1 - IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, changeRecord.getId(), newData.getAgencyId(), + IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, categoryChangeRecord.getId(), newData.getAgencyId(), newData.getGridId(), newData.getVillageId(), newData.getBuildId(), newData.getUnitId(), - newData.getHomeId(), "category", "调动", key, 1, resiInfo.getPids()); + newData.getHomeId(), categoryChangeRecord.getType(), categoryChangeRecord.getTypeName(), key, 1, resiInfo.getPids()); icUserChangeDetailedDao.insert(changeDetail); } From 4623a8fe8e6b136bc6060f656e0d2d9fc200eedc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 Jan 2022 08:36:48 +0800 Subject: [PATCH 73/83] =?UTF-8?q?/heart/serviceitem/dict-list=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=8F=82type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/demand/ServiceItemSelectFormDTO.java | 24 ++++++++++++++++++ .../IcServiceItemDictController.java | 7 ++++-- .../service/IcServiceItemDictService.java | 8 ++++++ .../impl/IcServiceItemDictServiceImpl.java | 25 +++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemSelectFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemSelectFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemSelectFormDTO.java new file mode 100644 index 0000000000..1d836fd259 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemSelectFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +public class ServiceItemSelectFormDTO implements Serializable { + private static final long serialVersionUID = 1689002457565460495L; + + public interface AddUserInternalGroup { + } + /** + * all:查询全部 + * usable:可用的 + * 默认查询全部 + */ + private String type; + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java index d6234d4a2c..12b617b6bc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; +import com.epmet.dto.form.demand.ServiceItemSelectFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; @@ -79,7 +80,9 @@ public class IcServiceItemDictController { * @return */ @PostMapping("dict-list") - public Result> queryDictList(@LoginUser TokenDto tokenDto){ - return new Result>().ok(icServiceItemDictService.queryDictList(tokenDto.getCustomerId())); + public Result> queryDictList(@LoginUser TokenDto tokenDto,@RequestBody ServiceItemSelectFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,ServiceItemSelectFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icServiceItemDictService.queryDictListForSelect(formDTO)); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java index fc671c3cdc..4e704aff54 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; +import com.epmet.dto.form.demand.ServiceItemSelectFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; @@ -62,4 +63,11 @@ public interface IcServiceItemDictService extends BaseService queryDictList(String customerId); + + /** + * 前端调用此接口 + * @param formDTO + * @return + */ + List queryDictListForSelect(ServiceItemSelectFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index 2d5e5a530d..76e431aa44 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dao.IcServiceItemDictDao; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; +import com.epmet.dto.form.demand.ServiceItemSelectFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; @@ -146,5 +147,29 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl queryDictListForSelect(ServiceItemSelectFormDTO formDTO) { + List resultList = new ArrayList<>(); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId()) + .eq(StringUtils.isNotBlank(formDTO.getType()) && "usable".equals(formDTO.getType()), IcServiceItemDictEntity::getUsableFlag, true) + .orderByAsc(IcServiceItemDictEntity::getSort); + List list=baseDao.selectList(query); + for(IcServiceItemDictEntity entity:list){ + OptionDTO optionDTO=new OptionDTO(); + optionDTO.setLabel(entity.getCategoryName()); + optionDTO.setValue(entity.getCategoryCode()); + optionDTO.setAwardPoint(entity.getAwardPoint()); + resultList.add(optionDTO); + } + return resultList; + } + } \ No newline at end of file From d00fe79c459a43592db2bcc70b01b4c751978104 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Jan 2022 09:10:10 +0800 Subject: [PATCH 74/83] =?UTF-8?q?=E6=97=A7=E6=8E=A5=E5=8F=A3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=96=B0=E7=9A=84=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcStatsResiWarnDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index bc3b4e769a..5e05bda2ef 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -61,6 +61,7 @@ select count(*) from ic_resi_user where 1=1 + AND STATUS = '0' and ${columnName} = '1' From 71bfa9058271a355ebc58416e425da58c5e99a56 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 Jan 2022 09:33:48 +0800 Subject: [PATCH 75/83] =?UTF-8?q?=E9=9C=80=E6=B1=82=E6=8C=87=E6=B4=BE?= =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=B8=8E=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=80=E8=87=B4=EF=BC=9A=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E7=BB=84=E7=BB=87=E5=BB=BA=E7=AB=8B=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcSocietyOrgServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 e0470c14dd..6542740821 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 @@ -19,7 +19,6 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; @@ -176,14 +175,15 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl agencyIds = new ArrayList<>(); - if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { + //2022.01.26与社会组织列表一直,查询当前工作人员所属组织建立的社会组织 + /*if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) { agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); }else{ //当前用户属于第二级组织的人,不会有: agencyIds.add(staffInfoCacheResult.getAgencyPIds()); } - } + }*/ agencyIds.add(staffInfoCacheResult.getAgencyId()); resultList = baseDao.selectListByAgencyId(agencyIds, formDTO.getServiceName(), formDTO.getCustomerId(), formDTO.getQueryPurpose()); return resultList; From 5bb47453ac3f8ef81ee6b3fc8963828d08a811d8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 Jan 2022 09:38:38 +0800 Subject: [PATCH 76/83] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E5=88=86=E6=9E=90=E7=BB=9F=E8=AE=A1=E5=BA=93=EF=BC=8C=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...8__fact_icuser_category_analysis_daily.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.28__fact_icuser_category_analysis_daily.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.28__fact_icuser_category_analysis_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.28__fact_icuser_category_analysis_daily.sql new file mode 100644 index 0000000000..530d2d1dfc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.28__fact_icuser_category_analysis_daily.sql @@ -0,0 +1,21 @@ +CREATE TABLE `fact_icuser_category_analysis_daily` ( + `ID` varchar(32) NOT NULL COMMENT '主键(人员类别分析表)', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户id', + `CONFIG_ID` varchar(64) NOT NULL COMMENT '预警配置ID', + `COLUMN_NAME` varchar(32) NOT NULL COMMENT '列名', + `DATE_ID` varchar(8) NOT NULL COMMENT '当前数据是截止到XXX的:yyyyMMdd', + `ORG_ID` varchar(32) NOT NULL COMMENT '网格id或者组织id', + `ORG_TYPE` varchar(10) NOT NULL COMMENT 'grid或者agency', + `PID` varchar(32) NOT NULL COMMENT 'orgid的上级', + `PIDS` varchar(255) NOT NULL COMMENT 'orgid的所有上级', + `TOTAL` int(11) NOT NULL COMMENT '当前类别总人数', + `QR_INCR` int(11) NOT NULL COMMENT '较上月迁入', + `QC_INCR` int(11) NOT NULL COMMENT '较上月迁出', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='人员类别分析(目前只统计了网格)'; \ No newline at end of file From 56e0b689374c55026838c8912ed8f131f1685d4d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 26 Jan 2022 09:53:29 +0800 Subject: [PATCH 77/83] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcUserChangeRecordServiceImpl.java | 2 ++ .../epmet/service/impl/IcUserTransferRecordServiceImpl.java | 5 +++-- .../src/main/resources/mapper/IcResiUserDao.xml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 4241e3428b..8567a7c165 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -248,7 +248,9 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl" + changeList.size()); icUserChangeRecordService.insertBatch(changeList); + log.info("初始变更记录明细数据,总条数->" + detailedList.size()); icUserChangeDetailedService.insertBatch(detailedList); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index 9d1470f253..7f8fa309cb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java @@ -41,6 +41,7 @@ import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.IcUserChangeDetailedService; import com.epmet.service.IcUserChangeRecordService; import com.epmet.service.IcUserTransferRecordService; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -161,13 +162,13 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl - LEFT JOIN ic_user_change_record iucr ON iru.id = iucr.ic_user_id AND iucr.type = 'add' + LEFT JOIN ic_user_change_record iucr ON iru.id = iucr.ic_user_id AND iucr.type = 'add' AND iucr.del_flag = '0' WHERE iucr.ic_user_id IS NULL AND iru.del_flag = '0' From c0a8544306be641f5aa38fdb81c8ddaac4386cbc Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Jan 2022 10:00:10 +0800 Subject: [PATCH 78/83] bug --- .../com/epmet/dao/IcStatsResiWarnDao.java | 2 ++ .../impl/IcStatsResiWarnServiceImpl.java | 30 ++++++++++++++----- .../main/resources/mapper/IcResiUserDao.xml | 1 + .../resources/mapper/IcStatsResiWarnDao.xml | 30 ++++++++++++------- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java index 086bf7ca0f..09c0d6979d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java @@ -74,4 +74,6 @@ public interface IcStatsResiWarnDao extends BaseDao { */ List selectCategoryCount(@Param("configIds") List configIds,@Param("agencyId")String agencyId); + List> selectCategoryCountByColumn(@Param("columnNames") List columnNames,@Param("agencyId")String agencyId); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java index c540ac1723..42bf629675 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java @@ -20,6 +20,7 @@ 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.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; @@ -44,10 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -144,9 +142,27 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList()), staffInfo.getAgencyId()); - if (CollectionUtils.isNotEmpty(dtos)){ - list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount()))); +// List dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList()), staffInfo.getAgencyId()); + List columns = configList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()); + List> maps = baseDao.selectCategoryCountByColumn(columns, staffInfo.getAgencyId()); +// if (CollectionUtils.isNotEmpty(dtos)){ +// list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount()))); +// } + Map columnCount = new HashMap<>(16); + if (CollectionUtils.isNotEmpty(maps)){ + columns.forEach(c -> { + Map>> groupByColumn = maps.stream().collect(Collectors.groupingBy((Map m) -> m.get(c))); + columnCount.put(c,CollectionUtils.isNotEmpty(groupByColumn.get(NumConstant.ONE_STR)) ? groupByColumn.get(NumConstant.ONE_STR).size() : NumConstant.ZERO); + }); + } + if (!org.springframework.util.CollectionUtils.isEmpty(columnCount)){ + list.forEach(l -> { + columnCount.forEach((k,v) -> { + if (l.getTypeCode().equals(k)){ + l.setTypeCount(v); + } + }); + }); } result.setTotal(list.stream().collect(Collectors.summingInt(PersonWarnLeftPieResultDTO.PersonWarnLeftPie::getTypeCount))); result.setList(list); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 661f6729c4..685b7c8d39 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -554,6 +554,7 @@ FROM ic_resi_user WHERE DEL_FLAG = 0 + AND STATUS = '0' AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{orgId},'%') AND( diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index 5e05bda2ef..608d10d5cd 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -151,26 +151,36 @@ + + \ No newline at end of file From 61331fe011c8468572387b9be9b9fbd772dd0c92 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 26 Jan 2022 10:24:16 +0800 Subject: [PATCH 79/83] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcUserChangeRecordServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 8567a7c165..c633efc473 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -206,7 +206,7 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl Date: Wed, 26 Jan 2022 11:10:31 +0800 Subject: [PATCH 80/83] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=A0=E9=99=A4=20?= =?UTF-8?q?=E5=88=86=E6=89=B9=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/IcUserChangeDetailedDao.java | 4 +++- .../java/com/epmet/dao/IcUserChangeRecordDao.java | 2 +- .../epmet/service/IcUserChangeDetailedService.java | 5 ++++- .../service/impl/IcUserChangeDetailedServiceImpl.java | 6 ++++-- .../service/impl/IcUserChangeRecordServiceImpl.java | 11 +++++++++-- .../main/resources/mapper/IcUserChangeDetailedDao.xml | 3 +++ .../main/resources/mapper/IcUserChangeRecordDao.xml | 5 ++++- 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java index b78f1077e2..ecb3d1f561 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java @@ -22,6 +22,8 @@ import com.epmet.entity.IcUserChangeDetailedEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 变更明细表 [一条变更记录对应多条人员类别数据] @@ -36,5 +38,5 @@ public interface IcUserChangeDetailedDao extends BaseDao icUserIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java index 9e9b0b06af..cff359168c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java @@ -48,5 +48,5 @@ public interface IcUserChangeRecordDao extends BaseDao * @Author sun * @Description 删除客户是新增类型的变更历史数据 **/ - void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type); + void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type, @Param("icUserIds") List icUserIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java index 04f01d63a1..f42238b5cf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java @@ -19,6 +19,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.IcUserChangeDetailedEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 变更明细表 @@ -33,5 +36,5 @@ public interface IcUserChangeDetailedService extends BaseService icUserIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java index c6ffcb3c14..dbdb593d7a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java @@ -23,6 +23,8 @@ import com.epmet.entity.IcUserChangeDetailedEntity; import com.epmet.service.IcUserChangeDetailedService; import org.springframework.stereotype.Service; +import java.util.List; + /** * 变更明细表 [一条变更记录对应多条人员类别数据] @@ -38,7 +40,7 @@ public class IcUserChangeDetailedServiceImpl extends BaseServiceImpl icUserIds) { + baseDao.delByCustomerId(customerId, type, icUserIds); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index c633efc473..a2606c3aaa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -44,6 +44,7 @@ import com.epmet.service.IcUserChangeRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -246,8 +247,14 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl icUserIdList = changeList.stream().map(IcUserChangeRecordEntity::getIcUserId).collect(Collectors.toList()); + List> partition = ListUtils.partition(icUserIdList, NumConstant.FIVE_HUNDRED); + partition.forEach(part -> { + baseDao.delByCustomerId(customerId, "add", part); + icUserChangeDetailedService.delByCustomerId(customerId, "add", part); + }); + log.info("初始变更记录数据,总条数->" + changeList.size()); icUserChangeRecordService.insertBatch(changeList); log.info("初始变更记录明细数据,总条数->" + detailedList.size()); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml index 24fe11c678..0931d47836 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml @@ -10,6 +10,9 @@ WHERE CUSTOMER_ID = #{customerId} AND type = #{type} + + #{icUserId} + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 80bd84eccb..55e117c10d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -64,8 +64,11 @@ FROM ic_user_change_record WHERE - CUSTOMER_ID = #{customerId} + customer_id = #{customerId} AND type = #{type} + + #{icUserId} + \ No newline at end of file From 9bbe2a350e6a56e0558f1e21f3d687e5ae4d610e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Jan 2022 13:33:37 +0800 Subject: [PATCH 81/83] bug --- .../src/main/resources/mapper/IcIndividualCategoryManageDao.xml | 1 + .../src/main/resources/mapper/IcStatsResiWarnDao.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml index 8979fb442c..47df855e0a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml @@ -22,5 +22,6 @@ INNER JOIN ic_resi_category_warn_config wc ON (sc.COLUMN_NAME = wc.COLUMN_NAME AND wc.DEL_FLAG = '0' AND wc.CUSTOMER_ID = sc.CUSTOMER_ID) WHERE cm.DEL_FLAG = 0 AND cm.USER_ID = #{userId} + ORDER BY cm.sort \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml index 608d10d5cd..572f9d8577 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml @@ -97,6 +97,7 @@ count(*) as count from ic_resi_user where 1=1 + AND status = '0' and ${columnName} = '1' From 1363855c5bf396c92c500d44b3ae13676a0b2a79 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 26 Jan 2022 13:54:08 +0800 Subject: [PATCH 82/83] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=201.=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=85=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/enums/IcResiUserTableEnum.java | 20 +- .../impl/IcResiUserImportServiceImpl.java | 291 ++++++++++++------ 2 files changed, 222 insertions(+), 89 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java index ffd0076429..9d72768f33 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java @@ -29,6 +29,11 @@ public enum IcResiUserTableEnum { private int headRowNo; private String mainTableFlagColumnName; + /** + * 根据表名获取枚举对象 + * @param tableName + * @return + */ public static IcResiUserTableEnum getObjectByTableName(String tableName) { for (IcResiUserTableEnum i : IcResiUserTableEnum.values()) { if (i.tableName.equals(tableName)) { @@ -38,7 +43,20 @@ public enum IcResiUserTableEnum { return null; } - + /** + * 判断是否有这一列 + * @param columnName + * @return + */ + public static boolean existsColumn(String columnName) { + for (IcResiUserTableEnum i : IcResiUserTableEnum.values()) { + String mainTableColumnName = i.mainTableFlagColumnName; + if (mainTableColumnName != null && mainTableColumnName.equals(columnName)) { + return true; + } + } + return false; + } public String getTableName() { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index bc463907c0..5bb39530f9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -5,7 +5,6 @@ import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.entity.ExportParams; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcelFactory; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.bean.ResiImportCategoryData; import com.epmet.bean.ResiImportResiCategoryChangedCache; import com.epmet.bean.ResiImportChangedData; @@ -420,15 +419,31 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res try { convertColumnWrappers2Map4Persist(itemIdAndColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues, true); - // 因为还没有读取子sheet,所以这些居民类别没有办法获取,先默认设置成0,后面读取子sheet的时候再更新 - columnAndValues.put("IS_ENSURE_HOUSE", "0"); - columnAndValues.put("IS_OLD_PEOPLE", "0"); - columnAndValues.put("IS_PARTY", "0"); - columnAndValues.put("IS_SPECIAL", "0"); - columnAndValues.put("IS_UNEMPLOYED", "0"); - columnAndValues.put("IS_UNITED_FRONT", "0"); - columnAndValues.put("IS_VETERANS", "0"); - columnAndValues.put("IS_VOLUNTEER", "0"); + String idCard = columnAndValues.get("ID_CARD"); + + Map existingResiMap = icResiUserDao.selectResiInfoMap(idCard); + + if (existingResiMap == null) { + // 新导入的居民,因为还没有读取子sheet,所以这些居民类别没有办法获取,先默认设置成0,后面读取子sheet的时候再更新 + columnAndValues.put("IS_ENSURE_HOUSE", "0"); + columnAndValues.put("IS_OLD_PEOPLE", "0"); + columnAndValues.put("IS_PARTY", "0"); + columnAndValues.put("IS_SPECIAL", "0"); + columnAndValues.put("IS_UNEMPLOYED", "0"); + columnAndValues.put("IS_UNITED_FRONT", "0"); + columnAndValues.put("IS_VETERANS", "0"); + columnAndValues.put("IS_VOLUNTEER", "0"); + } else { + // 该居民已存在,要做更新操作,因为还没有读取子sheet,所以这些居民最新类别没有办法获取,先设置上旧的数据 + columnAndValues.put("IS_ENSURE_HOUSE", existingResiMap.get("IS_ENSURE_HOUSE")); + columnAndValues.put("IS_OLD_PEOPLE", existingResiMap.get("IS_OLD_PEOPLE")); + columnAndValues.put("IS_PARTY", existingResiMap.get("IS_PARTY")); + columnAndValues.put("IS_SPECIAL", existingResiMap.get("IS_SPECIAL")); + columnAndValues.put("IS_UNEMPLOYED", existingResiMap.get("IS_UNEMPLOYED")); + columnAndValues.put("IS_UNITED_FRONT", existingResiMap.get("IS_UNITED_FRONT")); + columnAndValues.put("IS_VETERANS", existingResiMap.get("IS_VETERANS")); + columnAndValues.put("IS_VOLUNTEER", existingResiMap.get("IS_VOLUNTEER")); + } columnAndValues.put("AGENCY_ID", currUserAgencyId); columnAndValues.put("PIDS", currUserAgencyPids); @@ -436,14 +451,6 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res columnAndValues.put("UPDATED_BY", currentUserId); - // 验证居民信息是否存在 - String idCard = columnAndValues.get("ID_CARD"); - LambdaQueryWrapper idCardQuery = new LambdaQueryWrapper<>(); - idCardQuery.eq(IcResiUserEntity::getIdCard, idCard); - //IcResiUserEntity resiBaseInfo = icResiUserDao.selectOne(idCardQuery); - - Map existingResiMap = icResiUserDao.selectResiInfoMap(idCard); - if (existingResiMap != null) { // 修改居民信息 icResiUserDao.upTable(tableName, existingResiMap.get("ID"), columnAndValues); @@ -533,15 +540,13 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } // 检查用户是否存在 - LambdaQueryWrapper idCardQuery = new LambdaQueryWrapper<>(); - idCardQuery.eq(IcResiUserEntity::getIdCard, idCard); + Map resiInfoMap = icResiUserDao.selectResiInfoMap(idCard); - IcResiUserEntity icResiUserBaseInfo = icResiUserDao.selectOne(idCardQuery); - if (icResiUserBaseInfo == null) { + if (resiInfoMap == null || resiInfoMap.size() == 0) { throw new RenException(EpmetErrorCode.RESI_NOT_FOUND.getCode(), String.format("身份证号为【%s】的居民信息未找到,请确认该居民信息存在", idCard)); } - String icResiId = icResiUserBaseInfo.getId(); + String icResiId = resiInfoMap.get("ID"); columnAndValues.put("IC_RESI_USER", icResiId); columnAndValues.put("CUSTOMER_ID", loginUserUtil.getLoginUserCustomerId()); @@ -567,7 +572,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } // 保存到类别变更缓存中 - saveSubTableInfoToCategoryChangedResiCache(icResiId, Objects.requireNonNull(IcResiUserTableEnum.getObjectByTableName(targetTableName)).getMainTableFlagColumnName()); + saveSubTableInfoToCategoryChangedResiCache(icResiId, + Objects.requireNonNull(IcResiUserTableEnum.getObjectByTableName(targetTableName)).getMainTableFlagColumnName(), + resiInfoMap); } catch (Exception e) { String errorMsg; @@ -1042,7 +1049,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res /** * 生成导入调动数据 - * 1.新老数据中,只要状态是1的,都放入缓存 + * 1.新老数据中,0/1都存入 * @param existingResiMap * @param newResiMap * @return @@ -1067,13 +1074,22 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String oldCategoryValue = existingResiMap.get(categoryColumnName); String newCategoryValue = newResiMap.get(categoryColumnName); - if (StringUtils.isNotBlank(oldCategoryValue) && "1".equals(oldCategoryValue)) { + if (StringUtils.isBlank(oldCategoryValue)) oldCategoryValue = "0"; + if (StringUtils.isBlank(newCategoryValue)) newCategoryValue = "0"; + + if ("1".equals(oldCategoryValue) || "1".equals(newCategoryValue)) { + // 新旧值有一个为1,则放入 existingResiCategories.put(categoryColumnName, oldCategoryValue); + newResiCategories.put(categoryColumnName, newCategoryValue); } - if (StringUtils.isNotBlank(newCategoryValue) && "1".equals(newCategoryValue)) { - newResiCategories.put(categoryColumnName, newResiMap.get(categoryColumnName)); - } +// if ("1".equals(oldCategoryValue)) { +// existingResiCategories.put(categoryColumnName, oldCategoryValue); +// } +// +// if ("1".equals(newCategoryValue)) { +// newResiCategories.put(categoryColumnName, newCategoryValue); +// } } ResiImportCategoryData oldOne = new ResiImportCategoryData( @@ -1098,7 +1114,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } /** - * 类别变更的居民信息封装 + * 类别变更的居民信息封装。只要发生变化,0或者1都要保存 * 1. * @param existingResiMap * @param newResiMap @@ -1111,22 +1127,25 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res Set categoryColumnNames = resiCategoryColumnNameAndLabel.get().keySet(); for (String categoryColumnName : categoryColumnNames) { + String existingColumnValue = existingResiMap.get(categoryColumnName); String newColumnValue = newResiMap.get(categoryColumnName); - if (StringUtils.isAllBlank(existingColumnValue, newColumnValue)) { - // 都为空,则没发生变化 - continue; - } else { - // 先转为0再对比 - if (StringUtils.isBlank(existingColumnValue)) existingColumnValue = "0"; - if (StringUtils.isBlank(newColumnValue)) newColumnValue = "0"; + // 先转为0再对比 + if (StringUtils.isBlank(existingColumnValue)) existingColumnValue = "0"; + if (StringUtils.isBlank(newColumnValue)) newColumnValue = "0"; - if (!existingColumnValue.equals(newColumnValue)) { - oldCategories.put(categoryColumnName, existingColumnValue); - newCategories.put(categoryColumnName, newColumnValue); - } + if (!existingColumnValue.equals(newColumnValue)) { + oldCategories.put(categoryColumnName, existingColumnValue); + newCategories.put(categoryColumnName, newColumnValue); } + +// if (StringUtils.isAllBlank(existingColumnValue, newColumnValue)) { +// // 都为空,则没发生变化 +// continue; +// } else { +// +// } } if (oldCategories.size() == 0) { @@ -1158,7 +1177,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res * @param icResiId 居民id * @param columnName 该项信息在主表的列名 */ - private void saveSubTableInfoToCategoryChangedResiCache(String icResiId, String columnName) { + private void saveSubTableInfoToCategoryChangedResiCache(String icResiId, String columnName, Map resiInfoMap) { ResiImportResiCategoryChangedCache cc = newlyOrChangedResi.get(); Map newResis = cc.getNewResis(); @@ -1178,34 +1197,36 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res Map oldCategories = categoryChangedData.getOldData().getCategories(); Map newCategories = categoryChangedData.getNewData().getCategories(); - if (!oldCategories.containsKey(columnName)) { - // 没有这个类别,说明旧数据中是0,新数据中也是0,新数据改成1 + if ("0".equals(resiInfoMap.get(columnName))) { oldCategories.put(columnName, "0"); newCategories.put(columnName, "1"); - } else { - // 有这个类别,说明旧数据中是1,新数据中是0,新数据改成1,最后保存的时候,需要判断,新旧都是1,那么不创建变更记录 - newCategories.put(columnName, "1"); } + return; } ResiImportChangedData transferedData = transferedResis.get(icResiId); if (transferedData != null) { - // 说明是发生调动的居民,旧数据不用管了,新数据改成1 + // 说明是发生调动的居民,新数据值为1 Map newCategories = transferedData.getNewData().getCategories(); + Map oldCategories = transferedData.getOldData().getCategories(); + + oldCategories.put(columnName, "0"); newCategories.put(columnName, "1"); return; } - // 非新增,非调动,那么就是居民类别变更的,只不过变更的数据不在主sheet中,而在附sheet中 - ResiImportCategoryData oldOne = new ResiImportCategoryData(); - ResiImportCategoryData newOne = new ResiImportCategoryData(); + if ("0".equals(resiInfoMap.get(columnName))) { + // 非新增,非调动,变更的数据不在主sheet中,而在附sheet中。看是否发生人员类型变更(从0->1) + ResiImportCategoryData oldOne = new ResiImportCategoryData(); + ResiImportCategoryData newOne = new ResiImportCategoryData(); - oldOne.getCategories().put(columnName, "0"); - newOne.getCategories().put(columnName, "1"); + oldOne.getCategories().put(columnName, "0"); + newOne.getCategories().put(columnName, "1"); - ResiImportChangedData cd = new ResiImportChangedData(oldOne, newOne); - categoryChangedResis.put(icResiId, cd); + ResiImportChangedData cd = new ResiImportChangedData(oldOne, newOne); + categoryChangedResis.put(icResiId, cd); + } } /** @@ -1217,7 +1238,6 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res CustomerStaffInfoCacheResult operator = CustomerStaffRedis.getStaffInfo(loginUserUtil.getLoginUserCustomerId(), loginUserUtil.getLoginUserId()); - // 循环当前居民的所有类别的map for (Map.Entry entry : categoryChangedResis.entrySet()) { String resiId = entry.getKey(); @@ -1226,32 +1246,26 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res Map oldCategories = oldData.getCategories(); Map newCategories = newData.getCategories(); + fillResiSubCategoryInfo4TransferAndCategoryChange(oldData, newData); + StringBuilder sbBefore = new StringBuilder(""); StringBuilder sbAfter = new StringBuilder(""); //主表的语言描述 - for (Map.Entry newEntry : newCategories.entrySet()) { - String columnName = newEntry.getKey(); - String newColumnValue = newEntry.getValue(); - String oldColumnValue = oldCategories.get(columnName); - - if (newColumnValue.equals(oldColumnValue)) { - continue; - } + generateCategoryChangeDesc(oldCategories, newCategories, sbBefore, sbAfter); - String beforeValueName = "0".equals(oldColumnValue) ? "否" : "是"; - String newValueName = "0".equals(newColumnValue) ? "否" : "是"; - - String label = resiCategoryColumnNameAndLabel.get().get(columnName); + String descBefore = sbBefore.toString(); + String descAfter = sbAfter.toString(); - sbBefore.append(label).append(":").append(beforeValueName).append("\n"); - sbAfter.append(label).append(":").append(newValueName).append("\n"); + // 没有任何变化,跳过该居民 + if (StringUtils.isAllBlank(descBefore,descAfter)) { + continue; } // 生成changeRecord并存入 IcResiUserEntity resiInfo = icResiUserDao.selectById(resiId); IcUserChangeRecordEntity changeRecord = fillChangeRecord(loginUserUtil.getLoginUserCustomerId(), resiId, resiInfo.getName(), null, loginUserUtil.getLoginUserId(), - operator.getRealName() , sbBefore.toString(), sbAfter.toString(), "category", "类别", "", now); + operator.getRealName() , descBefore, descAfter, "category", "类别", "", now); icUserChangeRecordDao.insert(changeRecord); for (Map.Entry columnEntry : newCategories.entrySet()) { @@ -1266,16 +1280,58 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res int value = newValue.equals("1") && oldValue.equals("0") ? 1 : -1; - - IcUserChangeDetailedEntity newDetail = fillChangeDetail(loginUserUtil.getLoginUserCustomerId(), resiId, changeRecord.getId(), newData.getAgencyId(), - newData.getGridId(), newData.getVillageId(), newData.getBuildId(), newData.getUnitId(), - newData.getHomeId(), "category", "类别", columnEntry.getKey(), value, resiInfo.getPids()); + String agencyId = newData.getAgencyId(); + String gridId = newData.getGridId(); + String villageId = newData.getVillageId(); + String buildId = newData.getBuildId(); + String unitId = newData.getUnitId(); + String homeId = newData.getHomeId(); + + // 如果只有附加表信息,但是没有主表信息,并且附加表基础信息很多空着的,此处需要从主表获取了然后填充一下该信息 + if (agencyId == null) agencyId = resiInfo.getAgencyId(); + if (gridId == null) gridId = resiInfo.getGridId(); + if (villageId == null) villageId = resiInfo.getVillageId(); + if (buildId == null) buildId = resiInfo.getBuildId(); + if (unitId == null) unitId = resiInfo.getUnitId(); + if (homeId == null) homeId = resiInfo.getHomeId(); + + IcUserChangeDetailedEntity newDetail = fillChangeDetail(loginUserUtil.getLoginUserCustomerId(), resiId, changeRecord.getId(), agencyId, + gridId, villageId, buildId, unitId, + homeId, "category", "类别", columnEntry.getKey(), value, resiInfo.getPids()); icUserChangeDetailedDao.insert(newDetail); } } } + /** + * 生成类别变更描述 + * @param oldCategories + * @param newCategories + * @param sbBefore + * @param sbAfter + */ + private void generateCategoryChangeDesc(Map oldCategories, Map newCategories, + StringBuilder sbBefore, StringBuilder sbAfter) { + for (Map.Entry newEntry : newCategories.entrySet()) { + String columnName = newEntry.getKey(); + String newColumnValue = newEntry.getValue(); + String oldColumnValue = oldCategories.get(columnName); + + if (newColumnValue.equals(oldColumnValue)) { + continue; + } + + String beforeValueName = "0".equals(oldColumnValue) ? "否" : "是"; + String newValueName = "0".equals(newColumnValue) ? "否" : "是"; + + String label = resiCategoryColumnNameAndLabel.get().get(columnName); + + sbBefore.append(label).append(":").append(beforeValueName).append("\n"); + sbAfter.append(label).append(":").append(newValueName).append("\n"); + } + } + /** * 保存新增居民类别记录 * @param newResis @@ -1322,6 +1378,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res ResiImportCategoryData oldData = resi.getValue().getOldData(); ResiImportCategoryData newData = resi.getValue().getNewData(); + // 把附加表的旧数据填充到新数据中 + fillResiSubCategoryInfo4TransferAndCategoryChange(oldData, newData); + StringBuilder sbBefore = new StringBuilder(); StringBuilder sbAfter = new StringBuilder(); @@ -1435,9 +1494,42 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res icUserChangeRecordDao.insert(transferChangeRecord); // 保存 类别变更changeRecord - IcUserChangeRecordEntity categoryChangeRecord = fillChangeRecord(customerId, resiId, resiInfo.getName(), transferRecord.getId(), operator.getStaffId(), - operator.getRealName(), sbBefore.toString(), sbAfter.toString(), "category", "类别", "", now); - icUserChangeRecordDao.insert(categoryChangeRecord); + sbBefore = new StringBuilder(); + sbAfter = new StringBuilder(); + + // 过滤居民类别的key并集 + Set bingji = new HashSet<>(); + newData.getCategories().keySet().forEach((k) -> bingji.add(k)); + oldData.getCategories().keySet().forEach((k) -> bingji.add(k)); + + for (String category : bingji) { + String newColumnValue = newData.getCategories().get(category); + String oldColumnValue = oldData.getCategories().get(category); + + if (oldColumnValue == null) oldColumnValue = "0"; + if (newColumnValue == null) newColumnValue = "0"; + + if (newColumnValue.equals(oldColumnValue)) { + continue; + } + + String beforeValueName = "0".equals(oldColumnValue) ? "否" : "是"; + String newValueName = "0".equals(newColumnValue) ? "否" : "是"; + + String label = resiCategoryColumnNameAndLabel.get().get(category); + + sbBefore.append(label).append(":").append(beforeValueName).append("\n"); + sbAfter.append(label).append(":").append(newValueName).append("\n"); + } + + String categoryDescBefore = sbBefore.toString(); + String categoryDescAfter = sbAfter.toString(); + + if (!StringUtils.isAllBlank(categoryDescBefore, categoryDescAfter)) { + IcUserChangeRecordEntity categoryChangeRecord = fillChangeRecord(customerId, resiId, resiInfo.getName(), transferRecord.getId(), operator.getStaffId(), + operator.getRealName(), categoryDescBefore, categoryDescAfter , "category", "类别", "", now); + icUserChangeRecordDao.insert(categoryChangeRecord); + } // 保存 changeDetail for (Map.Entry oldCategories : oldData.getCategories().entrySet()) { @@ -1445,24 +1537,47 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // String value = oldCategories.getValue(); // 之前是这个类型,那这个类型需要-1 - IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, categoryChangeRecord.getId(), oldData.getAgencyId(), - oldData.getGridId(), oldData.getVillageId(), oldData.getBuildId(), oldData.getUnitId(), - oldData.getHomeId(), categoryChangeRecord.getType(), categoryChangeRecord.getTypeName(), key, -1, resiInfo.getPids()); - - icUserChangeDetailedDao.insert(changeDetail); + String oldValue = oldCategories.getValue(); + if ("1".equals(oldValue)) { + IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, transferChangeRecord.getId(), oldData.getAgencyId(), + oldData.getGridId(), oldData.getVillageId(), oldData.getBuildId(), oldData.getUnitId(), + oldData.getHomeId(), transferChangeRecord.getType(), transferChangeRecord.getTypeName(), key, -1, resiInfo.getPids()); + icUserChangeDetailedDao.insert(changeDetail); + } } // 保存 changeDetail for (Map.Entry newCategories : newData.getCategories().entrySet()) { String key = newCategories.getKey(); - // String value = newCategories.getValue(); + String newValue = newCategories.getValue(); // 现在是这个类型,这个类型要+1 - IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, categoryChangeRecord.getId(), newData.getAgencyId(), - newData.getGridId(), newData.getVillageId(), newData.getBuildId(), newData.getUnitId(), - newData.getHomeId(), categoryChangeRecord.getType(), categoryChangeRecord.getTypeName(), key, 1, resiInfo.getPids()); + if ("1".equals(newValue)) { + IcUserChangeDetailedEntity changeDetail = fillChangeDetail(customerId, resiId, transferChangeRecord.getId(), newData.getAgencyId(), + newData.getGridId(), newData.getVillageId(), newData.getBuildId(), newData.getUnitId(), + newData.getHomeId(), transferChangeRecord.getType(), transferChangeRecord.getTypeName(), key, 1, resiInfo.getPids()); + icUserChangeDetailedDao.insert(changeDetail); + } + } + } + } - icUserChangeDetailedDao.insert(changeDetail); + /** + * 把居民原有的子表的人员类别标记拿到,看是否需要给新导入的数据填充。因为一个人可能以前是党员, + * 后来做了调动,但是调动的时候没有填写党员信息,这样newData中是没有的,所以需要从oldData中拿到,填充到newData + * @param oldData + * @param newData + */ + private void fillResiSubCategoryInfo4TransferAndCategoryChange(ResiImportCategoryData oldData, ResiImportCategoryData newData) { + for (String category : oldData.getCategories().keySet()) { + String newValue = newData.getCategories().get(category); + String oldValue = oldData.getCategories().get(category); + + // 如果新数据中没有或者是0,并且是附加表信息,并且旧数据是1, 拿旧数据的过来 + if ((newValue == null || "0".equals(newValue)) + && "1".equals(oldValue) + && IcResiUserTableEnum.existsColumn(category)) { + newData.getCategories().put(category, "1"); } } } From 2b23adaf388cb2af1f9013acf0aa5e62e2417a31 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 Jan 2022 14:22:52 +0800 Subject: [PATCH 83/83] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E3=80=81=E7=A4=BE=E5=8C=BA=E8=87=AA=E7=BB=84=E7=BB=87=E3=80=81?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=8C=96=E5=85=9A=E5=BB=BA=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E6=9C=AA=E8=A7=A3=E5=86=B3=E7=9A=84=E4=B8=8D=E7=BB=99=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcUserDemandRecDao.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 7ea8f22256..02432b91c5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -591,6 +591,7 @@ a.DEL_FLAG = '0' AND a.`STATUS` = 'finished' AND a.EVALUATE_FLAG = 1 + and a.FINISH_RESULT='resolved' AND c.EVALUATE_TIME >= #{startTime} @@ -611,6 +612,7 @@ a.DEL_FLAG = '0' AND a.`STATUS` = 'finished' AND a.EVALUATE_FLAG = 1 + and a.FINISH_RESULT='resolved' AND c.EVALUATE_TIME >= #{startTime} @@ -634,6 +636,7 @@ a.DEL_FLAG = '0' AND a.`STATUS` = 'finished' AND a.EVALUATE_FLAG = 1 + and a.FINISH_RESULT='resolved' AND b.CUSTOMER_ID = #{customerId} GROUP BY b.SERVER_ID