临时外出加培训

This commit is contained in:
fl 2025-03-06 10:00:14 +08:00
parent 3013746145
commit 724e3a6aad
3 changed files with 37 additions and 4 deletions

View File

@ -61,6 +61,11 @@ public class HolidayBean {
* 请假开始时段1上午2下午
*/
private String leaveStartInterval;
/**
* 是否培训 1上午2下午
*/
private String isTrain;
/**
* 请假结束日期
*/

View File

@ -197,7 +197,15 @@ public class WeChatServiceImpl implements WeChatService {
public List<HolidayBean> getHolidaysList(HolidayBean bean) {
Long userId = Long.valueOf(UserUtil.getLoginUser().getUserId());
bean.setUserId(userId);
return dao.getHolidaysList(bean);
List<HolidayBean> holidaysList = dao.getHolidaysList(bean);
holidaysList.forEach(item -> {
if("培训".equals(item.getLeaveType())){
item.setIsTrain("1");
}else {
item.setIsTrain("0");
}
});
return holidaysList;
}
/**
@ -207,7 +215,14 @@ public class WeChatServiceImpl implements WeChatService {
*/
@Override
public HolidayBean getHolidaysDetail(String uuId) {
return dao.getHolidaysDetail(uuId);
HolidayBean holidayBean = dao.getHolidaysDetail(uuId);
//是否培训
if("培训".equals(holidayBean.getLeaveType())){
holidayBean.setIsTrain("1");
}else {
holidayBean.setIsTrain("0");
}
return holidayBean;
}
/**
@ -224,7 +239,11 @@ public class WeChatServiceImpl implements WeChatService {
o.setSource("3");
o.setUserId(userId);
if("临时外出".equals(o.getType())){
//是否培训
if("1".equals(o.getIsTrain())){
o.setLeaveType("培训");
}
o.setType(o.getLeaveType());
}else{
o.setLeaveStartInterval("1");
o.setLeaveEndInterval("2");

View File

@ -441,7 +441,16 @@
la.examine_status as examineStatus
FROM leave_apply_wechat la
WHERE la.is_active = '1'
and la.type = #{type}
<if test="type != null and type != '' ">
<choose>
<when test="type == '临时外出'">
and ( locate(#{type},la.type) or locate('培训',la.type) )
</when>
<otherwise>
and locate(#{type},la.type)
</otherwise>
</choose>
</if>
and la.user_id = #{userId}
ORDER BY la.update_time DESC
</select>