|
|
package com.customization.meeting;
|
|
|
|
|
|
import com.api.meeting.util.MeetingPrmUtil;
|
|
|
import com.engine.core.cfg.annotation.CommandDynamicProxy;
|
|
|
import com.engine.core.interceptor.AbstractCommandProxy;
|
|
|
import com.engine.core.interceptor.Command;
|
|
|
import com.engine.meeting.cmd.meetingbase.NewMeetingCmd;
|
|
|
import org.apache.commons.httpclient.util.DateUtil;
|
|
|
import weaver.common.StringUtil;
|
|
|
import weaver.conn.RecordSet;
|
|
|
import weaver.conn.RecordSetTrans;
|
|
|
import weaver.formmode.setup.ModeRightInfo;
|
|
|
import weaver.general.Util;
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* Created by oceanxu on 2019/8/28.
|
|
|
*/
|
|
|
@CommandDynamicProxy(target = NewMeetingCmd.class, desc="领导会议")
|
|
|
public class LeaderMeetNewMeetCmd extends AbstractCommandProxy<Map<String,Object>> {
|
|
|
@Override
|
|
|
public Map<String, Object> execute(Command<Map<String, Object>> command) {
|
|
|
NewMeetingCmd newMeetingCmd = (NewMeetingCmd)command;
|
|
|
User user = newMeetingCmd.getUser();
|
|
|
|
|
|
//获取被代理对象的参数
|
|
|
Map<String, Object> params = newMeetingCmd.getParams();
|
|
|
//对参数做预处理
|
|
|
String meetingid = Util.null2String(params.get("meetingid"));
|
|
|
|
|
|
MeetingPrmUtil mpu = new MeetingPrmUtil(user, meetingid);
|
|
|
// //TODO
|
|
|
// for (Map.Entry<String, Object> entry : params.entrySet()) {
|
|
|
// System.out.println("参数:Key = " + entry.getKey() + ", Value = " + entry.getValue());
|
|
|
// }
|
|
|
|
|
|
//参数回写
|
|
|
newMeetingCmd.setParams(params);
|
|
|
//执行标准的业务处理
|
|
|
Map<String, Object> result = nextExecute(command);
|
|
|
//对返回值做加工处理
|
|
|
try{
|
|
|
//查找领导表中数据
|
|
|
//参会人员
|
|
|
String hrmIds = params.get("hrmmembers").toString();
|
|
|
String hymc = params.get("name").toString();
|
|
|
String hylx = params.get("meetingtype").toString();
|
|
|
String hydd = params.get("address").toString();
|
|
|
String zdyhydd = params.get("customizeAddress").toString();
|
|
|
String ksrq = params.get("begindate").toString();
|
|
|
String kssj = params.get("begintime").toString();
|
|
|
String jsrq = params.get("enddate").toString();
|
|
|
String jssj = params.get("endtime").toString();
|
|
|
|
|
|
String[] hrmIdArr = hrmIds.split(",");
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
RecordSetTrans rst = new RecordSetTrans();
|
|
|
String hrmIdForLeader = "";
|
|
|
for (int i = 0;i<hrmIdArr.length;i++){
|
|
|
String hrmId = hrmIdArr[i];
|
|
|
rs.execute("select count(1) from uf_gbjbxx x where x.xm ='"+hrmId+"'");
|
|
|
|
|
|
if(rs.next()){
|
|
|
int num = rs.getInt(1);
|
|
|
if(num>0){
|
|
|
if(hrmIdForLeader.length()==0){
|
|
|
hrmIdForLeader = hrmId;
|
|
|
}else {
|
|
|
hrmIdForLeader+=","+hrmId;
|
|
|
}
|
|
|
//
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
if(StringUtil.isNotNull(hrmIdForLeader)){
|
|
|
// String id =UUID.randomUUID().toString();
|
|
|
String modDataCreateDate = DateUtil.formatDate(new Date(),"yyyy-MM-dd");
|
|
|
rst.executeSql("insert into uf_ldgbhyb (hymc,hylx,hydd,zdyhydd,ksrq,kssj,jsrq,jssj,chry,MODEDATACREATEDATE,formmodeid) values ('"+hymc+"','"+hylx+"','"+hydd+"','"+zdyhydd+"','"+ksrq+"','"+kssj+"','"+jsrq+"','"+jssj+"','"+hrmIdForLeader+"','"+modDataCreateDate+"','"+8002+"')");
|
|
|
rs.execute("select b.id from uf_ldgbhyb b where b.MODEDATACREATEDATE = '"+modDataCreateDate+"' and b.hymc = '"+hymc+"' and to_char(b.chry) ='"+hrmIdForLeader+"'");
|
|
|
Integer dateId = 0;
|
|
|
if(rs.next()){
|
|
|
dateId = rs.getInt(1);
|
|
|
}
|
|
|
ModeRightInfo moderight = new ModeRightInfo();
|
|
|
// moderight.editModeDataShare(user.getUID(), 3022, dateId);
|
|
|
moderight.editModeDataShare(user.getUID(), 8002, dateId);
|
|
|
}
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|