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 = "接口发布说明")
......
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();
}*/
}
...@@ -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;
}
}
...@@ -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