|
|
@ -1,10 +1,25 @@
|
|
|
|
package com.engine.mzgsecond.service.impl;
|
|
|
|
package com.engine.mzgsecond.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
import com.api.doc.mobile.systemDoc.util.CategoryUtil;
|
|
|
|
|
|
|
|
import com.engine.common.util.ParamUtil;
|
|
|
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
import com.engine.mzgsecond.entity.BirthdayRemindVo;
|
|
|
|
import com.engine.mzgsecond.entity.BirthdayRemindVo;
|
|
|
|
import com.engine.mzgsecond.entity.PersonInfoVo;
|
|
|
|
import com.engine.mzgsecond.entity.PersonInfoVo;
|
|
|
|
import com.engine.mzgsecond.entity.TodoNoticeTrainVo;
|
|
|
|
import com.engine.mzgsecond.entity.TodoNoticeTrainVo;
|
|
|
|
import com.engine.mzgsecond.service.PortalElementCusService;
|
|
|
|
import com.engine.mzgsecond.service.PortalElementCusService;
|
|
|
|
|
|
|
|
import com.engine.workflow.service.impl.RequestListServiceImpl;
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @Author liang.cheng
|
|
|
|
* @Author liang.cheng
|
|
|
@ -19,12 +34,86 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public TodoNoticeTrainVo todoNoticeTrain() {
|
|
|
|
public List<TodoNoticeTrainVo> todoNoticeTrain(HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
return null;
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
|
|
List<TodoNoticeTrainVo> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 待办事项
|
|
|
|
|
|
|
|
TodoNoticeTrainVo todo = TodoNoticeTrainVo.builder()
|
|
|
|
|
|
|
|
.key("todo")
|
|
|
|
|
|
|
|
.title("待办事项")
|
|
|
|
|
|
|
|
.count(0)
|
|
|
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "todoUrl"))
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
Map<String, Object> todoMap = ServiceUtil.getService(RequestListServiceImpl.class, user).doingCountInfo(request);
|
|
|
|
|
|
|
|
JSONObject totDatas = JSONObject.parseObject(JSONObject.toJSONString(todoMap));
|
|
|
|
|
|
|
|
if (totDatas.containsKey("totalcount")) {
|
|
|
|
|
|
|
|
JSONObject totalCount = totDatas.getJSONObject("totalcount");
|
|
|
|
|
|
|
|
String flowAll = totalCount.getString("flowAll");
|
|
|
|
|
|
|
|
todo.setCount(Convert.toInt(flowAll, 0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
list.add(todo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 通知公告
|
|
|
|
|
|
|
|
TodoNoticeTrainVo notice = TodoNoticeTrainVo.builder()
|
|
|
|
|
|
|
|
.key("notice")
|
|
|
|
|
|
|
|
.title("通知公告")
|
|
|
|
|
|
|
|
.count(0)
|
|
|
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "noticeUrl"))
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
List<String> secCategoryList = new ArrayList<>();
|
|
|
|
|
|
|
|
String rootDirectory = rs.getPropValue("mzgsecond", "docId");
|
|
|
|
|
|
|
|
getSubdirectories(rootDirectory, secCategoryList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> params = ParamUtil.request2Map(request);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
params.put("secid", StringUtils.join(secCategoryList, ","));
|
|
|
|
|
|
|
|
Map<String, Object> result = CategoryUtil.getHasDocOfCategoryNum(user, CategoryUtil.NEWS_DOC, params);
|
|
|
|
|
|
|
|
String allNoReadNum = Util.null2String(result.get("allnoReadNum"));
|
|
|
|
|
|
|
|
notice.setCount(Convert.toInt(allNoReadNum, 0));
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
rs.writeLog(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list.add(notice);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 培训活动
|
|
|
|
|
|
|
|
TodoNoticeTrainVo train = TodoNoticeTrainVo.builder()
|
|
|
|
|
|
|
|
.key("train")
|
|
|
|
|
|
|
|
.title("培训活动")
|
|
|
|
|
|
|
|
.count(0)
|
|
|
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "trainUrl"))
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
rs.executeQuery("select count(1) as num from uf_pxgcjl where zt = 0 ");
|
|
|
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
|
|
|
String number = rs.getString("num");
|
|
|
|
|
|
|
|
train.setCount(Convert.toInt(number, 0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
list.add(train);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public BirthdayRemindVo birthdayRemind() {
|
|
|
|
public BirthdayRemindVo birthdayRemind() {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 递归获取所有子目录
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param rootDirectory
|
|
|
|
|
|
|
|
* @param seccategoryList
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void getSubdirectories(String rootDirectory, List<String> seccategoryList) {
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
|
|
seccategoryList.add(rootDirectory);
|
|
|
|
|
|
|
|
rs.executeQuery("select id from DocSecCategory where parentid = ?", rootDirectory);
|
|
|
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
|
|
|
String id = rs.getString("id");
|
|
|
|
|
|
|
|
getSubdirectories(id, seccategoryList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|