Commit 62693996 by 284718418@qq.com

合并华颐 审批流程 代码

parent 5b52fe85
...@@ -26,7 +26,7 @@ import cn.hutool.core.net.NetUtil; ...@@ -26,7 +26,7 @@ import cn.hutool.core.net.NetUtil;
public class Application { public class Application {
public static void main(String[] args) { public static void main(String[] args) {
final Integer port = 8089; final Integer port = 8189;
if (!NetUtil.isUsableLocalPort(port)) { if (!NetUtil.isUsableLocalPort(port)) {
System.err.printf("端口%d被占用了,无法启动%n", port); System.err.printf("端口%d被占用了,无法启动%n", port);
System.exit(1); System.exit(1);
......
...@@ -3,8 +3,10 @@ package cn.timer.api.bean.kqmk; ...@@ -3,8 +3,10 @@ package cn.timer.api.bean.kqmk;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
...@@ -15,6 +17,8 @@ import lombok.Builder; ...@@ -15,6 +17,8 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
/** /**
* @author LAL 2020-05-09 * @author LAL 2020-05-09
*/ */
...@@ -67,4 +71,9 @@ public class KqglAssoLeaveBalance extends Model<KqglAssoLeaveBalance> { ...@@ -67,4 +71,9 @@ public class KqglAssoLeaveBalance extends Model<KqglAssoLeaveBalance> {
@ApiModelProperty(value = "是否为系统自动 0:否;1:是", example = "101") @ApiModelProperty(value = "是否为系统自动 0:否;1:是", example = "101")
private Integer isAutomatic; private Integer isAutomatic;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "假期统调用户ID")
private List<Integer> userIds;
} }
\ No newline at end of file
...@@ -54,7 +54,7 @@ public class CmsContentModular extends Model<CmsContentModular> { ...@@ -54,7 +54,7 @@ public class CmsContentModular extends Model<CmsContentModular> {
@ApiModelProperty(value = "0- 开启 1-关闭", example = "0") @ApiModelProperty(value = "0- 开启 1-关闭", example = "0")
private Integer isOpen; private Integer isOpen;
@ApiModelProperty(value = "排序:升序", example = "0") @ApiModelProperty(value = "排序", example = "0")
private Integer sort; private Integer sort;
} }
...@@ -58,5 +58,4 @@ public class SpmkApprovalG extends Model<SpmkApprovalG> { ...@@ -58,5 +58,4 @@ public class SpmkApprovalG extends Model<SpmkApprovalG> {
@ApiModelProperty(value = "是否可编辑 0是 1否", example = "101") @ApiModelProperty(value = "是否可编辑 0是 1否", example = "101")
private Integer isEditable; private Integer isEditable;
} }
package cn.timer.api.bean.spmk;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Table;
/**
* 审批草稿详情
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approve_detail_drafts")
@ApiModel("审批草稿详情")
public class SpmkApproveDetailDrafts extends Model<SpmkApproveDetailDrafts> {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private Integer id;
/**
* 审批汇总id
*/
private Integer approveSummaryId;
/**
* 标题
*/
private String name;
/**
* 所在部门名称
*/
private String departmentName;
/**
* 申请数据
*/
private String requestData;
/**
* 审批表单
*/
private String froms;
/**
* 审批流程
*/
private String router;
/**
* 通过节点
*/
private String flowChildren;
/**
* 设置:编号
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:编号
*/
public Integer getId() {
return id;
}
/**
* 设置:审批汇总id
*/
public void setApproveSummaryId(Integer approveSummaryId) {
this.approveSummaryId = approveSummaryId;
}
/**
* 获取:审批汇总id
*/
public Integer getApproveSummaryId() {
return approveSummaryId;
}
/**
* 设置:标题
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取:标题
*/
public String getName() {
return name;
}
/**
* 设置:所在部门名称
*/
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
/**
* 获取:所在部门名称
*/
public String getDepartmentName() {
return departmentName;
}
/**
* 设置:申请数据
*/
public void setRequestData(String requestData) {
this.requestData = requestData;
}
/**
* 获取:申请数据
*/
public String getRequestData() {
return requestData;
}
/**
* 设置:审批表单
*/
public void setFroms(String froms) {
this.froms = froms;
}
/**
* 获取:审批表单
*/
public String getFroms() {
return froms;
}
/**
* 设置:审批流程
*/
public void setRouter(String router) {
this.router = router;
}
/**
* 获取:审批流程
*/
public String getRouter() {
return router;
}
/**
* 设置:通过节点
*/
public void setFlowChildren(String flowChildren) {
this.flowChildren = flowChildren;
}
/**
* 获取:通过节点
*/
public String getFlowChildren() {
return flowChildren;
}
}
package cn.timer.api.bean.spmk;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 审批草稿箱
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approve_drafts")
@ApiModel("审批草稿箱")
public class SpmkApproveDrafts extends Model<SpmkApproveDrafts> implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 审批编号
*/
private Integer id;
/**
* 企业组织代码
*/
private Integer orgCode;
/**
* 发起人id 用于搜索(所在部门)
*/
private Integer empNum;
/**
* 标题
*/
private String title;
/**
* 所在部门名称
*/
private String departmentName;
/**
* 发起人名称
*/
private String initiator;
/**
* 发起时间
*/
private Date createTime;
/**
* 审批名称
*/
private String approveName;
/**
* 状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝
*/
private Integer sts;
/**
* 当前审批人
*/
private String currentApprover;
/**
* 历史审批人
*/
private String historyApprover;
/**
* assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪
*/
private Integer assoType;
/**
* 最近处理时间
*/
private Date updateTime;
/**
* 结束时间
*/
private Date endTime;
/**
* 摘要
*/
private String digest;
/**
* 是否删除 0-否 1-是
*/
private Integer isDelete;
/**
* 是否加急 0-否 1-是
*/
private Integer isUrgent;
/**
* 设置:审批编号
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:审批编号
*/
public Integer getId() {
return id;
}
/**
* 设置:企业组织代码
*/
public void setOrgCode(Integer orgCode) {
this.orgCode = orgCode;
}
/**
* 获取:企业组织代码
*/
public Integer getOrgCode() {
return orgCode;
}
/**
* 设置:发起人id 用于搜索(所在部门)
*/
public void setEmpNum(Integer empNum) {
this.empNum = empNum;
}
/**
* 获取:发起人id 用于搜索(所在部门)
*/
public Integer getEmpNum() {
return empNum;
}
/**
* 设置:标题
*/
public void setTitle(String title) {
this.title = title;
}
/**
* 获取:标题
*/
public String getTitle() {
return title;
}
/**
* 设置:所在部门名称
*/
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
/**
* 获取:所在部门名称
*/
public String getDepartmentName() {
return departmentName;
}
/**
* 设置:发起人名称
*/
public void setInitiator(String initiator) {
this.initiator = initiator;
}
/**
* 获取:发起人名称
*/
public String getInitiator() {
return initiator;
}
/**
* 设置:发起时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:发起时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:审批名称
*/
public void setApproveName(String approveName) {
this.approveName = approveName;
}
/**
* 获取:审批名称
*/
public String getApproveName() {
return approveName;
}
/**
* 设置:状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝
*/
public void setSts(Integer sts) {
this.sts = sts;
}
/**
* 获取:状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝
*/
public Integer getSts() {
return sts;
}
/**
* 设置:当前审批人
*/
public void setCurrentApprover(String currentApprover) {
this.currentApprover = currentApprover;
}
/**
* 获取:当前审批人
*/
public String getCurrentApprover() {
return currentApprover;
}
/**
* 设置:历史审批人
*/
public void setHistoryApprover(String historyApprover) {
this.historyApprover = historyApprover;
}
/**
* 获取:历史审批人
*/
public String getHistoryApprover() {
return historyApprover;
}
/**
* 设置:assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪
*/
public void setAssoType(Integer assoType) {
this.assoType = assoType;
}
/**
* 获取:assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪
*/
public Integer getAssoType() {
return assoType;
}
/**
* 设置:最近处理时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取:最近处理时间
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* 设置:结束时间
*/
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
/**
* 获取:结束时间
*/
public Date getEndTime() {
return endTime;
}
/**
* 设置:摘要
*/
public void setDigest(String digest) {
this.digest = digest;
}
/**
* 获取:摘要
*/
public String getDigest() {
return digest;
}
/**
* 设置:是否删除 0-否 1-是
*/
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
/**
* 获取:是否删除 0-否 1-是
*/
public Integer getIsDelete() {
return isDelete;
}
/**
* 设置:是否加急 0-否 1-是
*/
public void setIsUrgent(Integer isUrgent) {
this.isUrgent = isUrgent;
}
/**
* 获取:是否加急 0-否 1-是
*/
public Integer getIsUrgent() {
return isUrgent;
}
}
...@@ -19,6 +19,7 @@ import lombok.AllArgsConstructor; ...@@ -19,6 +19,7 @@ import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;
/** /**
* @author Tang 2020-04-17 * @author Tang 2020-04-17
...@@ -62,6 +63,9 @@ public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> { ...@@ -62,6 +63,9 @@ public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> {
@ApiModelProperty(value = "操作时间 ", example = "操作时间") @ApiModelProperty(value = "操作时间 ", example = "操作时间")
private Date updateTime; private Date updateTime;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "")
private List<SpmkExecutor> spmkExecutors; private List<SpmkExecutor> spmkExecutors;
} }
package cn.timer.api.bean.spmk;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 审批执行记录 发起人、抄送人、审批人操作记录--草稿
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-19 14:53:36
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approve_execute_record_drafts")
@ApiModel("审批执行记录 发起人、抄送人、审批人操作记录--草稿")
public class SpmkApproveExecuteRecordDrafts extends Model<SpmkApproveExecuteRecordDrafts> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private Integer id;
/**
* 审批汇总id
*/
private Integer approveSummaryId;
/**
* 名称 发起申请 1抄送人 审批人 连续多级主管
*/
private String name;
/**
* 类型 0发起申请 1抄送人 2审批人 3连续多级主管
*/
private Integer type;
/**
* 状态 0未执行 1审批中 2同意 3拒绝
*/
private Integer sts;
/**
* 创建时间
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 设置:编号
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:编号
*/
public Integer getId() {
return id;
}
/**
* 设置:审批汇总id
*/
public void setApproveSummaryId(Integer approveSummaryId) {
this.approveSummaryId = approveSummaryId;
}
/**
* 获取:审批汇总id
*/
public Integer getApproveSummaryId() {
return approveSummaryId;
}
/**
* 设置:名称 发起申请 1抄送人 审批人 连续多级主管
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取:名称 发起申请 1抄送人 审批人 连续多级主管
*/
public String getName() {
return name;
}
/**
* 设置:类型 0发起申请 1抄送人 2审批人 3连续多级主管
*/
public void setType(Integer type) {
this.type = type;
}
/**
* 获取:类型 0发起申请 1抄送人 2审批人 3连续多级主管
*/
public Integer getType() {
return type;
}
/**
* 设置:状态 0未执行 1审批中 2同意 3拒绝
*/
public void setSts(Integer sts) {
this.sts = sts;
}
/**
* 获取:状态 0未执行 1审批中 2同意 3拒绝
*/
public Integer getSts() {
return sts;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取:
*/
public Date getUpdateTime() {
return updateTime;
}
}
...@@ -102,5 +102,4 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> { ...@@ -102,5 +102,4 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> {
} }
\ No newline at end of file
...@@ -61,6 +61,9 @@ public class SpmkExecutor extends Model<SpmkExecutor> { ...@@ -61,6 +61,9 @@ public class SpmkExecutor extends Model<SpmkExecutor> {
@ApiModelProperty(value = "状态 0未执行 1执行中 2同意 3拒接 4转派", example = "101") @ApiModelProperty(value = "状态 0未执行 1执行中 2同意 3拒接 4转派", example = "101")
private Integer sts; private Integer sts;
@ApiModelProperty(value = "阅读标记0.未读 1.已读", example = "0")
private Integer readStatus;
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间 ", example = "创建时间") @ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime; private Date createTime;
......
...@@ -63,9 +63,18 @@ public class DiskFilesController { ...@@ -63,9 +63,18 @@ public class DiskFilesController {
@Autowired @Autowired
private SftpConfiguration config; private SftpConfiguration config;
@Value("${sftp.client.targetPath}")
private String targetPath;
@Value("${sftp.client.reservedName}")
private boolean reservedName;
@Value("${sftp.client.serverUrl}")
private String serverUrl;
@Autowired @Autowired
private OSSService ossService; private OSSService ossService;
@ResponseBody @ResponseBody
@PostMapping("/upload") @PostMapping("/upload")
@ApiOperation(value = "上传普通文件", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "上传普通文件", httpMethod = "POST", notes = "接口发布说明")
......
...@@ -9,13 +9,30 @@ import java.util.Date; ...@@ -9,13 +9,30 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.timer.api.aspect.lang.annotation.Log; import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.enums.BusinessType; import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.bean.dzht.DzhtAssoMbzj; import cn.timer.api.bean.dzht.DzhtAssoMbzj;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.config.exception.Regular;
import cn.timer.api.config.validation.ValidList;
import cn.timer.api.dto.kqmk.*;
import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.utils.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
...@@ -23,6 +40,8 @@ import org.springframework.http.HttpHeaders; ...@@ -23,6 +40,8 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -95,52 +114,10 @@ import cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper; ...@@ -95,52 +114,10 @@ import cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper;
import cn.timer.api.dao.kqmk.KqglAssoYhsbMapper; import cn.timer.api.dao.kqmk.KqglAssoYhsbMapper;
import cn.timer.api.dao.kqmk.KqglAssoZhoupaibanMapper; import cn.timer.api.dao.kqmk.KqglAssoZhoupaibanMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper; import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dto.kqmk.AdditionalDto;
import cn.timer.api.dto.kqmk.AttLateLate;
import cn.timer.api.dto.kqmk.AttMemberSettings;
import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttSchedulingDto;
import cn.timer.api.dto.kqmk.AttendanceAssistantDto;
import cn.timer.api.dto.kqmk.AttendanceCardListDto;
import cn.timer.api.dto.kqmk.AttendanceMachineStatus;
import cn.timer.api.dto.kqmk.AttendanceSummaryQueryDto;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.AttstateDate;
import cn.timer.api.dto.kqmk.BalanceSheetDataDto;
import cn.timer.api.dto.kqmk.CalendarDetailsDto;
import cn.timer.api.dto.kqmk.CalendarPunchDetailsDto;
import cn.timer.api.dto.kqmk.CalendarTableDataDto;
import cn.timer.api.dto.kqmk.ChangePunchResultsDto;
import cn.timer.api.dto.kqmk.CompensateDto;
import cn.timer.api.dto.kqmk.DailyDetailsDto;
import cn.timer.api.dto.kqmk.DetailsofbusinessDto;
import cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto;
import cn.timer.api.dto.kqmk.IndividualOvertimeRuleDto;
import cn.timer.api.dto.kqmk.JiaqibalanceDto;
import cn.timer.api.dto.kqmk.KqglAssoLeaveRulesDto;
import cn.timer.api.dto.kqmk.KqglAssoMonthPunchSummaryDto;
import cn.timer.api.dto.kqmk.KqglAssoOvertimeRulesDto;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.dto.kqmk.KqglAssoRulesViceDto;
import cn.timer.api.dto.kqmk.KqglMainKqzDto;
import cn.timer.api.dto.kqmk.KqzAttendanceGroupSearchDto;
import cn.timer.api.dto.kqmk.LeaveTypeDto;
import cn.timer.api.dto.kqmk.MachinememberDto;
import cn.timer.api.dto.kqmk.ModifyEmployeeBalanceDto;
import cn.timer.api.dto.kqmk.OriginalRecordDto;
import cn.timer.api.dto.kqmk.ResttryfixdayDto;
import cn.timer.api.dto.kqmk.SetConditionsDto;
import cn.timer.api.dto.kqmk.StartTimeRestDto;
import cn.timer.api.dto.kqmk.UserAttendanceRelDto;
import cn.timer.api.dto.kqmk.VacationInformationDto;
import cn.timer.api.dto.kqmk.WorkbenchCalendarDto;
import cn.timer.api.utils.DateUtil;
import cn.timer.api.utils.ResponseResult;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@Slf4j
@Api(tags = "3.0[1]考勤模块") @Api(tags = "3.0[1]考勤模块")
@RestController @RestController
@Transactional @Transactional
...@@ -984,6 +961,65 @@ public class TimeCardController { ...@@ -984,6 +961,65 @@ public class TimeCardController {
} }
/** /**
* 假期统调
*/
@PostMapping(value = "/leave_balance_all")
@ApiOperation(value = "假期统调", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> LeaveBalanceAll(@CurrentUser UserBean userBean,@RequestBody KqglAssoLeaveBalance balance) {
balance.setModifyUserid(userBean.getEmpNum());
balance.setModifyTimer(new Date().getTime());
balance.setOrgCode(userBean.getOrgCode());
String balanceDays = "0";
if(balance.getModifyAction() == 1) {//增加
balanceDays = "+" + balance.getBalanceDays();
}else {
balanceDays = "-" + balance.getBalanceDays();
}
balance.setBalanceDays(balanceDays);
if(!CollectionUtils.isEmpty(balance.getUserIds())){
for (Integer userId :balance.getUserIds()) {
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, userId)
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
if(balan != null) {
balance.setModifyNumber(balan.getModifyNumber()+1);
}else {
balance.setModifyNumber(1);
}
balance.setUserid(userId);
//添加成功
if(balance.insert()) {
//查询员工假期余额表中所对应的假期id
KqglAssoLeaveEmployeeBalance emba = KqglAssoLeaveEmployeeBalance.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getLeaveRulesId, balance.getLeaveRulesId())
.eq(KqglAssoLeaveEmployeeBalance::getUserid, userId).eq(KqglAssoLeaveEmployeeBalance::getOrgCode, userBean.getOrgCode()));
//获取最后得到的最终余额
double balance_days = kqglassoleavebalancemapper.Sumbalancedays(userId, userBean.getOrgCode(),balance.getLeaveRulesId());
if(emba != null && balance_days > 0) {
if(emba.getBalanceDays() != -1) {//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance.builder().id(emba.getId()).balanceDays(balance_days).build().updateById();
}
}else{
if(emba.getBalanceDays() != -1) {//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance.builder().id(emba.getId()).balanceDays(0).build().updateById();
}
}
}
}
}
return ResultUtil.success("操作成功!") ;
}
/**
* 根据考勤余额id获取信息 ||大于“0”为有数字限制 ||为“-1”时为无数字限制 * 根据考勤余额id获取信息 ||大于“0”为有数字限制 ||为“-1”时为无数字限制
*/ */
@GetMapping(value="/hqleavebalance/{id}") @GetMapping(value="/hqleavebalance/{id}")
...@@ -1721,6 +1757,86 @@ public class TimeCardController { ...@@ -1721,6 +1757,86 @@ public class TimeCardController {
return ResultUtil.data(pageAs, sumlist, "操作成功!"); return ResultUtil.data(pageAs, sumlist, "操作成功!");
} }
@PostMapping(value = "/export_leave_balance")
@ApiOperation(value = "导出假期余额列表数据", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> ExportLeaveBalance(@CurrentUser UserBean userBean, @Validated @RequestBody AttqueryCriteriaDto attquerycriteriadto) {
attquerycriteriadto.setOrgCode(userBean.getOrgCode());
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
List<ExportEmployeeLeaveBalanceDto> list = kqglassoleavebalancemapper.selectLeaveBalance(attquerycriteriadto);
for(ExportEmployeeLeaveBalanceDto endo : list) {
List<KqglAssoLeaveEmployeeBalance> empye = KqglAssoLeaveEmployeeBalance.builder().build().selectList(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getUserid, endo.getEmpnum())
.eq(KqglAssoLeaveEmployeeBalance::getOrgCode, endo.getOrgcode()));
List<BalanceSheetDataDto> balanceTo = new ArrayList<BalanceSheetDataDto>();
for(KqglAssoLeaveEmployeeBalance empyes : empye) {
BalanceSheetDataDto bal = BalanceSheetDataDto.builder().build();
bal.setBalancedays(empyes.getBalanceDays());
bal.setLeaverulesid(empyes.getLeaveRulesId());
balanceTo.add(bal);
}
endo.setBalanceTo(balanceTo);
}
return ResultUtil.data(list, "操作成功!");
}
/**
* 导入假期余额数据
*/
@PostMapping(value = "/import_leave_balance")
@ApiOperation(value = "导入假期余额数据", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> importLeaveBalance(@CurrentUser UserBean userBean,
@RequestBody Object o) throws Exception {
Integer orgCode = userBean.getOrgCode();
JSONArray jsonArray = (JSONArray)o;
for (Object object :jsonArray) {
JSONObject jsonObject = (JSONObject)object;
if(StringUtils.isEmpty(jsonObject.get("empnum"))){
continue;
}
String empnum = jsonObject.get("empnum").toString();
for (Map.Entry<String, Object> entity:jsonObject.entrySet()) {
log.info("entity key:{},vlue{}",entity.getKey(),entity.getValue());
if("empnum".equals(entity.getKey())){
}else if("department".equals(entity.getKey())){
}else{
Integer leaveRulesId = Integer.parseInt(entity.getKey());
double balanceDays = 0;
if(StringUtils.isEmpty(entity.getValue())){
continue;
}else {
if("不限制余额".equals(entity.getValue().toString())){
balanceDays = -1;
}else {
balanceDays = Double.parseDouble(entity.getValue().toString());
}
}
//查询员工假期余额表中所对应的假期id
KqglAssoLeaveEmployeeBalance emba = KqglAssoLeaveEmployeeBalance.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getLeaveRulesId, leaveRulesId)
.eq(KqglAssoLeaveEmployeeBalance::getUserid, empnum).eq(KqglAssoLeaveEmployeeBalance::getOrgCode, userBean.getOrgCode()));
if(emba != null && balanceDays > 0) {
if(emba.getBalanceDays() != -1) {//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance.builder().id(emba.getId()).balanceDays(balanceDays).build().updateById();
}
}else{
if(emba.getBalanceDays() != -1) {//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance.builder().id(emba.getId()).balanceDays(0).build().updateById();
}
}
}
}
}
return ResultUtil.success("导入假期余额成功!");
}
/** /**
* 移除考勤机管理员 * 移除考勤机管理员
......
...@@ -3,11 +3,16 @@ package cn.timer.api.controller.qyxx; ...@@ -3,11 +3,16 @@ package cn.timer.api.controller.qyxx;
import java.util.*; import java.util.*;
import cn.timer.api.bean.qyxx.*; import cn.timer.api.bean.qyxx.*;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.dto.qyxx.CmsContentReadDto; import cn.timer.api.dto.qyxx.CmsContentReadDto;
import cn.timer.api.utils.redis.RedisUtil;
import com.github.yulichang.query.MPJQueryWrapper; import com.github.yulichang.query.MPJQueryWrapper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -47,7 +52,7 @@ import javax.annotation.Resource; ...@@ -47,7 +52,7 @@ import javax.annotation.Resource;
@RestController @RestController
@Api(tags = "5.0企业讯息") @Api(tags = "5.0企业讯息")
@Transactional @Transactional
@RequestMapping(value = "/qyxx", produces = { "application/json" }) @RequestMapping(value = "/qyxx", produces = {"application/json"})
@Slf4j @Slf4j
public class CmsController { public class CmsController {
...@@ -57,6 +62,7 @@ public class CmsController { ...@@ -57,6 +62,7 @@ public class CmsController {
@Autowired @Autowired
private CmsIsReadMapper cmsIsReadMapper; private CmsIsReadMapper cmsIsReadMapper;
// @Autowired // @Autowired
// private CmsAnnouncementMapper cmsAnnouncementMapper; // private CmsAnnouncementMapper cmsAnnouncementMapper;
...@@ -106,7 +112,6 @@ public class CmsController { ...@@ -106,7 +112,6 @@ public class CmsController {
List<CmsContent> picList = CmsContent.builder().build().selectList(qw); List<CmsContent> picList = CmsContent.builder().build().selectList(qw);
map.put("list",qynr); map.put("list",qynr);
map.put("picList",picList); map.put("picList",picList);
return ResultUtil.data(map, "查询分类成功!"); return ResultUtil.data(map, "查询分类成功!");
} }
...@@ -145,7 +150,6 @@ public class CmsController { ...@@ -145,7 +150,6 @@ public class CmsController {
/** /**
* 分类内容获取 * 分类内容获取
*
*/ */
@GetMapping(value = "/getType") @GetMapping(value = "/getType")
@ApiOperation(value = "分类内容获取", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "分类内容获取", httpMethod = "GET", notes = "接口发布说明")
...@@ -164,8 +168,8 @@ public class CmsController { ...@@ -164,8 +168,8 @@ public class CmsController {
.leftJoin("cms_content_read ccr on t.id = ccr.cms_content_id"); .leftJoin("cms_content_read ccr on t.id = ccr.cms_content_id");
queryWrapper.eq("t.releasestate", 0) queryWrapper.eq("t.releasestate", 0)
.and(!StringUtils.isEmpty(userBean.getEmpNum()), wq -> wq.eq("t.open_status", 1) .and(!StringUtils.isEmpty(userBean.getEmpNum()), wq -> wq.eq("t.open_status", 1)
.or(true,q -> q.eq("t.open_status", 0).eq("ccr.user_id",userBean.getEmpNum())) .or(true, q -> q.eq("t.open_status", 0).eq("ccr.user_id", userBean.getEmpNum()))
.or(true,q -> q.eq("t.open_status", 0).eq("t.userid",userBean.getEmpNum()))) .or(true, q -> q.eq("t.open_status", 0).eq("t.userid", userBean.getEmpNum())))
.eq("t.organization_id", userBean.getOrgCode()).eq("t.modularid", id) .eq("t.organization_id", userBean.getOrgCode()).eq("t.modularid", id)
.groupBy("t.id") .groupBy("t.id")
.orderByDesc("t.releasetime") .orderByDesc("t.releasetime")
...@@ -178,7 +182,6 @@ public class CmsController { ...@@ -178,7 +182,6 @@ public class CmsController {
/** /**
* 获取分类 * 获取分类
*
*/ */
@GetMapping(value = "/xxfl") @GetMapping(value = "/xxfl")
@ApiOperation(value = "获取分类", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取分类", httpMethod = "GET", notes = "接口发布说明")
...@@ -208,7 +211,7 @@ public class CmsController { ...@@ -208,7 +211,7 @@ public class CmsController {
// qynr.setXxbh("XX" + i++); // qynr.setXxbh("XX" + i++);
Boolean a = qynr.getId() == null; Boolean a = qynr.getId() == null;
if(a){ if (a) {
qynr.setUserid(empNum); qynr.setUserid(empNum);
} }
if (a && qynr.getPublisher() == null) if (a && qynr.getPublisher() == null)
...@@ -229,16 +232,16 @@ public class CmsController { ...@@ -229,16 +232,16 @@ public class CmsController {
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum)).getName()); .eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum)).getName());
qynr.setReleasetype(fbfs); qynr.setReleasetype(fbfs);
qynr.setStatus(0); qynr.setStatus(0);
if(fbfs != null && fbfs == 4){ if (fbfs != null && fbfs == 4) {
qynr.setReleasestate(0); qynr.setReleasestate(0);
qynr.setStatus(1); qynr.setStatus(1);
qynr.setReleasetime(now.toString()); qynr.setReleasetime(now.toString());
} }
qynr.insertOrUpdate(); qynr.insertOrUpdate();
// 新增 文件传阅 人员数据 // 新增 文件传阅 人员数据
if(a){ if (a) {
if(!CollectionUtils.isEmpty(cmsContentDto.getCmsContentReads())){ if (!CollectionUtils.isEmpty(cmsContentDto.getCmsContentReads())) {
for (CmsContentRead entity :cmsContentDto.getCmsContentReads() ) { for (CmsContentRead entity : cmsContentDto.getCmsContentReads()) {
entity.setCmsContentId(qynr.getId()); entity.setCmsContentId(qynr.getId());
entity.setOrgCode(orgCode); entity.setOrgCode(orgCode);
entity.setReadStatus(0); entity.setReadStatus(0);
...@@ -248,8 +251,8 @@ public class CmsController { ...@@ -248,8 +251,8 @@ public class CmsController {
} }
} }
if (a){ if (a) {
String msg = fbfs==4?"提交成功":"提交成功、等待管理员审核"; String msg = fbfs == 4 ? "提交成功" : "提交成功、等待管理员审核";
return ResultUtil.data(qynr, msg); return ResultUtil.data(qynr, msg);
} else { } else {
return ResultUtil.data(qynr, "修改成功"); return ResultUtil.data(qynr, "修改成功");
...@@ -351,7 +354,7 @@ public class CmsController { ...@@ -351,7 +354,7 @@ public class CmsController {
MPJQueryWrapper<CmsContent> queryWrapper = new MPJQueryWrapper<>(); MPJQueryWrapper<CmsContent> queryWrapper = new MPJQueryWrapper<>();
queryWrapper.selectAll(CmsContent.class) queryWrapper.selectAll(CmsContent.class)
.leftJoin("cms_content_read ccr on t.id = ccr.cms_content_id"); .leftJoin("cms_content_read ccr on t.id = ccr.cms_content_id");
queryWrapper.and(!StringUtils.isEmpty(userBean.getEmpNum()), wq -> wq.eq("t.open_status", 1).or(true,sq -> sq.eq("t.open_status", 0).eq("ccr.user_id",userBean.getEmpNum()))); queryWrapper.and(!StringUtils.isEmpty(userBean.getEmpNum()), wq -> wq.eq("t.open_status", 1).or(true, sq -> sq.eq("t.open_status", 0).eq("ccr.user_id", userBean.getEmpNum())));
queryWrapper.eq("t.organization_id", userBean.getOrgCode()).eq("t.status", 1).eq("t.releasestate", 0) queryWrapper.eq("t.organization_id", userBean.getOrgCode()).eq("t.status", 1).eq("t.releasestate", 0)
.eq(t != null && t > -1, "t.modularid", t).eq(r != null && r > -1, "t.releasestate", r) .eq(t != null && t > -1, "t.modularid", t).eq(r != null && r > -1, "t.releasestate", r)
.between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "t.releasetime", .between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "t.releasetime",
...@@ -402,6 +405,35 @@ public class CmsController { ...@@ -402,6 +405,35 @@ public class CmsController {
return ResultUtil.data(cmsContentPage, cmsContents, "企业OA讯息搜索成功"); return ResultUtil.data(cmsContentPage, cmsContents, "企业OA讯息搜索成功");
} }
@PostMapping(value = "/oaCirculate")
@ApiOperation(value = "搜索OA文件传阅记录", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> oaCirculate(@CurrentUser UserBean userBean, @RequestBody QyxxQueryDto qyxxQueryDto) {
String s = qyxxQueryDto.getStartTime();
String e = qyxxQueryDto.getEndTime();
Integer r = qyxxQueryDto.getReleasestate();
Page<CmsContent> page = new Page<CmsContent>(
qyxxQueryDto.getCurrentPage() == null ? 1 : qyxxQueryDto.getCurrentPage(),
qyxxQueryDto.getTotalPage() == null ? 10 : qyxxQueryDto.getTotalPage());
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("organization_id", userBean.getOrgCode())
.eq("modularid", 7).eq(r != null && r > -1, "releasestate", r)
.between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime",
!StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00",
!StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00")
.and(wq -> wq.eq("publisher", userBean.getEmpNum()).or().eq("author", userBean.getUserInfo().getName()).or().inSql("id", "select cms_content_id from cms_content_read where user_id =" + userBean.getEmpNum()))
.orderByDesc("addeddate");
IPage<CmsContent> cmsContentPage = CmsContent.builder().build().selectPage(page, queryWrapper);
List<CmsContent> cmsContents = cmsContentPage.getRecords();
cmsContentPage.getCurrent();
cmsContentPage.getPages();
cmsContentPage.getTotal();
cmsContentPage.getSize();
return ResultUtil.data(cmsContentPage, cmsContents, "企业OA讯息搜索成功");
}
/** /**
* 根据id查讯息 * 根据id查讯息
* *
...@@ -442,7 +474,7 @@ public class CmsController { ...@@ -442,7 +474,7 @@ public class CmsController {
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>(); QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("organization_id", userBean.getOrgCode()) queryWrapper.eq("organization_id", userBean.getOrgCode())
.select("id", "publisher_name", "auditopinion", "modularid", "status", "title", "releasetime", .select("id", "publisher_name", "auditopinion", "modularid", "status", "title", "releasetime",
"addeddate", "author", "summary", "releasetype", "fmtpath","filepath","open_status") "addeddate", "author", "summary", "releasetype", "fmtpath", "filepath", "open_status")
.ne("status", 1).eq(t != null && t > -1, "modularid", t) .ne("status", 1).eq(t != null && t > -1, "modularid", t)
.between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime", .between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime",
!StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00", !StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00",
...@@ -500,7 +532,6 @@ public class CmsController { ...@@ -500,7 +532,6 @@ public class CmsController {
* 添加已读 * 添加已读
* *
* @param userBean * @param userBean
* @param id
* @return * @return
*/ */
@GetMapping(value = "/isread") @GetMapping(value = "/isread")
...@@ -623,6 +654,7 @@ public class CmsController { ...@@ -623,6 +654,7 @@ public class CmsController {
/** /**
* 查询传阅列表 * 查询传阅列表
*
* @return * @return
*/ */
@PostMapping(value = "/getCmsContentReads") @PostMapping(value = "/getCmsContentReads")
...@@ -648,17 +680,17 @@ public class CmsController { ...@@ -648,17 +680,17 @@ public class CmsController {
.selectOne(new QueryWrapper<CmsContentRead>().lambda() .selectOne(new QueryWrapper<CmsContentRead>().lambda()
.eq(CmsContentRead::getUserId, userBean.getEmpNum()) .eq(CmsContentRead::getUserId, userBean.getEmpNum())
.eq(CmsContentRead::getOrgCode, userBean.getOrgCode()) .eq(CmsContentRead::getOrgCode, userBean.getOrgCode())
.eq(CmsContentRead::getCmsContentId,id)); .eq(CmsContentRead::getCmsContentId, id));
if(cmsContentRead == null){ if (cmsContentRead == null) {
cmsContentRead = new CmsContentRead(); cmsContentRead = new CmsContentRead();
cmsContentRead.setUserId(userBean.getEmpNum()); cmsContentRead.setUserId(userBean.getEmpNum());
cmsContentRead.setUserName(userBean.getUserInfo().getName()); cmsContentRead.setUserName(userBean.getUserInfo().getName());
cmsContentRead.setOrgCode(userBean.getOrgCode()); cmsContentRead.setOrgCode(userBean.getOrgCode());
cmsContentRead.setCmsContentId(id); cmsContentRead.setCmsContentId(id);
}else { } else {
//已阅 直接返回 //已阅 直接返回
if(cmsContentRead.getReadStatus() == 1){ if (cmsContentRead.getReadStatus() == 1) {
return ResultUtil.data(1); return ResultUtil.data(1);
} }
} }
...@@ -667,7 +699,7 @@ public class CmsController { ...@@ -667,7 +699,7 @@ public class CmsController {
cmsContentRead.setReadStatus(1); cmsContentRead.setReadStatus(1);
cmsContentRead.setReviewTime(new Date()); cmsContentRead.setReviewTime(new Date());
cmsContentRead.insertOrUpdate(); cmsContentRead.insertOrUpdate();
}catch (Exception e){ } catch (Exception e) {
log.error("=============已阅操作失败, " + e); log.error("=============已阅操作失败, " + e);
return ResultUtil.error(e); return ResultUtil.error(e);
} }
...@@ -676,6 +708,7 @@ public class CmsController { ...@@ -676,6 +708,7 @@ public class CmsController {
/** /**
* 根据讯息id查传阅列表 * 根据讯息id查传阅列表
*
* @return * @return
*/ */
@PostMapping(value = "/comment") @PostMapping(value = "/comment")
...@@ -686,11 +719,11 @@ public class CmsController { ...@@ -686,11 +719,11 @@ public class CmsController {
.selectOne(new QueryWrapper<CmsContentRead>().lambda() .selectOne(new QueryWrapper<CmsContentRead>().lambda()
.eq(CmsContentRead::getUserId, userBean.getEmpNum()) .eq(CmsContentRead::getUserId, userBean.getEmpNum())
.eq(CmsContentRead::getOrgCode, userBean.getOrgCode()) .eq(CmsContentRead::getOrgCode, userBean.getOrgCode())
.eq(CmsContentRead::getCmsContentId,cmsContentReadDto.getCmsContentId())); .eq(CmsContentRead::getCmsContentId, cmsContentReadDto.getCmsContentId()));
try { try {
cmsContentRead.setReviewContent(cmsContentReadDto.getReviewContent()); cmsContentRead.setReviewContent(cmsContentReadDto.getReviewContent());
cmsContentRead.insertOrUpdate(); cmsContentRead.insertOrUpdate();
}catch (Exception e){ } catch (Exception e) {
log.error("=============评论失败, " + e); log.error("=============评论失败, " + e);
return ResultUtil.error(e); return ResultUtil.error(e);
} }
...@@ -698,18 +731,63 @@ public class CmsController { ...@@ -698,18 +731,63 @@ public class CmsController {
} }
/** /**
* 根据讯息id查传阅增加文件
*
* @return
*/
@PostMapping(value = "/cmsAddFile")
@ApiOperation(value = "文件传阅增加文件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> cmsAddFile(@CurrentUser UserBean userBean, @RequestBody JSONObject request) {
String cmsContentId = request.getString("cmsContentId");
//用户id查询传阅消息
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", cmsContentId);
CmsContent cmsContent = CmsContent.builder().build().selectOne(queryWrapper);
JSONArray addjsonArray = JSONArray.fromObject(request.getString("filepathcms"));
JSONArray resjsonArray = JSONArray.fromObject(cmsContent.getFilepath());
resjsonArray.addAll(addjsonArray);
cmsContent.setFilepath(resjsonArray.toString());
cmsContentMapper.updateById(cmsContent);
return ResultUtil.data(resjsonArray.toString());
}
/**
* 添加传阅人员 * 添加传阅人员
*
* @return * @return
*/ */
@PostMapping(value = "/addReadPersonnel") @PostMapping(value = "/addReadPersonnel")
@ApiOperation(value = "添加传阅人员", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "添加传阅人员", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> addReadPersonnel(@CurrentUser UserBean userBean, @RequestBody List<CmsContentRead> cmsContentReads) { public Result<Object> addReadPersonnel(@CurrentUser UserBean userBean, @RequestBody List<CmsContentRead> cmsContentReads) {
for (CmsContentRead ccr:cmsContentReads for (CmsContentRead ccr : cmsContentReads
) { ) {
ccr.insert(); ccr.insert();
} }
return ResultUtil.success(); return ResultUtil.success();
} }
@PostMapping(value = "/getUnreadCmsList")
@ApiOperation(value = "获取当前用户的未读传阅列表", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> shxxquery(@CurrentUser UserBean userBean) {
return ResultUtil.data(cmsIsReadMapper.getUnreadList(userBean.getEmpNum()));
}
@PostMapping(value = "/adminDeleteFile")
@ApiOperation(value = "管理员删除附件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> adminDeleteFile(@CurrentUser UserBean userBean, @RequestBody CmsContentReadDto cmsContentReadDto) {
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if (ent.getUserType() == 2) {
return ResultUtil.error("当前用户没有权限操作");
}
CmsContent cmsContent = CmsContent.builder().id(cmsContentReadDto.getId()).build().selectById();
JSONArray resjsonArray = JSONArray.fromObject(cmsContent.getFilepath());
/*不转为int会默认使用remove(object)*/
resjsonArray.remove((int)cmsContentReadDto.getFileIndex());
cmsContent.setFilepath(resjsonArray.toString());
cmsContent.updateById();
return ResultUtil.success("删除附件成功");
}
} }
package cn.timer.api.controller.spmk;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.spmk.SpmkApproveDetailSummary;
import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.spmk.SpmkExecutor;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ApproveSummarySts;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.spmk.SpmkApproveExecuteRecordMapper;
import cn.timer.api.dao.spmk.SpmkApproveSummaryMapper;
import cn.timer.api.dao.spmk.SpmkExecutorMapper;
import cn.timer.api.dto.spmk.AdminApprovingDto;
import cn.timer.api.dto.spmk.FlowChildren;
import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.redis.RedisUtil;
import cn.timer.api.utils.router.RouterUtils;
import cn.timer.api.utils.router.business.SpmkAssoBusiness;
import cn.timer.api.utils.router.business.SpmkAssoBusinessFactory;
import cn.timer.api.utils.router.enums.ApproveEnum;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Slf4j
@Api(tags = "3.0Admin审批模块")
@RestController
@Transactional
@RequestMapping(value = "/admin/spmk", produces = { "application/json","multipart/form-data" })
public class AdminSpmkController {
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private SpmkApproveSummaryMapper spmkApproveSummaryMapper;
@Autowired
private SpmkExecutorMapper spmkExecutorMapper;
@Autowired
private SpmkAssoBusinessFactory spmkAssoBusinessFactory;
@Autowired
private SpmkApproveExecuteRecordMapper spmkApproveExecuteRecordMapper;
private static com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
@Resource
private RedisUtil redisUtil;
//TODO 管理员审批
/**
* 管理员审批
*/
@PostMapping(value = "/approving")
@ApiOperation(value = "1.审批人审批", httpMethod = "POST", notes = "审批人审批")
@Transactional(rollbackFor = Exception.class)
@ApiOperationSupport(order = 20)
@Log(title = "审批-审批流程", businessType = BusinessType.UPDATE)
public Result<Object> approving(@CurrentUser UserBean userBean,@Validated @RequestBody AdminApprovingDto approvingDto) throws Exception {
/*判断是否有权限转派*/
//if(approvingDto.getSts()==4){
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if(ent != null) {
/*超管和管理员不受权限控制*/
if(ent.getUserType() == 2) {
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId, userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId, "/Approvalspbutonspbuton020102"));
if (zzglAuth == null) {
return ResultUtil.error("您没有权限");
}
}
}
//}
Integer asId = approvingDto.getAsId();
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
Integer approStatus=Integer.parseInt(redisUtil.get(asId.toString())==null?"0":redisUtil.get(asId.toString()).toString());
if(approStatus==1){
return ResultUtil.error("该审批已在审批中!");
}else{
redisUtil.set(asId.toString(),1,2);
}
SpmkApproveDetailSummary ad = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
.lambda()
.select(SpmkApproveDetailSummary::getId,
SpmkApproveDetailSummary::getRequestData,
SpmkApproveDetailSummary::getFroms,
SpmkApproveDetailSummary::getFlowChildren)
.eq(SpmkApproveDetailSummary::getApproveSummaryId, asId));
// 查询 SpmkApproveSummary 状态,
SpmkApproveSummary aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts)
.eq(SpmkApproveSummary::getId, asId));
// if (aSummary.getSts() > ApproveSummarySts.IN.ordinal()) {
// redisUtil.set(asId.toString(),0,500);
// return ResultUtil.error("该审批已结束!");
// }
//
// // 查询该 审批的状态 是否为 1 审批中
// Integer count = SpmkExecutor.builder().build().selectCount(new QueryWrapper<SpmkExecutor>().lambda()
// .eq(SpmkExecutor::getId, approvingDto.getExecutorId())
// .eq(SpmkExecutor::getSts, ExecutorSts.IN_EXECUTION.ordinal()));
//
// if (count == 0) {
// redisUtil.set(asId.toString(),0,500);
// return ResultUtil.error("您已审批过!");
// }
if ( spmkExecutorMapper.selectCount(new QueryWrapper<SpmkExecutor>().lambda()
.eq(SpmkExecutor::getId, approvingDto.getExecutorId())
.eq(SpmkExecutor::getEmpNum, userBean.getEmpNum())
.eq(SpmkExecutor::getSts, ExecutorSts.IN_EXECUTION.ordinal())) == 0) {
Integer adminNum = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode())
.in(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN,SysRoleType.U_TYPE_C_ADMIN)
.count();
if (adminNum <= 0) {
redisUtil.set(asId.toString(),0,500);
return ResultUtil.error("非当前审批人 或 管理员,无法操作!");
}
}
//如果是再次审批
SpmkApproveExecuteRecord spmkApproveExecuteRecord = SpmkApproveExecuteRecord.builder().id(approvingDto.getExecuteRecordId()).build().selectById();
if(spmkApproveExecuteRecord.getSts()>1){
spmkApproveExecuteRecordMapper.delExecuteRecord(approvingDto.getExecuteRecordId(), asId);
}
List<FlowChildren> listFlowChildren = jsonObject.parseArray(ad.getFlowChildren(),FlowChildren.class);
RouterUtils.updateRefuseToAgree(
listFlowChildren,
asId,
approvingDto.getExecuteRecordId(),
approvingDto.getExecutorId(),
approvingDto.getOpinion(),
approvingDto.getSts(),
aSummary.getSts(),
approvingDto.getUser(),
approvingDto.getSignatureImg(),
userBean.getEmpNum(),
approvingDto.getUserList(),
approvingDto.getTypeIndex(),
approvingDto.getUserIndex()
);
// 更新 flowChildren
SpmkApproveDetailSummary sadsUpdate = SpmkApproveDetailSummary.builder().id(ad.getId()).flowChildren(JSONArray.fromObject(listFlowChildren).toString()).build();
/*// 审批详情 审批时添加 附件
if(RequestDataUtils.addFileList(ad,approvingDto.getFileList())){
sadsUpdate.setRequestData(ad.getRequestData());
}*/
sadsUpdate.updateById();
//最后一条数据
FlowChildren fc = CollUtil.getLast(listFlowChildren);
if (fc.getExecute() == "2") {
// 查询 SpmkApproveSummary 状态
aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType)
.eq(SpmkApproveSummary::getId, asId));
// if (aSummary.getSts() != ApproveSummarySts.REFUSE.ordinal()) {
SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
JSONObject jSONObject = jsonObject.parseObject(ad.getRequestData(),JSONObject.class);
jSONObject.set("approveId", FromData.builder().value(String.valueOf(asId)).build());
jSONObject.set("orgCode", userBean.getOrgCode());
//审批完成后 业务
SpmkAssoBusiness sab = spmkAssoBusinessFactory.createSpmkService(ApproveEnum.getEnums(aSummary.getAssoType()));
if (sab != null){
log.info("1----------{}",sab);
}
log.info("2----------{}", jSONObject);
sab.handleApprove(jSONObject);
}
// }
// }else {
// redisUtil.set(asId.toString(),0,500);
// return ResultUtil.error("该审批已结束!");
// }
redisUtil.set(asId.toString(),0,500);
return ResultUtil.success();
}
/**
* 删除-考核模板
@DeleteMapping(value = "/del_appraisal_t/{id}")
@ApiOperation(value = "2.移除-审批人", httpMethod = "DELETE", notes = "移除-审批人")
@ApiOperationSupport(order = 6)
@Role
public Result<Object> delAT(@CurrentUser UserBean userBean,@Validated @RequestBody AdminApprovingDto approvingDto) throws Exception {
jxglAppraisalTMapper.delete(new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getId, id)
.eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
return ResultUtil.success();
}*/
}
...@@ -2,22 +2,27 @@ package cn.timer.api.controller.spmk; ...@@ -2,22 +2,27 @@ package cn.timer.api.controller.spmk;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.*;
import java.util.Date; import java.util.stream.Collectors;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import cn.timer.api.bean.crm.CrmClientContacts;
import cn.timer.api.bean.sche.ScheduleTask;
import cn.timer.api.bean.spmk.*; import cn.timer.api.bean.spmk.*;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.dao.spmk.*; import cn.timer.api.dao.spmk.*;
import cn.timer.api.dto.spmk.*; import cn.timer.api.dto.spmk.*;
import cn.timer.api.utils.redis.RedisUtil; import cn.timer.api.utils.redis.RedisUtil;
import cn.timer.api.utils.router.RequestDataUtils;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.SerializationUtils; import com.baomidou.mybatisplus.core.toolkit.SerializationUtils;
import net.sf.json.JSON; import com.beust.jcommander.internal.Lists;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
...@@ -80,7 +85,7 @@ import javax.annotation.Resource; ...@@ -80,7 +85,7 @@ import javax.annotation.Resource;
@Api(tags = "3.0审批模块") @Api(tags = "3.0审批模块")
@RestController @RestController
@Transactional @Transactional
@RequestMapping(value = "/spmk", produces = { "application/json","multipart/form-data" }) @RequestMapping(value = "/spmk", produces = {"application/json", "multipart/form-data"})
public class SpmkController { public class SpmkController {
@Autowired @Autowired
...@@ -112,6 +117,9 @@ public class SpmkController { ...@@ -112,6 +117,9 @@ public class SpmkController {
@Autowired @Autowired
private SpmkAssoBusinessFactory spmkAssoBusinessFactory; private SpmkAssoBusinessFactory spmkAssoBusinessFactory;
@Autowired
private SpmkApproveDetailDraftsMapper spmkApproveDetailDraftsMapper;
private static com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); private static com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
private boolean ISFIRST = true; // 第一次启动审批流程 private boolean ISFIRST = true; // 第一次启动审批流程
...@@ -119,18 +127,22 @@ public class SpmkController { ...@@ -119,18 +127,22 @@ public class SpmkController {
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired
private SpmkApproveDraftsMapper spmkApproveDraftsMapper;
//TODO 审批模板组 //TODO 审批模板组
/** /**
* 新增或编辑-审批模板组 * 新增或编辑-审批模板组
*/ */
@PostMapping(value = "/save_approval_template_g") @PostMapping(value = "/save_approval_template_g")
@ApiOperation(value = "1.新增或编辑-审批模板组", httpMethod = "POST", notes = "新增或编辑-审批模板组") @ApiOperation(value = "1.新增或编辑-审批模板组", httpMethod = "POST", notes = "新增或编辑-审批模板组")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
public Result<Object> saveAtg(@Validated({Insert.class,Update.class}) @RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG){ public Result<Object> saveAtg(@Validated({Insert.class, Update.class}) @RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG) {
if (spmkApprovalTemplateG.selectCount(new QueryWrapper<SpmkApprovalTemplateG>().lambda() if (spmkApprovalTemplateG.selectCount(new QueryWrapper<SpmkApprovalTemplateG>().lambda()
.ne(spmkApprovalTemplateG.getId() != null,SpmkApprovalTemplateG::getId, spmkApprovalTemplateG.getId()) .ne(spmkApprovalTemplateG.getId() != null, SpmkApprovalTemplateG::getId, spmkApprovalTemplateG.getId())
.eq(SpmkApprovalTemplateG::getName, spmkApprovalTemplateG.getName())) > 0) { .eq(SpmkApprovalTemplateG::getName, spmkApprovalTemplateG.getName())) > 0) {
return ResultUtil.error("审批模板组名重复!"); return ResultUtil.error("审批模板组名重复!");
} }
...@@ -145,9 +157,9 @@ public class SpmkController { ...@@ -145,9 +157,9 @@ public class SpmkController {
@DeleteMapping(value = "/delete_approval_template_g/{id}") @DeleteMapping(value = "/delete_approval_template_g/{id}")
@ApiOperation(value = "2.删除-审批模板组", httpMethod = "DELETE", notes = "删除-审批模板组") @ApiOperation(value = "2.删除-审批模板组", httpMethod = "DELETE", notes = "删除-审批模板组")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
public Result<Object> deleteAtgById(@PathVariable int id){ public Result<Object> deleteAtgById(@PathVariable int id) {
if (spmkApprovalTemplateMapper.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda().eq(SpmkApprovalTemplate::getApprovalTemplateGId, id)) > 0 ) if (spmkApprovalTemplateMapper.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda().eq(SpmkApprovalTemplate::getApprovalTemplateGId, id)) > 0)
return ResultUtil.error("审批模板组存在 模板,不可直接删除!"); return ResultUtil.error("审批模板组存在 模板,不可直接删除!");
return SpmkApprovalTemplateG.builder().id(id).build().deleteById() ? return SpmkApprovalTemplateG.builder().id(id).build().deleteById() ?
...@@ -160,7 +172,7 @@ public class SpmkController { ...@@ -160,7 +172,7 @@ public class SpmkController {
@GetMapping(value = "/list_approval_template_g") @GetMapping(value = "/list_approval_template_g")
@ApiOperation(value = "3.查询列表-审批模板组", httpMethod = "GET", notes = "查询列表-审批模板组") @ApiOperation(value = "3.查询列表-审批模板组", httpMethod = "GET", notes = "查询列表-审批模板组")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
public Result<Object> selectListAtg(){ public Result<Object> selectListAtg() {
return ResultUtil.data(spmkApprovalTemplateGMapper.selectListAtInAtg()); return ResultUtil.data(spmkApprovalTemplateGMapper.selectListAtInAtg());
} }
...@@ -171,7 +183,7 @@ public class SpmkController { ...@@ -171,7 +183,7 @@ public class SpmkController {
@PutMapping(value = "/update_approval_template_g") @PutMapping(value = "/update_approval_template_g")
@ApiOperation(value = "4.排序-审批模板组", httpMethod = "PUT", notes = "排序-审批模板组") @ApiOperation(value = "4.排序-审批模板组", httpMethod = "PUT", notes = "排序-审批模板组")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
public Result<Object> ranksAtg(@Validated(Ranks.class) @RequestBody ValidList<SpmkApprovalTemplateG> list){ public Result<Object> ranksAtg(@Validated(Ranks.class) @RequestBody ValidList<SpmkApprovalTemplateG> list) {
if (list == null || (list != null && list.size() <= 0)) { if (list == null || (list != null && list.size() <= 0)) {
return ResultUtil.success(); return ResultUtil.success();
...@@ -180,13 +192,14 @@ public class SpmkController { ...@@ -180,13 +192,14 @@ public class SpmkController {
} }
//TODO 审批模板 //TODO 审批模板
/** /**
* 新增或编辑-审批模板 * 新增或编辑-审批模板
*/ */
@PostMapping(value = "/save_approval_template") @PostMapping(value = "/save_approval_template")
@ApiOperation(value = "5.新增或编辑-审批模板", httpMethod = "POST", notes = "新增或编辑-审批模板") @ApiOperation(value = "5.新增或编辑-审批模板", httpMethod = "POST", notes = "新增或编辑-审批模板")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
public Result<Object> saveAt(@Validated @RequestBody SpmkApprovalTemplateDto spmkApprovalTemplateDto){ public Result<Object> saveAt(@Validated @RequestBody SpmkApprovalTemplateDto spmkApprovalTemplateDto) {
Integer approvalTemplateGId = spmkApprovalTemplateDto.getApprovalTemplateGId(); Integer approvalTemplateGId = spmkApprovalTemplateDto.getApprovalTemplateGId();
if (ObjectUtil.isNull(approvalTemplateGId)) if (ObjectUtil.isNull(approvalTemplateGId))
...@@ -195,9 +208,9 @@ public class SpmkController { ...@@ -195,9 +208,9 @@ public class SpmkController {
SpmkApprovalTemplate at = SpmkApprovalTemplate.builder().build(); SpmkApprovalTemplate at = SpmkApprovalTemplate.builder().build();
// 克隆 SpmkApprovalTemplateDto对象 到 SpmkApprovalTemplate对象,排除属性froms,router // 克隆 SpmkApprovalTemplateDto对象 到 SpmkApprovalTemplate对象,排除属性froms,router
BeanUtil.copyProperties(spmkApprovalTemplateDto, at , "froms","router"); BeanUtil.copyProperties(spmkApprovalTemplateDto, at, "froms", "router");
// 序列化 后 写入 SpmkApprovalTemplate对象 // 序列化 后 写入 SpmkApprovalTemplate对象
at.setFroms(ObjectUtil.serialize((List<JSONObject>)spmkApprovalTemplateDto.getFroms())); at.setFroms(ObjectUtil.serialize((List<JSONObject>) spmkApprovalTemplateDto.getFroms()));
at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter())); at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter()));
if (at.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda() if (at.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda()
...@@ -222,7 +235,7 @@ public class SpmkController { ...@@ -222,7 +235,7 @@ public class SpmkController {
@DeleteMapping(value = "/delete_approval_template/{id}") @DeleteMapping(value = "/delete_approval_template/{id}")
@ApiOperation(value = "6.删除-审批模板", httpMethod = "DELETE", notes = "删除-审批模板") @ApiOperation(value = "6.删除-审批模板", httpMethod = "DELETE", notes = "删除-审批模板")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
public Result<Object> deleteAtById(@PathVariable int id){ public Result<Object> deleteAtById(@PathVariable int id) {
return SpmkApprovalTemplate.builder().id(id).build().deleteById() ? ResultUtil.success() : ResultUtil.error("没有找到该对象"); return SpmkApprovalTemplate.builder().id(id).build().deleteById() ? ResultUtil.success() : ResultUtil.error("没有找到该对象");
...@@ -234,11 +247,11 @@ public class SpmkController { ...@@ -234,11 +247,11 @@ public class SpmkController {
@GetMapping(value = "/select_approval_template/{id}") @GetMapping(value = "/select_approval_template/{id}")
@ApiOperation(value = "7.id查询-审批模板", httpMethod = "GET", notes = "id查询-审批模板") @ApiOperation(value = "7.id查询-审批模板", httpMethod = "GET", notes = "id查询-审批模板")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
public Result<Object> selectAtById(@PathVariable int id){ public Result<Object> selectAtById(@PathVariable int id) {
SpmkApprovalTemplate at = SpmkApprovalTemplate.builder().id(id).build().selectById(); SpmkApprovalTemplate at = SpmkApprovalTemplate.builder().id(id).build().selectById();
SpmkApprovalTemplateDto atd = SpmkApprovalTemplateDto.builder().build(); SpmkApprovalTemplateDto atd = SpmkApprovalTemplateDto.builder().build();
BeanUtil.copyProperties(at, atd,"froms","router"); BeanUtil.copyProperties(at, atd, "froms", "router");
atd.setFroms(ObjectUtil.deserialize(at.getFroms())); atd.setFroms(ObjectUtil.deserialize(at.getFroms()));
atd.setRouter(ObjectUtil.deserialize(at.getRouter())); atd.setRouter(ObjectUtil.deserialize(at.getRouter()));
return ResultUtil.data(atd); return ResultUtil.data(atd);
...@@ -251,7 +264,7 @@ public class SpmkController { ...@@ -251,7 +264,7 @@ public class SpmkController {
@PutMapping(value = "/update_approval_template") @PutMapping(value = "/update_approval_template")
@ApiOperation(value = "8.排序-审批模板", httpMethod = "PUT", notes = "查询列表-审批模板组") @ApiOperation(value = "8.排序-审批模板", httpMethod = "PUT", notes = "查询列表-审批模板组")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
public Result<Object> ranksAt(@Validated({Ranks.class})@RequestBody ValidList<SpmkApprovalTemplate> list){ public Result<Object> ranksAt(@Validated({Ranks.class}) @RequestBody ValidList<SpmkApprovalTemplate> list) {
if (list == null || (list != null && list.size() <= 0)) { if (list == null || (list != null && list.size() <= 0)) {
return ResultUtil.success(); return ResultUtil.success();
...@@ -262,15 +275,15 @@ public class SpmkController { ...@@ -262,15 +275,15 @@ public class SpmkController {
} }
//TODO 审批组 //TODO 审批组
/** /**
* 新增或编辑-审批组 * 新增或编辑-审批组
*/ */
@PostMapping(value = "/save_approval_g") @PostMapping(value = "/save_approval_g")
@ApiOperation(value = "9.新增或编辑-审批组", httpMethod = "POST", notes = "新增或编辑-审批组") @ApiOperation(value = "9.新增或编辑-审批组", httpMethod = "POST", notes = "新增或编辑-审批组")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
public Result<Object> saveAg(@CurrentUser UserBean userBean, @Validated({Insert.class,Update.class}) @RequestBody SpmkApprovalG spmkApprovalG){ public Result<Object> saveAg(@CurrentUser UserBean userBean, @Validated({Insert.class, Update.class}) @RequestBody SpmkApprovalG spmkApprovalG) {
if (spmkApprovalG.selectCount(new QueryWrapper<SpmkApprovalG>().lambda() if (spmkApprovalG.selectCount(new QueryWrapper<SpmkApprovalG>().lambda()
.ne(spmkApprovalG.getId() != null, SpmkApprovalG::getId, spmkApprovalG.getId()) .ne(spmkApprovalG.getId() != null, SpmkApprovalG::getId, spmkApprovalG.getId())
...@@ -290,7 +303,7 @@ public class SpmkController { ...@@ -290,7 +303,7 @@ public class SpmkController {
@DeleteMapping(value = "/delete_approval_g/{id}") @DeleteMapping(value = "/delete_approval_g/{id}")
@ApiOperation(value = "10.删除-审批组", httpMethod = "DELETE", notes = "删除-审批组") @ApiOperation(value = "10.删除-审批组", httpMethod = "DELETE", notes = "删除-审批组")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
public Result<Object> deleteAgById(@PathVariable int id){ public Result<Object> deleteAgById(@PathVariable int id) {
// if (spmkCustomApprovalMapper.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda().eq(SpmkCustomApproval::getApprovalGId, id)) > 0 ) // if (spmkCustomApprovalMapper.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda().eq(SpmkCustomApproval::getApprovalGId, id)) > 0 )
// return ResultUtil.error("审批组存在 自定义审批,不可直接删除!"); // return ResultUtil.error("审批组存在 自定义审批,不可直接删除!");
...@@ -306,7 +319,7 @@ public class SpmkController { ...@@ -306,7 +319,7 @@ public class SpmkController {
@GetMapping(value = "/all_approval_g") @GetMapping(value = "/all_approval_g")
@ApiOperation(value = "11.查询列表-审批组-审批管理", httpMethod = "GET", notes = "查询列表-审批组-审批管理") @ApiOperation(value = "11.查询列表-审批组-审批管理", httpMethod = "GET", notes = "查询列表-审批组-审批管理")
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
public Result<Object> selectListAgByAdmin(@CurrentUser UserBean userBean){ public Result<Object> selectListAgByAdmin(@CurrentUser UserBean userBean) {
List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum()); List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum());
return ResultUtil.data(spmkApprovalGMapper.selectListAgInCaByAdmin(userBean.getOrgCode(), userBean.getEmpNum(), depts)); return ResultUtil.data(spmkApprovalGMapper.selectListAgInCaByAdmin(userBean.getOrgCode(), userBean.getEmpNum(), depts));
...@@ -319,10 +332,10 @@ public class SpmkController { ...@@ -319,10 +332,10 @@ public class SpmkController {
@GetMapping(value = "/all_approval_g1") @GetMapping(value = "/all_approval_g1")
@ApiOperation(value = "11.查询列表-审批组-审批管理", httpMethod = "GET", notes = "查询列表-审批组-审批管理") @ApiOperation(value = "11.查询列表-审批组-审批管理", httpMethod = "GET", notes = "查询列表-审批组-审批管理")
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
public Result<Object> selectListAgByAdmin1(@CurrentUser UserBean userBean,@RequestParam("eaaname")String eaaname){ public Result<Object> selectListAgByAdmin1(@CurrentUser UserBean userBean, @RequestParam("eaaname") String eaaname) {
List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum()); List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum());
return ResultUtil.data(spmkApprovalGMapper.selectListAgInCaByAdmin1(userBean.getOrgCode(), userBean.getEmpNum(), depts,eaaname)); return ResultUtil.data(spmkApprovalGMapper.selectListAgInCaByAdmin1(userBean.getOrgCode(), userBean.getEmpNum(), depts, eaaname));
} }
...@@ -332,7 +345,7 @@ public class SpmkController { ...@@ -332,7 +345,7 @@ public class SpmkController {
@GetMapping(value = "/list_approval_g") @GetMapping(value = "/list_approval_g")
@ApiOperation(value = "11.查询列表-审批组-个人审批", httpMethod = "GET", notes = "查询列表-审批组-个人审批") @ApiOperation(value = "11.查询列表-审批组-个人审批", httpMethod = "GET", notes = "查询列表-审批组-个人审批")
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
public Result<Object> selectListAg(@CurrentUser UserBean userBean){ public Result<Object> selectListAg(@CurrentUser UserBean userBean) {
List<SpmkApprovalG> spmkApprovalGS = spmkService.selectListAg(userBean); List<SpmkApprovalG> spmkApprovalGS = spmkService.selectListAg(userBean);
return ResultUtil.data(spmkService.selectListAg(userBean)); return ResultUtil.data(spmkService.selectListAg(userBean));
} }
...@@ -343,7 +356,7 @@ public class SpmkController { ...@@ -343,7 +356,7 @@ public class SpmkController {
@PutMapping(value = "/update_approval_g") @PutMapping(value = "/update_approval_g")
@ApiOperation(value = "12.排序-审批组", httpMethod = "PUT", notes = "排序-审批组") @ApiOperation(value = "12.排序-审批组", httpMethod = "PUT", notes = "排序-审批组")
@ApiOperationSupport(order = 12) @ApiOperationSupport(order = 12)
public Result<Object> ranksAg(@Validated({Ranks.class}) @RequestBody ValidList<SpmkApprovalG> list){ public Result<Object> ranksAg(@Validated({Ranks.class}) @RequestBody ValidList<SpmkApprovalG> list) {
if (list == null || list.size() <= 0) { if (list == null || list.size() <= 0) {
return ResultUtil.success(); return ResultUtil.success();
...@@ -361,11 +374,11 @@ public class SpmkController { ...@@ -361,11 +374,11 @@ public class SpmkController {
@ApiOperation(value = "13.新增或编辑-自定义审批", httpMethod = "POST", notes = "新增或编辑-自定义审批") @ApiOperation(value = "13.新增或编辑-自定义审批", httpMethod = "POST", notes = "新增或编辑-自定义审批")
@ApiOperationSupport(order = 13) @ApiOperationSupport(order = 13)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result<Object> saveCa(@CurrentUser UserBean userBean,@Validated @RequestBody SpmkCustomApprovalDto spmkCustomApprovalDto) throws Exception{ public Result<Object> saveCa(@CurrentUser UserBean userBean, @Validated @RequestBody SpmkCustomApprovalDto spmkCustomApprovalDto) throws Exception {
SpmkCustomApproval ca = SpmkCustomApproval.builder().build(); SpmkCustomApproval ca = SpmkCustomApproval.builder().build();
BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs"); BeanUtil.copyProperties(spmkCustomApprovalDto, ca, "froms", "router", "initiatorConfigs");
if (ca.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda() if (ca.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda()
.ne(ca.getId() != null, SpmkCustomApproval::getId, ca.getId()) .ne(ca.getId() != null, SpmkCustomApproval::getId, ca.getId())
...@@ -418,13 +431,14 @@ public class SpmkController { ...@@ -418,13 +431,14 @@ public class SpmkController {
/** /**
* 删除-自定义审批 * 删除-自定义审批
*
* @throws Exception * @throws Exception
*/ */
@DeleteMapping(value = "/delete_custom_approval/{id}") @DeleteMapping(value = "/delete_custom_approval/{id}")
@ApiOperation(value = "14.删除-自定义审批", httpMethod = "DELETE", notes = "删除-自定义审批") @ApiOperation(value = "14.删除-自定义审批", httpMethod = "DELETE", notes = "删除-自定义审批")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ApiOperationSupport(order = 14) @ApiOperationSupport(order = 14)
public Result<Object> deleteCaById(@PathVariable int id) throws Exception{ public Result<Object> deleteCaById(@PathVariable int id) throws Exception {
SpmkInitiatorConfig.builder().build().delete(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id)); SpmkInitiatorConfig.builder().build().delete(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id));
if (!SpmkCustomApproval.builder().id(id).build().deleteById()) { if (!SpmkCustomApproval.builder().id(id).build().deleteById()) {
...@@ -440,14 +454,14 @@ public class SpmkController { ...@@ -440,14 +454,14 @@ public class SpmkController {
@GetMapping(value = "/select_custom_approval/{id}") @GetMapping(value = "/select_custom_approval/{id}")
@ApiOperation(value = "15.id查询-自定义审批", httpMethod = "GET", notes = "id查询-自定义审批") @ApiOperation(value = "15.id查询-自定义审批", httpMethod = "GET", notes = "id查询-自定义审批")
@ApiOperationSupport(order = 15) @ApiOperationSupport(order = 15)
public Result<Object> selectCaById(@PathVariable int id){ public Result<Object> selectCaById(@PathVariable int id) {
SpmkCustomApproval ca = SpmkCustomApproval.builder().id(id).build().selectById(); SpmkCustomApproval ca = SpmkCustomApproval.builder().id(id).build().selectById();
List<SpmkInitiatorConfig> listIc = SpmkInitiatorConfig.builder().build().selectList(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id)); List<SpmkInitiatorConfig> listIc = SpmkInitiatorConfig.builder().build().selectList(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id));
SpmkCustomApprovalDto caD = SpmkCustomApprovalDto.builder() SpmkCustomApprovalDto caD = SpmkCustomApprovalDto.builder()
.froms(ObjectUtil.deserialize(ca.getFroms())) .froms(ObjectUtil.deserialize(ca.getFroms()))
.router(ObjectUtil.deserialize(ca.getRouter())) .router(ObjectUtil.deserialize(ca.getRouter()))
.build(); .build();
BeanUtil.copyProperties(ca, caD,"froms","router"); BeanUtil.copyProperties(ca, caD, "froms", "router");
caD.setInitiatorConfigs(listIc); caD.setInitiatorConfigs(listIc);
return ResultUtil.data(caD); return ResultUtil.data(caD);
} }
...@@ -458,7 +472,7 @@ public class SpmkController { ...@@ -458,7 +472,7 @@ public class SpmkController {
@PutMapping(value = "/update_custom_approval") @PutMapping(value = "/update_custom_approval")
@ApiOperation(value = "16.排序-自定义审批", httpMethod = "PUT", notes = "排序-自定义审批") @ApiOperation(value = "16.排序-自定义审批", httpMethod = "PUT", notes = "排序-自定义审批")
@ApiOperationSupport(order = 16) @ApiOperationSupport(order = 16)
public Result<Object> ranksCa(@Validated({Ranks.class}) @RequestBody ValidList<SpmkCustomApproval> list){ public Result<Object> ranksCa(@Validated({Ranks.class}) @RequestBody ValidList<SpmkCustomApproval> list) {
if (list == null || (list != null && list.size() <= 0)) { if (list == null || (list != null && list.size() <= 0)) {
return ResultUtil.success(); return ResultUtil.success();
...@@ -476,7 +490,7 @@ public class SpmkController { ...@@ -476,7 +490,7 @@ public class SpmkController {
@PutMapping(value = "/test_spmk") @PutMapping(value = "/test_spmk")
@ApiOperation(value = "16.测试", httpMethod = "PUT", notes = "排序-自定义审批") @ApiOperation(value = "16.测试", httpMethod = "PUT", notes = "排序-自定义审批")
@ApiOperationSupport(order = 16) @ApiOperationSupport(order = 16)
public Result<Object> test222(@Validated({Ranks.class}) @RequestBody ValidList<SpmkCustomApproval> list){ public Result<Object> test222(@Validated({Ranks.class}) @RequestBody ValidList<SpmkCustomApproval> list) {
Set<Integer> lanzi = new HashSet<Integer>(); Set<Integer> lanzi = new HashSet<Integer>();
//所有部门岗位 //所有部门岗位
...@@ -493,11 +507,11 @@ public class SpmkController { ...@@ -493,11 +507,11 @@ public class SpmkController {
} }
//遍历 //遍历
public static Set<Integer> empNumupdept2(Set<Integer> lanzi,List<ZzglBmgwM> bmgws,Integer getId) { public static Set<Integer> empNumupdept2(Set<Integer> lanzi, List<ZzglBmgwM> bmgws, Integer getId) {
for (ZzglBmgwM z : bmgws) { for (ZzglBmgwM z : bmgws) {
if (getId.equals(z.getId())) { if (getId.equals(z.getId())) {
lanzi.add(getId); lanzi.add(getId);
if (z.getUpId()==null || z.getUpId() == 0) { if (z.getUpId() == null || z.getUpId() == 0) {
return lanzi; return lanzi;
} }
getId = z.getUpId(); getId = z.getUpId();
...@@ -508,8 +522,10 @@ public class SpmkController { ...@@ -508,8 +522,10 @@ public class SpmkController {
} }
// TODO 审批汇总(发起审批) // TODO 审批汇总(发起审批)
/** /**
* 发起审批 * 发起审批
*
* @throws Exception * @throws Exception
*/ */
@PostMapping(value = "/start_approval") @PostMapping(value = "/start_approval")
...@@ -517,10 +533,10 @@ public class SpmkController { ...@@ -517,10 +533,10 @@ public class SpmkController {
@ApiOperationSupport(order = 17) @ApiOperationSupport(order = 17)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Log(title = "审批-发起审批", businessType = BusinessType.INSERT) @Log(title = "审批-发起审批", businessType = BusinessType.INSERT)
public Result<Object> saveA(@CurrentUser UserBean userBean,@Validated @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception{ public Result<Object> saveA(@CurrentUser UserBean userBean, @Validated @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>() YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda() .lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName) .select(YgglMainEmp::getHeadUrl, YgglMainEmp::getName)
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum()) .eq(YgglMainEmp::getEmpNum, userBean.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()) .eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
); );
...@@ -532,8 +548,7 @@ public class SpmkController { ...@@ -532,8 +548,7 @@ public class SpmkController {
Router router = spmkApproveSummaryDto.getRouter(); Router router = spmkApproveSummaryDto.getRouter();
List<Router> routers = router.getChildren(); List<Router> routers = router.getChildren();
// routers = RouterUtils.clearRouters(routers); if (routers == null) {
if(routers==null){
return ResultUtil.error("无法发起,请完善审批流程"); return ResultUtil.error("无法发起,请完善审批流程");
} }
if (CollectionUtil.isNotEmpty(routers)) { if (CollectionUtil.isNotEmpty(routers)) {
...@@ -556,7 +571,7 @@ public class SpmkController { ...@@ -556,7 +571,7 @@ public class SpmkController {
// if(!hasAudit){ // if(!hasAudit){
// return ResultUtil.error("请选择审批人!"); // return ResultUtil.error("请选择审批人!");
// } // }
}else { } else {
return ResultUtil.error("无法发起,请完善审批流程"); return ResultUtil.error("无法发起,请完善审批流程");
} }
...@@ -570,17 +585,17 @@ public class SpmkController { ...@@ -570,17 +585,17 @@ public class SpmkController {
.set("id", userBean.getEmpNum()); .set("id", userBean.getEmpNum());
RouterUtils.NextNode(listRouter, jSONObject, ISFIRST); RouterUtils.NextNode(listRouter, jSONObject, ISFIRST);
List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>(); List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>();
RouterUtils.getIsFlowChildren(listRouter,listFlowChildren); RouterUtils.getIsFlowChildren(listRouter, listFlowChildren);
if(listFlowChildren.isEmpty()){ if (listFlowChildren.isEmpty()) {
return ResultUtil.error("无法发起,请完善审批流程"); return ResultUtil.error("无法发起,请完善审批流程");
} }
List<FlowChildren> listFlowChildren1 = (ArrayList<FlowChildren>) SerializationUtils.clone((Serializable) listFlowChildren); List<FlowChildren> listFlowChildren1 = (ArrayList<FlowChildren>) SerializationUtils.clone((Serializable) listFlowChildren);
List<String> uidlist = new ArrayList<>(); List<String> uidlist = new ArrayList<>();
int i=0; int i = 0;
int fsize = listFlowChildren.size(); int fsize = listFlowChildren.size();
int f=0;//listFlowChildren删除次数 int f = 0;//listFlowChildren删除次数
for (FlowChildren flowChildrenItem: listFlowChildren) { for (FlowChildren flowChildrenItem : listFlowChildren) {
if ("audit".equals(flowChildrenItem.getClassName())) { if ("audit".equals(flowChildrenItem.getClassName())) {
boolean hasAudit = false; boolean hasAudit = false;
...@@ -588,29 +603,29 @@ public class SpmkController { ...@@ -588,29 +603,29 @@ public class SpmkController {
if (relation.getUsers().size() > 0) { if (relation.getUsers().size() > 0) {
hasAudit = true; hasAudit = true;
//审批人去重 //审批人去重
if (relation.getUsers().size() > 1){ if (relation.getUsers().size() > 1) {
int j=0; int j = 0;
int usize=relation.getUsers().size();// int usize = relation.getUsers().size();//
int r=0;//user list删除次数 int r = 0;//user list删除次数
for (User user:relation.getUsers() for (User user : relation.getUsers()
) { ) {
if (!uidlist.contains(user.getId())) { if (!uidlist.contains(user.getId())) {
uidlist.add(user.getId()); uidlist.add(user.getId());
}else { } else {
listFlowChildren1.get(i).getRelation().get(0).getUsers().remove(j-r); listFlowChildren1.get(i).getRelation().get(0).getUsers().remove(j - r);
r++; r++;
} }
j++; j++;
} }
if (usize==r){ if (usize == r) {
listFlowChildren1.remove(i-f); listFlowChildren1.remove(i - f);
f++; f++;
} }
}else { } else {
if (!uidlist.contains(relation.getUsers().get(0).getId())) { if (!uidlist.contains(relation.getUsers().get(0).getId())) {
uidlist.add(relation.getUsers().get(0).getId()); uidlist.add(relation.getUsers().get(0).getId());
}else { } else {
listFlowChildren1.remove(i-f); listFlowChildren1.remove(i - f);
f++; f++;
} }
} }
...@@ -648,6 +663,7 @@ public class SpmkController { ...@@ -648,6 +663,7 @@ public class SpmkController {
.orgCode(userBean.getOrgCode()) .orgCode(userBean.getOrgCode())
.empNum(userBean.getEmpNum()) .empNum(userBean.getEmpNum())
.title(spmkApproveSummaryDto.getTitle()) .title(spmkApproveSummaryDto.getTitle())
.digest(spmkApproveSummaryDto.getDigest())
.initiator(spmkApproveSummaryDto.getInitiator()) .initiator(spmkApproveSummaryDto.getInitiator())
.approveName(spmkApproveSummaryDto.getApproveName()) .approveName(spmkApproveSummaryDto.getApproveName())
.assoType(spmkApproveSummaryDto.getAssoType()) .assoType(spmkApproveSummaryDto.getAssoType())
...@@ -672,7 +688,7 @@ public class SpmkController { ...@@ -672,7 +688,7 @@ public class SpmkController {
adm.setFlowChildren(JSONArray.fromObject(listFlowChildren).toString()); adm.setFlowChildren(JSONArray.fromObject(listFlowChildren).toString());
try { try {
spmkApproveDetailSummaryMapper.insert(adm); spmkApproveDetailSummaryMapper.insert(adm);
}catch (Exception e){ } catch (Exception e) {
throw new CustomException("审批详情-新增异常"); throw new CustomException("审批详情-新增异常");
} }
...@@ -680,8 +696,10 @@ public class SpmkController { ...@@ -680,8 +696,10 @@ public class SpmkController {
} }
//TODO 审批汇总 //TODO 审批汇总
/** /**
* 审批汇总 * 审批汇总
*
* @param summaryQueryDto * @param summaryQueryDto
* @return * @return
* @throws * @throws
...@@ -719,6 +737,7 @@ public class SpmkController { ...@@ -719,6 +737,7 @@ public class SpmkController {
} }
//TODO 审批详情 //TODO 审批详情
/** /**
* 审批详情 * 审批详情
*/ */
...@@ -726,14 +745,28 @@ public class SpmkController { ...@@ -726,14 +745,28 @@ public class SpmkController {
@ApiOperation(value = "19.审批详情", httpMethod = "GET", notes = "审批详情") @ApiOperation(value = "19.审批详情", httpMethod = "GET", notes = "审批详情")
@ApiOperationSupport(order = 19) @ApiOperationSupport(order = 19)
@Log(title = "审批-审批详情", businessType = BusinessType.OTHER) @Log(title = "审批-审批详情", businessType = BusinessType.OTHER)
public Result<Object> selectAd(@PathVariable(required = true) Integer id) { public Result<Object> selectAd(@CurrentUser UserBean userBean, @PathVariable(required = true) Integer id) {
SpmkApproveDetailDto adD = spmkService.selectApproveDetailByAsId(id); SpmkApproveDetailDto adD = spmkService.selectApproveDetailByAsId(id, userBean.getEmpNum());
System.out.println(ResultUtil.data(adD));
return ResultUtil.data(adD);
}
/**
* 审批详情
*/
@GetMapping(value = "/select_drafts_detail/{id}")
@ApiOperation(value = "草稿箱审批详情", httpMethod = "GET", notes = "审批详情")
@Log(title = "审批-审批详情", businessType = BusinessType.OTHER)
public Result<Object> selectdd(@CurrentUser UserBean userBean, @PathVariable(required = true) Integer id) {
SpmkApproveDetailDto adD = spmkService.selectDraftsDetailByAsId(id);
System.out.println(ResultUtil.data(adD)); System.out.println(ResultUtil.data(adD));
return ResultUtil.data(adD); return ResultUtil.data(adD);
} }
//TODO 审批人审批 //TODO 审批人审批
/** /**
* 审批人审批 * 审批人审批
*/ */
...@@ -743,19 +776,36 @@ public class SpmkController { ...@@ -743,19 +776,36 @@ public class SpmkController {
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
@Log(title = "审批-审批流程", businessType = BusinessType.UPDATE) @Log(title = "审批-审批流程", businessType = BusinessType.UPDATE)
// @BindingResultCtrol(title = "审批人审批") // @BindingResultCtrol(title = "审批人审批")
public Result<Object> approving(@CurrentUser UserBean userBean,@Validated @RequestBody ApprovingDto approvingDto) throws Exception { public Result<Object> approving(@CurrentUser UserBean userBean, @Validated @RequestBody ApprovingDto approvingDto) throws Exception {
/*判断是否有权限转派*/
if (approvingDto.getSts() == 4) {
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if (ent != null) {
/*超管和管理员不受权限控制*/
if (ent.getUserType() == 2) {
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId, userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId, "/Approvalspbutonspbuton020102"));
if (zzglAuth == null) {
return ResultUtil.error("您没有转派权限");
}
}
}
}
Integer asId = approvingDto.getAsId(); Integer asId = approvingDto.getAsId();
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行 //查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
Integer approStatus=Integer.parseInt(redisUtil.get(asId.toString())==null?"0":redisUtil.get(asId.toString()).toString()); Integer approStatus = Integer.parseInt(redisUtil.get(asId.toString()) == null ? "0" : redisUtil.get(asId.toString()).toString());
if(approStatus==1){ if (approStatus == 1) {
return ResultUtil.error("该审批已在审批中!"); return ResultUtil.error("该审批已在审批中!");
}else{ } else {
redisUtil.set(asId.toString(),1,5000); redisUtil.set(asId.toString(), 1, 2);
} }
SpmkApproveDetailSummary ad = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>() SpmkApproveDetailSummary ad = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
.lambda() .lambda()
.select(SpmkApproveDetailSummary::getId, .select(SpmkApproveDetailSummary::getId,
SpmkApproveDetailSummary::getRequestData, SpmkApproveDetailSummary::getRequestData,
SpmkApproveDetailSummary::getFroms,
SpmkApproveDetailSummary::getFlowChildren) SpmkApproveDetailSummary::getFlowChildren)
.eq(SpmkApproveDetailSummary::getApproveSummaryId, asId)); .eq(SpmkApproveDetailSummary::getApproveSummaryId, asId));
...@@ -765,7 +815,7 @@ public class SpmkController { ...@@ -765,7 +815,7 @@ public class SpmkController {
.eq(SpmkApproveSummary::getId, asId)); .eq(SpmkApproveSummary::getId, asId));
if (aSummary.getSts() > ApproveSummarySts.IN.ordinal()) { if (aSummary.getSts() > ApproveSummarySts.IN.ordinal()) {
redisUtil.set(asId.toString(),0,500); redisUtil.set(asId.toString(), 0, 500);
return ResultUtil.error("该审批已结束!"); return ResultUtil.error("该审批已结束!");
} }
...@@ -775,11 +825,11 @@ public class SpmkController { ...@@ -775,11 +825,11 @@ public class SpmkController {
.eq(SpmkExecutor::getSts, ExecutorSts.IN_EXECUTION.ordinal())); .eq(SpmkExecutor::getSts, ExecutorSts.IN_EXECUTION.ordinal()));
if (count == 0) { if (count == 0) {
redisUtil.set(asId.toString(),0,500); redisUtil.set(asId.toString(), 0, 500);
return ResultUtil.error("您已审批过!"); return ResultUtil.error("您已审批过!");
} }
if ( spmkExecutorMapper.selectCount(new QueryWrapper<SpmkExecutor>().lambda() if (spmkExecutorMapper.selectCount(new QueryWrapper<SpmkExecutor>().lambda()
.eq(SpmkExecutor::getId, approvingDto.getExecutorId()) .eq(SpmkExecutor::getId, approvingDto.getExecutorId())
.eq(SpmkExecutor::getEmpNum, userBean.getEmpNum()) .eq(SpmkExecutor::getEmpNum, userBean.getEmpNum())
.eq(SpmkExecutor::getSts, ExecutorSts.IN_EXECUTION.ordinal())) == 0) { .eq(SpmkExecutor::getSts, ExecutorSts.IN_EXECUTION.ordinal())) == 0) {
...@@ -787,18 +837,18 @@ public class SpmkController { ...@@ -787,18 +837,18 @@ public class SpmkController {
Integer adminNum = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper) Integer adminNum = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()) .eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()) .eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode())
.in(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN,SysRoleType.U_TYPE_C_ADMIN) .in(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN, SysRoleType.U_TYPE_C_ADMIN)
.count(); .count();
if (adminNum <= 0) { if (adminNum <= 0) {
redisUtil.set(asId.toString(),0,500); redisUtil.set(asId.toString(), 0, 500);
return ResultUtil.error("非当前审批人 或 管理员,无法操作!"); return ResultUtil.error("非当前审批人 或 管理员,无法操作!");
} }
} }
if (aSummary.getSts() == 0) { if (aSummary.getSts() == 0) {
List<FlowChildren> listFlowChildren = jsonObject.parseArray(ad.getFlowChildren(),FlowChildren.class); List<FlowChildren> listFlowChildren = jsonObject.parseArray(ad.getFlowChildren(), FlowChildren.class);
// 审批逻辑 // 审批逻辑
RouterUtils.approving( RouterUtils.approving(
listFlowChildren, listFlowChildren,
...@@ -809,46 +859,54 @@ public class SpmkController { ...@@ -809,46 +859,54 @@ public class SpmkController {
approvingDto.getSts(), approvingDto.getSts(),
approvingDto.getUser(), approvingDto.getUser(),
approvingDto.getSignatureImg(), approvingDto.getSignatureImg(),
userBean.getEmpNum() userBean.getEmpNum(),
approvingDto.getUserList()
); );
// 更新 flowChildren // 更新 flowChildren
SpmkApproveDetailSummary.builder().id(ad.getId()).flowChildren(JSONArray.fromObject(listFlowChildren).toString()).build().updateById(); SpmkApproveDetailSummary sadsUpdate = SpmkApproveDetailSummary.builder().id(ad.getId()).flowChildren(JSONArray.fromObject(listFlowChildren).toString()).build();
// 审批详情 审批时添加 附件
if (RequestDataUtils.addFileList(ad, approvingDto.getFileList())) {
sadsUpdate.setRequestData(ad.getRequestData());
}
sadsUpdate.updateById();
//最后一条数据 //最后一条数据
FlowChildren fc = CollUtil.getLast(listFlowChildren); FlowChildren fc = CollUtil.getLast(listFlowChildren);
if (fc.getExecute() == "2") { if (fc.getExecute() == "2") {
// 查询 SpmkApproveSummary 状态 // 查询 SpmkApproveSummary 状态
aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda() aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType) .select(SpmkApproveSummary::getSts, SpmkApproveSummary::getAssoType)
.eq(SpmkApproveSummary::getId, asId)); .eq(SpmkApproveSummary::getId, asId));
if (aSummary.getSts() != ApproveSummarySts.REFUSE.ordinal()) { if (aSummary.getSts() != ApproveSummarySts.REFUSE.ordinal()) {
SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById(); SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
JSONObject jSONObject = jsonObject.parseObject(ad.getRequestData(),JSONObject.class); JSONObject jSONObject = jsonObject.parseObject(ad.getRequestData(), JSONObject.class);
jSONObject.set("approveId", FromData.builder().value(String.valueOf(asId)).build()); jSONObject.set("approveId", FromData.builder().value(String.valueOf(asId)).build());
jSONObject.set("orgCode", userBean.getOrgCode()); jSONObject.set("orgCode", userBean.getOrgCode());
//审批完成后 业务 //审批完成后 业务
SpmkAssoBusiness sab = spmkAssoBusinessFactory.createSpmkService(ApproveEnum.getEnums(aSummary.getAssoType())); SpmkAssoBusiness sab = spmkAssoBusinessFactory.createSpmkService(ApproveEnum.getEnums(aSummary.getAssoType()));
if (sab != null) if (sab != null)
Logoutput("1----------"+ sab); Logoutput("1----------" + sab);
Logoutput("2----------"+ jSONObject); Logoutput("2----------" + jSONObject);
sab.handleApprove(jSONObject); sab.handleApprove(jSONObject);
} }
} }
}else { } else {
redisUtil.set(asId.toString(),0,500); redisUtil.set(asId.toString(), 0, 500);
return ResultUtil.error("该审批已结束!"); return ResultUtil.error("该审批已结束!");
} }
redisUtil.set(asId.toString(),0,500); redisUtil.set(asId.toString(), 0, 500);
return ResultUtil.success(); return ResultUtil.success();
} }
@Autowired @Autowired
private PunchRecordMapper punchrecordmapper; private PunchRecordMapper punchrecordmapper;
//TODO 我发起的/我审批的/抄送我的 //TODO 我发起的/我审批的/抄送我的
/** /**
* 查询列表-我发起的/我审批的/抄送我的-分页 * 查询列表-我发起的/我审批的/抄送我的-分页
*/ */
...@@ -856,17 +914,17 @@ public class SpmkController { ...@@ -856,17 +914,17 @@ public class SpmkController {
@ApiOperation(value = "21.查询列表-我发起的/我审批的/抄送我的-分页", httpMethod = "POST", notes = "查询列表-我审批的-关键字、审批状态、发起时间-分页") @ApiOperation(value = "21.查询列表-我发起的/我审批的/抄送我的-分页", httpMethod = "POST", notes = "查询列表-我审批的-关键字、审批状态、发起时间-分页")
@ApiOperationSupport(order = 21) @ApiOperationSupport(order = 21)
@Log(title = "审批-我发起的/我审批的/抄送我的", businessType = BusinessType.OTHER) @Log(title = "审批-我发起的/我审批的/抄送我的", businessType = BusinessType.OTHER)
public Result<Object> selectMyAs(@CurrentUser UserBean userBean, @Validated @RequestBody MySummaryQueryDto mySummaryQueryDto) throws MethodArgumentNotValidException{ public Result<Object> selectMyAs(@CurrentUser UserBean userBean, @Validated @RequestBody MySummaryQueryDto mySummaryQueryDto) throws MethodArgumentNotValidException {
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>( IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(
mySummaryQueryDto.getCurrentPage() == null ? 1 : mySummaryQueryDto.getCurrentPage(), mySummaryQueryDto.getCurrentPage() == null ? 1 : mySummaryQueryDto.getCurrentPage(),
mySummaryQueryDto.getTotalPage() == null ? 10 : mySummaryQueryDto.getTotalPage()); mySummaryQueryDto.getTotalPage() == null ? 10 : mySummaryQueryDto.getTotalPage());
mySummaryQueryDto.setOrgCode(userBean.getOrgCode()); mySummaryQueryDto.setOrgCode(userBean.getOrgCode());
mySummaryQueryDto.setEmpNum(userBean.getEmpNum()); mySummaryQueryDto.setEmpNum(userBean.getEmpNum());
if(mySummaryQueryDto.getSts() == null) { if (mySummaryQueryDto.getSts() == null) {
mySummaryQueryDto.setSts(0); mySummaryQueryDto.setSts(0);
} }
//我发起的 //我发起的
if(mySummaryQueryDto.getType() == 0) { if (mySummaryQueryDto.getType() == 0) {
// mySummaryQueryDto.setSts(null); // mySummaryQueryDto.setSts(null);
} }
// 缺-部门id 搜索 // 缺-部门id 搜索
...@@ -874,40 +932,52 @@ public class SpmkController { ...@@ -874,40 +932,52 @@ public class SpmkController {
List<SpmkApproveSummary> listAs = pageAs.getRecords(); List<SpmkApproveSummary> listAs = pageAs.getRecords();
for(SpmkApproveSummary sp : listAs) { for (SpmkApproveSummary sp : listAs) {
String requerstr = ""; String requerstr = "";
try { try {
SpmkApproveDetailSummary ad = spmkApproveDetailSummaryMapper.selectOne(new QueryWrapper<SpmkApproveDetailSummary>().lambda().eq(SpmkApproveDetailSummary::getApproveSummaryId, sp.getId())); SpmkApproveDetailSummary ad = spmkApproveDetailSummaryMapper.selectOne(new QueryWrapper<SpmkApproveDetailSummary>().lambda().eq(SpmkApproveDetailSummary::getApproveSummaryId, sp.getId()).last("limit 1"));
JSONObject as =jsonObject.parseObject(ad.getRequestData().toString(),JSONObject.class); JSONObject as = jsonObject.parseObject(ad.getRequestData().toString(), JSONObject.class);
// Logoutput(as); // Logoutput(as);
// Logoutput(sp.getId()+"==========================================="+sp.getAssoType()); // Logoutput(sp.getId()+"==========================================="+sp.getAssoType());
requerstr = ""; requerstr = "";
//assoType : 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡 //assoType : 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡
switch (sp.getAssoType()) { switch (sp.getAssoType()) {
case 1:requerstr = "转正时间:"+as.getJSONObject("__newConfirmationTime").getStr("value");break; case 1:
case 2:requerstr = "离职时间:"+as.getJSONObject("__terminationDate").getStr("value");break; requerstr = "转正时间:" + as.getJSONObject("__newConfirmationTime").getStr("value");
break;
case 2:
requerstr = "离职时间:" + as.getJSONObject("__terminationDate").getStr("value");
break;
case 3: case 3:
String namepos = ""; String namepos = "";
PunchRecord pu = punchrecordmapper.organizationalStructure(Integer.valueOf(as.getJSONObject("__TransferInDepartment").getStr("value"))); PunchRecord pu = punchrecordmapper.organizationalStructure(Integer.valueOf(as.getJSONObject("__TransferInDepartment").getStr("value")));
if(pu != null) { if (pu != null) {
namepos = pu.getPost(); namepos = pu.getPost();
} }
requerstr = "调入岗位:"+namepos; requerstr = "调入岗位:" + namepos;
break;
case 5:
requerstr = "加班时长:" + as.getJSONObject("__timeLong").getStr("value") + "(小时)";
break; break;
case 5:requerstr = "加班时长:"+as.getJSONObject("__timeLong").getStr("value")+"(小时)";break;
case 6: case 6:
String name = ""; String name = "";
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectById(as.getJSONObject("__LeaveType").getStr("value")); KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectById(as.getJSONObject("__LeaveType").getStr("value"));
if(rul != null) { if (rul != null) {
name = rul.getName(); name = rul.getName();
} }
requerstr = "请假类型:"+name; requerstr = "请假类型:" + name;
break;
case 7:
requerstr = "出差时长:" + as.getJSONObject("__longTime").getStr("value") + "(小时)";
break;
case 8:
requerstr = "外出时长:" + as.getJSONObject("__longTime").getStr("value") + "(小时)";
break;
case 9:
requerstr = "补卡时间:" + as.getJSONObject("__PatchCardTime").getStr("value");
break; break;
case 7:requerstr = "出差时长:"+as.getJSONObject("__longTime").getStr("value")+"(小时)";break;
case 8:requerstr = "外出时长:"+as.getJSONObject("__longTime").getStr("value")+"(小时)";break;
case 9:requerstr = "补卡时间:"+as.getJSONObject("__PatchCardTime").getStr("value");break;
default: default:
break; break;
} }
...@@ -915,13 +985,17 @@ public class SpmkController { ...@@ -915,13 +985,17 @@ public class SpmkController {
e.printStackTrace(); e.printStackTrace();
} }
// Logoutput(requerstr); // Logoutput(requerstr);
sp.setDigest(requerstr); /*if(!StringUtils.isEmpty(sp.getDigest())){
requerstr = requerstr+" "+sp.getDigest();
}
sp.setDigest(requerstr);*/
} }
return ResultUtil.data(pageAs, listAs); return ResultUtil.data(pageAs, listAs);
} }
//TODO 撤销审批 //TODO 撤销审批
/** /**
* 撤销审批 * 撤销审批
*/ */
...@@ -948,7 +1022,7 @@ public class SpmkController { ...@@ -948,7 +1022,7 @@ public class SpmkController {
@ApiOperation(value = "23.删除-审批(发起的审批)-根据审批汇总id", httpMethod = "DELETE", notes = "删除-审批(发起的审批)-根据审批汇总id") @ApiOperation(value = "23.删除-审批(发起的审批)-根据审批汇总id", httpMethod = "DELETE", notes = "删除-审批(发起的审批)-根据审批汇总id")
@ApiOperationSupport(order = 23) @ApiOperationSupport(order = 23)
@Log(title = "审批-删除审批", businessType = BusinessType.DELETE) @Log(title = "审批-删除审批", businessType = BusinessType.DELETE)
public Result<Object> deleteApprovalData(@PathVariable Integer id){ public Result<Object> deleteApprovalData(@PathVariable Integer id) {
/* /*
List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectList(new QueryWrapper<SpmkApproveExecuteRecord>() List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectList(new QueryWrapper<SpmkApproveExecuteRecord>()
.lambda() .lambda()
...@@ -977,7 +1051,7 @@ public class SpmkController { ...@@ -977,7 +1051,7 @@ public class SpmkController {
@DeleteMapping(value = "/delete_approval_data") @DeleteMapping(value = "/delete_approval_data")
@ApiOperation(value = "90.(开发使用)删除-审批数据", httpMethod = "DELETE", notes = "审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据") @ApiOperation(value = "90.(开发使用)删除-审批数据", httpMethod = "DELETE", notes = "审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据")
@ApiOperationSupport(order = 90) @ApiOperationSupport(order = 90)
public Result<Object> deleteApprovalData(@CurrentUser UserBean userBean){ public Result<Object> deleteApprovalData(@CurrentUser UserBean userBean) {
spmkApprovalGMapper.delete(null); spmkApprovalGMapper.delete(null);
spmkCustomApprovalMapper.delete(null); spmkCustomApprovalMapper.delete(null);
spmkApproveSummaryMapper.delete(null); spmkApproveSummaryMapper.delete(null);
...@@ -992,24 +1066,24 @@ public class SpmkController { ...@@ -992,24 +1066,24 @@ public class SpmkController {
@GetMapping(value = "/icon") @GetMapping(value = "/icon")
@ApiOperation(value = "99.图标列表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "99.图标列表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 99) @ApiOperationSupport(order = 99)
public Result<List<SpmkIcon>> selectListIcon(@CurrentUser UserBean userBean){ public Result<List<SpmkIcon>> selectListIcon(@CurrentUser UserBean userBean) {
List<SpmkIcon> spmkIcons = SpmkIcon.builder().build().selectAll(); List<SpmkIcon> spmkIcons = SpmkIcon.builder().build().selectAll();
return ResultUtil.data(spmkIcons,"获取图标列表成功"); return ResultUtil.data(spmkIcons, "获取图标列表成功");
} }
//TODO 测试-生成 审批组 和 自定义审批 //TODO 测试-生成 审批组 和 自定义审批
@GetMapping(value = "/test") @GetMapping(value = "/test")
@ApiOperation(value = "98.测试-生成 审批组 和 自定义审批", httpMethod = "GET", notes = "测试-生成 审批组 和 自定义审批") @ApiOperation(value = "98.测试-生成 审批组 和 自定义审批", httpMethod = "GET", notes = "测试-生成 审批组 和 自定义审批")
@ApiOperationSupport(order = 98) @ApiOperationSupport(order = 98)
public Result<List<SpmkIcon>> createCustomApproval(@RequestParam Integer orgCode){ public Result<List<SpmkIcon>> createCustomApproval(@RequestParam Integer orgCode) {
spmkService.createCustomApproval(orgCode); spmkService.createCustomApproval(orgCode);
List<SpmkIcon> spmkIcons = SpmkIcon.builder().build().selectAll(); List<SpmkIcon> spmkIcons = SpmkIcon.builder().build().selectAll();
return ResultUtil.data(spmkIcons,"生成 审批组 和 自定义审批成功"); return ResultUtil.data(spmkIcons, "生成 审批组 和 自定义审批成功");
} }
@GetMapping(value = "/verification_staff") @GetMapping(value = "/verification_staff")
...@@ -1018,7 +1092,7 @@ public class SpmkController { ...@@ -1018,7 +1092,7 @@ public class SpmkController {
String msg = ""; String msg = "";
YgglMainEmp ygem = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()) YgglMainEmp ygem = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum())); .eq(YgglMainEmp::getEmpNum, userBean.getEmpNum()));
if(ygem.getJobStatus() == 1) { if (ygem.getJobStatus() == 1) {
msg = "正式员工不能发起转正审批"; msg = "正式员工不能发起转正审批";
} }
...@@ -1027,7 +1101,7 @@ public class SpmkController { ...@@ -1027,7 +1101,7 @@ public class SpmkController {
@PostMapping(value = "/approved_quantity") @PostMapping(value = "/approved_quantity")
@ApiOperation(value = "APP-我发起的/我审批的/抄送我的-数量", httpMethod = "POST", notes = "") @ApiOperation(value = "APP-我发起的/我审批的/抄送我的-数量", httpMethod = "POST", notes = "")
public Result<Object> ApprovedQuantity(@CurrentUser UserBean userBean, @Validated @RequestBody MySummaryQueryDto mysummaryquerydto){ public Result<Object> ApprovedQuantity(@CurrentUser UserBean userBean, @Validated @RequestBody MySummaryQueryDto mysummaryquerydto) {
ApprovedQuantityDto qna = ApprovedQuantityDto.builder().build(); ApprovedQuantityDto qna = ApprovedQuantityDto.builder().build();
...@@ -1038,22 +1112,22 @@ public class SpmkController { ...@@ -1038,22 +1112,22 @@ public class SpmkController {
mysummaryquerydto.setEmpNum(userBean.getEmpNum()); mysummaryquerydto.setEmpNum(userBean.getEmpNum());
mysummaryquerydto.setSts(5);//状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝 4:(2/3) 5:全部 mysummaryquerydto.setSts(5);//状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝 4:(2/3) 5:全部
int istartedit=0,ccme=0,iapprovedit=0; int istartedit = 0, ccme = 0, iapprovedit = 0;
mysummaryquerydto.setType(0);//我发起的 mysummaryquerydto.setType(0);//我发起的
List<SpmkApproveSummary> istartedit_ = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(mysummaryquerydto); List<SpmkApproveSummary> istartedit_ = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(mysummaryquerydto);
if(istartedit_.size() > 0) { if (istartedit_.size() > 0) {
istartedit = istartedit_.size(); istartedit = istartedit_.size();
} }
mysummaryquerydto.setType(1);//抄送我的 mysummaryquerydto.setType(1);//抄送我的
List<SpmkApproveSummary> ccme_ = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(mysummaryquerydto); List<SpmkApproveSummary> ccme_ = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(mysummaryquerydto);
if(ccme_.size() > 0) { if (ccme_.size() > 0) {
ccme = ccme_.size(); ccme = ccme_.size();
} }
mysummaryquerydto.setType(2);//我审批的 mysummaryquerydto.setType(2);//我审批的
List<SpmkApproveSummary> iapprovedit_ = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(mysummaryquerydto); List<SpmkApproveSummary> iapprovedit_ = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(mysummaryquerydto);
if(iapprovedit_.size() > 0) { if (iapprovedit_.size() > 0) {
iapprovedit = iapprovedit_.size(); iapprovedit = iapprovedit_.size();
} }
...@@ -1070,10 +1144,10 @@ public class SpmkController { ...@@ -1070,10 +1144,10 @@ public class SpmkController {
public void Logoutput(String science) { public void Logoutput(String science) {
if(!("pro").equals(environmental_science)) { if (!("pro").equals(environmental_science)) {
System.out.println(science); System.out.println(science);
}else { } else {
System.out.println(""); System.out.println("");
} }
...@@ -1084,7 +1158,626 @@ public class SpmkController { ...@@ -1084,7 +1158,626 @@ public class SpmkController {
*/ */
@PostMapping(value = "/approved_addDetail") @PostMapping(value = "/approved_addDetail")
@ApiOperation(value = "A审核详情数据转换", httpMethod = "POST", notes = "") @ApiOperation(value = "A审核详情数据转换", httpMethod = "POST", notes = "")
public String addApproveDetail(){ public String addApproveDetail() {
return spmkService.addApproveDetail(); return spmkService.addApproveDetail();
} }
/**
* 判断人员是否一致
*
* @param olist
* @param list
* @return
*/
private boolean isTrue(List<Router> olist, List<Router> list) {
if (olist.size() == 0 && list.size() == 0) {
return false;
} else if (olist.size() != list.size()) {
return true;
}
if (list.get(0).getClassName().equals("audit") && list.get(0).getName().equals("审批人")) {
if (list.get(0).getRelation().get(0).getType().equals("executive") && list.get(0).getRelation().get(0).getName().equals("主管")) {
return isTrue(olist.get(0).getChildren(), list.get(0).getChildren());
}
if (list.get(0).getRelation().get(0).getUsers().size() != olist.get(0).getRelation().get(0).getUsers().size()) {
return true;
} else {
return isTrue(olist.get(0).getChildren(), list.get(0).getChildren());
}
} else if (list.get(0).getClassName().equals("copy") && list.get(0).getName().equals("抄送人")) {
return false;
}
return false;
}
/**
* 更新审批流程通过节点
*
* @param userBean
* @param spmkApproveDetailDto
* @return
*/
@PostMapping(value = "/updateFlowChildren")
@ApiOperation(value = "更新审批流程通过节点", httpMethod = "POST", notes = "")
public Result<Object> updateFlowChildren(@CurrentUser UserBean userBean, @Validated @RequestBody SpmkApproveDetailDto spmkApproveDetailDto) {
try {
SpmkApproveDetailSummary spmkApproveDetailSummary = SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId()).build().selectById();
List<FlowChildren> listFlowChildren = spmkApproveDetailDto.getFlowChildren();
//只有添加审批人才会有值
if (spmkApproveDetailDto.getIndex() != null && spmkApproveDetailDto.getUserIndex() != null) {
//如果当前索引下的都要变更为0未执行
int currentIndex = spmkApproveDetailDto.getIndex();
for (int i = currentIndex + 1; i < listFlowChildren.size(); i++) {
if (i == currentIndex + 1) {
if (!listFlowChildren.get(currentIndex).getExecute().equals("1") && !listFlowChildren.get(currentIndex).getExecute().equals("0")) {
//如果当前索引下的都要变更为0未执行
FlowChildren flowChildren = listFlowChildren.get(spmkApproveDetailDto.getIndex());
User user = flowChildren.getRelation().get(0).getUsers().get(spmkApproveDetailDto.getUserIndex());
SpmkApproveExecuteRecord spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordById(Integer.parseInt(user.getId()), spmkApproveDetailSummary.getApproveSummaryId());
//删除审批过的人记录
if (spmkApproveExecuteRecord != null) {
spmkApproveExecuteRecordMapper.delExecuteRecord(spmkApproveExecuteRecord.getId(), spmkApproveDetailSummary.getApproveSummaryId());
}
listFlowChildren.get(i).setExecute("1");
listFlowChildren.get(i).getRelation().forEach(v -> {
v.getUsers().forEach(u -> {
u.setExecute("1");
//添加审批记录
SpmkApproveExecuteRecord spmkApproveExecuteRecord1 = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(spmkApproveDetailSummary.getApproveSummaryId())
.name(SpmkEnumInterface.ParticipatorType.APPROVER.getName())
.type(SpmkEnumInterface.ParticipatorType.APPROVER.ordinal())
.sts(SpmkEnumInterface.ExecuteRecordSts.IN_EXECUTION.ordinal())
.build();
spmkApproveExecuteRecord1.insert();
SpmkExecutor.builder()
.approveExecuteRecordId(spmkApproveExecuteRecord1.getId())
.empNum(Integer.parseInt(u.getId()))
.operatorHeaderUrl(u.getHeadUrl())
.executorName(u.getName())
.sts(1)
.build().insert();
SpmkApproveSummary.builder().currentApprover(u.getName()).id(spmkApproveDetailSummary.getApproveSummaryId()).build().updateById();
});
});
continue;
}
}
listFlowChildren.get(i).setExecute("0");
listFlowChildren.get(i).getRelation().forEach(v -> {
v.getUsers().forEach(u -> u.setExecute("0"));
});
}
SpmkApproveSummary.builder().sts(0).id(spmkApproveDetailSummary.getApproveSummaryId()).build().updateById();
}
// 更新 flowChildren
SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId())
.flowChildren(JSONArray.fromObject(listFlowChildren).toString()).build().updateById();
} catch (Exception e) {
return ResultUtil.error(e);
}
SpmkApproveDetailSummary detailSummary = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
.lambda().eq(SpmkApproveDetailSummary::getId, spmkApproveDetailDto.getId()));
return ResultUtil.data(JSON.toJSONString(detailSummary));
}
//移除审批人 1.0
// @Transactional(rollbackFor = Exception.class)
// @PostMapping(value = "/delteApprove")
// @ApiOperation(value = "移除审批人", httpMethod = "POST", notes = "")
// public Result<Object> delteApprove(@CurrentUser UserBean userBean, @Validated @RequestBody SpmkApproveDetailDto spmkApproveDetailDto) {
//// try {
//
// SpmkApproveDetailSummary spmkApproveDetailSummary = SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId()).build().selectById();
// List<FlowChildren> listFlowChildren = spmkApproveDetailDto.getFlowChildren();
// //是否执行到下一个节点
// boolean onlyOne = false;//是否只有一条
// boolean isExecute = false;//是否执行中
// boolean isAbreas = false;//是否并序
// boolean isFinal = false;//是否最终审批人
// boolean isNext = false;//是否轮到下一个节点
// User u;
// //当前节点
// FlowChildren currentChildren = listFlowChildren.get(spmkApproveDetailDto.getIndex());
// List<User> userList = currentChildren.getRelation().get(0).getUsers();
// User currentUser = userList.get(spmkApproveDetailDto.getUserIndex());
// //只有添加审批人才会有值
// if (spmkApproveDetailDto.getIndex() != null && spmkApproveDetailDto.getUserIndex() != null) {
// if (currentChildren.getClassName().equals("audit")) {
// //如果是并序
// if ("1".equals(currentChildren.getRelation().get(0).getApprovalOrder())) {
// isAbreas = true;
// }
// //如果只有一个人
// if (userList.size() == 1) {
// onlyOne = true;
// isNext=true;
// }
// if (currentChildren.getExecute().equals("1")) {
// isExecute = true;
// if (userList.get(spmkApproveDetailDto.getUserIndex()).getExecute().equals("1")) {
// //如果是最后一个
// if (userList.size() - 1 == spmkApproveDetailDto.getUserIndex() && !isAbreas) {
// isNext = true;
// }
// //出了自己其他人都审批过了
// if (isAbreas) {
// int num = currentChildren.getRelation().get(0).getUsers().stream().filter(v -> v.getExecute().equals("1") && v.getId() != currentUser.getId()).collect(Collectors.toList()).size();
// if (num == 0) {
// isNext = true;
// }
// }
// } else {
// isExecute = false;
// }
// }
// //是否最终审批人
// if (spmkApproveDetailDto.getIndex() == listFlowChildren.size() - 1) {
// if (isNext || onlyOne) {
// isFinal = true;
// }
// } else if (!listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getClassName().equals("audit")) {
// isFinal = true;
// }
//
// SpmkApproveExecuteRecord spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordById(Integer.parseInt(currentUser.getId()), spmkApproveDetailSummary.getApproveSummaryId());
// //删除审批过的人记录
// if (spmkApproveExecuteRecord != null) {
// if (onlyOne) {
// spmkApproveExecuteRecordMapper.delExecuteRecordByRecordIds(spmkApproveExecuteRecord.getId(), Integer.parseInt(currentUser.getId()));
// } else {
// List<SpmkExecutor> spmkExecutorsList=SpmkExecutor.builder().build().selectList(new LambdaQueryWrapper<SpmkExecutor>()
// .eq(SpmkExecutor::getApproveExecuteRecordId,spmkApproveExecuteRecord.getId()));
// if(spmkExecutorsList.size()>0&&spmkExecutorsList.size()==1){
// spmkApproveExecuteRecordMapper.delExecuteRecordByRecordIds(spmkApproveExecuteRecord.getId(), Integer.parseInt(currentUser.getId()));
// }else{
// spmkExecutorsList.stream().filter(v->v.getEmpNum()==Integer.parseInt(currentUser.getId())).collect(Collectors.toList()).get(0).deleteById();
// }
// }
// }
// if (isExecute && !isFinal) {
// if (!isAbreas) {
// if (isNext) {
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).setExecute("1");
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().get(0).setExecute("1");
// //并序
// u = listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().get(0);
// } else {
// listFlowChildren.get(spmkApproveDetailDto.getIndex()).setExecute("1");
// listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().get(spmkApproveDetailDto.getUserIndex() + 1).setExecute("1");
// u = listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().get(spmkApproveDetailDto.getUserIndex() + 1);
// }
//
// if (onlyOne || isNext) {
// spmkApproveExecuteRecord = SpmkApproveExecuteRecord
// .builder()
// .approveSummaryId(spmkApproveDetailSummary.getApproveSummaryId())
// .name(SpmkEnumInterface.ParticipatorType.APPROVER.getName())
// .type(SpmkEnumInterface.ParticipatorType.APPROVER.ordinal())
// .sts(SpmkEnumInterface.ExecuteRecordSts.IN_EXECUTION.ordinal())
// .build();
// spmkApproveExecuteRecord.insert();
// }
// SpmkExecutor.builder()
// .approveExecuteRecordId(spmkApproveExecuteRecord.getId())
// .empNum(Integer.parseInt(u.getId()))
// .operatorHeaderUrl(u.getHeadUrl())
// .executorName(u.getName())
// .sts(1)
// .build().insert();
// SpmkApproveSummary.builder().currentApprover(u.getName()).id(spmkApproveDetailSummary.getApproveSummaryId()).build().updateById();
// } else {
// //并序
// if (isNext) {
// FlowChildren nextFlowChildren = listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1);
// if (nextFlowChildren.getRelation().get(0).getApprovalOrder().equals("1")) {
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).setExecute("1");
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().forEach(v -> {
// v.setExecute("1");
// SpmkApproveExecuteRecord spmkApproveExecuteRecord1 = SpmkApproveExecuteRecord
// .builder()
// .approveSummaryId(spmkApproveDetailSummary.getApproveSummaryId())
// .name(SpmkEnumInterface.ParticipatorType.APPROVER.getName())
// .type(SpmkEnumInterface.ParticipatorType.APPROVER.ordinal())
// .sts(SpmkEnumInterface.ExecuteRecordSts.IN_EXECUTION.ordinal())
// .build();
// spmkApproveExecuteRecord1.insert();
// SpmkExecutor.builder()
// .approveExecuteRecordId(spmkApproveExecuteRecord1.getId())
// .empNum(Integer.parseInt(v.getId()))
// .operatorHeaderUrl(v.getHeadUrl())
// .executorName(v.getName())
// .sts(1)
// .build().insert();
// });
// SpmkApproveSummary.builder().currentApprover(nextFlowChildren.getRelation().get(0).getUsers().get(0).getName()).id(spmkApproveDetailSummary.getApproveSummaryId()).build().updateById();
// }
// }
// }
// }
//
//
// if (isExecute && isFinal) {
// SpmkApproveSummary.builder().id(spmkApproveDetailSummary.getApproveSummaryId()).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
// }
//
// if (onlyOne) {
// listFlowChildren.removeIf(f -> f == currentChildren);
// } else {
// listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().removeIf(user -> user == currentUser);
// }
// }
// }
// // 更新 flowChildren
// SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId())
// .flowChildren(JSONArray.fromObject(listFlowChildren).toString()).build().updateById();
//// } catch (Exception e) {
//// return ResultUtil.error(e);
//// }
//
// SpmkApproveDetailSummary detailSummary = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
// .lambda().eq(SpmkApproveDetailSummary::getId, spmkApproveDetailDto.getId()));
//
// return ResultUtil.data(JSON.toJSONString(detailSummary));
// }
@Transactional(rollbackFor = Exception.class)
@PostMapping(value = "/delteApprove")
@ApiOperation(value = "移除审批人", httpMethod = "POST", notes = "")
public Result<Object> delteApprove(@CurrentUser UserBean userBean, @Validated @RequestBody SpmkApproveDetailDto spmkApproveDetailDto) {
SpmkApproveDetailSummary spmkApproveDetailSummary = SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId()).build().selectById();
List<FlowChildren> listFlowChildren = spmkApproveDetailDto.getFlowChildren();
FlowChildren currentFlowChildren = listFlowChildren.get(spmkApproveDetailDto.getIndex());
List<User> currentUserList = currentFlowChildren.getRelation().get(0).getUsers();
User currentUser = currentUserList.get(spmkApproveDetailDto.getUserIndex());
//是否执行到下一个节点
boolean onlyOne = false;//是否只有一条
boolean isExecute = false;//是否执行中
boolean isAbreas = false;//是否并序
boolean isFinal = false;//是否最终审批人
boolean isNext = false;//是否轮到下一个节点
StringBuffer buffer = new StringBuffer();//新当前审批人的名字
if ("1".equals(currentFlowChildren.getRelation().get(0).getApprovalOrder())) {
isAbreas = true;
}
//如果只有一个人
if (currentUserList.size() == 1) {
onlyOne = true;
isNext = true;
}
//大节点在执行中
if (currentFlowChildren.getExecute().equals("1")) {
//小节点也在执行中
isExecute = true;
if (currentUser.getExecute().equals("1")) {
if (isAbreas) {
if (currentUserList.stream().filter(u -> u.getId() != currentUser.getId() && u.getExecute().equals("1")).collect(Collectors.toList()).size() == 0) {
isNext = true;
}
} else {
if (currentUserList.size() - 1 == spmkApproveDetailDto.getUserIndex()) {
isNext = true;
}
}
} else {
isExecute = false;
}
}
//如果属于最后一个大节点
if (listFlowChildren.size() - 1 == spmkApproveDetailDto.getIndex()) {
if (isNext) {
isFinal = true;
} else {
isFinal = false;
}
} else if (listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getClassName().equals("copy")) {
isFinal = true;
}
//执行中的人会存在操作记录
SpmkApproveExecuteRecord spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordById(Integer.parseInt(currentUser.getId()), spmkApproveDetailSummary.getApproveSummaryId());
//删除操作人记录
if (spmkApproveExecuteRecord != null) {
SpmkExecutor spmkExecutor =SpmkExecutor.builder().build().selectOne(new LambdaQueryWrapper<SpmkExecutor>()
.eq(SpmkExecutor::getApproveExecuteRecordId,spmkApproveExecuteRecord.getId()).eq(SpmkExecutor::getEmpNum,currentUser.getId()));
if (onlyOne) {
if(spmkExecutor.getSts()!=4) {
spmkApproveExecuteRecordMapper.delExecuteRecordByRecordIds(spmkApproveExecuteRecord.getId(), Integer.parseInt(currentUser.getId()));
}
} else {
List<SpmkExecutor> spmkExecutorsList = SpmkExecutor.builder().build().selectList(new LambdaQueryWrapper<SpmkExecutor>()
.eq(SpmkExecutor::getApproveExecuteRecordId, spmkApproveExecuteRecord.getId()));
if (isAbreas) {
//正常的并序是一条对应一个id,转派的是同一个id
if (spmkExecutorsList.size() == 1) {
spmkApproveExecuteRecordMapper.delExecuteRecordByRecordIds(spmkApproveExecuteRecord.getId(), Integer.parseInt(currentUser.getId()));
}
}
spmkExecutor.deleteById();
}
}
//当前被移除的人在执行中
if (isExecute) {
//如果不是最终的就还存在下一个审批节点
if (!isFinal) {
if (isNext) {
FlowChildren nextFlowChildren = listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1);
//如果下一个节点是并序的
if (nextFlowChildren.getRelation().get(0).getApprovalOrder().equals("1")) {
listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).setExecute("1");
listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().forEach(v -> {
v.setExecute("1");
SpmkApproveExecuteRecord spmkApproveExecuteRecord1 = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(spmkApproveDetailSummary.getApproveSummaryId())
.name(SpmkEnumInterface.ParticipatorType.APPROVER.getName())
.type(SpmkEnumInterface.ParticipatorType.APPROVER.ordinal())
.sts(SpmkEnumInterface.ExecuteRecordSts.IN_EXECUTION.ordinal())
.build();
spmkApproveExecuteRecord1.insert();
SpmkExecutor.builder()
.approveExecuteRecordId(spmkApproveExecuteRecord1.getId())
.empNum(Integer.parseInt(v.getId()))
.operatorHeaderUrl(v.getHeadUrl())
.executorName(v.getName())
.sts(1)
.build().insert();
buffer.append(v.getName() + ",");
});
buffer.deleteCharAt(buffer.lastIndexOf(","));
} else {
listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).setExecute("1");
listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().get(0).setExecute("1");
User u = listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().get(0);
SpmkApproveExecuteRecord spmkApproveExecuteRecord1 = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(spmkApproveDetailSummary.getApproveSummaryId())
.name(SpmkEnumInterface.ParticipatorType.APPROVER.getName())
.type(SpmkEnumInterface.ParticipatorType.APPROVER.ordinal())
.sts(SpmkEnumInterface.ExecuteRecordSts.IN_EXECUTION.ordinal())
.build();
spmkApproveExecuteRecord1.insert();
SpmkExecutor.builder()
.approveExecuteRecordId(spmkApproveExecuteRecord1.getId())
.empNum(Integer.parseInt(u.getId()))
.operatorHeaderUrl(u.getHeadUrl())
.executorName(u.getName())
.sts(1)
.build().insert();
buffer.append(u.getName());
}
} else {
if (!isAbreas) {
//顺序有一个同一个user里面的
listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().get(spmkApproveDetailDto.getUserIndex() + 1).setExecute("1");
User u = listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().get(spmkApproveDetailDto.getUserIndex() + 1);
SpmkExecutor.builder()
.approveExecuteRecordId(spmkApproveExecuteRecord.getId())
.empNum(Integer.parseInt(u.getId()))
.operatorHeaderUrl(u.getHeadUrl())
.executorName(u.getName())
.sts(1)
.build().insert();
buffer.append(u.getName());
}
}
}
SpmkApproveSummary.builder().currentApprover(buffer.toString()).id(spmkApproveDetailSummary.getApproveSummaryId()).build().updateById();
}
//只有一条数据或者已经到下一个大节点
if (onlyOne && isNext) {
listFlowChildren.removeIf(f -> f == currentFlowChildren);
} else {
listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().removeIf(u -> u == currentUser);
}
//如果是最终执行人
if (isFinal&&isNext&&isExecute) {
SpmkApproveSummary.builder().id(spmkApproveDetailSummary.getApproveSummaryId()).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
}
SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId())
.flowChildren(JSONArray.fromObject(listFlowChildren).toString()).build().updateById();
SpmkApproveDetailSummary detailSummary = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
.lambda().eq(SpmkApproveDetailSummary::getId, spmkApproveDetailDto.getId()));
return ResultUtil.data(JSON.toJSONString(detailSummary));
}
@PostMapping(value = "/save_drafts")
@ApiOperation(value = "存入草稿箱", httpMethod = "POST", notes = "存入草稿箱")
@Transactional(rollbackFor = Exception.class)
@Log(title = "审批-存入草稿箱", businessType = BusinessType.INSERT)
public Result<Object> saveDrafts(@CurrentUser UserBean userBean, @Validated @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception {
try {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda()
.select(YgglMainEmp::getHeadUrl, YgglMainEmp::getName)
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
);
if (ygglMainEmp == null)
return ResultUtil.error("发起人不存在!");
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
Router router = spmkApproveSummaryDto.getRouter();
// routers = RouterUtils.clearRouters(routers);
/*TODO 验证是否拥有添加审核人的权限 只用于华颐*/
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if (ent != null) {
/*超管和管理员不受权限控制*/
if (ent.getUserType() == 2) {
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId, userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId, "/Approvalspbutonspbuton020101"));
/*如果没有该权限*/
if (zzglAuth == null) {
SpmkCustomApproval ca = SpmkCustomApproval.builder().build().selectOne(new QueryWrapper<SpmkCustomApproval>().lambda()
.eq(SpmkCustomApproval::getName, spmkApproveSummaryDto.getApproveName()).eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode()));
Router oldRouter = ObjectUtil.deserialize(ca.getRouter());
if (isTrue(router.getChildren(), oldRouter.getChildren())) {
return ResultUtil.error("您没有新增审批人的权限");
}
}
}
}
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(router);
JSONObject jSONObject = spmkApproveSummaryDto.getRequestData()
.set("orgCode", userBean.getOrgCode())
.set("initiator", ygglMainEmp.getName())
.set("headUrl", ygglMainEmp.getHeadUrl())
.set("id", userBean.getEmpNum());
RouterUtils.NextNode(listRouter, jSONObject, ISFIRST, true);
List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>();
RouterUtils.getIsFlowChildren(listRouter, listFlowChildren);
String currentApprover = jSONObject.getStr("current_approver");
SpmkApproveDrafts as = SpmkApproveDrafts
.builder()
.orgCode(userBean.getOrgCode())
.empNum(userBean.getEmpNum())
.title(spmkApproveSummaryDto.getTitle())
.initiator(spmkApproveSummaryDto.getInitiator())
.approveName(spmkApproveSummaryDto.getApproveName())
.assoType(spmkApproveSummaryDto.getAssoType())
.sts(ApproveSummarySts.IN.ordinal())
.digest(spmkApproveSummaryDto.getDigest())
.updateTime(new Date())
.currentApprover(currentApprover).isUrgent(spmkApproveSummaryDto.getIsUrgent())
.build();
if (spmkApproveSummaryDto.getId() != null) {
as.setId(spmkApproveSummaryDto.getId());
}
if (!as.insertOrUpdate()) {
throw new CustomException("审批草稿汇总-新增异常");
}
// 草稿不插入执审批流程
// RouterUtils.insertogExecuteRecord(listFlowChildren, as.getId());
// 封装 审批详情
SpmkApproveDetailDrafts adm = SpmkApproveDetailDrafts.builder().build();
adm.setApproveSummaryId(as.getId());
adm.setName(spmkApproveSummaryDto.getTitle());
adm.setRequestData(spmkApproveSummaryDto.getRequestData().toString());
adm.setFroms(spmkApproveSummaryDto.getFroms().toString());
adm.setRouter(listRouter.get(0).toJSONString());
adm.setFlowChildren(JSONArray.fromObject(listFlowChildren).toString());
if (spmkApproveSummaryDto.getId() != null) {
SpmkApproveDetailDrafts sp = SpmkApproveDetailDrafts.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailDrafts>().lambda().eq(SpmkApproveDetailDrafts::getApproveSummaryId, spmkApproveSummaryDto.getId()));
adm.setId(sp.getId());
spmkApproveDetailDraftsMapper.updateById(adm);
} else {
spmkApproveDetailDraftsMapper.insert(adm);
}
return ResultUtil.data(as.getId());
} catch (Exception e) {
// throw new CustomException("审批草稿详情-新增异常");
e.printStackTrace();
}
return ResultUtil.error("审批草稿详情-新增异常");
}
;
@PostMapping(value = "/my_drafts")
@ApiOperation(value = "我的草稿箱", httpMethod = "POST", notes = "我的草稿箱")
@Log(title = "审批-我的草稿箱", businessType = BusinessType.OTHER)
public Result<Object> myDrafts(@CurrentUser UserBean userBean, @Validated @RequestBody MySummaryQueryDto mySummaryQueryDto) {
IPage<SpmkApproveDrafts> page = new Page<SpmkApproveDrafts>(
mySummaryQueryDto.getCurrentPage() == null ? 1 : mySummaryQueryDto.getCurrentPage(),
mySummaryQueryDto.getTotalPage() == null ? 10 : mySummaryQueryDto.getTotalPage());
mySummaryQueryDto.setOrgCode(userBean.getOrgCode());
mySummaryQueryDto.setEmpNum(userBean.getEmpNum());
if (mySummaryQueryDto.getSts() == null) {
mySummaryQueryDto.setSts(0);
}
IPage<SpmkApproveDrafts> pageAs = spmkApproveDraftsMapper.selectPageByQueryForEmpNum(page, mySummaryQueryDto);
List<SpmkApproveDrafts> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs);
}
@PostMapping(value = "/del_drafts")
@ApiOperation(value = "删除草稿", httpMethod = "POST", notes = "删除草稿")
@Log(title = "审批-删除草稿", businessType = BusinessType.OTHER)
public Result<Object> myDrafts(@CurrentUser UserBean userBean, @RequestBody SpmkApproveDrafts spmkApproveDrafts) {
SpmkApproveDrafts drafts = SpmkApproveDrafts.builder().id(spmkApproveDrafts.getId()).build().selectById();
SpmkApproveDetailDrafts.builder().build().delete(new QueryWrapper<SpmkApproveDetailDrafts>().lambda().eq(SpmkApproveDetailDrafts::getApproveSummaryId, drafts.getId()));
drafts.deleteById();
return ResultUtil.data("删除成功");
}
@PostMapping(value = "/add_files")
@ApiOperation(value = "添加附件", httpMethod = "POST", notes = "添加附件")
@Log(title = "审批-添加附件", businessType = BusinessType.OTHER)
public Result<Object> addFiles(@CurrentUser UserBean userBean, @RequestBody ApprovingDto approvingDto) {
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if (ent != null) {
if (ent.getUserType() == 2) {
return ResultUtil.error("暂无权限");
}
}
SpmkApproveDetailSummary ad = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
.lambda()
.select(SpmkApproveDetailSummary::getId,
SpmkApproveDetailSummary::getRequestData,
SpmkApproveDetailSummary::getFroms,
SpmkApproveDetailSummary::getFlowChildren)
.eq(SpmkApproveDetailSummary::getId, approvingDto.getAsId()));
// 审批详情 审批时添加 附件
try {
if (RequestDataUtils.addFileList(ad, approvingDto.getFileList())) {
ad.updateById();
}
} catch (Exception e) {
e.printStackTrace();
}
return ResultUtil.data("添加附件成功");
}
@PostMapping(value = "/del_file")
@ApiOperation(value = "添加附件", httpMethod = "POST", notes = "添加附件")
@Log(title = "审批-添加附件", businessType = BusinessType.OTHER)
public Result<Object> delFileList(@CurrentUser UserBean userBean, @RequestBody ApprovingDto approvingDto) {
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if (ent != null) {
if (ent.getUserType() == 2) {
return ResultUtil.error("暂无权限");
}
}
SpmkApproveDetailSummary ad = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
.lambda()
.select(SpmkApproveDetailSummary::getId,
SpmkApproveDetailSummary::getRequestData,
SpmkApproveDetailSummary::getFroms,
SpmkApproveDetailSummary::getFlowChildren)
.eq(SpmkApproveDetailSummary::getId, approvingDto.getAsId()));
// 审批详情 审批时添加 附件
try {
if (RequestDataUtils.delFileList(ad, approvingDto.getFileList())) {
ad.updateById();
}
} catch (Exception e) {
e.printStackTrace();
}
return ResultUtil.data("删除附件成功");
}
} }
...@@ -10,10 +10,12 @@ public interface SpmkService { ...@@ -10,10 +10,12 @@ public interface SpmkService {
boolean createCustomApproval(Integer orgCode); boolean createCustomApproval(Integer orgCode);
SpmkApproveDetailDto selectApproveDetailByAsId(Integer asId); SpmkApproveDetailDto selectApproveDetailByAsId(Integer asId,Integer empNum);
List<SpmkApprovalG> selectListAg(UserBean userBean); List<SpmkApprovalG> selectListAg(UserBean userBean);
String addApproveDetail(); String addApproveDetail();
SpmkApproveDetailDto selectDraftsDetailByAsId(Integer asId);
} }
...@@ -12,6 +12,7 @@ import cn.timer.api.dao.spmk.*; ...@@ -12,6 +12,7 @@ import cn.timer.api.dao.spmk.*;
import cn.timer.api.dto.spmk.FlowChildren; import cn.timer.api.dto.spmk.FlowChildren;
import cn.timer.api.dto.spmk.Router; import cn.timer.api.dto.spmk.Router;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -43,6 +44,12 @@ public class SpmkServiceImpl implements SpmkService{ ...@@ -43,6 +44,12 @@ public class SpmkServiceImpl implements SpmkService{
@Autowired @Autowired
private SpmkApproveDetailSummaryMapper spmkApproveDetailSummaryMapper; private SpmkApproveDetailSummaryMapper spmkApproveDetailSummaryMapper;
@Autowired
private SpmkApproveDetailDraftsMapper spmkApproveDetailDraftsMapper;
@Autowired
private SpmkApproveDraftsMapper spmkApproveDraftsMapper;
private static com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); private static com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
/** /**
...@@ -87,9 +94,12 @@ public class SpmkServiceImpl implements SpmkService{ ...@@ -87,9 +94,12 @@ public class SpmkServiceImpl implements SpmkService{
/** /**
* 根据审批汇总id 获取 审批详情 * 根据审批汇总id 获取 审批详情
* @param asId
* @param empNum
* @return
*/ */
@Override @Override
public SpmkApproveDetailDto selectApproveDetailByAsId(Integer asId) { public SpmkApproveDetailDto selectApproveDetailByAsId(Integer asId,Integer empNum) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, asId)); //SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, asId));
//审批详情 //审批详情
...@@ -97,7 +107,7 @@ public class SpmkServiceImpl implements SpmkService{ ...@@ -97,7 +107,7 @@ public class SpmkServiceImpl implements SpmkService{
//审批汇总 //审批汇总
SpmkApproveSummary sum = null; SpmkApproveSummary sum = null;
if(ad != null) { if(ad != null) {
sum = SpmkApproveSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveSummary>().lambda().select(SpmkApproveSummary::getId,SpmkApproveSummary::getEmpNum,SpmkApproveSummary::getSts,SpmkApproveSummary::getCreateTime) sum = SpmkApproveSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveSummary>().lambda().select(SpmkApproveSummary::getId,SpmkApproveSummary::getEmpNum,SpmkApproveSummary::getSts,SpmkApproveSummary::getCreateTime,SpmkApproveSummary::getDigest)
.eq(SpmkApproveSummary::getId, ad.getApproveSummaryId())); .eq(SpmkApproveSummary::getId, ad.getApproveSummaryId()));
} }
...@@ -121,10 +131,72 @@ public class SpmkServiceImpl implements SpmkService{ ...@@ -121,10 +131,72 @@ public class SpmkServiceImpl implements SpmkService{
adD.setFlowChildren(jsonObject.parseArray(ad.getFlowChildren(), FlowChildren.class)); adD.setFlowChildren(jsonObject.parseArray(ad.getFlowChildren(), FlowChildren.class));
} }
adD.setApproveExecuteRecord(listAer); adD.setApproveExecuteRecord(listAer);
/*** 标记 执行人 阅读 ***/
if(!CollectionUtils.isEmpty(listAer)){
this.updateSpmkExecutorReadStatus(listAer,empNum);
}
/*** 标记执行人阅读 结束***/
if(sum != null) {
adD.setEmpNum(sum.getEmpNum());
adD.setSts(sum.getSts());
adD.setLaunchTime(sum.getCreateTime());
adD.setDigest(sum.getDigest());
SpmkExecutor exe= null;
SpmkApproveExecuteRecord exere = SpmkApproveExecuteRecord.builder().build()
.selectOne(new QueryWrapper<SpmkApproveExecuteRecord>().lambda().select(SpmkApproveExecuteRecord::getId).eq(SpmkApproveExecuteRecord::getApproveSummaryId , sum.getId())
.eq(SpmkApproveExecuteRecord::getSts, 1));
if(exere != null) {
exe = SpmkExecutor.builder().build().selectOne(new QueryWrapper<SpmkExecutor>().lambda().eq(SpmkExecutor::getApproveExecuteRecordId, exere.getId()).orderByDesc(SpmkExecutor::getId));
}
if(exe != null) {
adD.setExecuteEmpNum(exe.getEmpNum());
adD.setExecuteSts(exe.getSts());
adD.setExeid(exe.getId());
adD.setExereid(exere.getId());
}
}
return adD;
}
//草稿箱用
public SpmkApproveDetailDto selectDraftsDetailByAsId(Integer asId) {
// TODO Auto-generated method stub
//SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, asId));
SpmkApproveDetailDrafts ad = spmkApproveDetailDraftsMapper.selectOne(new QueryWrapper<SpmkApproveDetailDrafts>().lambda().eq(SpmkApproveDetailDrafts::getApproveSummaryId, asId));
SpmkApproveDrafts sum = null;
if(ad != null) {
sum = SpmkApproveDrafts.builder().build().selectOne(new QueryWrapper<SpmkApproveDrafts>().lambda().select(SpmkApproveDrafts::getId,SpmkApproveDrafts::getEmpNum,SpmkApproveDrafts::getSts,SpmkApproveDrafts::getCreateTime,SpmkApproveDrafts::getDigest)
.eq(SpmkApproveDrafts::getId, ad.getApproveSummaryId()));
}
SpmkApproveDetailDto adD = SpmkApproveDetailDto.builder().build();
if (ad == null) {
return null;
}
//审批操作记录
// List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectListByAsId(asId);
BeanUtil.copyProperties(ad, adD, "requestData","froms","router","flowChildren","spmkApproveExecuteRecord");
if(ad.getRequestData() !=null) {
adD.setRequestData(jsonObject.parseObject(ad.getRequestData(), JSONObject.class));
}
if(ad.getFroms()!=null) {
adD.setFroms(jsonObject.parseArray(ad.getFroms(), JSONObject.class));
}
if(ad.getFlowChildren() !=null) {
adD.setRouter(jsonObject.parseObject(ad.getRouter(), Router.class));
}
if(ad.getFlowChildren()!=null) {
adD.setFlowChildren(jsonObject.parseArray(ad.getFlowChildren(), FlowChildren.class));
}
// adD.setApproveExecuteRecord(listAer);
if(sum != null) { if(sum != null) {
adD.setEmpNum(sum.getEmpNum()); adD.setEmpNum(sum.getEmpNum());
adD.setSts(sum.getSts()); adD.setSts(sum.getSts());
adD.setLaunchTime(sum.getCreateTime()); adD.setLaunchTime(sum.getCreateTime());
adD.setDigest(sum.getDigest());
SpmkExecutor exe= null; SpmkExecutor exe= null;
SpmkApproveExecuteRecord exere = SpmkApproveExecuteRecord.builder().build() SpmkApproveExecuteRecord exere = SpmkApproveExecuteRecord.builder().build()
...@@ -207,4 +279,21 @@ public class SpmkServiceImpl implements SpmkService{ ...@@ -207,4 +279,21 @@ public class SpmkServiceImpl implements SpmkService{
return "成功"; return "成功";
} }
/**
* 标记 执行人 阅读
* @param listAer
* @param empNum
*/
private void updateSpmkExecutorReadStatus(List<SpmkApproveExecuteRecord> listAer, Integer empNum){
for (SpmkApproveExecuteRecord entity:listAer ) {
if(!CollectionUtils.isEmpty(entity.getSpmkExecutors())){
for (SpmkExecutor se:entity.getSpmkExecutors()) {
if(empNum.equals(se.getEmpNum()) && 0 == se.getReadStatus()){
SpmkExecutor.builder().id(se.getId()).readStatus(1).build().updateById();
}
}
}
}
}
} }
...@@ -2,6 +2,7 @@ package cn.timer.api.dao.kqmk; ...@@ -2,6 +2,7 @@ package cn.timer.api.dao.kqmk;
import java.util.List; import java.util.List;
import cn.timer.api.dto.kqmk.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -9,10 +10,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,10 +10,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance; import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.dto.kqmk.AdditionalDto;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto;
import cn.timer.api.dto.kqmk.JiaqibalanceDto;
/** /**
* 员工假期余额 * 员工假期余额
...@@ -35,4 +32,6 @@ public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBala ...@@ -35,4 +32,6 @@ public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBala
List<AdditionalDto> RealTimeUpdate(int orgcode,int kqzid); List<AdditionalDto> RealTimeUpdate(int orgcode,int kqzid);
List<AdditionalDto> selectAdditionalByempnum(int orgcode,int empnum); List<AdditionalDto> selectAdditionalByempnum(int orgcode,int empnum);
List<ExportEmployeeLeaveBalanceDto> selectLeaveBalance(@Param("param") AttqueryCriteriaDto attquerycriteriadto);
} }
...@@ -3,7 +3,6 @@ package cn.timer.api.dao.qyxx; ...@@ -3,7 +3,6 @@ package cn.timer.api.dao.qyxx;
import com.github.yulichang.base.MPJBaseMapper; import com.github.yulichang.base.MPJBaseMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import cn.timer.api.bean.qyxx.CmsContent; import cn.timer.api.bean.qyxx.CmsContent;
/** /**
......
package cn.timer.api.dao.qyxx; package cn.timer.api.dao.qyxx;
import cn.timer.api.bean.qyxx.CmsContent;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -8,6 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -8,6 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.qyxx.CmsIsRead; import cn.timer.api.bean.qyxx.CmsIsRead;
import cn.timer.api.dto.qyxx.QyxxIsReadDto; import cn.timer.api.dto.qyxx.QyxxIsReadDto;
import java.util.List;
/** /**
* OA消息内容表 * OA消息内容表
* *
...@@ -24,5 +27,6 @@ public interface CmsIsReadMapper extends BaseMapper<CmsIsRead> { ...@@ -24,5 +27,6 @@ public interface CmsIsReadMapper extends BaseMapper<CmsIsRead> {
* @return * @return
*/ */
QyxxIsReadDto queryIsReadEmp(@Param(value = "orgCode") Integer orgCode, @Param(value = "mid") Integer mid); QyxxIsReadDto queryIsReadEmp(@Param(value = "orgCode") Integer orgCode, @Param(value = "mid") Integer mid);
List<CmsContent> getUnreadList(@Param(value="userId")Integer userId);
} }
package cn.timer.api.dao.spmk;
import cn.timer.api.bean.spmk.SpmkApproveDetailDrafts;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 审批草稿详情
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Repository
public interface SpmkApproveDetailDraftsMapper extends BaseMapper<SpmkApproveDetailDrafts> {
}
package cn.timer.api.dao.spmk;
import cn.timer.api.bean.spmk.SpmkApproveDrafts;
import cn.timer.api.dto.spmk.MySummaryQueryDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* 审批草稿箱
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Repository
public interface SpmkApproveDraftsMapper extends BaseMapper<SpmkApproveDrafts> {
IPage<SpmkApproveDrafts> selectPageByQueryForEmpNum(IPage<SpmkApproveDrafts> page, @Param("param") MySummaryQueryDto mySummaryQueryDto);
}
package cn.timer.api.dao.spmk;
import cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 审批执行记录 发起人、抄送人、审批人操作记录--草稿
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-19 14:53:36
*/
public interface SpmkApproveExecuteRecordDraftsMapper extends BaseMapper<SpmkApproveExecuteRecordDrafts> {
}
...@@ -2,6 +2,7 @@ package cn.timer.api.dao.spmk; ...@@ -2,6 +2,7 @@ package cn.timer.api.dao.spmk;
import java.util.List; import java.util.List;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -18,5 +19,9 @@ import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord; ...@@ -18,5 +19,9 @@ import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
public interface SpmkApproveExecuteRecordMapper extends BaseMapper<SpmkApproveExecuteRecord> { public interface SpmkApproveExecuteRecordMapper extends BaseMapper<SpmkApproveExecuteRecord> {
List<SpmkApproveExecuteRecord> selectListByAsId(@Param("id") Integer id); List<SpmkApproveExecuteRecord> selectListByAsId(@Param("id") Integer id);
int delExecuteRecord(@Param("recordId") Integer recordId,@Param("approveSummaryId") Integer approveSummaryId);
SpmkApproveExecuteRecord selectExecuteRecordById(@Param("userId") Integer userId,@Param("approveSummaryId") Integer approveSummaryId);
int delExecuteRecordByRecordIds(@Param("id") Integer id, @Param("uid")Integer uid);
SpmkApproveExecuteRecord selectExecuteRecordReoId(@Param("reoId") Integer reoId,@Param("approveSummaryId") Integer approveSummaryId);
} }
...@@ -29,6 +29,9 @@ public class BalanceSheetDataDto implements Serializable{ ...@@ -29,6 +29,9 @@ public class BalanceSheetDataDto implements Serializable{
@ApiModelProperty(value = "假期规则id", example = "字段说明") @ApiModelProperty(value = "假期规则id", example = "字段说明")
private Integer leaverulesid; private Integer leaverulesid;
@ApiModelProperty(value = "假期name", example = "字段说明")
private String name;
@ApiModelProperty(value = "余额天数 ", example = "字段说明") @ApiModelProperty(value = "余额天数 ", example = "字段说明")
private double balancedays; private double balancedays;
} }
package cn.timer.api.dto.kqmk;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExportEmployeeLeaveBalanceDto {
@ApiModelProperty(value = "员工工号 ", example = "字段说明")
private Integer empnum;
@ApiModelProperty(value = "员工名称 ", example = "字段说明")
private String empname;
@ApiModelProperty(value = "部门 ", example = "字段说明")
private String department;
@ApiModelProperty(value = "入职日期 ", example = "字段说明")
private String rztime;
@ApiModelProperty(value = "企业组织代码 ", example = "字段说明")
private Integer orgcode;
private Integer turnover_status;
@ApiModelProperty(value = "表数据", example = "字段说明")
List<BalanceSheetDataDto> balanceTo;
}
...@@ -5,9 +5,11 @@ import java.util.List; ...@@ -5,9 +5,11 @@ import java.util.List;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Transient;
import cn.timer.api.bean.qyxx.CmsContentRead; import cn.timer.api.bean.qyxx.CmsContentRead;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.utils.Page; import cn.timer.api.utils.Page;
......
...@@ -4,6 +4,7 @@ import cn.timer.api.utils.Page; ...@@ -4,6 +4,7 @@ import cn.timer.api.utils.Page;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -53,4 +54,7 @@ public class CmsContentReadDto extends Page implements Serializable { ...@@ -53,4 +54,7 @@ public class CmsContentReadDto extends Page implements Serializable {
@ApiModelProperty(value = "更新时间", example = "") @ApiModelProperty(value = "更新时间", example = "")
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "附件索引", example = "")
private Integer fileIndex;
} }
package cn.timer.api.dto.spmk;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AdminApprovingDto {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批汇总id", example = "2", required = true)
private Integer asId;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批执行记录id", example = "10", required = true)
private Integer executeRecordId;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "执行人记录id", example = "10", required = true)
private Integer executorId;
@ApiModelProperty(value = "意见", example = "同意、拒绝")
private String opinion;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "状态 2同意 3拒绝 4转派", example = "2", required = true)
private Integer sts;
@ApiModelProperty(value = "被转派人 ", example = "对象")
private User user;
@ApiModelProperty(value = "签字图片 ", example = "签字图片")
private String signatureImg;
@ApiModelProperty(value = "被转派人数组 ", example = "数组")
private List<User> userList;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "申请数据 ", example = "申请数据", required = true)
private Integer execute;
@ApiModelProperty(value = "节点索引 ", example = "节点索引", required = true)
private Integer typeIndex;
@ApiModelProperty(value = "节点用户索引 ", example = "节点用户索引", required = true)
private Integer userIndex;
}
...@@ -3,12 +3,15 @@ package cn.timer.api.dto.spmk; ...@@ -3,12 +3,15 @@ package cn.timer.api.dto.spmk;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg; import cn.timer.api.config.exception.ValidationMsg;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
...@@ -40,4 +43,10 @@ public class ApprovingDto { ...@@ -40,4 +43,10 @@ public class ApprovingDto {
@ApiModelProperty(value = "签字图片 ", example = "签字图片") @ApiModelProperty(value = "签字图片 ", example = "签字图片")
private String signatureImg; private String signatureImg;
@ApiModelProperty(value = "被转派人数组 ", example = "数组")
private List<User> userList;
@ApiModelProperty(value = "申请数据 ", example = "申请数据", required = true)
private List<JSONObject> fileList;
} }
package cn.timer.api.dto.spmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FromsFileValueData implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String file;
private String name;
}
...@@ -26,6 +26,9 @@ public class SpmkApproveDetailDto { ...@@ -26,6 +26,9 @@ public class SpmkApproveDetailDto {
@ApiModelProperty(value = "标题 ", example = "标题") @ApiModelProperty(value = "标题 ", example = "标题")
private String name; private String name;
@ApiModelProperty(value = "副标题 ", example = "副标题")
private String digest;
@ApiModelProperty(value = "所在部门名称 ", example = "所在部门名称") @ApiModelProperty(value = "所在部门名称 ", example = "所在部门名称")
private String departmentName; private String departmentName;
...@@ -58,4 +61,8 @@ public class SpmkApproveDetailDto { ...@@ -58,4 +61,8 @@ public class SpmkApproveDetailDto {
private Date launchTime; //审批发起时间 private Date launchTime; //审批发起时间
private Integer index;//插入审批人的索引
private Integer userIndex;//插入审批人的当前用户索引
} }
...@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull; ...@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.config.exception.ValidationMsg; import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -24,6 +25,7 @@ import lombok.NoArgsConstructor; ...@@ -24,6 +25,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class SpmkApproveSummaryDto{ public class SpmkApproveSummaryDto{
@NotBlank(message = ValidationMsg.NOTBLANK) @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "标题 ", example = "标题", required = true) @ApiModelProperty(value = "标题 ", example = "标题", required = true)
private String title; private String title;
...@@ -40,9 +42,9 @@ public class SpmkApproveSummaryDto{ ...@@ -40,9 +42,9 @@ public class SpmkApproveSummaryDto{
private String initiator; private String initiator;
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
@DecimalMax(value = "11",message = ValidationMsg.DECIMALMAX +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪 11录用 ") @DecimalMax(value = "9",message = ValidationMsg.DECIMALMAX +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@DecimalMin(value = "0",message = ValidationMsg.DECIMALMIN +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪 11录用") @DecimalMin(value = "0",message = ValidationMsg.DECIMALMIN +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪 11录用", example = "1") @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡", example = "1")
private Integer assoType; private Integer assoType;
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
...@@ -60,4 +62,7 @@ public class SpmkApproveSummaryDto{ ...@@ -60,4 +62,7 @@ public class SpmkApproveSummaryDto{
@ApiModelProperty(value = "是否加急", example = "是否加急", required = true) @ApiModelProperty(value = "是否加急", example = "是否加急", required = true)
private Integer isUrgent; private Integer isUrgent;
@ApiModelProperty
private Integer id;
} }
package cn.timer.api.utils.router;
import cn.timer.api.bean.spmk.SpmkApproveDetailSummary;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* 申请数据工具类
*
* @author wuqingjun
* @email 284718418@qq.com
* @date 2022-07-13 10:05:49
*/
@Slf4j
public class RequestDataUtils {
/**
* 表单file类型
*/
private final static String FORMS_CLASS_NAME_KEY = "className";
private final static String FORMS_CLASS_NAME_VALUE = "file";
/**
* 表单label类型
*/
private final static String FORMS_DISPLAY_NAME_KEY = "displayName";
private final static String FORMS_DISPLAY_NAME_VALUE = "上传附件";
/**
* 表单inputId
*/
private final static String FORMS_INPUTID_KEY = "inputId";
/**
* 申请数据 file* value
*/
private final static String FORMS_INPUTID_KEY_VALUE = "value";
private static JSONObject jsonObject = new JSONObject();
/**
* 审批详情 审批时添加 附件
*
* @param spmkApproveDetailSummary 审批详情数据
* @param fileList 新增数据
* @throws Exception
*/
public static Boolean addFileList(SpmkApproveDetailSummary spmkApproveDetailSummary, List<JSONObject> fileList) throws Exception {
if (CollectionUtils.isEmpty(fileList)) {
return false;
}
log.info("fileList = {}", fileList);
List<JSONObject> forms = jsonObject.parseArray(spmkApproveDetailSummary.getFroms(), JSONObject.class);
if (CollectionUtils.isEmpty(forms)) {
return false;
}
String inputId = "";
// 找到审批表单对应的附件节点 inputId
for (JSONObject object : forms) {
if (FORMS_CLASS_NAME_VALUE.equals(object.get(FORMS_CLASS_NAME_KEY)) /*&& FORMS_DISPLAY_NAME_VALUE.equals(object.get(FORMS_DISPLAY_NAME_KEY))*/) {
inputId = object.get(FORMS_INPUTID_KEY).toString();
break;
}
}
if (StringUtils.isEmpty(inputId) || inputId.length() <= 0) {
log.info("审批详情 >审批时添加附件 forms not file point.");
return false;
}
log.info("forms = {}", forms);
JSONObject requestData = jsonObject.parseObject(spmkApproveDetailSummary.getRequestData(), JSONObject.class);
if (StringUtils.isEmpty(requestData)) {
return false;
}
// 找到 申请数据 对应节点 的数据
JSONObject value = (JSONObject) requestData.get(inputId);
JSONArray v = (JSONArray) value.get(FORMS_INPUTID_KEY_VALUE);
// 添加 申请数据 对应节点 的数据
v.addAll(fileList);
log.info("requestData = {}", requestData);
spmkApproveDetailSummary.setRequestData(requestData.toJSONString());
return true;
}
/**
* 审批详情 审批时添加 附件
*
* @param spmkApproveDetailSummary 审批详情数据
* @param fileList 新增数据
* @throws Exception
*/
public static Boolean delFileList(SpmkApproveDetailSummary spmkApproveDetailSummary, List<JSONObject> fileList) throws Exception {
log.info("fileList = {}", fileList);
List<JSONObject> forms = jsonObject.parseArray(spmkApproveDetailSummary.getFroms(), JSONObject.class);
if (CollectionUtils.isEmpty(forms)) {
return false;
}
String inputId = "";
// 找到审批表单对应的附件节点 inputId
for (JSONObject object : forms) {
if (FORMS_CLASS_NAME_VALUE.equals(object.get(FORMS_CLASS_NAME_KEY)) /*&& FORMS_DISPLAY_NAME_VALUE.equals(object.get(FORMS_DISPLAY_NAME_KEY))*/) {
inputId = object.get(FORMS_INPUTID_KEY).toString();
break;
}
}
if (StringUtils.isEmpty(inputId) || inputId.length() <= 0) {
log.info("审批详情 >审批时添加附件 forms not file point.");
return false;
}
log.info("forms = {}", forms);
JSONObject requestData = jsonObject.parseObject(spmkApproveDetailSummary.getRequestData(), JSONObject.class);
if (StringUtils.isEmpty(requestData)) {
return false;
}
// 找到 申请数据 对应节点 的数据
JSONObject value = (JSONObject) requestData.get(inputId);
JSONArray v = (JSONArray) value.get(FORMS_INPUTID_KEY_VALUE);
v.clear();
if(fileList.size()>=0) {
v.addAll(fileList);
}
spmkApproveDetailSummary.setRequestData(requestData.toJSONString());
return true;
}
}
...@@ -5,6 +5,11 @@ import java.util.Date; ...@@ -5,6 +5,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.config.enuminterface.SpmkEnumInterface;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -18,7 +23,6 @@ import cn.hutool.core.collection.ListUtil; ...@@ -18,7 +23,6 @@ import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.convert.ConvertException; import cn.hutool.core.convert.ConvertException;
import cn.hutool.core.lang.Console; import cn.hutool.core.lang.Console;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord; import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
import cn.timer.api.bean.spmk.SpmkApproveSummary; import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.spmk.SpmkExecutor; import cn.timer.api.bean.spmk.SpmkExecutor;
...@@ -79,12 +83,15 @@ public class RouterUtils { ...@@ -79,12 +83,15 @@ public class RouterUtils {
*/ */
private final static String RELATION_TYPE_USERS = "users"; private final static String RELATION_TYPE_USERS = "users";
private static com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse) throws NumberFormatException, ConvertException, Exception { public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse) throws NumberFormatException, ConvertException, Exception {
return NextNode(listRouter, obj, isFirse, false); return NextNode(listRouter, obj, isFirse, false);
} }
// 执行下一个节点 // 执行下一个节点
public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse, boolean isAuditNext) throws NumberFormatException, ConvertException, Exception { public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse, boolean isAuditNext,boolean... isDrafts) throws NumberFormatException, ConvertException, Exception {
Router router; Router router;
if (CollectionUtil.isNotEmpty(listRouter)) { if (CollectionUtil.isNotEmpty(listRouter)) {
...@@ -153,9 +160,10 @@ public class RouterUtils { ...@@ -153,9 +160,10 @@ public class RouterUtils {
// } // }
if (!isAuditNext) { if (!isAuditNext) {
//此处如果是草稿就不需要更改
if(isDrafts!=null) {
router.setExecute(EXECUTING); router.setExecute(EXECUTING);
}
if(router.getRelation().size() > 0) { if(router.getRelation().size() > 0) {
// if (r != null && RELATION_TYPE_USERS.equals(r.getType())) { // if (r != null && RELATION_TYPE_USERS.equals(r.getType())) {
List<User> listUser = router.getRelation().get(0).getUsers(); List<User> listUser = router.getRelation().get(0).getUsers();
...@@ -168,7 +176,9 @@ public class RouterUtils { ...@@ -168,7 +176,9 @@ public class RouterUtils {
} }
switch (execute) { switch (execute) {
case UNEXECUTED: case UNEXECUTED:
if(isDrafts!=null) {
listUser.get(i).setExecute(EXECUTING); listUser.get(i).setExecute(EXECUTING);
}
// 首次发起申请时,写入 审批人名称 至 obj 中 // 首次发起申请时,写入 审批人名称 至 obj 中
if (isFirse && obj.getStr("current_approver") == null ) { if (isFirse && obj.getStr("current_approver") == null ) {
obj.set("current_approver", listUser.get(i).getName()); obj.set("current_approver", listUser.get(i).getName());
...@@ -568,26 +578,40 @@ public class RouterUtils { ...@@ -568,26 +578,40 @@ public class RouterUtils {
* @param asId 审批汇总Id * @param asId 审批汇总Id
* @param executorId 执行人记录Id * @param executorId 执行人记录Id
* @param opinion 意见 * @param opinion 意见
* @param sts 状态 1执行中 2通过 3拒绝 * @param sts 状态 1执行中 2通过 3拒绝 4转派
*/ */
public static void approving(List<FlowChildren> listFlowChildren,Integer asId,Integer executeRecordId, Integer executorId, String opinion,Integer sts,User redeployUser,String signatureImg,Integer empNum ) throws Exception { public static void approving(List<FlowChildren> listFlowChildren,Integer asId,Integer executeRecordId, Integer executorId, String opinion,Integer sts,User redeployUser,String signatureImg,Integer empNum,List<User> redeployUserList) throws Exception {
//是否有下一个审批人
boolean hasNextApprover = false; boolean hasNextApprover = false;
//统计并序审批 还有几个执行中的
int es=0; int es=0;
//操作人是否在审批名单里
boolean isExist = false;
for (int i = 0,n = listFlowChildren.size(); i < n; i++) { List<FlowChildren> flowChildrenList = new ArrayList<>();
int redeployIndex = -1;//当前转派人所在节点下标
//初始化转派人数据 用于转派
String flowChildrenJson = "{\"className\":\"audit\",\"execute\":\"0\",\"flow\":true,\"relation\":[{\"approvalOrder\":\"0\",\"departmentId\":\"\",\"down\":0,\"empty\":0,\"name\":\"\",\"signature\":0,\"type\":\"users\",\"upward\":0,\"users\":[{\"execute\":\"0\",\"headUrl\":\"\",\"id\":\"\",\"name\":\"\"}]}]}";
//FlowChildren flowChildren = jsonObject.parseObject(flowChildrenJson,FlowChildren.class);
for (int i = 0,n = listFlowChildren.size(); i < n; i++) {
// 新增 执行人 // 新增 执行人
List<User> listUser = CollUtil.toList(); List<User> listUser = CollUtil.toList();
boolean aobl = false; boolean aobl = false;//用于判断是 否并序审批
List<Relation> listR = listFlowChildren.get(i).getRelation(); List<Relation> listR = listFlowChildren.get(i).getRelation();
if (CollectionUtil.isNotEmpty(listR)) { if (CollectionUtil.isNotEmpty(listR)) {
listUser = listR.get(0).getUsers(); listUser = listR.get(0).getUsers();
if("1".equals(listR.get(0).getApprovalOrder())){
aobl = true;
for (User user:listR.get(0).getUsers() for (User user:listR.get(0).getUsers()
) { ) {
if(Integer.parseInt(user.getId()) == empNum && listFlowChildren.get(i).getClassName().equals(AUDIT)){
isExist = true;
}
//判断是顺序还是并序 0顺序 1并序
if("1".equals(listR.get(0).getApprovalOrder())){
aobl = true;
if ("1".equals(user.getExecute())){ if ("1".equals(user.getExecute())){
es++; es++;
} }
...@@ -596,15 +620,23 @@ public class RouterUtils { ...@@ -596,15 +620,23 @@ public class RouterUtils {
} }
} }
//判断大节点的执行状态 0 未执行 1 执行中 2 已执行
//执行中
if (EXECUTING.equals(listFlowChildren.get(i).getExecute())) { if (EXECUTING.equals(listFlowChildren.get(i).getExecute())) {
String currentApprover = "";//存放当前审批人名称
int num = 0;
//遍历当前节点审批人
outloop: // 标识 (若内层满足条件直接跳到该层循环)
for (int i_user = 0, n_user = listUser.size(); i_user < n_user; i_user++) { for (int i_user = 0, n_user = listUser.size(); i_user < n_user; i_user++) {
//判断用户执行状态 0 未执行 1 执行中 2 已执行
//已执行
if (EXECUTED.equals(listUser.get(i_user).getExecute())) { if (EXECUTED.equals(listUser.get(i_user).getExecute())) {
//执行中
}else if (EXECUTING.equals(listUser.get(i_user).getExecute())) { }else if (EXECUTING.equals(listUser.get(i_user).getExecute())) {
//判断当前节点审批人id 等于 操作用户id 则更新执行人信息:审批意见、状态(0未执行 1执行中 2同意 3拒接 4转派)
if (Integer.parseInt(listUser.get(i_user).getId()) == empNum){ if ((Integer.parseInt(listUser.get(i_user).getId()) == empNum && num == 0) || (!isExist && num == 0)){
num++;
SpmkExecutor.builder() SpmkExecutor.builder()
.id(executorId) .id(executorId)
.opinion(opinion) .opinion(opinion)
...@@ -640,24 +672,63 @@ public class RouterUtils { ...@@ -640,24 +672,63 @@ public class RouterUtils {
listFlowChildren.get(i_user).setExecute(EXECUTED); listFlowChildren.get(i_user).setExecute(EXECUTED);
return; return;
//转派 处理 //转派 处理
//在 原审批人 列表中 插入 一个被转派人(审批人) //在 原审批人 列表中 插入 一个或多个被转派人(审批人)
}else if (sts == ExecutorSts.REDEPLOY.ordinal()) { }else if (sts == ExecutorSts.REDEPLOY.ordinal()) {
List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1); List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
//新增转派多个人功能
//判断是走派多个人的 否则走旧逻辑
if(!CollectionUtils.isEmpty(redeployUserList)){
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1); 第一次修改
//redeployUserList.add(users1.get(users1.size() - 1)); 第二次修改
/*flowChildren.getRelation().get(0).setName(users1.get(users1.size() - 1).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(users1.get(users1.size() - 1).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(users1.get(users1.size() - 1).getId());*/
redeployIndex = i;
for (User ruser:redeployUserList
) {
ruser.setExecute(UNEXECUTED);
users1.add(ruser);
n_user = listUser.size();
}
// List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size());
// listUser = ListUtils.union(users1, users2);//并集
//listR.get(0).setApprovalOrder("1");
listFlowChildren.get(i).getRelation().get(0).setApprovalOrder("1");
}else {
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
redeployUser.setExecute(UNEXECUTED); redeployUser.setExecute(UNEXECUTED);
users1.add(redeployUser); users1.add(redeployUser);
//新加的 把转派人跟在后面说
User user = users1.get(users1.size() - 2);
// User us = new User();
// us.setExecute(UNEXECUTED);
// us.setName(user.getName());
// us.setId(user.getId());
// users1.add(us);
/*flowChildren.getRelation().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(user.getId());*/
redeployIndex = i;
List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size()); List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size());
redeployUserList = users2;
//listUser = ListUtils.union(users1, users2);
n_user = listUser.size();
}
// System.out.println(users1); // System.out.println(users1);
// System.out.println(users2); // System.out.println(users2);
listUser = ListUtils.union(users1, users2); //
n_user = listUser.size();
// System.out.println(listUser); // System.out.println(listUser);
} }
//break outloop;
} }
//未执行
}else if (UNEXECUTED.equals(listUser.get(i_user).getExecute())) { }else if (UNEXECUTED.equals(listUser.get(i_user).getExecute())) {
//新增执行人 执行状态为执行中
SpmkExecutor.builder() SpmkExecutor.builder()
.approveExecuteRecordId(executeRecordId) .approveExecuteRecordId(executeRecordId)
.empNum(Integer.parseInt(listUser.get(i_user).getId())) .empNum(Integer.parseInt(listUser.get(i_user).getId()))
...@@ -666,7 +737,7 @@ public class RouterUtils { ...@@ -666,7 +737,7 @@ public class RouterUtils {
.sts(ExecutorSts.IN_EXECUTION.ordinal()) .sts(ExecutorSts.IN_EXECUTION.ordinal())
.build() .build()
.insert(); .insert();
hasNextApprover = true; hasNextApprover = true;//标记为有下个审批人
listUser.get(i_user).setExecute(EXECUTING); listUser.get(i_user).setExecute(EXECUTING);
...@@ -674,12 +745,15 @@ public class RouterUtils { ...@@ -674,12 +745,15 @@ public class RouterUtils {
SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user).getName()).build().updateById(); SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user).getName()).build().updateById();
// 处理了 下一个审批人 则跳出循环 // 处理了 下一个审批人 则跳出循环
break; if(CollectionUtils.isEmpty(redeployUserList)){
break outloop;
}
} }
} }
// 无下一个审批人 则更新 节点状态 为 EXECUTED(已执行) // 无下一个审批人 则更新 节点状态 为 EXECUTED(已执行)
if (!hasNextApprover) { if (!hasNextApprover && es<=1) {
SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord
.builder() .builder()
.id(executeRecordId) .id(executeRecordId)
...@@ -688,17 +762,18 @@ public class RouterUtils { ...@@ -688,17 +762,18 @@ public class RouterUtils {
// 更新 审批执行记录 // 更新 审批执行记录
aer.updateById(); aer.updateById();
if(es<=1){ // if(es<=1){
// listFlowChildren.get(i).setExecute(EXECUTED);
// }
listFlowChildren.get(i).setExecute(EXECUTED); listFlowChildren.get(i).setExecute(EXECUTED);
}
} }
//判断大节点为未执行
}else if (UNEXECUTED.equals(listFlowChildren.get(i).getExecute())) { }else if (UNEXECUTED.equals(listFlowChildren.get(i).getExecute())) {
//判断无下一个审批人 并且 执行中的小于等于1
if (!hasNextApprover && es<=1) { if (!hasNextApprover && es<=1) {
switch (listFlowChildren.get(i).getClassName()) { switch (listFlowChildren.get(i).getClassName()) {
case CREATOR: case CREATOR://发起审批人
SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
...@@ -722,11 +797,12 @@ public class RouterUtils { ...@@ -722,11 +797,12 @@ public class RouterUtils {
listFlowChildren.get(i).setExecute(EXECUTED); listFlowChildren.get(i).setExecute(EXECUTED);
break; break;
case AUDIT: case AUDIT://审批中
//判断是否是并序
if(aobl){ if(aobl){
String currentApprover = ""; String currentApprover = "";
//遍历当前节点审批人
for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) { for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) {
SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
...@@ -737,6 +813,7 @@ public class RouterUtils { ...@@ -737,6 +813,7 @@ public class RouterUtils {
// 新增 审批执行记录 // 新增 审批执行记录
aer2.insert(); aer2.insert();
//新增执行人 并设置状态为执行中
SpmkExecutor executor = SpmkExecutor.builder() SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer2.getId()) .approveExecuteRecordId(aer2.getId())
.empNum(Integer.parseInt(listUser.get(i_user2).getId())) .empNum(Integer.parseInt(listUser.get(i_user2).getId()))
...@@ -766,7 +843,7 @@ public class RouterUtils { ...@@ -766,7 +843,7 @@ public class RouterUtils {
.build(); .build();
// 新增 审批执行记录 // 新增 审批执行记录
aer2.insert(); aer2.insert();
//遍历当前节点审批人
for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) { for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) {
SpmkExecutor executor = SpmkExecutor.builder() SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer2.getId()) .approveExecuteRecordId(aer2.getId())
...@@ -789,7 +866,7 @@ public class RouterUtils { ...@@ -789,7 +866,7 @@ public class RouterUtils {
} }
break; break;
case COPY: case COPY://抄送人
SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
...@@ -826,11 +903,391 @@ public class RouterUtils { ...@@ -826,11 +903,391 @@ public class RouterUtils {
} }
} }
for (int i = 0; i < listFlowChildren.size(); i++) {
flowChildrenList.add(listFlowChildren.get(i));
/*** 转派添加审批人 ***/
/*if(i == redeployIndex){
flowChildrenList.add(flowChildren);
}*/
}
if (flowChildrenList.size() > 0){
listFlowChildren.clear();
listFlowChildren.addAll(flowChildrenList);
}
} }
public static List<Router> clearRouters(List<Router> routers){ public static List<Router> clearRouters(List<Router> routers){
return routers; return routers;
} }
/**
* 被拒审批 管理员修改为同意审批
* @param listFlowChildren 节点
* @param asId 审批汇总Id
* @param executorId 执行人记录Id
* @param opinion 意见
* @param sts 状态 1执行中 2通过 3拒绝 4转派
*/
public static void updateRefuseToAgree(List<FlowChildren> listFlowChildren,Integer asId,Integer executeRecordId, Integer executorId, String opinion,Integer sts,Integer currentSts,User redeployUser,String signatureImg,Integer empNum,List<User> redeployUserList,Integer typeIndex,Integer userIndex) throws Exception {
//拒绝单
SpmkApproveExecuteRecord spmkApproveExecuteRecord = SpmkApproveExecuteRecord.builder().id(executeRecordId).build().selectById();
if(currentSts==3){
SpmkExecutor.builder().id(executorId).sts(sts).opinion(opinion).build().updateById();
spmkApproveExecuteRecord.builder().id(executeRecordId).sts(sts).build().updateById();
// 更新 审批汇总 状态
SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).updateTime(new Date()).sts(SpmkEnumInterface.ApproveSummarySts.IN.ordinal()).build().updateById();
}else if(currentSts==2){
SpmkApproveSummary.builder().id(asId).currentApprover(listFlowChildren.get(typeIndex).getRelation().get(0).getUsers().get(userIndex).getName()).updateTime(new Date()).sts(SpmkEnumInterface.ApproveSummarySts.IN.ordinal()).build().updateById();
}
//是否有下一个审批人
boolean hasNextApprover = false;
//统计并序审批 还有几个执行中的
int es=0;
//操作人是否在审批名单里
boolean isExist = false;
List<FlowChildren> flowChildrenList = new ArrayList<>();
int redeployIndex = -1;//当前转派人所在节点下标
//初始化转派人数据 用于转派
String flowChildrenJson = "{\"className\":\"audit\",\"execute\":\"0\",\"flow\":true,\"relation\":[{\"approvalOrder\":\"0\",\"departmentId\":\"\",\"down\":0,\"empty\":0,\"name\":\"\",\"signature\":0,\"type\":\"users\",\"upward\":0,\"users\":[{\"execute\":\"0\",\"headUrl\":\"\",\"id\":\"\",\"name\":\"\"}]}]}";
//FlowChildren flowChildren = jsonObject.parseObject(flowChildrenJson,FlowChildren.class);
boolean isApprover = false;
for (int i = 0,n = listFlowChildren.size(); i < n; i++) {
//等于当前审批人
if(i==typeIndex){
listFlowChildren.get(i).setExecute(EXECUTING);
}
// 新增 执行人
List<User> listUser = CollUtil.toList();
boolean aobl = false;//用于判断是 否并序审批
List<Relation> listR = listFlowChildren.get(i).getRelation();
if (CollectionUtil.isNotEmpty(listR)) {
listUser = listR.get(0).getUsers();
for (User user:listR.get(0).getUsers()
) {
if(Integer.parseInt(user.getId()) == empNum && listFlowChildren.get(i).getClassName().equals(AUDIT)){
isExist = true;
}
//判断是顺序还是并序 0顺序 1并序
if("1".equals(listR.get(0).getApprovalOrder())){
aobl = true;
if ("1".equals(user.getExecute())){
es++;
}
}
}
}
if(isApprover){
listFlowChildren.get(i).setExecute(UNEXECUTED);
listFlowChildren.get(i).getRelation().get(0).getUsers().forEach(v->v.setExecute(UNEXECUTED));
}
//判断大节点的执行状态 0 未执行 1 执行中 2 已执行
//执行中
if (EXECUTING.equals(listFlowChildren.get(i).getExecute())) {
String currentApprover = "";//存放当前审批人名称
int num = 0;
//遍历当前节点审批人
outloop: // 标识 (若内层满足条件直接跳到该层循环)
for (int i_user = 0, n_user = listUser.size(); i_user < n_user; i_user++) {
if(i_user==userIndex){
isApprover=true;
listUser.get(i_user).setExecute(EXECUTING);
}
//判断用户执行状态 0 未执行 1 执行中 2 已执行
//已执行
if (EXECUTED.equals(listUser.get(i_user).getExecute())) {
//执行中
}else if (EXECUTING.equals(listUser.get(i_user).getExecute())) {
//判断当前节点审批人id 等于 操作用户id 则更新执行人信息:审批意见、状态(0未执行 1执行中 2同意 3拒接 4转派)
if ((Integer.parseInt(redeployUser.getId()) == Integer.parseInt(listUser.get(i_user).getId()) && num == 0)){
num++;
SpmkExecutor.builder()
.id(executorId)
.opinion(opinion)
.empNum(Integer.parseInt(listUser.get(i_user).getId()))
.executorName(listUser.get(i_user).getName())
.operatorHeaderUrl(listUser.get(i_user).getHeadUrl())
.sts(sts)
.signatureImg(signatureImg)
.build().updateById();
listUser.get(i_user).setExecute(EXECUTED);
// 历史审批人
SpmkApproveSummary.builder()
.id(asId)
.historyApprover(listUser.get(i_user).getName())
.build()
.updateById();
//拒绝处理
// 0未执行 1执行中 2同意 3拒绝 4 转派
if(sts==ExecutorSts.AGREE.ordinal()){
}
if (sts == ExecutorSts.REFUSE.ordinal()) {
// 更新 审批汇总 状态
SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(sts).build().updateById();
SpmkApproveExecuteRecord
.builder()
.id(executeRecordId)
.sts(sts)
.build()
// 更新 审批执行记录
.updateById();
listFlowChildren.get(i_user).setExecute(EXECUTED);
return;
//转派 处理
//在 原审批人 列表中 插入 一个或多个被转派人(审批人)
}
else if (sts == ExecutorSts.REDEPLOY.ordinal()) {
List<User> users1 = CollectionUtil.sub(listUser, userIndex, userIndex+1);
//新增转派多个人功能
//判断是走派多个人的 否则走旧逻辑
if(!CollectionUtils.isEmpty(redeployUserList)){
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1); 第一次修改
//redeployUserList.add(users1.get(users1.size() - 1)); 第二次修改
/*flowChildren.getRelation().get(0).setName(users1.get(0).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(users1.get(0).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(users1.get(0).getId());*/
redeployIndex = i;
for (User ruser:redeployUserList
) {
ruser.setExecute(UNEXECUTED);
users1.add(ruser);
n_user = listUser.size();
}
// List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size());
// listUser = ListUtils.union(users1, users2);//并集
//listR.get(0).setApprovalOrder("1");
listFlowChildren.get(i).getRelation().get(0).setApprovalOrder("1");
}else {
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
redeployUser.setExecute(UNEXECUTED);
users1.add(redeployUser);
//新加的 把转派人跟在后面说
User user = users1.get(users1.size() - 2);
// User us = new User();
// us.setExecute(UNEXECUTED);
// us.setName(user.getName());
// us.setId(user.getId());
// users1.add(us);
/*flowChildren.getRelation().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(user.getId());*/
redeployIndex = i;
List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size());
redeployUserList = users2;
//listUser = ListUtils.union(users1, users2);
n_user = listUser.size();
}
// System.out.println(users1);
// System.out.println(users2);
//
// System.out.println(listUser);
}
//break outloop;
}
//未执行
}
else if (UNEXECUTED.equals(listUser.get(i_user).getExecute())) {
//新增执行人 执行状态为执行中
SpmkExecutor.builder()
.approveExecuteRecordId(executeRecordId)
.empNum(Integer.parseInt(listUser.get(i_user).getId()))
.executorName(listUser.get(i_user).getName())
.operatorHeaderUrl(listUser.get(i_user).getHeadUrl())
.sts(ExecutorSts.IN_EXECUTION.ordinal())
.build()
.insert();
hasNextApprover = true;//标记为有下个审批人
listUser.get(i_user).setExecute(EXECUTING);
// 当前审批人
SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user).getName()).build().updateById();
// 处理了 下一个审批人 则跳出循环
if(CollectionUtils.isEmpty(redeployUserList)){
break outloop;
}
}
}
// 无下一个审批人 则更新 节点状态 为 EXECUTED(已执行)
if (!hasNextApprover && es<=1) {
SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord
.builder()
.id(executeRecordId)
.sts(ExecutorSts.AGREE.ordinal())
.build();
// 更新 审批执行记录
aer.updateById();
// if(es<=1){
// listFlowChildren.get(i).setExecute(EXECUTED);
// }
listFlowChildren.get(i).setExecute(EXECUTED);
}
//判断大节点为未执行
}
else if (UNEXECUTED.equals(listFlowChildren.get(i).getExecute())) {
//判断无下一个审批人 并且 执行中的小于等于1
if (!hasNextApprover && es<=1) {
switch (listFlowChildren.get(i).getClassName()) {
case CREATOR://发起审批人
SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(asId)
.name(ParticipatorType.INITIATOR.getName())
.type(ParticipatorType.INITIATOR.ordinal())
.sts(ExecuteRecordSts.AGREE.ordinal())
.build();
// 新增 审批执行记录
aer.insert();
// 新增 执行人
User user = listFlowChildren.get(i).getRelation().get(0).getUsers().get(0);
SpmkExecutor.builder()
.approveExecuteRecordId(aer.getId())
.empNum(Integer.parseInt(user.getId()))
.executorName(user.getName())
.operatorHeaderUrl(user.getHeadUrl())
.sts(ExecutorSts.AGREE.ordinal())
.build()
.insert();
listFlowChildren.get(i).setExecute(EXECUTED);
break;
case AUDIT://审批中
//判断是否是并序
if(aobl){
String currentApprover = "";
//遍历当前节点审批人
for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) {
SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(asId)
.name(ParticipatorType.APPROVER.getName())
.type(ParticipatorType.APPROVER.ordinal())
.sts(ExecuteRecordSts.IN_EXECUTION.ordinal())
.build();
// 新增 审批执行记录
aer2.insert();
//新增执行人 并设置状态为执行中
SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer2.getId())
.empNum(Integer.parseInt(listUser.get(i_user2).getId()))
.executorName(listUser.get(i_user2).getName())
.operatorHeaderUrl(listUser.get(i_user2).getHeadUrl())
.sts(ExecutorSts.IN_EXECUTION.ordinal())
.build();
executor.insert();
listUser.get(i_user2).setExecute(EXECUTING);
hasNextApprover = true;
currentApprover=currentApprover!=""?currentApprover+","+listUser.get(i_user2).getName():listUser.get(i_user2).getName();
// 当前审批人
SpmkApproveSummary.builder().id(asId).currentApprover(currentApprover).build().updateById();
}
listFlowChildren.get(i).setExecute(EXECUTING);
}else{
SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(asId)
.name(ParticipatorType.APPROVER.getName())
.type(ParticipatorType.APPROVER.ordinal())
.sts(ExecuteRecordSts.IN_EXECUTION.ordinal())
.build();
// 新增 审批执行记录
aer2.insert();
//遍历当前节点审批人
for (int i_user2 = 0,n_user2 = listUser.size(); i_user2 < n_user2; i_user2++) {
SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer2.getId())
.empNum(Integer.parseInt(listUser.get(i_user2).getId()))
.executorName(listUser.get(i_user2).getName())
.operatorHeaderUrl(listUser.get(i_user2).getHeadUrl())
.sts(ExecutorSts.IN_EXECUTION.ordinal())
.build();
executor.insert();
listUser.get(i_user2).setExecute(EXECUTING);
hasNextApprover = true;
// 当前审批人
SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user2).getName()).build().updateById();
// 处理了 下一个审批人 则跳出循环
break;
}
listFlowChildren.get(i).setExecute(EXECUTING);
}
break;
case COPY://抄送人
SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord
.builder()
.approveSummaryId(asId)
.name(ParticipatorType.COPY.getName())
.type(ParticipatorType.COPY.ordinal())
.sts(ExecuteRecordSts.AGREE.ordinal())
.build();
// 新增 审批执行记录
aer3.insert();
List<Relation> listRelation = listFlowChildren.get(i).getRelation();
for (Relation relation : listRelation) {
List<User> listUser2 = relation.getUsers();
if (listUser2 != null) {
// 新增 执行人
for (User user2 : listUser2) {
SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer3.getId())
.empNum(Integer.parseInt(user2.getId()))
.executorName(user2.getName())
.operatorHeaderUrl(user2.getHeadUrl())
.sts(ExecutorSts.AGREE.ordinal())
.build();
executor.insert();
}
}
}
listFlowChildren.get(i).setExecute(EXECUTED);
break;
}
}
//重新新修改审批结果
}
}
for (int i = 0; i < listFlowChildren.size(); i++) {
flowChildrenList.add(listFlowChildren.get(i));
/*** 转派添加审批人 ***/
/*if(i == redeployIndex){
flowChildrenList.add(flowChildren);
}*/
}
if (flowChildrenList.size() > 0){
listFlowChildren.clear();
listFlowChildren.addAll(flowChildrenList);
}
}
} }
...@@ -244,8 +244,8 @@ config-8timer: ...@@ -244,8 +244,8 @@ config-8timer:
# 文件存储地址类型:aliyun-oss(阿里云OSS),physics-oss(物理机器OSS) # 文件存储地址类型:aliyun-oss(阿里云OSS),physics-oss(物理机器OSS)
# 默认存储物理机器OSS # 默认存储物理机器OSS
file-address: file-address:
type: physics-oss #type: physics-oss
#type: aliyun-oss type: aliyun-oss
#导出zip临时地址 #导出zip临时地址
zip: zip:
......
...@@ -107,7 +107,7 @@ spring: ...@@ -107,7 +107,7 @@ spring:
port: 465 port: 465
class: javax.net.ssl.SSLSocketFactor class: javax.net.ssl.SSLSocketFactor
redis: redis:
database: 4 # Redis数据库索引(默认为0),如果设置为1,那么存入的key-value都存放在select 1中 database: 2 # Redis数据库索引(默认为0),如果设置为1,那么存入的key-value都存放在select 1中
host: 120.78.162.177 host: 120.78.162.177
port: 7788 port: 7788
password: (!0YouLingRcRedis0!) password: (!0YouLingRcRedis0!)
...@@ -219,8 +219,8 @@ config-8timer: ...@@ -219,8 +219,8 @@ config-8timer:
# 文件存储地址类型:aliyun-oss(阿里云OSS),physics-oss(物理机器OSS) # 文件存储地址类型:aliyun-oss(阿里云OSS),physics-oss(物理机器OSS)
# 默认存储物理机器OSS # 默认存储物理机器OSS
file-address: file-address:
type: physics-oss #type: physics-oss
#type: aliyun-oss type: aliyun-oss
#导出zip临时地址 #导出zip临时地址
zip: zip:
......
spring: spring:
profiles: profiles:
active: dev active: test
#active: '@environment@' #active: '@environment@'
...@@ -123,6 +123,30 @@ ...@@ -123,6 +123,30 @@
yz.balance_days as balancedays--> yz.balance_days as balancedays-->
</select> </select>
<select id="selectLeaveBalance" resultType="cn.timer.api.dto.kqmk.ExportEmployeeLeaveBalanceDto">
SELECT emp.emp_num as empnum,
emp.`name` as empname,
emp.org_code as orgcode,
IFNULL(c.name,'') as department,
IFNULL(emp.rz_time,'') as rztime,
IFNULL((select em.job_status from yggl_main_lzb em where em.emp_num = emp.emp_num and em.org_code = emp.org_code),0) as turnover_status
from yggl_main_emp emp
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
where emp.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''">
and ( emp.`name` like CONCAT('%',#{param.query},'%') or
emp.emp_num like CONCAT('%',#{param.query},'%') or
c.name like CONCAT('%',#{param.query},'%'))
</if>
<if test="param.deptid != null and param.deptid != ''">
and c.id in (select m.id from zzgl_bmgw_m m where m.up_id = #{param.deptid}) or (c.id =#{param.deptid})
</if>
<if test="param.turnover_status == 0">
and emp.emp_num not in (select em.emp_num from yggl_main_lzb em where em.org_code = #{param.orgCode} and em.job_status = 3)
</if>
</select>
<select id="selectAdditional" resultMap="AdditionalMap"> <select id="selectAdditional" resultMap="AdditionalMap">
SELECT emp.emp_num as empnum, SELECT emp.emp_num as empnum,
......
...@@ -45,6 +45,14 @@ ...@@ -45,6 +45,14 @@
a.read_time ASC a.read_time ASC
</select> </select>
<select id="getUnreadList" resultType="cn.timer.api.bean.qyxx.CmsContent">
select cc.* from cms_content cc
left JOIN cms_content_read ccs on ccs.cms_content_id=cc.id
WHERE ccs.read_status = 0 and ccs.user_id=#{userId}
order by ccs.create_time desc
limit 10
</select>
<!-- <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.cmsI.CmsIsRead"> <!-- <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.cmsI.CmsIsRead">
INSERT INTO cms_is_read <trim prefix="(" suffix=")" suffixOverrides=","> INSERT INTO cms_is_read <trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != mid'> mid, </if> <if test ='null != uid'> uid </if> </trim> <if test ='null != mid'> mid, </if> <if test ='null != uid'> uid </if> </trim>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.spmk.SpmkApproveDetailDraftsMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.spmk.SpmkApproveDetailDrafts" id="spmkApproveDetailDraftsMap">
<result property="id" column="id"/>
<result property="approveSummaryId" column="approve_summary_id"/>
<result property="name" column="name"/>
<result property="departmentName" column="department_name"/>
<result property="requestData" column="request_data"/>
<result property="froms" column="froms"/>
<result property="router" column="router"/>
<result property="flowChildren" column="flow_children"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.spmk.SpmkApproveDetailDrafts">
select *
from spmk_approve_detail_drafts
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.spmk.SpmkApproveDetailDrafts">
select * from spmk_approve_detail_drafts
<where>
<if test="approveSummaryId != null and approveSummaryId != ''">AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="departmentName != null and departmentName != ''">AND `department_name` = #{departmentName}</if>
<if test="requestData != null and requestData != ''">AND `request_data` = #{requestData}</if>
<if test="froms != null and froms != ''">AND `froms` = #{froms}</if>
<if test="router != null and router != ''">AND `router` = #{router}</if>
<if test="flowChildren != null and flowChildren != ''">AND `flow_children` = #{flowChildren}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from spmk_approve_detail_drafts
<where>
<if test="approveSummaryId != null and approveSummaryId != ''">AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="departmentName != null and departmentName != ''">AND `department_name` = #{departmentName}</if>
<if test="requestData != null and requestData != ''">AND `request_data` = #{requestData}</if>
<if test="froms != null and froms != ''">AND `froms` = #{froms}</if>
<if test="router != null and router != ''">AND `router` = #{router}</if>
<if test="flowChildren != null and flowChildren != ''">AND `flow_children` = #{flowChildren}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.spmk.SpmkApproveDetailDrafts" useGeneratedKeys="true"
keyProperty="id">
insert into spmk_approve_detail_drafts
(`approve_summary_id`,
`name`,
`department_name`,
`request_data`,
`froms`,
`router`,
`flow_children`)
values (#{approveSummaryId},
#{name},
#{departmentName},
#{requestData},
#{froms},
#{router},
#{flowChildren})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.spmk.SpmkApproveDetailDrafts" useGeneratedKeys="true"
keyProperty="id">
insert into spmk_approve_detail_drafts
(
<if test="approveSummaryId != null">,`approve_summary_id`</if>
<if test="name != null">,`name`</if>
<if test="departmentName != null">,`department_name`</if>
<if test="requestData != null">,`request_data`</if>
<if test="froms != null">,`froms`</if>
<if test="router != null">,`router`</if>
<if test="flowChildren != null">,`flow_children`</if>
)
values
(
<if test="approveSummaryId != null">,#{approveSummaryId}</if>
<if test="name != null">,#{name}</if>
<if test="departmentName != null">,#{departmentName}</if>
<if test="requestData != null">,#{requestData}</if>
<if test="froms != null">,#{froms}</if>
<if test="router != null">,#{router}</if>
<if test="flowChildren != null">,#{flowChildren}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.spmk.SpmkApproveDetailDrafts" useGeneratedKeys="true"
keyProperty="id">
insert into spmk_approve_detail_drafts
(
`approve_summary_id`,
`name`,
`department_name`,
`request_data`,
`froms`,
`router`,
`flow_children`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.approveSummaryId},
#{item.name},
#{item.departmentName},
#{item.requestData},
#{item.froms},
#{item.router},
#{item.flowChildren}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApproveDetailDrafts">
update spmk_approve_detail_drafts
<set>
<if test="approveSummaryId != null">`approve_summary_id` = #{approveSummaryId},</if>
<if test="name != null">`name` = #{name},</if>
<if test="departmentName != null">`department_name` = #{departmentName},</if>
<if test="requestData != null">`request_data` = #{requestData},</if>
<if test="froms != null">`froms` = #{froms},</if>
<if test="router != null">`router` = #{router},</if>
<if test="flowChildren != null">`flow_children` = #{flowChildren}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from spmk_approve_detail_drafts
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from spmk_approve_detail_drafts where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.spmk.SpmkApproveDraftsMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.spmk.SpmkApproveDrafts" id="spmkApproveDraftsMap">
<result property="id" column="id"/>
<result property="orgCode" column="org_code"/>
<result property="empNum" column="emp_num"/>
<result property="title" column="title"/>
<result property="departmentName" column="department_name"/>
<result property="initiator" column="initiator"/>
<result property="createTime" column="create_time"/>
<result property="approveName" column="approve_name"/>
<result property="sts" column="sts"/>
<result property="currentApprover" column="current_approver"/>
<result property="historyApprover" column="history_approver"/>
<result property="assoType" column="asso_type"/>
<result property="updateTime" column="update_time"/>
<result property="endTime" column="end_time"/>
<result property="digest" column="digest"/>
<result property="isDelete" column="is_delete"/>
<result property="isUrgent" column="is_urgent"/>
</resultMap>
<select id="selectPageByQueryForEmpNum" resultMap="spmkApproveDraftsMap" >
SELECT
*
FROM spmk_approve_drafts a
WHERE a.org_code = #{param.orgCode} and a.is_delete=0 and a.emp_num=#{param.empNum}
ORDER BY a.id DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.spmk.SpmkApproveExecuteRecordDraftsMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts" id="spmkApproveExecuteRecordDraftsMap">
<result property="id" column="id"/>
<result property="approveSummaryId" column="approve_summary_id"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="sts" column="sts"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts">
select *
from spmk_approve_execute_record_drafts
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts">
select * from spmk_approve_execute_record_drafts
<where>
<if test="approveSummaryId != null and approveSummaryId != ''">AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="sts != null and sts != ''">AND `sts` = #{sts}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">AND `update_time` = #{updateTime}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from spmk_approve_execute_record_drafts
<where>
<if test="approveSummaryId != null and approveSummaryId != ''">AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="sts != null and sts != ''">AND `sts` = #{sts}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">AND `update_time` = #{updateTime}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts" useGeneratedKeys="true"
keyProperty="id">
insert into spmk_approve_execute_record_drafts
(`approve_summary_id`,
`name`,
`type`,
`sts`,
`create_time`,
`update_time`)
values (#{approveSummaryId},
#{name},
#{type},
#{sts},
#{createTime},
#{updateTime})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
useGeneratedKeys="true" keyProperty="id">
insert into spmk_approve_execute_record_drafts
(
<if test="approveSummaryId != null">,`approve_summary_id`</if>
<if test="name != null">,`name`</if>
<if test="type != null">,`type`</if>
<if test="sts != null">,`sts`</if>
<if test="createTime != null">,`create_time`</if>
<if test="updateTime != null">,`update_time`</if>
)
values
(
<if test="approveSummaryId != null">,#{approveSummaryId}</if>
<if test="name != null">,#{name}</if>
<if test="type != null">,#{type}</if>
<if test="sts != null">,#{sts}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="updateTime != null">,#{updateTime}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts" useGeneratedKeys="true"
keyProperty="id">
insert into spmk_approve_execute_record_drafts
(
`approve_summary_id`,
`name`,
`type`,
`sts`,
`create_time`,
`update_time`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.approveSummaryId},
#{item.name},
#{item.type},
#{item.sts},
#{item.createTime},
#{item.updateTime}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts">
update spmk_approve_execute_record_drafts
<set>
<if test="approveSummaryId != null">`approve_summary_id` = #{approveSummaryId},</if>
<if test="name != null">`name` = #{name},</if>
<if test="type != null">`type` = #{type},</if>
<if test="sts != null">`sts` = #{sts},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from spmk_approve_execute_record_drafts
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from spmk_approve_execute_record_drafts where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
b.operator_header_url SpmkExecutor_operator_header_url, b.operator_header_url SpmkExecutor_operator_header_url,
b.opinion SpmkExecutor_opinion, b.opinion SpmkExecutor_opinion,
b.sts SpmkExecutor_sts, b.sts SpmkExecutor_sts,
b.read_status SpmkExecutor_read_status,
b.create_time SpmkExecutor_create_time, b.create_time SpmkExecutor_create_time,
b.update_time SpmkExecutor_update_time, b.update_time SpmkExecutor_update_time,
b.signature_img SpmkExecutor_signature_img b.signature_img SpmkExecutor_signature_img
...@@ -165,5 +166,28 @@ ...@@ -165,5 +166,28 @@
</select> </select>
--> -->
<select id="selectExecuteRecordById" resultType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
SELECT sr.id FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
WHERE sr.approve_summary_id = #{approveSummaryId} and se.emp_num = #{userId}
</select>
<select id="selectExecuteRecordReoId" resultType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
SELECT sr.id FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
WHERE sr.approve_summary_id = #{approveSummaryId} and se.uid = #{reoId}
</select>
<delete id="delExecuteRecord">
DELETE sr,se FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se on sr.id=se.approve_execute_record_id
WHERE sr.approve_summary_id = #{approveSummaryId} and sr.id <![CDATA[ > ]]> #{recordId}
</delete>
<delete id="delExecuteRecordByRecordIds">
DELETE sr,se FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se on sr.id=se.approve_execute_record_id
WHERE sr.id =#{id} and se.emp_num =#{uid}
</delete>
</mapper> </mapper>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<result column="operator_header_url" property="operatorHeaderUrl" /> <result column="operator_header_url" property="operatorHeaderUrl" />
<result column="opinion" property="opinion" /> <result column="opinion" property="opinion" />
<result column="sts" property="sts" /> <result column="sts" property="sts" />
<result column="read_status" property="readStatus" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="signature_img" property="signatureImg" /> <result column="signature_img" property="signatureImg" />
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
operator_header_url, operator_header_url,
opinion, opinion,
sts, sts,
read_status,
create_time, create_time,
update_time, update_time,
signature_img, signature_img,
...@@ -138,5 +140,9 @@ ...@@ -138,5 +140,9 @@
</select> </select>
--> -->
<select id="executor" resultMap="BaseResultMap">
select
</select>
</mapper> </mapper>
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