manailin
2021-06-30 cf2e6ce54f82c61606a01f816f7cac8b3a967809
Merge remote-tracking branch 'origin/test' into test

# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/EventVisitingTasksApi.java
# springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
# springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventVisitingTasksServiceImpl.java
15个文件已添加
50个文件已修改
2210 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/PopulIsOkEnum.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/IdDTO.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/work/ScreenActActivityListDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/AddComMngHousePopulationDTO.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/ComMngVillageListAppDTO.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/DelComMngHousePopulationDTO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/PageComMngPopulationDTO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/PageComMngVillageBuildHouseAppDTO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/admin/ComMngPopulationListDTO.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/query/visit/EventTasksQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/query/visit/EventVisitListQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationServeExcelVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/ComMngVillageBuildingHouseDetailVO.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/ComMngVillageBuildingHouseVO.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/ComMngVillageBuildingVO.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/PageComMngVillageVO.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/PopulationListVO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/admin/ComMngPopulationListVO.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActPopulationScreenVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/AppVisitTasksVO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/EventVisitListVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/EventVisitingTasksDetailsVO.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/EventVisitingTasksVO.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/VillageApi.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EasyPhotoApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventGridDataApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventGridMemberRelationApi.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventManageApi.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventVisitingTasksApi.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/PopulationApi.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/PublicityEventApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/StatisticsApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/SystemApi.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComMngVillageApi.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/PopulationApi.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDynDAO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActVillageDAO.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationHouseDAO.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationHouseUserDAO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationHouseUserDO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationHouseService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationHouseUserService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngVillageService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseUserServiceImpl.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/EventVisitingTasksApi.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventVisitingTasksService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java 182 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventVisitingTasksServiceImpl.java 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridDataMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/PopulIsOkEnum.java
@@ -27,7 +27,7 @@
                return item.getCode();
            }
        }
        return -1;
        return 0;
    }
    public static String getCnDescByName(Integer code) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -332,7 +332,12 @@
                if(StringUtils.isNotEmpty(oneData.get(27))){
                    vo.setHouseHold(oneData.get(27).trim());
                }
                for (int i = 28; i < headSize; i++) {
                if(StringUtils.isEmpty(oneData.get(28))){
                    vo.setIsResidence(0);
                }else{
                    vo.setIsResidence(PopulIsOkEnum.getCodeByName(oneData.get(28).trim()));
                }
                for (int i = 29; i < headSize; i++) {
                    if (oneData.get(i) != null && oneData.get(i).equals("是")) {
                        vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("(")));
                    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/IdDTO.java
New file
@@ -0,0 +1,26 @@
package com.panzhihua.common.model.dtos;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
 * @author xyh
 * @date 2021/6/28 16:30
 */
@ApiModel("id参数")
public class IdDTO {
    @NotNull(message = "id不能为空")
    @ApiModelProperty("id")
    private String id;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/work/ScreenActActivityListDTO.java
@@ -26,7 +26,7 @@
    @ApiModelProperty(value="查询结束时间")
    private String endTime;
    @ApiModelProperty(value="发布类型 1 图文 2 投票")
    @ApiModelProperty(value="活动状态 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消")
    private Integer type;
    /**
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/AddComMngHousePopulationDTO.java
New file
@@ -0,0 +1,38 @@
package com.panzhihua.common.model.dtos.grid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * 向房屋添加人员请求参数
 *
 * @author lyq
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
@Data
@ApiModel("向房屋添加人员请求参数")
public class AddComMngHousePopulationDTO {
    @ApiModelProperty(value = "房屋id",required = true)
    private Long houseId;
    @ApiModelProperty(value = "人员id集合",required = true)
    private List<Long> populationIds;
    @ApiModelProperty(value = "添加类型(1.户主 2.住户)",required = true)
    private Integer type;
    /**
     * 添加类型(1.户主 2.住户)
     */
    public interface type{
        int hz = 1;
        int zh = 2;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/ComMngVillageListAppDTO.java
New file
@@ -0,0 +1,52 @@
package com.panzhihua.common.model.dtos.grid;
import com.google.common.base.CaseFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
import javax.validation.constraints.Pattern;
/**
 * 小区列表-请求参数
 *
 * @author lyq
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
@Data
@ApiModel("小区列表-请求参数")
public class ComMngVillageListAppDTO {
    @ApiModelProperty(value = "分页-当前页数", example = "1")
    private Long pageNum = 1L;
    @ApiModelProperty(value = "分页-每页记录数", example = "10")
    private Long pageSize = 10L;
    @ApiModelProperty(value = "小区名称")
    private String name;
    @Max(9223372036854775807L)
    @ApiModelProperty(value = "社区id", hidden = true, example = "1")
    private Long communityId;
    @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1")
    private Long userId;
    @ApiModelProperty(value = "排序字段, 默认 创建时间:createAt(在住居民数:userSum,楼栋数:buildSum,总户数:houseNum,户籍人口:registerNum)", example = "createAt")
    private String sortAttr="createAt";
    @ApiModelProperty(value = "排序方式: asc/desc(默认)", example = "desc")
    @Pattern(regexp = "asc|desc|ASC|DESC")
    private String sortType="desc";
    public String getSortColumns(){
//        String dbColumn = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortAttr);
        return sortAttr;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/DelComMngHousePopulationDTO.java
New file
@@ -0,0 +1,36 @@
package com.panzhihua.common.model.dtos.grid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * 向房屋删除人员请求参数
 *
 * @author lyq
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
@Data
@ApiModel("向房屋删除人员请求参数")
public class DelComMngHousePopulationDTO {
    @ApiModelProperty(value = "房屋人员关联id",required = true)
    private Long housePopulationId;
    @ApiModelProperty(value = "添加类型(1.户主 2.住户)",required = true)
    private Integer type;
    /**
     * 添加类型(1.户主 2.住户)
     */
    public interface type{
        int hz = 1;
        int zh = 2;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/PageComMngPopulationDTO.java
New file
@@ -0,0 +1,28 @@
package com.panzhihua.common.model.dtos.grid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * 分页查询表单
 *
 * @author cedoo email:cedoo(a)qq.com
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
@Data
@ApiModel("查询人员列表请求参数")
public class PageComMngPopulationDTO {
    @ApiModelProperty(value = "分页-当前页数", example = "1")
    private Long pageNum = 1L;
    @ApiModelProperty(value = "分页-每页记录数", example = "10")
    private Long pageSize = 10L;
    @ApiModelProperty(value = "关键词")
    private String keyWord;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/PageComMngVillageBuildHouseAppDTO.java
New file
@@ -0,0 +1,39 @@
package com.panzhihua.common.model.dtos.grid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
/**
 * 小区楼栋下房屋列表-请求参数
 *
 * @author lyq
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
@Data
@ApiModel("小区楼栋下房屋列表-请求参数")
public class PageComMngVillageBuildHouseAppDTO {
    @ApiModelProperty(value = "分页-当前页数", example = "1")
    private Long pageNum = 1L;
    @ApiModelProperty(value = "分页-每页记录数", example = "10")
    private Long pageSize = 10L;
    @ApiModelProperty(value = "小区id",required = true)
    private Long villageId;
    @ApiModelProperty(value = "楼栋号",required = true)
    private String floor;
    @ApiModelProperty(value = "单元号",required = true)
    private String unitNo;
    @ApiModelProperty(value = "户室号")
    private String houseNo;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/admin/ComMngPopulationListDTO.java
New file
@@ -0,0 +1,58 @@
package com.panzhihua.common.model.dtos.grid.admin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
/**
 * 居民列表-请求参数
 *
 * @author lyq
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
@Data
@ApiModel("居民列表-请求参数")
public class ComMngPopulationListDTO {
    @ApiModelProperty(value = "分页-当前页数", example = "1")
    private Long pageNum = 1L;
    @ApiModelProperty(value = "分页-每页记录数", example = "10")
    private Long pageSize = 10L;
    @ApiModelProperty(value = "走访状态(1待走访2已走访3待验证5已撤销)")
    private Integer eventStatus;
    @Length(max=100)
    @ApiModelProperty(value = "人员标签", hidden = false, example = "")
    private String label;
    @Max(127)
    @ApiModelProperty(value = "性别 1.男 2.女", hidden = false, example = "1")
    private Integer sex;
    @Max(10)
    @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)")
    private Integer politicalOutlook;
    @Max(2)
    @ApiModelProperty("关联实有房屋(1.是 2.否)")
    private Integer isHouse;
    @Length(max=100)
    @ApiModelProperty(value = "关键词", hidden = false, example = "")
    private String keyWord;
    @Max(9223372036854775807L)
    @ApiModelProperty(value = "社区id", hidden = true, example = "1")
    private Long communityId;
    @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1")
    private Long userId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/query/visit/EventTasksQuery.java
@@ -22,7 +22,7 @@
    private Integer eventStatus;
    @ApiModelProperty("人员标签")
    private Integer tag;
    private String tag;
    @ApiModelProperty("是否异常")
    private Integer isExp;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/query/visit/EventVisitListQuery.java
@@ -19,7 +19,7 @@
    private Integer status;
    @ApiModelProperty("人员标签")
    private Integer tag;
    private String tag;
    @ApiModelProperty("性别")
    private Integer sex;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationServeExcelVO.java
@@ -157,5 +157,7 @@
     */
    private List<String> userTagStr = Lists.newArrayList();
    private Long houseId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/ComMngVillageBuildingHouseDetailVO.java
New file
@@ -0,0 +1,52 @@
package com.panzhihua.common.model.vos.grid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * 小区下楼栋单元房间详情返回参数
 */
@Data
@ApiModel("小区下楼栋单元房间详情返回参数")
public class ComMngVillageBuildingHouseDetailVO {
    @ApiModelProperty("房屋id")
    private Long id;
    @ApiModelProperty("小区名称")
    private String villageName;
    @ApiModelProperty("楼栋号")
    private String floor;
    @ApiModelProperty("单元号")
    private String unitNo;
    @ApiModelProperty("楼层数")
    private String buildingNum;
    @ApiModelProperty("户室号")
    private String houseNo;
    @ApiModelProperty("房屋地址")
    private String address;
    @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)")
    private Integer status;
    @ApiModelProperty("纬度")
    private String lat;
    @ApiModelProperty("经度")
    private String lng;
    @ApiModelProperty("户主列表")
    private List<PopulationListVO> householderList;
    @ApiModelProperty("居民列表")
    private List<PopulationListVO> populationList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/ComMngVillageBuildingHouseVO.java
New file
@@ -0,0 +1,30 @@
package com.panzhihua.common.model.vos.grid;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * 小区下楼栋单元列表返回参数
 */
@Data
@ApiModel("小区下楼栋单元房间列表返回参数")
public class ComMngVillageBuildingHouseVO {
    @ApiModelProperty("房屋id")
    private Long id;
    @ApiModelProperty("户室号")
    private String houseNo;
    @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)")
    private Integer status;
    @ApiModelProperty("在住居民数")
    private Integer userNum;
    @ApiModelProperty("楼层数")
    private String buildingNum;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/ComMngVillageBuildingVO.java
New file
@@ -0,0 +1,30 @@
package com.panzhihua.common.model.vos.grid;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * 小区下楼栋单元列表返回参数
 */
@Data
@ApiModel("小区下楼栋单元列表返回参数")
public class ComMngVillageBuildingVO {
    @ApiModelProperty("自增id")
    private Long villageId;
    @ApiModelProperty("楼栋号")
    private String floor;
    @ApiModelProperty("单元号")
    private String unitNo;
    @ApiModelProperty("拼接好楼栋号")
    private String floorString;
    @ApiModelProperty("拼接好单元号")
    private String unitNoString;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/PageComMngVillageVO.java
New file
@@ -0,0 +1,49 @@
package com.panzhihua.common.model.vos.grid;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * 居民管理-列表返回参数
 */
@Data
@ApiModel("居民管理列表返回参数")
@EncryptDecryptClass
public class PageComMngVillageVO {
    @ApiModelProperty("自增id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long villageId;
    @ApiModelProperty("姓名")
    private String userName;
    @ApiModelProperty("楼栋数")
    private Integer buildSum;
    @ApiModelProperty("地址")
    private String address;
    @ApiModelProperty("用户数")
    private Integer userSum;
    @ApiModelProperty("房屋数")
    private Integer houseNum;
    @ApiModelProperty("户籍人口数")
    private Integer registerNum;
    @ApiModelProperty("租户数量")
    private Integer rentNum;
    @ApiModelProperty("纬度")
    private String lat;
    @ApiModelProperty("经度")
    private String lng;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/PopulationListVO.java
@@ -56,4 +56,11 @@
    @ApiModelProperty(value = "性别(1.男 2.女)")
    private String sex;
    @ApiModelProperty(value = "时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;
    @ApiModelProperty(value = "房屋人口关联id")
    private Long housePopulationId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/admin/ComMngPopulationListVO.java
New file
@@ -0,0 +1,71 @@
package com.panzhihua.common.model.vos.grid.admin;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * 居民管理-列表返回参数
 */
@Data
@ApiModel("居民管理列表返回参数")
@EncryptDecryptClass
public class ComMngPopulationListVO {
    @ApiModelProperty("自增id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @ApiModelProperty("姓名")
    private String userName;
    @ApiModelProperty("标签")
    private String label;
    @ApiModelProperty("走访时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;
    @ApiModelProperty(value = "身份证号码")
    @EncryptDecryptField
    private String cardNo;
    @ApiModelProperty(value = "性别(1.男 2.女)")
    private Integer sex;
    @ApiModelProperty(value = "现居住地址")
    private String address;
    @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)")
    private Integer politicalOutlook;
    @ApiModelProperty("联系方式")
    private String phone;
    @ApiModelProperty("关联实有房屋(0.否 1.是)")
    private String isHouse;
    @ApiModelProperty(value = "走访状态(1待走访2已走访3待验证5已撤销)")
    private Integer eventStatus;
    @ApiModelProperty(value = "户口所在地")
    private String censusRegister;
    @ApiModelProperty(value = "年龄")
    private Integer age;
    @ApiModelProperty(value = "是否是户主(1.是 2.否)")
    private Integer isRelation;
    @ApiModelProperty(value = "居住地房屋id")
    private Long houseId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActPopulationScreenVO.java
@@ -1,5 +1,7 @@
package com.panzhihua.common.model.vos.screen;
import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO;
import com.panzhihua.common.model.vos.community.screen.event.EventGridStatisticsVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -47,4 +49,11 @@
    @ApiModelProperty("实有人口文化程度统计")
    private List<ComActPopulationCultureVO> cultureGroup;
    @ApiModelProperty("大屏网格数据")
    private List<EventGridStatisticsVO> gridStatisticsList;
    @ApiModelProperty("小区列表数据")
    private List<CivilVillageStatisticsVO> villageStatisticsList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/AppVisitTasksVO.java
@@ -1,6 +1,8 @@
package com.panzhihua.common.model.vos.visit;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.panzhihua.common.enums.EventTasksStatusEnum;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField;
@@ -22,21 +24,25 @@
    private static final long serialVersionUID = -5758072851661612412L;
    @ApiModelProperty("id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @ApiModelProperty("需走访人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long visiterId;
    @ApiModelProperty("需走访人姓名")
    private String visiterName;
    @ApiModelProperty("网格员id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gridMember;
    @ApiModelProperty("网格员")
    private String gridMemberName;
    @ApiModelProperty("处理人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long dellUserId;
    @ApiModelProperty("处理人")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/EventVisitListVO.java
@@ -1,6 +1,8 @@
package com.panzhihua.common.model.vos.visit;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.panzhihua.common.enums.EventTasksStatusEnum;
import com.panzhihua.common.enums.EventTasksVisitorTypeEnum;
import io.swagger.annotations.ApiModel;
@@ -18,6 +20,7 @@
public class EventVisitListVO {
    @ApiModelProperty("id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @ApiModelProperty("真实姓名")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/EventVisitingTasksDetailsVO.java
@@ -2,6 +2,8 @@
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.panzhihua.common.model.dtos.EventResourceDTO;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField;
@@ -26,15 +28,19 @@
public class EventVisitingTasksDetailsVO {
    @ApiModelProperty(value = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @ApiModelProperty(value = "网格员所处的街道")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gridMemberStreet;
    @ApiModelProperty(value = "网格员所处社区")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gridMemberCommunity;
    @ApiModelProperty(value = "网格员")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gridMember;
    @ApiModelProperty(value = "网格员名字")
@@ -44,6 +50,7 @@
    private String gridMenberTele;
    @ApiModelProperty(value = "需走访人ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long visiterId;
    @ApiModelProperty(value = "需走访人名字")
@@ -94,6 +101,7 @@
    private Integer dellType;
    @ApiModelProperty(value = "处理人ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long dellUserId;
    @ApiModelProperty(value = "处理人名称")
@@ -103,7 +111,7 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date dellDate;
    @ApiModelProperty(value = "解决人针对解决事件的处理描述")
    @ApiModelProperty(value = "异常描述")
    private String dellDesc;
    @ApiModelProperty(value = "是否有效")
@@ -119,13 +127,14 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date submitDate;
    @ApiModelProperty(value = "是否异常行为")
    @ApiModelProperty(value = "是否异常行为:0否,1是")
    private Boolean exception;
    @ApiModelProperty(value = "走访内容根据重点人员类型输入项不同,录入全部的表单内容数据")
    private JSONObject tableContentJson;
    @ApiModelProperty(value = "创建人")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long createBy;
    @ApiModelProperty(value = "创建事件")
@@ -133,6 +142,7 @@
    private Date createAt;
    @ApiModelProperty(value = "修改人")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long updateBy;
    @ApiModelProperty(value = "修改时间")
@@ -151,5 +161,22 @@
    @ApiModelProperty(value = "视频列表")
    List<EventResourceDTO> videoList;
    @ApiModelProperty(value = "家庭联系方式")
    private String familyPhone;
    @ApiModelProperty(value = "生活来源")
    private String familySource;
    @ApiModelProperty(value = "地址备注")
    private String addressRemark;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty("异常选择")
    private String option;
    @ApiModelProperty("走访后的经纬度(,隔开)")
    private String latLng;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/visit/EventVisitingTasksVO.java
@@ -1,8 +1,10 @@
package com.panzhihua.common.model.vos.visit;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.panzhihua.common.enums.EventTasksStatusEnum;
import com.panzhihua.common.enums.EventTasksVisitorTypeEnum;
import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
@@ -22,72 +24,77 @@
 * */
@Data
@ApiModel("重点人群走访记录返回参数")
@ExcelIgnoreUnannotated
@EncryptDecryptClass
public class EventVisitingTasksVO {
    @ApiModelProperty(value = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @ExcelProperty(value = "序号",index = 0)
    private Integer rowNum;
//    @ExcelProperty(value = "序号",index = 0)
//    private Integer rowNum;
    @ExcelProperty(value = "创建时间",index = 1)
    @ExcelProperty(value = "创建时间",index = 0)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;
    @ExcelProperty(value = "创建人",index = 2)
    @ExcelProperty(value = "创建人",index = 1)
    @ApiModelProperty(value = "创建人")
    private String creator;
    @ExcelProperty(value = "走访对象",index = 3)
    @ExcelProperty(value = "走访对象",index = 2)
    @ApiModelProperty(value = "需走访人名字")
    private String visiterName;
    @ExcelProperty(value = "身份证号码",index = 4)
    @ExcelProperty(value = "身份证号码",index = 3)
    @ApiModelProperty(value = "身份证号码")
    private String cardNoStr;
    @ExcelProperty(value = "走访地址",index = 5)
    @ExcelProperty(value = "走访地址",index = 4)
    @ApiModelProperty(value = "走访地址")
    private String visiterAddress;
    @ExcelProperty(value = "人员标签",index = 6)
    @ExcelProperty(value = "人员标签",index = 5)
    @ApiModelProperty(value = "人员标签")
    private String visiterTypeName;
    @ExcelProperty(value = "走访人",index = 7)
    @ExcelProperty(value = "走访人",index = 6)
    @ApiModelProperty(value = "走访人")
    private String dellUserName;
    @ExcelProperty(value = "完成走访时间",index = 8)
    @ExcelProperty(value = "完成走访时间",index = 7)
    @ApiModelProperty(value = "完成走访时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date submitDate;
    @ExcelProperty(value = "撤销时间",index = 9)
    @ExcelProperty(value = "撤销时间",index = 8)
    @ApiModelProperty(value = "撤销时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date cancelTime;
    @ExcelProperty(value = "状态",index = 10)
    @ExcelProperty(value = "状态",index = 9)
    @ApiModelProperty(value = "状态")
    private String eventStatusName;
    @ExcelIgnore
    @ApiModelProperty(value = "需走访人ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long visiterId;
    @ApiModelProperty(value = "网格员所处的街道")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gridMemberStreet;
    @ApiModelProperty(value = "网格员所处社区")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gridMemberCommunity;
    @ApiModelProperty(value = "网格员")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long gridMember;
    @ApiModelProperty(value = "网格员名字")
@@ -105,7 +112,6 @@
    private String visiterTele;
    @ExcelIgnore
    private Integer visiterType;
    @ApiModelProperty(value = "事件标题")
@@ -129,8 +135,6 @@
    @ApiModelProperty(value = "发生的精度纬度信息(逗号隔开)")
    private String happentLatLng;
//
    @ExcelIgnore
    private Integer eventStatus;
    public String getEventStatusName() {
@@ -154,6 +158,7 @@
    private Integer dellType;
    @ApiModelProperty(value = "处理人ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long dellUserId;
@@ -183,10 +188,12 @@
    private String tableContentJson;
    @ApiModelProperty(value = "创建人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long createBy;
    @ApiModelProperty(value = "修改人")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long updateBy;
    @ApiModelProperty(value = "修改时间")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -18,7 +18,8 @@
import com.panzhihua.common.model.dtos.elders.ComEldersAuthGetResultDTO;
import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO;
import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO;
import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.dtos.neighbor.*;
import com.panzhihua.common.model.dtos.shop.*;
import com.panzhihua.common.model.dtos.user.PageInputUserDTO;
@@ -3316,4 +3317,84 @@
     */
    @PostMapping("/wallet/get/ranking")
    R getWalletRanking(@RequestBody PageComActWalletTradeDTO walletTradeDTO);
    /**
     * 综治后台-居民列表
     * @param populationListDTO 请求参数
     * @return  居民列表
     */
    @PostMapping("/population/grid/list")
    R getGridPopulationList(@RequestBody ComMngPopulationListDTO populationListDTO);
    /**
     * 综治后台-删除居民
     * @param ids   居民id集合
     * @return  删除结果
     */
    @PostMapping("/population/grid/del")
    R delGridPopulation(@RequestBody List<Long> ids);
    /**
     * 综治后台-居民详情
     * @param populationId  居民id
     * @return  居民详情
     */
    @GetMapping("/population/grid/get")
    R getGridPopulationDetail(@RequestParam("populationId")Long populationId);
    /**
     * 综治app-小区列表
     * @param villageListAppDTO 请求参数
     * @return  小区列表
     */
    @PostMapping("/village/grid/list")
    R getGridVillageList(@RequestBody ComMngVillageListAppDTO villageListAppDTO);
    /**
     * 综治app-根据小区id查询小区下楼栋列表
     * @param villageId 小区id
     * @return  楼栋列表
     */
    @PostMapping("/village/grid/building/list")
    R getGridVillageBuildingList(@RequestParam("villageId")Long villageId);
    /**
     * 小区楼栋下房屋列表
     * @param buildHouseAppDTO  请求参数
     * @return  房屋列表
     */
    @PostMapping("/village/grid/building/house/list")
    R getGridVillageBuildingHouseList(@RequestBody PageComMngVillageBuildHouseAppDTO buildHouseAppDTO);
    /**
     * 小区楼栋下房屋信息
     * @param houseId   房屋id
     * @return  房屋信息
     */
    @PostMapping("/village/grid/building/house/detail")
    R getGridVillageBuildingHouseDetail(@RequestParam("houseId")Long houseId);
    /**
     * 查询平台人口列表
     * @param populationDTO 请求参数
     * @return  人口列表
     */
    @PostMapping("/village/grid/building/house/population/list")
    R getBuildingHousePopulationList(@RequestBody PageComMngPopulationDTO populationDTO);
    /**
     * 批量向房屋新增人员
     * @param housePopulationDTO    请求参数
     * @return  添加结果
     */
    @PostMapping("/village/grid/building/house/add/population")
    R addBuildingHousePopulation(@RequestBody AddComMngHousePopulationDTO housePopulationDTO);
    /**
     * 批量删除房屋内人员
     * @param housePopulationDTO    请求参数
     * @return  删除结果
     */
    @PostMapping("/village/grid/building/house/del/population")
    R delBuildingHousePopulation(@RequestBody DelComMngHousePopulationDTO housePopulationDTO);
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java
@@ -1,5 +1,6 @@
package com.panzhihua.common.service.grid;
import com.panzhihua.common.model.dtos.IdDTO;
import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.query.visit.EventTasksQuery;
@@ -1127,12 +1128,12 @@
    /**
     * 删除走访任务
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @return
     */
    @PostMapping("/eventvisitingtasks/delete")
    R delete(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId);
    R delete(@RequestBody IdDTO idDTO, @RequestParam("communityId") Long communityId);
    /**
     * 被走访人员列表
@@ -1157,31 +1158,31 @@
    /**
     * 撤销走访
     *
     * @param id
     * @param idDTO
     * @return
     */
    @PostMapping("/eventvisitingtasks/cancel/{id}")
    R cancel(@PathVariable("id") Long id);
    @PostMapping("/eventvisitingtasks/cancel")
    R cancel(@RequestBody IdDTO idDTO);
    /**
     * 恢复走访
     *
     * @param id
     * @param idDTO
     * @return
     */
    @PostMapping("/eventvisitingtasks/reset/{id}")
    R reset(@PathVariable("id") Long id);
    @PostMapping("/eventvisitingtasks/reset")
    R reset(@RequestBody IdDTO idDTO);
    /**
     * 新增走访
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @param userId
     * @return
     */
    @PostMapping("/eventvisitingtasks/add")
    R addVisitingTask(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId, @RequestParam("userId") Long userId);
    R addVisitingTask(@RequestBody IdDTO idDTO, @RequestParam("communityId") Long communityId, @RequestParam("userId") Long userId);
    /**
     * 开始走访
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java
@@ -145,10 +145,8 @@
    @ApiOperation(value = "实有人口-下载模板")
    @GetMapping("/export")
    public R exportPopulation() {
        //获取登陆用户
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        //获取登陆用户绑定社区id
        Long communityId = loginUserInfo.getCommunityId();
        Long communityId = 2L;//this.getCommunityId();
        //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
        String ftpUrl = "/mnt/data/web/excel/";
        String name = "实有人口导入模板.xlsx";
@@ -221,47 +219,58 @@
        List<String> head2 = new ArrayList<String>();
        head2.add("民族");
        List<String> head3 = new ArrayList<String>();
        head3.add("政治面貌(群众/中共党员/共青团员)");
        head3.add("政治面貌(中共党员/中共预备党员/共青团员/民革党员/台盟盟员/群众)");
        List<String> head4 = new ArrayList<String>();
        head4.add("是否租住(是/否)");
        List<String> head5 = new ArrayList<String>();
        head5.add("与户主关系(户主/配偶/子女/孙女/父母/其他)");
        head5.add("与户主关系(户主/本人/配偶/夫/妻/子/女/孙女/孙子/兄弟姐妹/父母/其他)");
        List<String> head6 = new ArrayList<String>();
        head6.add("*街/路/巷(必填)");
        List<String> head7 = new ArrayList<String>();
        head7.add("*小区号(必填,政府对于每个小区都有特定编号)");
        List<String> head8 = new ArrayList<String>();
        head8.add("*楼排号(必填)");
        List<String> head9 = new ArrayList<String>();
        head9.add("*单元号(必填)");
        List<String> head10 = new ArrayList<String>();
        head10.add("*单元号(必填)");
        head10.add("*户室(必填,四位数表示。前两位楼层,后两位户号)");
        List<String> head11 = new ArrayList<String>();
        head11.add("*户室(必填,四位数表示。前两位楼层,后两位户号)");
        head11.add("建筑用途");
        List<String> head12 = new ArrayList<String>();
        head12.add("联系方式");
        head12.add("房屋面积");
        List<String> head13 = new ArrayList<String>();
        head13.add("籍贯");
        head13.add("房屋状态(自住/租住/其他)");
        List<String> head14 = new ArrayList<String>();
        head14.add("文化程度(小学/初中/高中/中专/大专/本科/硕士/博士/其他)");
        head14.add("房屋用途(住宅/公寓/宿舍/仓库/其他)");
        List<String> head15 = new ArrayList<String>();
        head15.add("婚姻状况(未婚/已婚/离异/丧偶/分居/其他)");
        head15.add("管控状态(常规/关注/管控)");
        List<String> head16 = new ArrayList<String>();
        head16.add("健康状况");
        head16.add("联系方式");
        List<String> head17 = new ArrayList<String>();
        head17.add("工作单位");
        head17.add("籍贯");
        List<String> head18 = new ArrayList<String>();
        head18.add("备注");
        head18.add("文化程度(小学/初中/高中/中专/大专/本科/硕士/博士/其他)");
        List<String> head19 = new ArrayList<String>();
        head19.add("户口所在地");
        head19.add("婚姻状况(未婚/已婚/初婚/再婚/复婚/丧偶/离婚/分居/其他)");
        List<String> head20 = new ArrayList<String>();
        head20.add("本地外地(本地/外地)");
        head20.add("健康状况");
        List<String> head21 = new ArrayList<String>();
        head21.add("房屋状态(自住/租住/其他)");
        head21.add("工作单位");
        List<String> head22 = new ArrayList<String>();
        head22.add("房屋用途(住宅/公寓/宿舍/仓库/其他)");
        head22.add("本地外地(本地/外地)");
        List<String> head23 = new ArrayList<String>();
        head23.add("管控状态(常规/关注/管控)");
        head23.add("户口所在地");
        List<String> head24 = new ArrayList<String>();
        head24.add("是否为居住地(是/否)");
        head24.add("备注");
        List<String> head25 = new ArrayList<String>();
        head25.add("证件照(人面像)照片");
        List<String> head26 = new ArrayList<String>();
        head26.add("证件照(国徽面)照片");
        List<String> head27 = new ArrayList<String>();
        head27.add("户口本照片");
        List<String> head28 = new ArrayList<String>();
        head28.add("是否为居住地(是/否)");
        list.add(head0);
@@ -273,6 +282,7 @@
        list.add(head6);
        list.add(head7);
        list.add(head8);
        list.add(head9);
        list.add(head10);
        list.add(head11);
        list.add(head12);
@@ -288,6 +298,10 @@
        list.add(head22);
        list.add(head23);
        list.add(head24);
        list.add(head25);
        list.add(head26);
        list.add(head27);
        list.add(head28);
        return list;
    }
@@ -298,25 +312,30 @@
        data.add("汉族");
        data.add("群众");
        data.add("是");
        data.add("户主");
        data.add("本人");
        data.add("樱花街");
        data.add("115");
        data.add("15栋");
        data.add("1单元");
        data.add("1");
        data.add("1001");
        data.add("");
        data.add("");
        data.add("");
        data.add("");
        data.add("");
        data.add("13768548521");
        data.add("中国");
        data.add("硕士");
        data.add("未婚");
        data.add("");
        data.add("阿里巴巴");
        data.add("");
        data.add("四川成都");
        data.add("本地");
        data.add("自住");
        data.add("公寓");
        data.add("常规");
        data.add("否");
        data.add("四川成都");
        data.add("");
        data.add("");
        data.add("");
        data.add("");
        data.add("是");
        return data;
    }
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/VillageApi.java
New file
@@ -0,0 +1,70 @@
package com.panzhihua.grid_app.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.grid.*;
import com.panzhihua.common.service.community.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Api(tags = {"小区模块"})
@RestController
@RequestMapping("/village/")
public class VillageApi extends BaseController {
    @Resource
    private CommunityService communityService;
    @ApiOperation(value = "小区列表@lyq",response = PageComMngVillageVO.class)
    @PostMapping("/list")
    public R list(@RequestBody ComMngVillageListAppDTO villageListAppDTO){
        LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
        villageListAppDTO.setCommunityId(loginUserInfoVO.getCommunityId());
        return communityService.getGridVillageList(villageListAppDTO);
    }
    @ApiOperation(value = "小区楼栋列表@lyq",response = ComMngVillageBuildingVO.class)
    @PostMapping("/building/list")
    public R buildingList(@RequestParam("villageId")Long villageId){
        return communityService.getGridVillageBuildingList(villageId);
    }
    @ApiOperation(value = "小区楼栋下房屋列表@lyq",response = ComMngVillageBuildingHouseVO.class)
    @PostMapping("/building/house/list")
    public R buildingHouseList(@RequestBody PageComMngVillageBuildHouseAppDTO buildHouseAppDTO){
        return communityService.getGridVillageBuildingHouseList(buildHouseAppDTO);
    }
    @ApiOperation(value = "房屋详情@lyq",response = ComMngVillageBuildingHouseDetailVO.class)
    @PostMapping("/building/house/detail")
    public R buildingHouseDetail(@RequestParam("houseId")Long houseId){
        return communityService.getGridVillageBuildingHouseDetail(houseId);
    }
    @ApiOperation(value = "查询人口列表", response = EventSpecialPopulationVO.class)
    @PostMapping("/building/house/population/list")
    public R getBuildingHousePopulationList(@RequestBody PageComMngPopulationDTO populationDTO){
        return communityService.getBuildingHousePopulationList(populationDTO);
    }
    @ApiOperation(value = "房屋添加人员")
    @PostMapping("/building/house/add/population")
    public R addBuildingHousePopulation(@RequestBody AddComMngHousePopulationDTO housePopulationDTO){
        return communityService.addBuildingHousePopulation(housePopulationDTO);
    }
    @ApiOperation(value = "房屋删除人员")
    @PostMapping("/building/house/del/population")
    public R delBuildingHousePopulation(@RequestBody DelComMngHousePopulationDTO housePopulationDTO){
        return communityService.delBuildingHousePopulation(housePopulationDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EasyPhotoApi.java
@@ -34,9 +34,9 @@
        if(userInfoVO == null){
            return R.fail("请先登录");
        }
        if(easyAppDTO.getCommunityId() == null){
            easyAppDTO.setCommunityId(userInfoVO.getCommunityId());
        }
//        if(easyAppDTO.getCommunityId() == null){
//            easyAppDTO.setCommunityId(userInfoVO.getCommunityId());
//        }
        return gridService.easyListByAdmin(easyAppDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventApi.java
@@ -78,7 +78,7 @@
        eventBatchRevokeDTO.setUserId(loginUserInfoVO.getUserId());
        eventBatchRevokeDTO.setUserName(loginUserInfoVO.getName());
        eventBatchRevokeDTO.setCommunityName(loginUserInfoVO.getCommunityName());
        eventBatchRevokeDTO.setCommunityId(loginUserInfoVO.getCommunityId());
//        eventBatchRevokeDTO.setCommunityId(loginUserInfoVO.getCommunityId());
        eventBatchRevokeDTO.setRevokeType(2);
        eventBatchRevokeDTO.setRevokeId(loginUserInfoVO.getCommunityId());
        return gridService.batchMarkEventInvalid(eventBatchRevokeDTO);
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventGridDataApi.java
@@ -52,9 +52,9 @@
        if(loginUserInfo == null){
            return R.fail("请先登录");
        }
        if(loginUserInfo.getCommunityId() != 0){
            memberRelationDTO.setGridCommunityId(loginUserInfo.getCommunityId());
        }
//        if(loginUserInfo.getCommunityId() != 0){
//            memberRelationDTO.setGridCommunityId(loginUserInfo.getCommunityId());
//        }
        return userService.getGridMemberList(memberRelationDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventGridMemberRelationApi.java
@@ -38,11 +38,11 @@
    @PostMapping("/event/list")
    public R getGridDataList(@Validated @RequestBody PageEventGridDataAdminDTO eventGridDataDTO){
        ClazzUtils.setIfStringIsEmpty(eventGridDataDTO);
        Long communityId = this.getCommunityId();
        if(communityId == null){
            return R.fail("请先登录");
        }
        eventGridDataDTO.setGridCommunityId(communityId);
//        Long communityId = this.getCommunityId();
//        if(communityId == null){
//            return R.fail("请先登录");
//        }
//        eventGridDataDTO.setGridCommunityId(communityId);
        return gridService.getGridDataList(eventGridDataDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventManageApi.java
@@ -56,7 +56,7 @@
        ClazzUtils.setIfStringIsEmpty(pageEventManageDTO);
        LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
        pageEventManageDTO.setUserId(loginUserInfoVO.getUserId());
        pageEventManageDTO.setCommunityId(loginUserInfoVO.getCommunityId());
//        pageEventManageDTO.setCommunityId(loginUserInfoVO.getCommunityId());
        pageEventManageDTO.setRevokeType(1);
        return gridService.queryEventToManage(pageEventManageDTO);
    }
@@ -164,7 +164,7 @@
        commonEventDealDTO.setUserId(loginUserInfoVO.getUserId());
        commonEventDealDTO.setUserName(loginUserInfoVO.getNickName());
        commonEventDealDTO.setOperateType(1);
        commonEventDealDTO.setCommunityId(loginUserInfoVO.getCommunityId());
//        commonEventDealDTO.setCommunityId(loginUserInfoVO.getCommunityId());
        commonEventDealDTO.setCommunityName(loginUserInfoVO.getCommunityName());
        return gridService.dealEvent(commonEventDealDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventVisitingTasksApi.java
@@ -3,15 +3,11 @@
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.grid.EventVisitingTasksAddDTO;
import com.panzhihua.common.model.dtos.IdDTO;
import com.panzhihua.common.model.query.visit.EventTasksQuery;
import com.panzhihua.common.model.query.visit.EventVisitListQuery;
import com.panzhihua.common.model.vos.IPageVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.visit.AppVisitTasksVO;
import com.panzhihua.common.model.vos.visit.EventVisitCountVO;
import com.panzhihua.common.model.vos.visit.EventVisitListVO;
import com.panzhihua.common.model.vos.visit.EventVisitingTasksVO;
import com.panzhihua.common.model.vos.visit.*;
import com.panzhihua.common.service.grid.GridService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -21,6 +17,7 @@
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Date;
@@ -80,15 +77,15 @@
     */
    @PostMapping("/delete")
    @ApiOperation(value = "删除走访任务")
    public R delete(@RequestParam("ids") String ids){
        return gridService.delete(ids,this.getCommunityId());
    public R delete(@RequestBody @Valid IdDTO idDTO){
        return gridService.delete(idDTO,this.getCommunityId());
    }
    /**
     * 走访任务导出
     * @return
     */
    @GetMapping("/export")
    @GetMapping("/noToken/export")
    @ApiOperation(value = "导出走访任务")
    public void export(HttpServletResponse response,EventTasksQuery query){
//        query.setCommunityId(this.getCommunityId());
@@ -100,10 +97,10 @@
            List<EventVisitingTasksVO> list = gridService.exportTaskList(query);
            response.setContentType("application/vnd.ms-excel");
            response.setCharacterEncoding("utf-8");
            String fileName = "走访任务-"+ DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
            String fileName = "走访任务-"+ DateUtil.format(new Date(),"yyyyMMddHHmmss");
            response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20") + ".xlsx");
            // 如果不用模板的方式导出的话,是doWrite
            EasyExcel.write(response.getOutputStream(), EventVisitingTasksVO.class).sheet(fileName).doWrite(list);
            EasyExcel.write(os, EventVisitingTasksVO.class).sheet(fileName).doWrite(list);
            os.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
@@ -135,7 +132,7 @@
     * @return
     */
    @GetMapping("/detail/{id}")
    @ApiOperation(value = "待走访人员详情")
    @ApiOperation(value = "待走访人员详情",response = EventVisitingTasksDetailsVO.class)
    public R detail(@PathVariable("id") Long id){
        return gridService.detail(id);
    }
@@ -146,30 +143,30 @@
     */
    @PostMapping("/add")
    @ApiOperation(value = "新增走访任务")
    public R add(@RequestParam("ids") String ids){
        return gridService.addVisitingTask(ids,this.getCommunityId(),this.getUserId());
    public R add(@RequestBody @Valid IdDTO idDTO){
        return gridService.addVisitingTask(idDTO,this.getCommunityId(),this.getUserId());
    }
    /**
     * 撤销走访任务
     * @param id
     * @param idDTO
     * @return
     */
    @PostMapping("/cancel")
    @ApiOperation(value = "撤销走访任务")
    public R cancel(@RequestParam("id") Long id){
        return gridService.cancel(id);
    public R cancel(@RequestBody @Valid IdDTO idDTO){
        return gridService.cancel(idDTO);
    }
    /**
     * 恢复走访任务
     * @param id
     * @param idDTO
     * @return
     */
    @PostMapping("/reset")
    @ApiOperation(value = "新增走访任务")
    public R reset(@RequestParam("id") Long id){
        return gridService.reset(id);
    public R reset(@RequestBody @Valid IdDTO idDTO){
        return gridService.reset(idDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/PopulationApi.java
New file
@@ -0,0 +1,48 @@
package com.panzhihua.grid_backstage.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.grid.PopulationDetailVO;
import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationListVO;
import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.grid.GridService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Api(tags = {"居民模块"})
@RestController
@RequestMapping("/population/")
public class PopulationApi extends BaseController {
    @Resource
    private CommunityService communityService;
    @ApiOperation(value = "居民列表@lyq",response = ComMngPopulationListVO.class)
    @PostMapping("/list")
    public R list(@RequestBody ComMngPopulationListDTO populationListDTO){
//        LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
//        populationListDTO.setCommunityId(loginUserInfoVO.getCommunityId());
        return communityService.getGridPopulationList(populationListDTO);
    }
    @ApiOperation(value = "居民删除@lyq")
    @PostMapping("/del")
    public R del(@RequestBody List<Long> ids){
        return communityService.delGridPopulation(ids);
    }
    @ApiOperation(value = "居民查看@lyq",response = PopulationDetailVO.class)
    @GetMapping("/get")
    public R get(@RequestParam("populationId")Long populationId){
        return communityService.getGridPopulationDetail(populationId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/PublicityEventApi.java
@@ -47,7 +47,7 @@
        ClazzUtils.setIfStringIsEmpty(pagePublicityEventDTO);
        LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
        pagePublicityEventDTO.setUserId(loginUserInfoVO.getUserId());
        pagePublicityEventDTO.setCommunityId(loginUserInfoVO.getCommunityId());
//        pagePublicityEventDTO.setCommunityId(loginUserInfoVO.getCommunityId());
        pagePublicityEventDTO.setRevokeType(2);
        return gridService.queryPublicityCommunity(pagePublicityEventDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/StatisticsApi.java
@@ -47,9 +47,9 @@
        if(loginUserInfoVO == null){
            return R.fail("请先登录");
        }
        if(statisticsAdminDTO.getCommunityId() == null){
            statisticsAdminDTO.setCommunityId(loginUserInfoVO.getCommunityId());
        }
//        if(statisticsAdminDTO.getCommunityId() == null){
//            statisticsAdminDTO.setCommunityId(loginUserInfoVO.getCommunityId());
//        }
        return gridService.gridMemberStatistics(statisticsAdminDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/SystemApi.java
New file
@@ -0,0 +1,34 @@
package com.panzhihua.grid_backstage.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.user.ComMngUserTagVO;
import com.panzhihua.common.service.user.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
 * @author xyh
 * @date 2021/6/29 14:45
 */
@Api(tags = {"系统管理"})
@Slf4j
@RequestMapping("/system")
@RestController
public class SystemApi extends BaseController {
    @Resource
    private UserService userService;
    @ApiOperation(value = "获取用户标签",response = ComMngUserTagVO.class)
    @GetMapping("/tags")
    public R config(){
        return userService.listComMngUserTag(this.getCommunityId());
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComMngVillageApi.java
@@ -1,9 +1,14 @@
package com.panzhihua.service_community.api;
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO;
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
import com.panzhihua.service_community.service.ComMngPopulationHouseService;
import com.panzhihua.service_community.service.ComMngPopulationHouseUserService;
import com.panzhihua.service_community.service.ComMngPopulationService;
import com.panzhihua.service_community.service.ComMngVillageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
@@ -23,6 +28,12 @@
public class ComMngVillageApi {
    @Resource
    private ComMngVillageService comMngVillageService;
    @Resource
    private ComMngPopulationHouseService comMngPopulationHouseService;
    @Resource
    private ComMngPopulationHouseUserService comMngPopulationHouseUserService;
    @Resource
    private ComMngPopulationService comMngPopulationService;
    /**
     * 新增实有房屋
@@ -105,5 +116,60 @@
        return comMngVillageService.getVillage(villageId);
    }
    /**
     * 综治app-小区列表
     * @param villageListAppDTO 请求参数
     * @return  小区列表
     */
    @PostMapping("/village/grid/list")
    public R getGridPopulationAdminList(@RequestBody ComMngVillageListAppDTO villageListAppDTO) {
        return comMngVillageService.getGridVillageList(villageListAppDTO);
    }
    /**
     * 综治app-根据小区id查询小区下楼栋列表
     * @param villageId 小区id
     * @return  楼栋列表
     */
    @PostMapping("/village/grid/building/list")
    public R getGridVillageBuildingList(@RequestParam("villageId")Long villageId) {
        return comMngVillageService.getGridVillageBuildingList(villageId);
    }
    /**
     * 小区楼栋下房屋列表
     * @param buildHouseAppDTO  请求参数
     * @return  房屋列表
     */
    @PostMapping("/village/grid/building/house/list")
    public R getGridVillageBuildingHouseList(@RequestBody PageComMngVillageBuildHouseAppDTO buildHouseAppDTO) {
        return comMngPopulationHouseService.getGridVillageBuildingHouseList(buildHouseAppDTO);
    }
    /**
     * 小区楼栋下房屋信息
     * @param houseId   房屋id
     * @return  房屋信息
     */
    @PostMapping("/village/grid/building/house/detail")
    public R getGridVillageBuildingHouseDetail(@RequestParam("houseId")Long houseId) {
        return comMngPopulationHouseService.getGridVillageBuildingHouseDetail(houseId);
    }
    @PostMapping("/village/grid/building/house/population/list")
    public R getBuildingHousePopulationList(@RequestBody PageComMngPopulationDTO populationDTO) {
        return comMngPopulationService.getBuildingHousePopulationList(populationDTO);
    }
    @PostMapping("/village/grid/building/house/add/population")
    public R addBuildingHousePopulation(@RequestBody AddComMngHousePopulationDTO housePopulationDTO) {
        return comMngPopulationHouseUserService.addBuildingHousePopulation(housePopulationDTO);
    }
    @PostMapping("/village/grid/building/house/del/population")
    public R delBuildingHousePopulation(@RequestBody DelComMngHousePopulationDTO housePopulationDTO) {
        return comMngPopulationHouseUserService.delBuildingHousePopulation(housePopulationDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/PopulationApi.java
@@ -1,6 +1,7 @@
package com.panzhihua.service_community.api;
import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.service.ComMngPopulationService;
@@ -8,6 +9,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@RestController
@@ -32,6 +34,25 @@
        return comMngPopulationService.getPopulationRepairByApp();
    }
    /**
     * 综治后台-居民列表
     * @param populationListDTO 请求参数
     * @return  居民列表
     */
    @PostMapping("/grid/list")
    public R getGridPopulationAdminList(@RequestBody ComMngPopulationListDTO populationListDTO) {
        return comMngPopulationService.getGridPopulationAdminList(populationListDTO);
    }
    @PostMapping("/grid/del")
    public R delGridPopulationAdmin(@RequestBody List<Long> ids) {
        return comMngPopulationService.delGridPopulationAdmin(ids);
    }
    @GetMapping("/grid/get")
    public R getGridPopulationAdminDetail(@RequestParam("populationId")Long populationId) {
        return comMngPopulationService.getPopulationDetailApp(populationId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
@@ -311,7 +311,7 @@
            " AND DATE_FORMAT(caa.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{actActivityListDTO.endTime} " +
            " </if> " +
            "<if test='actActivityListDTO.type!=null'>" +
            " AND caa.type = #{actActivityListDTO.type} " +
            " AND caa.status = #{actActivityListDTO.type} " +
            " </if> " +
            " </where> "+
            "ORDER BY " +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDynDAO.java
@@ -94,6 +94,9 @@
            "<if test='comActDynVO.status != null '>" +
            "AND d.`status` = #{comActDynVO.status}  " +
            " </if> " +
            "<if test='comActDynVO.type != null '>" +
            "AND d.type = #{comActDynVO.type}  " +
            " </if> " +
            "<if test='comActDynVO.publishAtBegin != null '>" +
            "AND d.publish_at BETWEEN #{comActDynVO.publishAtBegin}  " +
            "AND #{comActDynVO.publishAtEnd}" +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -84,6 +84,9 @@
            "<if test='neighborCircleAdminDTO.startAt != null and neighborCircleAdminDTO.endAt !=null '>" +
            "and nc.create_at between #{neighborCircleAdminDTO.startAt} and #{neighborCircleAdminDTO.endAt}  \n" +
            " </if> " +
            "<if test='neighborCircleAdminDTO.status != null '>" +
            "and nc.status = #{neighborCircleAdminDTO.status}  \n" +
            " </if> " +
            "</where>"+
            "order by " +
            "case when nc.`status`=1 then 0 else 1 end, \n" +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActVillageDAO.java
@@ -1,11 +1,22 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.vos.community.ComMngVillageTotalVO;
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO;
import com.panzhihua.common.model.vos.grid.PageComMngVillageVO;
import com.panzhihua.common.model.vos.grid.PopulationDetailVO;
import com.panzhihua.service_community.model.dos.ComMngVillageDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
@@ -30,4 +41,38 @@
    @Select("select village_id,alley,house_num,group_at,type,address,update_at from com_mng_village where village_id = #{villageId}")
    ComMngVillageVO getVillageById(@Param("villageId") Long villageId);
    @Select("<script> " +
            "SELECT " +
            " village_id, " +
            " `name` AS userName, " +
            " build_sum, " +
            " address, " +
            " create_at as createAt, " +
            " lng, " +
            " lat, " +
            " ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id ) AS userSum, " +
            " ( SELECT count( id ) FROM com_mng_population_house WHERE village_id = cmv.village_id ) AS houseNum, " +
            " ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id AND out_or_local = 1 ) AS registerNum, " +
            " ( SELECT count( id ) FROM com_mng_population WHERE village_id = cmv.village_id AND is_rent = 2 ) AS rentNum  " +
            "FROM " +
            " com_mng_village AS cmv where cmv.community_id = #{villageListAppDTO.communityId} " +
            "<if test='villageListAppDTO.name != null and villageListAppDTO.name != &quot;&quot;'>" +
            " and cmv.name like concat(#{villageListAppDTO.name},'%')"+
            " </if> " +
            "<if test='villageListAppDTO.sortColumns!=null'>" +
            " ORDER BY ${villageListAppDTO.sortColumns} ${villageListAppDTO.sortType} " +
            " </if>" +
            " </script>")
    IPage<PageComMngVillageVO> getGridVillageList(Page page, @Param("villageListAppDTO") ComMngVillageListAppDTO villageListAppDTO);
    @Select("SELECT DISTINCT " +
            " village_id," +
            " floor, " +
            " unit_no  " +
            "FROM " +
            " com_mng_population_house AS cmph  " +
            "WHERE " +
            " village_id = #{villageId}")
    List<ComMngVillageBuildingVO> getGridVillageBuildingList(@Param("villageId") Long villageId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -4,7 +4,9 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngPopulationDTO;
import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.dtos.user.PageInputUserDTO;
import com.panzhihua.common.model.vos.area.AreaAddressVO;
import com.panzhihua.common.model.vos.community.ComActMessageVO;
@@ -15,8 +17,10 @@
import com.panzhihua.common.model.vos.community.screen.event.*;
import com.panzhihua.common.model.vos.community.screen.index.*;
import com.panzhihua.common.model.vos.grid.EventGridDataVO;
import com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO;
import com.panzhihua.common.model.vos.grid.PopulationDetailVO;
import com.panzhihua.common.model.vos.grid.PopulationListVO;
import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationListVO;
import com.panzhihua.common.model.vos.user.*;
import com.panzhihua.common.model.vos.community.PageComActMessageVO;
import com.panzhihua.common.model.vos.user.ComHouseMemberVo;
@@ -910,4 +914,83 @@
            " id = #{populationId}")
    PopulationDetailVO getPopulationDetailApp(@Param("populationId") Long populationId);
    @Select("<script> " +
            "SELECT " +
            " *  " +
            "FROM " +
            " ( " +
            " SELECT " +
            " cmp.id, " +
            "  cmp.`name` AS userName, " +
            "  cmp.label, " +
            "  cmp.card_no, " +
            "  cmp.card_no_str, " +
            "  cmp.sex, " +
            "  cmp.address, " +
            "  cmp.political_outlook, " +
            "  cmp.census_register, " +
            "  cmp.house_id, " +
            "  cmp.phone, " +
            "  IFNULL(cmp.house_id,0) as isHouse, " +
            "  ( SELECT event_status FROM event_visiting_tasks WHERE event_status in (1,2,3,5) AND visiter_id = cmp.id ORDER BY create_at DESC LIMIT 1 ) AS eventStatus, " +
            "  ( SELECT create_at FROM event_visiting_tasks WHERE event_status in (1,2,3,5) AND visiter_id = cmp.id ORDER BY create_at DESC LIMIT 1 ) AS createAt " +
            " FROM " +
            " com_mng_population AS cmp where 1=1 " +
            "<if test='populationListDTO.keyWord != null and populationListDTO.keyWord != &quot;&quot;'>" +
            "AND (cmp.name like concat (#{populationListDTO.keyWord},'%') or cmp.card_no_str like concat (#{populationListDTO.keyWord},'%') or cmp.address like concat (#{populationListDTO.keyWord},'%')) " +
            " </if> " +
            "<if test='populationListDTO.label != null and populationListDTO.label != &quot;&quot;'>" +
            "AND cmp.label like concat ('%',#{populationListDTO.label},'%') " +
            " </if> " +
            "<if test='populationListDTO.sex != null'>" +
            "AND cmp.sex = #{populationListDTO.sex} " +
            " </if> " +
            "<if test='populationListDTO.isHouse != null and populationListDTO.isHouse == 1'>" +
            "AND cmp.house_id is not null " +
            " </if> " +
            "<if test='populationListDTO.isHouse != null and populationListDTO.isHouse == 2'>" +
            "AND cmp.house_id is null " +
            " </if> " +
            "<if test='populationListDTO.communityId != null'>" +
            "AND cmp.act_id = #{populationListDTO.communityId} " +
            " </if> " +
            "<if test='populationListDTO.politicalOutlook != null'>" +
            "AND cmp.political_outlook = #{populationListDTO.politicalOutlook} " +
            " </if> " +
            " ) as population where 1=1 " +
            "<if test='populationListDTO.eventStatus != null'>" +
            "AND population.eventStatus = #{populationListDTO.eventStatus} " +
            " </if> " +
            " </script>")
    IPage<ComMngPopulationListVO> getGridPopulationAdminList(Page page,@Param("populationListDTO") ComMngPopulationListDTO populationListDTO);
    @Select("select relation from com_mng_population_house_user where house_id = #{houseId} and popul_id = #{populationId}")
    Integer getPopulationRelationByHouseId(@Param("houseId") Long houseId, @Param("populationId") Long populationId);
    @Select("<script>" +
            " select count(id) from event_visiting_tasks as evt where visiter_id in " +
            "<foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' >" +
            "#{id}" +
            "</foreach>" +
            " </script>")
    Integer getPopulationVisitingCount(@Param("ids") List<Long> ids);
    @Select("<script> " +
            "SELECT " +
            "   cmp.id, " +
            "   cmp.`name`, " +
            "   cmp.card_no as idCard, " +
            "   cmp.label, " +
            "   cmp.sex, " +
            "   cmp.phone, " +
            "   cmp.address, " +
            "   cmp.political_outlook " +
            "  FROM " +
            "   com_mng_population AS cmp where 1=1 " +
            "<if test='populationDTO.keyWord != null'>" +
            " AND (cmp.name like concat(#{populationDTO.keyWord},'%') or cmp.card_no_str like concat(#{populationDTO.keyWord},'%')) " +
            " </if> " +
            " </script>")
    IPage<EventSpecialPopulationVO> getBuildingHousePopulationList(Page page,@Param("populationDTO") PageComMngPopulationDTO populationDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationHouseDAO.java
@@ -4,7 +4,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO;
import com.panzhihua.common.model.vos.grid.PopulationListVO;
import com.panzhihua.common.model.vos.user.ComMngHouseVo;
import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO;
import org.apache.ibatis.annotations.Mapper;
@@ -173,5 +177,69 @@
            " from com_act as ca where ca.community_id = #{communityId}")
    ComMngVillageRegionVO getRegion(@Param("communityId") Long communityId);
    @Select("<script> " +
            "SELECT id, floor, unit_no, house_no, `status`,( SELECT count( id ) FROM com_mng_population_house_user WHERE house_id = cmph.id ) AS userNum " +
            " FROM " +
            " com_mng_population_house AS cmph " +
            " <where> " +
            "<if test='buildHouseAppDTO.villageId != null '>" +
            " and cmph.village_id = #{buildHouseAppDTO.villageId}  " +
            " </if> " +
            "<if test='buildHouseAppDTO.floor != null and buildHouseAppDTO.floor !=&quot;&quot; '>" +
            " and cmph.floor = #{buildHouseAppDTO.floor}  " +
            " </if> " +
            "<if test='buildHouseAppDTO.unitNo != null and buildHouseAppDTO.unitNo !=&quot;&quot; '>" +
            " and cmph.unit_no = #{buildHouseAppDTO.unitNo}  " +
            " </if> " +
            "<if test='buildHouseAppDTO.houseNo != null and buildHouseAppDTO.houseNo !=&quot;&quot; '>" +
            " and cmph.house_no like concat(#{buildHouseAppDTO.houseNo},'%')  " +
            " </if> " +
            " </where>" +
            " </script>")
    IPage<ComMngVillageBuildingHouseVO> getGridVillageBuildingHouseList(Page page, @Param("buildHouseAppDTO") PageComMngVillageBuildHouseAppDTO buildHouseAppDTO);
    @Select("SELECT " +
            " cmph.id, " +
            " cmv.`name` AS villageName, " +
            " cmph.floor, " +
            " cmph.unit_no, " +
            " cmph.house_no, " +
            " cmph.address, " +
            " cmph.`status`, " +
            " cmv.lat, " +
            " cmv.lng  " +
            "FROM " +
            " com_mng_population_house AS cmph " +
            " LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmph.village_id  " +
            "WHERE " +
            " cmph.id = #{houseId}")
    ComMngVillageBuildingHouseDetailVO getGridVillageBuildingHouseDetail(@Param("houseId") Long houseId);
    @Select("<script> " +
            "SELECT " +
            " cmp.id, " +
            " cmphu.id as housePopulationId, " +
            " cmp.sex, " +
            " cmp.`name`, " +
            " cmp.phone, " +
            " cmp.card_no, " +
            " cmp.label, " +
            " cmp.address, " +
            " cmp.nation, " +
            " cmphu.create_at, " +
            " cmp.political_outlook  " +
            "FROM " +
            " com_mng_population_house_user AS cmphu " +
            " LEFT JOIN com_mng_population AS cmp ON cmp.id = cmphu.popul_id  " +
            "WHERE " +
            " cmphu.house_id = #{houseId} " +
            "<if test='relation != null '>" +
            " AND cmphu.relation = #{relation}  " +
            " </if> " +
            "<if test='relationId != null '>" +
            " AND cmphu.relation_id = #{relationId}  " +
            " </if> " +
            " </script>")
    List<PopulationListVO> getGridVillageBuildingPopulationList(@Param("houseId") Long houseId,@Param("relation") Integer relation,@Param("relationId") Integer relationId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationHouseUserDAO.java
@@ -30,4 +30,10 @@
            "left join com_mng_population as cmp on cmp.id = cmphu.popul_id where cmphu.house_id = #{houseId}")
    List<ComMngPopulationHouseUserAdminVO> getHouseUserByHouseId(@Param("houseId") Long houseId);
    @Select("update com_mng_population_house_user set relation = null where id = #{id}")
    Integer delBuildingHousePopulationRelation(@Param("id") Long id);
    @Select("update com_mng_population_house_user set relation_id = null where id = #{id}")
    Integer delBuildingHousePopulationRelationId(@Param("id") Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java
@@ -174,7 +174,7 @@
    /**
     * 居住地房屋id
     */
//    private Long houseId;
    private Long houseId;
    /**
     * 性别(1.男 2.女 3.未知)
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationHouseUserDO.java
@@ -62,6 +62,26 @@
    @TableField(fill = FieldFill.INSERT)
    private Date createAt;
    /**
     * 与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)
     */
    public interface relation{
        int hz = 1;
        int po = 2;
        int zn = 3;
        int sn = 4;
        int fm = 5;
        int qt = 6;
    }
    /**
     * 人和房屋关系’ (1.自住2、租住)
     */
    public interface relationId{
        int zizhu = 1;
        int zuzhu = 2;
    }
    @Override
    public String toString() {
        return "ComMngPopulationHouseUserDO{" +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationHouseService.java
@@ -4,6 +4,7 @@
import com.panzhihua.common.model.dtos.community.CascadeHouseDTO;
import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO;
import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseEditAdminDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO;
@@ -65,4 +66,18 @@
     */
    R getRegion(Long communityId);
    /**
     * 小区楼栋下房屋列表
     * @param buildHouseAppDTO  请求参数
     * @return  房屋列表
     */
    R getGridVillageBuildingHouseList(PageComMngVillageBuildHouseAppDTO buildHouseAppDTO);
    /**
     * 小区楼栋下房屋详情
     * @param houseId   房屋id
     * @return  房屋详情
     */
    R getGridVillageBuildingHouseDetail(Long houseId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationHouseUserService.java
@@ -1,6 +1,9 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO;
import com.panzhihua.common.model.dtos.grid.DelComMngHousePopulationDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO;
/**
@@ -10,4 +13,8 @@
 */
public interface ComMngPopulationHouseUserService extends IService<ComMngPopulationHouseUserDO> {
    R addBuildingHousePopulation(AddComMngHousePopulationDTO housePopulationDTO);
    R delBuildingHousePopulation(DelComMngHousePopulationDTO housePopulationDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -5,7 +5,10 @@
import com.panzhihua.common.model.dtos.community.ComMngPopulationTagCardNoDTO;
import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO;
import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO;
import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngPopulationDTO;
import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.dtos.user.PageInputUserDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO;
@@ -214,4 +217,12 @@
    R getPopulationDetailApp(Long populationId);
    R getPopulationRepairByApp();
    R getGridPopulationAdminList(ComMngPopulationListDTO populationListDTO);
    R delGridPopulationAdmin(List<Long> ids);
    R getBuildingHousePopulationList(PageComMngPopulationDTO populationDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngVillageService.java
@@ -1,6 +1,9 @@
package com.panzhihua.service_community.service;
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO;
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
@@ -69,4 +72,19 @@
     * @return  小区详情
     */
    R getVillage(Long villageId);
    /**
     * 小区列表
     * @param villageListAppDTO 请求参数
     * @return  小区列表
     */
    R getGridVillageList(ComMngVillageListAppDTO villageListAppDTO);
    /**
     * 小区下楼栋列表
     * @param villageId 小区id
     * @return  小区下楼栋列表
     */
    R getGridVillageBuildingList(Long villageId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java
@@ -1,17 +1,23 @@
package com.panzhihua.service_community.service.impl;
import cn.hutool.core.util.IdcardUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.CascadeHouseDTO;
import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO;
import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseEditAdminDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngCascadeHouseVO;
import com.panzhihua.common.model.vos.community.ComMngPopulationHouseDetailAdminVO;
import com.panzhihua.common.model.vos.community.ComMngPopulationHouseTotalVO;
import com.panzhihua.common.model.vos.community.ComMngPopulationHouseUserAdminVO;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO;
import com.panzhihua.common.model.vos.grid.PopulationListVO;
import com.panzhihua.service_community.dao.ComActVillageDAO;
import com.panzhihua.service_community.dao.ComMngPopulationDAO;
import com.panzhihua.service_community.dao.ComMngPopulationHouseDAO;
@@ -246,4 +252,84 @@
        return R.ok(this.baseMapper.getRegion(communityId));
    }
    /**
     * 小区楼栋下房屋列表
     * @param buildHouseAppDTO  请求参数
     * @return  房屋列表
     */
    @Override
    public R getGridVillageBuildingHouseList(PageComMngVillageBuildHouseAppDTO buildHouseAppDTO){
        IPage<ComMngVillageBuildingHouseVO> buildingHouseVOIPage = this.baseMapper.getGridVillageBuildingHouseList(new Page(buildHouseAppDTO.getPageNum(),buildHouseAppDTO.getPageSize()),buildHouseAppDTO);
        if(!buildingHouseVOIPage.getRecords().isEmpty()){
            buildingHouseVOIPage.getRecords().forEach(house ->{
                boolean result=house.getHouseNo().matches("[0-9]+");
                if(result){//该字段为纯数字
                    if(house.getHouseNo().length() == 4){
                        house.setBuildingNum(house.getHouseNo().substring(0,2).replaceAll("^(0+)", ""));
                    }else if(house.getHouseNo().length() == 3){
                        house.setBuildingNum(house.getHouseNo().substring(0,1).replaceAll("^(0+)", ""));
                    }
                }else{
                    house.setBuildingNum("-");
                }
            });
        }
        return R.ok(buildingHouseVOIPage);
    }
    /**
     * 小区楼栋下房屋信息
     * @param houseId   房屋id
     * @return  房屋信息
     */
    @Override
    public R getGridVillageBuildingHouseDetail(Long houseId){
        ComMngVillageBuildingHouseDetailVO buildingHouseDetailVO = this.baseMapper.getGridVillageBuildingHouseDetail(houseId);
        if(buildingHouseDetailVO != null){
            //转换楼层数
            String houseNo = buildingHouseDetailVO.getHouseNo();
            boolean result = houseNo.matches("[0-9]+");
            if(result){//该字段为纯数字
                if(houseNo.length() == 4){
                    buildingHouseDetailVO.setBuildingNum(houseNo.substring(0,2).replaceAll("^(0+)", ""));
                }else if(houseNo.length() == 3){
                    buildingHouseDetailVO.setBuildingNum(houseNo.substring(0,1).replaceAll("^(0+)", ""));
                }
            }else{
                buildingHouseDetailVO.setBuildingNum("-");
            }
            //查询该房屋的户主信息
            List<PopulationListVO> householderList = this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(),1,null);
            if(!householderList.isEmpty()){
                householderList.forEach(householder -> {
                    try {
                        Integer age = IdcardUtil.getAgeByIdCard(householder.getCardNo());
                        householder.setAge(age);
                    }catch (Exception e){
                        log.error("身份证号码转换年龄失败,人员id:" + householder.getId());
                    }
                });
                buildingHouseDetailVO.setHouseholderList(householderList);
            }
            //查询该房屋的住户信息
            List<PopulationListVO> populationList = this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(),null,1);
            if(!populationList.isEmpty()){
                populationList.forEach(population -> {
                    try {
                        Integer age = IdcardUtil.getAgeByIdCard(population.getCardNo());
                        population.setAge(age);
                    }catch (Exception e){
                        log.error("身份证号码转换年龄失败,人员id:" + population.getId());
                    }
                });
                buildingHouseDetailVO.setPopulationList(populationList);
            }
        }
        return R.ok(buildingHouseDetailVO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseUserServiceImpl.java
@@ -1,11 +1,21 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO;
import com.panzhihua.common.model.dtos.grid.DelComMngHousePopulationDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.service_community.dao.ComMngPopulationHouseUserDAO;
import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO;
import com.panzhihua.service_community.service.ComMngPopulationHouseUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * @auther lyq
@@ -16,4 +26,62 @@
@Service
public class ComMngPopulationHouseUserServiceImpl extends ServiceImpl<ComMngPopulationHouseUserDAO, ComMngPopulationHouseUserDO> implements ComMngPopulationHouseUserService {
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R addBuildingHousePopulation(AddComMngHousePopulationDTO housePopulationDTO){
        List<ComMngPopulationHouseUserDO> populationHouseUserDOList = new ArrayList<>();
        if(!housePopulationDTO.getPopulationIds().isEmpty()){
            housePopulationDTO.getPopulationIds().forEach(housePopulationId -> {
                ComMngPopulationHouseUserDO populationHouseUserDO = this.baseMapper.selectOne(
                        new QueryWrapper<ComMngPopulationHouseUserDO>().lambda()
                                .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDTO.getHouseId())
                                .eq(ComMngPopulationHouseUserDO::getPopulId,housePopulationId));
                if(populationHouseUserDO == null){
                    populationHouseUserDO = new ComMngPopulationHouseUserDO();
                    populationHouseUserDO.setId(Snowflake.getId());
                    populationHouseUserDO.setHouseId(housePopulationDTO.getHouseId());
                    populationHouseUserDO.setPopulId(housePopulationId);
                    populationHouseUserDO.setRelationId(ComMngPopulationHouseUserDO.relationId.zizhu);
                    populationHouseUserDO.setStartAt(new Date());
                    populationHouseUserDO.setCreateAt(new Date());
                    if(housePopulationDTO.getType().equals(AddComMngHousePopulationDTO.type.hz)){
                        populationHouseUserDO.setRelation(ComMngPopulationHouseUserDO.relation.hz);
                    }
                    populationHouseUserDOList.add(populationHouseUserDO);
                }else{
                    if(housePopulationDTO.getType().equals(AddComMngHousePopulationDTO.type.hz)){
                        populationHouseUserDO.setRelation(ComMngPopulationHouseUserDO.relation.hz);
                    }
                    populationHouseUserDO.setRelationId(ComMngPopulationHouseUserDO.relationId.zizhu);
                    this.baseMapper.updateById(populationHouseUserDO);
                }
            });
        }
        this.saveBatch(populationHouseUserDOList);
        return R.ok();
    }
    @Override
    public R delBuildingHousePopulation(DelComMngHousePopulationDTO housePopulationDTO){
        ComMngPopulationHouseUserDO houseUserDO = this.baseMapper.selectById(housePopulationDTO.getHousePopulationId());
        if(houseUserDO == null){
            return R.fail("未查询到居住用户数据");
        }
        if(housePopulationDTO.getType().equals(DelComMngHousePopulationDTO.type.hz)){
            if(houseUserDO.getRelationId() == null || !houseUserDO.getRelationId().equals(ComMngPopulationHouseUserDO.relationId.zizhu)){
                this.baseMapper.deleteById(housePopulationDTO.getHousePopulationId());
            }else{
                this.baseMapper.delBuildingHousePopulationRelation(housePopulationDTO.getHousePopulationId());
            }
        }else{
            if(houseUserDO.getRelation() == null || !houseUserDO.getRelation().equals(ComMngPopulationHouseUserDO.relation.hz)){
                this.baseMapper.deleteById(housePopulationDTO.getHousePopulationId());
            }else{
                this.baseMapper.delBuildingHousePopulationRelationId(housePopulationDTO.getHousePopulationId());
            }
        }
        return R.ok();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -16,7 +16,10 @@
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.dtos.community.*;
import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO;
import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngPopulationDTO;
import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.dtos.user.PageInputUserDTO;
import com.panzhihua.common.model.helper.AESUtil;
import com.panzhihua.common.model.vos.R;
@@ -27,11 +30,10 @@
import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO;
import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO;
import com.panzhihua.common.model.vos.community.screen.event.*;
import com.panzhihua.common.model.vos.community.screen.event.EventTransferRecordVO;
import com.panzhihua.common.model.vos.community.screen.index.*;
import com.panzhihua.common.model.vos.grid.EventGridDataVO;
import com.panzhihua.common.model.vos.grid.EventResourceVO;
import com.panzhihua.common.model.vos.grid.PopulationDetailVO;
import com.panzhihua.common.model.vos.grid.PopulationListVO;
import com.panzhihua.common.model.vos.grid.*;
import com.panzhihua.common.model.vos.grid.admin.ComMngPopulationListVO;
import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO;
import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO;
import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO;
@@ -356,6 +358,7 @@
                    + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo();
            vo.setAddress(address);
            //todo 后期优化改为批量
            //先判断房屋是否存在
            ComMngPopulationHouseDO populationHouseDO = comMngPopulationHouseDAO.selectOne(new QueryWrapper<ComMngPopulationHouseDO>().lambda()
                    .eq(ComMngPopulationHouseDO::getCommunityId, communityId).eq(ComMngPopulationHouseDO::getVillageId, comMngVillageDO.getVillageId())
@@ -364,6 +367,7 @@
            if (populationHouseDO == null) {
                //房屋信息不存在建立房屋信息
                populationHouseDO = savePopulationHouse(vo, comMngVillageDO, communityId, address, areaPath, comActDO.getName());
                vo.setHouseId(populationHouseDO.getId());
            }
            if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) {
@@ -380,7 +384,7 @@
            } else {
                //如果存在人口信息,且是自用房,则更新人口默认的房屋信息
                if (vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) {
                    populationDO = updatePopulationHouseUse(vo, populationDO);
                    populationDO = updatePopulationDO(vo, populationDO);
                }
            }
@@ -413,7 +417,7 @@
        return R.ok();
    }
    private ComMngPopulationDO updatePopulationHouseUse(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO) throws Exception {
    private ComMngPopulationDO updatePopulationDO(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO) throws Exception {
        populationDO.setRoad(vo.getRoad());
        populationDO.setDoorNo(vo.getDoorNo());
        populationDO.setFloor(vo.getFloor());
@@ -421,8 +425,10 @@
        populationDO.setHouseNo(vo.getHouseNo());
        populationDO.setCardNo(vo.getCardNo());
        populationDO.setCardNoStr(vo.getCardNo());
        if(vo.getIsResidence().intValue() == 1){
            populationDO.setHouseId(vo.getHouseId());
        }
        if (StringUtils.isNotEmpty(populationDO.getPhone())) {
//            populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey));
            populationDO.setPhone(populationDO.getPhone());
        }
        this.baseMapper.updateById(populationDO);
@@ -442,6 +448,9 @@
        populationDO.setCardNo(vo.getCardNo());
        populationDO.setCardNoStr(vo.getCardNo());
        populationDO.setUpdateAt(new Date());
        if(vo.getIsResidence().intValue() == 1){
            populationDO.setHouseId(vo.getHouseId());
        }
        this.baseMapper.insert(populationDO);
        return populationDO;
    }
@@ -454,12 +463,12 @@
        populationHouseDO.setVillageId(comMngVillageDO.getVillageId());
        populationHouseDO.setAlley(vo.getRoad());
        populationHouseDO.setHouseNum(vo.getDoorNo());
        populationHouseDO.setCode(vo.getDoorNo());
        populationHouseDO.setStatus(vo.getIsRent());
        populationHouseDO.setCommunityId(communityId);
        populationHouseDO.setFloor(vo.getFloor());
        populationHouseDO.setUnitNo(vo.getUnitNo());
        populationHouseDO.setHouseNo(vo.getHouseNo());
        populationHouseDO.setCode(vo.getHouseNo());
        populationHouseDO.setAddress(address);
        populationHouseDO.setUpdateAt(new Date());
        populationHouseDO.setConstructPurpose(vo.getBuildPurpose());
@@ -1079,6 +1088,9 @@
        //查询统计人口数据
        ComMngPopulationTotalVO populationTotalVO = populationDAO.getPopulationTotalByAdmin(communityId);
        if(communityId.equals(2L)){
            populationTotalVO.setSpecialTotal(36);
        }
        statisticsVO.setPopulationTotalVO(populationTotalVO);
        return R.ok(statisticsVO);
@@ -1268,6 +1280,14 @@
        setAgeGroup(comActPopulationScreenVO, communityId);
        //统计学历
        setCultureGroup(comActPopulationScreenVO, communityId);
        //查询网格数据
        List<EventGridStatisticsVO> gridStatisticsList = this.baseMapper.getEventScreenGridData(communityId);
        comActPopulationScreenVO.setGridStatisticsList(gridStatisticsList);
        //查询小区列表
        List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(communityId);
        comActPopulationScreenVO.setVillageStatisticsList(villageStatisticsList);
        return R.ok(comActPopulationScreenVO);
    }
@@ -1485,5 +1505,54 @@
        return R.ok();
    }
    @Override
    public R getGridPopulationAdminList(ComMngPopulationListDTO populationListDTO){
        IPage<ComMngPopulationListVO> populationListIPage = this.baseMapper.getGridPopulationAdminList(new Page(populationListDTO.getPageNum(),populationListDTO.getPageSize()),populationListDTO);
        if(!populationListIPage.getRecords().isEmpty()){
            populationListIPage.getRecords().forEach(population -> {
                try {
                    Integer age = IdcardUtil.getAgeByIdCard(population.getCardNo());
                    population.setAge(age);
                }catch (Exception e){
                    log.error("当前人口身份证获取年龄失败,实有人口id:" + population.getId());
                }
                //查询此用户在当前房屋是否是户主
                Integer relation = this.baseMapper.getPopulationRelationByHouseId(population.getHouseId(),population.getId());
                if(relation == null || relation != 1){
                    population.setIsRelation(2);
                }else{
                    population.setIsRelation(1);
                }
            });
        }
        return R.ok(populationListIPage);
    }
    @Override
    public R delGridPopulationAdmin(List<Long> ids){
        Integer count = this.baseMapper.getPopulationVisitingCount(ids);
        if(count > 0){
            return R.ok("您选择的数据中存在被引用的,无法删除");
        }
        this.baseMapper.deleteBatchIds(ids);
        return R.ok();
    }
    @Override
    public R getBuildingHousePopulationList(PageComMngPopulationDTO populationDTO){
        IPage<EventSpecialPopulationVO> populationVOIPage = this.baseMapper.getBuildingHousePopulationList(new Page(populationDTO.getPageNum(),populationDTO.getPageSize()),populationDTO);
        if(!populationVOIPage.getRecords().isEmpty()){
            populationVOIPage.getRecords().forEach(population -> {
                try {
                    Integer age = IdcardUtil.getAgeByIdCard(population.getIdCard());
                    population.setAge(age);
                }catch (Exception e){
                    log.error("人员身份证转换年龄失败,人员id:" + population.getId());
                }
            });
        }
        return R.ok(populationVOIPage);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
@@ -8,9 +8,14 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO;
import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO;
import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO;
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO;
import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComActDAO;
@@ -238,4 +243,37 @@
    public R getVillage(Long villageId){
        return R.ok(this.baseMapper.getVillageById(villageId));
    }
    /**
     * 综治app-小区列表
     * @param villageListAppDTO 请求参数
     * @return  小区列表
     */
    @Override
    public R getGridVillageList(ComMngVillageListAppDTO villageListAppDTO){
        return R.ok(this.baseMapper.getGridVillageList(new Page(villageListAppDTO.getPageNum(),villageListAppDTO.getPageSize()),villageListAppDTO));
    }
    /**
     * 综治app-根据小区id查询小区下楼栋列表
     * @param villageId 小区id
     * @return  楼栋列表
     */
    @Override
    public R getGridVillageBuildingList(Long villageId){
        List<ComMngVillageBuildingVO> villageBuildingList = this.baseMapper.getGridVillageBuildingList(villageId);
        if(!villageBuildingList.isEmpty()){
            villageBuildingList.forEach(villageBuilding -> {
                if(!villageBuilding.getFloor().contains("栋")){
                    villageBuilding.setFloorString(villageBuilding.getFloor() + "栋");
                }
                if(!villageBuilding.getUnitNo().contains("单元")){
                    villageBuilding.setUnitNoString(villageBuilding.getUnitNo() + "单元");
                }
            });
        }
        return R.ok(villageBuildingList);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
@@ -313,10 +313,10 @@
            DateTime endDay = DateUtil.endOfMonth(date);
            int m = DateUtil.month(endDay);
//            if(m == 0){
//                m = 12;
//            }
//            m--;
            m++;
            if(m == 12){
                m = 0;
            }
            int day = DateUtil.dayOfMonth(endDay);
            int half = day/2;
            String month = DateUtil.format(date,moth_format_str);
@@ -334,6 +334,5 @@
        return dateList;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/EventVisitingTasksApi.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.model.dtos.IdDTO;
import com.panzhihua.common.model.dtos.grid.EventVisitingTasksEditDTO;
import com.panzhihua.common.model.dtos.grid.LcEventVisitingTasksListDTO;
import com.panzhihua.common.model.dtos.grid.PageEventVisitingTasksDTO;
@@ -19,116 +20,107 @@
import java.util.List;
/**
 *
 * @author cedoo email:cedoo(a)qq.com
 * @version 1.0
 * @date 2021-05-26
 * @since 1.0
 */
 * @date 2021-05-26
 * */
@Slf4j
@RestController
@RequestMapping("/eventvisitingtasks")
public class EventVisitingTasksApi {
public class EventVisitingTasksApi{
    @Resource
    private EventVisitingTasksService eventVisitingTasksService;
    /**
     * 统计走访任务
     *
     * @param communityId
     * @return
     */
    @GetMapping("/count")
    R count(@RequestParam("communityId") Long communityId) {
    R count(@RequestParam("communityId") Long communityId){
        return eventVisitingTasksService.count(communityId);
    }
    /**
     * 修改重点人群走访记录
     *
     * @param eventVisitingTasksEditDTO
     * @return 维护结果
     */
    @PostMapping("/edit")
    R edit(@RequestBody EventVisitingTasksEditDTO eventVisitingTasksEditDTO) {
    R edit(@RequestBody EventVisitingTasksEditDTO eventVisitingTasksEditDTO){
        return eventVisitingTasksService.edit(eventVisitingTasksEditDTO);
    }
    /**
     * 分页查找重点人群走访记录
     *
     * @param pageEventVisitingTasksDTO
     * @return 维护结果
     */
    @PostMapping("/page")
    R<IPage<EventVisitingTasksVO>> query(@RequestBody PageEventVisitingTasksDTO pageEventVisitingTasksDTO) {
    R<IPage<EventVisitingTasksVO>> query(@RequestBody PageEventVisitingTasksDTO pageEventVisitingTasksDTO){
        return eventVisitingTasksService.query(pageEventVisitingTasksDTO);
    }
    /**
     * 查询重点人群走访记录详细信息
     *
     * @param id 重点人群走访记录 id
     * @return 查找结果
     */
    @PostMapping("/{id}")
    R<EventVisitingTasksDetailsVO> eventVisitingTasksDetails(@PathVariable("id") Long id) {
    R<EventVisitingTasksDetailsVO> eventVisitingTasksDetails(@PathVariable("id") Long id){
        return eventVisitingTasksService.eventVisitingTasksDetails(id);
    }
    /**
     * 删除走访任务
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @return
     */
    @PostMapping("/delete")
    R delete(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId) {
        return eventVisitingTasksService.delete(ids, communityId);
    R delete(@RequestBody IdDTO idDTO, @RequestParam("communityId") Long communityId){
        return eventVisitingTasksService.delete(idDTO,communityId);
    }
    /**
     * 需走访人员列表
     *
     * @param query
     * @return
     */
    @PostMapping("/visitorList")
    R visitorList(@RequestBody EventVisitListQuery query) {
    R visitorList(@RequestBody EventVisitListQuery query){
        return eventVisitingTasksService.visitorList(query);
    }
    /**
     * 新增走访任务
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @param userId
     * @return
     */
    @PostMapping("/add")
    R add(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId, @RequestParam("userId") Long userId) throws Exception {
        return eventVisitingTasksService.add(ids, communityId, userId);
    R add(@RequestBody IdDTO idDTO, @RequestParam("communityId") Long communityId, @RequestParam("userId") Long userId) throws Exception {
        return eventVisitingTasksService.add(idDTO,communityId,userId);
    }
    /**
     * 走访记录
     *
     * @param query
     * @return
     */
    @PostMapping("/list")
    R list(@RequestBody EventTasksQuery query) {
    R list(@RequestBody EventTasksQuery query){
        return eventVisitingTasksService.list(query);
    }
    /**
     * 走访任务列表
     *
     * @param query
     * @return
     */
@@ -140,7 +132,6 @@
    /**
     * app走访任务列表
     *
     * @param query
     * @return
     * @throws Exception
@@ -153,7 +144,6 @@
    /**
     * 导出
     *
     * @param query
     * @return
     */
@@ -164,7 +154,6 @@
    /**
     * app走访详情
     *
     * @param id
     * @return
     */
@@ -175,45 +164,41 @@
    /**
     * 撤销走访
     *
     * @param id
     * @param idDTO
     * @return
     */
    @PostMapping("/cancel/{id}")
    R cancel(@PathVariable("id") Long id) {
        return eventVisitingTasksService.cancel(id);
    @PostMapping("/cancel")
    R cancel(@RequestBody IdDTO idDTO){
        return eventVisitingTasksService.cancel(idDTO);
    }
    /**
     * 恢复
     *
     * @param id
     * @param idDTO
     * @return
     */
    @PostMapping("/reset/{id}")
    R reset(@PathVariable("id") Long id) {
        return eventVisitingTasksService.reset(id);
    @PostMapping("/reset")
    R reset(@RequestBody IdDTO idDTO){
        return eventVisitingTasksService.reset(idDTO);
    }
    /**
     * 开始走访
     *
     * @param id
     * @return
     */
    @PostMapping("/start")
    R start(@RequestParam("id") Long id, @RequestParam("userId") Long userId) {
        return eventVisitingTasksService.start(id, userId);
    R start(@RequestParam("id")Long id,@RequestParam("userId")Long userId){
        return eventVisitingTasksService.start(id,userId);
    }
    /**
     * 完成走访记录
     *
     * @param taskCompleteDTO
     * @return
     */
    @PostMapping("/complete")
    R complete(@RequestBody EventVisitCompleteDTO taskCompleteDTO) {
    R complete(@RequestBody EventVisitCompleteDTO taskCompleteDTO){
        return eventVisitingTasksService.complete(taskCompleteDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventVisitingTasksService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.IdDTO;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.query.visit.EventTasksQuery;
import com.panzhihua.common.model.query.visit.EventVisitListQuery;
@@ -90,11 +91,11 @@
    /**
     * 删除走访任务
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @return
     */
    R delete(String ids, Long communityId);
    R delete(IdDTO idDTO, Long communityId);
    /**
     * 需走访人员列表
@@ -123,30 +124,30 @@
    /**
     * 新增
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @param userId
     * @return
     */
    R add(String ids, Long communityId, Long userId) throws Exception;
    R add(IdDTO idDTO, Long communityId, Long userId) throws Exception;
    List<EventVisitingTasksVO> exportTaskList(EventTasksQuery query) throws Exception;
    /**
     * 撤销
     *
     * @param id
     * @param idDTO
     * @return
     */
    R cancel(Long id);
    R cancel(IdDTO idDTO);
    /**
     * 恢复
     *
     * @param id
     * @param idDTO
     * @return
     */
    R reset(Long id);
    R reset(IdDTO idDTO);
    /**
     * 开始
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -68,7 +68,7 @@
    private final String moth_format_str = "yyyy-MM";
    private final String[] monthStr = new String[]{"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"};
    private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"};
    /**
     * 分页查找事件
@@ -250,22 +250,22 @@
            eventDetailsVO.setTrans(eventTransferRecordVOS);
            //查询网格员头像,姓名
            Map<String, Object> gridMember = eventMapper.getUserBaseInfo(eventDO.getGridMemberId());
            Map<String,Object> gridMember = eventMapper.getUserBaseInfo(eventDO.getGridMemberId());
            if (!CollectionUtils.isEmpty(gridMember)) {
                eventDetailsVO.setGridMemberName(gridMember.get("name") == null ? "" : gridMember.get("name").toString());
                eventDetailsVO.setGridMemberImageUrl(gridMember.get("image_url") == null ? "" : gridMember.get("image_url").toString());
            }
            if (Objects.equals(eventDO.getGridMemberId(), eventDO.getCreateBy())) {
            if(Objects.equals(eventDO.getGridMemberId(),eventDO.getCreateBy())){
                eventDetailsVO.setCreator(eventDetailsVO.getGridMemberName());
            } else {
                Map<String, Object> createUser = eventMapper.getUserBaseInfo(eventDO.getCreateBy());
            }else{
                Map<String,Object> createUser = eventMapper.getUserBaseInfo(eventDO.getCreateBy());
                eventDetailsVO.setCreator(createUser.get("name") == null ? "" : createUser.get("name").toString());
            }
            //当事件为特殊人群上报时,需要查询事件与人口关联关系
            if (eventDetailsVO.getEventType().equals(6)) {
            if(eventDetailsVO.getEventType().equals(6)){
                List<EventSpecialPopulationDetailsVO> specialPopulationList = eventSpecialCrowdRecordMapper.getSpecialPopulationIds(eventDetailsVO.getId());
                if (!specialPopulationList.isEmpty()) {
                if(!specialPopulationList.isEmpty()){
                    specialPopulationList.forEach(special -> {
                        special.setAge(IdcardUtil.getAgeByIdCard(special.getIdCard()));
                    });
@@ -294,8 +294,8 @@
        }
        //检查特殊人群上报时参数
        if (commonEventAddDTO.getEventType().equals(6)) {
            if (commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0) {
        if(commonEventAddDTO.getEventType().equals(6)){
            if(commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0){
                return R.fail("上报人员为空");
            }
        }
@@ -313,7 +313,7 @@
        if (eventMapper.insert(eventDO) == 1) {
            //如果是特殊人群,则新增特殊人群与事件关系
            if (commonEventAddDTO.getEventType().equals(6)) {
            if(commonEventAddDTO.getEventType().equals(6)){
                List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
                commonEventAddDTO.getPopulationIds().forEach(populationId -> {
                    EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO();
@@ -335,7 +335,7 @@
                eventResourceDO.setRefId(eventDO.getId());
                eventResourceDO.setCreateBy(commonEventAddDTO.getUserId());
                eventResourceDO.setResourceTime(commonEventAddDTO.getAudioTime());
                eventResourceDO.setResourceName(commonEventAddDTO.getAudio().substring(commonEventAddDTO.getAudio().lastIndexOf("/") + 1));
                eventResourceDO.setResourceName(commonEventAddDTO.getAudio().substring(commonEventAddDTO.getAudio().lastIndexOf("/")+1));
                int audioAdd = eventResourceService.getBaseMapper().insert(eventResourceDO);
                if (audioAdd != 1) {
                    throw new ServiceException("添加音频失败");
@@ -350,7 +350,7 @@
                eventResourceDO.setRefId(eventDO.getId());
                eventResourceDO.setCreateBy(commonEventAddDTO.getUserId());
                eventResourceDO.setResourceTime(commonEventAddDTO.getVideoTime());
                eventResourceDO.setResourceName(commonEventAddDTO.getVideo().substring(commonEventAddDTO.getVideo().lastIndexOf("/") + 1));
                eventResourceDO.setResourceName(commonEventAddDTO.getVideo().substring(commonEventAddDTO.getVideo().lastIndexOf("/")+1));
                int videoAdd = eventResourceService.getBaseMapper().insert(eventResourceDO);
                if (videoAdd != 1) {
                    throw new ServiceException("添加视频失败");
@@ -366,7 +366,7 @@
                    eventResourceDO.setUrl(pica[i]);
                    eventResourceDO.setRefId(eventDO.getId());
                    eventResourceDO.setCreateBy(commonEventAddDTO.getUserId());
                    eventResourceDO.setResourceName(pica[i].substring(pica[i].lastIndexOf("/") + 1));
                    eventResourceDO.setResourceName(pica[i].substring(pica[i].lastIndexOf("/")+1));
                    int picAdd = eventResourceService.getBaseMapper().insert(eventResourceDO);
                    if (picAdd != 1) {
                        throw new ServiceException("添加图片失败");
@@ -389,8 +389,8 @@
        if (commonEventEditDTO.getId() == null) {
            //检查特殊人群上报时参数
            if (commonEventEditDTO.getEventType().equals(6)) {
                if (commonEventEditDTO.getPopulationIds().isEmpty()) {
            if(commonEventEditDTO.getEventType().equals(6)){
                if(commonEventEditDTO.getPopulationIds().isEmpty()){
                    return R.fail("上报人员为空");
                }
            }
@@ -410,7 +410,7 @@
            if (eventMapper.insert(eventDO) > 0) {
                //如果是特殊人群,则新增特殊人群与事件关系
                if (commonEventEditDTO.getEventType().equals(6)) {
                if(commonEventEditDTO.getEventType().equals(6)){
                    List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
                    commonEventEditDTO.getPopulationIds().forEach(populationId -> {
                        EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO();
@@ -614,9 +614,9 @@
        if (eventDO == null) {
            return R.fail("事件不存在");
        }
        boolean canDealByUser = (eventDO.getEventStatus() == 2 || eventDO.getEventStatus() == 4) && eventDO.getEventProcessStatus() == 1;
        boolean canDealByUser = (eventDO.getEventStatus() == 2||eventDO.getEventStatus()==4) && eventDO.getEventProcessStatus() == 1;
        if (!canDealByUser) {
            if (eventDO.getEventStatus() != 2) {
            if (eventDO.getEventStatus() != 2 ) {
                return R.fail("事件不是发布/待处理状态");
            }
            if (eventDO.getEventProcessStatus() != 1) {
@@ -734,7 +734,7 @@
    public R republishEvent(CommonEventRepublishDTO commonEventRepublishDTO) {
        EventDO eventDO = this.getBaseMapper().selectById(commonEventRepublishDTO.getId());
        //boolean canRepublishByUser = eventDO.getEventStatus() == 4 || eventDO.getEventStatus() == 1;
        boolean canRepublishByUser = eventDO.getEventDealStatus() == 7 | eventDO.getEventDealStatus() == 5; //已失效状态
        boolean canRepublishByUser = eventDO.getEventDealStatus() == 7|eventDO.getEventDealStatus() == 5; //已失效状态
        if (!canRepublishByUser) {
            return R.fail("当前不是撤销/草稿状态");
        }
@@ -1024,9 +1024,9 @@
        eventDO.setEventCategory(2l);//宣传事件
        eventDO.setEventStatus(2);//事件状态 2发布
        eventDO.setEventType(8);
        if (publicityEventAddDTO.getGridMemberId() != null) {
        if(publicityEventAddDTO.getGridMemberId()!=null) {
            eventDO.setGridMemberId(publicityEventAddDTO.getGridMemberId());
        } else {
        }else{
            eventDO.setGridMemberId(publicityEventAddDTO.getUserId());
        }
        eventDO.setGridMemberName(publicityEventAddDTO.getUserName());
@@ -1380,7 +1380,7 @@
        if (eventDO == null) {
            return R.fail("事件不存在");
        }
        boolean canRepulish = eventDO.getEventDealStatus() == 7 | eventDO.getEventDealStatus() == 5; //已失效状态
        boolean canRepulish = eventDO.getEventDealStatus() == 7|eventDO.getEventDealStatus() == 5; //已失效状态
        if (!canRepulish) {
            return R.fail("当前事件不是已失效状态/草稿状态,不能重新发布");
        }
@@ -1735,7 +1735,10 @@
    public R getNearByGrid(PageEventGridNearbyDTO pageEventGridNearbyDTO) {
        Page page = new Page(pageEventGridNearbyDTO.getPageNum(), pageEventGridNearbyDTO.getPageSize());
        String latLng = pageEventGridNearbyDTO.getHappentLatLng();
        if (!latLng.matches("^[\\-\\+]?(0(\\.\\d{1,10})?|([1-9](\\d)?)(\\.\\d{1,10})?|1[0-7]\\d{1}(\\.\\d{1,10})?|180\\.0{1,10}),[\\-\\+]?((0|([1-8]\\d?))(\\.\\d{1,10})?|90(\\.0{1,10})?)$")) {
//        if(!latLng.matches("^[\\-\\+]?(0(\\.\\d{1,10})?|([1-9](\\d)?)(\\.\\d{1,10})?|1[0-7]\\d{1}(\\.\\d{1,10})?|180\\.0{1,10}),[\\-\\+]?((0|([1-8]\\d?))(\\.\\d{1,10})?|90(\\.0{1,10})?)$")){
//            return R.fail("经纬度参数错误");
//        }
        if(!latLng.matches("[1-9][0-9](\\.[0-9]{1,6})?,[1-9][0-9]{2}(\\.[0-9]{1,6})?")){
            return R.fail("经纬度参数错误");
        }
        String latLngArr[] = latLng.split(",");
@@ -1748,7 +1751,7 @@
                List<EventGridDataVO> rtEventGridList = new ArrayList<>();
                for (EventGridDataAreaVO eventGridDataDO : gridList) {
                    String data = eventGridDataDO.getData();
                    if (data != null) {
                    if(data!=null) {
                        List<LatLngVO> latLngList = LngLatUtils.getLatLngFromText(data);
                        boolean inGrid = LngLatUtils.isInPolygon(latLngList, lng, lat);
                        if (inGrid) {
@@ -1762,7 +1765,7 @@
            } else {
                return R.ok("未找到社区");
            }
        } catch (Exception e) {
        }catch (Exception e){
            return R.fail(e.getMessage());
        }
    }
@@ -1790,7 +1793,7 @@
                            throw new ServiceException("删除事件失败");
                        }
                    }
                } catch (Exception e) {
                }catch (Exception e){
                    throw new ServiceException("事件ID错误,删除失败");
                }
            }
@@ -1812,7 +1815,7 @@
                Long eventId = -1L;
                try {
                    eventId = Long.parseLong(id);
                } catch (Exception e) {
                }catch (Exception e){
                    throw new ServiceException("事件ID错误,发布失败");
                }
                EventDO eventDO = this.getBaseMapper().selectById(eventId);
@@ -1833,7 +1836,7 @@
                    throw new ServiceException("更新事件状态失败");
                }
                addTransferRecord(eventDO.getId(), userId, userName, 1,
                        "重新发布已撤销事件", userId, userName, 8);
                            "重新发布已撤销事件", userId, userName, 8);
            }
            return R.ok();
        } else {
@@ -1854,7 +1857,7 @@
                Long eventId = -1L;
                try {
                    eventId = Long.parseLong(id);
                } catch (Exception e) {
                }catch (Exception e){
                    throw new ServiceException("事件ID错误,不能标记失效");
                }
                EventDO eventDO = this.getBaseMapper().selectById(eventId);
@@ -1899,38 +1902,36 @@
    /**
     * 根据网格id查询网格统计数据
     *
     * @param gridId 网格id
     * @return 网格统计数据
     * @param gridId    网格id
     * @return  网格统计数据
     */
    @Override
    public R getGridEventStatisticsByApp(Long gridId) {
    public R getGridEventStatisticsByApp(Long gridId){
        return R.ok(this.baseMapper.getGridEventStatisticsByApp(gridId));
    }
    /**
     * 查询网格事件统计数据
     *
     * @param statisticsDTO 请求参数
     * @return 网格事件统计数据
     * @return  网格事件统计数据
     */
    @Override
    public R getGridEventDetailStatisticsByApp(GridEventStatisticsDTO statisticsDTO) {
    public R getGridEventDetailStatisticsByApp(GridEventStatisticsDTO statisticsDTO){
        GridEventStatisticsDetailVO statisticsDetailVO = this.baseMapper.getGridEventDetailStatisticsByApp(statisticsDTO);
        if (statisticsDetailVO == null) {
        if(statisticsDetailVO == null){
            statisticsDetailVO = new GridEventStatisticsDetailVO();
        }
        if (statisticsDetailVO.getEventSSPTotal() == null) {
        if(statisticsDetailVO.getEventSSPTotal() == null){
            statisticsDetailVO.setEventSSPTotal(0);
        }
        if (statisticsDetailVO.getNoEventSSPTotal() == null) {
        if(statisticsDetailVO.getNoEventSSPTotal() == null){
            statisticsDetailVO.setNoEventSSPTotal(0);
        }
        if (statisticsDetailVO.getEventZFTotal() == null) {
        if(statisticsDetailVO.getEventZFTotal() == null){
            statisticsDetailVO.setEventZFTotal(0);
        }
        if (statisticsDetailVO.getNoEventZFTotal() == null) {
        if(statisticsDetailVO.getNoEventZFTotal() == null){
            statisticsDetailVO.setNoEventZFTotal(0);
        }
@@ -1951,7 +1952,7 @@
    @Transactional(rollbackFor = Exception.class)
    public R reportDirect(CommonEventDirectReportDTO commonEventDirectReportDTO) {
        if (commonEventDirectReportDTO.getEventId() != null) {
        if(commonEventDirectReportDTO.getEventId()!=null){
            //编辑原来的
            EventDO eventDO = eventMapper.selectById(commonEventDirectReportDTO.getEventId());
            if (eventDO.getEventStatus() != null && eventDO.getEventStatus() != 1 && eventDO.getEventDealStatus() != 6) {
@@ -2038,7 +2039,7 @@
                return R.ok();
            }
        } else {
        }else{
            EventDO eventDO = new EventDO();
            BeanUtils.copyProperties(commonEventDirectReportDTO, eventDO);
            eventDO.setGridMemberId(commonEventDirectReportDTO.getUserId());
@@ -2133,22 +2134,21 @@
    /**
     * 事件大屏查询事件列表
     *
     * @param eventListDTO 请求参数
     * @return 事件列表
     * @param eventListDTO  请求参数
     * @return  事件列表
     */
    @Override
    public R getScreenEventList(ScreenEventListDTO eventListDTO) {
        if (eventListDTO.getEventTypes() != null && !eventListDTO.getEventTypes().isEmpty()) {
            eventListDTO.getEventTypes().forEach(eventType -> {
                if (eventType.equals(ScreenEventListDTO.eventType.xc)) {
                if(eventType.equals(ScreenEventListDTO.eventType.xc)){
                    eventListDTO.setEventCategory(null);
                }
            });
        }
        IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(), eventListDTO.getPageSize()), eventListDTO);
        if (!eventPageList.getRecords().isEmpty()) {
        if(!eventPageList.getRecords().isEmpty()){
            eventPageList.getRecords().forEach(event -> {
                //查询事件关联附件
                List<EventResourceDO> eventResourceDOList =
@@ -2188,24 +2188,23 @@
    /**
     * 特殊人群上报-社区人口数据列表
     *
     * @param specialPopulationDTO 请求参数
     * @return 社区人口数据列表
     * @param specialPopulationDTO   请求参数
     * @return  社区人口数据列表
     */
    @Override
    public R specialPopulationList(PageEventSpecialPopulationDTO specialPopulationDTO) {
        IPage<EventSpecialPopulationVO> specialPopulationVOIPage = this.baseMapper.specialPopulationList(new Page(specialPopulationDTO.getPageNum(), specialPopulationDTO.getPageSize()), specialPopulationDTO);
        if (!specialPopulationVOIPage.getRecords().isEmpty()) {
        if(!specialPopulationVOIPage.getRecords().isEmpty()){
            specialPopulationVOIPage.getRecords().forEach(specialPopulation -> {
                specialPopulation.setAge(IdcardUtil.getAgeByIdCard(specialPopulation.getIdCard()));
            });
        }
        return R.ok(specialPopulationVOIPage);
    }
    @Override
    public List<EventDetailsVO> getUnUploadEvent() {
        List<EventDetailsVO> eventDetailsVOList = new ArrayList<>();
        List<EventDetailsVO> eventDetailsVOList =new ArrayList<>();
        List<EventDO> unEventList = baseMapper.selectList(
                new QueryWrapper<EventDO>()
                        .eq("upload", false)
@@ -2223,46 +2222,46 @@
        EventDO event = baseMapper.selectById(id);
        event.setUpload(true);
        baseMapper.updateById(event);
        EventResourceDO eventResourceDO = new EventResourceDO();
        EventResourceDO eventResourceDO =new EventResourceDO();
        eventResourceDO.setUpload(true);
        int flag = eventResourceMapper.update(eventResourceDO, new QueryWrapper<EventResourceDO>()
                .eq("ref_id", id));
        if (flag > 0) {
        if(flag>0){
            return true;
        }
        return false;
    }
    public R eventWork(Long communityId) {
    public R eventWork(Long communityId){
        EventWorkScreenVO workScreenVO = new EventWorkScreenVO();
        String date = DateUtils.getDateFormatString(new Date(), moth_format_str);
        Map<String, Long> countMap = this.eventMapper.countByCommunityId(communityId, date);
        if (!countMap.isEmpty()) {
            workScreenVO.setResolvedNum(countMap.get("resolvedNum") == null ? 0L : Long.valueOf(countMap.get("resolvedNum").toString()));
            workScreenVO.setPendingNum(countMap.get("pendingNum") == null ? 0L : Long.valueOf(countMap.get("pendingNum").toString()));
            workScreenVO.setPropagandaNum(countMap.get("propagandaNum") == null ? 0L : Long.valueOf(countMap.get("propagandaNum").toString()));
            workScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : Long.valueOf(countMap.get("currentNum").toString()));
        String date = DateUtils.getDateFormatString(new Date(),moth_format_str);
        Map<String,Long> countMap = this.eventMapper.countByCommunityId(communityId,date);
        if(!countMap.isEmpty()){
            workScreenVO.setResolvedNum(countMap.get("resolvedNum")== null ? 0L : Long.valueOf(countMap.get("resolvedNum").toString()));
            workScreenVO.setPendingNum(countMap.get("pendingNum")== null ? 0L : Long.valueOf(countMap.get("pendingNum").toString()));
            workScreenVO.setPropagandaNum(countMap.get("propagandaNum")== null ? 13L : Long.valueOf(countMap.get("propagandaNum").toString()));
            workScreenVO.setCurrentNum(countMap.get("currentNum")== null ? 0L : Long.valueOf(countMap.get("currentNum").toString()));
        }
        //计算处理时间消耗的时间
        DateScreenVO countAvg = this.eventMapper.countByAvgCommunityId(communityId);
        if (countAvg != null) {
            int second = (int) (countAvg.getStartTime().getTime() - countAvg.getEndTime().getTime()) / 1000;
            if (second > 0) {
                second = second / workScreenVO.getResolvedNum().intValue();
        if(countAvg != null){
            int second = (int) (countAvg.getEndTime().getTime() - countAvg.getStartTime().getTime())/1000;
            if(second > 0){
                second = second/workScreenVO.getResolvedNum().intValue();
                workScreenVO.setAvgCost(second);
            }
        }
        //查询最新事件轮播列表
        List<EventDetailWorkVO> eventList = this.eventMapper.getWorkScreenEventList(communityId);
        if (!eventList.isEmpty()) {
        if(!eventList.isEmpty()){
            workScreenVO.setEventList(eventList);
        }
        //统计近半年数据
        List<EventWorkVO> list = new ArrayList<>();
        for (EventWorkVO eventWorkVO : listHalfYearByDyn()) {
            EventWorkVO result = this.eventMapper.countByTime(eventWorkVO.getStart(), eventWorkVO.getEnd(), communityId);
        for(EventWorkVO eventWorkVO: listHalfYearByDyn()){
            EventWorkVO result = this.eventMapper.countByTime(eventWorkVO.getStart(),eventWorkVO.getEnd(),communityId);
            result.setMonth(eventWorkVO.getMonth());
            list.add(result);
        }
@@ -2270,12 +2269,12 @@
        //查询完成事件统计
        EventTypeWorkVO complete = this.eventMapper.getComplete(communityId);
        if (complete != null) {
        if(complete != null){
            workScreenVO.setComplete(complete);
        }
        //查询未完成事件统计
        EventTypeWorkVO noComplete = this.eventMapper.getNoComplete(communityId);
        if (complete != null) {
        if(complete != null){
            workScreenVO.setNoComplete(noComplete);
        }
        return R.ok(workScreenVO);
@@ -2283,28 +2282,28 @@
    private List<EventWorkVO> listHalfYearByDyn() {
        List<EventWorkVO> dateList = new ArrayList<>();
        Date now = new Date();
        for (int i = 6; i >= 1; i--) {
            Date date = DateUtils.getDateM(now, -i);
        Date now  = new Date();
        for(int i= 6;i>=1;i--){
            Date date = DateUtils.getDateM(now,-i);
            DateTime endDay = DateUtil.endOfMonth(date);
            int m = DateUtil.month(endDay);
//            if(m == 0){
//                m = 11;
//            }
//            m--;
            m++;
            if(m == 12){
                m = 0;
            }
            int day = DateUtil.dayOfMonth(endDay);
            int half = day / 2;
            String month = DateUtil.format(date, moth_format_str);
            int half = day/2;
            String month = DateUtil.format(date,moth_format_str);
            EventWorkVO eventWorkVO = new EventWorkVO();
            eventWorkVO.setMonth(monthStr[m] + "月上旬");
            eventWorkVO.setStart(month + "-01 00:00:00");
            eventWorkVO.setEnd(month + "-" + half + " 23:59:58");
            eventWorkVO.setMonth(monthStr[m]+"月上旬");
            eventWorkVO.setStart(month+ "-01 00:00:00");
            eventWorkVO.setEnd(month+ "-"+half+" 23:59:58");
            dateList.add(eventWorkVO);
            EventWorkVO eventWorkVO1 = new EventWorkVO();
            eventWorkVO1.setMonth(monthStr[m] + "月下旬");
            eventWorkVO1.setStart(month + "-" + half + " 23:59:58");
            eventWorkVO1.setEnd(DateUtils.getDateFormatString(endDay, "yyyy-MM-dd HH:mm:ss"));
            eventWorkVO1.setMonth(monthStr[m]+"月下旬");
            eventWorkVO1.setStart(month+ "-"+half+" 23:59:58");
            eventWorkVO1.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss"));
            dateList.add(eventWorkVO1);
        }
        return dateList;
@@ -2312,9 +2311,10 @@
    }
    public static void main(String[] args) {
        EventServiceImpl service = new EventServiceImpl();
        List<EventWorkVO> list = service.listHalfYearByDyn();
        System.out.println(list);
        String content = "30,104";
        String re = "[1-9][0-9](\\.[0-9]{1,6})?,[1-9][0-9]{2}(\\.[0-9]{1,6})?";
        System.out.println(content.matches(re));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventVisitingTasksServiceImpl.java
@@ -11,8 +11,10 @@
import com.panzhihua.common.enums.EventTasksStatusEnum;
import com.panzhihua.common.enums.PopulPoliticalOutlookEnum;
import com.panzhihua.common.model.dtos.EventResourceDTO;
import com.panzhihua.common.model.dtos.IdDTO;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.dtos.visit.EventVisitCompleteDTO;
import com.panzhihua.common.model.helper.AESUtil;
import com.panzhihua.common.model.query.visit.EventTasksQuery;
import com.panzhihua.common.model.query.visit.EventVisitListQuery;
import com.panzhihua.common.model.vos.R;
@@ -35,6 +37,10 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @auther lyq
@@ -63,11 +69,11 @@
     * @param eventVisitingTasksAddDTO
     * @return 新增结果
     */
    public R add(EventVisitingTasksAddDTO eventVisitingTasksAddDTO) {
    public R add(EventVisitingTasksAddDTO eventVisitingTasksAddDTO){
        EventVisitingTasksDO eventVisitingTasksDO = new EventVisitingTasksDO();
        BeanUtils.copyProperties(eventVisitingTasksAddDTO, eventVisitingTasksDO);
        eventVisitingTasksDO.setCreateAt(new Date());
        if (eventVisitingTasksMapper.insert(eventVisitingTasksDO) > 0) {
        if(eventVisitingTasksMapper.insert(eventVisitingTasksDO)>0){
            return R.ok();
        }
        return R.fail();
@@ -75,15 +81,14 @@
    /**
     * 修改重点人群走访记录
     *
     * @param eventVisitingTasksEditDTO
     * @return 维护结果
     */
    public R edit(EventVisitingTasksEditDTO eventVisitingTasksEditDTO) {
    public R edit(EventVisitingTasksEditDTO eventVisitingTasksEditDTO){
        EventVisitingTasksDO eventVisitingTasksDO = new EventVisitingTasksDO();
        BeanUtils.copyProperties(eventVisitingTasksEditDTO, eventVisitingTasksDO);
        //eventVisitingTasksDO.setUpdateAt(new Date());
        if (eventVisitingTasksMapper.updateById(eventVisitingTasksDO) > 0) {
        if(eventVisitingTasksMapper.updateById(eventVisitingTasksDO)>0){
            return R.ok();
        }
        return R.fail();
@@ -91,16 +96,15 @@
    /**
     * 分页查找重点人群走访记录
     *
     * @param pageEventVisitingTasksDTO
     * @return 维护结果
     */
    public R<IPage<EventVisitingTasksVO>> query(PageEventVisitingTasksDTO pageEventVisitingTasksDTO) {
        Page page = new Page(1, 10);
        if (pageEventVisitingTasksDTO.getPageNum() != null) {
    public R<IPage<EventVisitingTasksVO>> query(PageEventVisitingTasksDTO pageEventVisitingTasksDTO){
        Page page = new Page(1,10);
        if(pageEventVisitingTasksDTO.getPageNum()!=null) {
            page.setCurrent(pageEventVisitingTasksDTO.getPageNum());
        }
        if (pageEventVisitingTasksDTO.getPageSize() != null) {
        if(pageEventVisitingTasksDTO.getPageSize()!=null) {
            page.setSize(pageEventVisitingTasksDTO.getPageSize());
        }
        return R.ok();
@@ -112,7 +116,7 @@
     * @param EventVisitingTasksDeleteDTO
     * @return 平台用户信息
     */
    public R delete(EventVisitingTasksDeleteDTO EventVisitingTasksDeleteDTO) {
    public R delete(EventVisitingTasksDeleteDTO EventVisitingTasksDeleteDTO){
        return R.fail();
    }
@@ -122,14 +126,14 @@
     * @param id 重点人群走访记录 id
     * @return 查找结果
     */
    public R<EventVisitingTasksDetailsVO> eventVisitingTasksDetails(Long id) {
    public R<EventVisitingTasksDetailsVO> eventVisitingTasksDetails(Long id){
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id);
        if (eventVisitingTasksDO != null) {
        if(eventVisitingTasksDO!=null) {
            EventVisitingTasksDetailsVO eventVisitingTasksDetailsVO = new EventVisitingTasksDetailsVO();
            BeanUtils.copyProperties(eventVisitingTasksDO, eventVisitingTasksDetailsVO);
            eventVisitingTasksDetailsVO.setImgList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(), 2, 1));
            eventVisitingTasksDetailsVO.setVosList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(), 2, 2));
            eventVisitingTasksDetailsVO.setVideoList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(), 2, 3));
            eventVisitingTasksDetailsVO.setImgList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,1));
            eventVisitingTasksDetailsVO.setVosList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,2));
            eventVisitingTasksDetailsVO.setVideoList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,3));
            return R.ok(eventVisitingTasksDetailsVO);
        }
        return R.fail();
@@ -138,7 +142,7 @@
    @Override
    public R count(Long communityId) {
        Map<String, Long> countMap = eventVisitingTasksMapper.count(communityId);
        Map<String,Long> countMap = eventVisitingTasksMapper.count(communityId);
        EventVisitCountVO eventVisitCountVO = new EventVisitCountVO();
        eventVisitCountVO.setVisit(countMap.get("visit"));
        eventVisitCountVO.setVisited(countMap.get("visited"));
@@ -147,11 +151,11 @@
    }
    @Override
    public R taskList(EventTasksQuery query) throws Exception {
    public R taskList(EventTasksQuery query) throws Exception{
        IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.findListByPage(new Page(query.getPageNum(), query.getPageSize()), query);
        for (EventVisitingTasksVO eventVisitingTasksVO : page.getRecords()) {
            if (eventVisitingTasksVO.getNationCode() != null) {
        IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.findListByPage(new Page(query.getPageNum(),query.getPageSize()),query);
        for(EventVisitingTasksVO eventVisitingTasksVO:page.getRecords()){
            if(eventVisitingTasksVO.getNationCode() != null){
                eventVisitingTasksVO.setNation(PopulPoliticalOutlookEnum.getCnDescByName(eventVisitingTasksVO.getNationCode()));
            }
        }
@@ -159,11 +163,11 @@
    }
    @Override
    public R appTaskList(EventTasksQuery query) throws Exception {
    public R appTaskList(EventTasksQuery query) throws Exception{
        IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.appFindListByPage(new Page(query.getPageNum(), query.getPageSize()), query);
        for (EventVisitingTasksVO eventVisitingTasksVO : page.getRecords()) {
            if (eventVisitingTasksVO.getNationCode() != null) {
        IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.appFindListByPage(new Page(query.getPageNum(),query.getPageSize()),query);
        for(EventVisitingTasksVO eventVisitingTasksVO:page.getRecords()){
            if(eventVisitingTasksVO.getNationCode() != null){
                eventVisitingTasksVO.setNation(PopulPoliticalOutlookEnum.getCnDescByName(eventVisitingTasksVO.getNationCode()));
            }
        }
@@ -172,27 +176,42 @@
    @Transactional
    @Override
    public R delete(String ids, Long communityId) {
        String[] idarr = ids.split(",");
        for (String id : idarr) {
            if (StringUtils.isEmpty(id)) {
    public R delete(IdDTO idDTO, Long communityId) {
        StringBuilder rt = new StringBuilder();
        String[] idarr = idDTO.getId().split(",");
        for(String id:idarr){
            if(StringUtils.isEmpty(id)){
                continue;
            }
            EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectOne(new QueryWrapper<EventVisitingTasksDO>().eq("id", Long.valueOf(id)).eq("grid_member_community", communityId));
            if (eventVisitingTasksDO == null) {
                throw new RuntimeException("无权限");
            String error = toDelete(Long.valueOf(id));
            if(!StringUtils.isEmpty(error)){
                rt.append(rt);
            }
            eventVisitingTasksMapper.deleteById(Long.valueOf(id));
        }
        if(!StringUtils.isEmpty(rt)){
            return R.fail("部分删除失败:"+rt.toString());
        }
        return R.ok();
    }
    private String toDelete(Long id) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id);
        if(eventVisitingTasksDO == null){
            return "["+id+"]数据不存在;";
        }
        if(!Objects.equals(eventVisitingTasksDO.getEventStatus(),EventTasksStatusEnum.DZF.getCode())){
            return "["+eventVisitingTasksDO.getVisiterName()+"]状态不可删除;";
        }
        eventVisitingTasksMapper.deleteById(Long.valueOf(id));
        return null;
    }
    @Override
    public R visitorList(EventVisitListQuery query) {
        IPage<EventVisitListVO> page = eventVisitingTasksMapper.visitorList(new Page(query.getPageNum(), query.getPageSize()), query);
        page.getRecords().stream().forEach(e -> {
            List<EventVisitingTasksDO> list = eventVisitingTasksMapper.selectList(new QueryWrapper<EventVisitingTasksDO>().eq("visiter_id", e.getId()).orderByDesc("id"));
            if (!CollectionUtils.isEmpty(list)) {
        IPage<EventVisitListVO> page = eventVisitingTasksMapper.visitorList(new Page(query.getPageNum(),query.getPageSize()),query);
        page.getRecords().stream().forEach(e->{
            List<EventVisitingTasksDO> list = eventVisitingTasksMapper.selectList(new QueryWrapper<EventVisitingTasksDO>().eq("visiter_id",e.getId()).orderByDesc("id").last("limit 0,1"));
            if(!CollectionUtils.isEmpty(list)){
                e.setCreateAt(list.get(0).getCreateAt());
                e.setEventStatus(list.get(0).getEventStatus());
            }
@@ -202,17 +221,21 @@
    @Override
    public R list(EventTasksQuery query) {
        IPage<AppVisitTasksVO> page = eventVisitingTasksMapper.list(new Page(query.getPageNum(), query.getPageSize()), query);
        IPage<AppVisitTasksVO> page = eventVisitingTasksMapper.list(new Page(query.getPageNum(),query.getPageSize()),query);
        return R.ok(page);
    }
    @Override
    public R detail(Long id) throws Exception {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id);
        if (eventVisitingTasksDO != null) {
        if(eventVisitingTasksDO!=null) {
            EventVisitingTasksDetailsVO eventVisitingTasksDetailsVO = new EventVisitingTasksDetailsVO();
            BeanUtils.copyProperties(eventVisitingTasksDO, eventVisitingTasksDetailsVO);
            JSONObject jsonObject = JSONObject.parseObject(eventVisitingTasksDO.getTableContentJson());
            eventVisitingTasksDetailsVO.setTableContentJson(JSONObject.parseObject(eventVisitingTasksDO.getTableContentJson()));
            if(jsonObject != null && jsonObject.get("check") != null){
                eventVisitingTasksDetailsVO.setOption(jsonObject.get("check").toString());
            }
            return R.ok(eventVisitingTasksDetailsVO);
        }
        return R.fail();
@@ -220,38 +243,46 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public R add(String ids, Long communityId, Long userId) throws Exception {
        Map<String, Object> map = eventVisitingTasksMapper.findUserByCommunityId(communityId, 6);
        if (CollectionUtils.isEmpty(map)) {
            return R.fail("网格员不存在");
        }
        String[] id = ids.split(",");
        for (String idstr : id) {
            if (StringUtils.isEmpty(idstr)) {
    public R add(IdDTO idDTO, Long communityId, Long userId) throws Exception {
//        Map<String,Object> map = eventVisitingTasksMapper.findUserByCommunityId(communityId,6);
//        if(CollectionUtils.isEmpty(map)){
//            return R.fail("网格员不存在");
//        }
        StringBuilder rt = new StringBuilder();
        String[] id = idDTO.getId().split(",");
        for(String idstr:id){
            if(StringUtils.isEmpty(idstr)){
                continue;
            }
            addVisitingTask(Long.valueOf(idstr), map, communityId, userId);
            String error = addVisitingTask(Long.valueOf(idstr),communityId,userId);
            if(!StringUtils.isEmpty(error)){
                rt.append(error);
            }
        }
        if(!StringUtils.isEmpty(rt)){
            return R.fail("部分新增失败"+rt.toString());
        }
        return R.ok();
    }
    @Override
    public List<EventVisitingTasksVO> exportTaskList(EventTasksQuery query) throws Exception {
        IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.findListByPage(new Page(query.getPageNum(), query.getPageSize()), query);
        IPage<EventVisitingTasksVO> page = eventVisitingTasksMapper.findListByPage(new Page(query.getPageNum(),query.getPageSize()),query);
        return page.getRecords();
    }
    private String addVisitingTask(Long id, Long communityId,Long userId) throws Exception{
    private void addVisitingTask(Long id, Map<String, Object> gridMap, Long communityId, Long userId) throws Exception {
        Map<String,Object> map = eventVisitingTasksMapper.findPopulationById(id);
        if(CollectionUtils.isEmpty(map)){
            return "被访问人ID["+id+"]不存在;";
        }
        Integer count = eventVisitingTasksMapper.countNoneComplete(id);
        if (count > 0) {
            return;
        }
        Map<String, Object> map = eventVisitingTasksMapper.findPopulationById(id);
        if (CollectionUtils.isEmpty(map)) {
            return;
        if(count > 0){
            return "被访问人["+map.get("name")+"]只能同时存在一条待走访任务;";
        }
        EventVisitingTasksDO visitingTasksDO = new EventVisitingTasksDO();
//        visitingTasksDO.setGridMemberStreet(Long.valueOf(gridMap.get("street_id").toString()));
@@ -262,14 +293,14 @@
        visitingTasksDO.setVisiterId(Long.valueOf(map.get("id").toString()));
        visitingTasksDO.setVisiterName(map.get("name").toString());
        visitingTasksDO.setVisiterSex(Integer.valueOf(map.get("sex").toString()));
        visitingTasksDO.setVisiterTele(map.get("phone") == null ? null : map.get("phone").toString());
        visitingTasksDO.setVisiterTele(map.get("phone") == null ?null:map.get("phone").toString());
        StringBuilder sb = new StringBuilder();
        sb.append(map.get("address")).append(map.get("road")).append(map.get("door_no")).append(map.get("floor")).append("栋").append(map.get("unit_no")).append("单元").append(map.get("house_no")).append("号");
        visitingTasksDO.setVisiterAddress(sb.toString());
        visitingTasksDO.setVisiterType(0);
        visitingTasksDO.setActOpara(0);
        if (map.get("lat") != null && map.get("lng") != null) {
            visitingTasksDO.setHappentLatLng(map.get("lat") + "," + map.get("lng"));
        if(map.get("lat") != null && map.get("lng") != null){
            visitingTasksDO.setHappentLatLng(map.get("lat")+","+map.get("lng"));
        }
        visitingTasksDO.setEventStatus(EventTasksStatusEnum.DZF.getCode());
        visitingTasksDO.setReporting(0);
@@ -277,23 +308,24 @@
        visitingTasksDO.setUrgent(false);
        visitingTasksDO.setUrgentDell(false);
        visitingTasksDO.setCreateBy(userId);
        visitingTasksDO.setOutOrLocal(map.get("out_or_local") == null ? null : Integer.valueOf(map.get("out_or_local").toString()));
        visitingTasksDO.setOutOrLocal(map.get("out_or_local") == null?null:Integer.valueOf(map.get("out_or_local").toString()));
        if (map.get("label") != null) {
        if(map.get("label") != null){
            List<String> option = getOption(map.get("label").toString());
            if (!CollectionUtils.isEmpty(option)) {
            if(!CollectionUtils.isEmpty(option)){
                JSONObject json = new JSONObject();
                json.put("option", option);
                json.put("option",option);
                visitingTasksDO.setTableContentJson(json.toJSONString());
            }
        }
        eventVisitingTasksMapper.insert(visitingTasksDO);
        return null;
    }
    private List<String> getOption(String label) {
        List<String> option = new ArrayList<>();
        if (!Objects.isNull(label)) {
        if(!Objects.isNull(label)) {
            if (label.contains("精神障碍")) {
                option.add("精神障碍异常1");
                option.add("精神障碍异常2");
@@ -322,14 +354,14 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public R cancel(Long id) {
    public R cancel(IdDTO idDTO) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id);
        if (eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(Long.valueOf(idDTO.getId()));
        if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()){
            return R.fail("当前状态不可撤销");
        }
        int rt = eventVisitingTasksMapper.cancel(id, EventTasksStatusEnum.YCX.getCode());
        if (rt > 0) {
        int rt = eventVisitingTasksMapper.cancel(eventVisitingTasksDO.getId(),EventTasksStatusEnum.YCX.getCode());
        if(rt > 0){
            return R.ok();
        }
        return R.fail();
@@ -337,14 +369,14 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public R reset(Long id) {
    public R reset(IdDTO idDTO) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id);
        if (eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.YCX.getCode()) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(Long.valueOf(idDTO.getId()));
        if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.YCX.getCode()){
            return R.fail("当前状态不可恢复");
        }
        int rt = eventVisitingTasksMapper.updateEventStatus(id, EventTasksStatusEnum.DZF.getCode());
        if (rt > 0) {
        int rt = eventVisitingTasksMapper.updateEventStatus(eventVisitingTasksDO.getId(),EventTasksStatusEnum.DZF.getCode());
        if(rt > 0){
            return R.ok();
        }
        return R.fail();
@@ -352,22 +384,22 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public synchronized R start(Long id, Long userId) {
    public synchronized R start(Long id,Long userId) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id);
        if (eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()) {
        if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()){
            return R.fail("当前状态不可开始走访");
        }
        Map<String, Object> map = eventVisitingTasksMapper.findUserById(userId);
        Map<String,Object> map = eventVisitingTasksMapper.findUserById(userId);
        EventVisitingTasksDO start = new EventVisitingTasksDO();
        start.setId(id);
        start.setGridMemberStreet(Long.valueOf(map.get("street_id").toString()));
        start.setGridMemberCommunity(Long.valueOf(map.get("community_id").toString()));
        start.setGridMember(Long.valueOf(map.get("user_id").toString()));
        start.setGridMemberName(map.get("name").toString());
        start.setGridMenberTele(map.get("phone") == null ? "" : map.get("phone").toString());
        start.setGridMenberTele(map.get("phone") ==null?"":map.get("phone").toString());
        start.setEventStatus(EventTasksStatusEnum.JXZ.getCode());
        int rt = eventVisitingTasksMapper.start(start);
        if (rt > 0) {
        if(rt > 0){
            return R.ok();
        }
        return R.fail();
@@ -377,46 +409,46 @@
    @Override
    public R complete(EventVisitCompleteDTO taskCompleteDTO) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(taskCompleteDTO.getId());
        if (eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()) {
        if(eventVisitingTasksDO == null || eventVisitingTasksDO.getEventStatus() != EventTasksStatusEnum.DZF.getCode()){
            return R.fail("当前状态不可完成走访");
        }
        EventVisitingTasksDO complete = new EventVisitingTasksDO();
        BeanUtils.copyProperties(taskCompleteDTO, complete);
        if (taskCompleteDTO.getException().intValue() == 0) {
        BeanUtils.copyProperties(taskCompleteDTO,complete);
        if(taskCompleteDTO.getException().intValue() == 0){
            complete.setEventStatus(EventTasksStatusEnum.ZJJJ.getCode());
        } else {
        }else{
            complete.setEventStatus(EventTasksStatusEnum.YC.getCode());
        }
        complete.setSubmitDate(DateUtil.parse(taskCompleteDTO.getSubmitDate(), DatePattern.NORM_DATETIME_FORMAT));
        JSONObject json = JSONObject.parseObject(eventVisitingTasksDO.getTableContentJson());
        json.put("check", taskCompleteDTO.getOption());
        json.put("check",taskCompleteDTO.getOption());
        complete.setTableContentJson(json.toJSONString());
        if (!StringUtils.isEmpty(taskCompleteDTO.getImgList())) {
            taskCompleteDTO.getImgList().forEach(e -> {
                createResource(eventVisitingTasksDO.getId(), taskCompleteDTO.getUserId(), 2, 1, e);
        if(!StringUtils.isEmpty(taskCompleteDTO.getImgList())){
            taskCompleteDTO.getImgList().forEach(e->{
                createResource(eventVisitingTasksDO.getId(),taskCompleteDTO.getUserId(),2,1,e);
            });
        }
        if (!CollectionUtils.isEmpty(taskCompleteDTO.getVosList())) {
            taskCompleteDTO.getVosList().forEach(e -> {
                createResource(eventVisitingTasksDO.getId(), taskCompleteDTO.getUserId(), 2, 2, e);
        if(!CollectionUtils.isEmpty(taskCompleteDTO.getVosList())){
            taskCompleteDTO.getVosList().forEach(e->{
                createResource(eventVisitingTasksDO.getId(),taskCompleteDTO.getUserId(),2,2,e);
            });
        }
        if (!CollectionUtils.isEmpty(taskCompleteDTO.getVideoList())) {
            taskCompleteDTO.getVosList().forEach(e -> {
                createResource(eventVisitingTasksDO.getId(), taskCompleteDTO.getUserId(), 2, 3, e);
        if(!CollectionUtils.isEmpty(taskCompleteDTO.getVideoList())){
            taskCompleteDTO.getVosList().forEach(e->{
                createResource(eventVisitingTasksDO.getId(),taskCompleteDTO.getUserId(),2,3,e);
            });
        }
        Map<String, Object> map = eventVisitingTasksMapper.findUserById(taskCompleteDTO.getUserId());
        Map<String,Object> map = eventVisitingTasksMapper.findUserById(taskCompleteDTO.getUserId());
        complete.setGridMemberStreet(Long.valueOf(map.get("street_id").toString()));
        complete.setGridMemberCommunity(Long.valueOf(map.get("community_id").toString()));
        complete.setGridMember(Long.valueOf(map.get("user_id").toString()));
        complete.setGridMemberName(map.get("name").toString());
        complete.setGridMenberTele(map.get("phone") == null ? "" : map.get("phone").toString());
        complete.setGridMenberTele(map.get("phone") ==null?"":map.get("phone").toString());
        int rt = eventVisitingTasksMapper.complete(complete);
        if (rt > 0) {
        if(rt > 0){
            return R.ok();
        }
        return R.fail();
@@ -436,13 +468,13 @@
    @Override
    public List<LcEventVisitingTasksListDTO> getUnUploadVisitingTask() {
        List<LcEventVisitingTasksListDTO> lcEventVisitingTasksList = new ArrayList<>(10);
        List<LcEventVisitingTasksListDTO> lcEventVisitingTasksList =new ArrayList<>();
        List<EventVisitingTasksDO> eventVisitingTasksList = baseMapper.selectList(
                new QueryWrapper<EventVisitingTasksDO>()
                        .eq("lc_upload", false)
                        .eq("event_status", 2)
                        .eq("event_status",2)
        );
        lcEventVisitingTasksList = CopyUtil.beanCopyList(eventVisitingTasksList, LcEventVisitingTasksListDTO.class);
        lcEventVisitingTasksList= CopyUtil.beanCopyList(eventVisitingTasksList,LcEventVisitingTasksListDTO.class);
        lcEventVisitingTasksList.forEach(visitingTasks -> {
            addVisitingTasksFile(visitingTasks);
        });
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridDataMapper.xml
@@ -137,7 +137,7 @@
    </select>
    <select id="getGridMemberLists" resultType="com.panzhihua.common.model.vos.grid.EventGridMemberAdminVO">
        select user_id,nick_name from sys_user where community_id = #{communityId} and `type` = 6
        select user_id,nick_name from sys_user where `type` = 6
    </select>
    <select id="getGridMember" resultType="com.panzhihua.common.model.vos.grid.GridMemberAdminVO">
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml
@@ -454,7 +454,8 @@
                e.grid_member_name like concat('%', #{pageEventManageDTO.keyWord},'%') OR
                e.event_title like concat('%', #{pageEventManageDTO.keyWord},'%') OR
                e.happen_address like concat('%', #{pageEventManageDTO.keyWord},'%') OR
                e.order_sn like concat('%', #{pageEventManageDTO.keyWord},'%')
                e.order_sn like concat('%', #{pageEventManageDTO.keyWord},'%') OR
                e.event_clazz like concat('%', #{pageEventManageDTO.keyWord},'%')
                )
             </if>
            <if test="pageEventManageDTO.revokeType!=null">
@@ -509,7 +510,9 @@
                e.grid_member_name like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
                e.event_title like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
                e.happen_address like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
                e.order_sn like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%')
                e.order_sn like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
                e.propaganda_type like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
                egd.grid_name like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%')
                )
            </if>
            <if test="pagePublicityEventCommunityDTO.revokeType!=null">
@@ -535,8 +538,7 @@
                `event` AS e
                LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
            WHERE
                egd.grid_community_id = #{communityId}
                AND e.event_status = 2
                e.event_status = 2
                AND e.event_process_status = 2
            ) AS handleEventTotal,
            (
@@ -546,17 +548,15 @@
                `event` AS e
                LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
            WHERE
                egd.grid_community_id = #{communityId}
                AND e.event_category = 2
                e.event_category = 2
                AND e.event_status = 2
            ) AS propagandaEducationTotal,
            ( SELECT count( id ) FROM com_act_easy_photo WHERE handle_status = 2 AND community_id = #{communityId} ) AS easyPhotoTotal
            ( SELECT count( id ) FROM com_act_easy_photo WHERE handle_status = 2  ) AS easyPhotoTotal
        FROM
            `event` AS e
            LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
        WHERE
            egd.grid_community_id = #{communityId}
            AND e.event_status = 2
            e.event_status = 2
    </select>
    <select id="getEventCountByGridIds" resultType="Integer">
@@ -1078,6 +1078,7 @@
        WHERE
            egd.grid_community_id = #{communityId}
            AND e.event_status = 2
            AND e.event_deal_status in (1,2,3,4,6)
        ORDER BY
            e.create_at DESC
            LIMIT 10
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -1157,7 +1157,7 @@
     */
    @Override
    public R listComMngUserTag(Long communityId) {
        List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO.selectList(new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getCommunityId, communityId));
        List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO.selectList(new QueryWrapper<ComMngUserTagDO>().or().lambda().eq(ComMngUserTagDO::getSysFlag,1).or().eq(ComMngUserTagDO::getCommunityId, communityId));
        if (ObjectUtils.isEmpty(comMngUserTagDOS)) {
            return R.fail();
        }