Commit a70ae404 by tangzhaoqian Committed by chenzg

审批人审批优化,员工管理、组织管理Bug修复

parent c6c493f2
......@@ -94,7 +94,7 @@ public class LogAspect
// 获取当前的用户
// LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
QyzxEmpLogin eld = (QyzxEmpLogin)session.getAttribute("ui");
System.out.println(eld);
// *========数据库日志=========*//
QyzxOperLog operLog = new QyzxOperLog();
......
package cn.timer.api.config.enuminterface;
import lombok.Getter;
public interface SpmkEnumInterface {
/**
* 员工类型
*/
@Getter
enum ExecutorSts implements SpmkEnumInterface {
NON_EXECUTION(0, "未执行"), IN_EXECUTION(1, "执行中"), AGREE(2, "同意"), REFUSE(3, "拒绝"), REDEPLOY(4, "转派");
private Integer type;
private String name;
ExecutorSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
}
/**
* @date 2020年3月23日
* @author 翁东州
* @方法中文名称:
*/
package cn.timer.api.config.enuminterface;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
......@@ -46,6 +39,24 @@ public interface YgEnumInterface {
return mow.type.toString();
}
}
/**
* 部门 岗位
*/
@Getter
enum OrgType implements YgEnumInterface {
DEPARTMENT(0, "部门"), POST(1, "岗位");
private Integer type;
private String name;
OrgType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 员工类型
......
......@@ -9,6 +9,7 @@ import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -326,11 +327,8 @@ public class QyzxController {
wp.select(ZzglAuth::getMenuId).eq(ZzglAuth::getOrgCode, ctrl.getId())
.and(i -> i.in(ZzglAuth::getBmgwId, list.toArray()));
List<ZzglAuth> zas = ZzglAuth.builder().build().selectList(wp);
if (zas.size() == 0)
return ResultUtil.error(null, "切换企业失败,在该公司没有权限");
zas.stream().forEach(o -> menus.add(o.getMenuId()));
} else {
return ResultUtil.error(null, "切换企业失败,在该公司没有权限");
if (zas != null && zas.size() != 0)
zas.stream().forEach(o -> menus.add(o.getMenuId()));
}
}
emp.setOrgId(orgCode);
......@@ -538,5 +536,21 @@ public class QyzxController {
return ResultUtil.data(pages, listOl, "操作成功!");
}
/**
* 删除-操作日志
*
* @param
* @return
*/
@DeleteMapping(value = "/delete_oper_log")
@ApiOperation(value = "删除-操作日志", httpMethod = "DELETE", notes = "查询-操作日志")
public Result<Object> deleteOperLog(@CurrentUser UserBean userBean,@RequestBody Integer[] ids) {
ArrayList<Integer> list = CollUtil.toList(ids);
int delCount = qyzxOperLogMapper.deleteBatchIds(list);
return ResultUtil.data(delCount, "操作成功!");
}
}
......@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.druid.sql.visitor.functions.Nil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -45,6 +46,7 @@ import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.SpmkEnumInterface;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.controller.spmk.service.SpmkServiceImpl;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
......@@ -119,6 +121,7 @@ public class SpmkController {
public Result<Object> saveAtg(@RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG){
if (spmkApprovalTemplateG.selectCount(new QueryWrapper<SpmkApprovalTemplateG>().lambda()
.ne(SpmkApprovalTemplateG::getId, spmkApprovalTemplateG.getId())
.eq(SpmkApprovalTemplateG::getName, spmkApprovalTemplateG.getName())) > 0) {
return ResultUtil.error("审批模板组名重复!");
}
......@@ -189,6 +192,7 @@ public class SpmkController {
at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter()));
if (at.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda()
.ne(SpmkApprovalTemplate::getId, at.getId())
.eq(SpmkApprovalTemplate::getName, at.getName())) > 0) {
return ResultUtil.error("审批模板名重复!");
}
......@@ -256,6 +260,7 @@ public class SpmkController {
public Result<Object> saveAg(@CurrentUser UserBean userBean, @RequestBody SpmkApprovalG spmkApprovalG){
if (spmkApprovalG.selectCount(new QueryWrapper<SpmkApprovalG>().lambda()
.ne(SpmkApprovalG::getId, spmkApprovalG.getId())
.eq(SpmkApprovalG::getName, spmkApprovalG.getName())
.eq(SpmkApprovalG::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("审批组名重复!");
......@@ -338,6 +343,7 @@ public class SpmkController {
BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs");
if (ca.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda()
.ne(SpmkCustomApproval::getId, ca.getId())
.eq(SpmkCustomApproval::getName, ca.getName())
.eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("自定义审批名重复!");
......@@ -575,7 +581,15 @@ public class SpmkController {
@ApiOperationSupport(order = 20)
@Log(title = "审批-审批流程", businessType = BusinessType.UPDATE)
// @BindingResultCtrol(title = "审批人审批")
public Result<Object> approving(@Validated @RequestBody ApprovingDto approvingDto) throws Exception {
public Result<Object> approving(@CurrentUser UserBean userBean,@Validated @RequestBody ApprovingDto approvingDto) throws Exception {
if (spmkExecutorMapper.selectCount(new QueryWrapper<SpmkExecutor>().lambda()
.eq(SpmkExecutor::getId, approvingDto.getExecutorId())
.eq(SpmkExecutor::getEmpNum, userBean.getEmpNum())
.eq(SpmkExecutor::getSts, SpmkEnumInterface.ExecutorSts.NON_EXECUTION)) == 0) {
return ResultUtil.error("非当前审批人,无法审批!");
}
SpmkApproveDetail ad = SpmkApproveDetail.builder().build().selectOne(new QueryWrapper<SpmkApproveDetail>()
.lambda()
.select(SpmkApproveDetail::getId,
......@@ -588,6 +602,8 @@ public class SpmkController {
.select(SpmkApproveSummary::getSts)
.eq(SpmkApproveSummary::getId, approvingDto.getAsId()));
if (aSummary.getSts() == 1 || aSummary.getSts() == 2 || aSummary.getSts() == 3) {
return ResultUtil.error("该审批已结束!");
}
......
......@@ -37,11 +37,13 @@ import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
......@@ -89,7 +91,7 @@ public class ZzglController {
* @param
* @return
*/
@GetMapping(value = "/deptlist2")
@GetMapping(value = "/deptlist_plus")
@ApiOperation(value = "1.获取部门岗位-升级版", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 1)
public Result<List<Tree<String>>> selectlistdept2(@CurrentUser UserBean userBean) {
......@@ -128,11 +130,14 @@ public class ZzglController {
}
@GetMapping(value = "/depts")
@ApiOperation(value = "只获取部门", httpMethod = "GET", notes = "接口发布说明")
@ApiOperation(value = "2.获取部门", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 2)
public Result<List<ZzglBmgwM>> selectdepts(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).list();//0:部门;1:岗位
.eq(ZzglBmgwM::getOrgCode, orgCode)
.eq(ZzglBmgwM::getType, YgEnumInterface.OrgType.DEPARTMENT)
.list();
return ResultUtil.data(zzglBmgwMs);
}
......@@ -240,16 +245,17 @@ public class ZzglController {
// 根部门upId 默认为0
zzglBmgwM.setUpId(0);
}
if (zzglBmgwM.getName().trim().length()==0)
if (zzglBmgwM.getLeader() == null && StrUtil.length(StrUtil.trim(zzglBmgwM.getName())) == 0)
return ResultUtil.error("部门岗位名称不能为空");
Boolean a = zzglBmgwM.getId() == null;
if (a && zzglBmgwM.getType() == null)
Boolean notId = zzglBmgwM.getId() == null;
if (notId && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0);
zzglBmgwM.setOrgCode(userBean.getOrgCode());
zzglBmgwM.insertOrUpdate();
if (a)
return ResultUtil.data(zzglBmgwM);
return ResultUtil.success();
zzglBmgwM.setOrgCode(userBean.getOrgCode());
zzglBmgwM.insertOrUpdate();
return notId ? ResultUtil.data(zzglBmgwM) : ResultUtil.success();
}
......
......@@ -8,6 +8,11 @@ package cn.timer.api.dto.yggl;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -28,30 +33,39 @@ public class AddygdaDto extends Page implements Serializable{
private static final long serialVersionUID = -1230023773946170942L;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="员工姓名",example="华仔")
private String name;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="手机号",example="101")
private String phone;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他",example="0")
private Integer zjType;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="证件号码 ",example="证件号码")
private String zjNum;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="0")
private Integer jobType;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="入职日期 ",example="客户注册后的时间为入职时间")
private Date rzTime;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)",example="0")
private Integer syq;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="性别 0:男;1:女",example="0")
private Integer sex;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="部门岗位id",example="0")
private Integer bmgwId;
......
......@@ -175,7 +175,7 @@ config-8timer:
one: 3
two: 7
three: 30
init-password: 123456
......@@ -146,4 +146,5 @@ config-8timer:
remind: #合同提醒时间 默认小于等于1天会提醒+三个配置项
one: 3
two: 7
three: 30
\ No newline at end of file
three: 30
init-password: 123456
\ No newline at end of file
......@@ -146,4 +146,5 @@ config-8timer:
remind: #合同提醒时间 默认小于等于1天会提醒+三个配置项
one: 3
two: 7
three: 30
\ No newline at end of file
three: 30
init-password: 123456
\ No newline at end of file
......@@ -38,7 +38,7 @@
oper_url,
oper_ip,
oper_location,
oper_param,
<!-- oper_param, -->
json_result,
status,
error_msg,
......
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