|
|
@@ -1,18 +1,13 @@
|
|
|
package com.malk.ruisi.controller;
|
|
|
|
|
|
-
|
|
|
-import cn.hutool.core.text.UnicodeUtil;
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
-import cn.hutool.crypto.SecureUtil;
|
|
|
-import cn.hutool.http.HttpRequest;
|
|
|
-import cn.hutool.http.HttpResponse;
|
|
|
-import cn.hutool.http.HttpUtil;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+import org.springframework.http.ContentDisposition;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-
|
|
|
-
|
|
|
import com.malk.ruisi.service.QysService;
|
|
|
+import com.malk.ruisi.service.RSService;
|
|
|
import com.malk.ruisi.service.RsQysService;
|
|
|
import com.malk.ruisi.service.impl.dingshiqiImpl;
|
|
|
import com.malk.server.aliwork.YDConf;
|
|
|
@@ -30,6 +25,7 @@ import com.malk.utils.UtilMap;
|
|
|
import com.malk.utils.UtilServlet;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.MDC;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.io.Resource;
|
|
|
import org.springframework.core.io.UrlResource;
|
|
|
@@ -37,19 +33,26 @@ import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.util.UriUtils;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
import java.net.MalformedURLException;
|
|
|
+import java.net.URLDecoder;
|
|
|
+import java.net.URLEncoder;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
|
import java.sql.Connection;
|
|
|
import java.sql.DriverManager;
|
|
|
import java.sql.ResultSet;
|
|
|
import java.sql.Statement;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.ZoneOffset;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.Instant;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
+import java.util.function.BiFunction;
|
|
|
|
|
|
@RestController
|
|
|
@Slf4j
|
|
|
@@ -58,6 +61,8 @@ public class QysHuiDaoController {
|
|
|
@Autowired
|
|
|
private RsQysService qysService;
|
|
|
@Autowired
|
|
|
+ private QysService QYSService;
|
|
|
+ @Autowired
|
|
|
private YDClient ydClient;
|
|
|
@Autowired
|
|
|
private YDConf ydConf;
|
|
|
@@ -65,38 +70,59 @@ public class QysHuiDaoController {
|
|
|
private DDConf ddConf;
|
|
|
@Autowired
|
|
|
private DDClient ddClient;
|
|
|
+
|
|
|
@PostMapping("/person")
|
|
|
//传入实例Id获取实例数据
|
|
|
public McR person(@RequestBody Map map) throws Exception {
|
|
|
log.info("param:{}", map);
|
|
|
- List<String> list = (List<String>) map.get("formInstanceId");
|
|
|
- List<String> result = new ArrayList<>();
|
|
|
- for (String s : list) {
|
|
|
- Map formData = (Map) ydClient.queryData(YDParam.builder().formInstId(s)
|
|
|
- .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
- .userId(ddConf.getOperator()).build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
+ List<String> formInstanceIds = (List<String>) map.get("formInstanceId");
|
|
|
+ Set<String> uniqueNames = new HashSet<>(); // 用于去重的姓名(可选)
|
|
|
+ Set<String> uniqueIds = new HashSet<>(); // 用于去重的ID(可选)
|
|
|
+ List<Map<String, String>> result = new ArrayList<>();
|
|
|
+
|
|
|
+ for (String formInstId : formInstanceIds) {
|
|
|
+ // 查询表单数据
|
|
|
+ Map formData = (Map) ydClient.queryData(
|
|
|
+ YDParam.builder()
|
|
|
+ .formInstId(formInstId)
|
|
|
+ .appType(ydConf.getAppType())
|
|
|
+ .systemToken(ydConf.getSystemToken())
|
|
|
+ .userId(ddConf.getOperator())
|
|
|
+ .build(),
|
|
|
+ YDConf.FORM_QUERY.retrieve_id
|
|
|
+ ).getFormData();
|
|
|
+
|
|
|
log.info("formData:{}", formData);
|
|
|
|
|
|
- List<String> aa2 = (List<String>) formData.get("employeeField_lwr509pq");
|
|
|
- System.out.println(aa2);
|
|
|
- //用for循环遍历一下aa2集合
|
|
|
- result.addAll(aa2);
|
|
|
- }
|
|
|
- Set<String> result1 = new HashSet<>(result);
|
|
|
- List<Map> r = new ArrayList<>();
|
|
|
- for (String s1 : result1) {
|
|
|
- Map<String, String> name1 = new HashMap<>();
|
|
|
- int start = s1.indexOf('(');
|
|
|
- int end = s1.indexOf(')');
|
|
|
- if (start != -1 && end != -1) {
|
|
|
- String name = s1.substring(0, start);
|
|
|
- String id = s1.substring(start + 1, end);
|
|
|
- name1.put("label", name);
|
|
|
- name1.put("value", id);
|
|
|
+ // 获取姓名列表和ID列表
|
|
|
+ List<String> names = (List<String>) formData.get("employeeField_lwr509pq");
|
|
|
+ List<String> ids = (List<String>) formData.get("employeeField_lwr509pq_id");
|
|
|
+
|
|
|
+ // 防止空指针
|
|
|
+ if (names == null) names = Collections.emptyList();
|
|
|
+ if (ids == null) ids = Collections.emptyList();
|
|
|
+
|
|
|
+ // 取最小长度,防止索引越界
|
|
|
+ int size = Math.min(names.size(), ids.size());
|
|
|
+ for (int i = 0; i < size; i++) {
|
|
|
+ String name = names.get(i);
|
|
|
+ String id = ids.get(i);
|
|
|
+
|
|
|
+ // 如果希望结果去重,可以用 name+id 作为唯一键
|
|
|
+ String key = name + "|" + id;
|
|
|
+ if (uniqueNames.contains(key)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ uniqueNames.add(key); // 用 name|id 去重
|
|
|
+
|
|
|
+ Map<String, String> item = new HashMap<>();
|
|
|
+ item.put("label", name);
|
|
|
+ item.put("value", id);
|
|
|
+ result.add(item);
|
|
|
}
|
|
|
- r.add(name1);
|
|
|
}
|
|
|
- return McR.success(r);
|
|
|
+
|
|
|
+ return McR.success(result);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -104,13 +130,15 @@ public class QysHuiDaoController {
|
|
|
private YDService ydService;
|
|
|
|
|
|
@PostMapping("/success")
|
|
|
- McR rsuccess(HttpServletRequest request){
|
|
|
- Map<String,?> data = UtilServlet.getParamMap(request);
|
|
|
- log.info("请假成功:{}",JSON.toJSONString(data));
|
|
|
+ McR rsuccess(HttpServletRequest request) {
|
|
|
+ Map<String, ?> data = UtilServlet.getParamMap(request);
|
|
|
+ log.info("请假成功:{}", JSON.toJSONString(data));
|
|
|
return McR.success();
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private DDClient_Contacts ddClient_contacts;
|
|
|
+
|
|
|
//获取用户邮箱信息
|
|
|
@GetMapping("/test22")
|
|
|
public McR test22() throws Exception {
|
|
|
@@ -122,48 +150,88 @@ public class QysHuiDaoController {
|
|
|
// String yzsyzid2 = userIds[0];
|
|
|
Map userInfoByMobile1 = ddClient_contacts.getUserInfoById(ddClient.getAccessToken(), userId);
|
|
|
org_email = String.valueOf(userInfoByMobile1.get("org_email"));
|
|
|
- log.info("userInfo:{},org_email:{}", userInfoByMobile1,org_email);
|
|
|
+ log.info("userInfo:{},org_email:{}", userInfoByMobile1, org_email);
|
|
|
ydClient.operateData(YDParam.builder()
|
|
|
.formInstId("aa6db5e6-e81b-4fcd-937b-ad78d8ce75cd")
|
|
|
- .updateFormDataJson(JSON.toJSONString(UtilMap.map("textField_m2sgwol5",org_email)))
|
|
|
+ .updateFormDataJson(JSON.toJSONString(UtilMap.map("textField_m2sgwol5", org_email)))
|
|
|
.build(), YDConf.FORM_OPERATION.update);
|
|
|
}
|
|
|
return McR.success(userId);
|
|
|
}
|
|
|
-//更新表单字段
|
|
|
+
|
|
|
+ //更新表单字段
|
|
|
@GetMapping("/test20")
|
|
|
McR test12() {
|
|
|
ydClient.operateData(YDParam.builder()
|
|
|
.formInstanceId("dbea313c-b8e7-4c68-bf3a-d0c1e19a5e24")
|
|
|
// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("associationFormField_lvz3j6lr",Arrays.asList(getAss("物理用印公司用印场景","FINST-5V766V61BVZKFD1C68KB14U69RMR3TXGWM4WL1XN1")))))
|
|
|
- .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_lutjqbz2","校长")))
|
|
|
- .useLatestVersion(true)
|
|
|
- .build(), YDConf.FORM_OPERATION.update);
|
|
|
+ .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_lutjqbz2", "校长")))
|
|
|
+ .useLatestVersion(true)
|
|
|
+ .build(), YDConf.FORM_OPERATION.update);
|
|
|
return McR.success();
|
|
|
}
|
|
|
+
|
|
|
//更新表单字段
|
|
|
@PostMapping("/test30")
|
|
|
McR test13(@RequestBody Map data) {
|
|
|
- String ins = String.valueOf(data.get("ins"));
|
|
|
-// String user = String.valueOf(data.get("user"));
|
|
|
+// MDC.put("MDC_KEY_PID","1065");
|
|
|
+ String ins = String.valueOf(data.get("ins"));
|
|
|
+ String employ = String.valueOf(data.get("employ"));
|
|
|
+ List id = (List) data.get("id");
|
|
|
+// Map list = (Map) ydClient.queryData(YDParam.builder()
|
|
|
+// .formInstId(ins)
|
|
|
+// .appType(ydConf.getAppType())
|
|
|
+// .systemToken(ydConf.getSystemToken())
|
|
|
+// .userId(ddConf.getOperator())
|
|
|
+// .build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
+// Map<String, Object> formData = (Map<String, Object>) list.get("formData");
|
|
|
+// List<Map> tableFieid = (List<Map>) formData.get("tableField_lrru2tnq");
|
|
|
+// if (tableFieid != null) {
|
|
|
+// for (Map<String, Object> tableItem : tableFieid) {
|
|
|
+//
|
|
|
+// String zq = (String) tableItem.get("textField_luh0k82j");
|
|
|
+// if ("kpzq".equals(zq)) {
|
|
|
+// String xjStr = (String) tableItem.get("numberField_lrru2to2");//开票金额保留两位小数
|
|
|
+//
|
|
|
+// tableItem.put("numberField_lrru2to2", "newXj");
|
|
|
+//// updateList.add(tableItem);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// formData.put("tableField_lrru2tnq", tableFieid);
|
|
|
+
|
|
|
|
|
|
ydClient.operateData(YDParam.builder()
|
|
|
|
|
|
.formInstanceId(ins)
|
|
|
-// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("associationFormField_lvz8coby",Arrays.asList(getAss("瑞思(天津)教育信息咨询有限公司-合同专用章","FINST-KMC66FA1UHCP0HJ49V7X1CY10O6V34R7WJ42MH11")))))
|
|
|
-// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("associationFormField_lvz8coby",Arrays.asList(getAss("北京领语堂瑞思教育科技有限公司通州临河里分公司-公章","FINST-KQ566AA1QJCPHQCO73QO8AS9JWT531Y4XJ42MRF")))))
|
|
|
-// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("numberField_lvz8cobc, numberField_lvz8cobz","2, 10")))
|
|
|
-// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_lvz8coc5, textField_lvz8coc6, textField_lvz8coc7","广州咪喵企业管理有限公司, 赵丽婷, 13450203857")))
|
|
|
-// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("departmentSelectField_lts8k71m",Arrays.asList("155243318"))))
|
|
|
- .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("employeeField_lwsvj15o",Arrays.asList("2312"))))
|
|
|
-// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("radioField_m1j8w12d, radioField_m1j8w12c","否, 否")))
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("associationFormField_lu0u6npd",Arrays.asList(getAss("石家庄市裕华区博烁培训学校有限公司-公章","FINST-BOD66V81LKCPBOE08B1HL57OBP802UM1WJ42M92")))))
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("associationFormField_lu0u6npd",Arrays.asList(getAss("石家庄市裕华区博烁培训学校有限公司-公章","FINST-BOD66V81LKCPBOE08B1HL57OBP802UM1WJ42M92"),getAss("石家庄市新华区卓烁培训学校有限公司-公章","FINST-N9866581ZHCPDDWUCBRWM78XFG0S3B14WJ42M0R"),
|
|
|
+// getAss("石家庄市桥西区德烁培训学校有限公司-公章","FINST-G7D667819JCPBN5D86V55BVQ3M733K93WJ42MA9"),getAss("石家庄市长安区金烁文化教育培训学校有限公司-公章","FINST-9H766091VJCPCFQ4ETKN3C1SM09A3D10WJ42MSJ")))))
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_ltwa0vk0, textField_ltwa0vk1, textField_ltwa0vk2","合肥慕昕文化传媒有限公司, 白玉京, 19056882895")))//ht01
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_lvz8coc7","15600296667")))//ht02对方企业联系方式
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_lvz8coc5, textField_lvz8coc6, textField_lvz8coc7","合肥慕昕文化传媒有限公司, 白玉京, 19056882895")))//ht02
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("attachmentField_ltsbweit",Arrays.asList(UtilMap.map("downloadUrl, name, previewUrl, url, ext",
|
|
|
+// "https://aservice.risechina.com/ruisi/qys/download/HT01-HTYY-202506270705/易维信-EVTrust- 博至(北京)文化科技有限公司域名:pipithink.com-SSL证书购买合同(2025.06.27).pdf",
|
|
|
+// "【易维信-EVTrust】- 博至(北京)文化科技有限公司[域名:pipithink.com] - SSL证书购买合同(2025.06.27).pdf",
|
|
|
+// "https://aservice.risechina.com/ruisi/qys/download/HT01-HTYY-202506270705/易维信-EVTrust- 博至(北京)文化科技有限公司域名:pipithink.com-SSL证书购买合同(2025.06.27).pdf",
|
|
|
+// "https://aservice.risechina.com/ruisi/qys/download/HT01-HTYY-202506270705/易维信-EVTrust- 博至(北京)文化科技有限公司域名:pipithink.com-SSL证书购买合同(2025.06.27).pdf",
|
|
|
+// "pdf")))))
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("attachmentField_ltsbweit", Arrays.asList(UtilMap.map("downloadUrl, name, previewUrl, url, ext", "", "", "", "", "")))))
|
|
|
+// .updateFormDataJson(JSON.toJSONString(formData))
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("employeeField_lwspracb",Arrays.asList("1006896","3282"))))//xz04
|
|
|
+ .updateFormDataJson(JSONObject.toJSONString(UtilMap.map(employ,id)))//xz04
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("employeeField_lwrrbl0i",Arrays.asList("1007332"))))//ht01
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("employeeField_lwrmgdil",Arrays.asList("966124498"))))
|
|
|
+// .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("textField_lvw4umfr, textField_m0dh8wmp","昆山博语艺术培训有限公司 -合同章, 3315241551458668845")))
|
|
|
.useLatestVersion(true)
|
|
|
.build(), YDConf.FORM_OPERATION.update);
|
|
|
return McR.success();
|
|
|
}
|
|
|
- private Object getAss(String title,String id){
|
|
|
- return UtilMap.map("appType, formUuid, formType, instanceId, title, subTitle","APP_VCTRP6227CC8368NDOID","FORM-7ACCB70D96FA4187BD2042243641E54CD6VH","receipt",id,title,"");
|
|
|
+
|
|
|
+ private Object getAss(String title, String id) {
|
|
|
+ return UtilMap.map("appType, formUuid, formType, instanceId, title, subTitle", "APP_VCTRP6227CC8368NDOID", "FORM-7ACCB70D96FA4187BD2042243641E54CD6VH", "receipt", id, title, "");
|
|
|
}
|
|
|
+
|
|
|
@GetMapping("/test31")
|
|
|
McR test31() throws Exception {
|
|
|
Map formData = (Map) ydClient.queryData(YDParam.builder().formInstId("435f2478-22b0-46bb-8a38-beeb1d5f3814")
|
|
|
@@ -171,45 +239,47 @@ public class QysHuiDaoController {
|
|
|
.build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
return McR.success(formData);
|
|
|
}
|
|
|
- @PostMapping("/test21")
|
|
|
- McR test21(@RequestBody Map data) {
|
|
|
+
|
|
|
+ @PostMapping("/test21")
|
|
|
+ McR test21(@RequestBody Map data) {
|
|
|
// String formInstanceId = "3d1368b1-1d8a-49c7-8cf1-6b3d555105c6";//请假表单实例ID
|
|
|
// String userId = "1004909";
|
|
|
- String formInstanceId = String.valueOf(data.get("formInstanceId"));
|
|
|
- String userId = String.valueOf(data.get("userId"));
|
|
|
- Map formData = (Map) ydClient.queryData(YDParam.builder().formInstId(formInstanceId)
|
|
|
- .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
- .build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
- List employeeField_lts1mg30_id = (List) formData.get("employeeField_lts1mg30_id");
|
|
|
- List departmentSelectField_lts1mg2z_id = (List) formData.get("departmentSelectField_lts1mg2z_id");
|
|
|
- List departmentSelectField_lys0k6qb_id = (List) formData.get("departmentSelectField_lys0k6qb_id");
|
|
|
- //
|
|
|
- System.out.println("=="+employeeField_lts1mg30_id);
|
|
|
- formData.put("employeeField_lts1mg30", employeeField_lts1mg30_id);
|
|
|
- formData.put("departmentSelectField_lts1mg2z", departmentSelectField_lts1mg2z_id);
|
|
|
- formData.put("departmentSelectField_lys0k6qb", departmentSelectField_lys0k6qb_id);
|
|
|
-
|
|
|
- System.out.println(formData);
|
|
|
- ydClient.operateData(YDParam.builder()
|
|
|
- .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
- .formUuid("FORM-A02F7EA3AD6548E59B8E1692AD729C77C5LD")
|
|
|
- .userId(userId)
|
|
|
- .formDataJson(JSON.toJSONString(formData))
|
|
|
- .build(), YDConf.FORM_OPERATION.start).toString();////
|
|
|
- return McR.success(formData);
|
|
|
- }
|
|
|
+ String formInstanceId = String.valueOf(data.get("formInstanceId"));
|
|
|
+ String userId = String.valueOf(data.get("userId"));
|
|
|
+ Map formData = (Map) ydClient.queryData(YDParam.builder().formInstId(formInstanceId)
|
|
|
+ .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
+ .build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
+ List employeeField_lts1mg30_id = (List) formData.get("employeeField_lts1mg30_id");
|
|
|
+ List departmentSelectField_lts1mg2z_id = (List) formData.get("departmentSelectField_lts1mg2z_id");
|
|
|
+ List departmentSelectField_lys0k6qb_id = (List) formData.get("departmentSelectField_lys0k6qb_id");
|
|
|
+ //
|
|
|
+ System.out.println("==" + employeeField_lts1mg30_id);
|
|
|
+ formData.put("employeeField_lts1mg30", employeeField_lts1mg30_id);
|
|
|
+ formData.put("departmentSelectField_lts1mg2z", departmentSelectField_lts1mg2z_id);
|
|
|
+ formData.put("departmentSelectField_lys0k6qb", departmentSelectField_lys0k6qb_id);
|
|
|
+
|
|
|
+ System.out.println(formData);
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
+ .formUuid("FORM-A02F7EA3AD6548E59B8E1692AD729C77C5LD")
|
|
|
+ .userId(userId)
|
|
|
+ .formDataJson(JSON.toJSONString(formData))
|
|
|
+ .build(), YDConf.FORM_OPERATION.start).toString();////
|
|
|
+ return McR.success(formData);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/test22")
|
|
|
- McR test22(@RequestBody Map data ) {
|
|
|
+ McR test22(@RequestBody Map data) {
|
|
|
// String formInstanceId = "d738e145-e0ca-4b1e-87c8-d278330041b7";//离职单
|
|
|
// String userId = "1007210";
|
|
|
- String formInstanceId = String.valueOf(data.get("formInstanceId"));
|
|
|
- String userId = String.valueOf(data.get("userId"));
|
|
|
+ String formInstanceId = String.valueOf(data.get("formInstanceId"));
|
|
|
+ String userId = String.valueOf(data.get("userId"));
|
|
|
Map formData = (Map) ydClient.queryData(YDParam.builder().formInstId(formInstanceId)
|
|
|
.appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
.build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
- List employeeField_lts8k71n_id = (List) formData.get("employeeField_lts8k71n_id");
|
|
|
- List departmentSelectField_lts8k71m_id = (List) formData.get("departmentSelectField_lts8k71m_id");
|
|
|
- List departmentSelectField_lx9uj3ds_id = (List) formData.get("departmentSelectField_lx9uj3ds_id");
|
|
|
+ List employeeField_lts8k71n_id = (List) formData.get("employeeField_lts8k71n_id");
|
|
|
+ List departmentSelectField_lts8k71m_id = (List) formData.get("departmentSelectField_lts8k71m_id");
|
|
|
+ List departmentSelectField_lx9uj3ds_id = (List) formData.get("departmentSelectField_lx9uj3ds_id");
|
|
|
// List employeeField_lwt3bde4_id = (List) formData.get("employeeField_lwt3bde4_id");
|
|
|
// System.out.println("=="+employeeField_lts1mg30_id);
|
|
|
formData.put("employeeField_lts8k71n", employeeField_lts8k71n_id);
|
|
|
@@ -225,6 +295,7 @@ public class QysHuiDaoController {
|
|
|
.build(), YDConf.FORM_OPERATION.start).toString();////
|
|
|
return McR.success(formData);
|
|
|
}
|
|
|
+
|
|
|
@GetMapping("/test25")
|
|
|
McR test25() {
|
|
|
String formInstanceId = "eb7b7950-5884-415a-91cd-ceb4b9a3d762";//it07
|
|
|
@@ -232,9 +303,9 @@ public class QysHuiDaoController {
|
|
|
Map formData = (Map) ydClient.queryData(YDParam.builder().formInstId(formInstanceId)
|
|
|
.appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
.build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
- List employeeField_lts8k71n_id = (List) formData.get("employeeField_lu7zrcj3_id");
|
|
|
- List departmentSelectField_lts8k71m_id = (List) formData.get("departmentSelectField_lu7zrcj4_id");
|
|
|
- List departmentSelectField_lx9uj3ds_id = (List) formData.get("departmentSelectField_lyr15lez_id");
|
|
|
+ List employeeField_lts8k71n_id = (List) formData.get("employeeField_lu7zrcj3_id");
|
|
|
+ List departmentSelectField_lts8k71m_id = (List) formData.get("departmentSelectField_lu7zrcj4_id");
|
|
|
+ List departmentSelectField_lx9uj3ds_id = (List) formData.get("departmentSelectField_lyr15lez_id");
|
|
|
// List employeeField_lwt3bde4_id = (List) formData.get("employeeField_lwt3bde4_id");
|
|
|
// System.out.println("=="+employeeField_lts1mg30_id);
|
|
|
formData.put("employeeField_lu7zrcj3", employeeField_lts8k71n_id);
|
|
|
@@ -250,18 +321,20 @@ public class QysHuiDaoController {
|
|
|
.build(), YDConf.FORM_OPERATION.start).toString();////
|
|
|
return McR.success(formData);
|
|
|
}
|
|
|
- @PostMapping("/test23")//离职单
|
|
|
+
|
|
|
+ @PostMapping("/test23")
|
|
|
+//离职单
|
|
|
McR test23(@RequestBody Map data) {
|
|
|
- String formInstanceId = String.valueOf(data.get("formInstanceId"));
|
|
|
- String userId = String.valueOf(data.get("userId"));
|
|
|
+ String formInstanceId = String.valueOf(data.get("formInstanceId"));
|
|
|
+ String userId = String.valueOf(data.get("userId"));
|
|
|
// String formInstanceId = "1c934e55-cd5d-42e7-94b3-2a90cdb8c827";
|
|
|
// String userId = "1007443";
|
|
|
Map formData = (Map) ydClient.queryData(YDParam.builder().formInstId(formInstanceId)
|
|
|
.appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
.build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
- List employeeField_lu7zrcj3_id = (List) formData.get("employeeField_lts3bfjz_id");
|
|
|
+ List employeeField_lu7zrcj3_id = (List) formData.get("employeeField_lts3bfjz_id");
|
|
|
// List departmentSelectField_lts1mg2z_id = (List) formData.get("departmentSelectField_lts1mg2z_id");
|
|
|
- List departmentSelectField_lu7zrcj4_id = (List) formData.get("departmentSelectField_lts3bfjq_id");
|
|
|
+ List departmentSelectField_lu7zrcj4_id = (List) formData.get("departmentSelectField_lts3bfjq_id");
|
|
|
//
|
|
|
// System.out.println("=="+employeeField_lts1mg30_id);
|
|
|
formData.put("employeeField_lts3bfjz", employeeField_lu7zrcj3_id);
|
|
|
@@ -292,24 +365,26 @@ public class QysHuiDaoController {
|
|
|
|
|
|
return McR.success(formData);
|
|
|
}
|
|
|
+
|
|
|
//刷新页面为最新版本
|
|
|
@GetMapping("/test6")
|
|
|
public McR test6() throws Exception {
|
|
|
- List<Map> datalist = ydService.queryFormData_all(YDParam.builder()
|
|
|
- .formUuid("FORM-AFFBC2B18FCF4BAAADFEB5A6F6DBEAE14KAT")
|
|
|
- .build()
|
|
|
- );
|
|
|
- for (Map map : datalist) {
|
|
|
- ydClient.operateData(YDParam.builder()
|
|
|
- .useLatestVersion(true)
|
|
|
- .formInstanceId(UtilMap.getString(map, "formInstanceId"))
|
|
|
-// .formInstanceId("9aed08de-2867-4c41-a44c-c83a13b7f728")
|
|
|
- .updateFormDataJson(JSONObject.toJSONString(new HashMap<>()))
|
|
|
- .build(), YDConf.FORM_OPERATION.update);
|
|
|
- }
|
|
|
+// List<Map> datalist = ydService.queryFormData_all(YDParam.builder()
|
|
|
+// .formUuid("FORM-AFFBC2B18FCF4BAAADFEB5A6F6DBEAE14KAT")
|
|
|
+// .build()
|
|
|
+// );
|
|
|
+// for (Map map : datalist) {
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .useLatestVersion(true)
|
|
|
+// .formInstanceId(UtilMap.getString(map, "formInstanceId"))
|
|
|
+ .formInstanceId("6c13de82-66d2-40e6-b3ed-bf8aa8b9d9be")
|
|
|
+ .updateFormDataJson(JSONObject.toJSONString(new HashMap<>()))
|
|
|
+ .build(), YDConf.FORM_OPERATION.update);
|
|
|
+// }
|
|
|
return McR.success();
|
|
|
}
|
|
|
- @GetMapping("/test5" )
|
|
|
+
|
|
|
+ @GetMapping("/test5")
|
|
|
public String test5() throws Exception {
|
|
|
dingshiqiImpl dingshiqi = new dingshiqiImpl();
|
|
|
List<Map> datalist = (List<Map>) ydClient.queryData(YDParam.builder()
|
|
|
@@ -334,12 +409,12 @@ public class QysHuiDaoController {
|
|
|
JSONArray arr = obj.getJSONArray("result");
|
|
|
for (int i = 0; i < arr.size(); i++) {
|
|
|
JSONObject json = arr.getJSONObject(i);
|
|
|
- log.info("json:{},{}", json.getString("operatorUserId"),json.getString("type"));
|
|
|
+ log.info("json:{},{}", json.getString("operatorUserId"), json.getString("type"));
|
|
|
|
|
|
|
|
|
if (json.getString("operatorUserId").equals("13810479803") && json.getString("type").equals("TODO")) {
|
|
|
taskId = json.getString("taskId");
|
|
|
- taskExecute(String.valueOf(formData.get("textField_lzns5l3k")),taskId);
|
|
|
+ taskExecute(String.valueOf(formData.get("textField_lzns5l3k")), taskId);
|
|
|
flag = true;
|
|
|
break;
|
|
|
}
|
|
|
@@ -352,6 +427,7 @@ public class QysHuiDaoController {
|
|
|
}
|
|
|
return "success";
|
|
|
}
|
|
|
+
|
|
|
private Map<String, String> getFormUuid(String type) {
|
|
|
Map<String, String> map = UtilMap.empty();
|
|
|
switch (type) {
|
|
|
@@ -412,29 +488,42 @@ public class QysHuiDaoController {
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
- @GetMapping("/test1" )
|
|
|
+
|
|
|
+ @GetMapping("/test1")
|
|
|
public String test1() throws Exception {
|
|
|
-// List<Map> list = (List<Map>) ydClient.queryData(YDParam.builder().formUuid("FORM-5DB656AF0F0E4EFA85A4739D55C23ED85BXO")
|
|
|
+// List<Map> list = (List<Map>) ydClient.queryData(YDParam.builder().formUuid("FORM-55D56A69CCCE4043A01660C8910E33BAQ4N0")
|
|
|
// .searchFieldJson(JSONObject.toJSONString(UtilMap.map("serialNumberField_lvz8coae", "HT02-KJLHEYY-202407240029")))
|
|
|
// .build(), YDConf.FORM_QUERY.retrieve_list).getData();
|
|
|
// String type = "FORM-88F968E75CC340EB91B1AC692F4184DC9I9W";
|
|
|
- String sn = "HTSG-202408120010";
|
|
|
- String[] sns = sn.split("-");
|
|
|
- dingshiqiImpl dingshiqi = new dingshiqiImpl();
|
|
|
- Map<String, String> formUuid = getFormUuid(sns[0]);
|
|
|
- List<Map> list1 = (List<Map>) ydClient.queryData(YDParam.builder().formUuid(formUuid.get("type")).searchCondition(
|
|
|
- JSONObject.toJSONString(UtilMap.map(formUuid.get("sn"), sn))
|
|
|
+ String sn = "HT01-HTYY-202503140499";
|
|
|
+// String[] sns = sn.split("-");
|
|
|
+// dingshiqiImpl dingshiqi = new dingshiqiImpl();
|
|
|
+// Map<String, String> formUuid = getFormUuid(sns[0]);
|
|
|
+ List<Map> list1 = (List<Map>) ydClient.queryData(YDParam.builder().formUuid("FORM-55D56A69CCCE4043A01660C8910E33BAQ4N0").searchCondition(
|
|
|
+ JSONObject.toJSONString(UtilMap.map("serialNumberField_ltsbweh2", sn))
|
|
|
).build(), YDConf.FORM_QUERY.retrieve_list).getData();
|
|
|
Map map = list1.get(0);
|
|
|
- String instanceId = (String) map.get("formInstanceId");
|
|
|
- Map data = (Map) ydClient.queryData(YDParam.builder().formInstId(instanceId)
|
|
|
- .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
- .userId(ddConf.getOperator()).build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
- log.info("data:{}", data);
|
|
|
- log.info("list1:{}", list1);
|
|
|
- String categoryName = data.get(getCust(formUuid.get("type"), "categoryName")).toString();
|
|
|
-// String categoryName = list1.get("textField_lwa2350q");
|
|
|
- log.info("categoryName:{}", categoryName);
|
|
|
+ System.out.println(map);
|
|
|
+ List attachmentField_ltsbweit = (List) map.get("attachmentField_ltsbweit");
|
|
|
+ System.out.println(attachmentField_ltsbweit);
|
|
|
+// Map data = (Map) ydClient.queryData(YDParam.builder().formInstId("ee385bfd-195b-4258-aa8c-47852eeeddf3")
|
|
|
+// .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
+// .userId(ddConf.getOperator()).build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
+//// log.info("data:{}", data);
|
|
|
+// Object attachmentField_ltsbweit = data.get("attachmentField_ltsbweit");
|
|
|
+// System.out.println("===="+attachmentField_ltsbweit);
|
|
|
+// List list = new ArrayList();
|
|
|
+// for (int i = 0; i < 5; i++) {
|
|
|
+//
|
|
|
+// Map map1 = (Map) attachmentField_ltsbweit.get(i);
|
|
|
+// list.add(map1);
|
|
|
+// }
|
|
|
+// System.out.println("====="+list);
|
|
|
+
|
|
|
+// log.info("list1:{}", list1);
|
|
|
+// String categoryName = data.get(getCust(formUuid.get("type"), "categoryName")).toString();
|
|
|
+//// String categoryName = list1.get("textField_lwa2350q");
|
|
|
+// log.info("categoryName:{}", categoryName);
|
|
|
// if(type.equals("FORM-B27C1AE7298648F29E836B5FDF469DBDPFCK")){
|
|
|
// if(categoryName.equals("物理用印外带场景") || categoryName.equals("物理用印公司用印场景")){
|
|
|
// String jsonString = data.get(getCust(type, "fujian1")).toString();
|
|
|
@@ -491,8 +580,12 @@ public class QysHuiDaoController {
|
|
|
// System.out.println("qaq"+auths);
|
|
|
// System.out.println("qqqq"+subTitle);
|
|
|
// }
|
|
|
-return "success";
|
|
|
+ return "success";
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RSService rsService;
|
|
|
+
|
|
|
@GetMapping("/test32")
|
|
|
public McR test32() throws Exception {
|
|
|
// ArrayList<Object> objects = new ArrayList<>();
|
|
|
@@ -512,11 +605,137 @@ return "success";
|
|
|
// System.out.println("11"+result);
|
|
|
//
|
|
|
// }
|
|
|
- taskExecute("4a610fb3-dd7d-43fd-946d-36d65c82b563","44170522662");
|
|
|
+// taskExecute("4a610fb3-dd7d-43fd-946d-36d65c82b563","44170522662");
|
|
|
+ rsService.syncDingTalk_exclusive();
|
|
|
// Map userInfoById = ddClient_contacts.getUserInfoById(ddClient.getAccessToken(), "1006660");
|
|
|
// String org_email = String.valueOf(userInfoById.get("org_email"));
|
|
|
return McR.success();
|
|
|
}
|
|
|
+
|
|
|
+ private static final String
|
|
|
+ TEMPLATE_ID = "2758656747503223510",
|
|
|
+ FWGS = "fwgs",
|
|
|
+ FZF = "fzf",
|
|
|
+ DZ = "dz",
|
|
|
+ SXH = "sxh",
|
|
|
+ SYQY = "syqy",
|
|
|
+ CPX = "cpx",
|
|
|
+ DTJ = "dtj",
|
|
|
+ SSRQ = "ssrq",
|
|
|
+ BG_KJDXUA = "kcjdxua",
|
|
|
+ BG_ZKSS = "zkss",
|
|
|
+ BG_KSFYKS = "ksfyks",
|
|
|
+ BG_KSFY = "ksfy",
|
|
|
+ BG_SF = "sf",
|
|
|
+ BG_BYF = "byfprekkqjrbtxyn",
|
|
|
+ BG_ZJ = "zj";
|
|
|
+
|
|
|
+ //TODO
|
|
|
+ @GetMapping("/test67")
|
|
|
+ public McR test66() throws Exception {
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ data.put("templateId", "2758656747503223510");
|
|
|
+ data.put("title", "瑞思契约锁合同文档");
|
|
|
+ Map data1 = (Map) ydClient.queryData(YDParam.builder().formInstId("48516784-0e8e-45be-a8ec-36d46e709c83")
|
|
|
+ .appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
+ .userId(ddConf.getOperator()).build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
+ String fwgs = String.valueOf(data1.get("textField_mayy2yf8"));//发文公司
|
|
|
+ String fzf = String.valueOf(data1.get("textField_lxa4w5uh"));//发子方
|
|
|
+ String dz = String.valueOf(data1.get("textField_lxa4w5uc"));//代字
|
|
|
+ String sxh = String.valueOf(data1.get("textField_lxa4w5ud"));//红头文件编号
|
|
|
+ String syqy = String.valueOf(data1.get("textField_lxa4w5ub"));//适用区域
|
|
|
+ String cpx = String.valueOf(data1.get("textField_lxa4w5uf"));//产品线
|
|
|
+ String dtj = String.valueOf(data1.get("selectField_lxa4w5ue"));//定调价
|
|
|
+// long timestamp = (long) data.get("textField_mayy2yf8");
|
|
|
+ long timestamp = Long.parseLong("1747893049582");
|
|
|
+// 创建 SimpleDateFormat 对象来定义输出日期的格式
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+// 将时间戳转换为 Date 对象
|
|
|
+ Date date = new Date(timestamp);
|
|
|
+// 使用 SimpleDateFormat 格式化 Date 对象为所需的日期格式
|
|
|
+ String ssrq = sdf.format(date);//申请执行日期
|
|
|
+
|
|
|
+// System.out.println("fwgs:"+fwgs);
|
|
|
+// System.out.println("fzf :"+fzf );
|
|
|
+// System.out.println("dz :"+dz );
|
|
|
+// System.out.println("sxh :"+sxh );
|
|
|
+// System.out.println("syqy:"+syqy);
|
|
|
+// System.out.println("cpx :"+cpx );
|
|
|
+// System.out.println("dtj :"+dtj );
|
|
|
+// System.out.println("ssrq :"+ssrq );
|
|
|
+
|
|
|
+ List<Map> mapList = (List<Map>) data1.get("tableField_ltse8sqr");
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ if (mapList != null && mapList.size() > 0) {
|
|
|
+ List<Map> bg = new ArrayList<>();
|
|
|
+ for (int i = 0; i < mapList.size(); i++) {
|
|
|
+ Map map = mapList.get(i);
|
|
|
+ String kcjdxua = String.valueOf(map.get("textField_luhyit7r"));//课时阶段名称
|
|
|
+ String zkss = String.valueOf(map.get("numberField_ltse8sqv"));//总课时数
|
|
|
+ String ksfyks = String.valueOf(map.get("numberField_ltse8sqw"));//课时费单价
|
|
|
+ String ksfy = String.valueOf(map.get("numberField_ltse8sqx"));//课时费
|
|
|
+ String sf = String.valueOf(map.get("numberField_ltse8sqy"));//教辅书费
|
|
|
+ String byfprekkqjrbtxyn = String.valueOf(map.get("numberField_ltse8sqz"));//其他费用
|
|
|
+ String zj = String.valueOf(map.get("numberField_ltse8sr0"));//课时阶段名称
|
|
|
+ Map table1 = new HashMap<>();
|
|
|
+ table1.put("kcjdxua", kcjdxua);
|
|
|
+ table1.put("zkss", zkss);
|
|
|
+ table1.put("ksfyks", ksfyks);
|
|
|
+ table1.put("ksfy", ksfy);
|
|
|
+ table1.put("sf", sf);
|
|
|
+ table1.put("byfprekkqjrbtxyn", byfprekkqjrbtxyn);
|
|
|
+ table1.put("zj", zj);
|
|
|
+ bg.add(table1);
|
|
|
+ params.put("bg", JSONObject.toJSONString(bg));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ params.put("fwgs", "新公司名");
|
|
|
+ params.put("fzf", "zzz");
|
|
|
+ params.put("dz", "nb");
|
|
|
+ params.put("sxh", "qq");
|
|
|
+ params.put("syqy", "啊阿萨");
|
|
|
+ params.put("cpx", "自助");
|
|
|
+ params.put("dtj", "请求");
|
|
|
+ params.put("ssrq", "2024-01-01");
|
|
|
+
|
|
|
+
|
|
|
+// params1.add(bgMap);
|
|
|
+// params.add(bgParams);
|
|
|
+
|
|
|
+ data.put("params", JSONObject.toJSONString(params));
|
|
|
+// data.put("params", params);
|
|
|
+ JSONObject draft = QYSService.createbyMoban(data);
|
|
|
+
|
|
|
+ String documentId = null;
|
|
|
+ if (draft != null) {
|
|
|
+ documentId = draft.getString("documentId");
|
|
|
+ }
|
|
|
+ return McR.success(documentId);
|
|
|
+ }
|
|
|
+
|
|
|
+ private String formatTimestamp(long timestamp) {
|
|
|
+ try {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 修改为仅包含日期的格式
|
|
|
+ return sdf.format(new Date(timestamp));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return "无效日期";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 修改后的日期格式化方法(符合接口要求的yyyy-MM-dd格式)
|
|
|
+ private String formatDate(long timestamp) {
|
|
|
+ return new SimpleDateFormat("yyyy-MM-dd")
|
|
|
+ .format(new Date(timestamp));
|
|
|
+ }
|
|
|
+
|
|
|
+ private String toDate(long timestamp) {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ return sdf.format(new Date(timestamp));
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/test33")
|
|
|
public McR test33() throws Exception {
|
|
|
List<Map> dataList = ydService.queryFormData_all(YDParam.builder()
|
|
|
@@ -552,6 +771,7 @@ return "success";
|
|
|
System.out.println("111");
|
|
|
|
|
|
}
|
|
|
+
|
|
|
@GetMapping("/test2")
|
|
|
public String test2() throws Exception {
|
|
|
dingshiqiImpl dingshiqi = new dingshiqiImpl();
|
|
|
@@ -568,14 +788,14 @@ return "success";
|
|
|
Map param2 = new HashMap();
|
|
|
param2.put("x-acs-dingtalk-access-token", dingshiqi.getAccessToken_PJSS());
|
|
|
Map body3 = new HashMap();
|
|
|
- body3.put("appType","APP_VCTRP6227CC8368NDOID");
|
|
|
- body3.put("systemToken","5H9662C1X8XJLFFCE841M5VBEBQ73DM5IBPULPI3");
|
|
|
+ body3.put("appType", "APP_VCTRP6227CC8368NDOID");
|
|
|
+ body3.put("systemToken", "5H9662C1X8XJLFFCE841M5VBEBQ73DM5IBPULPI3");
|
|
|
body3.put("processInstanceId", instanceId);
|
|
|
- body3.put("userId","1006781");
|
|
|
- boolean flag=true;
|
|
|
+ body3.put("userId", "1006781");
|
|
|
+ boolean flag = true;
|
|
|
do {
|
|
|
String s = UtilHttp.doGet("https://api.dingtalk.com/v1.0/yida/processes/operationRecords", param2, (Map<String, Object>) body3);
|
|
|
- JSONObject obj=JSONObject.parseObject(s);
|
|
|
+ JSONObject obj = JSONObject.parseObject(s);
|
|
|
JSONArray arr = obj.getJSONArray("result");
|
|
|
System.out.println(arr);
|
|
|
flag = true;
|
|
|
@@ -595,10 +815,11 @@ return "success";
|
|
|
//
|
|
|
//// }
|
|
|
// }
|
|
|
- }while (flag);
|
|
|
+ } while (flag);
|
|
|
return "success";
|
|
|
}
|
|
|
- @GetMapping("/test10" )
|
|
|
+
|
|
|
+ @GetMapping("/test10")
|
|
|
public List<Map> test() throws Exception {
|
|
|
// dingshiqiImpl dingshiqi = new dingshiqiImpl();
|
|
|
// List<Map> list = (List<Map>) ydClient.queryData(YDParam.builder().formUuid("FORM-5DB656AF0F0E4EFA85A4739D55C23ED85BXO")
|
|
|
@@ -610,15 +831,15 @@ return "success";
|
|
|
String jdbcUrl = "jdbc:mysql://10.9.33.236/qiyuesuodb?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC";
|
|
|
String userName = "root";
|
|
|
String password = "hpZbPf6YnVr7";
|
|
|
- try{
|
|
|
+ try {
|
|
|
Class.forName("com.mysql.cj.jdbc.Driver");
|
|
|
Connection conn = DriverManager.getConnection(jdbcUrl, userName, password);
|
|
|
Statement statement = conn.createStatement();
|
|
|
ResultSet resultSet = statement.executeQuery(sql);
|
|
|
- int i=0;
|
|
|
- while (resultSet.next()){
|
|
|
+ int i = 0;
|
|
|
+ while (resultSet.next()) {
|
|
|
i++;
|
|
|
- System.out.println(i+"-"+resultSet.getFetchSize());
|
|
|
+ System.out.println(i + "-" + resultSet.getFetchSize());
|
|
|
System.out.println(resultSet.getString("yzsysmz"));//看进度用
|
|
|
System.out.println(resultSet.getString("yzsyzid"));//名称
|
|
|
System.out.println(resultSet.getString("gszt"));//名称
|
|
|
@@ -628,16 +849,16 @@ return "success";
|
|
|
String gszt = resultSet.getString("gszt");//名称
|
|
|
String id = resultSet.getString("id");//名称
|
|
|
HashMap<String, Object> bankmap = new HashMap<>();
|
|
|
- bankmap.put("yzsysmz",yzsysmz);
|
|
|
- bankmap.put("yzsyzid",yzsyzid);
|
|
|
- bankmap.put("gszt",gszt);
|
|
|
- bankmap.put("id",id);
|
|
|
+ bankmap.put("yzsysmz", yzsysmz);
|
|
|
+ bankmap.put("yzsyzid", yzsyzid);
|
|
|
+ bankmap.put("gszt", gszt);
|
|
|
+ bankmap.put("id", id);
|
|
|
LegaltList.add(bankmap);
|
|
|
}
|
|
|
resultSet.close();
|
|
|
statement.close();
|
|
|
conn.close();
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
// Map map = list.get(0);
|
|
|
@@ -682,9 +903,11 @@ return "success";
|
|
|
// }while (flag);
|
|
|
return LegaltList;
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private QysService qysService1;
|
|
|
-//@GetMapping("/test12" )
|
|
|
+
|
|
|
+ //@GetMapping("/test12" )
|
|
|
//public String test12() throws Exception {
|
|
|
// qysService1.download1("contractId");
|
|
|
// List<String> unzippedFiles = new ArrayList<>();
|
|
|
@@ -732,37 +955,39 @@ return "success";
|
|
|
// log.info("list:{}", list);
|
|
|
//
|
|
|
//}
|
|
|
- @GetMapping("/test11" )
|
|
|
+ @GetMapping("/test11")
|
|
|
public String test11() throws Exception {
|
|
|
- Map data = (Map) ydClient.queryData(YDParam.builder().formInstId("4b3fdbdf-3aef-4fe8-9eef-d4966b61e8d4")
|
|
|
+ Map data = (Map) ydClient.queryData(YDParam.builder().formInstId("32b5ede4-6bbc-4165-904b-4279a2af2562")
|
|
|
.appType(ydConf.getAppType()).systemToken(ydConf.getSystemToken())
|
|
|
.userId(ddConf.getOperator()).build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
log.info("data:{}", data);
|
|
|
- String sfbh = data.get("selectField_lu9euh7u").toString();
|
|
|
- System.out.println("aaaaaaaaa"+sfbh);
|
|
|
+// String sfbh = data.get("selectField_lu9euh7u").toString();
|
|
|
+// System.out.println("aaaaaaaaa" + sfbh);
|
|
|
return "success";
|
|
|
}
|
|
|
- private void taskExecute(String instanceId,String taskId){
|
|
|
+
|
|
|
+ private void taskExecute(String instanceId, String taskId) {
|
|
|
Map param3 = new HashMap();
|
|
|
- param3.put("x-acs-dingtalk-access-token",new dingshiqiImpl().getAccessToken_PJSS());
|
|
|
+ param3.put("x-acs-dingtalk-access-token", new dingshiqiImpl().getAccessToken_PJSS());
|
|
|
Map body4 = new HashMap();
|
|
|
- body4.put("outResult","AGREE");
|
|
|
- body4.put("appType","APP_VCTRP6227CC8368NDOID");
|
|
|
- body4.put("systemToken","5H9662C1X8XJLFFCE841M5VBEBQ73DM5IBPULPI3");
|
|
|
- body4.put("remark","同意");
|
|
|
- body4.put("taskId",taskId);
|
|
|
+ body4.put("outResult", "AGREE");
|
|
|
+ body4.put("appType", "APP_VCTRP6227CC8368NDOID");
|
|
|
+ body4.put("systemToken", "5H9662C1X8XJLFFCE841M5VBEBQ73DM5IBPULPI3");
|
|
|
+ body4.put("remark", "同意");
|
|
|
+ body4.put("taskId", taskId);
|
|
|
body4.put("processInstanceId", instanceId);
|
|
|
- body4.put("userId","15099924886");
|
|
|
- String s1 = UtilHttp.doPost("https://api.dingtalk.com/v1.0/yida/tasks/execute", param3,null, (Map<String, Object>) body4);
|
|
|
- System.out.println("result"+s1);
|
|
|
+ body4.put("userId", "15099924886");
|
|
|
+ String s1 = UtilHttp.doPost("https://api.dingtalk.com/v1.0/yida/tasks/execute", param3, null, (Map<String, Object>) body4);
|
|
|
+ System.out.println("result" + s1);
|
|
|
}
|
|
|
+
|
|
|
/***
|
|
|
* 第三步
|
|
|
* 契约锁签署完成回调、保存文件
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/callback")
|
|
|
- public String callback(@RequestParam Map<String, String> param) throws Exception {
|
|
|
+ public String callback(@RequestParam Map<String, String> param) throws Exception {
|
|
|
log.info("callback:{}", JSON.toJSONString(param));
|
|
|
|
|
|
//1.content解析为json字符 并获得contractId
|
|
|
@@ -773,17 +998,20 @@ return "success";
|
|
|
//("attachmentField_ltsbweit",文件)
|
|
|
return qysService.callback(param);
|
|
|
}
|
|
|
+
|
|
|
@PostMapping("/callback1")
|
|
|
- public String callback1(@RequestParam Map<String, String> param) throws Exception {
|
|
|
+ public String callback1(@RequestParam Map<String, String> param) throws Exception {
|
|
|
log.info("callback:{}", param);
|
|
|
|
|
|
return qysService.callback1(param);
|
|
|
}
|
|
|
|
|
|
private static final String FILE_DIRECTORY = "/home/server/ruisi_qys/ruisi_qiyuesuo/fils_new/";
|
|
|
+// private static final String FILE_DIRECTORY = "C:\\Users\\EDY\\Desktop\\测试\\2025年度pipithink.com域名通用证书合同";
|
|
|
|
|
|
@GetMapping("/download/{sn}/{fileName}")
|
|
|
- public ResponseEntity<Resource> downloadFile(@PathVariable String fileName,@PathVariable String sn) {
|
|
|
+ public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, @PathVariable String sn) {
|
|
|
+
|
|
|
Path filePath = Paths.get(FILE_DIRECTORY.concat(sn.concat("//"))).resolve(fileName).normalize();
|
|
|
try {
|
|
|
Resource resource = new UrlResource(filePath.toUri());
|
|
|
@@ -803,6 +1031,43 @@ return "success";
|
|
|
return ResponseEntity.notFound().build();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// @GetMapping("/download/{sn}/{fileName}")
|
|
|
+// @GetMapping("/download")
|
|
|
+// public ResponseEntity<Resource> downloadFile(
|
|
|
+// @RequestParam String fileName) {
|
|
|
+// System.out.println(fileName);
|
|
|
+// try {
|
|
|
+// // 对fileName进行URL解码
|
|
|
+// String decodedFileName = URLDecoder.decode(fileName, StandardCharsets.UTF_8.name());
|
|
|
+// log.info("decodedFileName:{}", decodedFileName);
|
|
|
+// Path filePath = Paths.get(FILE_DIRECTORY)
|
|
|
+// .resolve(decodedFileName) // 使用解码后的文件名
|
|
|
+// .normalize();
|
|
|
+//
|
|
|
+// Resource resource = new UrlResource(filePath.toUri());
|
|
|
+// if (resource.exists()) {
|
|
|
+// HttpHeaders headers = new HttpHeaders();
|
|
|
+// // 保持原始文件名输出(不重复编码)
|
|
|
+// headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + resource.getFilename());
|
|
|
+//
|
|
|
+// return ResponseEntity.ok()
|
|
|
+// .headers(headers)
|
|
|
+// .contentType(MediaType.parseMediaType("application/octet-stream"))
|
|
|
+// .body(resource);
|
|
|
+// } else {
|
|
|
+// return ResponseEntity.notFound().build();
|
|
|
+// }
|
|
|
+// } catch (MalformedURLException e) {
|
|
|
+// return ResponseEntity.notFound().build();
|
|
|
+// } catch (IOException e) {
|
|
|
+// return ResponseEntity.notFound().build();
|
|
|
+// } catch (IllegalArgumentException e) {
|
|
|
+// // 处理URL解码失败的情况
|
|
|
+// return ResponseEntity.badRequest().build();
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
private String getCust(String type, String key) throws Exception {
|
|
|
Map<String, String> map = UtilMap.empty();
|
|
|
if (type.equals("FORM-55D56A69CCCE4043A01660C8910E33BAQ4N0")) {
|