DESKTOP-71BH0QO\L、ming
2021-03-29 68d8b72a646b4022e8a842f153ba9475e74803bc
ADD:实有房屋相关接口
2个文件已添加
10个文件已修改
581 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/VillageApi.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComCvtServeExcelListen.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngVillageServeExcelListen.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngVillageServeExcelVO.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 274 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComMngVillageApi.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngVillageService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/VillageApi.java
@@ -1,6 +1,9 @@
package com.panzhihua.applets_backstage.api;
import com.alibaba.excel.EasyExcel;
import com.jcraft.jsch.SftpException;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.listen.ComMngVillageServeExcelListen;
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
@@ -8,23 +11,30 @@
import com.panzhihua.common.service.community.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
 * @description: 实有房屋(小区)管理
 * @author: llming
 **/
@Slf4j
@Api(tags = {"实有房屋管理"})
@RestController
@RequestMapping("/villagemanager/")
public class VillageApi extends BaseController {
    @Value("${excel.convenientUrl}")
    private String excelConvenientUrl="http://panzhihua.nhys.cdnhxx.com/web/shiyoufangwudaoru.xlsx";
    @Resource
    private CommunityService communityService;
@@ -61,4 +71,27 @@
        return communityService.delectVillage(Ids);
    }
    @ApiOperation(value = "下载模板-实有房屋")
    @GetMapping(value = "/serve/download/template")
    public R downloadTemplate(HttpServletResponse response) throws IOException, SftpException {
        return R.ok(excelConvenientUrl);
    }
    @ApiOperation(value = "excel导入实有房屋")
    @PostMapping(value = "/serve/import", consumes = "multipart/*", headers = "content-type=multipart/form-date")
    public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) {
        //获取文件名
        String fileName = file.getOriginalFilename();
        log.info("传入文件名字【{}】",fileName);
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            EasyExcel.read(inputStream, ComMngVillageVO.class, new ComMngVillageServeExcelListen(communityService,null)).sheet().doRead();
        } catch (IOException e) {
            e.printStackTrace();
            log.error("导入模板失败【{}】", e.getMessage());
        }
        return R.ok();
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComCvtServeExcelListen.java
@@ -24,7 +24,7 @@
    private Long communityId;
    public ComCvtServeExcelListen(CommunityService communityService,Long communityId){
    public ComCvtServeExcelListen(CommunityService communityService, Long communityId) {
        this.communityService = communityService;
        this.communityId = communityId;
    }
@@ -32,17 +32,19 @@
    private static final int BATCH_COUNT = 100;
    private List<ComCvtServeExcelVO> list = new ArrayList<>();
    @Override
    public void invoke(ComCvtServeExcelVO comCvtServeExcelVO, AnalysisContext analysisContext) {
        list.add(comCvtServeExcelVO);
        // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
        if(list.size() >= BATCH_COUNT){
        if (list.size() >= BATCH_COUNT) {
            log.info("excel导入数据【{}】", JSONObject.toJSONString(list));
            R r = this.communityService.listSaveConvenientServeExcelVO(list,this.communityId);
            R r = this.communityService.listSaveConvenientServeExcelVO(list, this.communityId);
            if (!R.isOk(r)) {
                throw new ServiceException(r.getMsg());
            }
            list.clear();           //清空list
            //清空list
            list.clear();
        }
    }
@@ -50,7 +52,7 @@
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        log.info("excel导入数据【{}】", JSONObject.toJSONString(list));
        R r = this.communityService.listSaveConvenientServeExcelVO(list,this.communityId);//确保最后遗留的数据保存在数据库中
        R r = this.communityService.listSaveConvenientServeExcelVO(list, this.communityId);//确保最后遗留的数据保存在数据库中
        if (!R.isOk(r)) {
            throw new ServiceException(r.getMsg());
        }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngVillageServeExcelListen.java
New file
@@ -0,0 +1,61 @@
package com.panzhihua.common.listen;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComCvtServeExcelVO;
import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO;
import com.panzhihua.common.service.community.CommunityService;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
/**
 * @description: 实有房屋导入监听
 * @author: llming
 */
@Slf4j
public class ComMngVillageServeExcelListen extends AnalysisEventListener<ComMngVillageServeExcelVO> {
    private CommunityService communityService;
    private Long communityId;
    public ComMngVillageServeExcelListen(CommunityService communityService, Long communityId) {
        this.communityService = communityService;
        this.communityId = communityId;
    }
    private static final int BATCH_COUNT = 100;
    private List<ComMngVillageServeExcelVO> list = new ArrayList<>();
    @Override
    public void invoke(ComMngVillageServeExcelVO comMngVillageServeExcelVO, AnalysisContext analysisContext) {
        /*list.add(comMngVillageServeExcelVO);
        // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
        if (list.size() >= BATCH_COUNT) {
            log.info("excel导入数据【{}】", JSONObject.toJSONString(list));
            R r = communityService.listSaveVillageServeExcelVO(list, this.communityId);
            if (!R.isOk(r)) {
                throw new ServiceException(r.getMsg());
            }
            //清空list
            list.clear();
        }*/
    }
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
       /* log.info("excel导入数据【{}】", JSONObject.toJSONString(list));
        //确保最后遗留的数据保存在数据库中
        R r = this.communityService.listSaveVillageServeExcelVO(list, this.communityId);
        if (!R.isOk(r)) {
            throw new ServiceException(r.getMsg());
        }*/
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActVO.java
@@ -7,6 +7,7 @@
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
@@ -83,6 +84,5 @@
    private String distance;
    @ApiModelProperty("街道Id")
    @NotBlank(groups = {AddGroup.class},message = "街道Id不能为空")
    private Integer streetId;
    private Long streetId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngVillageServeExcelVO.java
New file
@@ -0,0 +1,31 @@
package com.panzhihua.common.model.vos.community;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.panzhihua.common.validated.AddGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @description: 批量导入实有房屋(小区)
 * @author: llming
 */
@Data
public class ComMngVillageServeExcelVO implements Serializable {
    /**
     * 服务分类
     */
    @ExcelProperty(value = "街路巷" ,index = 0)
    private String alley;
    @ExcelProperty(value = "门牌号" ,index = 1)
    private Integer houseNum;
    @ExcelProperty(value = "小区(组)" ,index = 2)
    private String groupAt;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -23,6 +23,7 @@
public interface CommunityService {
    /**
     * 新增社区活动
     *
     * @param comActActivityVO 新增信息
     * @return 新增结果
     */
@@ -31,6 +32,7 @@
    /**
     * 编辑社区活动
     *
     * @param comActActivityVO 编辑内容
     * @return 编辑结果
     */
@@ -39,6 +41,7 @@
    /**
     * 删除社区活动
     *
     * @param comActActivityVO 活动主键
     * @return 删除结果
     */
@@ -47,6 +50,7 @@
    /**
     * 分页查询社区活动
     *
     * @param comActActivityVO 查询参数
     * @return 分页集合
     */
@@ -55,6 +59,7 @@
    /**
     * 发布活动
     *
     * @param comActActivityVO 主键id 发布时间
     * @return 发布结果
     */
@@ -63,6 +68,7 @@
    /**
     * 取消活动
     *
     * @param comActActivityVO 取消原因
     * @return 取消结果
     */
@@ -71,15 +77,17 @@
    /**
     * 活动详情
     * @param id 活动id
     *
     * @param id     活动id
     * @param userId 当前登录者id
     * @return 详情
     */
    @PostMapping("detailactivity")
    R detailActivity(@RequestParam("id") Long id, @RequestParam("userId")Long userId);
    R detailActivity(@RequestParam("id") Long id, @RequestParam("userId") Long userId);
    /**
     * 活动报名名单
     *
     * @param activitySignVO 查询参数
     * @return 报名人员集合
     */
@@ -88,6 +96,7 @@
    /**
     * 新增社区动态
     *
     * @param comActDynVO 新增信息
     * @return 新增结果
     */
@@ -96,6 +105,7 @@
    /**
     * 编辑社区动态
     *
     * @param comActDynVO 编辑内容
     * @return 编辑结果
     */
@@ -104,6 +114,7 @@
    /**
     * 删除社区动态
     *
     * @param comActDynVO 动态id
     * @return 删除结果
     */
@@ -112,6 +123,7 @@
    /**
     * 分页查询社区动态
     *
     * @param comActDynVO 查询参数
     * @return 动态集合
     */
@@ -120,6 +132,7 @@
    /**
     * 社区动态详情
     *
     * @param id 动态id
     * @return 详情
     */
@@ -128,6 +141,7 @@
    /**
     * 分页查询随手拍
     *
     * @param comActEasyPhotoVO 查询参数
     * @return 心愿列表
     */
@@ -136,15 +150,17 @@
    /**
     * 随手拍详情
     * @param id 随手拍主键
     *
     * @param id     随手拍主键
     * @param userId 登录用户id
     * @return 详情内容
     */
    @PostMapping("detaileasyphoto")
    R detailEasyPhoto(@RequestParam("id") Long id, @RequestParam("userId")Long userId);
    R detailEasyPhoto(@RequestParam("id") Long id, @RequestParam("userId") Long userId);
    /**
     * 分页查询微心愿
     *
     * @param comActMicroWishVO 查询参数
     * @return 分页集合
     */
@@ -153,15 +169,17 @@
    /**
     * 心愿详情
     * @param id 查询主键
     *
     * @param id     查询主键
     * @param userId 登录用户id
     * @return 心愿内容
     */
    @PostMapping("detailmicrowish")
    R detailMicroWish(@RequestParam("id") Long id, @RequestParam("userId")Long userId);
    R detailMicroWish(@RequestParam("id") Long id, @RequestParam("userId") Long userId);
    /**
     * 审核、分配、反馈心愿
     *
     * @param comActMicroWishVO 具体操作
     * @return 操作结果
     */
@@ -170,6 +188,7 @@
    /**
     * 分页展示我的所有活动 时间倒序排列
     *
     * @param comActActivityVO 分页参数
     * @return 分页集合
     */
@@ -178,6 +197,7 @@
    /**
     * 报名/取消报名社区活动
     *
     * @param signactivityVO 报名参数
     * @return 报名 取消报名 结果
     */
@@ -186,6 +206,7 @@
    /**
     * 上传随手拍
     *
     * @param comActEasyPhotoVO 上传数据
     * @return 上传结果
     */
@@ -194,6 +215,7 @@
    /**
     * 发布微心愿
     *
     * @param comActMicroWishVO 发布内容
     * @return 发布结果
     */
@@ -202,6 +224,7 @@
    /**
     * 点赞/取消点赞随手拍
     *
     * @param comActEasyPhotoVO 操作参数
     * @return 操作结果
     */
@@ -210,6 +233,7 @@
    /**
     * 点赞/取消点赞微心愿
     *
     * @param comActMicroWishVO 操作参数
     * @return 操作结果
     */
@@ -218,15 +242,17 @@
    /**
     * 新增社区动态浏览记录
     * @param id 动态主键
     *
     * @param id     动态主键
     * @param userId 登录用户id
     * @return 新增结果
     */
    @PostMapping("adddynamicuser")
    R addDynamicUser(@RequestParam("id") Long id, @RequestParam("userId")Long userId);
    R addDynamicUser(@RequestParam("id") Long id, @RequestParam("userId") Long userId);
    /**
     * 审核、反馈随手拍
     *
     * @param comActEasyPhotoVO 操作参数
     * @return 操作结果
     */
@@ -235,6 +261,7 @@
    /**
     * 新增社区
     *
     * @param comActVO 社区信息
     * @return 新增结果
     */
@@ -243,6 +270,7 @@
    /**
     * 编辑社区
     *
     * @param comActVO 编辑内容
     * @return 编辑结果
     */
@@ -251,6 +279,7 @@
    /**
     * 房屋信息
     *
     * @param userId 用户id
     * @return 房屋信息
     */
@@ -259,6 +288,7 @@
    /**
     * 新增小区
     *
     * @param comMngStructAreaVO 小区信息
     * @return 新增结果
     */
@@ -267,6 +297,7 @@
    /**
     * 分页查询小区
     *
     * @param comMngStructAreaVO 查询参数
     * @return 分页结果
     */
@@ -275,6 +306,7 @@
    /**
     * 编辑小区
     *
     * @param comMngStructAreaVO 编辑内容
     * @return 编辑结果
     */
@@ -283,6 +315,7 @@
    /**
     * 删除小区
     *
     * @param comMngStructAreaVO 地址编码
     * @return 删除结果
     */
@@ -291,6 +324,7 @@
    /**
     * 小区批量建房
     *
     * @param batchhouseVO 建房参数
     * @return 建房结果
     */
@@ -299,14 +333,16 @@
    /**
     * 展示下级建筑
     *
     * @param houseCode 房屋编号
     * @return 下级建筑列表
     */
    @PostMapping("listsubordinatebuilding")
    R listSubordinatebuilding(@RequestParam("houseCode")String houseCode);
    R listSubordinatebuilding(@RequestParam("houseCode") String houseCode);
    /**
     * 添加同级地址
     *
     * @param comMngStructHouseVO 同级参数
     * @return 添加结果
     */
@@ -315,6 +351,7 @@
    /**
     * 编辑地址
     *
     * @param comMngStructHouseVO 编辑内容
     * @return 编辑结果
     */
@@ -323,6 +360,7 @@
    /**
     * 删除地址
     *
     * @param comMngStructHouseVO 删除指定地址和所有下级
     * @return 删除结果
     */
@@ -331,6 +369,7 @@
    /**
     * 新增其他建筑
     *
     * @param comMngStructOtherBuildVO 建筑参数
     * @return 新增结果
     */
@@ -339,6 +378,7 @@
    /**
     * 查询所有建筑类型
     *
     * @return 类型列表
     */
    @PostMapping("listbuildtype")
@@ -346,6 +386,7 @@
    /**
     * 分页查询 其他建筑
     *
     * @param comMngStructOtherBuildVO 分页查询参数
     * @return 查询结果
     */
@@ -354,6 +395,7 @@
    /**
     * 增加志愿者
     *
     * @param comMngVolunteerMngVO 志愿者信息
     * @return 增加结果
     */
@@ -362,6 +404,7 @@
    /**
     * 删除志愿者
     *
     * @param comMngVolunteerMngVO 手机号
     * @return 删除结果
     */
@@ -370,6 +413,7 @@
    /**
     * 编辑志愿者
     *
     * @param comMngVolunteerMngVO 编辑内容
     * @return 编辑结果
     */
@@ -378,6 +422,7 @@
    /**
     * 分页展示志愿者
     *
     * @param comMngVolunteerMngVO 查询参数
     * @return 分页集合返回
     */
@@ -386,6 +431,7 @@
    /**
     * 分页展示志愿者审核
     *
     * @param comMngVolunteerMngVO 查询参数
     * @return 查询结果
     */
@@ -394,6 +440,7 @@
    /**
     * 志愿者审核详情
     *
     * @param id 主键
     * @return 详情
     */
@@ -402,6 +449,7 @@
    /**
     * 志愿者审核
     *
     * @param comMngVolunteerMngVO 审核操作
     * @return 审核结果
     */
@@ -410,6 +458,7 @@
    /**
     * 删除志愿者审核
     *
     * @param comMngVolunteerMngVO 主键
     * @return 删除结果
     */
@@ -418,6 +467,7 @@
    /**
     * 查询区域
     *
     * @param comActVO 登录人的经纬度、或者指定区域的社区
     * @return 10个社区
     */
@@ -426,6 +476,7 @@
    /**
     * 用户修改手机号对应的志愿者手机号也要修改
     *
     * @param userPhoneVO 新旧手机号
     * @return 修改结果
     */
@@ -434,15 +485,17 @@
    /**
     * 房屋地址下拉列表
     *
     * @param parentCode 父级编码
     * @param areaId 小区id
     * @param areaId     小区id
     * @return 下级列表
     */
    @PostMapping("listhouses")
    R listHouses(@RequestParam("parentCode")String parentCode, @RequestParam("areaId")Long areaId);
    R listHouses(@RequestParam("parentCode") String parentCode, @RequestParam("areaId") Long areaId);
    /**
     * 新增房屋
     *
     * @param comMngStructHouseVO 房屋信息
     * @return 新增结果
     */
@@ -451,22 +504,25 @@
    /**
     * 查询小区
     *
     * @param communityId 社区id
     * @return 小区集合
     */
    @PostMapping("listarea")
    R listArea(@RequestParam("communityId")Long  communityId);
    R listArea(@RequestParam("communityId") Long communityId);
    /**
     * 用户参加的所有社区活动
     *
     * @param userId 用户id
     * @return 活动列表
     */
    @PostMapping("listactivity")
    R listActivity(@RequestParam("userId")Long  userId );
    R listActivity(@RequestParam("userId") Long userId);
    /**
     * 用户确认心愿
     *
     * @param comActMicroWishVO 用户评价
     * @return 确认结果
     */
@@ -475,6 +531,7 @@
    /**
     * 建筑类型
     *
     * @param communityId 社区id
     * @return 建筑集合
     */
@@ -483,14 +540,16 @@
    /**
     * 增加删除建筑类型
     *
     * @param systemmanagementConfigVO 操作内容
     * @return  操作结果
     * @return 操作结果
     */
    @PostMapping("putcommngstructbuildtype")
    R putComMngStructBuildType(@RequestBody SystemmanagementConfigVO systemmanagementConfigVO);
    /**
     * 获取广告跳转内容配置
     *
     * @return 跳转内容集合
     */
    @PostMapping("getjumpcontent")
@@ -498,6 +557,7 @@
    /**
     * 编辑运营后台系统配置
     *
     * @param appletesBackstageConfigDTO 编辑内容
     * @return 编辑结果
     */
@@ -506,6 +566,7 @@
    /**
     * 社区详情
     *
     * @param communityId 社区id
     * @return 社区详情
     */
@@ -514,14 +575,16 @@
    /**
     * 小区详情
     *
     * @param areaId 小区id
     * @return 小区信息
     */
    @PostMapping("detailarea")
    R detailArea(@RequestParam("areaId")Long areaId);
    R detailArea(@RequestParam("areaId") Long areaId);
    /**
     * 分页查询社区
     *
     * @param pageComActDTO 查询参数
     * @return 分页集合
     */
@@ -530,14 +593,16 @@
    /**
     * 志愿者详情
     *
     * @param id 主键
     * @return
     */
    @PostMapping("detailvolunteer")
    R detailVolunteer(@RequestParam("id")Long id);
    R detailVolunteer(@RequestParam("id") Long id);
    /**
     * 查询平台所有的社区
     *
     * @return 社区集合 按照创建顺序倒序排列
     */
    @PostMapping("listcommunityall")
@@ -545,6 +610,7 @@
    /**
     * 首页广告banner
     *
     * @return
     */
    @PostMapping("listadvertisement")
@@ -552,6 +618,7 @@
    /**
     * 新增广告
     *
     * @param comOpsAdvDTO
     * @return
     */
@@ -560,6 +627,7 @@
    /**
     * 编辑广告
     *
     * @param comOpsAdvDTO 编辑内容
     * @return 编辑结果
     */
@@ -568,6 +636,7 @@
    /**
     * 广告位置下拉列表
     *
     * @return 位置集合
     */
    @PostMapping("listadvpos")
@@ -575,6 +644,7 @@
    /**
     * 跳转内容下拉列表
     *
     * @return 跳转内容集合
     */
    @PostMapping("listadvjump")
@@ -582,15 +652,17 @@
    /**
     * 社区管理后台数据看板 代办事件
     *
     * @param communityId 社区id
     * @param userId
     * @return 代办事件列表
     */
    @PostMapping("indexdatacommunitybackstage")
    R indexDataCommunityBackstage(@RequestParam("communityId") Long communityId, @RequestParam("userId")Long userId);
    R indexDataCommunityBackstage(@RequestParam("communityId") Long communityId, @RequestParam("userId") Long userId);
    /**
     * 删除社区
     *
     * @param communityId 社区id
     * @return 删除结果
     */
@@ -599,6 +671,7 @@
    /**
     * 定时任务刷新社区动态置顶状态
     *
     * @return
     */
    @PostMapping("timedtaskdynistopping")
@@ -606,6 +679,7 @@
    /**
     * 定时任务刷新社区动态发布状态
     *
     * @return
     */
    @PostMapping("timedtaskdynstatus")
@@ -613,13 +687,15 @@
    /**
     * 定时任务查询所有要取消的社区活动
     * @return  社区活动集合
     *
     * @return 社区活动集合
     */
    @PostMapping("timedtaskactactivity")
    R timedTaskActActivity();
    /**
     * 定时任务刷新社区活动的各个状态 除取消外
     *
     * @return
     */
    @PostMapping("timedtaskactactivityall")
@@ -627,14 +703,16 @@
    /**
     * 其他建筑详情
     *
     * @param id 主键id
     * @return 建筑内容
     */
    @PostMapping("detailotherbuild")
    R detailOtherbuild(@RequestParam("id")Long id);
    R detailOtherbuild(@RequestParam("id") Long id);
    /**
     * 编辑其他建筑
     *
     * @param comMngStructOtherBuildVO 编辑内容
     * @return 编辑结果
     */
@@ -643,21 +721,25 @@
    /**
     * 删除其他建筑
     *
     * @param id 主键
     * @return 删除结果
     */
    @PostMapping("deleteotherbuild")
    R deleteOtherbuild(@RequestParam("id")Long id);
    R deleteOtherbuild(@RequestParam("id") Long id);
    /**
     * 社区后台分页查询社区活动
     *
     * @param comActActivityVO 查询参数
     * @return 返回结果
     */
    @PostMapping("pageactivitycommunityback")
    R pageActivityCommunityBack(@RequestBody ComActActivityVO comActActivityVO);
    /**
     * 小程序分页查询随手拍
     *
     * @param comActEasyPhotoVO 查询参数
     * @return 返回结果
     */
@@ -666,6 +748,7 @@
    /**
     * 随手拍评论分页查询
     *
     * @param pageComActEasyPhotoCommentDTO 查询参数
     * @return 查询结果
     */
@@ -674,6 +757,7 @@
    /**
     * 评论点赞/取消点赞
     *
     * @param comActEasyPhotoCommentUserDTO 操作
     * @return 操作结果
     */
@@ -682,6 +766,7 @@
    /**
     * 随手拍--评论--新增评论
     *
     * @param comActEasyPhotoCommentDTO 新增内容
     * @return 新增结果
     */
@@ -690,6 +775,7 @@
    /**
     * 一起议-新增
     *
     * @param comActDiscussDTO 新增参数
     * @return 新增结果
     */
@@ -698,6 +784,7 @@
    /**
     * 一起议-详情
     *
     * @param id 主键
     * @return ComActDiscussVO
     */
@@ -706,6 +793,7 @@
    /**
     * 一起议-删除
     *
     * @param id 主键
     * @return 删除结果
     */
@@ -714,6 +802,7 @@
    /**
     * 一起议-回复
     *
     * @param comActDiscussCommentDTO 评论内容
     * @return 回复结果
     */
@@ -722,6 +811,7 @@
    /**
     * 一起议-分页查询
     *
     * @param pageComActDiscussDTO 查询参数
     * @return ComActDiscussVO
     */
@@ -730,6 +820,7 @@
    /**
     * 一起议-评论-查看
     *
     * @param id 主键
     * @return 详情
     */
@@ -738,6 +829,7 @@
    /**
     * 一起议-评论-置顶
     *
     * @param id 主键
     * @return 置顶结果
     */
@@ -746,22 +838,25 @@
    /**
     * 一起议-评论-回复
     *
     * @param comActDiscussCommentDTO 回复内容
     * @return  回复结果
     * @return 回复结果
     */
    @PostMapping("adddiscusscommentback")
    R addDiscussCommentBack(@RequestBody ComActDiscussCommentDTO comActDiscussCommentDTO);
    /**
     * 一起议-评论-分页查询
     *
     * @param pageComActDiscussCommentDTO 分页查询参数
     * @return  ComActDiscussCommentVO
     * @return ComActDiscussCommentVO
     */
    @PostMapping("pagediscusscomment")
    R pageDiscussComment(@RequestBody PageComActDiscussCommentDTO pageComActDiscussCommentDTO);
    /**
     * 一起议-分页查询 小程序
     *
     * @param pageComActDiscussDTO 查询参数
     * @return ComActDiscussVO 分页
     */
@@ -770,6 +865,7 @@
    /**
     * 一起议-点赞、取消点赞
     *
     * @param comActDiscussUserDTO 操作类型
     * @return 操作结果
     */
@@ -778,6 +874,7 @@
    /**
     * 一起议-评论-分页查询 小程序
     *
     * @param pageComActDiscussCommentDTO 分页参数
     * @return ComActDiscussCommentVO
     */
@@ -786,15 +883,17 @@
    /**
     * 一起议-详情 小程序
     * @param id 主键
     *
     * @param id     主键
     * @param userId 登录用户主键
     * @return ComActDiscussVO
     */
    @PostMapping("detaildiscussapplets")
    R detailDiscussApplets(@RequestParam("id") Long id, @RequestParam("userId")Long userId);
    R detailDiscussApplets(@RequestParam("id") Long id, @RequestParam("userId") Long userId);
    /**
     * 一起议-投票
     *
     * @param comActDiscussOptionUserDTO 投票信息
     * @return 投票结果
     */
@@ -803,6 +902,7 @@
    /**
     * 一起议-评论-点赞、取消点赞
     *
     * @param comActDiscussUserDTO 评论点赞
     * @return 点赞结果
     */
@@ -811,6 +911,7 @@
    /**
     * 分页查询广告
     *
     * @param pageComOpsAdvDTO 查询内容
     * @return 查询结果 ComOpsAdvVO
     */
@@ -819,6 +920,7 @@
    /**
     * 广告详情
     *
     * @param id 主键
     * @return 广告内容
     */
@@ -827,14 +929,16 @@
    /**
     * 删除广告
     *
     * @param id 主键
     * @return 删除结果
     */
    @PostMapping("deleteadvertisement")
    R deleteAdvertisement(@RequestParam("id")Long id);
    R deleteAdvertisement(@RequestParam("id") Long id);
    /**
     * 查询城市下属所有地区列表
     *
     * @param cityAdcode 城市地址编码
     * @return 地区列表
     */
@@ -843,91 +947,113 @@
    /**
     * 首页图表数据汇总
     *
     * @param communityId 社区id
     * @return 图表数据
     */
    @PostMapping("indexdatacommunitybackstageechart")
    R indexDataCommunityBackstageEchart(@RequestParam("communityId")Long communityId);
    R indexDataCommunityBackstageEchart(@RequestParam("communityId") Long communityId);
    /**
     * 选择导入的小区
     * @param param 小区名字 模糊查询
     *
     * @param param       小区名字 模糊查询
     * @param communityId 社区id
     * @return 小区集合 ComMngStructAreaVO
     */
    @PostMapping("listareas")
    R listAreas(@RequestParam("param")String param, @RequestParam("communityId")Long communityId);
    R listAreas(@RequestParam("param") String param, @RequestParam("communityId") Long communityId);
    /**
     * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则
     *
     * @param id 小区id
     * @return ComMngStructAreaVO
     */
    @PostMapping("checkAreaHouse")
    R checkAreaHouse(@RequestParam("id")Long id);
    R checkAreaHouse(@RequestParam("id") Long id);
    /**
     * 新增留言
     *
     * @param comActMessageVO 新增留言信息
     * @return 发布结果
     */
    @PostMapping("addmessage")
    R addMessage(@RequestBody ComActMessageVO comActMessageVO);
    R addMessage(@RequestBody ComActMessageVO comActMessageVO);
    /**
     * 我的留言
     *
     * @param comActMessageVO 留言信息
     * @return 发布结果
     */
    @PostMapping("pagemymessage")
    R pageMyMessageApplets(@RequestBody ComActMessageVO comActMessageVO);
    R pageMyMessageApplets(@RequestBody ComActMessageVO comActMessageVO);
    /**
     * 给我的留言
     *
     * @param comActMessageVO 留言信息
     * @return 发布结果
     */
    @PostMapping("pagesendtomemessage")
    R pageSendToMessageApplets(@RequestBody ComActMessageVO comActMessageVO);
    R pageSendToMessageApplets(@RequestBody ComActMessageVO comActMessageVO);
    /**
     * 新增留言回复
     *
     * @param comActMessageBackVO 保存留言回复信息
     * @return 发布结果
     */
    @PostMapping("addmessageback")
    R addMessageBack(@RequestBody ComActMessageBackVO comActMessageBackVO);
    R addMessageBack(@RequestBody ComActMessageBackVO comActMessageBackVO);
    /**
     * 根据id查询留言列表
     *
     * @return 发布结果
     */
    @PostMapping("pagemessagebyuser")
    R pageMessageByUser(@RequestBody ComActMessageVO comActMessageVO);
    R pageMessageByUser(@RequestBody ComActMessageVO comActMessageVO);
    /**
     * 根据id删除留言
     *
     * @return 删除结果
     */
    @PostMapping("deletemessage")
    R deleteMessage(@RequestBody ComActMessageVO comActMessageVO);
    R deleteMessage(@RequestBody ComActMessageVO comActMessageVO);
    /**
     * 根据id集合批量设置是否公开
     *
     * @return 删除结果
     */
    @PostMapping("resetmessagepublic")
    R resetMessagePublic(@RequestBody ResetComActMessageVO resetComActMessageVO);
    R resetMessagePublic(@RequestBody ResetComActMessageVO resetComActMessageVO);
    /**
     * 分页显示社区所有留言
     *
     * @param comActMessageVO 留言信息
     * @return 结果集合
     */
    @PostMapping("pagemycommunitymessage")
    R pageMyCommunityMessage(@RequestBody ComActMessageVO comActMessageVO);
    R pageMyCommunityMessage(@RequestBody ComActMessageVO comActMessageVO);
    /**
     * 根据id查找留言详情
     *
     * @param id
     * @return
     */
    @PostMapping("detailmessage")
    R detailMessage(@RequestParam("id")Long id);
    R detailMessage(@RequestParam("id") Long id);
    /**
     * 小程序通过便民服务区域分页查询便民服务商家
     *
     * @param comCvtBusinessAppletsDTO 查询参数
     * @return 返回结果
     */
@@ -936,6 +1062,7 @@
    /**
     * 一起议-新增
     *
     * @param comOpsHouseDTO 新增参数
     * @return 新增结果
     */
@@ -944,6 +1071,7 @@
    /**
     * 一起议-详情
     *
     * @param id 主键
     * @return ComOpsHouseVO
     */
@@ -952,30 +1080,34 @@
    /**
     * 房屋租售-修改
     * @param comOpsHouseVO    修改参数
     * @return  修改结果
     *
     * @param comOpsHouseVO 修改参数
     * @return 修改结果
     */
    @PostMapping("/putOpsHouse")
    R putOpsHouse(@RequestBody ComOpsHouseVO comOpsHouseVO);
    /**
     * 房屋租售-小程序修改
     * @param comOpsHouseVO    修改参数
     * @return  修改结果
     *
     * @param comOpsHouseVO 修改参数
     * @return 修改结果
     */
    @PostMapping("/putOpsHouseByApplets")
    R putOpsHouseByApplets(@RequestBody ComOpsHouseVO comOpsHouseVO);
    /**
     * 房屋租售-上下架
     * @param comOpsHouseVO    上下架参数
     * @return  上下架结果
     *
     * @param comOpsHouseVO 上下架参数
     * @return 上下架结果
     */
    @PostMapping("/undercarriageHouse")
    R undercarriageHouse(@RequestBody ComOpsHouseUndercarriageVO comOpsHouseVO);
    /**
     * 一起议-删除
     *
     * @param id 主键
     * @return 删除结果
     */
@@ -984,6 +1116,7 @@
    /**
     * 一起议-分页查询
     *
     * @param pageComOpsHouseDTO 查询参数
     * @return ComOpsHouseVO
     */
@@ -992,6 +1125,7 @@
    /**
     * 社区后台分页查询便民服务商家
     *
     * @param pageComCvtBusinessDTO 查询参数
     * @return 返回结果
     */
@@ -1000,6 +1134,7 @@
    /**
     * 添加便民服务商家信息
     *
     * @param comCvtBusinessDTO
     * @return
     */
@@ -1137,21 +1272,24 @@
    /**
     * 小程序便民服务商家详情
     *
     * @param id 商家ID
     * @return
     */
    @GetMapping("/convenient/business/serve/get")
    R getComCvtBusinessServeDetail(@RequestParam("id")Long id);
    R getComCvtBusinessServeDetail(@RequestParam("id") Long id);
    /**
     * 批量导入便民服务
     *
     * @param list 便民服务集合
     */
    @PostMapping("/convenient/serve/import")
    R listSaveConvenientServeExcelVO(@RequestBody List<ComCvtServeExcelVO> list,@RequestParam("communityId") Long communityId);
    R listSaveConvenientServeExcelVO(@RequestBody List<ComCvtServeExcelVO> list, @RequestParam("communityId") Long communityId);
    /**
     * 导出房屋信息
     *
     * @param areaId
     * @return
     */
@@ -1160,6 +1298,7 @@
    /**
     * 小程序添加车辆信息
     *
     * @param comCvtBusinessDTO
     * @return
     */
@@ -1168,6 +1307,7 @@
    /**
     * 小程序用户登记车辆列表
     *
     * @param userId
     * @return
     */
@@ -1182,6 +1322,7 @@
    /**
     * 删除车辆信息
     *
     * @param id
     * @return
     */
@@ -1190,14 +1331,16 @@
    /**
     * 批量导入便民服务
     *
     * @param list 便民服务集合
     */
    @PostMapping("/common/data/car/import")
    R listSaveMngCarExcelVO(@RequestBody List<ComMngCarExcelVO> list,@RequestParam("communityId") Long communityId);
    R listSaveMngCarExcelVO(@RequestBody List<ComMngCarExcelVO> list, @RequestParam("communityId") Long communityId);
    /**
     * 社区后台实有单位管理列表
     *
     * @param pageComMngRealCompanyDTO
     * @return
     */
@@ -1206,6 +1349,7 @@
    /**
     * 社区后台添加修改实有单位
     *
     * @param comMngRealCompanyVO
     * @return
     */
@@ -1214,6 +1358,7 @@
    /**
     * 社区后台删除实有单位
     *
     * @param id
     * @return
     */
@@ -1222,6 +1367,7 @@
    /**
     * 实有单位详情
     *
     * @param id
     * @return
     */
@@ -1230,13 +1376,15 @@
    /**
     * 批量导入实有单位
     *
     * @param list 实有单位集合
     */
    @PostMapping("/common/data/company/import")
    R listSaveMngRealCompanyExcelVO(@RequestBody List<ComMngRealCompanyExcelVO> list,@RequestParam("communityId") Long communityId);
    R listSaveMngRealCompanyExcelVO(@RequestBody List<ComMngRealCompanyExcelVO> list, @RequestParam("communityId") Long communityId);
    /**
     * 实有单位导出
     *
     * @param exportRealCompanyExcelDTO
     * @return
     */
@@ -1245,6 +1393,7 @@
    /**
     * 社区后台实有单位管理列表
     *
     * @param pageComMngRealAssetsDTO
     * @return
     */
@@ -1253,6 +1402,7 @@
    /**
     * 社区后台添加修改实有单位
     *
     * @param comMngRealAssetsVO
     * @return
     */
@@ -1261,6 +1411,7 @@
    /**
     * 社区后台删除实有单位
     *
     * @param id
     * @return
     */
@@ -1269,6 +1420,7 @@
    /**
     * 实有单位详情
     *
     * @param id
     * @return
     */
@@ -1277,13 +1429,15 @@
    /**
     * 批量导入实有单位
     *
     * @param list 实有单位集合
     */
    @PostMapping("/common/data/assets/import")
    R listSaveMngRealAssetsExcelVO(@RequestBody List<ComMngRealAssetsExcelVO> list,@RequestParam("communityId") Long communityId);
    R listSaveMngRealAssetsExcelVO(@RequestBody List<ComMngRealAssetsExcelVO> list, @RequestParam("communityId") Long communityId);
    /**
     * 实有单位导出
     *
     * @param exportRealAssetsExcelDTO
     * @return
     */
@@ -1292,6 +1446,7 @@
    /**
     * 查询所有省份
     *
     * @return
     */
    @GetMapping("/common/data/province")
@@ -1299,6 +1454,7 @@
    /**
     * 查询省份下所有的城市
     *
     * @param provinceAdcode
     * @return
     */
@@ -1307,6 +1463,7 @@
    /**
     * 查询城市下所有的区县
     *
     * @param cityAdcode
     * @return
     */
@@ -1315,6 +1472,7 @@
    /**
     * 查询省下所有区域  tree结构
     *
     * @param provinceAdcode
     * @return
     */
@@ -1323,6 +1481,7 @@
    /**
     * 分页查询街道
     *
     * @param pageComStreetDTO
     * @return
     */
@@ -1331,6 +1490,7 @@
    /**
     * 新增街道
     *
     * @param comStreetVOO
     * @return
     */
@@ -1339,6 +1499,7 @@
    /**
     * 删除街道
     *
     * @param Ids
     * @return
     */
@@ -1347,6 +1508,7 @@
    /**
     * 查询街道
     *
     * @param comStreetVO
     * @return
     */
@@ -1355,6 +1517,7 @@
    /**
     * 分页查询实有房屋
     *
     * @param pageComMngVillageDTO
     * @return
     */
@@ -1363,6 +1526,7 @@
    /**
     * 新增实有房屋
     *
     * @param comMngVillageVO
     * @return
     */
@@ -1371,6 +1535,7 @@
    /**
     * 删除实有房屋
     *
     * @param Ids
     * @return
     */
@@ -1379,9 +1544,20 @@
    /**
     * 查询实有房屋
     *
     * @param comMngVillageVO
     * @return
     */
    @PostMapping("/listvillage")
    R listVillage(ComMngVillageVO comMngVillageVO);
    /**
     * 批量导入实有房屋
     *
     * @param list
     * @param communityId
     * @return
     */
    /*@PostMapping("/village/import")
    R listSaveVillageServeExcelVO(@RequestBody List<ComMngVillageServeExcelVO> list, @RequestParam Long communityId);*/
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComMngVillageApi.java
@@ -2,14 +2,13 @@
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngCarExcelVO;
import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO;
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
import com.panzhihua.service_community.service.ComMngVillageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
@@ -72,4 +71,15 @@
        return R.ok(r);
    }
    /**
     * 社区后台导入实有房屋
     * @param list 车辆列表
     * @param communityId 社区编号
     * @return
     */
    @PostMapping("/village/import")
    public R listSaveMngCarExcelVO(@RequestBody List<ComMngVillageServeExcelVO> list, @RequestParam("communityId") Long communityId){
        return comMngVillageService.listSaveVillage(list,communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDO.java
@@ -97,7 +97,7 @@
    /**
     * 街道ID
     */
    private Integer streetId;
    private Long streetId;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngVillageService.java
@@ -2,6 +2,7 @@
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO;
import com.panzhihua.common.model.vos.community.ComMngVillageVO;
import java.util.List;
@@ -13,7 +14,6 @@
public interface ComMngVillageService {
    /**
     * 添加实有房屋
     *
     * @param comMngVillageVO 实有房屋
     * @return 新增结果
     */
@@ -21,7 +21,6 @@
    /**
     * 查询实有房屋
     *
     * @param comMngVillageVO 登录人的经纬度、或者指定区域的社区
     * @return 社区集合
     */
@@ -29,7 +28,6 @@
    /**
     * 分页查询实有房屋
     *
     * @param pageComMngVillageDTO 查询参数
     * @return 分页集合
     */
@@ -37,9 +35,16 @@
    /**
     * 删除实有房屋
     *
     * @param Ids 实有房屋ids
     * @return 删除结果
     */
    R delecComActVillage(List<Long> Ids);
    /**
     * 批量导入实有房屋
     * @param list
     * @param communityId
     * @return
     */
    R listSaveVillage(List<ComMngVillageServeExcelVO> list, Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java
@@ -9,7 +9,11 @@
import com.panzhihua.common.model.vos.community.ComActVO;
import com.panzhihua.common.model.vos.community.ComMngStructOtherBuildVO;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.dao.ComActVillageDAO;
import com.panzhihua.service_community.dao.ComStreetDAO;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComMngVillageDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.ComActService;
import org.springframework.beans.BeanUtils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@@ -30,6 +34,9 @@
public class ComActServiceImpl implements ComActService {
    @Resource
    private ComActDAO comActDAO;
    @Resource
    private ComStreetDAO comStreetDAO;
    /**
     * 新增社区
     *
@@ -41,16 +48,20 @@
        String password = comActVO.getPassword();
        String encode = new BCryptPasswordEncoder().encode(password);
        comActVO.setPassword(encode);
        ComActDO comActDO=new ComActDO();
        ComStreetDO comStreetDO = comStreetDAO.selectById(comActVO.getStreetId());
        if (comStreetDO == null) {
            return R.fail("当前街道不存在!");
        }
        ComActDO comActDO = new ComActDO();
        Integer integer = comActDAO.selectCount(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getName, comActVO.getName()));
        if (integer>0) {
        if (integer > 0) {
            return R.fail("社区已经存在");
        }
        BeanUtils.copyProperties(comActVO,comActDO);
        BeanUtils.copyProperties(comActVO, comActDO);
        int insert = comActDAO.insert(comActDO);
        if (insert>0) {
        if (insert > 0) {
            ComActDO comActDO1 = comActDAO.selectOne(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getName, comActVO.getName()));
            BeanUtils.copyProperties(comActDO1,comActVO);
            BeanUtils.copyProperties(comActDO1, comActVO);
            return R.ok(comActVO);
        }
        return R.fail();
@@ -64,26 +75,31 @@
     */
    @Override
    public R putCommunity(ComActVO comActVO) {
        ComActDO comActDO=new ComActDO();
        ComActDO comActDO = new ComActDO();
        String password = comActVO.getPassword();
        String account = comActVO.getAccount();
        Long communityId = comActVO.getCommunityId();
//        String contacts = comActVO.getContacts();
        int a=0;
        int a = 0;
        if (!ObjectUtils.isEmpty(password)) {
            String encode = new BCryptPasswordEncoder().encode(password);
            comActVO.setPassword(encode);
            a=1;
            a = 1;
        }
        ComStreetDO comStreetDO = comStreetDAO.selectById(comActVO.getStreetId());
        if (comStreetDO == null) {
            return R.fail("当前街道不存在!");
        }
//        if(!ObjectUtils.isEmpty(account)||!ObjectUtils.isEmpty(contacts)){
//            a=1;
//        }
        BeanUtils.copyProperties(comActVO,comActDO);
        BeanUtils.copyProperties(comActVO, comActDO);
        int update = comActDAO.updateById(comActDO);
        if (update>0) {
            if (a==1) {
        if (update > 0) {
            if (a == 1) {
//                修改登录账户的密码
                comActDAO.updateAccountPassword(comActVO.getPassword(),account,communityId);
                comActDAO.updateAccountPassword(comActVO.getPassword(), account, communityId);
            }
            return R.ok();
        }
@@ -98,7 +114,7 @@
     */
    @Override
    public R listCommunity(ComActVO comActVO) {
        List<ComActVO> comActVOS=comActDAO.listCommunity(comActVO);
        List<ComActVO> comActVOS = comActDAO.listCommunity(comActVO);
        return R.ok(comActVOS);
    }
@@ -114,8 +130,8 @@
        if (ObjectUtils.isEmpty(comActDO)) {
            return R.fail();
        }
        ComActVO comActVO=new ComActVO();
        BeanUtils.copyProperties(comActDO,comActVO);
        ComActVO comActVO = new ComActVO();
        BeanUtils.copyProperties(comActDO, comActVO);
        comActVO.setAreaName(comActDAO.selectAreaName(comActVO.getAreaCode()));
        return R.ok(comActVO);
    }
@@ -131,10 +147,10 @@
        Page page = new Page<>();
        Long pageNum = pageComActDTO.getPageNum();
        Long pageSize = pageComActDTO.getPageSize();
        if (null==pageNum||0==pageNum) {
        if (null == pageNum || 0 == pageNum) {
            pageNum = 1l;
        }
        if (null==pageSize||0==pageSize) {
        if (null == pageSize || 0 == pageSize) {
            pageSize = 10l;
        }
        page.setSize(pageSize);
@@ -151,11 +167,11 @@
    @Override
    public R listCommunityAll() {
        List<ComActDO> comActDOS = comActDAO.selectList(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getState, 0).orderByDesc(ComActDO::getCreateAt));
        List<ComActVO> comActVOS=new ArrayList<>();
        List<ComActVO> comActVOS = new ArrayList<>();
        if (!ObjectUtils.isEmpty(comActDOS)) {
            comActDOS.forEach(comActDO -> {
                ComActVO comActVO=new ComActVO();
                BeanUtils.copyProperties(comActDO,comActVO);
                ComActVO comActVO = new ComActVO();
                BeanUtils.copyProperties(comActDO, comActVO);
                comActVOS.add(comActVO);
            });
        }
@@ -171,7 +187,7 @@
    @Override
    public R delectCommunity(Long communityId) {
        int delete = comActDAO.deleteById(communityId);
        if (delete>0) {
        if (delete > 0) {
            return R.ok();
        }
        return R.fail();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
@@ -5,27 +5,39 @@
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.google.common.collect.Lists;
import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO;
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.dao.ComActDAO;
import com.panzhihua.service_community.dao.ComActVillageDAO;
import com.panzhihua.service_community.dao.ComMngVolunteerMngDAO;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComActDiscussDO;
import com.panzhihua.service_community.model.dos.ComMngVillageDO;
import com.panzhihua.service_community.service.ComMngVillageService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @author: llming
 * @description: 实有房屋
 **/
@Service
public class ComMngVillageServiceImpl implements ComMngVillageService {
public class ComMngVillageServiceImpl extends ServiceImpl<ComActVillageDAO, ComMngVillageDO> implements ComMngVillageService {
    @Resource
    ComActVillageDAO comActVillageDAO;
    @Resource
    ComActDAO comActDAO;
    @Override
    public R addComActVillage(ComMngVillageVO comMngVillageVO) {
@@ -38,6 +50,8 @@
            return R.fail("实有房屋已经存在");
        }
        BeanUtils.copyProperties(comMngVillageVO, comMngVillageDO);
        ComActDO comActDO = comActDAO.selectById(comMngVillageDO.getCommunityId());
        comMngVillageDO.setStreetId(comActDO.getStreetId());
        int insert = comActVillageDAO.insert(comMngVillageDO);
        if (insert > 0) {
            param.eq(ComMngVillageDO::getAlley, comMngVillageVO.getAlley());
@@ -75,7 +89,7 @@
        page.setSize(pageSize);
        page.setCurrent(pageNum);
        LambdaQueryWrapper<ComMngVillageDO> userLambdaQueryWrapper = Wrappers.lambdaQuery();
        if (!pageComMngVillageDTO.getAlley().isEmpty()) {
        if (pageComMngVillageDTO.getAlley() != null) {
            userLambdaQueryWrapper.like(ComMngVillageDO::getAlley, pageComMngVillageDTO.getAlley());
        }
        Page userPage = new Page(pageNum, pageSize);
@@ -91,4 +105,23 @@
        }
        return R.fail();
    }
    @Override
    public R listSaveVillage(List<ComMngVillageServeExcelVO> list, Long communityId) {
        //获取社区下所有的实有房屋(小区),打印已经存在的重复数据
        List<ComMngVillageDO> comMngVillageDOs = comActVillageDAO.selectList(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getCommunityId, communityId));
        List<String> alleyList = list.stream().map(vo -> vo.getAlley()).collect(Collectors.toList());
        List<Integer> houseNumList = list.stream().map(vo -> vo.getHouseNum()).collect(Collectors.toList());
        List<ComMngVillageDO> resultList = comMngVillageDOs.stream().filter(village -> alleyList.contains(village.getAlley()) && houseNumList.contains(village.getAlley())).collect(Collectors.toList());
        if (resultList != null && resultList.size() > 0) {
            List<String> repeatList = resultList.stream().map(ComMngVillageDO::getAlley).collect(Collectors.toList());
            return R.fail("导入实有房屋,存在数据重复:" + repeatList.toArray());
        }
        ArrayList<ComMngVillageDO> comMngVillageDOS = Lists.newArrayList();
        BeanUtils.copyProperties(list, comMngVillageDOS);
        /*this.saveBatch(comMngCarDOS);
        return R.ok("共计导入车辆数量:" + comMngCarDOS.size());*/
        System.out.println(comMngVillageDOS);
        return null;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java
@@ -12,6 +12,7 @@
import com.panzhihua.common.model.vos.community.ComStreetVO;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.dao.ComStreetDAO;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.ComStreetService;
import org.springframework.beans.BeanUtils;
@@ -74,14 +75,18 @@
     */
    @Override
    public R listStreet(ComStreetVO comStreetVO) {
        List<ComStreetVO> vos = Lists.newArrayList();
        LambdaQueryWrapper<ComStreetDO> param = new QueryWrapper<ComStreetDO>().lambda();
        param.eq(ComStreetDO::getProvinceCode, comStreetVO.getProvinceCode());
        param.eq(ComStreetDO::getCityCode, comStreetVO.getCityCode());
        param.eq(ComStreetDO::getAreaCode, comStreetVO.getCityCode());
        List<ComStreetDO> ComStreetDOS = comStreetDAO.selectList(param);
        BeanUtils.copyProperties(vos, ComStreetDOS);
        return R.ok(vos);
        if (comStreetVO.getProvinceCode() != null) {
            param.eq(ComStreetDO::getProvinceCode, comStreetVO.getProvinceCode());
        }
        if (comStreetVO.getCityCode() != null) {
            param.eq(ComStreetDO::getCityCode, comStreetVO.getCityCode());
        }
        if (comStreetVO.getAreaCode() != null) {
            param.eq(ComStreetDO::getAreaCode, comStreetVO.getAreaCode());
        }
        List<ComStreetDO> comStreetDOS = comStreetDAO.selectList(param);
        return R.ok(comStreetDOS);
    }
    /**
@@ -122,7 +127,7 @@
        page.setSize(pageSize);
        page.setCurrent(pageNum);
        LambdaQueryWrapper<ComStreetDO> userLambdaQueryWrapper = Wrappers.lambdaQuery();
        if (!pageComStreetDTO.getName().isEmpty()) {
        if (pageComStreetDTO.getName() != null) {
            userLambdaQueryWrapper.like(ComStreetDO::getName, pageComStreetDTO.getName());
        }
        Page userPage = new Page(pageNum, pageSize);
@@ -132,13 +137,18 @@
    /**
     * 批量删除社区
     *
     * 批量删除街道
     * @param streetIds 社区id
     * @return 删除结果
     */
    @Override
    public R delectStreat(List<Long> streetIds) {
        //不能删除,已经绑定了社区的街道
        LambdaQueryWrapper<ComActDO> comActDOParam = new QueryWrapper<ComActDO>().lambda().in(ComActDO::getStreetId, streetIds);
        List<ComActDO> comActDOS = comActDAO.selectList(comActDOParam);
        if (comActDOS != null && comActDOS.size() > 0) {
            return R.fail("删除失败,批量删除街道中,街道下有社区无法删除!");
        }
        int delete = comStreetDAO.deleteBatchIds(streetIds);
        if (delete > 0) {
            return R.ok();