springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -3733,6 +3733,6 @@ * @param comSwPatrolRecordDTO 查询参数 * @return 分页集合 */ @PostMapping("/patrolRecor/page") @PostMapping("/patrolRecord/page") R pagePatrolRecord(@RequestBody ComSwPatrolRecordDTO comSwPatrolRecordDTO); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommonDataApi.java
@@ -119,6 +119,67 @@ @ApiOperation(value = "下载模板-车辆管理") @GetMapping(value = "/car/download/template") public R downloadTemplate(HttpServletResponse response) throws IOException, SftpException { // //获取登陆用户绑定社区id // Long communityId = 2L;//this.getCommunityId(); // //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 // String ftpUrl = "/mnt/data/web/excel/"; // String name = "车辆导入模板.xlsx"; // try { // SFTPUtil sftp = new SFTPUtil(userName, password, host, port); // sftp.login(); // boolean existDir = sftp.isExistDir(ftpUrl + name); // if (!existDir) { // String property = System.getProperty("car.dir"); // String fileName = property + File.separator + name; // // 这里 需要指定写用哪个class去写 // ExcelWriter excelWriter = null; // InputStream inputStream = null; // try { // List<List<String>> list = new ArrayList<>(); // List<String> head0 = new ArrayList<String>(); // head0.add("小区名称"); // List<String> head1 = new ArrayList<String>(); // head1.add("车主姓名"); // List<String> head2 = new ArrayList<String>(); // head2.add("身份证号码"); // List<String> head3 = new ArrayList<String>(); // head3.add("联系方式"); // List<String> head4 = new ArrayList<String>(); // head4.add("车牌号"); // List<String> head5 = new ArrayList<String>(); // head5.add("品牌型号"); // List<String> head6 = new ArrayList<String>(); // head6.add("车身颜色"); // list.add(head0); // list.add(head1); // list.add(head2); // list.add(head3); // list.add(head4); // list.add(head5); // list.add(head6); // // EasyExcel.write(fileName).head(list).sheet("车辆导入模板"); // 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(); // } // } // } // return R.ok(carUrl + "车辆导入模板.xlsx"); // } catch (Exception e) { // e.printStackTrace(); // log.error("文件传输失败【{}】", e.getMessage()); // return R.fail(); // } return R.ok(carUrl); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -225,9 +225,6 @@ "<if test='comMngPopulationVO.remark != null and comMngPopulationVO.remark != ""'>" + "AND cmp.remark = #{comMngPopulationVO.remark} " + " </if> " + "<if test='comMngPopulationVO.address != null and comMngPopulationVO.address != ""'>" + "AND cmp.address like concat('%', #{comMngPopulationVO.address}, '%') " + " </if> " + " </where>" + " order by cmp.create_at desc" + "</script>") springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSwPatrolRecordDAO.java
@@ -25,9 +25,9 @@ "cspr.id, " + "cspr.community_id AS communityId, " + "cspr.patrol_time AS patrolTime, " + "cspr.weather" + "cspr.temperature" + "cspr.wind" + "cspr.weather," + "cspr.temperature," + "cspr.wind," + "cspr.patrol_type AS patrolType, " + "cspr.patrol_person AS patrolPerson, " + "cspr.address, " + @@ -38,11 +38,11 @@ "cspr.succession_person AS successionPerson, " + "cspr.succession_time AS successionTime, " + "cspr.create_at AS createAt, " + "cspr.create_time AS createTime," + "csprr.report_id AS reportId" + "FROM " + "com_sw_patrol_record AS cspr" + "left join com_sw_patrol_record_report AS csprr on cspr.id = csprr.patrol_record_id" + "cspr.create_by AS createBy, " + "csprr.report_id AS reportId " + "FROM " + "com_sw_patrol_record as cspr " + "left join com_sw_patrol_record_report as csprr on csprr.patrol_record_id = cspr.id " + "<where>" + "<if test='comSwPatrolRecordDTO.communityId != null and comSwPatrolRecordDTO.communityId != ""'>" + "AND cspr.community_id = #{comSwPatrolRecordDTO.communityId} " + @@ -60,7 +60,7 @@ "AND cspr.patrol_time <![CDATA[ <= ]]> #{comSwPatrolRecordDTO.patrolTime} " + " </if> " + " </where>" + " order by create_at desc" + " order by cspr.create_at desc" + "</script>") IPage<ComSwPatrolRecordVO> pagePatrolRecord(Page page, @Param("comSwPatrolRecordDTO") ComSwPatrolRecordDTO comSwPatrolRecordDTO); }