Commit dc887489 by tangzhaoqian Committed by chenzg

审批模块:审批模块重构,审批模块数据库设计。审批模板,自定义审批,可见审批发起人,增删查改相关功能完成,

parent 111c11ef
package cn.timer.api.bean.spmk;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approval_g")
@ApiModel("审批组")
public class SpmkApprovalG extends Model<SpmkApprovalG> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101")
private Integer orgCode;
@ApiModelProperty(value = "组名 ", example = "组名")
private String name;
@ApiModelProperty(value = "排序 排序", example = "101")
private Integer ranks;
@ApiModelProperty(value = "是否可编辑 0是 1否", example = "101")
private Integer isEditable;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approval_template")
@ApiModel("员工登录表")
public class SpmkApprovalTemplate extends Model<SpmkApprovalTemplate> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "审批模板组id 当前用户ID", example = "101")
private Integer approvalTemplateGId;
@ApiModelProperty(value = "审批图标地址 ", example = "审批图标地址")
private String iconUrl;
@ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String name;
@ApiModelProperty(value = "审批说明 ", example = "审批说明")
private String description;
@ApiModelProperty(value = "审批开关 0启用 1停用", example = "101")
private Integer isOpen;
@ApiModelProperty(value = "排序 由于区分关键字,命名后缀加s", example = "101")
private Integer ranks;
@ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101")
private Integer isOpinion;
@ApiModelProperty(value = "更新时间 ", example = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
@ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "1")
private Integer assoType;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private byte[] froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private byte[] router;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approval_template_g")
@ApiModel("审批模板组")
public class SpmkApprovalTemplateG extends Model<SpmkApprovalTemplateG> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "组名 ", example = "组名")
private String name;
@ApiModelProperty(value = "排序 排序", example = "101")
private Integer ranks;
@ApiModelProperty(value = "编辑时间 ", example = "编辑时间")
private Date updateTime;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approve_detail")
@ApiModel("审批详情")
public class SpmkApproveDetail extends Model<SpmkApproveDetail> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "审批汇总id 审批汇总id", example = "101")
private Integer approveSummaryId;
@ApiModelProperty(value = "标题 ", example = "标题")
private String name;
@ApiModelProperty(value = "所在部门名称 ", example = "所在部门名称")
private String departmentName;
@ApiModelProperty(value = "申请数据 ", example = "申请数据")
private byte[] requestData;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private byte[] froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private byte[] router;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approve_execute_record")
@ApiModel("审批执行记录")
public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "审批汇总id 审批汇总id", example = "101")
private Integer approveSummaryId;
@ApiModelProperty(value = "名称 ", example = "发起申请 1抄送人 审批人 连续多级主管")
private String name;
@ApiModelProperty(value = "类型 0发起申请 1抄送人 2审批人 3连续多级主管", example = "101")
private Integer type;
@ApiModelProperty(value = "状态 0未执行 1审批中 2同意 3拒绝", example = "101")
private Integer sts;
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approve_summary")
@ApiModel("审批汇总")
public class SpmkApproveSummary extends Model<SpmkApproveSummary> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "审批编号 审批编号", example = "101")
private Integer id;
@ApiModelProperty(value = "企业组织代码", example = "123")
private Integer orgCode;
@ApiModelProperty(value = "发起人id 用于搜索(所在部门)", example = "101")
private Integer empNum;
@ApiModelProperty(value = "标题 ", example = "标题")
private String title;
@ApiModelProperty(value = "所在部门名称 ", example = "所在部门名称")
private String departmentName;
@ApiModelProperty(value = "发起人名称 ", example = "发起人名称")
private String initiator;
@ApiModelProperty(value = "发起时间 ", example = "发起时间")
private Date createTime;
@ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String approveName;
@ApiModelProperty(value = "状态 0审批中 1审批撤销 2审批拒绝 3审批通过/审批完成", example = "101")
private Integer sts;
@ApiModelProperty(value = "当前审批人 ", example = "当前审批人")
private String currentApprover;
@ApiModelProperty(value = "历史审批人 ", example = "历史审批人")
private String historyApprover;
@ApiModelProperty(value = "最近处理时间 ", example = "最近处理时间")
private Date updateTime;
@ApiModelProperty(value = "结束时间 ", example = "结束时间")
private Date endTime;
@ApiModelProperty(value = "摘要 ", example = "摘要")
private String digest;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_custom_approval")
@ApiModel("自定义审批")
public class SpmkCustomApproval extends Model<SpmkCustomApproval> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101")
private Integer orgCode;
@ApiModelProperty(value = "审批组id 当前用户ID", example = "101")
private Integer approvalGId;
@ApiModelProperty(value = "审批图标地址 ", example = "审批图标地址")
private String iconUrl;
@ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String name;
@ApiModelProperty(value = "审批说明 ", example = "审批说明")
private String description;
@ApiModelProperty(value = "审批开关 0启用 1停用", example = "101")
private Integer isOpen;
@ApiModelProperty(value = "排序 排序", example = "101")
private Integer ranks;
@ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101")
private Integer isOpinion;
@ApiModelProperty(value = "更新时间 ", example = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
@ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "1")
private Integer assoType;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private byte[] froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private byte[] router;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_executor")
@ApiModel("执行人")
public class SpmkExecutor extends Model<SpmkExecutor> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "审批执行记录id 审批执行记录id", example = "101")
private Integer approveExecuteRecordId;
@ApiModelProperty(value = "执行人id 执行人id", example = "101")
private Integer empNum;
@ApiModelProperty(value = "执行人名称 ", example = "执行人名称")
private String executorName;
@ApiModelProperty(value = "执行人头像url ", example = "执行人头像url")
private String operatorHeaderUrl;
@ApiModelProperty(value = "意见 ", example = "意见")
private String opinion;
@ApiModelProperty(value = "状态 0未执行 1执行中 2同意 3拒接", example = "101")
private Integer sts;
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
}
\ No newline at end of file
package cn.timer.api.bean.spmk;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 审批发起人配置
*
* @author Tang 2020-04-17
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "spmk_approve_execute_record")
@ApiModel("审批执行记录")
public class SpmkInitiatorConfig extends Model<SpmkInitiatorConfig> {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
@ApiModelProperty(value = "编号 ", example = "1")
private Integer id;
/**
* 自定义审批id
*/
@ApiModelProperty(value = "自定义审批id", example = "100")
private Integer customApprovalId;
/**
* 关联id
*/
@ApiModelProperty(value = "关联id", example = "100")
private Integer assoId;
/**
* 类型
*/
@ApiModelProperty(value = "类型", example = "100")
private Integer type;
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -27,8 +28,14 @@ import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
import cn.timer.api.bean.spmk.SpmkApproveDetail;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.spmk.SpmkCustomApproval;
import cn.timer.api.bean.spmk.SpmkIcon;
import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
import cn.timer.api.bean.spmk.SpmkJqgz;
import cn.timer.api.bean.spmk.SpmkLcjd;
import cn.timer.api.bean.spmk.SpmkLcjdEmpAsso;
......@@ -41,11 +48,24 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dao.spmk.SpmkApprovalGMapper;
import cn.timer.api.dao.spmk.SpmkApprovalTemplateGMapper;
import cn.timer.api.dao.spmk.SpmkApprovalTemplateMapper;
import cn.timer.api.dao.spmk.SpmkApproveDetailMapper;
import cn.timer.api.dao.spmk.SpmkApproveExecuteRecordMapper;
import cn.timer.api.dao.spmk.SpmkApproveSummaryMapper;
import cn.timer.api.dao.spmk.SpmkCustomApprovalMapper;
import cn.timer.api.dao.spmk.SpmkExecutorMapper;
import cn.timer.api.dao.spmk.SpmkInitiatorConfigMapper;
import cn.timer.api.dao.spmk.SpmkSpglMapper;
import cn.timer.api.dao.spmk.SpmkSpzMapper;
import cn.timer.api.dto.spmk.SpmkMbKjDto;
import cn.timer.api.dto.spmk.Router;
import cn.timer.api.dto.spmk.Spmk;
import cn.timer.api.dto.spmk.SpmkApprovalTemplateDto;
import cn.timer.api.dto.spmk.SpmkApproveDetailDto;
import cn.timer.api.dto.spmk.SpmkApproveSummaryDto;
import cn.timer.api.dto.spmk.SpmkCustomApprovalDto;
import cn.timer.api.dto.spmk.SpmkMbKjDto;
import cn.timer.api.dto.spmk.SpmkSpglDto;
import cn.timer.api.dto.spmk.SpmkSpglMoveDto;
import cn.timer.api.dto.spmk.SpmkSpglSortDto;
......@@ -69,12 +89,6 @@ public class SpmkServiceImpl {
private SpmkSpglMapper spmkSpglMapper;
@Autowired
private SpmkSpzMapper spmkSpzMapper;
// @Autowired
// private SpmkLcjdMapper spmkLcjdMapper;
// @Autowired
// private SpmkSxpzMapper spmkSxpzMapper;
// @Autowired
// private SpmkLcjdEmpAssoMapper spmkLcjdEmpAssoMapper;
/**
* 审批组-列表
......@@ -415,89 +429,374 @@ public class SpmkServiceImpl {
/**
* 流程节点解析
*/
@PostMapping(value = "/jsonparse")
@ApiOperation(value = "流程节点解析", httpMethod = "POST", notes = "流程节点解析")
// @PostMapping(value = "/jsonparse")
// @ApiOperation(value = "流程节点解析", httpMethod = "POST", notes = "流程节点解析")
// @ApiOperationSupport(order = 1)
// public Result<Object> jsonToObj(@RequestBody Object jsonObj){
//
// JSONObject obj = JSONUtil.parseObj(jsonObj, false, true);
//
// Router Router = obj.get("router", Router.class);
//
// Console.log("obj:" + obj.toStringPretty());
// Console.log("Router:" + Router.toPrettyString());
// Console.log("Router:" + Router.toJSONString());
//
// return ResultUtil.success("解析成功!");
// }
/**
* 部门id 查询 员工
*/
@PostMapping(value = "/deptSelectEmp")
@ApiOperation(value = "部门id 查询 员工", httpMethod = "POST", notes = "流程节点解析_plus")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj(@RequestBody Object jsonObj){
JSONObject obj = JSONUtil.parseObj(jsonObj, false, true);
public Result<Object> selectEmpBydept(@RequestParam Integer id){
List<YgglMainEmp> ygglMainEmp = RouterUtils.selectOtherlistent(4,id);
return ResultUtil.data(ygglMainEmp, "解析成功!");
}
/**
* 流程节点解析123
*/
@PostMapping(value = "/jsonparse_plus_plus")
@ApiOperation(value = "jsonparse_plus_plus", httpMethod = "POST", notes = "流程节点解析_plus")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj123(@CurrentUser UserBean userBean, @RequestBody Spmk spmk){
Router Router = obj.get("router", Router.class);
Console.log("obj:" + obj.toStringPretty());
Console.log("Router:" + Router.toPrettyString());
Console.log("Router:" + Router.toJSONString());
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(spmk.getRouter());
JSONObject jSONObject = spmk.getData();
jSONObject.put("orgCode", userBean.getOrgCode());
return ResultUtil.success("解析成功!");
return ResultUtil.data(RouterUtils.NextNode(listRouter, jSONObject), "解析成功!");
}
@Autowired
private SpmkApprovalTemplateGMapper spmkApprovalTemplateGMapper;
@Autowired
private SpmkApprovalTemplateMapper spmkApprovalTemplateMapper;
@Autowired
private SpmkApprovalGMapper spmkApprovalGMapper;
@Autowired
private SpmkCustomApprovalMapper spmkCustomApprovalMapper;
//TODO 审批模板组
/**
* 流程节点解析
* 新增或编辑-审批模板组
*/
@PostMapping(value = "/jsonparse_plus")
@ApiOperation(value = "流程节点解析_plus", httpMethod = "POST", notes = "流程节点解析_plus")
@PostMapping(value = "/save_approval_template_g")
@ApiOperation(value = "新增或编辑-审批模板组", httpMethod = "POST", notes = "新增或编辑-审批模板组")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj2(@RequestBody Router jsonObj){
public Result<Object> saveAtg(@RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG){
Console.log("jsonObj:" + jsonObj);
Console.log("jsonObj:" + jsonObj.getChildren());
return spmkApprovalTemplateG.insertOrUpdate() ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
return ResultUtil.data(jsonObj, "解析成功!");
}
/**
* 流程节点解析
* 删除-审批模板组
*/
@PostMapping(value = "/jsonparse_plusx")
@ApiOperation(value = "流程节点解析_plus", httpMethod = "POST", notes = "流程节点解析_plus")
@DeleteMapping(value = "/delete_approval_template_g/{id}")
@ApiOperation(value = "删除-审批模板组", httpMethod = "DELETE", notes = "删除-审批模板组")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj3(@RequestBody Object jsonObj){
public Result<Object> deleteAtgById(@PathVariable int id){
JSONObject obj = JSONUtil.parseObj(jsonObj, false, true);
obj.put("orgCode", 4);
Console.log("jsonObj:" + obj.get("name"));
Console.log("jsonObj:" + obj.get("id"));
Console.log("jsonObj:" + obj.get("aaa"));
return SpmkApprovalTemplateG.builder().id(id).build().deleteById() ? ResultUtil.success("操作成功!") : ResultUtil.error("没有找到该对象");
return ResultUtil.data(jsonObj, "解析成功!");
}
/**
* 部门id 查询 员工
* 查询列表-审批模板组
*/
@PostMapping(value = "/deptSelectEmp")
@ApiOperation(value = "部门id 查询 员工", httpMethod = "POST", notes = "流程节点解析_plus")
@GetMapping(value = "/list_approval_template_g")
@ApiOperation(value = "查询列表-审批模板组", httpMethod = "GET", notes = "查询列表-审批模板组")
@ApiOperationSupport(order = 1)
public Result<Object> selectEmpBydept(@RequestParam Integer id){
List<YgglMainEmp> ygglMainEmp = RouterUtils.selectOtherlistent(4,id);
return ResultUtil.data(ygglMainEmp, "解析成功!");
public Result<Object> selectListAtg(){
return ResultUtil.data(spmkApprovalTemplateGMapper.selectListAtInAtg(),"操作成功!");
}
/**
* 排序-审批模板组
*/
@PutMapping(value = "/list_approval_template_g")
@ApiOperation(value = "排序-审批模板组", httpMethod = "PUT", notes = "排序-审批模板组")
@ApiOperationSupport(order = 1)
public Result<Object> ranksAtg(@PathVariable List<SpmkApprovalTemplateG> list){
return spmkApprovalTemplateGMapper.updateListRandsById(list) ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
}
//TODO 审批模板
/**
* 新增或编辑-审批模板
*/
@PostMapping(value = "/save_approval_template")
@ApiOperation(value = "新增或编辑-审批模板", httpMethod = "POST", notes = "新增或编辑-审批模板")
@ApiOperationSupport(order = 1)
public Result<Object> saveAt(@RequestBody SpmkApprovalTemplateDto spmkApprovalTemplateDto){
Integer approvalTemplateGId = spmkApprovalTemplateDto.getApprovalTemplateGId();
if (ObjectUtil.isNull(approvalTemplateGId))
return ResultUtil.error("操作失败!-1");
SpmkApprovalTemplate at = SpmkApprovalTemplate.builder().build();
BeanUtil.copyProperties(spmkApprovalTemplateDto, at , "froms","router");
at.setFroms(ObjectUtil.serialize(spmkApprovalTemplateDto.getFroms()));
at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter()));
return at.insertOrUpdate() ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!-2");
}
/**
* 删除-审批模板
*/
@DeleteMapping(value = "/delete_approval_template/{id}")
@ApiOperation(value = "删除-审批模板", httpMethod = "DELETE", notes = "删除-审批模板")
@ApiOperationSupport(order = 1)
public Result<Object> deleteAtById(@PathVariable int id){
return SpmkApprovalTemplate.builder().id(id).build().deleteById() ? ResultUtil.success("操作成功!") : ResultUtil.error("没有找到该对象");
}
/**
* id查询-审批模板
*/
@GetMapping(value = "/select_approval_template")
@ApiOperation(value = "id查询-审批模板", httpMethod = "GET", notes = "id查询-审批模板")
@ApiOperationSupport(order = 1)
public Result<Object> selectAtById(@PathVariable int id){
return ResultUtil.data(SpmkApprovalTemplate.builder().id(id).build().selectById(),"操作成功!");
}
/**
* 排序-审批模板
*/
@PutMapping(value = "/list_approval_template_g")
@ApiOperation(value = "查询列表-审批模板组", httpMethod = "PUT", notes = "查询列表-审批模板组")
@ApiOperationSupport(order = 1)
public Result<Object> ranksAt(@PathVariable List<SpmkApprovalTemplate> list){
return spmkApprovalTemplateMapper.updateListRandsById(list) ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
}
//TODO 审批组
/**
* 流程节点解析123
* 新增或编辑-审批组
*/
@PostMapping(value = "/jsonparse_plus_plus")
@ApiOperation(value = "流程节点解析_plus", httpMethod = "POST", notes = "流程节点解析_plus")
@PostMapping(value = "/save_approval_g")
@ApiOperation(value = "新增或编辑-审批组", httpMethod = "POST", notes = "新增或编辑-审批组")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj123(@RequestBody Spmk spmk){
public Result<Object> saveAg(@CurrentUser UserBean userBean,@RequestBody SpmkApprovalG spmkApprovalG){
spmkApprovalG.setOrgCode(userBean.getOrgCode());
return spmkApprovalG.insertOrUpdate() ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(spmk.getRouter());
}
/**
* 删除-审批组
*/
@DeleteMapping(value = "/delete_approval_g/{id}")
@ApiOperation(value = "删除-审批组", httpMethod = "DELETE", notes = "删除-审批组")
@ApiOperationSupport(order = 1)
public Result<Object> deleteAgById(@PathVariable int id){
return SpmkApprovalG.builder().id(id).build().deleteById() ? ResultUtil.success("操作成功!") : ResultUtil.error("没有找到该对象");
return ResultUtil.data(RouterUtils.NextNode(listRouter, spmk.getData()), "解析成功!");
}
/**
* 查询列表-审批组
*/
@GetMapping(value = "/list_approval_g")
@ApiOperation(value = "查询列表-审批组", httpMethod = "GET", notes = "查询列表-审批组")
@ApiOperationSupport(order = 1)
public Result<Object> selectListAg(@CurrentUser UserBean userBean){
return ResultUtil.data(spmkApprovalGMapper.selectListAgInCa(userBean.getOrgCode(), userBean.getEmpNum()),"操作成功!");
}
/**
* 排序-审批组
*/
@PutMapping(value = "/list_approval_template_g")
@ApiOperation(value = "排序-审批组", httpMethod = "PUT", notes = "排序-审批组")
@ApiOperationSupport(order = 1)
public Result<Object> ranksAg(@PathVariable List<SpmkApprovalG> list){
return spmkApprovalGMapper.updateListRandsById(list) ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
}
//TODO 自定义审批
/**
* 新增或编辑-自定义审批
*/
@PostMapping(value = "/save_custom_approval")
@ApiOperation(value = "新增或编辑-自定义审批", httpMethod = "POST", notes = "新增或编辑-自定义审批")
@ApiOperationSupport(order = 1)
@Transactional(rollbackFor = Exception.class)
public Result<Object> saveCa(@RequestBody SpmkCustomApprovalDto spmkCustomApprovalDto) throws Exception{
Integer approvalGId = spmkCustomApprovalDto.getApprovalGId();
if (ObjectUtil.isNull(approvalGId))
return ResultUtil.error("操作失败!-1");
SpmkCustomApproval ca = SpmkCustomApproval.builder().build();
BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs");
ca.setFroms(ObjectUtil.serialize(spmkCustomApprovalDto.getFroms()));
ca.setRouter(ObjectUtil.serialize(spmkCustomApprovalDto.getRouter()));
if (!ca.insertOrUpdate())
return ResultUtil.error("操作失败!-2");
Integer id = ca.getId();
Console.log("自定义审批id: " + id);
List<SpmkInitiatorConfig> listIc = spmkCustomApprovalDto.getInitiatorConfigs();
for (int i = 0, n = listIc.size(); i < n; i++) {
listIc.get(i).setCustomApprovalId(id);
}
//
/**
* 注意: 为保证该api的原子性 要加 事务处理 回滚(方法注解-@Transactional(rollbackFor = Exception.class))
* 1.删除 历史的 SpmkInitiatorConfig-审批发起人配置,
* 2.新增 最新的 SpmkInitiatorConfig-审批发起人配置,
* 3.新增 SpmkCustomApproval-自定义审批
*/
if (!SpmkInitiatorConfig.builder().build().delete(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id)) ||
!spmkInitiatorConfigMapper.insertList(listIc)) {
// 手动抛出异常,事务回滚
throw new Exception();
}
return ResultUtil.success("操作成功!");
}
/**
* 删除-自定义审批
*/
@DeleteMapping(value = "/delete_custom_approval/{id}")
@ApiOperation(value = "删除-自定义审批", httpMethod = "DELETE", notes = "删除-自定义审批")
@ApiOperationSupport(order = 1)
public Result<Object> deleteCaById(@PathVariable int id){
return SpmkCustomApproval.builder().id(id).build().deleteById() &&
SpmkInitiatorConfig.builder().build().delete(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id)) ?
ResultUtil.success("操作成功!") : ResultUtil.error("没有找到该对象");
}
/**
* id查询-自定义审批
*/
@GetMapping(value = "/select_custom_approval")
@ApiOperation(value = "id查询-审批模板", httpMethod = "GET", notes = "id查询-审批模板")
@ApiOperationSupport(order = 1)
public Result<Object> selectCaById(@PathVariable int id){
return ResultUtil.data(SpmkCustomApproval.builder().id(id).build().selectById(),"操作成功!");
}
/**
* 排序-自定义审批
*/
@PutMapping(value = "/list_custom_approval")
@ApiOperation(value = "查询列表-审批模板组", httpMethod = "PUT", notes = "查询列表-审批模板组")
@ApiOperationSupport(order = 1)
public Result<Object> ranksCa(@PathVariable List<SpmkCustomApproval> list){
return spmkCustomApprovalMapper.updateListRandsById(list) ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
}
@Autowired
private SpmkApproveSummaryMapper spmkApproveSummaryMapper;
@Autowired
private SpmkApproveDetailMapper spmkApproveDetailMapper;
@Autowired
private SpmkApproveExecuteRecordMapper spmkApproveExecuteRecordMapper;
@Autowired
private SpmkExecutorMapper spmkExecutorMapper;
@Autowired
private SpmkInitiatorConfigMapper spmkInitiatorConfigMapper;
// TODO 审批汇总(发起审批)
/**
* 发起审批
*/
@PostMapping(value = "/start_approval")
@ApiOperation(value = "新增或编辑-自定义审批", httpMethod = "POST", notes = "新增或编辑-自定义审批")
@ApiOperationSupport(order = 1)
public Result<Object> saveCa(@CurrentUser UserBean userBean, @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto){
SpmkApproveSummary as = spmkApproveSummaryDto.getSpmkApproveSummary();
as.setOrgCode(userBean.getOrgCode());
// 待补充
SpmkApproveDetailDto adD = spmkApproveSummaryDto.getSpmkApproveDetailDto();
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(spmkApproveSummaryDto.getSpmkApproveDetailDto().getRouter());
JSONObject jSONObject = spmkApproveSummaryDto
.getSpmkApproveDetailDto()
.getRequestData()
.put("orgCode", userBean.getOrgCode());
SpmkApproveDetail ad = SpmkApproveDetail.builder().build();
BeanUtil.copyProperties(adD, ad , "requestData","froms","router");
ad.setRequestData(ObjectUtil.serialize(adD.getRequestData()));
ad.setFroms(ObjectUtil.serialize(adD.getFroms()));
ad.setRouter(ObjectUtil.serialize(adD.getRouter()));
// Integer approvalGId = spmkCustomApproval.getApprovalGId();
//
// if (approvalGId == null || approvalGId.equals("")) {
// return ResultUtil.error("操作失败!-1");
// }
return null;
// return spmkCustomApproval.insertOrUpdate() ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!-2");
}
}
package cn.timer.api.dao.spmk;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkApprovalG;
/**
* 审批组
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkApprovalGMapper extends BaseMapper<SpmkApprovalG> {
List<SpmkApprovalG> selectListAgInCa(@Param("org_code") Integer org_code, @Param("emp_num") Integer emp_num);
boolean updateListRandsById(List<SpmkApprovalG> list);
}
package cn.timer.api.dao.spmk;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
import cn.timer.api.dto.spmk.SpmkApprovalTemplateGDto;
/**
* 审批模板组
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkApprovalTemplateGMapper extends BaseMapper<SpmkApprovalTemplateG> {
SpmkApprovalTemplateGDto selectListAtInAtg();
boolean updateListRandsById(List<SpmkApprovalTemplateG> list);
}
package cn.timer.api.dao.spmk;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
/**
* 员工登录表
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkApprovalTemplateMapper extends BaseMapper<SpmkApprovalTemplate> {
boolean updateListRandsById(List<SpmkApprovalTemplate> list);
}
package cn.timer.api.dao.spmk;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkApproveDetail;
/**
* 审批详情
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkApproveDetailMapper extends BaseMapper<SpmkApproveDetail> {
}
package cn.timer.api.dao.spmk;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
/**
* 审批执行记录
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkApproveExecuteRecordMapper extends BaseMapper<SpmkApproveExecuteRecord> {
}
package cn.timer.api.dao.spmk;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
/**
* 审批汇总
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkApproveSummaryMapper extends BaseMapper<SpmkApproveSummary> {
}
package cn.timer.api.dao.spmk;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkCustomApproval;
/**
* 自定义审批
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkCustomApprovalMapper extends BaseMapper<SpmkCustomApproval> {
boolean updateListRandsById(List<SpmkCustomApproval> list);
}
package cn.timer.api.dao.spmk;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkExecutor;
/**
* 执行人
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkExecutorMapper extends BaseMapper<SpmkExecutor> {
}
package cn.timer.api.dao.spmk;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
/**
* 审批发起人配置
*
* @author Tang 2020-04-17
*/
@Repository
public interface SpmkInitiatorConfigMapper extends BaseMapper<SpmkInitiatorConfig> {
boolean insertList(List<SpmkInitiatorConfig> listIc);
}
package cn.timer.api.dto.spmk;
import java.util.List;
import javax.persistence.Entity;
import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.bean.spmk.SpmkCustomApproval;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SpmkApprovalGDto extends SpmkApprovalG {
/**
*
*/
private static final long serialVersionUID = 1L;
private List<SpmkCustomApproval> spmkCustomApprovals;
}
package cn.timer.api.dto.spmk;
import java.util.Date;
import javax.persistence.Entity;
import cn.hutool.json.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SpmkApprovalTemplateDto {
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "审批模板组id 当前用户ID", example = "101")
private Integer approvalTemplateGId;
@ApiModelProperty(value = "审批图标地址 ", example = "审批图标地址")
private String iconUrl;
@ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String name;
@ApiModelProperty(value = "审批说明 ", example = "审批说明")
private String description;
@ApiModelProperty(value = "审批开关 0启用 1停用", example = "101")
private Integer isOpen;
@ApiModelProperty(value = "排序 由于区分关键字,命名后缀加s", example = "101")
private Integer ranks;
@ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101")
private Integer isOpinion;
@ApiModelProperty(value = "更新时间 ", example = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
@ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "2")
private Integer assoType;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private JSONObject froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private Router router;
}
package cn.timer.api.dto.spmk;
import java.util.List;
import javax.persistence.Entity;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SpmkApprovalTemplateGDto extends SpmkApprovalTemplateG{
/**
*
*/
private static final long serialVersionUID = 1L;
private List<SpmkApprovalTemplate> spmkApprovalTemplates;
}
package cn.timer.api.dto.spmk;
import javax.persistence.Entity;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApproveDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SpmkApproveDetailDto {
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "审批汇总id 审批汇总id", example = "101")
private Integer approveSummaryId;
@ApiModelProperty(value = "标题 ", example = "标题")
private String name;
@ApiModelProperty(value = "所在部门名称 ", example = "所在部门名称")
private String departmentName;
@ApiModelProperty(value = "申请数据 ", example = "申请数据")
private JSONObject requestData;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private JSONObject froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private Router router;
}
package cn.timer.api.dto.spmk;
import java.util.Date;
import javax.persistence.Entity;
import cn.timer.api.bean.spmk.SpmkApproveDetail;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SpmkApproveSummaryDto{
private SpmkApproveSummary spmkApproveSummary;
private SpmkApproveDetailDto spmkApproveDetailDto;
}
package cn.timer.api.dto.spmk;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SpmkCustomApprovalDto {
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101")
private Integer orgCode;
@ApiModelProperty(value = "审批组id 当前用户ID", example = "101")
private Integer approvalGId;
@ApiModelProperty(value = "审批图标地址 ", example = "审批图标地址")
private String iconUrl;
@ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String name;
@ApiModelProperty(value = "审批说明 ", example = "审批说明")
private String description;
@ApiModelProperty(value = "审批开关 0启用 1停用", example = "101")
private Integer isOpen;
@ApiModelProperty(value = "排序 排序", example = "101")
private Integer ranks;
@ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101")
private Integer isOpinion;
@ApiModelProperty(value = "更新时间 ", example = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
@ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "1")
private Integer assoType;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private JSONObject froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private Router router;
@ApiModelProperty(value = "可见发起人配置 ", example = "可见发起人配置 ")
private List<SpmkInitiatorConfig> initiatorConfigs;
}
......@@ -2,29 +2,15 @@ package cn.timer.api.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zcgl.ZcglAssoZcgx;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.spmk.Condition;
import cn.timer.api.dto.spmk.Relation;
import cn.timer.api.dto.spmk.Router;
......@@ -57,6 +43,10 @@ public class RouterUtils {
// 非条件节点
if (listRouter.size() == 1) {
router = listRouter.get(0);
if (router.getExecute() == null) {
System.out.println("默认UNEXECUTED");
router.setExecute(UNEXECUTED);
}
// 0未执行 1执行中 2已执行
switch (router.getExecute()) {
case UNEXECUTED:
......@@ -86,9 +76,6 @@ public class RouterUtils {
break;
}
}
break;
case COPY:
Console.log("抄送人逻辑");
......@@ -107,9 +94,9 @@ public class RouterUtils {
user.setId(String.valueOf(emp.getEmpNum()));
listUsers.add(user);
}
listRelations.get(i).setUsers(listUsers);
}else if (RELATION_TYPE_USERS.equals(listRelations.get(i).getType())) {
// 直接跳过,此处 else if代码段 只做说明,可不写
}
}
NextNode(router.getChildren(),obj);
......@@ -122,7 +109,6 @@ public class RouterUtils {
switch (router.getClassName()) {
case AUDIT:
Console.log("下一个审批人逻辑");
router.setFlow(true);
boolean executeFlog = true;
List<User> listUser = router.getRelation().get(0).getUsers();
......@@ -198,7 +184,7 @@ public class RouterUtils {
};
// 执行下一个节点
public static List<Router> NextNodeing(List<Router> listRouter,JSONObject obj) {
public static List<Router> NextNode_bak(List<Router> listRouter,JSONObject obj) {
Router router;
if (listRouter != null && listRouter.size() != 0) {
......@@ -234,9 +220,6 @@ public class RouterUtils {
break;
}
}
break;
case COPY:
Console.log("抄送人逻辑");
......@@ -280,15 +263,14 @@ public class RouterUtils {
switch (execute) {
case UNEXECUTED:
listUser.get(i).setExecute(EXECUTING);
if (!EXECUTED.equals(listUser.get(i).getExecute())) {
executeFlog = false;
}
break user;
case EXECUTING:
listUser.get(i).setExecute(EXECUTED);
break;
}
if (!EXECUTED.equals(listUser.get(i).getExecute())) {
executeFlog = false;
}
}
if (executeFlog) {
router.setExecute(EXECUTED);
......
<?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.SpmkApprovalGMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApprovalG" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
<result column="is_editable" property="isEditable" />
</resultMap>
<resultMap id="BaseResultMapDto" type="cn.timer.api.dto.spmk.SpmkApprovalGDto" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
<result column="is_editable" property="isEditable" />
<collection column="SpmkCustomApproval_id" property="spmkCustomApprovals" ofType="cn.timer.api.bean.spmk.SpmkCustomApproval"
resultMap="cn.timer.api.bean.spmk.SpmkCustomApproval.BaseResultMap" columnPrefix="SpmkCustomApproval_">
</collection>
</resultMap>
<sql id="Base_Column_List">
id,
org_code,
name,
ranks,
is_editable
</sql>
<sql id="Base_Column_List_Alias">
id SpmkApprovalG_id,
org_code SpmkApprovalG_org_code,
name SpmkApprovalG_name,
ranks SpmkApprovalG_ranks,
is_editable SpmkApprovalG_is_editable
</sql>
<sql id="Base_Column_List_Alias_ca">
id SpmkCustomApproval_id,
org_code SpmkCustomApproval_org_code,
approval_g_id SpmkCustomApproval_approval_g_id,
icon_url SpmkCustomApproval_icon_url,
name SpmkCustomApproval_name,
description SpmkCustomApproval_description,
is_open SpmkCustomApproval_is_open,
ranks SpmkCustomApproval_ranks,
is_opinion SpmkCustomApproval_is_opinion,
update_time SpmkCustomApproval_update_time,
create_time SpmkCustomApproval_create_time,
asso_type SpmkCustomApproval_asso_type,
froms SpmkCustomApproval_froms,
router SpmkCustomApproval_router
</sql>
<select id="selectListAgInCa" resultMap="BaseResultMapDto">
SELECT
<include refid="Base_Column_List_Alias" />,
<include refid="Base_Column_List_Alias_ca" />
FROM spmk_approval_g a
LEFT JOIN spmk_custom_approval b IN a.id = b.approval_g_id
WHERE b.org_code = #{org_code} AND b.id in
(
SELECT custom_approval_id FROM spmk_initiator_config WHERE emp_num = #{emp_num} GROUP BY custom_approval_id
)
</select>
<update id="updateListRandsById" parameterType="list">
<foreach item="item" index="index" collection="list" open="" separator=";" close="">
UPDATE spmk_approval_template_g
<set>
<if test ='null != item.ranks'>ranks = #{item.ranks},</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkApprovalG">
INSERT INTO spmk_approval_g
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != name'>
name,
</if>
<if test ='null != ranks'>
ranks,
</if>
<if test ='null != isEditable'>
is_editable
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != name'>
#{name},
</if>
<if test ='null != ranks'>
#{ranks},
</if>
<if test ='null != isEditable'>
#{isEditable}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM spmk_approval_g
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApprovalG">
UPDATE spmk_approval_g
<set>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != name'>name = #{name},</if>
<if test ='null != ranks'>ranks = #{ranks},</if>
<if test ='null != isEditable'>is_editable = #{isEditable}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approval_g
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approval_g
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM spmk_approval_g
</select>
-->
</mapper>
\ No newline at end of file
<?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.SpmkApprovalTemplateGMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApprovalTemplateG" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
<result column="update_time" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMapDto" type="cn.timer.api.dto.spmk.SpmkApprovalTemplateGDto" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
<result column="update_time" property="updateTime" />
<collection column="SpmkApprovalTemplate_id" property="spmkApprovalTemplates" ofType="cn.timer.api.bean.spmk.SpmkApprovalTemplate"
resultMap="cn.timer.api.bean.spmk.SpmkApprovalTemplate.BaseResultMap" columnPrefix="SpmkApprovalTemplate_">
</collection>
</resultMap>
<sql id="Base_Column_List">
id,
name,
ranks,
update_time
</sql>
<sql id="Base_Column_List_Alias">
id SpmkApprovalTemplateG_id,
name SpmkApprovalTemplateG_name,
ranks SpmkApprovalTemplateG_ranks,
update_time SpmkApprovalTemplateG_update_time
</sql>
<sql id="Base_Column_List_Alias_at">
id SpmkApprovalTemplate_id,
approval_template_g_id SpmkApprovalTemplate_approval_template_g_id,
icon_url SpmkApprovalTemplate_icon_url,
name SpmkApprovalTemplate_name,
description SpmkApprovalTemplate_description,
is_open SpmkApprovalTemplate_is_open,
ranks SpmkApprovalTemplate_ranks,
is_opinion SpmkApprovalTemplate_is_opinion,
update_time SpmkApprovalTemplate_update_time,
create_time SpmkApprovalTemplate_create_time,
asso_type SpmkApprovalTemplate_asso_type,
froms SpmkApprovalTemplate_froms,
router SpmkApprovalTemplate_router
</sql>
<select id="selectListAtInAtg" resultMap="BaseResultMapDto">
SELECT
<include refid="Base_Column_List_Alias" />,
<include refid="Base_Column_List_Alias_at" />
FROM spmk_approval_template_g a
LEFT JOIN spmk_approval_template b IN a.id = b.approval_template_g_id
</select>
<update id="updateListRandsById" parameterType="list">
<foreach item="item" index="index" collection="list" open="" separator=";" close="">
UPDATE spmk_approval_template_g
<set>
<if test ='null != item.ranks'>ranks = #{item.ranks},</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkApprovalTemplateG">
INSERT INTO spmk_approval_template_g
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != name'>
name,
</if>
<if test ='null != ranks'>
ranks,
</if>
<if test ='null != updateTime'>
update_time
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != name'>
#{name},
</if>
<if test ='null != ranks'>
#{ranks},
</if>
<if test ='null != updateTime'>
#{updateTime}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM spmk_approval_template_g
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApprovalTemplateG">
UPDATE spmk_approval_template_g
<set>
<if test ='null != name'>name = #{name},</if>
<if test ='null != ranks'>ranks = #{ranks},</if>
<if test ='null != updateTime'>update_time = #{updateTime}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approval_template_g
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approval_template_g
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM spmk_approval_template_g
</select>
-->
</mapper>
\ No newline at end of file
<?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.SpmkApprovalTemplateMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApprovalTemplate" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="approval_template_g_id" property="approvalTemplateGId" />
<result column="icon_url" property="iconUrl" />
<result column="name" property="name" />
<result column="description" property="description" />
<result column="is_open" property="isOpen" />
<result column="ranks" property="ranks" />
<result column="is_opinion" property="isOpinion" />
<result column="update_time" property="updateTime" />
<result column="create_time" property="createTime" />
<result column="asso_type" property="assoType" />
<result column="froms" property="froms" />
<result column="router" property="router" />
</resultMap>
<sql id="Base_Column_List">
id,
approval_template_g_id,
icon_url,
name,
description,
is_open,
ranks,
is_opinion,
update_time,
create_time,
asso_type,
froms,
router
</sql>
<sql id="Base_Column_List_Alias">
id SpmkApprovalTemplate_id,
approval_template_g_id SpmkApprovalTemplate_approval_template_g_id,
icon_url SpmkApprovalTemplate_icon_url,
name SpmkApprovalTemplate_name,
description SpmkApprovalTemplate_description,
is_open SpmkApprovalTemplate_is_open,
ranks SpmkApprovalTemplate_ranks,
is_opinion SpmkApprovalTemplate_is_opinion,
update_time SpmkApprovalTemplate_update_time,
create_time SpmkApprovalTemplate_create_time,
asso_type SpmkApprovalTemplate_asso_type,
froms SpmkApprovalTemplate_froms,
router SpmkApprovalTemplate_router
</sql>
<update id="updateListRandsById" parameterType="list">
<foreach item="item" index="index" collection="list" open="" separator=";" close="">
UPDATE spmk_approval_template
<set>
<if test ='null != item.ranks'>ranks = #{item.ranks},</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkApprovalTemplate">
INSERT INTO spmk_approval_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != approvalTemplateGId'>
approval_template_g_id,
</if>
<if test ='null != iconUrl'>
icon_url,
</if>
<if test ='null != name'>
name,
</if>
<if test ='null != description'>
description,
</if>
<if test ='null != isOpen'>
is_open,
</if>
<if test ='null != ranks'>
ranks,
</if>
<if test ='null != isOpinion'>
is_opinion,
</if>
<if test ='null != updateTime'>
update_time,
</if>
<if test ='null != createTime'>
create_time,
</if>
<if test ='null != assoType'>
asso_type,
</if>
<if test ='null != froms'>
froms,
</if>
<if test ='null != router'>
router
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != approvalTemplateGId'>
#{approvalTemplateGId},
</if>
<if test ='null != iconUrl'>
#{iconUrl},
</if>
<if test ='null != name'>
#{name},
</if>
<if test ='null != description'>
#{description},
</if>
<if test ='null != isOpen'>
#{isOpen},
</if>
<if test ='null != ranks'>
#{ranks},
</if>
<if test ='null != isOpinion'>
#{isOpinion},
</if>
<if test ='null != updateTime'>
#{updateTime},
</if>
<if test ='null != createTime'>
#{createTime},
</if>
<if test ='null != assoType'>
#{assoType},
</if>
<if test ='null != froms'>
#{froms},
</if>
<if test ='null != router'>
#{router}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM spmk_approval_template
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApprovalTemplate">
UPDATE spmk_approval_template
<set>
<if test ='null != approvalTemplateGId'>approval_template_g_id = #{approvalTemplateGId},</if>
<if test ='null != iconUrl'>icon_url = #{iconUrl},</if>
<if test ='null != name'>name = #{name},</if>
<if test ='null != description'>description = #{description},</if>
<if test ='null != isOpen'>is_open = #{isOpen},</if>
<if test ='null != ranks'>ranks = #{ranks},</if>
<if test ='null != isOpinion'>is_opinion = #{isOpinion},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != assoType'>asso_type = #{assoType},</if>
<if test ='null != froms'>froms = #{froms},</if>
<if test ='null != router'>router = #{router}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approval_template
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approval_template
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM spmk_approval_template
</select>
-->
</mapper>
\ No newline at end of file
<?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.SpmkCustomApprovalMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkCustomApproval" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="approval_g_id" property="approvalGId" />
<result column="icon_url" property="iconUrl" />
<result column="name" property="name" />
<result column="description" property="description" />
<result column="is_open" property="isOpen" />
<result column="ranks" property="ranks" />
<result column="is_opinion" property="isOpinion" />
<result column="update_time" property="updateTime" />
<result column="create_time" property="createTime" />
<result column="asso_type" property="assoType" />
<result column="froms" property="froms" />
<result column="router" property="router" />
</resultMap>
<sql id="Base_Column_List">
id,
org_code,
approval_g_id,
icon_url,
name,
description,
is_open,
ranks,
is_opinion,
update_time,
create_time,
asso_type,
froms,
router
</sql>
<sql id="Base_Column_List_Alias">
id SpmkCustomApproval_id,
org_code SpmkCustomApproval_org_code,
approval_g_id SpmkCustomApproval_approval_g_id,
icon_url SpmkCustomApproval_icon_url,
name SpmkCustomApproval_name,
description SpmkCustomApproval_description,
is_open SpmkCustomApproval_is_open,
ranks SpmkCustomApproval_ranks,
is_opinion SpmkCustomApproval_is_opinion,
update_time SpmkCustomApproval_update_time,
create_time SpmkCustomApproval_create_time,
asso_type SpmkCustomApproval_asso_type,
froms SpmkCustomApproval_froms,
router SpmkCustomApproval_router
</sql>
<update id="updateListRandsById" parameterType="list">
<foreach item="item" index="index" collection="list" open="" separator=";" close="">
UPDATE spmk_custom_approval
<set>
<if test ='null != item.ranks'>ranks = #{item.ranks},</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkCustomApproval">
INSERT INTO spmk_custom_approval
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != approvalGId'>
approval_g_id,
</if>
<if test ='null != iconUrl'>
icon_url,
</if>
<if test ='null != name'>
name,
</if>
<if test ='null != description'>
description,
</if>
<if test ='null != isOpen'>
is_open,
</if>
<if test ='null != ranks'>
ranks,
</if>
<if test ='null != isOpinion'>
is_opinion,
</if>
<if test ='null != updateTime'>
update_time,
</if>
<if test ='null != createTime'>
create_time,
</if>
<if test ='null != assoType'>
asso_type,
</if>
<if test ='null != froms'>
froms,
</if>
<if test ='null != router'>
router
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != approvalGId'>
#{approvalGId},
</if>
<if test ='null != iconUrl'>
#{iconUrl},
</if>
<if test ='null != name'>
#{name},
</if>
<if test ='null != description'>
#{description},
</if>
<if test ='null != isOpen'>
#{isOpen},
</if>
<if test ='null != ranks'>
#{ranks},
</if>
<if test ='null != isOpinion'>
#{isOpinion},
</if>
<if test ='null != updateTime'>
#{updateTime},
</if>
<if test ='null != createTime'>
#{createTime},
</if>
<if test ='null != assoType'>
#{assoType},
</if>
<if test ='null != froms'>
#{froms},
</if>
<if test ='null != router'>
#{router}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM spmk_custom_approval
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkCustomApproval">
UPDATE spmk_custom_approval
<set>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != approvalGId'>approval_g_id = #{approvalGId},</if>
<if test ='null != iconUrl'>icon_url = #{iconUrl},</if>
<if test ='null != name'>name = #{name},</if>
<if test ='null != description'>description = #{description},</if>
<if test ='null != isOpen'>is_open = #{isOpen},</if>
<if test ='null != ranks'>ranks = #{ranks},</if>
<if test ='null != isOpinion'>is_opinion = #{isOpinion},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != assoType'>asso_type = #{assoType},</if>
<if test ='null != froms'>froms = #{froms},</if>
<if test ='null != router'>router = #{router}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_custom_approval
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_custom_approval
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM spmk_custom_approval
</select>
-->
</mapper>
\ No newline at end of file
<?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.SpmkInitiatorConfigMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkInitiatorConfig" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="custom_approval_id" property="customApprovalId" />
<result column="asso_id" property="assoId" />
<result column="type" property="type" />
</resultMap>
<sql id="Base_Column_List">
id,
custom_approval_id,
asso_id,
type
</sql>
<sql id="Base_Column_List_Alias">
id SpmkInitiatorConfig_id,
custom_approval_id SpmkInitiatorConfig_custom_approval_id,
asso_id SpmkInitiatorConfig_asso_id,
type SpmkInitiatorConfig_type
</sql>
<insert id="insertList" useGeneratedKeys="true" keyColumn="id" parameterType="list">
INSERT INTO spmk_initiator_config
(custom_approval_id,asso_id,type)
values
<foreach item="item" index="index" collection="list" open="" separator="," close="">
(
#{item.customApprovalId},#{item.assoId},#{item.type}
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkInitiatorConfig">
INSERT INTO spmk_initiator_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != customApprovalId'>
custom_approval_id,
</if>
<if test ='null != assoId'>
asso_id,
</if>
<if test ='null != type'>
type
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != customApprovalId'>
#{customApprovalId},
</if>
<if test ='null != assoId'>
#{assoId},
</if>
<if test ='null != type'>
#{type}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM spmk_initiator_config
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkInitiatorConfig">
UPDATE spmk_initiator_config
<set>
<if test ='null != customApprovalId'>custom_approval_id = #{customApprovalId},</if>
<if test ='null != assoId'>asso_id = #{assoId},</if>
<if test ='null != type'>type = #{type}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_initiator_config
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_initiator_config
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM spmk_initiator_config
</select>
-->
</mapper>
\ No newline at end of file
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