This commit is contained in:
andy 2026-06-02 14:25:59 +08:00
parent 65eab9985b
commit 6b18b1651b

View File

@ -14,7 +14,6 @@ import com.evo.common.core.domain.AjaxResult;
import com.evo.common.utils.Collections;
import com.evo.common.utils.http.HttpUtils;
import com.evo.ding.DingUtils;
import com.evo.kingdeeUtils.kenum.KingdeeParamsEnum;
import com.evo.personnelMatters.mapper.RzOverTimeDetailMapper;
import com.evo.personnelMatters.mapper.RzOverTimeMapper;
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
@ -26,8 +25,6 @@ import com.evo.wechat.dto.MessageTemplate;
import com.evo.wechat.service.GZHAccessTokenService;
import org.apache.ibatis.annotations.Param;
import org.jasypt.encryption.StringEncryptor;
import org.springframework.core.io.FileSystemResource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@ -195,8 +192,8 @@ public class TestController {
*/
@GetMapping("/testAdapterSend")
public AjaxResult testSend() throws ParseException {
// RestTemplate restTemplate = new RestTemplate();
// MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
RestTemplate restTemplate = new RestTemplate();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
// // 文件
// File file = new File("D:\\andy\\车辆管理.png");
//// File file1 = new File("D:\\andy\\index.ts");
@ -222,61 +219,63 @@ public class TestController {
//
//
//
// Map<String,String> dataMap = Collections.emptyMap();
// dataMap.put("month", "sendMarkdownAndFileToUser");
// dataMap.put("robotCode","dinge794oclijuyxsyub");
// dataMap.put("clientId", "dinge794oclijuyxsyub");
// dataMap.put("clientSecret", "4ryzLl48I8ghhKqEMPCwablFqbs6PCmadqfDAPFWBNuIEBMJvPFQg-XHAe2oH2Fe");
// dataMap.put("recipientType", "code");//00146
// dataMap.put("users", JSON.toJSONString(Collections.asList("00272")));
// dataMap.put("title", "test测试");
// dataMap.put("content", markdownMsg.toString());
// {"month":"sendMarkdownAndFileToUser","robotCode":"dinge794oclijuyxsyub","clientId":"dinge794oclijuyxsyub","clientSecret":"4ryzLl48I8ghhKqEMPCwablFqbs6PCmadqfDAPFWBNuIEBMJvPFQg-XHAe2oH2Fe","recipientType":"code","users":["00312","00150"],"title":"消息通知测试","content":"消息正文内容。。。。。。。。"}
Map<String,String> dataMap = Collections.emptyMap();
dataMap.put("month", "sendMarkdownAndFileToUser");
dataMap.put("robotCode","dinge794oclijuyxsyub");
dataMap.put("clientId", "dinge794oclijuyxsyub");
dataMap.put("clientSecret", "4ryzLl48I8ghhKqEMPCwablFqbs6PCmadqfDAPFWBNuIEBMJvPFQg-XHAe2oH2Fe");
dataMap.put("recipientType", "code");//00146
dataMap.put("users", JSON.toJSONString(Collections.asList("00312","00150")));
dataMap.put("title", "消息通知测试");
dataMap.put("content", "消息正文内容。。。。。。。。");
//
//// dataMap.put("parameterTypes", JSON.toJSONString(Collections.asList("java.lang.String","java.lang.String")));
//// dataMap.put("parameters", JSON.toJSONString(Collections.asList("test测试",markdownMsg.toString())));
// //推送数据类型
// params.add("data", JSON.toJSONString(dataMap));
params.add("data", JSON.toJSONString(dataMap));
//
// String url = "http://localhost:8089/ding/send";
// return AjaxResult.success(restTemplate.postForObject(url, params, String.class));
String url = "http://localhost:8089/ding/send";
return AjaxResult.success(restTemplate.postForObject(url, params, String.class));
//
//String data = "{\"FormId\":\"BD_Empinfo\",\"FieldKeys\":\"FID\",\"FilterString\":[{\"Left\":\"\",\"FieldName\":\"FStaffNumber\",\"Compare\":\"17\",\"Value\":\"00046\",\"Right\":\"\",\"Logic\":0}],\"OrderString\":\"\",\"TopRowCount\":0,\"StartRow\":0,\"Limit\":2000,\"SubSystemId\":\"\"}";
String data = "{\n" +
" \"FormId\" : \"PRD_MO\",\n" +
" \"FieldKeys\" : \"F_HBYT_SCLH,FBillNo,FWorkShopID.FName,FMaterialId.FNumber,FMaterialName,FPlanStartDate,FPlanFinishDate,FPickMtrlStatus\",\n" +
" \"FilterString\" : [ {\n" +
" \"FieldName\" : \"FStatus\",\n" +
" \"Compare\" : \"105\",\n" +
" \"Value\" : \"4\",\n" +
" \"Left\" : \"\",\n" +
" \"Right\" : \"\",\n" +
" \"Logic\" : 0\n" +
" }, {\n" +
" \"FieldName\" : \"FPickMtrlStatus\",\n" +
" \"Compare\" : \"29\",\n" +
" \"Value\" : \"1\",\n" +
" \"Left\" : \"\",\n" +
" \"Right\" : \"\",\n" +
" \"Logic\" : 0\n" +
" }, {\n" +
" \"FieldName\" : \"F_HBYT_SCLH\",\n" +
" \"Compare\" : \"67\",\n" +
" \"Value\" : \"QB-26-163-XCL\",\n" +
" \"Left\" : \"\",\n" +
" \"Right\" : \"\",\n" +
" \"Logic\" : 0\n" +
" } ],\n" +
" \"OrderString\" : \"\",\n" +
" \"TopRowCount\" : 0,\n" +
" \"StartRow\" : 0,\n" +
" \"Limit\" : 10000,\n" +
" \"SubSystemId\" : \"\"\n" +
"}";
return AjaxResult.success(HttpUtils.sendPost("http://localhost:8089/distribution/kingdee/send", JSONObject.toJSONString(
Collections.asMap("fromId","PRD_MO", "month","billQuery", "parameterTypes",Collections.asList(String.class),"data",Collections.asMap("123",data)))));
//
// String data = "{\n" +
// " \"FormId\" : \"PRD_MO\",\n" +
// " \"FieldKeys\" : \"F_HBYT_SCLH,FBillNo,FWorkShopID.FName,FMaterialId.FNumber,FMaterialName,FPlanStartDate,FPlanFinishDate,FPickMtrlStatus\",\n" +
// " \"FilterString\" : [ {\n" +
// " \"FieldName\" : \"FStatus\",\n" +
// " \"Compare\" : \"105\",\n" +
// " \"Value\" : \"4\",\n" +
// " \"Left\" : \"\",\n" +
// " \"Right\" : \"\",\n" +
// " \"Logic\" : 0\n" +
// " }, {\n" +
// " \"FieldName\" : \"FPickMtrlStatus\",\n" +
// " \"Compare\" : \"29\",\n" +
// " \"Value\" : \"1\",\n" +
// " \"Left\" : \"\",\n" +
// " \"Right\" : \"\",\n" +
// " \"Logic\" : 0\n" +
// " }, {\n" +
// " \"FieldName\" : \"F_HBYT_SCLH\",\n" +
// " \"Compare\" : \"67\",\n" +
// " \"Value\" : \"QB-26-163-XCL\",\n" +
// " \"Left\" : \"\",\n" +
// " \"Right\" : \"\",\n" +
// " \"Logic\" : 0\n" +
// " } ],\n" +
// " \"OrderString\" : \"\",\n" +
// " \"TopRowCount\" : 0,\n" +
// " \"StartRow\" : 0,\n" +
// " \"Limit\" : 10000,\n" +
// " \"SubSystemId\" : \"\"\n" +
// "}";
//
// return AjaxResult.success(HttpUtils.sendPost("http://localhost:8089/distribution/kingdee/send", JSONObject.toJSONString(
// Collections.asMap("fromId","PRD_MO", "month","billQuery", "parameterTypes",Collections.asList(String.class),"data",Collections.asMap("123",data)))));
}