From f72306be34e0f859b5ab08df32c4a41e4eaa92eb Mon Sep 17 00:00:00 2001 From: 刘小明 <liuxm_a@163.com> Date: 星期三, 16 十月 2024 11:30:46 +0800 Subject: [PATCH] 添加每天完成设备数量统计定时任务 --- pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 37 insertions(+), 15 deletions(-) diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java index c4f59a9..3228be2 100644 --- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java +++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java @@ -25,7 +25,6 @@ @Slf4j @RestController @RequestMapping(path="webFile") -@SuppressWarnings("unchecked")//java鐗堟湰瓒婇珮锛屽娉涘瀷绾︽潫瓒婁弗锛屾墍浠ラ厤缃甋uppressWarnings("unchecked" public class WebFileCtrl { @Autowired @@ -42,8 +41,8 @@ /** * 涓婁紶鐓х墖鍥剧墖鏂囦欢 锛堝綋鍓嶅彧瀵筽ng jpg鏍煎紡鍥剧墖鏀寔缂╃暐鍥撅級 - * @param file - * @return + * @param file web绔笂浼犳枃浠剁殑post瀵硅薄 + * @return 杩斿洖缁撴灉 */ @PostMapping("/upPhoto") @SsoPowerAop(power = "-1") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇� @@ -63,7 +62,13 @@ null); String fileMainName = fileOp.getFileMainName(frVo.fileName) ; Long id = this.saveFileInfo(fileNameGrp[0], fileNameGrp[1], fileMainName, frVo.fileNameHash, frVo.fileWebPath); - FileVo fvo = new FileVo(id, frVo.fileNameHash, fileNameGrp[0], fileNameGrp[1], (frVo.getFileWebUrl() + frVo.getFileWebPath()), fileOp.getImgFileZipPath(frVo.getFileWebUrl() + frVo.getFileWebPath()), frVo.fileSysRestUrl + frVo.fileWebDownloadPath + id) ; + FileVo fvo = new FileVo(id, + frVo.fileNameHash, + fileNameGrp[0], + fileNameGrp[1], + (frVo.getFileWebUrl() + frVo.getFileWebPath()), + fileOp.getImgFileZipPath(frVo.getFileWebUrl() + frVo.getFileWebPath()), + frVo.fileWebDownloadPath + id) ; return BaseResponseUtils.buildSuccess(fvo) ; }else { return BaseResponseUtils.buildError("鏈緱鍒颁笂浼犳枃浠剁殑鎵╁睍鍚�"); @@ -82,8 +87,8 @@ /** * 涓婁紶褰曢煶闊抽鏂囦欢 - * @param file - * @return + * @param file web绔笂浼犳枃浠剁殑post瀵硅薄 + * @return 杩斿洖缁撴灉 */ @PostMapping("/upPhone") @SsoPowerAop(power = "-1") @@ -102,7 +107,13 @@ null); String fileMainName = fileOp.getFileMainName(frVo.fileName) ; Long id = this.saveFileInfo(fileNameGrp[0], fileNameGrp[1], fileMainName, frVo.fileNameHash, frVo.fileWebPath); - FileVo fvo = new FileVo(id, frVo.fileNameHash, fileNameGrp[0], fileNameGrp[1],frVo.getFileWebUrl() + frVo.getFileWebPath(), null, frVo.fileSysRestUrl + frVo.fileWebDownloadPath + id) ; + FileVo fvo = new FileVo(id, + frVo.fileNameHash, + fileNameGrp[0], + fileNameGrp[1], + frVo.getFileWebUrl() + frVo.getFileWebPath(), + null, + frVo.fileWebDownloadPath + id) ; return BaseResponseUtils.buildSuccess(fvo) ; }else { return BaseResponseUtils.buildError("鏈緱鍒颁笂浼犳枃浠剁殑鎵╁睍鍚�"); @@ -122,8 +133,8 @@ /** * 涓婁紶褰曞儚瑙嗛鏂囦欢 - * @param file - * @return + * @param file web绔笂浼犳枃浠剁殑post瀵硅薄 + * @return 杩斿洖缁撴灉 */ @PostMapping("/upVideo") @SsoPowerAop(power = "-1") @@ -142,7 +153,13 @@ null); String fileMainName = fileOp.getFileMainName(frVo.fileName) ; Long id = this.saveFileInfo(fileNameGrp[0], fileNameGrp[1], fileMainName, frVo.fileNameHash, frVo.fileWebPath); - FileVo fvo = new FileVo(id, frVo.fileNameHash, fileNameGrp[0], fileNameGrp[1],frVo.getFileWebUrl() + frVo.getFileWebPath(), null, frVo.fileSysRestUrl + frVo.fileWebDownloadPath + id) ; + FileVo fvo = new FileVo(id, + frVo.fileNameHash, + fileNameGrp[0], + fileNameGrp[1], + frVo.getFileWebUrl() + frVo.getFileWebPath(), + null, + frVo.fileWebDownloadPath + id) ; return BaseResponseUtils.buildSuccess(fvo) ; }else { return BaseResponseUtils.buildError("鏈緱鍒颁笂浼犳枃浠剁殑鎵╁睍鍚�"); @@ -162,8 +179,8 @@ /** * 涓婁紶鏂囨。鏂囦欢 - * @param file - * @return + * @param file web绔笂浼犳枃浠剁殑post瀵硅薄 + * @return 杩斿洖缁撴灉 */ @PostMapping("/upDocument") @SsoPowerAop(power = "-1") @@ -175,7 +192,7 @@ if(!fileNameGrp[1].trim().equals("")){ String fileExtName = fileNameGrp[1]; if(!supportedFileTypes.contains(fileExtName)){ - return BaseResponseUtils.buildError("璇蜂笂浼燱ord,Excel,PowerPoint,PDF绫诲瀷鏂囨。"); + return BaseResponseUtils.buildError("璇蜂笂浼燱ord,Excel,PDF绫诲瀷鏂囨。"); } FileRestVo frVo = fileOp.saveFile(file, fmUrl, @@ -186,7 +203,12 @@ null); String fileMainName = fileOp.getFileMainName(frVo.fileName) ; Long id = this.saveFileInfo(fileNameGrp[0], fileNameGrp[1], fileMainName, frVo.fileNameHash, frVo.fileWebPath); - FileVo fvo = new FileVo(id, frVo.fileNameHash, fileNameGrp[0], fileNameGrp[1],frVo.getFileWebUrl() + frVo.getFileWebPath(), null, frVo.fileSysRestUrl + frVo.fileWebDownloadPath + id) ; + FileVo fvo = new FileVo(id, + frVo.fileNameHash, + fileNameGrp[0], fileNameGrp[1], + frVo.getFileWebUrl() + frVo.getFileWebPath(), + null, + frVo.fileWebDownloadPath + id) ; return BaseResponseUtils.buildSuccess(fvo) ; }else { return BaseResponseUtils.buildError("鏈緱鍒颁笂浼犳枃浠剁殑鎵╁睍鍚�"); @@ -211,7 +233,7 @@ * @param newName 鏂囦欢鏂板悕绉� * @param hash 鏂囦欢鏂板悕绉扮殑鍝堝笇鍊� * @param filePath 鏂囦欢鏈嶅姟绔瓨鍌ㄧ浉瀵硅矾寰� - * @return + * @return 鏁版嵁璁板綍涓婚敭 */ private Long saveFileInfo(String orgName, String extName, String newName, Integer hash, String filePath){ OthFile po = new OthFile() ; -- Gitblit v1.8.0