提交 27338b22 authored 作者: gongwenjie's avatar gongwenjie

考勤

上级 3425d192
package com.zjty.tynotes.attendance.dao;
import com.zjty.tynotes.attendance.entity.UserOverWork;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
* @Author gwj
* @create 2020/3/30 13:10
*/
public interface UserOverWorkDao extends MongoRepository<UserOverWork,String> {
UserOverWork findByUserId(String userId);
}
...@@ -34,7 +34,7 @@ public class ApprovalInformation { ...@@ -34,7 +34,7 @@ public class ApprovalInformation {
@ApiModelProperty(value = "审核审批用户id",example = "1") @ApiModelProperty(value = "审核审批用户id",example = "1")
private String approvalUserIdTwo; private String approvalUserIdTwo;
@ApiModelProperty(value = "审批类型",example = "事假/调休/病假/加班/公出") @ApiModelProperty(value = "审批类型,事假/调休/病假/加班/公出",example = "事假/调休/病假/加班/公出")
private String approvalType; private String approvalType;
@ApiModelProperty(value = "审批状态,0代表待审批,1代表已通过,2代表已拒绝",example = "0/1/2") @ApiModelProperty(value = "审批状态,0代表待审批,1代表已通过,2代表已拒绝",example = "0/1/2")
......
...@@ -2,12 +2,15 @@ package com.zjty.tynotes.attendance.service.impl; ...@@ -2,12 +2,15 @@ package com.zjty.tynotes.attendance.service.impl;
import com.zjty.tynotes.attendance.dao.ApprovalInformationDao; import com.zjty.tynotes.attendance.dao.ApprovalInformationDao;
import com.zjty.tynotes.attendance.dao.AttendanceDetailsDao; import com.zjty.tynotes.attendance.dao.AttendanceDetailsDao;
import com.zjty.tynotes.attendance.dao.UserOverWorkDao;
import com.zjty.tynotes.attendance.entity.ApprovalInformation; import com.zjty.tynotes.attendance.entity.ApprovalInformation;
import com.zjty.tynotes.attendance.entity.AttendanceDetails; import com.zjty.tynotes.attendance.entity.AttendanceDetails;
import com.zjty.tynotes.attendance.entity.UserOverWork;
import com.zjty.tynotes.attendance.service.ApprovalInformationService; import com.zjty.tynotes.attendance.service.ApprovalInformationService;
import com.zjty.tynotes.pas.dao.DepartmentDao; import com.zjty.tynotes.pas.dao.DepartmentDao;
import com.zjty.tynotes.pas.entity.Department; import com.zjty.tynotes.pas.entity.Department;
import com.zjty.tynotes.pas.service.IUserService; import com.zjty.tynotes.pas.service.IUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -31,6 +34,8 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic ...@@ -31,6 +34,8 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
private IUserService iUserService; private IUserService iUserService;
@Autowired @Autowired
private DepartmentDao departmentDao; private DepartmentDao departmentDao;
@Autowired
private UserOverWorkDao userOverWorkDao;
@Override @Override
public ApprovalInformation addApproval(ApprovalInformation approvalInformation) { public ApprovalInformation addApproval(ApprovalInformation approvalInformation) {
...@@ -85,6 +90,10 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic ...@@ -85,6 +90,10 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
if(("1").equals(departmentLevel)||("2").equals(departmentLevel)){ if(("1").equals(departmentLevel)||("2").equals(departmentLevel)){
approvalInformation.setApprovalUserIdOne(userId); approvalInformation.setApprovalUserIdOne(userId);
if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){ if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("0")){
if(StringUtils.isNotBlank(approvalInformation.getApprovalType())&&approvalInformation.getApprovalType().equals("调休")){
UserOverWork userOverWork = userOverWorkDao.findByUserId(approvalInformation.getUserId());
}
approvalInformation.setStatus("1"); approvalInformation.setStatus("1");
approvalInformation.setApprovalOne("0"); approvalInformation.setApprovalOne("0");
}else if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("1")){ }else if(approvalInformation.getApprovalStatus()!=null && approvalInformation.getApprovalStatus().equals("1")){
......
package com.zjty.tynotes.weekly.subject.entity.vo; package com.zjty.tynotes.weekly.subject.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -8,6 +9,8 @@ import lombok.NoArgsConstructor; ...@@ -8,6 +9,8 @@ import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
/** /**
* @Author gwj * @Author gwj
* @create 2020/3/30 9:13 * @create 2020/3/30 9:13
...@@ -22,8 +25,16 @@ public class Problem { ...@@ -22,8 +25,16 @@ public class Problem {
@ApiModelProperty(value = "id",example = "1") @ApiModelProperty(value = "id",example = "1")
private String id; private String id;
@ApiModelProperty(value = "id",example = "1") @ApiModelProperty(value = "描述",example = "1")
private String des; private String des;
@ApiModelProperty(value = "用户id",example = "1")
private String userId; private String userId;
@ApiModelProperty(value = "用户名",example = "")
private String name;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "反馈时间",example = "")
private Date submitTime;
} }
...@@ -301,6 +301,12 @@ public class UserManageServiceImpl implements UserManageService { ...@@ -301,6 +301,12 @@ public class UserManageServiceImpl implements UserManageService {
*/ */
@Override @Override
public Problem submitProblem(Problem problem) { public Problem submitProblem(Problem problem) {
Optional<User> optional = pasUserDao.findById(problem.getUserId());
if(optional.isPresent()){
User user = optional.get();
problem.setName(user.getUsername());
problem.setSubmitTime(new Date());
}
return problemDao.save(problem); return problemDao.save(problem);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论