|
|
|
@ -1,6 +1,9 @@
|
|
|
|
|
package weaver.interfaces.dito.portal;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.customization.dito.sendtodo.SendPortalWithAddDoneCmd;
|
|
|
|
|
import com.customization.dito.sendtodo.SendPortalWithAddTodoCmd;
|
|
|
|
|
import com.customization.dito.sendtodo.SendPortalWithDeleteCmd;
|
|
|
|
@ -13,8 +16,6 @@ import weaver.general.Util;
|
|
|
|
|
import weaver.ofs.interfaces.SendRequestStatusDataInterfaces;
|
|
|
|
|
import weaver.workflow.request.todo.DataObj;
|
|
|
|
|
import weaver.workflow.request.todo.RequestStatusObj;
|
|
|
|
|
import net.sf.json.JSONArray;
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
@ -69,67 +70,74 @@ public class SendRequestData2PortalInterfaces implements SendRequestStatusDataIn
|
|
|
|
|
public void SendRequestStatusData(ArrayList<DataObj> datas) {
|
|
|
|
|
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
|
|
|
|
|
for(DataObj dobj : datas){
|
|
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
|
|
JSONObject mainboject = new JSONObject();
|
|
|
|
|
String requestname = "";
|
|
|
|
|
JSONObject todojson = new JSONObject();
|
|
|
|
|
JSONObject donejson = new JSONObject();
|
|
|
|
|
JSONObject deljson = new JSONObject();
|
|
|
|
|
ArrayList<RequestStatusObj> tododatas = dobj.getTododatas();
|
|
|
|
|
if(tododatas.size()>0){//处理推送的待办数据
|
|
|
|
|
List<Map<String,Object>> todolist = new ArrayList();
|
|
|
|
|
for(RequestStatusObj rso : tododatas){//遍历当前发送的待办数据
|
|
|
|
|
Map<String,Object> rsojson = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
requestname = rso.getRequstname() ;
|
|
|
|
|
bb.writeLog("tododatas-requestname:"+requestname);
|
|
|
|
|
//rsojson.put("cid",rso.getCid());
|
|
|
|
|
rsojson.put("requestname",requestname);
|
|
|
|
|
rsojson.put("requestid",rso.getRequestid());
|
|
|
|
|
rsojson.put("username",rso.getUser().getLastname()+"("+rso.getUser().getUID()+")");
|
|
|
|
|
rsojson.put("id",rso.getUser().getUID());
|
|
|
|
|
rsojson.put("isremark",rso.getIsremark());
|
|
|
|
|
rsojson.put("loginid",rso.getUser().getLoginid());
|
|
|
|
|
// rsojson.put("isremark",rso.getIsremark());
|
|
|
|
|
// rsojson.put("viewtype",rso.getViewtype());
|
|
|
|
|
// rsojson.put("receivedatetime",rso.getReceivedate()+" "+rso.getReceivetime()+"/"+rso.getOperatedate()+" "+rso.getOperatetime());
|
|
|
|
|
// rsojson.put("nodename",rso.getNodename());
|
|
|
|
|
todolist.add(rsojson);
|
|
|
|
|
}
|
|
|
|
|
Map<String,Object> params = new HashMap<>();
|
|
|
|
|
params.put("TodoDatas",todolist);
|
|
|
|
|
params.put("requestid",dobj.getRequestid());
|
|
|
|
|
new SendPortalWithAddTodoCmd(params).execute(Context.getCommandComtext());
|
|
|
|
|
|
|
|
|
|
todojson.put("TodoCount",tododatas.size());
|
|
|
|
|
todojson.put("TodoDatas",todolist);
|
|
|
|
|
jsonArray.add(todojson);
|
|
|
|
|
if(tododatas.size()>0){
|
|
|
|
|
//处理推送的待办数据
|
|
|
|
|
// List<Map<String,Object>> todolist = new ArrayList();
|
|
|
|
|
// for(RequestStatusObj rso : tododatas){//遍历当前发送的待办数据
|
|
|
|
|
// Map<String,Object> rsojson = new HashMap<>();
|
|
|
|
|
//
|
|
|
|
|
// requestname = rso.getRequstname() ;
|
|
|
|
|
// bb.writeLog("tododatas-requestname:"+requestname);
|
|
|
|
|
// //rsojson.put("cid",rso.getCid());
|
|
|
|
|
// rsojson.put("requestname",requestname);
|
|
|
|
|
// rsojson.put("requestid",rso.getRequestid());
|
|
|
|
|
// rsojson.put("username",rso.getUser().getLastname()+"("+rso.getUser().getUID()+")");
|
|
|
|
|
// rsojson.put("id",rso.getUser().getUID());
|
|
|
|
|
// rsojson.put("isremark",rso.getIsremark());
|
|
|
|
|
// rsojson.put("loginid",rso.getUser().getLoginid());
|
|
|
|
|
// // rsojson.put("isremark",rso.getIsremark());
|
|
|
|
|
// // rsojson.put("viewtype",rso.getViewtype());
|
|
|
|
|
// // rsojson.put("receivedatetime",rso.getReceivedate()+" "+rso.getReceivetime()+"/"+rso.getOperatedate()+" "+rso.getOperatetime());
|
|
|
|
|
// // rsojson.put("nodename",rso.getNodename());
|
|
|
|
|
// todolist.add(rsojson);
|
|
|
|
|
// }
|
|
|
|
|
// Map<String,Object> params = new HashMap<>();
|
|
|
|
|
// params.put("TodoDatas",todolist);
|
|
|
|
|
// params.put("requestid",dobj.getRequestid());
|
|
|
|
|
// new SendPortalWithAddTodoCmd(params).execute(Context.getCommandComtext());
|
|
|
|
|
//
|
|
|
|
|
// todojson.put("TodoCount",tododatas.size());
|
|
|
|
|
// todojson.put("TodoDatas",todolist);
|
|
|
|
|
// jsonArray.add(todojson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArrayList<RequestStatusObj> donedatas = dobj.getDonedatas();
|
|
|
|
|
bb.writeLog("donedatas-size:"+donedatas.size());
|
|
|
|
|
if(donedatas.size()>0){//处理推送的已办数据
|
|
|
|
|
List<Map<String,Object>> donelist = new ArrayList();
|
|
|
|
|
for(RequestStatusObj rso : donedatas){//遍历当前发送的已办数据
|
|
|
|
|
for(RequestStatusObj rso : donedatas){ //遍历当前发送的已办数据
|
|
|
|
|
|
|
|
|
|
Map<String,Object> rsojson = new HashMap<>();
|
|
|
|
|
requestname = rso.getRequstname() ;
|
|
|
|
|
String requestname = rso.getRequstname() ;
|
|
|
|
|
String requestid = rso.getRequestid()+"";
|
|
|
|
|
String isremark = rso.getIsremark();
|
|
|
|
|
bb.writeLog("donedatas-requestid:"+requestid);
|
|
|
|
|
bb.writeLog("donedatas-requestname:"+requestname);
|
|
|
|
|
bb.writeLog("donedatas-isremark:"+isremark);
|
|
|
|
|
|
|
|
|
|
rsojson.put("requestname",requestname);
|
|
|
|
|
rsojson.put("requestid",rso.getRequestid());
|
|
|
|
|
// rsojson.put("cid",rso.getCid());
|
|
|
|
|
rsojson.put("requestid",requestid);
|
|
|
|
|
rsojson.put("requestname",rso.getRequstname());
|
|
|
|
|
rsojson.put("workflowname",rso.getWorkflowname());
|
|
|
|
|
rsojson.put("username",rso.getUser().getLastname());
|
|
|
|
|
rsojson.put("isremark",rso.getIsremark());
|
|
|
|
|
rsojson.put("isremark",isremark);
|
|
|
|
|
rsojson.put("id",rso.getUser().getUID());
|
|
|
|
|
rsojson.put("loginid",rso.getUser().getLoginid());
|
|
|
|
|
rsojson.put("creater",rso.getCreator().getLoginid());
|
|
|
|
|
rsojson.put("noedid",rso.getNodeid());
|
|
|
|
|
// rsojson.put("viewtype",rso.getViewtype());
|
|
|
|
|
// rsojson.put("receivedatetime",rso.getReceivedate()+" "+rso.getReceivetime()+"/"+rso.getOperatedate()+" "+rso.getOperatetime());
|
|
|
|
|
rsojson.put("nodename",rso.getNodename());
|
|
|
|
|
// rsojson.put("iscomplete",rso.getIscomplete());
|
|
|
|
|
donelist.add(rsojson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String,Object> params = new HashMap<>();
|
|
|
|
|
params.put("doneDatas",donelist);
|
|
|
|
|
params.put("requestid",dobj.getRequestid());
|
|
|
|
@ -139,33 +147,64 @@ public class SendRequestData2PortalInterfaces implements SendRequestStatusDataIn
|
|
|
|
|
donejson.put("DoneDatas",donelist);
|
|
|
|
|
jsonArray.add(donejson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArrayList<RequestStatusObj> deldatas = dobj.getDeldatas();
|
|
|
|
|
bb.writeLog("deldatas-size:"+deldatas.size());
|
|
|
|
|
if(deldatas.size()>0){ //处理推送的删除数据
|
|
|
|
|
JSONArray todolist = new JSONArray();
|
|
|
|
|
for(RequestStatusObj rso : deldatas){//遍历当前发送的删除数据
|
|
|
|
|
requestname = rso.getRequstname() ;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
bb.writeLog("deldatas-userid:"+JSONArray.parseArray(JSON.toJSONString(deldatas)));
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
bb.writeLog("e:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONArray deleteRemarklist = new JSONArray();
|
|
|
|
|
for(RequestStatusObj rso : deldatas){ //遍历当前发送的删除数据
|
|
|
|
|
|
|
|
|
|
String requestname = rso.getRequstname() ;
|
|
|
|
|
String requestid = rso.getRequestid()+"";
|
|
|
|
|
String isremark = rso.getIsremark();
|
|
|
|
|
|
|
|
|
|
String userid = rso.getUser().getUID() + "";
|
|
|
|
|
|
|
|
|
|
bb.writeLog("deldatas-requestid:"+requestid);
|
|
|
|
|
bb.writeLog("deldatas-requestname:"+requestname);
|
|
|
|
|
JSONObject rsojson = new JSONObject();
|
|
|
|
|
rsojson.put("cid",rso.getCid());
|
|
|
|
|
rsojson.put("requestid",rso.getRequestid());
|
|
|
|
|
rsojson.put("username",rso.getUser().getLastname()+"("+rso.getUser().getUID()+")");
|
|
|
|
|
todolist.add(rsojson);
|
|
|
|
|
bb.writeLog("deldatas-isremark:"+isremark);
|
|
|
|
|
|
|
|
|
|
bb.writeLog("deldatas-userid:"+userid);
|
|
|
|
|
|
|
|
|
|
if("8".equals(isremark) || "9".equals(isremark)){
|
|
|
|
|
JSONObject rsojson = new JSONObject();
|
|
|
|
|
rsojson.put("cid",rso.getCid());
|
|
|
|
|
rsojson.put("requestid",rso.getRequestid());
|
|
|
|
|
rsojson.put("username",rso.getUser().getLastname()+"("+rso.getUser().getUID()+")");
|
|
|
|
|
rsojson.put("isremark",isremark);
|
|
|
|
|
rsojson.put("userid",userid);
|
|
|
|
|
deleteRemarklist.add(rsojson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
deljson.put("DelCount",deldatas.size());
|
|
|
|
|
deljson.put("DelDatas",todolist);
|
|
|
|
|
jsonArray.add(deljson);
|
|
|
|
|
//同步统一门户
|
|
|
|
|
Map<String,Object> param = new HashMap<>();
|
|
|
|
|
bb.writeLog("deldatas-requestid:"+dobj.getRequestid());
|
|
|
|
|
bb.writeLog("deldatas-deleteRemarklist:"+deleteRemarklist.toString());
|
|
|
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<String,Object>();
|
|
|
|
|
param.put("requestid",dobj.getRequestid());
|
|
|
|
|
param.put("deleteRemarkDatas",deleteRemarklist);
|
|
|
|
|
new SendPortalWithDeleteCmd(param).execute(Context.getCommandComtext());
|
|
|
|
|
|
|
|
|
|
// deljson.put("DelCount",deldatas.size());
|
|
|
|
|
// deljson.put("DelDatas",deletelist);
|
|
|
|
|
// jsonArray.add(deljson);
|
|
|
|
|
//同步统一门户
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mainboject.put("id",id);
|
|
|
|
|
mainboject.put("syscode",syscode);
|
|
|
|
|
mainboject.put("requestid",dobj.getRequestid());
|
|
|
|
|
mainboject.put("requestname",requestname);
|
|
|
|
|
mainboject.put("sendtimestamp",dobj.getSendtimestamp());
|
|
|
|
|
mainboject.put("RequestDatas",jsonArray);
|
|
|
|
|
// mainboject.put("id",id);
|
|
|
|
|
// mainboject.put("syscode",syscode);
|
|
|
|
|
// mainboject.put("requestid",dobj.getRequestid());
|
|
|
|
|
// mainboject.put("requestname",requestname);
|
|
|
|
|
// mainboject.put("sendtimestamp",dobj.getSendtimestamp());
|
|
|
|
|
// mainboject.put("RequestDatas",jsonArray);
|
|
|
|
|
|
|
|
|
|
//输入内容信息到日志文件中 /log/ecology
|
|
|
|
|
log.error("\n"+formatJson(mainboject.toString()));
|
|
|
|
|