QC3445872 美之高门户元素开发

美之高考勤假期
Chengliang 5 months ago
parent c37ab9fe6e
commit 3af54cb1f5

@ -20,4 +20,5 @@ public class BirthdayRemindVo {
private String lastname;
private Integer day;
}

@ -35,11 +35,11 @@ public interface PortalElementCusService {
List<TodoNoticeTrainVo> todoNoticeTrain(HttpServletRequest request, HttpServletResponse response);
/**
* @Description:
* @Description: ()
* @Author: liang.cheng
* @Date: 2024/12/23 2:23 PM
* @param: []
* @return: com.engine.mzgsecond.entity.BirthdayRemindVo
*/
BirthdayRemindVo birthdayRemind();
List<BirthdayRemindVo> birthdayRemind();
}

@ -6,14 +6,17 @@ 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.kq.biz.KQBalanceOfLeaveBiz;
import com.engine.mzgsecond.entity.BirthdayRemindVo;
import com.engine.mzgsecond.entity.PersonInfoVo;
import com.engine.mzgsecond.entity.TodoNoticeTrainVo;
import com.engine.mzgsecond.service.PortalElementCusService;
import com.engine.workflow.service.impl.RequestListServiceImpl;
import org.apache.commons.lang.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.common.database.dialect.DialectUtil;
import weaver.hrm.job.JobTitlesComInfo;
import weaver.hrm.resource.ResourceComInfo;
@ -23,8 +26,10 @@ import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author liang.cheng
@ -38,6 +43,13 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
RecordSet rs = new RecordSet();
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
String amountId = rs.getPropValue("mzgsecond", "amountId");
String currentDate = DateUtil.getCurrentDate();
String restAmount = KQBalanceOfLeaveBiz.getRestAmount(String.valueOf(user.getUID()),amountId,currentDate);
String txAmountId = rs.getPropValue("mzgsecond", "txAmountId");
String txRestAmount = KQBalanceOfLeaveBiz.getRestAmount(String.valueOf(user.getUID()),txAmountId,currentDate);
PersonInfoVo personInfo = PersonInfoVo.builder()
.id(user.getUID())
.imageUrl(getImageFile(String.valueOf(user.getUID())))
@ -45,8 +57,8 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
.status(getStatus(user.getStatus()))
.jobTitle(jobTitlesComInfo.getJobTitlesname(user.getJobtitle()))
.day(0)
.amount("0.00")
.txAmount("0.00")
.amount(restAmount)
.txAmount(txRestAmount)
.performance("未开始")
.build();
@ -55,12 +67,11 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
if (rs.next()) {
companystartdate = Util.null2String(rs.getString("companystartdate"));
}
if (StringUtils.isNotEmpty(companystartdate)) {
personInfo.setDay(getCompanyDay(companystartdate));
}
return personInfo;
}
@ -126,8 +137,34 @@ public class PortalElementCusServiceImpl extends Service implements PortalElemen
}
@Override
public BirthdayRemindVo birthdayRemind() {
return null;
public List<BirthdayRemindVo> birthdayRemind() {
List<BirthdayRemindVo> birthdayRemindVos = new ArrayList<>();
String currentMonth = DateUtil.getCurrentDate().substring(5, 7);
int day = Integer.parseInt(DateUtil.getCurrentDate().substring(8, 10));
RecordSet rs = new RecordSet();
String substrFun = ("oracle".equals(rs.getDBType()) || DialectUtil.isMySql(rs.getDBType())) ? "substr" : "substring";
rs.executeQuery("select lastname,"+substrFun+"(birthday,9,2) as days from hrmresource where birthday is not null and birthday <> ''\n" +
" and "+substrFun+"(birthday,6,2) = ? order by secLevel desc",currentMonth);
while (rs.next()) {
String lastname = Util.null2String(rs.getString("lastname"));
int days = Util.getIntValue(rs.getString("days"));
int betweenDay = days - day;
if (betweenDay >= 0) {
birthdayRemindVos.add(BirthdayRemindVo.builder()
.lastname(lastname)
.day(betweenDay)
.build());
}
}
//获取前3条数据
return birthdayRemindVos.stream()
.sorted(Comparator.comparing(BirthdayRemindVo::getDay))
.limit(3)
.collect(Collectors.toList());
}

@ -1,5 +1,7 @@
package test;
import weaver.common.DateUtil;
/**
* @Author weaver_cl
* @Description:
@ -9,6 +11,11 @@ package test;
public class MainTest {
public static void main(String[] args) {
String currentMonth = DateUtil.getCurrentDate().substring(5, 7);
int day = Integer.parseInt(DateUtil.getCurrentDate().substring(8, 10));
System.out.println(currentMonth);
System.out.println(day);
}
}

Loading…
Cancel
Save