提交 27a8efee authored 作者: gongwenjie's avatar gongwenjie

合并分支 'gwj' 到 'master'

Gwj 查看合并请求 !104
流水线 #154 已取消 于阶段
...@@ -35,12 +35,18 @@ public class ApprovalInformation { ...@@ -35,12 +35,18 @@ public class ApprovalInformation {
@ApiModelProperty(value = "提交审批用户姓名",example = "1") @ApiModelProperty(value = "提交审批用户姓名",example = "1")
private String name; private String name;
@ApiModelProperty(value = "审核审批用户id",example = "1") @ApiModelProperty(value = "审批用户id1",example = "1")
private String approvalUserIdOne; private String approvalUserIdOne;
@ApiModelProperty(value = "审核审批用户id",example = "1") @ApiModelProperty(value = "审批用户1名字",example = "张三")
private String approvalUserIdOneName;
@ApiModelProperty(value = "审批用户id2",example = "1")
private String approvalUserIdTwo; private String approvalUserIdTwo;
@ApiModelProperty(value = "审批用户2名字",example = "李四")
private String approvalUserIdTwoName;
@ApiModelProperty(value = "审批类型,事假/调休/病假/公出/出差",example = "事假/调休/病假/公出/出差") @ApiModelProperty(value = "审批类型,事假/调休/病假/公出/出差",example = "事假/调休/病假/公出/出差")
private String approvalType; private String approvalType;
......
...@@ -124,14 +124,24 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic ...@@ -124,14 +124,24 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
return false; return false;
} }
/**
* 审核审批
* @param userId
* @param approvalStatus
* @param approvalInformation
* @return
*/
@Override @Override
@Transactional @Transactional
public ApprovalInformation auditApproval(String userId,String approvalStatus,ApprovalInformation approvalInformation) { public ApprovalInformation auditApproval(String userId,String approvalStatus,ApprovalInformation approvalInformation) {
String departmentId = approvalInformation.getDepartmentId(); String departmentId = approvalInformation.getDepartmentId();
String departmentLevel = iUserService.getDepartmentLevel(departmentId); String departmentLevel = iUserService.getDepartmentLevel(departmentId);
System.out.println(departmentLevel);
if(("1").equals(departmentLevel)||("2").equals(departmentLevel)){ if(("1").equals(departmentLevel)||("2").equals(departmentLevel)){
approvalInformation.setApprovalUserIdOne(userId); approvalInformation.setApprovalUserIdOne(userId);
Optional<User> optional = pasUserDao.findById(userId);
if(optional.isPresent()){
approvalInformation.setApprovalUserIdOneName(optional.get().getUsername());
}
if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){ if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){
if(StringUtils.isNotBlank(approvalInformation.getApprovalType())&&approvalInformation.getApprovalType().equals("调休")){ if(StringUtils.isNotBlank(approvalInformation.getApprovalType())&&approvalInformation.getApprovalType().equals("调休")){
UserOverWork userOverWork = userOverWorkDao.findByUserId(approvalInformation.getUserId()); UserOverWork userOverWork = userOverWorkDao.findByUserId(approvalInformation.getUserId());
...@@ -171,6 +181,10 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic ...@@ -171,6 +181,10 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
}else { }else {
if(approvalInformation.getApprovalTwo()==null){ if(approvalInformation.getApprovalTwo()==null){
approvalInformation.setApprovalUserIdTwo(userId); approvalInformation.setApprovalUserIdTwo(userId);
Optional<User> optional = pasUserDao.findById(userId);
if(optional.isPresent()){
approvalInformation.setApprovalUserIdTwoName(optional.get().getUsername());
}
if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){ if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){
approvalInformation.setApprovalTwo("0"); approvalInformation.setApprovalTwo("0");
}else if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("1")){ }else if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("1")){
...@@ -181,6 +195,10 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic ...@@ -181,6 +195,10 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
String parentDepartmentLevel = iUserService.getParentDepartmentLevel(departmentId); String parentDepartmentLevel = iUserService.getParentDepartmentLevel(departmentId);
if(("1").equals(parentDepartmentLevel)||("2").equals(parentDepartmentLevel)){ if(("1").equals(parentDepartmentLevel)||("2").equals(parentDepartmentLevel)){
approvalInformation.setApprovalUserIdOne(userId); approvalInformation.setApprovalUserIdOne(userId);
Optional<User> optional = pasUserDao.findById(userId);
if(optional.isPresent()){
approvalInformation.setApprovalUserIdTwoName(optional.get().getUsername());
}
if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){ if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){
if(StringUtils.isNotBlank(approvalInformation.getApprovalType())&&approvalInformation.getApprovalType().equals("调休")){ if(StringUtils.isNotBlank(approvalInformation.getApprovalType())&&approvalInformation.getApprovalType().equals("调休")){
UserOverWork userOverWork = userOverWorkDao.findByUserId(approvalInformation.getUserId()); UserOverWork userOverWork = userOverWorkDao.findByUserId(approvalInformation.getUserId());
...@@ -220,6 +238,7 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic ...@@ -220,6 +238,7 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
} }
} }
} }
approvalInformationDao.save(approvalInformation);
return approvalInformation; return approvalInformation;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论