|
|
|
|
package com.engine.meeting.qc711359.cmd;
|
|
|
|
|
|
|
|
|
|
import com.engine.common.biz.AbstractCommonCommand;
|
|
|
|
|
import com.engine.common.entity.BizLogContext;
|
|
|
|
|
import com.engine.core.interceptor.CommandContext;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
|
import weaver.soa.workflow.request.RequestInfo;
|
|
|
|
|
import weaver.soa.workflow.request.MainTableInfo;
|
|
|
|
|
import weaver.soa.workflow.request.Property;
|
|
|
|
|
import weaver.soa.workflow.request.RequestService;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
*会议任务转督办功能(生成待办流程)
|
|
|
|
|
*/
|
|
|
|
|
public class TurnHandleMeetingTaskCmd extends AbstractCommonCommand<Map<String, Object>> {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 构造方法
|
|
|
|
|
* @param user
|
|
|
|
|
* @param params
|
|
|
|
|
*/
|
|
|
|
|
public TurnHandleMeetingTaskCmd(User user, Map<String, Object> params){
|
|
|
|
|
this.user=user;
|
|
|
|
|
this.params=params;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取日志对象
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public BizLogContext getLogContext() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 会议任务转督办功能(生成待办流程)
|
|
|
|
|
* @param commandContext
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> execute(CommandContext commandContext) {
|
|
|
|
|
Map<String, Object> ret = new HashMap<String, Object>();
|
|
|
|
|
RecordSet recordSet = new RecordSet();
|
|
|
|
|
RecordSet record = new RecordSet();
|
|
|
|
|
String userId = String.valueOf(user.getUID()); //当前用户Id
|
|
|
|
|
//String meetingid=Util.null2String(params.get("meetingid"));//会议id
|
|
|
|
|
String decisionid=Util.null2String(params.get("id"));//会议任务id
|
|
|
|
|
String ismobile=Util.null2String(params.get("ismobile"));//会议任务id
|
|
|
|
|
recordSet.writeLog("===============会议任务转督办功能,参数:decisionid="+decisionid);
|
|
|
|
|
try{
|
|
|
|
|
String workflowId = recordSet.getPropValue("QC711359","workflowId");//流程id
|
|
|
|
|
String createid = recordSet.getPropValue("QC711359","createid");//创建人id
|
|
|
|
|
|
|
|
|
|
String rwmc = recordSet.getPropValue("QC711359","rwmc");//任务名称
|
|
|
|
|
String rwms = recordSet.getPropValue("QC711359","rwms");//任务描述
|
|
|
|
|
String dbrwly = recordSet.getPropValue("QC711359","dbrwly");//督办任务来源(会议类型为三重一大的来源为’三重一大‘,其他的为’会议‘)
|
|
|
|
|
String hyzjr = recordSet.getPropValue("QC711359","hyzjr");//会议召集人
|
|
|
|
|
String chld = recordSet.getPropValue("QC711359","chld");//参会领导
|
|
|
|
|
String chry = recordSet.getPropValue("QC711359","chry");//参会人员
|
|
|
|
|
String hyxzr = recordSet.getPropValue("QC711359","hyxzr");//会议协助人
|
|
|
|
|
String hyrwzrr = recordSet.getPropValue("QC711359","hyrwzrr");//会议任务责任人
|
|
|
|
|
String hyrwjcr = recordSet.getPropValue("QC711359","hyrwjcr");//会议任务检查人
|
|
|
|
|
String fj = recordSet.getPropValue("QC711359","fj");//附件
|
|
|
|
|
|
|
|
|
|
String source1 = recordSet.getPropValue("QC711359","source1");//会议
|
|
|
|
|
String source2 = recordSet.getPropValue("QC711359","source2");//三重一大
|
|
|
|
|
|
|
|
|
|
String meet_chld = recordSet.getPropValue("QC711359","meetingchld");//会议信息,参会领导字段
|
|
|
|
|
String meet_xzr = recordSet.getPropValue("QC711359","xzr");//会议信息,协助人
|
|
|
|
|
String type = recordSet.getPropValue("QC711359","meetingtype");//会议类型id(三重一大)
|
|
|
|
|
String meetfj = recordSet.getPropValue("QC711359","meetfj");//新增的会议附件字段
|
|
|
|
|
|
|
|
|
|
String kssj = recordSet.getPropValue("QC711359","kssj");//开始日期
|
|
|
|
|
String jssj = recordSet.getPropValue("QC711359","jssj");//结束日期
|
|
|
|
|
|
|
|
|
|
if(!"".equals(workflowId)&&!"".equals(decisionid) ){
|
|
|
|
|
RequestInfo ri = new RequestInfo();
|
|
|
|
|
MainTableInfo mi = new MainTableInfo();
|
|
|
|
|
Property pp = null;
|
|
|
|
|
|
|
|
|
|
ri.setIsNextFlow("1"); //是否创建后流转流程. 0:不流转. 1:流转
|
|
|
|
|
ri.setWorkflowid(workflowId); //流程ID
|
|
|
|
|
ri.setCreatorid(createid); //创建人
|
|
|
|
|
ri.setRequestlevel("0"); //紧急程度
|
|
|
|
|
ri.setRemindtype("0"); //消息提醒类型
|
|
|
|
|
|
|
|
|
|
String meetingid="";
|
|
|
|
|
record.executeQuery("select * from MEETING_DECISION where id = ? ", decisionid);
|
|
|
|
|
if(record.next()){
|
|
|
|
|
meetingid = record.getString("meetingid");
|
|
|
|
|
String hrmid01 = record.getString("hrmid01");//决议执行人
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(hyrwzrr);
|
|
|
|
|
pp.setValue(hrmid01);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String hrmid02 = record.getString("hrmid02");//检查人
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(hyrwjcr);
|
|
|
|
|
pp.setValue(hrmid02);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String begindate = record.getString("begindate");
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(kssj);
|
|
|
|
|
pp.setValue(begindate);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String enddate = record.getString("enddate");
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(jssj);
|
|
|
|
|
pp.setValue(enddate);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!"".equals(meetingid)){
|
|
|
|
|
recordSet.executeQuery("select * from meeting where id = ?", meetingid);
|
|
|
|
|
if(recordSet.next()){
|
|
|
|
|
String meetingName = recordSet.getString("name");
|
|
|
|
|
String desc_n = recordSet.getString("desc_n");
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(rwms);
|
|
|
|
|
pp.setValue(desc_n);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
ri.setDescription(SystemEnv.getHtmlLabelName(514003,user.getLanguage())+SystemEnv.getHtmlLabelName(2103,user.getLanguage())+":"+meetingName);
|
|
|
|
|
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(rwmc);
|
|
|
|
|
pp.setValue(meetingName);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String meetingtype = recordSet.getString("meetingtype");
|
|
|
|
|
if(type.equals(meetingtype)){
|
|
|
|
|
meetingtype = source2;
|
|
|
|
|
}else{
|
|
|
|
|
meetingtype = source1;
|
|
|
|
|
}
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(dbrwly);
|
|
|
|
|
pp.setValue(meetingtype);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String caller = recordSet.getString("caller");
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(hyzjr);
|
|
|
|
|
pp.setValue(caller);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String meet_chldTemp = recordSet.getString(""+meet_chld+"");
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(chld);
|
|
|
|
|
pp.setValue(meet_chldTemp);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String meet_xzrTemp = recordSet.getString(""+meet_xzr+"");
|
|
|
|
|
//record.writeLog("============meet_xzrTemp = "+meet_xzrTemp);
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(hyxzr);
|
|
|
|
|
pp.setValue(meet_xzrTemp);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String hrmmembers = recordSet.getString("hrmmembers");
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(chry);
|
|
|
|
|
pp.setValue(hrmmembers);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
|
|
|
|
|
String decisionatchids = recordSet.getString("decisionatchids");
|
|
|
|
|
String accessorys = recordSet.getString("accessorys");
|
|
|
|
|
String fj1 = recordSet.getString(""+meetfj+"");
|
|
|
|
|
if("".equals(accessorys)){
|
|
|
|
|
accessorys = fj1;
|
|
|
|
|
}else{
|
|
|
|
|
accessorys += ","+fj1;
|
|
|
|
|
}
|
|
|
|
|
pp = new Property();
|
|
|
|
|
pp.setName(fj);
|
|
|
|
|
pp.setValue(decisionatchids);
|
|
|
|
|
mi.addProperty(pp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ri.setMainTableInfo(mi);
|
|
|
|
|
int newrequestid = Util.getIntValue(new RequestService().createRequest(ri), 0);
|
|
|
|
|
//ret.put("newrequestid", newrequestid);
|
|
|
|
|
record.writeLog("============会议同步流程的id:newrequestid = "+newrequestid);
|
|
|
|
|
if(newrequestid>0){
|
|
|
|
|
if("1".equals(ismobile)){
|
|
|
|
|
ret.put("ret", true);
|
|
|
|
|
}else{
|
|
|
|
|
ret.put("status", true);
|
|
|
|
|
}
|
|
|
|
|
//ret.put("msg", "已转督办");
|
|
|
|
|
record.executeUpdate("update MEETING_DECISION set remark = '1' where id = ? ", decisionid);
|
|
|
|
|
record.writeLog("会议信息同步流程成功");
|
|
|
|
|
}else{
|
|
|
|
|
if("1".equals(ismobile)){
|
|
|
|
|
ret.put("ret", false);
|
|
|
|
|
}else{
|
|
|
|
|
ret.put("status", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
record.executeUpdate("update MEETING_DECISION set remark = '0' where id = ? ", decisionid);
|
|
|
|
|
record.writeLog("会议同步流程失败:"+newrequestid);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if("1".equals(ismobile)){
|
|
|
|
|
ret.put("ret", false);
|
|
|
|
|
}else{
|
|
|
|
|
ret.put("status", false);
|
|
|
|
|
}
|
|
|
|
|
//ret.put("msg", "决议任务id或者流程id为空!");
|
|
|
|
|
}
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
|
|
|
|
|
if("1".equals(ismobile)){
|
|
|
|
|
ret.put("ret", false);
|
|
|
|
|
}else{
|
|
|
|
|
ret.put("status", false);
|
|
|
|
|
}
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
//ret.put("msg", "转办失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
}
|