|
@@ -6,6 +6,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.SystemUtils;
|
|
|
+import org.springblade.common.constant.CommonConstant;
|
|
|
import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.oss.model.BladeFile;
|
|
@@ -16,6 +17,7 @@ import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.repair.util.ExcelInfoUtils;
|
|
|
import org.springblade.repair.util.FileUtils;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
+import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -318,12 +320,19 @@ public class CheckAndRepairController {
|
|
|
public void checkPrivateHtmlIsCopy(){
|
|
|
String sql="select p_key_id,project_id,html_url from m_wbs_tree_private where is_deleted=0 and html_url NOT LIKE '%privateUrlCopy%' AND type=2";
|
|
|
List<WbsTreePrivate> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
+ String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
|
|
|
+ String projectUrl="";
|
|
|
+ if(sys_isonline.equals("20")){
|
|
|
+ projectUrl="/home/www/wwwroot/Users/hongchuangyanfa/Desktop/privateUrlCopy";
|
|
|
+ }else {
|
|
|
+ projectUrl="/mnt/sdc/Users/hongchuangyanfa/Desktop/privateUrlCopy/";
|
|
|
+ }
|
|
|
for (WbsTreePrivate wbsTreePrivate : list) {
|
|
|
if(StringUtils.isNotEmpty(wbsTreePrivate.getHtmlUrl())){
|
|
|
String url=wbsTreePrivate.getHtmlUrl();
|
|
|
File html = new File(wbsTreePrivate.getHtmlUrl());
|
|
|
if(html.exists()){
|
|
|
- String project = "/mnt/sdc/Users/hongchuangyanfa/Desktop/privateUrlCopy/"+wbsTreePrivate.getProjectId()+"/";
|
|
|
+ String project = projectUrl+wbsTreePrivate.getProjectId()+"/";
|
|
|
File projectFile = new File(project);
|
|
|
if(!projectFile.exists()){
|
|
|
projectFile.mkdir();
|
|
@@ -359,7 +368,7 @@ public class CheckAndRepairController {
|
|
|
* 检查private html文件是否存在
|
|
|
*/
|
|
|
@GetMapping("/checkPrivateHtmlIsExist")
|
|
|
- @Scheduled(cron = "0 0 12 * * ?")
|
|
|
+ @Scheduled(cron = "0 0 3 * * ?")
|
|
|
public void checkPrivateHtmlIsExist() throws Exception {
|
|
|
String sql="select p_key_id, excel_id,html_url from m_wbs_tree_private where html_url IS NOT NULL and is_deleted=0";
|
|
|
List<WbsTreePrivate> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|