Commit b2e8519f by 翁国栋

审批假期时间显示

parent ae2a67c6
......@@ -2,11 +2,14 @@ package cn.timer.api.controller.spmk;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.annotation.Role;
import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.bean.jxgl.JxglAppraisalT;
import cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.spmk.*;
import cn.timer.api.bean.zzgl.ZzglAuth;
......@@ -112,7 +115,7 @@ public class AdminSpmkController {
// 查询 SpmkApproveSummary 状态,
SpmkApproveSummary aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts)
.select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType,SpmkApproveSummary::getEmpNum,SpmkApproveSummary::getOrgCode)
.eq(SpmkApproveSummary::getId, asId));
// if (aSummary.getSts() > ApproveSummarySts.IN.ordinal()) {
......@@ -129,7 +132,24 @@ public class AdminSpmkController {
// redisUtil.set(asId.toString(),0,500);
// return ResultUtil.error("您已审批过!");
// }
//判断是否是请假审批
if(aSummary.getAssoType()==ApproveEnum.LEAVE.getType()){
if(approvingDto.getSts()==2) {
JSONObject jSONObject = jsonObject.parseObject(ad.getRequestData(), JSONObject.class);
// 请假类型 - 前端传中文
String LeaveType = ObjectUtil.isNull(jSONObject.get("__LeaveType", FromData.class)) ? null : jSONObject.get("__LeaveType", FromData.class).getValue();
// 时长
String longTime = ObjectUtil.isNull(jSONObject.get("__longTime", FromData.class)) ? null : jSONObject.get("__longTime", FromData.class).getValue();
//判断这个人假期是否足够
KqglAssoLeaveEmployeeBalance emba = KqglAssoLeaveEmployeeBalance.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getLeaveRulesId, Convert.toInt(LeaveType))
.eq(KqglAssoLeaveEmployeeBalance::getUserid, aSummary.getEmpNum()).eq(KqglAssoLeaveEmployeeBalance::getOrgCode, aSummary.getOrgCode()));
if (emba != null) {
if (emba.getBalanceDays()!=-1&&emba.getBalanceDays() < Convert.toInt(longTime)) {
return ResultUtil.error("当前发起人假期余额不足");
}
}
}
}
if ( spmkExecutorMapper.selectCount(new QueryWrapper<SpmkExecutor>().lambda()
.eq(SpmkExecutor::getId, approvingDto.getExecutorId())
.eq(SpmkExecutor::getEmpNum, userBean.getEmpNum())
......@@ -207,6 +227,7 @@ public class AdminSpmkController {
*/
if (fc.getExecute() == "2") {
// 查询 SpmkApproveSummary 状态
aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType)
......
......@@ -5,9 +5,11 @@ import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.convert.Convert;
import cn.hutool.db.sql.SqlBuilder;
import cn.timer.api.bean.crm.CrmBusinessGroupMember;
import cn.timer.api.bean.crm.CrmClientContacts;
import cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance;
import cn.timer.api.bean.sche.ScheduleTask;
import cn.timer.api.bean.spmk.*;
import cn.timer.api.bean.zzgl.ZzglAuth;
......@@ -833,7 +835,7 @@ public class SpmkController {
// 查询 SpmkApproveSummary 状态,
SpmkApproveSummary aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts)
.select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType,SpmkApproveSummary::getEmpNum,SpmkApproveSummary::getOrgCode)
.eq(SpmkApproveSummary::getId, asId));
if (aSummary.getSts() > ApproveSummarySts.IN.ordinal()) {
......@@ -869,6 +871,26 @@ public class SpmkController {
}
//判断是否是请假审批
if(aSummary.getAssoType()==ApproveEnum.LEAVE.getType()){
if(approvingDto.getSts()==2) {
JSONObject jSONObject = jsonObject.parseObject(ad.getRequestData(), JSONObject.class);
// 请假类型 - 前端传中文
String LeaveType = ObjectUtil.isNull(jSONObject.get("__LeaveType", FromData.class)) ? null : jSONObject.get("__LeaveType", FromData.class).getValue();
// 时长
String longTime = ObjectUtil.isNull(jSONObject.get("__longTime", FromData.class)) ? null : jSONObject.get("__longTime", FromData.class).getValue();
//判断这个人假期是否足够
KqglAssoLeaveEmployeeBalance emba = KqglAssoLeaveEmployeeBalance.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getLeaveRulesId, Convert.toInt(LeaveType))
.eq(KqglAssoLeaveEmployeeBalance::getUserid, aSummary.getEmpNum()).eq(KqglAssoLeaveEmployeeBalance::getOrgCode, aSummary.getOrgCode()));
if (emba != null) {
if (emba.getBalanceDays()!=-1&&emba.getBalanceDays() < Convert.toInt(longTime)) {
return ResultUtil.error("当前发起人假期余额不足");
}
}
}
}
if (aSummary.getSts() == 0) {
List<FlowChildren> listFlowChildren = jsonObject.parseArray(ad.getFlowChildren(), FlowChildren.class);
// 审批逻辑
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment