huanghongfa
2021-01-15 32c13616300f182704a4844fddb8ff7901d51678
定时任务修改
7个文件已修改
133 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/SFTPUtil.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/SFTPUtil.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/PartyBuildingJobHandler.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/UserJobHandler.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml
@@ -24,9 +24,10 @@
  <component name="ChangeListManager">
    <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment="">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActivityVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActivityVO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/utlis/SFTPUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/utlis/SFTPUtil.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/utlis/SFTPUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/utlis/SFTPUtil.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -400,7 +401,7 @@
      <workItem from="1610326930387" duration="5497000" />
      <workItem from="1610368400707" duration="771000" />
      <workItem from="1610415637750" duration="6485000" />
      <workItem from="1610499071420" duration="42826000" />
      <workItem from="1610499071420" duration="47467000" />
    </task>
    <servers />
  </component>
@@ -452,54 +453,54 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1610606590056" />
    <state width="1031" height="544" key="GridCell.Tab.0.bottom" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.0.bottom" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.0.center" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.0.center" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.0.left" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.0.left" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.0.right" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.0.right" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.1.bottom" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.1.bottom" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.1.center" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.1.center" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.1.left" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.1.left" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.1.right" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.1.right" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.2.bottom" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.2.bottom" timestamp="1610676501912">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.2.center" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610676501912" />
    <state width="1031" height="544" key="GridCell.Tab.2.center" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.2.left" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.2.left" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.2.right" timestamp="1610674699795">
    <state width="1031" height="544" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state width="1031" height="544" key="GridCell.Tab.2.right" timestamp="1610676501911">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="544" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1610674699795" />
    <state width="1031" height="544" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1610676501911" />
    <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1610611848124">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/SFTPUtil.java
