From 7cdc66043ad8c484b8eb4597e281a5d8d33e4794 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 25 八月 2023 16:41:12 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java | 6 ++
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java | 27 ++++++++++++-
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java | 60 +++++++++++++++--------------
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 6 ++
4 files changed, 66 insertions(+), 33 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
index b2ac01f..7fa790e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -83,8 +83,10 @@
String fileName = FileUploadUtils.upload(filePath, file);
String url1 = serverConfig.getUrl();
log.info("url1鐨勫�紀ld :{}", url1);
- //杩欓噷鐨�8032涓嶆槸tomcat鐨勶紝鎵�浠ヨ杞垚tomcat鐨�
- url1 = url1.replace("8032", "8099");
+ if (url1.contains("8032")) {
+ //杩欓噷鐨�8032涓嶆槸tomcat鐨勶紝鎵�浠ヨ杞垚tomcat鐨�
+ url1 = url1.replace("8032", "8099");
+ }
log.info("url1鐨勫�糿ew :{}", url1);
String url = url1 + fileName;
AjaxResult ajax = AjaxResult.success();
@@ -97,6 +99,27 @@
}
+// private static void parseUTF(int[] bits) {
+// int index = 0;//杩欎釜鎸囬拡鎸囧悜姣忎竴琛屽惊鐜椂鍒椾笅鏍囩殑浣嶇疆锛屼笅涓�琛屽紑濮嬫椂閲嶆柊缃綅0
+// int count = 0;
+// ;//杩欎釜鍙橀噺璁板綍姣忎釜UTF-8瀛楃鐨勫瓧鑺傛暟锛岃嚦灏�1瀛楄妭
+// for (int j = ; j < bits.length; ) {
+// //寰幆姣忎竴琛屾暟缁勬暟鎹�-浠庡ご鍘昏--鍏堣杩欎釜瀛楃鏄嚑涓瓧鑺傜粍鎴愮殑
+// // 鐒跺悗鎸塽tf-8鐨勭紪鐮佹牸寮忕粍鍚堝瓧绗︿覆锛岃浆鎹负瀛楃鍗冲彲
+// if (bits[j] == 1) {
+// count++;
+// index++;
+// } else {
+// index++;//杩欎竴浣嶆槸1鍚庨潰璺熺殑閭d竴涓猳
+// //涓嶄负1锛屽垯璇存槑宸茬粡瑙f瀽瀹屽瓧鑺傛暟锛宑ount閲岄潰瀛樼殑濡傛灉鏄疈琛ㄧず鏄崟瀛楄妭鏁版嵁
+// //濡傛灉涓嶆槸o鍒欒〃绀烘槸澶氬瓧鑺傛暟鎹�
+// String str = "";
+// }
+// }
+// }
+//
+//}
+
/**
* 鏈湴璧勬簮閫氱敤涓嬭浇
*/
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
index 288f118..7bf6d64 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
@@ -516,7 +516,11 @@
serviceFundflow.setFundtype(2);
serviceFundflow.setApplytype(serviceFund.getApplytype());
serviceFundflow.setFlowconclusion(CheckFlag);
- serviceFundflow.setFlowcontent(checkFundVO.getFlowcontent());
+ if (org.apache.commons.lang.StringUtils.isNotBlank(checkFundVO.getFlowcontent())) {
+ serviceFundflow.setFlowcontent(checkFundVO.getFlowcontent());
+ } else {
+ serviceFundflow.setFlowcontent(checkFundVO.getFlowconclusion() == 1 ? "閫氳繃" : "涓嶉�氳繃");
+ }
serviceFundflow.setFlowlevel(OriginalFlowLevel + 1);
serviceFundflowService.save(serviceFundflow);
serviceFundService.updateById(serviceFund);
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
index 22b64aa..ff1f92c 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -591,7 +591,11 @@
serviceFundflow.setFundtype(1);
serviceFundflow.setApplytype("0");
serviceFundflow.setFlowconclusion(CheckFlag);
- serviceFundflow.setFlowcontent(checkFundVO.getFlowcontent());
+ if (StringUtils.isNotBlank(checkFundVO.getFlowcontent())) {
+ serviceFundflow.setFlowcontent(checkFundVO.getFlowcontent());
+ } else {
+ serviceFundflow.setFlowcontent(checkFundVO.getFlowconclusion() == 1 ? "閫氳繃" : "涓嶉�氳繃");
+ }
serviceFundflow.setFlowlevel(OriginalFlowLevel + 1);
serviceFundflowService.save(serviceFundflow);
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
index 3af0d38..4857017 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
@@ -137,6 +137,7 @@
ServiceFundShared serviceFundShared = DtoConversionUtils.sourceToTarget(serviceFund, ServiceFundShared.class);
serviceFundShared.setSerfunid(serviceFundShared.getId());
serviceFundShared.setId(null);
+ log.info("鏁版嵁閮芥彃杩涘幓浜嗗悧锛� {}", serviceFundShared);
sharedService.save(serviceFundShared);
//fundId涓轰富琛ㄧ殑ID
@@ -774,40 +775,41 @@
String strFUrl = "http://129.88.242.39:8899/seeyon/rest/attachment?token=" + strRes;
List<RbDetailFile> parseArray2 = new ArrayList<>();
List<RbDetailFile> parseArray = JSON.parseArray(remShare.getAnnexfiles(), RbDetailFile.class);
- log.info("parseArray鐨勫�� : {}",parseArray);
- for (int i = 0; i < parseArray.size(); i++) {
- RbDetailFile rbDetailFile = parseArray.get(i);
- log.info("filePath鐨勪慨鏀�:{}", filePath);
- String url = rbDetailFile.getUrl();
- //file鐢ㄧ殑鏄粷瀵逛綅缃�
- String substring = url.substring(url.indexOf("/profile/upload") + "/profile/upload".length());
+ log.info("parseArray鐨勫�� : {}", parseArray);
+ if (!CollectionUtils.isEmpty(parseArray)) {
+ for (int i = 0; i < parseArray.size(); i++) {
+ RbDetailFile rbDetailFile = parseArray.get(i);
+ log.info("filePath鐨勪慨鏀�:{}", filePath);
+ String url = rbDetailFile.getUrl();
+ //file鐢ㄧ殑鏄粷瀵逛綅缃�
+ String substring = url.substring(url.indexOf("/profile/upload") + "/profile/upload".length());
// String strFile = rbDetailFile.getUrl().replace(filePath, "/profile/upload");
- System.out.println("fund鏈嶅姟鐨刦ilePath + substring: " + filePath + substring);
- File filetest = new File(filePath + substring);
+ System.out.println("fund鏈嶅姟鐨刦ilePath + substring: " + filePath + substring);
+ File filetest = new File(filePath + substring);
- try {
- String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl);
- log.info("绗笁鏂逛紶鍥炵殑鏁版嵁: {}", struploadResult);
- if (StringUtils.isEmpty(struploadResult)) {
- log.info("HttpClientKit.sendPostWithFile 璇锋眰涓虹┖浜� filetest:{}, strFUrl:{} ", filetest, strFUrl);
- return 0;
+ try {
+ String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl);
+ log.info("绗笁鏂逛紶鍥炵殑鏁版嵁: {}", struploadResult);
+ if (StringUtils.isEmpty(struploadResult)) {
+ log.info("HttpClientKit.sendPostWithFile 璇锋眰涓虹┖浜� filetest:{}, strFUrl:{} ", filetest, strFUrl);
+ return 0;
+ }
+ //鑾峰彇fileid
+ JSONObject jsonR = JSONObject.parseObject(struploadResult);
+ JSONArray jsonArr = jsonR.getJSONArray("atts");
+ log.info("绗笁鏂逛紶鍥炵殑鏁版嵁鑾峰彇鐨刟tts : {}", jsonArr);
+ for (int j = 0; j < jsonArr.size(); j++) {
+ JSONObject jsonRet = jsonArr.getJSONObject(j);
+ rbDetailFile.setFileid(jsonRet.get("fileUrl").toString());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
}
- //鑾峰彇fileid
- JSONObject jsonR = JSONObject.parseObject(struploadResult);
- JSONArray jsonArr = jsonR.getJSONArray("atts");
- log.info("绗笁鏂逛紶鍥炵殑鏁版嵁鑾峰彇鐨刟tts : {}", jsonArr);
- for (int j = 0; j < jsonArr.size(); j++) {
- JSONObject jsonRet = jsonArr.getJSONObject(j);
- rbDetailFile.setFileid(jsonRet.get("fileUrl").toString());
- }
- } catch (Exception e) {
- e.printStackTrace();
+ parseArray2.add(rbDetailFile);
}
- parseArray2.add(rbDetailFile);
+ remShare.setAnnexfiles(JSON.toJSONString(parseArray2));
+ log.info("ServiceReimbursementdetailShared 鏄惁鍔犱笂浜唂ileid : {}", remShare);
}
- remShare.setAnnexfiles(JSON.toJSONString(parseArray2));
- log.info("ServiceReimbursementdetailShared 鏄惁鍔犱笂浜唂ileid : {}", remShare);
-
return 0;
}
--
Gitblit v1.9.3