|
|
@@ -102,27 +102,35 @@ public class SysNotifyTodoWebServiceImpl implements SysNotifyTodoWebService {
|
|
|
res="蓝凌OA待办下载失败,失败信息:"+result.getMessage();
|
|
|
}else if (result.getReturnState()==2){
|
|
|
String message = result.getMessage();
|
|
|
- JSONObject jsonObject = JSONObject.fromObject(message);
|
|
|
- JSONArray docs = jsonObject.getJSONArray("docs");
|
|
|
- List<String> sqls = new ArrayList<>();
|
|
|
- for (int i = 0; i <docs.size() ; i++) {
|
|
|
- Object obj = docs.get(i);
|
|
|
- JSONObject object = JSONObject.fromObject(obj);
|
|
|
- String link = object.get("link") == null ? null : object.getString("link").replace("&", "'||chr(38)||'");
|
|
|
- if(baseDao.getCountByCondition("jprocess","jp_landrayid='"+object.getString("id")+"'")==0){
|
|
|
- sqls.add("insert into jprocess(jp_id, jp_name, jp_launcherid, jp_launchername, jp_form, " +
|
|
|
- "jp_launchtime, jp_table, jp_status, jp_url,jp_landrayid,jp_nodedealman,jp_codevalue," +
|
|
|
- "jp_processinstanceid,jp_nodename)" +
|
|
|
- " values(process_seq.nextval,'"+ object.getString("subject")+"','"+object.getString("creator")+"','"+
|
|
|
- object.getString("creatorName")+"','" +object.getString("key")+"',to_date('"+object.getString("createTime")+"','yyyy-MM-dd HH24:mi:ss'),'"+
|
|
|
- object.getString("modelName")+"','待审批','http://oa.seg.com.cn:8081"+link+"','"+object.getString("id")+"','"+cond+"','"+object.getString("moduleName")+"','"+object.getString("id")+"','"+cond+"')");
|
|
|
- }
|
|
|
+ List<String> sqls = new ArrayList<>();
|
|
|
+ if (message.indexOf("errorPage")==-1) {
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(message);
|
|
|
+ JSONArray docs = jsonObject.getJSONArray("docs");
|
|
|
+ for (int i = 0; i < docs.size(); i++) {
|
|
|
+ Object obj = docs.get(i);
|
|
|
+ JSONObject object = JSONObject.fromObject(obj);
|
|
|
+ String link = object.get("link") == null ? null : object.getString("link").replace("&", "'||chr(38)||'");
|
|
|
+ if (baseDao.getCountByCondition("jprocess", "jp_landrayid='" + object.getString("id") + "'") == 0) {
|
|
|
+ sqls.add("insert into jprocess(jp_id, jp_name, jp_launcherid, jp_launchername, jp_form, " +
|
|
|
+ "jp_launchtime, jp_table, jp_status, jp_url,jp_landrayid,jp_nodedealman,jp_codevalue," +
|
|
|
+ "jp_processinstanceid,jp_nodename)" +
|
|
|
+ " values(process_seq.nextval,'" + object.getString("subject") + "','" + object.getString("creator") + "','" +
|
|
|
+ object.getString("creatorName") + "','" + object.getString("key") + "',to_date('" + object.getString("createTime") + "','yyyy-MM-dd HH24:mi:ss'),'" +
|
|
|
+ object.getString("modelName") + "','待审批','http://oa.seg.com.cn:8081" + link + "','" + object.getString("id") + "','" + cond + "','" + object.getString("moduleName") + "','" + object.getString("id") + "','" + cond + "')");
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ SqlRowList rowSet = baseDao.queryForRowSet("select jp_processinstanceid from jprocess where nvl(jp_landrayid,' ')<>' ' and jp_status='待审批' and jp_nodedealman='" + cond + "'");
|
|
|
+ while (rowSet.next()) {
|
|
|
+ sqls.add("update jprocess set jp_status='已审批' where nvl(jp_landrayid,' ')<>' ' and jp_nodedealman='" + cond + "' and jp_processinstanceid='"+rowSet.getString("jp_processinstanceid")+"'");
|
|
|
+ baseDao.execute("insert into jnode (jn_id,jn_name, jn_dealmanid,jn_processinstanceid,JN_DEALTIME, JN_DEALRESULT) values (jnode_seq.nextval,'" + cond + "','" + cond + "','" + rowSet.getString("jp_processinstanceid") + "',to_char(sysdate,'yyyy-MM-dd HH24:mi:ss'),'详见蓝凌OA')");
|
|
|
+ }
|
|
|
}
|
|
|
- if (sqls!=null&&sqls.size()>0){
|
|
|
+ if (sqls != null && sqls.size() > 0) {
|
|
|
baseDao.execute(sqls);
|
|
|
}
|
|
|
- res="蓝凌OA待办下载成功";
|
|
|
+ res = "蓝凌OA待办下载成功";
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
@@ -151,35 +159,37 @@ public class SysNotifyTodoWebServiceImpl implements SysNotifyTodoWebService {
|
|
|
res="蓝凌OA已办下载失败,失败信息:"+result.getMessage();
|
|
|
}else if (result.getReturnState()==2){
|
|
|
String message = result.getMessage();
|
|
|
- JSONObject jsonObject = JSONObject.fromObject(message);
|
|
|
- JSONArray docs = jsonObject.getJSONArray("docs");
|
|
|
- List<String> sqls = new ArrayList<>();
|
|
|
- for (int i = 0; i <docs.size() ; i++) {
|
|
|
- Object obj = docs.get(i);
|
|
|
- JSONObject object = JSONObject.fromObject(obj);
|
|
|
- String link = object.get("link") == null ? null : object.getString("link").replace("&", "'||chr(38)||'");
|
|
|
- if(baseDao.getCountByCondition("jprocess","jp_landrayid='"+object.getString("id")+"'")==0){
|
|
|
- sqls.add("insert into jprocess(jp_id, jp_name, jp_launcherid, jp_launchername, jp_form, " +
|
|
|
- "jp_launchtime, jp_table, jp_status, jp_url,jp_landrayid,jp_nodedealman,jp_codevalue," +
|
|
|
- "jp_processinstanceid,jp_nodename) values (process_seq.nextval,'"+ object.getString("subject")+"','"+object.getString("creator")+"','"+
|
|
|
- object.getString("creatorName")+"','" +object.getString("key")+"',to_date('"+object.getString("createTime")+"','yyyy-MM-dd HH24:mi:ss'),'"+
|
|
|
- object.getString("modelName")+"','已审批','http://oa.seg.com.cn:8081"+link+"','"+object.getString("id")+"','"+cond+"','"+object.getString("moduleName")+"','"+object.getString("id")+"','"+cond+"')");
|
|
|
- sqls.add("insert into jnode (jn_id,jn_name, jn_dealmanid,jn_processinstanceid,JN_DEALTIME, JN_DEALRESULT) values" +
|
|
|
- "(jnode_seq.nextval,'"+cond+"','"+cond+"','"+object.getString("id")+"',sysdate,'详见蓝凌OA')");
|
|
|
- }else {
|
|
|
- if (baseDao.getCountByCondition("jprocess", "jp_status='待审批' and jp_landrayid='"+object.getString("id")+"'")>0) {
|
|
|
- sqls.add("update jprocess set jp_status='已审批' where jp_landrayid='" + object.getString("id") + "'");
|
|
|
- sqls.add("insert into jnode (jn_id,jn_name, jn_dealmanid,jn_processinstanceid,JN_DEALTIME, JN_DEALRESULT) values " +
|
|
|
- "(jnode_seq.nextval,'" + cond + "','" + cond + "','" + object.getString("id") +
|
|
|
- "',sysdate,'详见蓝凌OA')");
|
|
|
+ if (message.indexOf("errorPage")==-1) {
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(message);
|
|
|
+ JSONArray docs = jsonObject.getJSONArray("docs");
|
|
|
+ List<String> sqls = new ArrayList<>();
|
|
|
+ for (int i = 0; i < docs.size(); i++) {
|
|
|
+ Object obj = docs.get(i);
|
|
|
+ JSONObject object = JSONObject.fromObject(obj);
|
|
|
+ String link = object.get("link") == null ? null : object.getString("link").replace("&", "'||chr(38)||'");
|
|
|
+ if (baseDao.getCountByCondition("jprocess", "jp_landrayid='" + object.getString("id") + "'") == 0) {
|
|
|
+ sqls.add("insert into jprocess(jp_id, jp_name, jp_launcherid, jp_launchername, jp_form, " +
|
|
|
+ "jp_launchtime, jp_table, jp_status, jp_url,jp_landrayid,jp_nodedealman,jp_codevalue," +
|
|
|
+ "jp_processinstanceid,jp_nodename) values (process_seq.nextval,'" + object.getString("subject") + "','" + object.getString("creator") + "','" +
|
|
|
+ object.getString("creatorName") + "','" + object.getString("key") + "',to_date('" + object.getString("createTime") + "','yyyy-MM-dd HH24:mi:ss'),'" +
|
|
|
+ object.getString("modelName") + "','已审批','http://oa.seg.com.cn:8081" + link + "','" + object.getString("id") + "','" + cond + "','" + object.getString("moduleName") + "','" + object.getString("id") + "','" + cond + "')");
|
|
|
+ sqls.add("insert into jnode (jn_id,jn_name, jn_dealmanid,jn_processinstanceid,JN_DEALTIME, JN_DEALRESULT) values" +
|
|
|
+ "(jnode_seq.nextval,'" + cond + "','" + cond + "','" + object.getString("id") + "',to_char(sysdate,'yyyy-MM-dd HH24:mi:ss'),'详见蓝凌OA')");
|
|
|
+ } else {
|
|
|
+ if (baseDao.getCountByCondition("jprocess", "jp_status='待审批' and jp_landrayid='" + object.getString("id") + "'") > 0) {
|
|
|
+ sqls.add("update jprocess set jp_status='已审批' where jp_landrayid='" + object.getString("id") + "'");
|
|
|
+ sqls.add("insert into jnode (jn_id,jn_name, jn_dealmanid,jn_processinstanceid,JN_DEALTIME, JN_DEALRESULT) values " +
|
|
|
+ "(jnode_seq.nextval,'" + cond + "','" + cond + "','" + object.getString("id") +
|
|
|
+ "',to_char(sysdate,'yyyy-MM-dd HH24:mi:ss'),'详见蓝凌OA')");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
+ if (sqls != null && sqls.size() > 0) {
|
|
|
+ baseDao.execute(sqls);
|
|
|
+ }
|
|
|
+ res = "蓝凌OA已办下载成功";
|
|
|
}
|
|
|
- if (sqls!=null&&sqls.size()>0){
|
|
|
- baseDao.execute(sqls);
|
|
|
- }
|
|
|
- res="蓝凌OA已办下载成功";
|
|
|
}
|
|
|
System.err.println(res);
|
|
|
|