@@ -266,6 +266,26 @@
    }
    /**
     * 下载文件
     *
     * @param directory    下载目录
     * @param downloadFile 下载的文件名
     * @return 字节数组
     * @throws SftpException
     * @throws IOException
     * @throws Exception
     */
    public InputStream downloadInputStream(String directory, String downloadFile) throws SftpException, IOException {
        if (directory != null && !"".equals(directory)) {
            sftp.cd(directory);
        }
        InputStream is = sftp.get(downloadFile);
//        byte[] fileData = IOUtils.toByteArray(is);
//        log.info("file:{} is download successful", downloadFile);
        return is;
    }
    /**
     * 删除文件
     *
     * @param directory  要删除文件所在目录
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/SFTPUtil.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java
@@ -20,6 +20,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -93,23 +94,23 @@
    @ApiOperation(value = "下载模板-导入党员")
    @GetMapping(value = "downloadtemplate",headers="Accept=application/octet-stream")
    public ResponseEntity<byte[]> downloadTemplate() {
    public ResponseEntity<InputStreamResource> downloadTemplate(HttpServletResponse response, HttpServletRequest request) throws IOException, SftpException {
        SFTPUtil sftp = new SFTPUtil();
        sftp.login();
        try {
        InputStream inputStream = sftp.downloadInputStream(FtpConstants.FTPFILEPATH_MUBAN, UPLOAD_EXCEL);
        HttpHeaders headers = new HttpHeaders();
        headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
        headers.add("Content-Disposition", String.format("attachment; filename=\"%s\"", UPLOAD_EXCEL));
        headers.add("Pragma", "no-cache");
        headers.add("Expires", "0");
            byte[] download = sftp.download(FtpConstants.FTPFILEPATH_MUBAN, UPLOAD_EXCEL);
            ResponseEntity.BodyBuilder bodyBuilder = ResponseEntity.ok();
            bodyBuilder.contentType(MediaType.APPLICATION_OCTET_STREAM);
            String encodeFileName = URLEncoder.encode(UPLOAD_EXCEL, "UTF-8");
            bodyBuilder.header("Content-Disposition","attachment;filename="+encodeFileName);
            return bodyBuilder.body(download);
        return ResponseEntity
                .ok()
                .headers(headers)
//                .contentLength(file.contentLength())
                .contentType(MediaType.parseMediaType("application/msexcel"))
                .body(new InputStreamResource(inputStream));
        } catch (Exception e) {
            e.printStackTrace();
            log.error("下载模板失败【{}】",e.getMessage());
        }
        return null;
    }
    @ApiOperation(value = "上传照片")
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java
@@ -42,7 +42,8 @@
    public ReturnT<String> timedTaskDynIstoppingJobHandler(String param) throws Exception {
        log.info("定时任务刷新社区动态置顶状态");
        R r=communityService.timedTaskDynIstopping();
        return new ReturnT(r.getData().toString());
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
    /**
@@ -54,7 +55,8 @@
    public ReturnT<String> timedTaskDynStatusJobHandler(String param) throws Exception {
        log.info("定时任务刷新社区动态发布状态");
        R r=communityService.timedTaskDynStatus();
        return new ReturnT(r.getData().toString());
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
    /**
@@ -68,6 +70,7 @@
        R r=communityService.timedTaskActActivity();
        if (R.isOk(r)) {
            Object data = r.getData();
            if (!ObjectUtils.isEmpty(data)) {
            List<ComActActivityVO> comActActivityVOS= JSONArray.parseArray(JSONArray.toJSONString(data),ComActActivityVO.class);
            if (!ObjectUtils.isEmpty(comActActivityVOS)) {
                comActActivityVOS.forEach(comActActivityVO -> {
@@ -95,7 +98,9 @@
                });
            }
        }
        return new ReturnT(r.getData().toString());
        }
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
    /**
@@ -107,6 +112,7 @@
    public ReturnT<String> timedTaskActActivityAllJobHandler(String param) throws Exception {
        log.info("定时任务刷新社区活动的各个状态 除取消外");
        R r=communityService.timedTaskActActivityAll();
        return new ReturnT(r.getData().toString().toString());
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
}
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/PartyBuildingJobHandler.java
@@ -41,7 +41,8 @@
    public ReturnT<String> timedtaskpartybuildingstatusJobHandler(String param) throws Exception {
        log.info("定时任务刷新党建动态发布状态");
        R r=partyBuildingService.timedTaskPartyBuildingStatus();
        return new ReturnT(r.getData().toString());
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
    /**
@@ -55,6 +56,7 @@
        R r=partyBuildingService.timedTaskPartyBuildingActivity();
        if (R.isOk(r)) {
            Object data = r.getData();
            if (!ObjectUtils.isEmpty(data)) {
            List<PartyBuildingActivityVO> partyBuildingActivityVOS= JSONArray.parseArray(JSONArray.toJSONString(data),PartyBuildingActivityVO.class);
            if (!ObjectUtils.isEmpty(partyBuildingActivityVOS)) {
                partyBuildingActivityVOS.forEach(partyBuildingActivityVO -> {
@@ -81,7 +83,10 @@
                });
            }
        }
        return new ReturnT(r.getData().toString());
            }
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
    /**
@@ -93,6 +98,7 @@
    public ReturnT<String> timedTaskPartyBuildingActivityAllJobHandler(String param) throws Exception {
        log.info("定时任务刷新党建活动的各个状态 除取消外");
        R r=partyBuildingService.timedTaskPartyBuildingActivityAll();
        return new ReturnT(r.getData().toString());
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
}
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/UserJobHandler.java
@@ -30,7 +30,8 @@
    public ReturnT<String> timedTaskContinuousLandingDaysJobHandler(String param) throws Exception {
        log.info("维护用户持续登录天数");
        R r=userService.timedTaskContinuousLandingDays();
        return new ReturnT(r.getData().toString());
        log.info("执行结果【{}】",r.toString());
        return ReturnT.SUCCESS;
    }
}