New file |
| | |
| | | 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.ComMngCarExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 实有单位导入监听 |
| | | * @author: Null |
| | | * @date: 2021/3/11 13:26 |
| | | */ |
| | | @Slf4j |
| | | public class ComMngRealCompanyExcelListen extends AnalysisEventListener<ComMngRealCompanyExcelVO> { |
| | | |
| | | private CommunityService communityService; |
| | | |
| | | private Long communityId; |
| | | |
| | | public ComMngRealCompanyExcelListen(CommunityService communityService, Long communityId){ |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | |
| | | private static final int BATCH_COUNT = 100; |
| | | private List<ComMngRealCompanyExcelVO> list = new ArrayList<>(); |
| | | |
| | | @Override |
| | | public void invoke(ComMngRealCompanyExcelVO comMngRealCompanyExcelVO, AnalysisContext analysisContext) { |
| | | list.add(comMngRealCompanyExcelVO); |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if(list.size() >= BATCH_COUNT){ |
| | | log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | R r = this.communityService.listSaveMngRealCompanyExcelVO(list,this.communityId); |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | list.clear(); //清空list |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | R r = this.communityService.listSaveMngRealCompanyExcelVO(list,this.communityId);//确保最后遗留的数据保存在数据库中 |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description: 实有单位导出请求参数 |
| | | * @author: Null |
| | | * @date: 2021/3/11 10:36 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有单位导出请求参数") |
| | | public class ExportRealCompanyExcelDTO { |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String comName; |
| | | |
| | | @ApiModelProperty(value = "法人") |
| | | private String legalPerson; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description: 实有单位列表请求参数 |
| | | * @author: Null |
| | | * @date: 2021/3/11 10:36 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有单位列表请求参数") |
| | | public class PageComMngRealCompanyDTO { |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String comName; |
| | | |
| | | @ApiModelProperty(value = "法人") |
| | | private String legalPerson; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("小区Id") |
| | | private String areaId; |
| | | @ApiModelProperty("小区名称") |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @description: 实有单位 |
| | | * @author: Null |
| | | * @date: 2021/3/19 12:02 |
| | | */ |
| | | @Data |
| | | public class ComMngRealCompanyExcelVO implements Serializable { |
| | | |
| | | |
| | | @ExcelProperty(value = "单位名称" ,index = 0) |
| | | private String comName; |
| | | |
| | | @ExcelProperty(value = "公司法人" ,index = 1) |
| | | private String legalPerson; |
| | | |
| | | @ExcelProperty(value = "负责人" ,index = 2) |
| | | private String leader; |
| | | |
| | | @ExcelProperty(value = "联系方式" ,index = 3) |
| | | private String contactsPhone; |
| | | |
| | | @ExcelProperty(value = "人员规模" ,index = 4) |
| | | private Integer scope; |
| | | |
| | | @ExcelProperty(value = "详细地址" ,index = 5) |
| | | private String address; |
| | | |
| | | @ExcelProperty(value = "统一社会信用代码" ,index = 6) |
| | | private String creditCode; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description: 实有单位 |
| | | * @author: Null |
| | | * @date: 2021/3/19 12:02 |
| | | */ |
| | | @Data |
| | | public class ComMngRealCompanyVO implements Serializable { |
| | | |
| | | @ApiModelProperty("主键") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "社区ID",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("单位名称") |
| | | private String comName; |
| | | |
| | | @ApiModelProperty("法人") |
| | | private String legalPerson; |
| | | |
| | | @ApiModelProperty("负责人") |
| | | private String leader; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String contactsPhone; |
| | | |
| | | @ApiModelProperty("人员规模") |
| | | private Integer scope; |
| | | |
| | | @ApiModelProperty("统一社会信用代码") |
| | | private String creditCode; |
| | | |
| | | @ApiModelProperty("省份行政区划代码") |
| | | private Integer provinceAdcode; |
| | | |
| | | @ApiModelProperty("城市行政区划代码") |
| | | private Integer cityAdcode; |
| | | |
| | | /**区县行政区划代码*/ |
| | | @ApiModelProperty("区县行政区划代码") |
| | | private Integer districtAdcode; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String address; |
| | | |
| | | /**创建时间*/ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | } |
| | |
| | | @PostMapping("/common/data/car/import") |
| | | R listSaveMngCarExcelVO(@RequestBody List<ComMngCarExcelVO> list,@RequestParam("communityId") Long communityId); |
| | | |
| | | |
| | | /** |
| | | * 社区后台实有单位管理列表 |
| | | * @param pageComMngRealCompanyDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/common/data/company/page") |
| | | R pageQueryComMngRealCompany(@RequestBody PageComMngRealCompanyDTO pageComMngRealCompanyDTO); |
| | | |
| | | /** |
| | | * 社区后台添加修改实有单位 |
| | | * @param comMngRealCompanyVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/common/data/company/save") |
| | | R saveComMngRealCompany(@RequestBody ComMngRealCompanyVO comMngRealCompanyVO); |
| | | |
| | | /** |
| | | * 社区后台删除实有单位 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/common/data/company/delete") |
| | | R deleteComMngRealCompany(@RequestParam(value = "id") Long id); |
| | | |
| | | /** |
| | | * 实有单位详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/common/data/company/save") |
| | | R detailComMngRealCompany(@RequestParam(value = "id") Long id); |
| | | |
| | | /** |
| | | * 批量导入实有单位 |
| | | * @param list 实有单位集合 |
| | | */ |
| | | @PostMapping("/common/data/company/import") |
| | | R listSaveMngRealCompanyExcelVO(@RequestBody List<ComMngRealCompanyExcelVO> list,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 实有单位导出 |
| | | * @param exportRealCompanyExcelDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/common/data/company/export") |
| | | R exportRealCompany(ExportRealCompanyExcelDTO exportRealCompanyExcelDTO); |
| | | } |
| | |
| | | @PostMapping("common/data/special/tags/save") |
| | | R saveSpecialInputUserTags(@RequestBody ComMngTagVO comMngTagVO); |
| | | |
| | | |
| | | } |
| | |
| | | import com.alibaba.excel.enums.CellExtraTypeEnum; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.jcraft.jsch.SftpException; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComCvtServeExcelListen; |
| | | import com.panzhihua.common.listen.ComMngCarExcelListen; |
| | | import com.panzhihua.common.model.dtos.community.ComMngCarSaveDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngCarDTO; |
| | | import com.panzhihua.common.model.dtos.user.ComMngUserTagDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.InputUserTagsDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.listen.ComMngRealCompanyExcelListen; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.user.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.ComMngTagVO; |
| | | import com.panzhihua.common.model.vos.user.CommunityUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @description: 社区管理基础数据库管理接口 |
| | |
| | | private String excelUrl; |
| | | @Value("${excel.carUrl}") |
| | | private String carUrl="http://panzhihua.nhys.cdnhxx.com/web/%e8%bd%a6%e8%be%86%e5%af%bc%e5%85%a5%e6%a8%a1%e6%9d%bf.xlsx"; |
| | | @Value("${excel.companyUrl}") |
| | | private String companyUrl="http://panzhihua.nhys.cdnhxx.com/web/%e5%ae%9e%e6%9c%89%e5%8d%95%e4%bd%8d%e5%af%bc%e5%85%a5%e6%a8%a1%e6%9d%bf.xlsx"; |
| | | |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | |
| | | return userService.inputUserDetail(id); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "居民管理 导出居民Excel" ) |
| | | @PostMapping("/user/export") |
| | | public R export(@RequestBody ExportUserDTO exportUserDTO){ |
| | | exportUserDTO.setCommunityId(this.getCommunityId()); |
| | | String url=excelUrl; |
| | | String uuid= UUID.randomUUID().toString().replace("-",""); |
| | | String name=uuid+".xlsx"; |
| | | String ftpUrl="/mnt/data/web/excel/"; |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r=userService.inputUserExport(exportUserDTO); |
| | | if (R.isOk(r)) { |
| | | List<EexcelUserDTO>eexcelUserDTOS= JSONArray.parseArray(JSONArray.toJSONString(r.getData()),EexcelUserDTO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName,password,host,port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl+name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator+name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream=null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, EexcelUserDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("模板").build(); |
| | | excelWriter.write(eexcelUserDTOS, writeSheet); |
| | | excelWriter.finish(); |
| | | File file=new File(fileName); |
| | | inputStream=new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】",absolutePath,delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url+name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | /** |
| | | * 设置居民标签 |
| | | * @param inputUserTagsDTO 标签信息 |
| | |
| | | comMngTagVO.setCommunityId(communityId); |
| | | return userService.saveSpecialInputUserTags(comMngTagVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询单位管理列表",response = ComMngRealCompanyVO.class) |
| | | @PostMapping("/company/page") |
| | | public R pageQueryComMngRealCompany(@RequestBody PageComMngRealCompanyDTO pageComMngRealCompanyDTO) { |
| | | return communityService.pageQueryComMngRealCompany(pageComMngRealCompanyDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加/修改实有单位") |
| | | @PostMapping("/company/save") |
| | | public R saveComMngRealCompany(@RequestBody ComMngRealCompanyVO comMngRealCompanyVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comMngRealCompanyVO.setCommunityId(communityId); |
| | | return communityService.saveComMngRealCompany(comMngRealCompanyVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区后台删除实有单位") |
| | | @DeleteMapping("/company/delete") |
| | | public R deleteComMngRealCompany(@RequestParam(value = "id") Long id) { |
| | | return communityService.deleteComMngRealCompany(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有单位详情",response = ComMngRealCompanyVO.class) |
| | | @GetMapping("/company/detail") |
| | | public R detailComMngRealCompany(@RequestParam(value = "id") Long id) { |
| | | return communityService.detailComMngRealCompany(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载模板-实有单位导入模板") |
| | | @GetMapping(value = "/company/download/template") |
| | | public R downloadRealCompanyTemplate(HttpServletResponse response) throws IOException, SftpException { |
| | | return R.ok(companyUrl); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导入实有单位信息") |
| | | @PostMapping(value = "/company/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R importRealCompany(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | String fileName = file.getOriginalFilename(); //获取文件名 |
| | | log.info("传入文件名字【{}】",fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | EasyExcel.read(inputStream, ComMngRealCompanyExcelVO.class, new ComMngRealCompanyExcelListen(communityService,this.getCommunityId())).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有单位Excel" ) |
| | | @PostMapping("/company/export") |
| | | public R exportRealCompany(@RequestBody ExportRealCompanyExcelDTO exportRealCompanyExcelDTO){ |
| | | exportRealCompanyExcelDTO.setCommunityId(this.getCommunityId()); |
| | | String url=excelUrl; |
| | | String uuid= UUID.randomUUID().toString().replace("-",""); |
| | | String name=uuid+".xlsx"; |
| | | String ftpUrl="/mnt/data/web/excel/"; |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r=communityService.exportRealCompany(exportRealCompanyExcelDTO); |
| | | if (R.isOk(r)) { |
| | | List<ComMngRealCompanyExcelVO>eexcelUserDTOS= JSONArray.parseArray(JSONArray.toJSONString(r.getData()),ComMngRealCompanyExcelVO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName,password,host,port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl+name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator+name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream=null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComMngRealCompanyExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("实有单位导出").build(); |
| | | excelWriter.write(eexcelUserDTOS, writeSheet); |
| | | excelWriter.finish(); |
| | | File file=new File(fileName); |
| | | inputStream=new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】",absolutePath,delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url+name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComMngCarAppletDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngCarSaveDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngCarDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComCvtServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyVO; |
| | | import com.panzhihua.service_community.service.ComMngCarService; |
| | | import com.panzhihua.service_community.service.ComMngRealCompanyService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Resource |
| | | private ComMngCarService comMngCarService; |
| | | |
| | | @Resource |
| | | private ComMngRealCompanyService comMngRealCompanyService; |
| | | |
| | | /** |
| | | * 小程序用户车辆登记 |
| | |
| | | return comMngCarService.userComMngCarList(userId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台车辆管理列表 |
| | | * @param pageComMngCarDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/car/page") |
| | | public R pageQueryComMngCar(@RequestBody PageComMngCarDTO pageComMngCarDTO) { |
| | | return comMngCarService.pageQueryComMngCar(pageComMngCarDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台添加修改车辆 |
| | | * @param comMngCarSaveDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/car/save") |
| | | public R saveComMngCar(@RequestBody ComMngCarSaveDTO comMngCarSaveDTO) { |
| | | return comMngCarService.saveComMngCar(comMngCarSaveDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台删除车辆 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/car/delete") |
| | | public R deleteComMngCar(@RequestParam(value = "id") Long id) { |
| | | return comMngCarService.deleteComMngCar(id); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台导入车辆 |
| | | * @param list 车辆列表 |
| | | * @param communityId 社区编号 |
| | | * @return |
| | | */ |
| | | @PostMapping("/car/import") |
| | | public R listSaveMngCarExcelVO(@RequestBody List<ComMngCarExcelVO> list, @RequestParam("communityId") Long communityId){ |
| | | return comMngCarService.listSaveMngCarExcelVO(list,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台实有单位管理列表 |
| | | * @param pageComMngRealCompanyDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/company/page") |
| | | public R pageQueryComMngRealCompany(@RequestBody PageComMngRealCompanyDTO pageComMngRealCompanyDTO) { |
| | | return comMngRealCompanyService.pageQueryComMngRealCompany(pageComMngRealCompanyDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台添加修改实有单位 |
| | | * @param comMngRealCompanyVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/company/save") |
| | | public R saveComMngRealCompany(@RequestBody ComMngRealCompanyVO comMngRealCompanyVO) { |
| | | return comMngRealCompanyService.saveComMngRealCompany(comMngRealCompanyVO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台删除实有单位 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/company/delete") |
| | | public R deleteComMngRealCompany(@RequestParam(value = "id") Long id) { |
| | | return comMngRealCompanyService.deleteComMngRealCompany(id); |
| | | } |
| | | |
| | | @GetMapping("/company/detail") |
| | | public R detailComMngRealCompany(@RequestParam(value = "id") Long id) { |
| | | return comMngRealCompanyService.detailComMngRealCompany(id); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台导入实有单位 |
| | | * @param list 车实有单位列表 |
| | | * @param communityId 社区编号 |
| | | * @return |
| | | */ |
| | | @PostMapping("/company/import") |
| | | public R listSaveMngRealCompanyExcelVO(@RequestBody List<ComMngRealCompanyExcelVO> list, @RequestParam("communityId") Long communityId){ |
| | | return comMngRealCompanyService.listSaveMngRealCompanyExcelVO(list,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 导出实有单位 |
| | | * @param exportRealCompanyExcelDTO 实有单位导出查询参数 |
| | | * @return |
| | | */ |
| | | @PostMapping("/company/export") |
| | | public R exportRealCompanyExcel(@RequestBody ExportRealCompanyExcelDTO exportRealCompanyExcelDTO ){ |
| | | return comMngRealCompanyService.exportRealCompanyExcel(exportRealCompanyExcelDTO); |
| | | } |
| | | } |
New file |
| | |
| | | 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.community.ExportRealCompanyExcelDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngRealCompanyDTO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngRealCompanyDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 实有单位 |
| | | * @author: Null |
| | | * @date: 2021/3/16 14:28 |
| | | */ |
| | | @Mapper |
| | | public interface ComMngRealCompanyDAO extends BaseMapper<ComMngRealCompanyDO> { |
| | | |
| | | @Select("<script> " + |
| | | " SELECT " + |
| | | " t.id, " + |
| | | " t.com_name AS comName, " + |
| | | " t.legal_person AS legalPerson, " + |
| | | " t.leader, " + |
| | | " t.contacts_phone AS contactsPhone, " + |
| | | " t.scope, " + |
| | | " t.credit_code AS creditCode, " + |
| | | " t.province_adcode AS provinceAdcode, " + |
| | | " t.city_adcode AS cityAdcode, " + |
| | | " t.district_adcode AS districtAdcode, " + |
| | | " t.address, " + |
| | | " t.create_at AS createAt " + |
| | | "FROM " + |
| | | " com_mng_real_company t " + |
| | | "<if test='pageComMngRealCompanyDTO.comName != null and pageComMngRealCompanyDTO.comName.trim() != ""'>" + |
| | | " and t.com_name LIKE concat( #{pageComMngCarDTO.comName}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='pageComMngRealCompanyDTO.communityId != null and pageComMngRealCompanyDTO.communityId != 0'>" + |
| | | " and t.community_id = #{pageComMngRealCompanyDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='pageComMngRealCompanyDTO.legalPerson != null and pageComMngRealCompanyDTO.legalPerson.trim() != ""'>" + |
| | | " and t.legal_person LIKE concat( #{pageComMngCarDTO.legalPerson}, '%' ) " + |
| | | " </if> " + |
| | | " order by t.create_at desc"+ |
| | | "</script>") |
| | | IPage<ComMngRealCompanyVO> pageQueryComMngRealCompany(Page page, @Param(value = "pageComMngRealCompanyDTO") PageComMngRealCompanyDTO pageComMngRealCompanyDTO); |
| | | |
| | | @Select("<script> " + |
| | | " SELECT " + |
| | | " t.com_name AS comName, " + |
| | | " t.legal_person AS legalPerson, " + |
| | | " t.leader, " + |
| | | " t.contacts_phone AS contactsPhone, " + |
| | | " t.scope, " + |
| | | " t.credit_code AS creditCode, " + |
| | | " t.address " + |
| | | "FROM " + |
| | | " com_mng_real_company t where 1=1 " + |
| | | "<if test='exportRealCompanyExcelDTO.comName != null and exportRealCompanyExcelDTO.comName.trim() != ""'>" + |
| | | " and t.com_name LIKE concat( #{exportRealCompanyExcelDTO.comName}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='exportRealCompanyExcelDTO.communityId != null and exportRealCompanyExcelDTO.communityId != 0'>" + |
| | | " and t.community_id = #{exportRealCompanyExcelDTO.communityId} " + |
| | | " </if> " + |
| | | "<if test='exportRealCompanyExcelDTO.legalPerson != null and exportRealCompanyExcelDTO.legalPerson.trim() != ""'>" + |
| | | " and t.legal_person LIKE concat( #{exportRealCompanyExcelDTO.legalPerson}, '%' ) " + |
| | | " </if> " + |
| | | " order by t.create_at desc"+ |
| | | "</script>") |
| | | List<ComMngRealCompanyExcelVO> exportRealCompanyExcel(@Param(value = "exportRealCompanyExcelDTO") ExportRealCompanyExcelDTO exportRealCompanyExcelDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description: 实有单位 |
| | | * @author: Null |
| | | * @date: 2021/3/19 11:32 |
| | | */ |
| | | @Data |
| | | @TableName(value = "com_mng_real_company") |
| | | public class ComMngRealCompanyDO { |
| | | |
| | | /**主键*/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /**社区ID*/ |
| | | private Long communityId; |
| | | |
| | | /**单位名称*/ |
| | | private String comName; |
| | | |
| | | /**法人*/ |
| | | private String legalPerson; |
| | | |
| | | /**负责人*/ |
| | | private String leader; |
| | | |
| | | /**联系方式*/ |
| | | private String contactsPhone; |
| | | |
| | | /**人员规模*/ |
| | | private Integer scope; |
| | | |
| | | /**统一社会信用代码*/ |
| | | private String creditCode; |
| | | |
| | | /**省份行政区划代码*/ |
| | | private Integer provinceAdcode; |
| | | |
| | | /**城市行政区划代码*/ |
| | | private Integer cityAdcode; |
| | | |
| | | /**区县行政区划代码*/ |
| | | private Integer districtAdcode; |
| | | |
| | | /**详细地址*/ |
| | | private String address; |
| | | |
| | | /**创建时间*/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /**创建人*/ |
| | | private Long createBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ExportRealCompanyExcelDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngRealCompanyDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ComMngRealCompanyService { |
| | | |
| | | /** |
| | | * 社区后台实有单位管理列表 |
| | | * @param pageComMngRealCompanyDTO |
| | | * @return |
| | | */ |
| | | R pageQueryComMngRealCompany(PageComMngRealCompanyDTO pageComMngRealCompanyDTO); |
| | | |
| | | /** |
| | | * 社区后台添加修改实有单位 |
| | | * @param comMngRealCompanyVO |
| | | * @return |
| | | */ |
| | | R saveComMngRealCompany(ComMngRealCompanyVO comMngRealCompanyVO); |
| | | |
| | | /** |
| | | * 社区后台删除实有单位 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R deleteComMngRealCompany(Long id); |
| | | |
| | | /** |
| | | * 实有单位详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R detailComMngRealCompany(Long id); |
| | | |
| | | /** |
| | | * 导入实有单位 |
| | | * @param list |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R listSaveMngRealCompanyExcelVO(List<ComMngRealCompanyExcelVO> list, Long communityId); |
| | | |
| | | /** |
| | | * 导出实有单位 |
| | | * @param exportRealCompanyExcelDTO |
| | | * @return |
| | | */ |
| | | R exportRealCompanyExcel(ExportRealCompanyExcelDTO exportRealCompanyExcelDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.ExportRealCompanyExcelDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngRealCompanyDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyVO; |
| | | import com.panzhihua.service_community.dao.ComMngRealCompanyDAO; |
| | | import com.panzhihua.service_community.model.dos.ComMngRealCompanyDO; |
| | | import com.panzhihua.service_community.service.ComMngRealCompanyService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 实有单位 |
| | | * @author: Null |
| | | * @date: 2021/3/19 11:55 |
| | | */ |
| | | @Service |
| | | public class ComMngRealCompanyServiceImpl extends ServiceImpl<ComMngRealCompanyDAO, ComMngRealCompanyDO> implements ComMngRealCompanyService { |
| | | |
| | | @Resource |
| | | private ComMngRealCompanyDAO comMngRealCompanyDAO; |
| | | |
| | | @Override |
| | | public R pageQueryComMngRealCompany(PageComMngRealCompanyDTO pageComMngRealCompanyDTO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = pageComMngRealCompanyDTO.getPageNum(); |
| | | Long pageSize = pageComMngRealCompanyDTO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComMngRealCompanyVO> iPage = comMngRealCompanyDAO.pageQueryComMngRealCompany(page, pageComMngRealCompanyDTO); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | @Override |
| | | public R saveComMngRealCompany(ComMngRealCompanyVO comMngRealCompanyVO) { |
| | | if(null!=comMngRealCompanyVO.getId() && comMngRealCompanyVO.getId()!=0){ |
| | | //修改 |
| | | ComMngRealCompanyDO comMngRealCompanyDO = comMngRealCompanyDAO.selectById(comMngRealCompanyVO.getId()); |
| | | if(null==comMngRealCompanyDO){ |
| | | return R.fail("该单位不存在"); |
| | | } |
| | | ComMngRealCompanyDO checkCreditCode = comMngRealCompanyDAO.selectOne(new QueryWrapper<ComMngRealCompanyDO>().lambda().eq(ComMngRealCompanyDO::getCreditCode,comMngRealCompanyVO.getCreditCode())); |
| | | if(null!=checkCreditCode && comMngRealCompanyDO.getId()!=checkCreditCode.getId()){ |
| | | return R.fail("该单位已存在,信用代码重复"); |
| | | } |
| | | |
| | | BeanUtils.copyProperties(comMngRealCompanyVO,comMngRealCompanyDO); |
| | | int update = comMngRealCompanyDAO.updateById(comMngRealCompanyDO); |
| | | if(update>0){ |
| | | return R.ok(); |
| | | } |
| | | }else{ |
| | | //新增 |
| | | Integer count = comMngRealCompanyDAO.selectCount(new QueryWrapper<ComMngRealCompanyDO>().lambda().eq(ComMngRealCompanyDO::getCreditCode,comMngRealCompanyVO.getCreditCode())); |
| | | if(count>0){ |
| | | return R.fail("该单位已存在,信用代码重复"); |
| | | } |
| | | ComMngRealCompanyDO comMngRealCompanyDO = new ComMngRealCompanyDO(); |
| | | BeanUtils.copyProperties(comMngRealCompanyVO,comMngRealCompanyDO); |
| | | int insert = comMngRealCompanyDAO.insert(comMngRealCompanyDO); |
| | | if(insert>0){ |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteComMngRealCompany(Long id) { |
| | | ComMngRealCompanyDO comMngRealCompanyDO = comMngRealCompanyDAO.selectById(id); |
| | | if(null==comMngRealCompanyDO){ |
| | | return R.fail("该单位不存在"); |
| | | } |
| | | int delete = comMngRealCompanyDAO.deleteById(id); |
| | | if(delete>0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R detailComMngRealCompany(Long id) { |
| | | ComMngRealCompanyDO comMngRealCompanyDO = comMngRealCompanyDAO.selectById(id); |
| | | if(null==comMngRealCompanyDO){ |
| | | return R.fail("该单位不存在"); |
| | | } |
| | | ComMngRealCompanyVO comMngRealCompanyVO = new ComMngRealCompanyVO(); |
| | | BeanUtils.copyProperties(comMngRealCompanyDO,comMngRealCompanyVO); |
| | | return R.ok(comMngRealCompanyVO); |
| | | } |
| | | |
| | | @Override |
| | | public R listSaveMngRealCompanyExcelVO(List<ComMngRealCompanyExcelVO> list, Long communityId) { |
| | | StringBuffer message = new StringBuffer(); |
| | | List<ComMngRealCompanyDO> comMngRealCompanyDOS = new ArrayList<>(); |
| | | list.forEach(l->{ |
| | | Integer count = comMngRealCompanyDAO.selectCount(new QueryWrapper<ComMngRealCompanyDO>().lambda().eq(ComMngRealCompanyDO::getCreditCode,l.getCreditCode())); |
| | | if(count==0){ |
| | | ComMngRealCompanyDO comMngRealCompanyDO = new ComMngRealCompanyDO(); |
| | | BeanUtils.copyProperties(l,comMngRealCompanyDO); |
| | | comMngRealCompanyDO.setCommunityId(communityId); |
| | | comMngRealCompanyDOS.add(comMngRealCompanyDO); |
| | | } |
| | | }); |
| | | boolean batch = this.saveBatch(comMngRealCompanyDOS); |
| | | if(batch){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail("请检查数据是否重复,格合是否正确"); |
| | | } |
| | | |
| | | @Override |
| | | public R exportRealCompanyExcel(ExportRealCompanyExcelDTO exportRealCompanyExcelDTO) { |
| | | List<ComMngRealCompanyExcelVO> list = comMngRealCompanyDAO.exportRealCompanyExcel(exportRealCompanyExcelDTO); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/common/data/user/export") |
| | | public R inputUserExport(@RequestBody ExportUserDTO exportUserDTO){ |
| | | return sysUserInputService.export(exportUserDTO); |
| | | return sysUserInputService.exportInputUser(exportUserDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | |
| | | // "</script>") |
| | | @Select("select a.id,a.community_id from com_mng_struct_area a where a.area_name=#{areaName}") |
| | | ComMngStructAreaVO selectByAreaName(String areaName); |
| | | @Select("SELECT \n" + |
| | | "REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName,\n" + |
| | | "h.house_code\n" + |
| | | "FROM\n" + |
| | | "\tcom_mng_struct_area a \n" + |
| | | "\tjoin com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5\n" + |
| | | "WHERE\n" + |
| | | "\ta.area_name = #{areaName}") |
| | | @Select("SELECT " + |
| | | "REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName, " + |
| | | "h.house_code " + |
| | | "FROM " + |
| | | " com_mng_struct_area a " + |
| | | " join com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5 " + |
| | | "WHERE " + |
| | | " a.area_name = #{areaName}") |
| | | List<ComMngStructHouseVO> selectHouserByareaName(String areaName); |
| | | @Select("SELECT \n" + |
| | | "p.name,\n" + |
| | | "p.id,\n" + |
| | | "if(p.is_rent=1,'合租','家人')relationship,\n" + |
| | | "p.id_card,\n" + |
| | | "p.phone,\n" + |
| | | "year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age,\n" + |
| | | "p.create_at\n" + |
| | | "FROM\n" + |
| | | "\tsys_user_input p \n" + |
| | | "WHERE\n" + |
| | | "\tp.door_number = #{doorNumber} \n" + |
| | | "\tAND p.id !=#{userId}") |
| | | @Select("SELECT " + |
| | | "p.name, " + |
| | | "p.id, " + |
| | | "if(p.is_rent=1,'合租','家人')relationship, " + |
| | | "p.id_card, " + |
| | | "p.phone, " + |
| | | "year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age, " + |
| | | "p.create_at " + |
| | | "FROM " + |
| | | " sys_user_input p " + |
| | | "WHERE " + |
| | | " p.door_number = #{doorNumber} " + |
| | | " AND p.id !=#{userId}") |
| | | List<ComMngFamilyInfoVO> selectListFamily(@Param("doorNumber") String doorNumber, @Param("userId")Long userId); |
| | | |
| | | @Select("<script> " + |
| | |
| | | "<if test='pageInputUserDTO.phone != null and pageInputUserDTO.phone.trim() != ""'>" + |
| | | " and t.phone like concat(#{pageInputUserDTO.phone},'%') " + |
| | | " </if> " + |
| | | "<if test='pageInputUserDTO.areaId != null and pageInputUserDTO.areaId.trim() != ""'>" + |
| | | " and t.area_id = #{pageInputUserDTO.areaId} " + |
| | | "<if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName.trim() != ""'>" + |
| | | "AND t.`area_name` like concat(#{pageInputUserDTO.areaName},'%') " + |
| | | " </if> " + |
| | | "<if test='pageInputUserDTO.tags != null and pageInputUserDTO.tags.trim() != ""'>" + |
| | | " and t.tags like concat('%',#{pageInputUserDTO.tags},'%') " + |
| | |
| | | " group by t.id_card "+ |
| | | "</script>") |
| | | IPage<InputUserInfoVO> specialInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | "u.id 'order', " + |
| | | "u.door_number doorNumber, " + |
| | | "if(u.is_rent=1,'租住','自主')isRent, " + |
| | | "u.name, " + |
| | | "u.nation, " + |
| | | "case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, " + |
| | | "if(u.marital_status=1,'已婚','未婚')maritalStatus, " + |
| | | "u.phone, " + |
| | | "u.education, " + |
| | | "u.id_card, " + |
| | | "u.company, " + |
| | | "u.residence, " + |
| | | "if(u.is_panzhiHua=1,'是','否') isPanZhiHua, " + |
| | | "u.situation, " + |
| | | "if(is_contact=1,'是','否') isContact, " + |
| | | "if(u.major=1,'是','否') major, " + |
| | | "if(u.soldier=1,'是','否') soldier, " + |
| | | "if(u.disability=1,'是','否') disability, " + |
| | | "if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, " + |
| | | "if(u.lowIncome_people=1,'是','否') lowIncomePeople, " + |
| | | "if(u.old_people=1,'是','否') oldPeople, " + |
| | | "if(u.special_service_family=1,'是','否') specialServiceFamily, " + |
| | | "if(u.key_personnel=1,'是','否') keyPersonnel " + |
| | | "FROM " + |
| | | " sys_user_input u " + |
| | | " LEFT JOIN sys_user su on su.id_card=u.id_card"+ |
| | | "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" + |
| | | " JOIN com_mng_struct_area c ON u.area_id = c.id " + |
| | | " </if> " + |
| | | "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>" + |
| | | "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id " + |
| | | " </if> " + |
| | | "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" + |
| | | "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') " + |
| | | " </if> " + |
| | | " where u.community_id=#{exportUserDTO.communityId} " + |
| | | "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>" + |
| | | "AND u.phone like concat(#{exportUserDTO.phone},'%') " + |
| | | " </if> " + |
| | | "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>" + |
| | | " and u.`name` like concat(#{exportUserDTO.name},'%') " + |
| | | " </if> " + |
| | | "</script>") |
| | | List<EexcelUserDTO> selectExport(@Param("exportUserDTO") ExportUserDTO exportUserDTO); |
| | | } |
| | |
| | | "AND u.phone like concat(#{exportUserDTO.phone},'%') " + |
| | | " </if> " + |
| | | " group by u.user_id "+ |
| | | |
| | | "union all "+ |
| | | "SELECT \n" + |
| | | "u.id+100000000 'order',\n" + |
| | | "u.door_number doorNumber,\n" + |
| | | "if(u.is_rent=1,'租住','自主')isRent,\n" + |
| | | "u.name,\n" + |
| | | "u.nation,\n" + |
| | | "case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook,\n" + |
| | | "if(u.marital_status=1,'已婚','未婚')maritalStatus,\n" + |
| | | "u.phone,\n" + |
| | | "u.education,\n" + |
| | | "u.id_card,\n" + |
| | | "u.company,\n" + |
| | | "u.residence,\n" + |
| | | "if(u.is_panzhiHua=1,'是','否') isPanZhiHua,\n" + |
| | | "u.situation,\n" + |
| | | "if(is_contact=1,'是','否') isContact,\n" + |
| | | "if(u.major=1,'是','否') major,\n" + |
| | | "if(u.soldier=1,'是','否') soldier,\n" + |
| | | "if(u.disability=1,'是','否') disability,\n" + |
| | | "if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds,\n" + |
| | | "if(u.lowIncome_people=1,'是','否') lowIncomePeople,\n" + |
| | | "if(u.old_people=1,'是','否') oldPeople,\n" + |
| | | "if(u.special_service_family=1,'是','否') specialServiceFamily,\n" + |
| | | "if(u.key_personnel=1,'是','否') keyPersonnel\n" + |
| | | "FROM\n" + |
| | | "\tsys_user_input u\n" + |
| | | "\tLEFT JOIN sys_user su on su.id_card=u.id_card"+ |
| | | "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" + |
| | | " JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | " </if> " + |
| | | "<if test='exportUserDTO.areaName == null or exportUserDTO.areaName.trim() == ""'>" + |
| | | "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | " </if> " + |
| | | "<if test='exportUserDTO.areaName != null and exportUserDTO.areaName.trim() != ""'>" + |
| | | "AND c.`area_name` like concat(#{exportUserDTO.areaName},'%') \n" + |
| | | " </if> " + |
| | | " where u.community_id=#{exportUserDTO.communityId} " + |
| | | "<if test='exportUserDTO.phone != null and exportUserDTO.phone.trim() != ""'>" + |
| | | "AND u.phone like concat(#{exportUserDTO.phone},'%') " + |
| | | " </if> " + |
| | | "<if test='exportUserDTO.name != null and exportUserDTO.name.trim() != ""'>" + |
| | | " and u.`name` like concat(#{exportUserDTO.name},'%') \n" + |
| | | " </if> " + |
| | | "</script>") |
| | | List<EexcelUserDTO> selectExport(@Param("exportUserDTO") ExportUserDTO exportUserDTO); |
| | | |
| | |
| | | * @param exportUserDTO |
| | | * @return |
| | | */ |
| | | R export(ExportUserDTO exportUserDTO); |
| | | R exportInputUser(ExportUserDTO exportUserDTO); |
| | | |
| | | /** |
| | | * 居民详情 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R export(ExportUserDTO exportUserDTO) { |
| | | return null; |
| | | public R exportInputUser(ExportUserDTO exportUserDTO) { |
| | | List<EexcelUserDTO> eexcelUserDTOS=sysUserInputDAO.selectExport(exportUserDTO); |
| | | return R.ok(eexcelUserDTOS); |
| | | } |
| | | |
| | | |