|
|
|
@ -14,9 +14,14 @@ import com.engine.workflow.service.impl.RequestListServiceImpl;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.job.JobTitlesComInfo;
|
|
|
|
|
import weaver.hrm.resource.ResourceComInfo;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -30,7 +35,33 @@ import java.util.Map;
|
|
|
|
|
public class PortalElementCusServiceImpl extends Service implements PortalElementCusService {
|
|
|
|
|
@Override
|
|
|
|
|
public PersonInfoVo personInfo() {
|
|
|
|
|
return null;
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
|
|
|
|
|
|
|
|
|
|
PersonInfoVo personInfo = PersonInfoVo.builder()
|
|
|
|
|
.id(user.getUID())
|
|
|
|
|
.imageUrl(getImageFile(String.valueOf(user.getUID())))
|
|
|
|
|
.lastname(Util.formatMultiLang(user.getLastname(),String.valueOf(user.getLanguage())))
|
|
|
|
|
.status(getStatus(user.getStatus()))
|
|
|
|
|
.jobTitle(jobTitlesComInfo.getJobTitlesname(user.getJobtitle()))
|
|
|
|
|
.day(0)
|
|
|
|
|
.amount("0.00")
|
|
|
|
|
.txAmount("0.00")
|
|
|
|
|
.performance("未开始")
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
String companystartdate = "";
|
|
|
|
|
rs.executeQuery("select companystartdate from hrmresource where id = ?",user.getUID());
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
companystartdate = Util.null2String(rs.getString("companystartdate"));
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(companystartdate)) {
|
|
|
|
|
personInfo.setDay(getCompanyDay(companystartdate));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return personInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -43,7 +74,7 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
|
|
|
|
|
.key("todo")
|
|
|
|
|
.title("待办事项")
|
|
|
|
|
.count(0)
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "todoUrl"))
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "todoUrl").replace("'", ""))
|
|
|
|
|
.build();
|
|
|
|
|
Map<String, Object> todoMap = ServiceUtil.getService(RequestListServiceImpl.class, user).doingCountInfo(request);
|
|
|
|
|
JSONObject totDatas = JSONObject.parseObject(JSONObject.toJSONString(todoMap));
|
|
|
|
@ -59,7 +90,7 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
|
|
|
|
|
.key("notice")
|
|
|
|
|
.title("通知公告")
|
|
|
|
|
.count(0)
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "noticeUrl"))
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "noticeUrl").replace("'", ""))
|
|
|
|
|
.build();
|
|
|
|
|
List<String> secCategoryList = new ArrayList<>();
|
|
|
|
|
String rootDirectory = rs.getPropValue("mzgsecond", "docId");
|
|
|
|
@ -82,7 +113,7 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
|
|
|
|
|
.key("train")
|
|
|
|
|
.title("培训活动")
|
|
|
|
|
.count(0)
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "trainUrl"))
|
|
|
|
|
.url(rs.getPropValue("mzgsecond", "trainUrl").replace("'", ""))
|
|
|
|
|
.build();
|
|
|
|
|
rs.executeQuery("select count(1) as num from uf_pxgcjl where zt = 0 ");
|
|
|
|
|
if (rs.next()) {
|
|
|
|
@ -116,4 +147,50 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getStatus(int status) {
|
|
|
|
|
String statusName = "";
|
|
|
|
|
switch (status){
|
|
|
|
|
case 0:
|
|
|
|
|
statusName="试用";break;
|
|
|
|
|
case 1:
|
|
|
|
|
statusName="正式";break;
|
|
|
|
|
case 2:
|
|
|
|
|
statusName="临时";break;
|
|
|
|
|
case 3:
|
|
|
|
|
statusName="试用延期";break;
|
|
|
|
|
case 4:
|
|
|
|
|
statusName="解聘";break;
|
|
|
|
|
case 5:
|
|
|
|
|
statusName="离职";break;
|
|
|
|
|
case 6:
|
|
|
|
|
statusName="退休";break;
|
|
|
|
|
case 7:
|
|
|
|
|
statusName="无效";break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return statusName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getImageFile(String uId) {
|
|
|
|
|
String imageUrl = "";
|
|
|
|
|
try {
|
|
|
|
|
imageUrl = new ResourceComInfo().getMessagerUrls(uId);
|
|
|
|
|
if ("/messager/images/icon_w_wev8.jpg".equals(imageUrl) || "/messager/images/icon_m_wev8.jpg".equals(imageUrl)) {
|
|
|
|
|
imageUrl = "";
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return imageUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int getCompanyDay(String companyDate) {
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
LocalDate startDate = LocalDate.parse(companyDate, formatter);
|
|
|
|
|
LocalDate currentDate = LocalDate.now();
|
|
|
|
|
return (int)ChronoUnit.DAYS.between(startDate, currentDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|