|
@@ -1,5 +1,6 @@
|
|
|
package com.malk.jianhui.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.kingdee.bos.webapi.entity.IdentifyInfo;
|
|
@@ -10,11 +11,16 @@ import com.malk.jianhui.service.JianhuiService;
|
|
|
import com.malk.server.aliwork.YDConf;
|
|
|
import com.malk.server.aliwork.YDParam;
|
|
|
import com.malk.server.common.McR;
|
|
|
+import com.malk.server.dingtalk.DDConf;
|
|
|
import com.malk.server.dingtalk.DDR_New;
|
|
|
import com.malk.service.aliwork.YDClient;
|
|
|
+import com.malk.service.dingtalk.DDClient;
|
|
|
+import com.malk.utils.UtilHttp;
|
|
|
import com.malk.utils.UtilMap;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.logging.log4j.util.Strings;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
|
|
|
|
@@ -37,6 +43,12 @@ public class JianhuiServiceImpl implements JianhuiService {
|
|
|
@Autowired
|
|
|
private YDClient ydClient;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DDClient ddClient;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DDConf ddConf;
|
|
|
+
|
|
|
//单据状态
|
|
|
private static final Map<String,String> FDOCUMENTSTATUS = new HashMap<>();
|
|
|
static{
|
|
@@ -1261,9 +1273,55 @@ public class JianhuiServiceImpl implements JianhuiService {
|
|
|
syncSupplier();//同步供应商
|
|
|
syncSalePrice();//同步销售价目表
|
|
|
syncMaterial();//同步物料
|
|
|
+
|
|
|
+ //新增数据底表更新时间
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .formUuid("FORM-5BAA6A050AC449438568D5A50FE2D2684RBN")
|
|
|
+ .formDataJson(JSONObject.toJSONString(UtilMap.map("dateField_m8sdk1ny", new Date().getTime())))
|
|
|
+ .build(), YDConf.FORM_OPERATION.create);
|
|
|
+
|
|
|
return McR.success();
|
|
|
}
|
|
|
|
|
|
+ @Async
|
|
|
+ @Override
|
|
|
+ public void manualSyncData(String userId) {
|
|
|
+ //发送工作通知
|
|
|
+ if (Strings.isNotBlank(userId)){
|
|
|
+ Map param2 = new HashMap();
|
|
|
+ param2.put("access_token",ddClient.getAccessToken());
|
|
|
+ Map body3 = new HashMap();
|
|
|
+ body3.put("agent_id",ddConf.getAgentId());
|
|
|
+ body3.put("userid_list",userId);
|
|
|
+ Map msg = new HashMap();
|
|
|
+ msg.put("msgtype","text");
|
|
|
+ //获取当前时间 精确到秒
|
|
|
+ String time = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ msg.put("text", UtilMap.map("content","开始同步金蝶业务数据 时间:" + time));
|
|
|
+ body3.put("msg",msg);
|
|
|
+ UtilHttp.doPost("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2",null,param2,body3);
|
|
|
+ }
|
|
|
+
|
|
|
+ syncData();
|
|
|
+
|
|
|
+ //发送工作通知
|
|
|
+ if (Strings.isNotBlank(userId)){
|
|
|
+ Map param2 = new HashMap();
|
|
|
+ param2.put("access_token",ddClient.getAccessToken());
|
|
|
+ Map body3 = new HashMap();
|
|
|
+ body3.put("agent_id",ddConf.getAgentId());
|
|
|
+ body3.put("userid_list",userId);
|
|
|
+ Map msg = new HashMap();
|
|
|
+ msg.put("msgtype","text");
|
|
|
+ //获取当前时间 精确到秒
|
|
|
+ String time = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ msg.put("text", UtilMap.map("content","金蝶业务数据已更新 时间:" + time));
|
|
|
+ body3.put("msg",msg);
|
|
|
+ UtilHttp.doPost("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2",null,param2,body3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
private String getMultiLanguageTextName(Object object){
|