#weaver-matform# 门户元素后端接口开发
parent
65d05427b7
commit
d35f75b7d0
@ -0,0 +1,71 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||||
|
<%@ page import="java.text.SimpleDateFormat" %>
|
||||||
|
<%@ page import="weaver.formmode.setup.ModeRightInfo" %>
|
||||||
|
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("code","0");
|
||||||
|
String uuid = request.getParameter("uuid");
|
||||||
|
bb.writeLog("uuid:"+uuid);
|
||||||
|
String fromtable = "uf_rzznzf" ;
|
||||||
|
Map<String,String> map = new HashMap<String, String>();
|
||||||
|
|
||||||
|
String fsr = "" ;
|
||||||
|
String fsrxm = "";
|
||||||
|
String jsr = "" ;
|
||||||
|
String jsrxm = "" ;
|
||||||
|
String zfy = "" ;
|
||||||
|
String zftp = "" ;
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
try{
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
if(StringUtils.isNotBlank(uuid)){
|
||||||
|
|
||||||
|
String sql = " select * from "+fromtable+" where uuid = '"+uuid+"' ";
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
fsr = Util.null2String(rs.getString("fsr"));
|
||||||
|
if(StringUtils.isNotBlank(fsr)){
|
||||||
|
fsrxm = ResourceComInfo.getLastname(fsr);
|
||||||
|
}
|
||||||
|
jsr = Util.null2String(rs.getString("jsr"));
|
||||||
|
if(StringUtils.isNotBlank(jsr)){
|
||||||
|
jsrxm = ResourceComInfo.getLastname(jsr);
|
||||||
|
}
|
||||||
|
zfy = Util.null2String(rs.getString("zfy"));
|
||||||
|
zftp = Util.null2String(rs.getString("zftp"));
|
||||||
|
count++ ;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
jsonObject.put("code","-300");
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
jsonObject.put("code","-100");
|
||||||
|
}
|
||||||
|
|
||||||
|
map.put("fsr",fsr);
|
||||||
|
map.put("fsrxm",fsrxm);
|
||||||
|
map.put("jsr",jsr);
|
||||||
|
map.put("jsrxm",jsrxm);
|
||||||
|
map.put("zfy",zfy);
|
||||||
|
map.put("zftp",zftp);
|
||||||
|
jsonObject.put("data",map);
|
||||||
|
if(count > 0){
|
||||||
|
jsonObject.put("code","200");
|
||||||
|
}else{
|
||||||
|
jsonObject.put("code","-200");
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,113 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.text.SimpleDateFormat" %>
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
List<Map<String,String>> dataList = new ArrayList<Map<String,String>>();
|
||||||
|
Map<String,String> dataMap = null;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd" ) ;
|
||||||
|
// Calendar calendar = Calendar.getInstance() ;
|
||||||
|
// String currentDay = sdf.format(calendar.getTime()) ;
|
||||||
|
// bb.writeLog("currentDay:"+currentDay);
|
||||||
|
|
||||||
|
for(int i=0;i<30;i++)
|
||||||
|
{
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DAY_OF_YEAR, 0-i);
|
||||||
|
String currentDay = sdf.format(calendar.getTime()) ;
|
||||||
|
bb.writeLog("currentDay:"+currentDay);
|
||||||
|
|
||||||
|
String sql =" select k.* from (select h.id,h.lastname,h.sex,h.departmentid,d.departmentname,s.subcompanyname,k.jobtitlename," +
|
||||||
|
" datediff(year,h.companystartdate,convert(varchar(50), getdate(), 23)) as zn" +
|
||||||
|
" from hrmresource h\n" +
|
||||||
|
" inner join HrmDepartment d on d.id = h.departmentid\n" +
|
||||||
|
" inner join HrmSubCompany s on s.id = h.subcompanyid1\n" +
|
||||||
|
" inner join HrmJobTitles k on k.id = h.jobtitle\n" +
|
||||||
|
" where h.companystartdate like '%"+currentDay+"'\n" +
|
||||||
|
" and h.status in(0,1,2,3)" +
|
||||||
|
" and h.belongto is null " +
|
||||||
|
" ) k where k.zn > 0 " ;
|
||||||
|
|
||||||
|
bb.writeLog("sql:"+sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
while (rs.next()){
|
||||||
|
String id = Util.null2String(rs.getString("id"));
|
||||||
|
String lastname = Util.null2String(rs.getString("lastname"));
|
||||||
|
String sex = Util.null2String(rs.getString("sex"));
|
||||||
|
String departmentname = Util.null2String(rs.getString("departmentname"));
|
||||||
|
String subcompanyname = Util.null2String(rs.getString("subcompanyname"));
|
||||||
|
String zn = Util.null2String(rs.getString("zn"));
|
||||||
|
String departmentid = Util.null2String(rs.getString("departmentid"));
|
||||||
|
String jobtitlename = Util.null2String(rs.getString("jobtitlename"));
|
||||||
|
|
||||||
|
String deptnamenew = "" ;
|
||||||
|
dataMap = new HashMap<String, String>();
|
||||||
|
dataMap.put("userid",id);
|
||||||
|
dataMap.put("sex",sex);
|
||||||
|
dataMap.put("jobtitlename",jobtitlename);
|
||||||
|
dataMap.put("lastname",lastname);
|
||||||
|
dataMap.put("departmentname",departmentname);
|
||||||
|
dataMap.put("subcompanyname",subcompanyname);
|
||||||
|
if(StringUtils.isNotBlank(departmentid)){
|
||||||
|
deptnamenew = getTopDepartment(departmentid);
|
||||||
|
}
|
||||||
|
dataMap.put("deptnamenew",deptnamenew);
|
||||||
|
dataMap.put("zn",zn);
|
||||||
|
dataList.add(dataMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("data",dataList);
|
||||||
|
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
|
||||||
|
<%!
|
||||||
|
|
||||||
|
public String getTopDepartment(String departmentid){
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
String departmentname = "" ;
|
||||||
|
if(StringUtils.isNotBlank(departmentid)){
|
||||||
|
String sql = " with tem_table(department_id,department_name,supdep_id,curlevel) as (\n" +
|
||||||
|
" select id,departmentname,supdepid, 1 as level \n" +
|
||||||
|
" from HrmDepartment where id = " + departmentid+
|
||||||
|
" union all \n" +
|
||||||
|
" select a.id,a.departmentname,a.supdepid, b.curlevel+1 \n" +
|
||||||
|
" from HrmDepartment a \n" +
|
||||||
|
" inner join tem_table b on (a.id = b.supdep_id)\n" +
|
||||||
|
" ) \n" +
|
||||||
|
" select * from tem_table ";
|
||||||
|
|
||||||
|
bb.writeLog("sql:"+sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
while (rs.next()){
|
||||||
|
String department_id = Util.null2String(rs.getString("department_id"));
|
||||||
|
String department_name = Util.null2String(rs.getString("department_name"));
|
||||||
|
String supdep_id = Util.null2String(rs.getString("supdep_id"));
|
||||||
|
if(StringUtils.isBlank(supdep_id) || "0".equals(supdep_id)){
|
||||||
|
departmentname = department_name ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bb.writeLog("departmentname:"+departmentname);
|
||||||
|
|
||||||
|
return departmentname;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||||
|
<%@ page import="java.util.Map" %>
|
||||||
|
<%@ page import="java.util.List" %>
|
||||||
|
<%@ page import="java.util.ArrayList" %>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.util.HashMap" %>
|
||||||
|
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
List<Map<String,String>> dataList = new ArrayList<Map<String,String>>();
|
||||||
|
Map<String,String> dataMap = null;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
String seccategory = Util.null2String(request.getParameter("seccategory"));
|
||||||
|
if(StringUtils.isNotBlank(seccategory)){
|
||||||
|
String sql = " select docsubject,id,doccreatedate,doccreatetime from docdetail \n" +
|
||||||
|
" where seccategory="+seccategory+" \n" + // and doccreatedate >= DATEADD(day, -7, GETDATE())
|
||||||
|
" order by doccreatedate desc, doccreatetime desc ";
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
while (rs.next()){
|
||||||
|
String id = Util.null2String(rs.getString("id"));
|
||||||
|
String docsubject = Util.null2String(rs.getString("docsubject"));
|
||||||
|
String doccreatedate = Util.null2String(rs.getString("doccreatedate"));
|
||||||
|
String doccreatetime = Util.null2String(rs.getString("doccreatetime"));
|
||||||
|
|
||||||
|
dataMap = new HashMap<String, String>();
|
||||||
|
dataMap.put("userid",id);
|
||||||
|
dataMap.put("docsubject",docsubject);
|
||||||
|
dataMap.put("doccreatedate",doccreatedate);
|
||||||
|
dataMap.put("doccreatetime",doccreatetime);
|
||||||
|
dataList.add(dataMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("data",dataList);
|
||||||
|
|
||||||
|
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page import="com.engine.matfron.entity.OptionVO" %>
|
||||||
|
<%@ page import="com.engine.matfron.entity.SeriesParam" %>
|
||||||
|
<%@ page import="java.text.DecimalFormat" %>
|
||||||
|
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
OptionVO optionVO = getPortalEthnic();
|
||||||
|
jsonObject.put("data",optionVO);
|
||||||
|
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
<%!
|
||||||
|
|
||||||
|
public OptionVO getPortalEthnic() {
|
||||||
|
|
||||||
|
DecimalFormat df = new DecimalFormat("#.00");
|
||||||
|
|
||||||
|
String fieldid = "27";
|
||||||
|
String fieldname = "field"+fieldid ;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
List<String> colorList = Arrays.asList("#6e94f3","#faf0e6","#7cfc00","#ao20f0","#00ced1","#83d8ae","#697695","#8ac9e9","#9933fa","#c0ff3e","#ffe4c4","#cd6090");
|
||||||
|
LinkedList<SeriesParam> seriesData = new LinkedList<>();
|
||||||
|
LinkedList<String> nameSet = new LinkedList<>();
|
||||||
|
|
||||||
|
rs.executeQuery(" select t."+fieldname+",k.selectname as name,count(1) as sums" +
|
||||||
|
" from cus_fielddata t\n" +
|
||||||
|
" inner join hrmresource h on h.id = t.id\n" +
|
||||||
|
" left join cus_selectitem k on k.selectvalue = t."+fieldname+"\n" +
|
||||||
|
" where k.fieldid="+fieldid+" \n" +
|
||||||
|
" and t."+fieldname+" is not null\n" +
|
||||||
|
" and scope = 'HrmCustomFieldByInfoType' and scopeid='3'\n" +
|
||||||
|
" group by t."+fieldname+",k.selectname \n" +
|
||||||
|
"");
|
||||||
|
while (rs.next()) {
|
||||||
|
Random random = new Random();
|
||||||
|
String color = colorList.get(random.nextInt(colorList.size()));
|
||||||
|
String name = Util.null2String(rs.getString("name"));
|
||||||
|
seriesData.add(SeriesParam.builder().value(Util.getDoubleValue(rs.getString("sums"))).name(name).color(color).build());
|
||||||
|
nameSet.add(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
double percentage = seriesData.stream().mapToDouble(SeriesParam::getValue).sum();
|
||||||
|
seriesData.forEach(item -> item.setValue(Double.valueOf(df.format((item.getValue() * 100) / percentage))));
|
||||||
|
|
||||||
|
|
||||||
|
return OptionVO.builder()
|
||||||
|
.titleText("人员类型")
|
||||||
|
.legendDataTwo(nameSet)
|
||||||
|
.seriesData(seriesData)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page import="com.engine.matfron.entity.OptionVO" %>
|
||||||
|
<%@ page import="com.engine.matfron.entity.SeriesParam" %>
|
||||||
|
<%@ page import="java.util.stream.Collectors" %>
|
||||||
|
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
OptionVO OptionVO = getHomePlace();
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
<%!
|
||||||
|
|
||||||
|
public OptionVO getHomePlace() {
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
List<String> colorList = Arrays.asList("#ao20f0","#8ac9e9","#697695","#83d8ae","#faf0e6","#7cfc00","#6e94f3","#9933fa","#c0ff3e","#00ced1","#ffe4c4","#cd6090");
|
||||||
|
LinkedList<SeriesParam> seriesData = new LinkedList<>();
|
||||||
|
LinkedList<String> legendData = new LinkedList<>();
|
||||||
|
|
||||||
|
rs.executeQuery("select h.locationid,l.locationname,count(1) as num from hrmresource h\n" +
|
||||||
|
" left join hrmlocations l on h.locationid = l.id\n" +
|
||||||
|
" where h.status < 4 and h.locationid is not null group by h.locationid,l.locationname");
|
||||||
|
while (rs.next()) {
|
||||||
|
String locationname = Util.null2String(rs.getString("locationname"));
|
||||||
|
legendData.add(locationname);
|
||||||
|
Random random = new Random();
|
||||||
|
String color = colorList.get(random.nextInt(colorList.size()));
|
||||||
|
seriesData.add(SeriesParam.builder().value(Util.getDoubleValue(rs.getString("num"))).name(locationname).color(color).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Double> values = seriesData.stream().map(SeriesParam :: getValue).collect(Collectors.toList());
|
||||||
|
double percentage = values.stream().mapToDouble(Double::doubleValue).sum();
|
||||||
|
seriesData.forEach(item -> item.setValue(Double.valueOf(df.format((item.getValue() * 100) / percentage))));
|
||||||
|
|
||||||
|
return OptionVO.builder()
|
||||||
|
.titleText("归属地分析")
|
||||||
|
.legendDataFirst(legendData)
|
||||||
|
.seriesData(seriesData)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.text.SimpleDateFormat" %>
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
List<Map<String,String>> dataList = new ArrayList<Map<String,String>>();
|
||||||
|
Map<String,String> dataMap = null;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
String timestrformart = "MM-dd" ;
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(timestrformart) ;
|
||||||
|
Calendar calendar = Calendar.getInstance() ;
|
||||||
|
String currentDay = sdf.format(calendar.getTime()) ;
|
||||||
|
bb.writeLog("currentDay:"+currentDay);
|
||||||
|
|
||||||
|
String sql =" select h.id,h.lastname,h.sex,d.departmentname,s.subcompanyname from hrmresource h\n" +
|
||||||
|
" inner join HrmDepartment d on d.id = h.departmentid\n" +
|
||||||
|
" inner join HrmSubCompany s on s.id = h.subcompanyid1\n" +
|
||||||
|
" where birthday like '%"+currentDay+"'\n" +
|
||||||
|
" and h.status in(0,1,2,3) " +
|
||||||
|
" and h.belongto is null " ;
|
||||||
|
bb.writeLog("sql:"+sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
while (rs.next()){
|
||||||
|
String id = Util.null2String(rs.getString("id"));
|
||||||
|
String lastname = Util.null2String(rs.getString("lastname"));
|
||||||
|
String sex = Util.null2String(rs.getString("sex"));
|
||||||
|
String departmentname = Util.null2String(rs.getString("departmentname"));
|
||||||
|
String subcompanyname = Util.null2String(rs.getString("subcompanyname"));
|
||||||
|
|
||||||
|
dataMap = new HashMap<String, String>();
|
||||||
|
dataMap.put("userid",id);
|
||||||
|
dataMap.put("sex",sex);
|
||||||
|
dataMap.put("lastname",lastname);
|
||||||
|
dataMap.put("departmentname",departmentname);
|
||||||
|
dataMap.put("subcompanyname",subcompanyname);
|
||||||
|
dataList.add(dataMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("data",dataList);
|
||||||
|
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,279 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="weaver.hrm.User" %>
|
||||||
|
<%@ page import="weaver.hrm.HrmUserVarify" %>
|
||||||
|
<%@ page import="org.apache.commons.lang.StringUtils" %>
|
||||||
|
<%@ page import="com.engine.portrait.util.PortraitUtil" %>
|
||||||
|
<%@ page import="com.engine.portrait.util.CommonUtil" %>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="weaver.mobile.webservices.workflow.WorkflowServiceImpl" %>
|
||||||
|
<%@ page import="com.api.doc.detail.util.DocDownloadCheckUtil" %>
|
||||||
|
<%@ page import="java.util.Map" %>
|
||||||
|
<%@ page import="com.engine.common.util.ParamUtil" %>
|
||||||
|
<%@ page import="com.api.doc.center.service.DocCountService" %>
|
||||||
|
<%@ page import="com.engine.common.util.ServiceUtil" %>
|
||||||
|
<%@ page import="com.api.doc.center.service.impl.DocCountServiceImpl" %>
|
||||||
|
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
User user = HrmUserVarify.getUser(request , response) ;
|
||||||
|
int userid = user.getUID();
|
||||||
|
|
||||||
|
String userimageurl = "" ;
|
||||||
|
String resourceimageid = "" ;
|
||||||
|
String jobtitlename = "" ;
|
||||||
|
String lastname = user.getLastname();
|
||||||
|
if("sysadmin".equals(user.getLoginid())){
|
||||||
|
jobtitlename = "系统管理员";
|
||||||
|
}else{
|
||||||
|
String sql =" select resourceimageid,d.jobtitlename from hrmresource h \n" +
|
||||||
|
" left join hrmjobtitles d on d.id = h.jobtitle \n" +
|
||||||
|
" where h.id= ? ";
|
||||||
|
rs.executeQuery(sql,new Object[]{userid}) ;
|
||||||
|
if(rs.next()){
|
||||||
|
jobtitlename = Util.null2String(rs.getString("jobtitlename"));
|
||||||
|
resourceimageid = Util.null2String(rs.getString("resourceimageid"));
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(resourceimageid)){
|
||||||
|
String fileid = "";
|
||||||
|
if(StringUtils.isNotEmpty(resourceimageid)){
|
||||||
|
try{
|
||||||
|
fileid = DocDownloadCheckUtil.checkPermission(resourceimageid+"",null);
|
||||||
|
}catch (Exception e){
|
||||||
|
bb.writeLog("e:"+e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userimageurl = "/weaver/weaver.file.FileDownload?fileid="+fileid+"";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String rzts = "";
|
||||||
|
String rznf = "" ;
|
||||||
|
String rzsyts = "" ;
|
||||||
|
|
||||||
|
// String sql =" select case when p.rzts2 >0 then p.rzts2 else p.rzts1 end as rzts \n" +
|
||||||
|
// " from (" +
|
||||||
|
// " select " +
|
||||||
|
// " isnull((select isnull(datediff(day,hr.createdate,convert(varchar(100), getdate(), 23)),0) rzts from hrmresource hr where hr.id = "+userid+"),0) as rzts1, \n" +
|
||||||
|
// " isnull((select isnull(datediff(day,hr.created,convert(varchar(100), getdate(), 23)),0) rzts from HrmResourcemanager hr where hr.id = "+userid+"),0) as rzts2 \n" +
|
||||||
|
// " ) p " ;
|
||||||
|
//
|
||||||
|
// rs.executeQuery(sql);
|
||||||
|
// if(rs.next()){
|
||||||
|
// rzts = Util.null2String(rs.getString("rzts"));
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(userid == 1){
|
||||||
|
rznf = "0";
|
||||||
|
rzsyts = "0";
|
||||||
|
rzts = rznf + "年" + rzsyts;
|
||||||
|
}else {
|
||||||
|
String sql = " select wr.rznf,isnull(datediff(day,DATEADD(yy,wr.rznf,wr.companystartdate),convert(varchar(100), getdate(), 23)),0) as rzsyts\n" +
|
||||||
|
" from (\n" +
|
||||||
|
" select hr.id,hr.companystartdate,\n" +
|
||||||
|
" case when right(convert(varchar(100), getdate(), 23),5) > right(hr.companystartdate,5)\n" +
|
||||||
|
" then \n" +
|
||||||
|
" isnull(datediff(year,hr.companystartdate,convert(varchar(100), getdate(), 23)),0) \n" +
|
||||||
|
" else \n" +
|
||||||
|
" isnull(datediff(year,hr.companystartdate,convert(varchar(100), getdate(), 23)),0)-1\n" +
|
||||||
|
" end rznf\n" +
|
||||||
|
" from hrmresource hr\n" +
|
||||||
|
" ) wr \n" +
|
||||||
|
" where id = " + userid + " ";
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if (rs.next()) {
|
||||||
|
|
||||||
|
rznf = Util.null2String(rs.getString("rznf"));
|
||||||
|
rzsyts = Util.null2String(rs.getString("rzsyts"));
|
||||||
|
rzts = rznf + "年" + rzsyts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// if(userid == 1){
|
||||||
|
// String sql = " select isnull(datediff(day,hr.created,convert(varchar(100), getdate(), 23)),0) rzts from HrmResourcemanager hr where hr.id = ?";
|
||||||
|
// rs.executeQuery(sql,new Object[]{userid});
|
||||||
|
// if(rs.next()){
|
||||||
|
// rzts = Util.getIntValue(Util.null2String(rs.getString("rzts")),0);
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// String sql = " select isnull(datediff(day,hr.createdate,convert(varchar(100), getdate(), 23)),0) rzts from HrmResource hr where hr.id = ?";
|
||||||
|
// rs.executeQuery(sql,new Object[]{userid});
|
||||||
|
// if(rs.next()){
|
||||||
|
// rzts = Util.getIntValue(Util.null2String(rs.getString("rzts")),0);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
int doc_create = 0;
|
||||||
|
//封装request传递参数到map
|
||||||
|
try{
|
||||||
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||||
|
map.put("docCountType", "1");
|
||||||
|
Map<String,Object> apidatas = getCountService(request, response).getNumOfMy(map, user,request,response);
|
||||||
|
if(apidatas.containsKey("number")){
|
||||||
|
String number = Util.null2String(apidatas.get("number"));
|
||||||
|
if(StringUtils.isNotEmpty(number)){
|
||||||
|
doc_create = Util.getIntValue(number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isshowprocessed = true;
|
||||||
|
boolean belongtoshowFlag = true;
|
||||||
|
|
||||||
|
|
||||||
|
WorkflowServiceImpl ws = new WorkflowServiceImpl();
|
||||||
|
int wf_create = 0;
|
||||||
|
// String sql = " select isnull(count(requestid),0) as amount from workflow_requestbase where creater=? and workflowid in(select id from workflow_base where isvalid =1)";
|
||||||
|
// rs.executeQuery(sql,new Object[]{userid}) ;
|
||||||
|
// if(rs.next()){
|
||||||
|
// wf_create = Util.getIntValue(Util.null2String(rs.getString("amount")),0);
|
||||||
|
// }
|
||||||
|
|
||||||
|
try{
|
||||||
|
wf_create = ws.getMyWorkflowRequestCount(user.getUID(), null,belongtoshowFlag);
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int wf_deal = 0;
|
||||||
|
// sql = " select isnull(count(requestid),0) as amount from workflow_requestLog where operator=? ";
|
||||||
|
// rs.executeQuery(sql,new Object[]{userid}) ;
|
||||||
|
// if(rs.next()){
|
||||||
|
// wf_deal = Util.getIntValue(Util.null2String(rs.getString("amount")),0);
|
||||||
|
// }
|
||||||
|
|
||||||
|
try{
|
||||||
|
wf_deal = ws.getHendledWorkflowRequestCount(user.getUID(), isshowprocessed, null,belongtoshowFlag);
|
||||||
|
}catch (Exception e){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String mtgtrs = "0" ;
|
||||||
|
String dateType = "3";
|
||||||
|
try{
|
||||||
|
String sql = getQuerySql(userid+"","16");
|
||||||
|
if(StringUtils.isNotEmpty(sql)){
|
||||||
|
rs.executeQuery(sql,userid,dateType);
|
||||||
|
if (rs.next()) {
|
||||||
|
String itemData = Util.null2String(rs.getString("itemData"));
|
||||||
|
if(StringUtils.isNotEmpty(itemData) && itemData.contains("amount")){
|
||||||
|
mtgtrs = itemData.substring(itemData.indexOf("=")+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String cyqlsl = "0" ;
|
||||||
|
try{
|
||||||
|
String sql = getQuerySql(userid+"","17");
|
||||||
|
if(StringUtils.isNotEmpty(sql)){
|
||||||
|
rs.executeQuery(sql,userid,dateType);
|
||||||
|
if (rs.next())
|
||||||
|
{
|
||||||
|
String itemData = Util.null2String(rs.getString("itemData"));
|
||||||
|
String itemname = Util.null2String(rs.getString("itemname"));
|
||||||
|
String name = Util.null2String(rs.getString("name"));
|
||||||
|
bb.writeLog("itemname:"+itemname+" itemname:"+itemname+" name:"+name);
|
||||||
|
|
||||||
|
if(StringUtils.isNotEmpty(itemData) && itemData.contains("amount")){
|
||||||
|
cyqlsl = itemData.substring(itemData.indexOf("=")+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("lastname",lastname);
|
||||||
|
jsonObject.put("userurl","/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo");
|
||||||
|
jsonObject.put("rzts",rzts);
|
||||||
|
|
||||||
|
jsonObject.put("rznf",rznf);
|
||||||
|
jsonObject.put("rzsyts",rzsyts);
|
||||||
|
|
||||||
|
jsonObject.put("doc_create",doc_create);
|
||||||
|
jsonObject.put("doc_create_url","/spa/document/static/index.html#/main/document/search");
|
||||||
|
jsonObject.put("wf_create",wf_create);
|
||||||
|
jsonObject.put("wf_create_url","/spa/workflow/static/index.html#/main/workflow/listMine");
|
||||||
|
jsonObject.put("wf_deal",wf_deal);
|
||||||
|
jsonObject.put("wf_deal_url","/spa/workflow/static/index.html#/main/workflow/listDone");
|
||||||
|
|
||||||
|
jsonObject.put("jobtitlename",jobtitlename);
|
||||||
|
jsonObject.put("userimageurl",userimageurl);
|
||||||
|
|
||||||
|
String cyqlsl_new = "0" ;
|
||||||
|
if(StringUtils.isNotEmpty(cyqlsl)){
|
||||||
|
if(cyqlsl.contains(".")){
|
||||||
|
try{
|
||||||
|
cyqlsl_new = cyqlsl.substring(0,cyqlsl.indexOf("."));
|
||||||
|
}catch (Exception e){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jsonObject.put("cyqlsl",cyqlsl_new);
|
||||||
|
jsonObject.put("cyqlsl_old",cyqlsl);
|
||||||
|
jsonObject.put("mtgtrs",mtgtrs);
|
||||||
|
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
|
||||||
|
<%!
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @param userid
|
||||||
|
* @param itemid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getQuerySql(String userid,String itemid) {
|
||||||
|
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
StringBuilder sqlSB = new StringBuilder();
|
||||||
|
|
||||||
|
if(StringUtils.isNotEmpty(itemid))
|
||||||
|
{
|
||||||
|
sqlSB.append(" select e.id as itemdataid,e.userid,e.itemvalue,e.otherinfo as itemdata,d.* from (SELECT a.moduleid,a.name ,b.subname,b.subid ,b.iconname,b.iconcolor,b.iconbgcolor,c.id as itemid,c.iszeroshow,c.name as itemname,c.tipsinfo,c.isability,c.isnegative,c.overcolor,c.showorder")
|
||||||
|
.append(" FROM wr_individualitem_module a join wr_individualitem_submodule b on a.moduleid = b.moduleid ")
|
||||||
|
.append(" join wr_individualitem_info c on b.subid = c.subid ")
|
||||||
|
.append(" where a.status = 1 and b.status = 1 and c.status = 1 ");
|
||||||
|
if (!CommonUtil.hasSubordinate(userid)) {
|
||||||
|
sqlSB.append(" and a.moduleid != 3 ");
|
||||||
|
}
|
||||||
|
String shareSql = "";
|
||||||
|
try {
|
||||||
|
shareSql = PortraitUtil.getShareBizidSql("10",userid);
|
||||||
|
} catch (Exception e) {
|
||||||
|
bb.writeLog("获取shareSql失败,userid="+userid+",type=10,"+e);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(shareSql)) {
|
||||||
|
sqlSB.append(" and b.subid in (").append(shareSql).append(")");
|
||||||
|
}
|
||||||
|
sqlSB.append(" ) d join wr_individualitem_detail e on e.itemid = d.itemid ").append(" WHERE e.userid = ? and e.type = ? ");
|
||||||
|
sqlSB.append(" and d.itemid = "+itemid);
|
||||||
|
sqlSB.append(" order by d.moduleid asc,d.showorder asc");
|
||||||
|
}
|
||||||
|
return sqlSB.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private DocCountService getCountService(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
User user = com.engine.workflow.util.CommonUtil.getUserByRequest(request, response);//根据请求获取用户,包含主次账号信息
|
||||||
|
return ServiceUtil.getService(DocCountServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,113 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@ page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="weaver.hrm.User" %>
|
||||||
|
<%@ page import="weaver.hrm.HrmUserVarify" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.bean.MessageBean" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.bean.MessageType" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.util.Util_Message" %>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.io.IOException" %>
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||||
|
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
boolean flag = true;
|
||||||
|
int smstypeid = Util.getIntValue(request.getParameter("replaytypeid"),505);
|
||||||
|
// User user = HrmUserVarify.getUser(request , response) ;
|
||||||
|
// int userid = user.getUID();
|
||||||
|
|
||||||
|
String fsr = request.getParameter("fsr");
|
||||||
|
String jsr = request.getParameter("jsr");
|
||||||
|
String hfnr = request.getParameter("hfnr");
|
||||||
|
out.println("fsr:"+fsr);
|
||||||
|
out.println("jsr:"+jsr);
|
||||||
|
out.println("hfnr"+hfnr);
|
||||||
|
|
||||||
|
try{
|
||||||
|
if(StringUtils.isNotBlank(fsr) && StringUtils.isNotBlank(jsr)){
|
||||||
|
String jsrname = ResourceComInfo.getLastname(jsr);
|
||||||
|
out.println("jsrname"+jsrname);
|
||||||
|
flag = sendMessage(smstypeid,fsr,hfnr,jsrname);
|
||||||
|
}else{
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
out.println("flag"+flag);
|
||||||
|
|
||||||
|
jsonObject.put("result",flag);
|
||||||
|
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
|
||||||
|
<%!
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean sendMessage(int smstypeid,String jsr,String hfnr,String fsrname) {
|
||||||
|
|
||||||
|
String linkUrl = "";
|
||||||
|
String linkMobileUrl = "";
|
||||||
|
String title = " ";
|
||||||
|
String content = fsrname+"给你回复:"+hfnr;
|
||||||
|
|
||||||
|
Set<String> userSet = new HashSet<String>();
|
||||||
|
userSet.add(jsr);
|
||||||
|
return sendMessage(smstypeid,userSet,title,content,linkUrl,linkMobileUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @param smstypeid
|
||||||
|
* @param sendIdSet
|
||||||
|
* @param title
|
||||||
|
* @param context
|
||||||
|
* @param linkPcUrl
|
||||||
|
* @param linkMobileUrl
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean sendMessage(int smstypeid, Set<String> sendIdSet, String title, String context, String linkPcUrl, String linkMobileUrl)
|
||||||
|
{
|
||||||
|
BaseBean bs = new BaseBean();
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
boolean flag = false;
|
||||||
|
String sumcount="";
|
||||||
|
String sql=" select count(*) as sumcount from ecology_message_type where id='"+smstypeid+"'";
|
||||||
|
rs.execute(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
sumcount=Util.null2String(rs.getString("sumcount"));
|
||||||
|
}
|
||||||
|
if("0".equals(sumcount)){
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageType messageType = MessageType.newInstance(smstypeid); // 消息来源(见文档第四点补充 必填)
|
||||||
|
try {
|
||||||
|
MessageBean messageBean = Util_Message.createMessage(messageType, sendIdSet, title, context, linkPcUrl, linkMobileUrl);
|
||||||
|
messageBean.setCreater(1);// 创建人id
|
||||||
|
messageBean.setDetailTitle("");
|
||||||
|
flag = Util_Message.store(messageBean);
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
flag = false;
|
||||||
|
e.printStackTrace();
|
||||||
|
bs.writeLog("send message error:",e);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,203 @@
|
|||||||
|
<%@ page import="weaver.general.*" %>
|
||||||
|
<%@page import="weaver.conn.RecordSet"%>
|
||||||
|
<%@ page import="weaver.hrm.User" %>
|
||||||
|
<%@ page import="weaver.hrm.HrmUserVarify" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.bean.MessageBean" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.bean.MessageType" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.util.Util_Message" %>
|
||||||
|
<%@ page import="com.alibaba.fastjson.JSONObject" %>
|
||||||
|
<%@ page import="java.io.IOException" %>
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||||
|
<%@ page import="java.text.SimpleDateFormat" %>
|
||||||
|
<%@ page import="weaver.formmode.setup.ModeRightInfo" %>
|
||||||
|
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
|
||||||
|
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
|
||||||
|
User user = HrmUserVarify.getUser(request , response) ;
|
||||||
|
int userid = user.getUID();
|
||||||
|
|
||||||
|
String zftp = request.getParameter("zftp");
|
||||||
|
String sendUserId = request.getParameter("userid");
|
||||||
|
String rzzn = request.getParameter("rzzn");
|
||||||
|
String zfy = request.getParameter("zfy");
|
||||||
|
bb.writeLog("sendUserId:"+sendUserId);
|
||||||
|
bb.writeLog("rzzn:"+rzzn);
|
||||||
|
bb.writeLog("zfy:"+zfy);
|
||||||
|
|
||||||
|
int smstypeid = Util.getIntValue(request.getParameter("smstypeid"),563);
|
||||||
|
try{
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-","");
|
||||||
|
if(StringUtils.isNotBlank(sendUserId)){
|
||||||
|
int count = updateWishesInfo(uuid,userid+"",sendUserId,zfy,zftp);
|
||||||
|
bb.writeLog("count:"+count);
|
||||||
|
if(count > 0){
|
||||||
|
sendMessageBy(sendUserId,smstypeid,zfy,uuid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("result",true);
|
||||||
|
|
||||||
|
%>
|
||||||
|
<%=jsonObject.toString() %>
|
||||||
|
|
||||||
|
|
||||||
|
<%!
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void sendMessageBy(String sendUserId,int smstypeid,String zfy,String uuid) {
|
||||||
|
|
||||||
|
String linkUrl = "/spa/custom/static/index.html#/main/cs/app/d598bf2074434c67af3e008d4f9cfe20_anniversaryView?uuid="+uuid;
|
||||||
|
String linkMobileUrl = "/spa/custom/static/index.html#/main/cs/app/d598bf2074434c67af3e008d4f9cfe20_anniversaryView?uuid="+uuid;
|
||||||
|
String title = " ";
|
||||||
|
String content = zfy;
|
||||||
|
// DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
// LocalDate currentDate = LocalDate.now();
|
||||||
|
// String today = currentDate.format(dateFormatter);
|
||||||
|
|
||||||
|
Set<String> userSet = new HashSet<String>();
|
||||||
|
userSet.add(sendUserId);
|
||||||
|
sendMessage(smstypeid,userSet,title,content,linkUrl,linkMobileUrl);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @param smstypeid
|
||||||
|
* @param sendIdSet
|
||||||
|
* @param title
|
||||||
|
* @param context
|
||||||
|
* @param linkPcUrl
|
||||||
|
* @param linkMobileUrl
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean sendMessage(int smstypeid, Set<String> sendIdSet, String title, String context, String linkPcUrl, String linkMobileUrl)
|
||||||
|
{
|
||||||
|
BaseBean bs = new BaseBean();
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
boolean flag = false;
|
||||||
|
String sumcount="";
|
||||||
|
String sql=" select count(*) as sumcount from ecology_message_type where id='"+smstypeid+"'";
|
||||||
|
rs.execute(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
sumcount=Util.null2String(rs.getString("sumcount"));
|
||||||
|
}
|
||||||
|
if("0".equals(sumcount)){
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageType messageType = MessageType.newInstance(smstypeid); // 消息来源(见文档第四点补充 必填)
|
||||||
|
try {
|
||||||
|
MessageBean messageBean = Util_Message.createMessage(messageType, sendIdSet, title, context, linkPcUrl, linkMobileUrl);
|
||||||
|
messageBean.setCreater(1);// 创建人id
|
||||||
|
messageBean.setDetailTitle("");
|
||||||
|
flag = Util_Message.store(messageBean);
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
flag = false;
|
||||||
|
e.printStackTrace();
|
||||||
|
bs.writeLog("send message error:",e);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%!
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @param uuid
|
||||||
|
*/
|
||||||
|
public int updateWishesInfo(String uuid,String fsr,String jsr,String zfy,String zftp){
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
int count = 0;
|
||||||
|
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||||
|
|
||||||
|
bb.writeLog("uuid:"+uuid);
|
||||||
|
|
||||||
|
SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
SimpleDateFormat formatter2 = new SimpleDateFormat("HH:mm:ss");
|
||||||
|
String currentdate = formatter1.format(new Date());
|
||||||
|
String currenttime = formatter2.format(new Date());
|
||||||
|
String modedatacreater = "1";
|
||||||
|
String modedatacreatertype = "0";
|
||||||
|
|
||||||
|
String fromtable = "uf_rzznzf" ;
|
||||||
|
String formmodeid = "" ;
|
||||||
|
String sql =" select k.id from modeinfo k \n" +
|
||||||
|
" inner join workflow_bill l on formid = l.id\n" +
|
||||||
|
" where l.tablename = '"+fromtable+"' " ;
|
||||||
|
|
||||||
|
rs.execute(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
formmodeid = Util.null2String(rs.getString("id"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bb.writeLog("formmodeid:"+formmodeid);
|
||||||
|
Map<String, String> datas = new HashMap<String, String>();
|
||||||
|
datas.put("formmodeid", formmodeid);
|
||||||
|
datas.put("modedatacreater", modedatacreater);
|
||||||
|
datas.put("modedatacreatertype", modedatacreatertype);
|
||||||
|
datas.put("modedatacreatedate", currentdate);
|
||||||
|
datas.put("modedatacreatetime", currenttime);
|
||||||
|
datas.put("uuid", uuid);
|
||||||
|
datas.put("fsr", fsr);
|
||||||
|
datas.put("fsrid", fsr);
|
||||||
|
datas.put("jsr", jsr);
|
||||||
|
datas.put("jsrid", jsr);
|
||||||
|
datas.put("zfy", zfy);
|
||||||
|
datas.put("zftp", zftp);
|
||||||
|
|
||||||
|
String tablenvalue = "";
|
||||||
|
String tablename = "";
|
||||||
|
for (Map.Entry<String, String> entry : datas.entrySet()) {
|
||||||
|
String fieldname = Util.null2String(entry.getKey()).trim();
|
||||||
|
String fieldvalue = Util.null2String(entry.getValue()).replace("'", "''").trim();
|
||||||
|
tablename += tablename == "" ? fieldname : "," + fieldname;
|
||||||
|
tablenvalue += tablenvalue == "" ? "'" + fieldvalue + "'" : ",'" + fieldvalue + "'";
|
||||||
|
}
|
||||||
|
if (tablename != "" && tablenvalue != "") {
|
||||||
|
|
||||||
|
sql = " insert into " + fromtable + "(" + tablename + ") values (" + tablenvalue + ")";
|
||||||
|
bb.writeLog("sql:" + sql);
|
||||||
|
boolean boo = rs.executeUpdate(sql);
|
||||||
|
if (boo) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
bb.writeLog("count:" + count);
|
||||||
|
if (count > 0) {
|
||||||
|
String dataid = "";
|
||||||
|
sql = " select id from " + fromtable + " where uuid='" + uuid + "'";
|
||||||
|
bb.writeLog("sql:" + sql);
|
||||||
|
rs.execute(sql);
|
||||||
|
if (rs.next()) {
|
||||||
|
dataid = Util.null2String(rs.getString("id"));
|
||||||
|
}
|
||||||
|
if (!"".equals(dataid)) {
|
||||||
|
modeRightInfo.editModeDataShare(Integer.valueOf(modedatacreater), Util.getIntValue(formmodeid), Integer.parseInt(dataid));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue