#matfron-1# 入职周年、生日祝福开发
@ -0,0 +1,68 @@
|
||||
<%@ 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="com.api.doc.detail.util.DocDownloadCheckUtil" %>
|
||||
<%@ page import="weaver.hrm.User" %>
|
||||
<%@ page import="weaver.hrm.HrmUserVarify" %>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||
|
||||
<%
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
|
||||
User user = HrmUserVarify.getUser (request , response) ;
|
||||
Map<String,String> map = null;
|
||||
List<Map<String,String>> list = new ArrayList<Map<String,String>>();
|
||||
|
||||
String sql = " select id,tp,zfy,zfby from uf_rzzntp where sfqy = 0 ";
|
||||
rs.executeQuery(sql);
|
||||
while (rs.next()){
|
||||
String billid = Util.null2String(rs.getString("id"));
|
||||
String tp = Util.null2String(rs.getString("tp"));
|
||||
String zfy = Util.null2String(rs.getString("zfy"));
|
||||
String zfby = Util.null2String(rs.getString("zfby"));
|
||||
map = new HashMap<String, String>();
|
||||
map.put("billid",billid);
|
||||
map.put("tp",tp);
|
||||
map.put("zfy",zfy);
|
||||
map.put("zfby",zfby);
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
for(int i=0;i<list.size();i++){
|
||||
Map<String,String> dataMap = list.get(i);
|
||||
String tp = dataMap.get("tp");
|
||||
if(StringUtils.isNotBlank(tp)){
|
||||
String imagefileid = "" ;
|
||||
sql = " select k.imagefileid \n" +
|
||||
" from DocImageFile t\n" +
|
||||
" inner join imagefile k on k.imagefileid = t.imagefileid\n" +
|
||||
" where docid="+tp ;
|
||||
rs.executeQuery(sql);
|
||||
if(rs.next()){
|
||||
imagefileid = Util.null2String(rs.getString("imagefileid"));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(imagefileid)){
|
||||
String imageurl ="";
|
||||
String imagefileid_ = DocDownloadCheckUtil.checkPermission(imagefileid,user);
|
||||
if(StringUtils.isNotBlank(imagefileid_)){
|
||||
imageurl = "/weaver/weaver.file.FileDownload?fileid="+imagefileid_;
|
||||
}
|
||||
dataMap.put("imagefileid",imagefileid);
|
||||
dataMap.put("imageurl",imageurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data",list);
|
||||
|
||||
%>
|
||||
<%=jsonObject.toString() %>
|
||||
|
||||
|
||||
|
||||
|
@ -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,64 @@
|
||||
<%@ 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="com.api.doc.detail.util.DocDownloadCheckUtil" %>
|
||||
<%@ page import="weaver.hrm.User" %>
|
||||
<%@ page import="weaver.hrm.HrmUserVarify" %>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||
|
||||
<%
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
|
||||
User user = HrmUserVarify.getUser (request , response) ;
|
||||
Map<String,String> map = null;
|
||||
List<Map<String,String>> list = new ArrayList<Map<String,String>>();
|
||||
|
||||
String sql = " select id,tp from uf_srzftp where sfqy = 0 ";
|
||||
rs.executeQuery(sql);
|
||||
while (rs.next()){
|
||||
String billid = Util.null2String(rs.getString("id"));
|
||||
String tp = Util.null2String(rs.getString("tp"));
|
||||
map = new HashMap<String, String>();
|
||||
map.put("billid",billid);
|
||||
map.put("tp",tp);
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
for(int i=0;i<list.size();i++){
|
||||
Map<String,String> dataMap = list.get(i);
|
||||
String tp = dataMap.get("tp");
|
||||
if(StringUtils.isNotBlank(tp)){
|
||||
String imagefileid = "" ;
|
||||
sql = " select k.imagefileid \n" +
|
||||
" from DocImageFile t\n" +
|
||||
" inner join imagefile k on k.imagefileid = t.imagefileid\n" +
|
||||
" where docid="+tp ;
|
||||
rs.executeQuery(sql);
|
||||
if(rs.next()){
|
||||
imagefileid = Util.null2String(rs.getString("imagefileid"));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(imagefileid)){
|
||||
String imageurl ="";
|
||||
String imagefileid_ = DocDownloadCheckUtil.checkPermission(imagefileid,user);
|
||||
if(StringUtils.isNotBlank(imagefileid_)){
|
||||
imageurl = "/weaver/weaver.file.FileDownload?fileid="+imagefileid_;
|
||||
}
|
||||
dataMap.put("imagefileid",imagefileid);
|
||||
dataMap.put("imageurl",imageurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data",list);
|
||||
|
||||
%>
|
||||
<%=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);
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 372 KiB |
After Width: | Height: | Size: 404 KiB |
After Width: | Height: | Size: 204 KiB |
After Width: | Height: | Size: 404 KiB |
After Width: | Height: | Size: 180 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 213 B |
After Width: | Height: | Size: 32 KiB |
@ -0,0 +1,194 @@
|
||||
<%@ 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="com.engine.cube.service.ModeCardService" %>
|
||||
<%@ page import="com.engine.common.util.ServiceUtil" %>
|
||||
<%@ page import="com.engine.cube.service.impl.ModCardServiceImpl" %>
|
||||
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||
<%@ page import="sun.misc.BASE64Encoder" %>
|
||||
<%@ page import="sun.misc.BASE64Decoder" %>
|
||||
<%@ page import="com.api.doc.detail.util.DocDownloadCheckUtil" %>
|
||||
<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" %>
|
||||
|
||||
<%
|
||||
RecordSet rs = new RecordSet();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser (request , response) ;
|
||||
String lastname = user.getLastname();
|
||||
|
||||
String layoutid = "1117" ;
|
||||
int smstypeid_ = 537 ;
|
||||
|
||||
String billid = request.getParameter("billid");
|
||||
String modeid = request.getParameter("modeid");
|
||||
String formid = request.getParameter("formid");
|
||||
String userid = request.getParameter("userid") ;
|
||||
String anniversary = request.getParameter("rzzn") ;
|
||||
|
||||
bb.writeLog("userid3333:"+userid);
|
||||
|
||||
String zfy = request.getParameter("zfy") ;
|
||||
String imagefileid = request.getParameter("imagefileid") ;
|
||||
String imagebillid = request.getParameter("imagebillid") ;
|
||||
String imageurl = "" ;
|
||||
if(StringUtils.isNotBlank(imagefileid)){
|
||||
String imagefileid_ = DocDownloadCheckUtil.checkPermission(imagefileid,null);
|
||||
if(StringUtils.isNotBlank(imagefileid_)){
|
||||
imageurl = "/weaver/weaver.file.FileDownload?fileid="+imagefileid_;
|
||||
}
|
||||
}else {
|
||||
String tp = "";
|
||||
String imageid = "";
|
||||
String sql = " select tp from uf_rzzntp where id = " + imagebillid;
|
||||
rs.executeQuery(sql);
|
||||
if (rs.next()) {
|
||||
tp = Util.null2String(rs.getString("tp"));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(tp)) {
|
||||
sql = " select k.imagefileid \n" +
|
||||
" from DocImageFile t \n" +
|
||||
" inner join imagefile k on k.imagefileid = t.imagefileid \n" +
|
||||
" where docid= " + tp;
|
||||
rs.executeQuery(sql);
|
||||
if (rs.next()) {
|
||||
imageid = Util.null2String(rs.getString("imagefileid"));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(imageid)) {
|
||||
String imagefileid_ = DocDownloadCheckUtil.checkPermission(imageid, null);
|
||||
if (StringUtils.isNotBlank(imagefileid_)) {
|
||||
imageurl = "/weaver/weaver.file.FileDownload?fileid=" + imagefileid_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int smstypeid = Util.getIntValue(request.getParameter("smstypeid"),smstypeid_);
|
||||
|
||||
String from = "reply";
|
||||
String src = "submit";
|
||||
String iscreate = "1" ;
|
||||
String isFormMode = "1";
|
||||
String username = "" ;
|
||||
if(StringUtils.isNotEmpty(userid)){
|
||||
username = ResourceComInfo.getLastname(userid);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(username) && StringUtils.isNotBlank(anniversary)){
|
||||
|
||||
// String zfy = "亲爱的$userid$,入职$anniversary$周年纪念日快乐!";
|
||||
// zfy = zfy.replace("$userid$",username);
|
||||
// zfy = zfy.replace("$anniversary$",anniversary);
|
||||
|
||||
BASE64Decoder decoder = new BASE64Decoder();
|
||||
if(StringUtils.isNotBlank(zfy)){
|
||||
zfy = new String(decoder.decodeBuffer(zfy),"UTF-8");
|
||||
}
|
||||
|
||||
String contentHtml ="<p><img alt=\"\" src=\""+imageurl+"\" /></p>\n" +
|
||||
"<p> </p>\n" +
|
||||
"<p>"+zfy+"</p> ";
|
||||
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String replycontent = encoder.encode(contentHtml.getBytes("UTF-8"));
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<String, Object>();
|
||||
paramMap.put("reqModeId",modeid);
|
||||
paramMap.put("reqBillid",billid);
|
||||
paramMap.put("reqFormid",formid);
|
||||
paramMap.put("isFormMode",isFormMode);
|
||||
paramMap.put("from",from);
|
||||
paramMap.put("src",src);
|
||||
paramMap.put("iscreate",iscreate);
|
||||
paramMap.put("replycontent",replycontent);
|
||||
paramMap.put("isEditOpt","0");
|
||||
|
||||
Map<String,Object> dataMap = this.getService(user).replySubmit(paramMap,user);
|
||||
if(dataMap.isEmpty()){
|
||||
apidatas.put("status", "1");
|
||||
|
||||
String linkUrl = "/spa/cube/index.html#/main/cube/card?type=0&modeId="+modeid+"&formId="+formid+"&billid="+billid+"&layoutid="+layoutid;
|
||||
String linkMobileUrl = "/spa/cube/index.html#/main/cube/card?type=0&modeId="+modeid+"&formId="+formid+"&billid="+billid+"&layoutid="+layoutid;
|
||||
bb.writeLog("linkUrl:"+linkUrl);
|
||||
String title = " ";
|
||||
String content = lastname+"祝您:</br>"+zfy;
|
||||
Set<String> userSet = new HashSet<String>();
|
||||
userSet.add(userid);
|
||||
sendMessage(smstypeid,userSet,title,content,linkUrl,linkMobileUrl);
|
||||
|
||||
jsonObject.put("code","200");
|
||||
jsonObject.put("data",apidatas);
|
||||
}else{
|
||||
apidatas.put("status", "0");
|
||||
jsonObject.put("code","100");
|
||||
}
|
||||
}else{
|
||||
jsonObject.put("code","-100");
|
||||
}
|
||||
|
||||
jsonObject.put("result",true);
|
||||
%>
|
||||
<%=jsonObject.toJSONString() %>
|
||||
|
||||
<%!
|
||||
|
||||
private ModeCardService getService(User user) {
|
||||
return (ModeCardService) ServiceUtil.getService(ModCardServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @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,190 @@
|
||||
<%@ 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="com.engine.cube.service.ModeCardService" %>
|
||||
<%@ page import="com.engine.common.util.ServiceUtil" %>
|
||||
<%@ page import="com.engine.cube.service.impl.ModCardServiceImpl" %>
|
||||
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||
<%@ page import="sun.misc.BASE64Encoder" %>
|
||||
<%@ page import="sun.misc.BASE64Decoder" %>
|
||||
<%@ page import="com.api.doc.detail.util.DocDownloadCheckUtil" %>
|
||||
<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" %>
|
||||
|
||||
<%
|
||||
RecordSet rs = new RecordSet();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser (request , response) ;
|
||||
String lastname = user.getLastname();
|
||||
String layoutid = "1118" ;
|
||||
int smstypeid_ = 581 ;
|
||||
|
||||
String billid = request.getParameter("billid");
|
||||
String modeid = request.getParameter("modeid");
|
||||
String formid = request.getParameter("formid");
|
||||
String userid = request.getParameter("userid") ;
|
||||
|
||||
bb.writeLog("userid666:"+userid);
|
||||
|
||||
String zfy = request.getParameter("zfy") ;
|
||||
String imagefileid = request.getParameter("imagefileid") ;
|
||||
String imagebillid = request.getParameter("imagebillid") ;
|
||||
String imageurl = "" ;
|
||||
if(StringUtils.isNotBlank(imagefileid)){
|
||||
String imagefileid_ = DocDownloadCheckUtil.checkPermission(imagefileid,null);
|
||||
if(StringUtils.isNotBlank(imagefileid_)){
|
||||
imageurl = "/weaver/weaver.file.FileDownload?fileid="+imagefileid_;
|
||||
}
|
||||
}else {
|
||||
String tp = "";
|
||||
String imageid = "";
|
||||
String sql = " select tp from uf_srzftp where id = " + imagebillid;
|
||||
rs.executeQuery(sql);
|
||||
if (rs.next()) {
|
||||
tp = Util.null2String(rs.getString("tp"));
|
||||
}
|
||||
bb.writeLog("tp:"+tp);
|
||||
if (StringUtils.isNotBlank(tp)) {
|
||||
sql = " select k.imagefileid \n" +
|
||||
" from DocImageFile t \n" +
|
||||
" inner join imagefile k on k.imagefileid = t.imagefileid \n" +
|
||||
" where docid= " + tp;
|
||||
rs.executeQuery(sql);
|
||||
if (rs.next()) {
|
||||
imageid = Util.null2String(rs.getString("imagefileid"));
|
||||
}
|
||||
bb.writeLog("imageid:"+imageid);
|
||||
if (StringUtils.isNotBlank(imageid)) {
|
||||
String imagefileid_ = DocDownloadCheckUtil.checkPermission(imageid, null);
|
||||
if (StringUtils.isNotBlank(imagefileid_)) {
|
||||
imageurl = "/weaver/weaver.file.FileDownload?fileid=" + imagefileid_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int smstypeid = Util.getIntValue(request.getParameter("smstypeid"),smstypeid_);
|
||||
|
||||
String from = "reply";
|
||||
String src = "submit";
|
||||
String iscreate = "1" ;
|
||||
String isFormMode = "1";
|
||||
String username = "" ;
|
||||
if(StringUtils.isNotEmpty(userid)){
|
||||
username = ResourceComInfo.getLastname(userid);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(username)){
|
||||
|
||||
BASE64Decoder decoder = new BASE64Decoder();
|
||||
if(StringUtils.isNotBlank(zfy)){
|
||||
zfy = new String(decoder.decodeBuffer(zfy),"UTF-8");
|
||||
}
|
||||
|
||||
String contentHtml ="<p><img alt=\"\" src=\""+imageurl+"\" /></p>\n" +
|
||||
"<p> </p>\n" +
|
||||
"<p>"+zfy+"</p> ";
|
||||
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String replycontent = encoder.encode(contentHtml.getBytes("UTF-8"));
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<String, Object>();
|
||||
|
||||
paramMap.put("reqModeId",modeid);
|
||||
paramMap.put("reqBillid",billid);
|
||||
paramMap.put("reqFormid",formid);
|
||||
paramMap.put("isFormMode",isFormMode);
|
||||
paramMap.put("from",from);
|
||||
paramMap.put("src",src);
|
||||
paramMap.put("iscreate",iscreate);
|
||||
paramMap.put("replycontent",replycontent);
|
||||
paramMap.put("isEditOpt","0");
|
||||
|
||||
Map<String,Object> dataMap = this.getService(user).replySubmit(paramMap,user);
|
||||
if(dataMap.isEmpty()){
|
||||
apidatas.put("status", "1");
|
||||
|
||||
String linkUrl = "/spa/cube/index.html#/main/cube/card?type=0&modeId="+modeid+"&formId="+formid+"&billid="+billid+"&layoutid="+layoutid;
|
||||
String linkMobileUrl = "/spa/cube/index.html#/main/cube/card?type=0&modeId="+modeid+"&formId="+formid+"&billid="+billid+"&layoutid="+layoutid;
|
||||
bb.writeLog("linkUrl:"+linkUrl);
|
||||
String title = " ";
|
||||
String content = lastname+"祝您:</br>"+zfy;
|
||||
Set<String> userSet = new HashSet<String>();
|
||||
userSet.add(userid);
|
||||
sendMessage(smstypeid,userSet,title,content,linkUrl,linkMobileUrl);
|
||||
|
||||
jsonObject.put("code","200");
|
||||
jsonObject.put("data",apidatas);
|
||||
}else{
|
||||
apidatas.put("status", "0");
|
||||
jsonObject.put("code","100");
|
||||
}
|
||||
}else{
|
||||
jsonObject.put("code","-100");
|
||||
}
|
||||
|
||||
jsonObject.put("result",true);
|
||||
%>
|
||||
<%=jsonObject.toJSONString() %>
|
||||
|
||||
<%!
|
||||
|
||||
private ModeCardService getService(User user) {
|
||||
return (ModeCardService) ServiceUtil.getService(ModCardServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
||||
%>
|
||||
|
||||
|
||||
|
||||
|