|
|
@@ -117,6 +117,7 @@ public class DocumentServiceImpl implements DocumentService {
|
|
|
private static final Map<String,String> HISTORY_DEPTID = new HashMap<>();
|
|
|
static {
|
|
|
HISTORY_DEPTID.put("投资部", "BM000003");
|
|
|
+ HISTORY_DEPTID.put("市场部", "BM000004");
|
|
|
HISTORY_DEPTID.put("行政人事部", "BM000007");
|
|
|
HISTORY_DEPTID.put("财务部", "BM000008");
|
|
|
HISTORY_DEPTID.put("兰州基地", "BM000013");
|
|
|
@@ -765,4 +766,45 @@ public class DocumentServiceImpl implements DocumentService {
|
|
|
return ALL_RETURN;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void testViewNotice(String id){
|
|
|
+ K3CloudApi client = new K3CloudApi(kingDeeService.initIden());
|
|
|
+ View view = new View();
|
|
|
+ view.setNumber(id);
|
|
|
+ String formId = "AP_PAYBILL";
|
|
|
+ try {
|
|
|
+ String resultJson = client.view(formId, JSON.toJSONString(view));
|
|
|
+ Gson gson = new Gson();
|
|
|
+ //对返回结果进行解析和校验
|
|
|
+ RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class);
|
|
|
+ if (repoRet.getResult().getResponseStatus().isIsSuccess()) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(repoRet.getResult().getResult()));
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("PAYBILLENTRY").toString());
|
|
|
+ boolean isAllPay = true;
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ JSONObject sonObject = JSONObject.parseObject(jsonArray.get(i).toString());
|
|
|
+ String fbankmsg = sonObject.get("FBANKMSG").toString();
|
|
|
+ if (!fbankmsg.contains("交易成功")){
|
|
|
+ isAllPay = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isAllPay){
|
|
|
+ String content = "你有一条单据已完成付款";
|
|
|
+ Map<String, Object> msg = new HashMap<>();
|
|
|
+ msg.put("msgtype","text");
|
|
|
+ msg.put("text", UtilMap.map("content", content));
|
|
|
+
|
|
|
+ ddClient_notice.sendNotification(ddClient.getAccessToken(), Arrays.asList("603864663125953014"),null,false,msg);
|
|
|
+ }
|
|
|
+ System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult()));
|
|
|
+ log.info("接口返回结果:{}",gson.toJson(repoRet.getResult()));
|
|
|
+ } else {
|
|
|
+ fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus()));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ fail(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|