From 7f2be3d9ea7aacaf3eeb521822bfa6ad1ab095e4 Mon Sep 17 00:00:00 2001 From: tangzhaoqian <tangzhaoqian@youlingrc.com> Date: Thu, 7 May 2020 09:18:08 +0800 Subject: [PATCH] 权限、8个模板数据接口定义 --- src/main/java/cn/timer/api/aspect/BindingResultAspect.java | 45 +++++++++++++++++++++++++++++++++++++++------ src/main/java/cn/timer/api/aspect/lang/bean/ValidationError.java | 1 - src/main/java/cn/timer/api/bean/spmk/SpmkApprovalTemplate.java | 2 +- src/main/java/cn/timer/api/bean/spmk/SpmkApproveSummary.java | 2 +- src/main/java/cn/timer/api/bean/spmk/SpmkCustomApproval.java | 5 ++++- src/main/java/cn/timer/api/controller/qyzx/QyzxController.java | 1 - src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java | 64 ++++++++++++++++++++++++++++++++++++++++++---------------------- src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java | 2 +- src/main/java/cn/timer/api/dto/spmk/MySummaryQueryDto.java | 4 ++-- src/main/java/cn/timer/api/dto/spmk/SpmkApprovalTemplateDto.java | 2 +- src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java | 6 +++--- src/main/java/cn/timer/api/dto/spmk/SpmkCustomApprovalDto.java | 24 ++++++++++++++++++++++-- src/main/java/cn/timer/api/utils/router/RouterUtils.java | 2 +- src/main/java/cn/timer/api/utils/router/business/EvectionBusiness.java | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/LeaveBusiness.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/RecruitBusiness.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/RegularizationBusiness.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/ReissueACardBusiness.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/ResignationBusiness.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusiness.java | 16 ++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusinessFactory.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/TransferPositionBusiness.java | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/business/WorkOvertimeBusiness.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/cn/timer/api/utils/router/enums/ApproveEnum.java | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapping/spmk/SpmkApprovalGMapper.xml | 22 +++++++++++++++++----- src/main/resources/mapping/spmk/SpmkCustomApprovalMapper.xml | 10 ++++++++++ 26 files changed, 591 insertions(+), 48 deletions(-) create mode 100644 src/main/java/cn/timer/api/utils/router/business/EvectionBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/LeaveBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/RecruitBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/RegularizationBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/ReissueACardBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/ResignationBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusinessFactory.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/TransferPositionBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/business/WorkOvertimeBusiness.java create mode 100644 src/main/java/cn/timer/api/utils/router/enums/ApproveEnum.java diff --git a/src/main/java/cn/timer/api/aspect/BindingResultAspect.java b/src/main/java/cn/timer/api/aspect/BindingResultAspect.java index f81833d..cc8c0ca 100644 --- a/src/main/java/cn/timer/api/aspect/BindingResultAspect.java +++ b/src/main/java/cn/timer/api/aspect/BindingResultAspect.java @@ -37,25 +37,38 @@ import cn.timer.api.utils.ResultUtil; @Component public class BindingResultAspect { - // 配置织入点 + // @annotation配置织入点 @Pointcut("@annotation(cn.timer.api.aspect.lang.annotation.BindingResultCtrol)") public void bindingResultPointCut() { } + + // execution 配置织入点 + @Pointcut("execution(* cn.timer.api.controller.*.*.*(..))") + public void clazzPointCut() + { + } - @Before("bindingResultPointCut()") +// @Before("bindingResultPointCut()") public void doBefore(JoinPoint point) throws Throwable { //预留 // handleDataScope(point); } - @Around("bindingResultPointCut() && args(..,bindingResult)") - public Object doAround(ProceedingJoinPoint joinPoint,BindingResult bindingResult) throws Throwable { +// @Around("bindingResultPointCut() && args(..,bindingResult)") + @Around("clazzPointCut()") + public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable { Long startTime = System.currentTimeMillis(); Object retVal; - if(bindingResult.hasErrors()){ - List<ObjectError> ls = bindingResult.getAllErrors(); + Object[] objs = joinPoint.getArgs(); + List<Object> listObj = CollectionUtil.toList(objs); + BeanPropertyBindingResult optional = (BeanPropertyBindingResult)listObj.stream() + .filter(p -> "BeanPropertyBindingResult".equals(ClassUtil.getClassName(p, true))) + .findFirst() + .orElse(null); + if(optional != null && optional.hasErrors()){ + List<ObjectError> ls = optional.getAllErrors(); List<ValidationError> listVe = new ArrayList<ValidationError>(); ValidationError ve; for (ObjectError one : ls) { @@ -80,6 +93,26 @@ public class BindingResultAspect { Console.log("返回内容 {}: " ,JSONObject.toJSONString(retVal)); Long endtime = System.currentTimeMillis(); Console.log("执行耗时为{}:" ,endtime-startTime + "ms"); + + + + +// Object[] objs = joinPoint.getArgs(); +// +// List<Object> listObj = CollectionUtil.toList(objs); +// BeanPropertyBindingResult optional = (BeanPropertyBindingResult)listObj.stream() +// .filter(p -> "BeanPropertyBindingResult".equals(ClassUtil.getClassName(p, true))) +// .findFirst() +// .orElse(null); +// if (optional != null && optional.hasErrors()) { +// System.err.println("Optional: "+ optional); +// } + + + + + + return retVal; } diff --git a/src/main/java/cn/timer/api/aspect/lang/bean/ValidationError.java b/src/main/java/cn/timer/api/aspect/lang/bean/ValidationError.java index 00c4c92..9b315db 100644 --- a/src/main/java/cn/timer/api/aspect/lang/bean/ValidationError.java +++ b/src/main/java/cn/timer/api/aspect/lang/bean/ValidationError.java @@ -1,6 +1,5 @@ package cn.timer.api.aspect.lang.bean; -import cn.timer.api.bean.spmk.SpmkApprovalG; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/cn/timer/api/bean/spmk/SpmkApprovalTemplate.java b/src/main/java/cn/timer/api/bean/spmk/SpmkApprovalTemplate.java index 802278c..a562d3e 100644 --- a/src/main/java/cn/timer/api/bean/spmk/SpmkApprovalTemplate.java +++ b/src/main/java/cn/timer/api/bean/spmk/SpmkApprovalTemplate.java @@ -70,7 +70,7 @@ public class SpmkApprovalTemplate extends Model<SpmkApprovalTemplate> { @ApiModelProperty(value = "创建时间 ", example = "创建时间") private Date createTime; - @ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "1") + @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1") private Integer assoType; @ApiModelProperty(value = "审批表单 ", example = "审批表单") diff --git a/src/main/java/cn/timer/api/bean/spmk/SpmkApproveSummary.java b/src/main/java/cn/timer/api/bean/spmk/SpmkApproveSummary.java index 3bb8436..a7adb4c 100644 --- a/src/main/java/cn/timer/api/bean/spmk/SpmkApproveSummary.java +++ b/src/main/java/cn/timer/api/bean/spmk/SpmkApproveSummary.java @@ -73,7 +73,7 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> { @ApiModelProperty(value = "历史审批人 ", example = "历史审批人") private String historyApprover; - @ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "5") + @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1") private Integer assoType; @TableField(fill = FieldFill.UPDATE) diff --git a/src/main/java/cn/timer/api/bean/spmk/SpmkCustomApproval.java b/src/main/java/cn/timer/api/bean/spmk/SpmkCustomApproval.java index 1e575d9..5e47af2 100644 --- a/src/main/java/cn/timer/api/bean/spmk/SpmkCustomApproval.java +++ b/src/main/java/cn/timer/api/bean/spmk/SpmkCustomApproval.java @@ -73,8 +73,11 @@ public class SpmkCustomApproval extends Model<SpmkCustomApproval> { @ApiModelProperty(value = "创建时间 ", example = "创建时间") private Date createTime; - @ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "1") + @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1") private Integer assoType; + + @ApiModelProperty(value = "所有可见 0否 1是", example = "1") + private Integer isAllvisible; @ApiModelProperty(value = "审批表单 ", example = "审批表单") private byte[] froms; diff --git a/src/main/java/cn/timer/api/controller/qyzx/QyzxController.java b/src/main/java/cn/timer/api/controller/qyzx/QyzxController.java index 1692570..06f0d61 100644 --- a/src/main/java/cn/timer/api/controller/qyzx/QyzxController.java +++ b/src/main/java/cn/timer/api/controller/qyzx/QyzxController.java @@ -39,7 +39,6 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM; import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.enums.CommonEnum; - import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper; import cn.timer.api.dao.qyzx.QyzxEntAuthMapper; diff --git a/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java b/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java index 928ece0..9b6973d 100644 --- a/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java +++ b/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java @@ -66,6 +66,9 @@ import cn.timer.api.dto.spmk.SummaryQueryDto; import cn.timer.api.utils.Result; import cn.timer.api.utils.ResultUtil; 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 io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -74,6 +77,7 @@ import io.swagger.annotations.ApiOperation; @Transactional @RequestMapping(value = "/spmk", produces = { "application/json","multipart/form-data" }) +//@BindingResultCtrol(title = "发起审批") public class SpmkServiceImpl { @Autowired @@ -88,7 +92,7 @@ public class SpmkServiceImpl { @Autowired private SpmkCustomApprovalMapper spmkCustomApprovalMapper; - //TODO 新增或编辑-审批模板组 + //TODO 审批模板组 /** * 新增或编辑-审批模板组 */ @@ -197,7 +201,7 @@ public class SpmkServiceImpl { * 排序-审批模板 */ @PutMapping(value = "/update_approval_template") - @ApiOperation(value = "8.查询列表-审批模板组", httpMethod = "PUT", notes = "查询列表-审批模板组") + @ApiOperation(value = "8.排序-审批模板", httpMethod = "PUT", notes = "查询列表-审批模板组") @ApiOperationSupport(order = 8) public Result<Object> ranksAt(@RequestBody List<SpmkApprovalTemplate> list){ @@ -214,7 +218,7 @@ public class SpmkServiceImpl { @PostMapping(value = "/save_approval_g") @ApiOperation(value = "9.新增或编辑-审批组", httpMethod = "POST", notes = "新增或编辑-审批组") @ApiOperationSupport(order = 9) - public Result<Object> saveAg(@CurrentUser UserBean userBean,@RequestBody SpmkApprovalG spmkApprovalG){ + public Result<Object> saveAg(@CurrentUser UserBean userBean, @RequestBody SpmkApprovalG spmkApprovalG){ spmkApprovalG.setOrgCode(userBean.getOrgCode()); return spmkApprovalG.insertOrUpdate() ? ResultUtil.data(spmkApprovalG, "操作成功!") : ResultUtil.error("操作失败!"); @@ -243,7 +247,8 @@ public class SpmkServiceImpl { @ApiOperationSupport(order = 11) public Result<Object> selectListAg(@CurrentUser UserBean userBean){ - return ResultUtil.data(spmkApprovalGMapper.selectListAgInCa(userBean.getOrgCode(), userBean.getEmpNum()),"操作成功!"); +// ZzglController. + return ResultUtil.data(spmkApprovalGMapper.selectListAgInCa(userBean.getOrgCode(), userBean.getEmpNum(), null),"操作成功!"); } @@ -277,10 +282,14 @@ public class SpmkServiceImpl { ca.setFroms(ObjectUtil.serialize(spmkCustomApprovalDto.getFroms())); ca.setRouter(ObjectUtil.serialize(spmkCustomApprovalDto.getRouter())); + //1.新增 SpmkCustomApproval-自定义审批 if (!ca.insertOrUpdate()) return ResultUtil.error("操作失败!-2"); + Integer id = ca.getId(); + // 2.删除 历史的 SpmkInitiatorConfig-审批发起人配置, + SpmkInitiatorConfig.builder().build().delete(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id)); Console.log("自定义审批id: " + id); List<SpmkInitiatorConfig> listIc = spmkCustomApprovalDto.getInitiatorConfigs(); @@ -288,6 +297,7 @@ public class SpmkServiceImpl { for (int i = 0, n = listIc.size(); i < n; i++) { listIc.get(i).setCustomApprovalId(id); } + // 3.新增 最新的 SpmkInitiatorConfig-审批发起人配置, if (!spmkInitiatorConfigMapper.insertList(listIc)) { // 手动抛出异常,事务回滚 throw new Exception(); @@ -295,14 +305,14 @@ public class SpmkServiceImpl { } - SpmkInitiatorConfig.builder().build().delete(new QueryWrapper<SpmkInitiatorConfig>().lambda().eq(SpmkInitiatorConfig::getCustomApprovalId, id)); + // /** * 注意: 为保证该api的原子性 要加 事务处理 回滚(方法注解-@Transactional(rollbackFor = Exception.class)) - * 1.删除 历史的 SpmkInitiatorConfig-审批发起人配置, - * 2.新增 最新的 SpmkInitiatorConfig-审批发起人配置, - * 3.新增 SpmkCustomApproval-自定义审批 + * 1.新增 SpmkCustomApproval-自定义审批 + * 2.删除 历史的 SpmkInitiatorConfig-审批发起人配置, + * 3.新增 最新的 SpmkInitiatorConfig-审批发起人配置, */ // 清空前端不需要的字段再返回,节省流量 @@ -340,8 +350,8 @@ public class SpmkServiceImpl { public Result<Object> selectCaById(@PathVariable int id){ SpmkCustomApproval ca = SpmkCustomApproval.builder().id(id).build().selectById(); SpmkCustomApprovalDto caD = SpmkCustomApprovalDto.builder() - .froms(ObjectUtil.unserialize(ca.getFroms())) - .router(ObjectUtil.unserialize(ca.getRouter())) + .froms(ObjectUtil.deserialize(ca.getFroms())) + .router(ObjectUtil.deserialize(ca.getRouter())) .build(); BeanUtil.copyProperties(ca, caD,"froms","router"); @@ -380,7 +390,7 @@ public class SpmkServiceImpl { @ApiOperation(value = "17.发起审批", httpMethod = "POST", notes = "发起审批") @ApiOperationSupport(order = 17) @Transactional(rollbackFor = Exception.class) - @BindingResultCtrol(title = "发起审批") +// @BindingResultCtrol(title = "发起审批") public Result<Object> saveCa(@CurrentUser UserBean userBean,@Valid @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto,BindingResult bindingResult) throws Exception{ YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>() @@ -394,10 +404,10 @@ public class SpmkServiceImpl { List<Router> listRouter = new ArrayList<Router>(); listRouter.add(spmkApproveSummaryDto.getRouter()); JSONObject jSONObject = spmkApproveSummaryDto.getRequestData() - .put("orgCode", FromData.builder().value(String.valueOf(userBean.getOrgCode())).build()) - .put("initiator", FromData.builder().value(spmkApproveSummaryDto.getInitiator()).build()) - .put("headUrl", FromData.builder().value(ygglMainEmp.getHeadUrl()).build()) - .put("id", FromData.builder().value(StrUtil.toString(userBean.getEmpNum())).build()); + .set("orgCode", FromData.builder().value(String.valueOf(userBean.getOrgCode())).build()) + .set("initiator", FromData.builder().value(spmkApproveSummaryDto.getInitiator()).build()) + .set("headUrl", FromData.builder().value(ygglMainEmp.getHeadUrl()).build()) + .set("id", FromData.builder().value(StrUtil.toString(userBean.getEmpNum())).build()); RouterUtils.NextNode(listRouter, jSONObject, ISFIRST); List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>(); RouterUtils.getIsFlowChildren(listRouter,listFlowChildren); @@ -484,11 +494,10 @@ public class SpmkServiceImpl { SpmkApproveDetailDto adD = SpmkApproveDetailDto.builder().build(); List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectListByAsId(id); BeanUtil.copyProperties(ad, adD, "requestData","froms","router","spmkApproveExecuteRecord"); - - adD.setRequestData(ObjectUtil.unserialize(ad.getRequestData())); - adD.setFroms(ObjectUtil.unserialize(ad.getFroms())); - adD.setRouter(ObjectUtil.unserialize(ad.getRouter())); - adD.setFlowChildren(ObjectUtil.unserialize(ad.getFlowChildren())); + adD.setRequestData(ObjectUtil.deserialize(ad.getRequestData())); + adD.setFroms(ObjectUtil.deserialize(ad.getFroms())); + adD.setRouter(ObjectUtil.deserialize(ad.getRouter())); + adD.setFlowChildren(ObjectUtil.deserialize(ad.getFlowChildren())); adD.setApproveExecuteRecord(listAer); return ResultUtil.data(adD, "操作成功!"); @@ -521,6 +530,9 @@ public class SpmkServiceImpl { SpmkApproveDetail ad = SpmkApproveDetail.builder().build() .selectOne(new QueryWrapper<SpmkApproveDetail>() .lambda() + .select(SpmkApproveDetail::getId, + SpmkApproveDetail::getRequestData, + SpmkApproveDetail::getFlowChildren) .eq(SpmkApproveDetail::getApproveSummaryId, approvingDto.getAsId())); // 查询 SpmkApproveSummary 状态 @@ -542,7 +554,7 @@ public class SpmkServiceImpl { } if (aSummary.getSts() == 0) { - List<FlowChildren> listFlowChildren = ObjectUtil.unserialize(ad.getFlowChildren()); + List<FlowChildren> listFlowChildren = ObjectUtil.deserialize(ad.getFlowChildren()); RouterUtils.approving( listFlowChildren, approvingDto.getAsId(), @@ -560,10 +572,18 @@ public class SpmkServiceImpl { if (fc.getExecute() == "2") { // 查询 SpmkApproveSummary 状态 aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda() - .select(SpmkApproveSummary::getSts) + .select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType) .eq(SpmkApproveSummary::getId, approvingDto.getAsId())); if (aSummary.getSts() != 3) { SpmkApproveSummary.builder().id(approvingDto.getAsId()).endTime(new Date()).sts(2).build().updateById(); + + + + + //审批完成后 业务 + SpmkAssoBusiness sab = SpmkAssoBusinessFactory.createSpmkAssoType(ApproveEnum.getEnums(aSummary.getAssoType())); + if (sab != null) + sab.handleApprove(ObjectUtil.deserialize(ad.getRequestData())); } } diff --git a/src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java b/src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java index 39d0840..a66de73 100644 --- a/src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java +++ b/src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java @@ -17,7 +17,7 @@ import cn.timer.api.bean.spmk.SpmkApprovalG; @Repository public interface SpmkApprovalGMapper extends BaseMapper<SpmkApprovalG> { - List<SpmkApprovalG> selectListAgInCa(@Param("org_code") Integer org_code, @Param("emp_num") Integer emp_num); + List<SpmkApprovalG> selectListAgInCa(@Param("org_code") Integer org_code, @Param("emp_num") Integer emp_num, @Param("deptIds") List<Integer> deptIds); boolean updateListRandsById(List<SpmkApprovalG> list); diff --git a/src/main/java/cn/timer/api/dto/spmk/MySummaryQueryDto.java b/src/main/java/cn/timer/api/dto/spmk/MySummaryQueryDto.java index 9f02aa2..3172332 100644 --- a/src/main/java/cn/timer/api/dto/spmk/MySummaryQueryDto.java +++ b/src/main/java/cn/timer/api/dto/spmk/MySummaryQueryDto.java @@ -35,8 +35,8 @@ public class MySummaryQueryDto extends Page{ private String endTime; @NotNull(message = "type为空") - @DecimalMax(value = "2",message = "assoType 只能为 0我发起的 1抄送我的 2我审批的") - @DecimalMin(value = "0",message = "assoType 只能为 0我发起的 1抄送我的 2我审批的") + @DecimalMax(value = "2",message = "type 只能为 0我发起的 1抄送我的 2我审批的") + @DecimalMin(value = "0",message = "type 只能为 0我发起的 1抄送我的 2我审批的") @ApiModelProperty(value = "0我发起的 1抄送我的 2我审批的", example = "0") private Integer type; diff --git a/src/main/java/cn/timer/api/dto/spmk/SpmkApprovalTemplateDto.java b/src/main/java/cn/timer/api/dto/spmk/SpmkApprovalTemplateDto.java index b09e68e..f591cd0 100644 --- a/src/main/java/cn/timer/api/dto/spmk/SpmkApprovalTemplateDto.java +++ b/src/main/java/cn/timer/api/dto/spmk/SpmkApprovalTemplateDto.java @@ -47,7 +47,7 @@ public class SpmkApprovalTemplateDto { @ApiModelProperty(value = "创建时间 ", example = "创建时间") private Date createTime; - @ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "2") + @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1") private Integer assoType; @ApiModelProperty(value = "审批表单 ", example = "审批表单") diff --git a/src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java b/src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java index d564e26..fae90ed 100644 --- a/src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java +++ b/src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java @@ -38,9 +38,9 @@ public class SpmkApproveSummaryDto{ private String initiator; @NotNull(message = "assoType为空") - @DecimalMax(value = "9",message = "assoType 只能为 0无 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡") - @DecimalMin(value = "0",message = "assoType 只能为 0无 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡") - @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡 ", example = "5") + @DecimalMax(value = "9",message = "assoType 只能为 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪") + @DecimalMin(value = "0",message = "assoType 只能为 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪") + @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1") private Integer assoType; @NotNull(message = "requestData为空") diff --git a/src/main/java/cn/timer/api/dto/spmk/SpmkCustomApprovalDto.java b/src/main/java/cn/timer/api/dto/spmk/SpmkCustomApprovalDto.java index 7c0bba5..54bc5d6 100644 --- a/src/main/java/cn/timer/api/dto/spmk/SpmkCustomApprovalDto.java +++ b/src/main/java/cn/timer/api/dto/spmk/SpmkCustomApprovalDto.java @@ -3,6 +3,10 @@ package cn.timer.api.dto.spmk; import java.util.Date; import java.util.List; +import javax.validation.constraints.DecimalMax; +import javax.validation.constraints.DecimalMin; +import javax.validation.constraints.NotBlank; + import cn.hutool.json.JSONObject; import cn.timer.api.bean.spmk.SpmkInitiatorConfig; import io.swagger.annotations.ApiModelProperty; @@ -23,12 +27,15 @@ public class SpmkCustomApprovalDto { @ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101") private Integer orgCode; + @NotBlank(message = "approvalGId为空") @ApiModelProperty(value = "审批组id 当前用户ID", example = "101") private Integer approvalGId; + @NotBlank(message = "iconUrl为空") @ApiModelProperty(value = "审批图标地址 ", example = "审批图标地址") private String iconUrl; + @NotBlank(message = "name为空") @ApiModelProperty(value = "审批名称 ", example = "审批名称") private String name; @@ -41,6 +48,7 @@ public class SpmkCustomApprovalDto { @ApiModelProperty(value = "排序 排序", example = "101") private Integer ranks; + @NotBlank(message = "isOpinion为空") @ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101") private Integer isOpinion; @@ -50,15 +58,27 @@ public class SpmkCustomApprovalDto { @ApiModelProperty(value = "创建时间 ", example = "创建时间") private Date createTime; - @ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "1") + @NotBlank(message = "assoType为空") + @DecimalMax(value = "9",message = "assoType 只能为 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪") + @DecimalMin(value = "0",message = "assoType 只能为 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪") + @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1") private Integer assoType; - + + @NotBlank(message = "isAllvisible为空") + @DecimalMax(value = "1",message = "isAllvisible 只能为 0否 1是") + @DecimalMin(value = "0",message = "isAllvisible 只能为 0否 1是") + @ApiModelProperty(value = "所有可见 0否 1是", example = "1") + private Integer isAllvisible; + + @NotBlank(message = "froms为空") @ApiModelProperty(value = "审批表单 ", example = "审批表单") private List<JSONObject> froms; + @NotBlank(message = "router为空") @ApiModelProperty(value = "审批流程 ", example = "审批流程") private Router router; + @NotBlank(message = "initiatorConfigs为空") @ApiModelProperty(value = "可见发起人配置 ", example = "数组类型") private List<SpmkInitiatorConfig> initiatorConfigs; diff --git a/src/main/java/cn/timer/api/utils/router/RouterUtils.java b/src/main/java/cn/timer/api/utils/router/RouterUtils.java index bfa13cf..4b5876c 100644 --- a/src/main/java/cn/timer/api/utils/router/RouterUtils.java +++ b/src/main/java/cn/timer/api/utils/router/RouterUtils.java @@ -196,8 +196,8 @@ public class RouterUtils { if (listCondition == null || listCondition.size() == 0) { routerRule.setFlow(true); }else { + Compare compare; for (Condition condition : listCondition) { - Compare compare ; for (String string : condition.getValues()) { // 简单工厂模式 - 判断条件 diff --git a/src/main/java/cn/timer/api/utils/router/business/EvectionBusiness.java b/src/main/java/cn/timer/api/utils/router/business/EvectionBusiness.java new file mode 100644 index 0000000..15b445d --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/EvectionBusiness.java @@ -0,0 +1,40 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 出差-业务 + * @author Tang + * + */ +@Builder +public class EvectionBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + // 开始时间 + String startTime = jsonObj.get("__startTime",FromData.class).getValue(); + // 结束时间 + String endTime = jsonObj.get("__endTime",FromData.class).getValue(); + // 时长 + String longTime = jsonObj.get("__longTime",FromData.class).getValue(); + // 出差事由 + String businessTrip = jsonObj.get("__businessTrip",FromData.class).getValue(); + // 上传文件 + String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); + + // 调 考勤管理 业务 + + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/LeaveBusiness.java b/src/main/java/cn/timer/api/utils/router/business/LeaveBusiness.java new file mode 100644 index 0000000..03eff8b --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/LeaveBusiness.java @@ -0,0 +1,42 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 请假-业务 + * + * @author Tang + * + */ +@Builder +public class LeaveBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + + // 请假类型 + String LeaveType = jsonObj.get("__LeaveType",FromData.class).getValue(); + // 开始时间 + String startTime = jsonObj.get("__startTime",FromData.class).getValue(); + // 结束时间 + String endTime = jsonObj.get("__endTime",FromData.class).getValue(); + // 时长 + String longTime = jsonObj.get("__longTime",FromData.class).getValue(); + // 请假事由 + String ReasonsForLeave = jsonObj.get("__ReasonsForLeave",FromData.class).getValue(); + // 上传文件 + String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); + + // 调 考勤管理 业务 + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/RecruitBusiness.java b/src/main/java/cn/timer/api/utils/router/business/RecruitBusiness.java new file mode 100644 index 0000000..3755718 --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/RecruitBusiness.java @@ -0,0 +1,57 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 招聘-业务 + * + * @author Tang + * + */ +@Builder +public class RecruitBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + + // 招聘部门 + String RecruitmentDept = jsonObj.get("__RecruitmentDept",FromData.class).getValue(); + // 招聘职位 + String RecruitmentPost = jsonObj.get("__RecruitmentPost",FromData.class).getValue(); + // 工性性质 + String WorkingNature = jsonObj.get("__WorkingNature",FromData.class).getValue(); + // 招聘人数 + String NumberOfRecruiters = jsonObj.get("__NumberOfRecruiters",FromData.class).getValue(); + // 已在岗人数 + String NumberOfPeople = jsonObj.get("NumberOfPeople",FromData.class).getValue(); + // 招聘原因 + String RecruitmentReasons = jsonObj.get("RecruitmentReasons",FromData.class).getValue(); + // 该岗位工作职责 + String operatingDuty = jsonObj.get("operatingDuty",FromData.class).getValue(); + // 招聘要求 + String RecruitmentRequirements = jsonObj.get("RecruitmentRequirements",FromData.class).getValue(); + // 薪酬上限 + String SalaryCap = jsonObj.get("SalaryCap",FromData.class).getValue(); + // 薪酬下限 + String TransferInDepartment = jsonObj.get("TransferInDepartment",FromData.class).getValue(); + // 生效日期 + String PayFloor = jsonObj.get("PayFloor",FromData.class).getValue(); + // 备注 + String Remarks = jsonObj.get("Remarks",FromData.class).getValue(); + // 上传文件 + String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); + + // 调 招聘管理 业务 + + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/RegularizationBusiness.java b/src/main/java/cn/timer/api/utils/router/business/RegularizationBusiness.java new file mode 100644 index 0000000..5c41d69 --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/RegularizationBusiness.java @@ -0,0 +1,42 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 转正-业务 + * @author Tang + * + */ +@Builder +public class RegularizationBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + + // 申请人名称 + String applicant = jsonObj.get("__applicant",FromData.class).getValue(); + // 实际转正时间 + String newConfirmationTime = jsonObj.get("__newConfirmationTime",FromData.class).getValue(); + // 备注 + String Remarks = jsonObj.get("Remarks",FromData.class).getValue(); + // 试用期内主要工作和成绩 + String WorkAndAchievement = jsonObj.get("WorkAndAchievement",FromData.class).getValue(); + // 存在问题及改进意见 + String problem = jsonObj.get("problem",FromData.class).getValue(); + // 上传文件 + String file = jsonObj.get("file",FromData.class).getValue(); + + // 调 员工管理 业务 + + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/ReissueACardBusiness.java b/src/main/java/cn/timer/api/utils/router/business/ReissueACardBusiness.java new file mode 100644 index 0000000..e22055d --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/ReissueACardBusiness.java @@ -0,0 +1,35 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 补卡-业务 + * @author Tang + * + */ +@Builder +public class ReissueACardBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + + // 补卡时间 + String PatchCardTime = jsonObj.get("__PatchCardTime",FromData.class).getValue(); + // 缺卡原因 + String cardShortage = jsonObj.get("cardShortage",FromData.class).getValue(); + // 上传文件 + String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); + + // 调 考勤管理 业务 + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/ResignationBusiness.java b/src/main/java/cn/timer/api/utils/router/business/ResignationBusiness.java new file mode 100644 index 0000000..6832877 --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/ResignationBusiness.java @@ -0,0 +1,39 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 离职-业务 + * @author Tang + * + */ +@Builder +public class ResignationBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + + // 申请人 + String applicant = jsonObj.get("__applicant",FromData.class).getValue(); + // 计划离职日期 + String terminationDate = jsonObj.get("__terminationDate",FromData.class).getValue(); + // 离职原因 + String ReasonForResignation = jsonObj.get("__ReasonForResignation",FromData.class).getValue(); + // 备注 + String Remarks = jsonObj.get("Remarks",FromData.class).getValue(); + // 上传文件 + String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); + + // 调 员工管理 业务 + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusiness.java b/src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusiness.java new file mode 100644 index 0000000..00467f9 --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusiness.java @@ -0,0 +1,16 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import lombok.Data; + +/** + * 审批关联业务 + * @author Tang + * + */ +@Data +public abstract class SpmkAssoBusiness { + + public abstract void handleApprove(JSONObject jsonObj); + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusinessFactory.java b/src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusinessFactory.java new file mode 100644 index 0000000..aaa52cc --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/SpmkAssoBusinessFactory.java @@ -0,0 +1,49 @@ +package cn.timer.api.utils.router.business; + +import cn.timer.api.utils.router.enums.ApproveEnum; + +/** + * 审批关联业务工厂类 + * @author Tang + * + */ +public class SpmkAssoBusinessFactory { + + public static SpmkAssoBusiness createSpmkAssoType(ApproveEnum assotype) { + SpmkAssoBusiness sat = null; + switch (assotype) { + case DEFAULT: + break; + case REGULARIZATION: + sat = RegularizationBusiness.builder().build(); + break; + case RESIGNATION: + sat = ResignationBusiness.builder().build(); + break; + case TRANSFER_POSITION: + sat = TransferPositionBusiness.builder().build(); + break; + case RECRUIT: + sat = RecruitBusiness.builder().build(); + break; + case WORK_OVERTIME: + sat = WorkOvertimeBusiness.builder().build(); + break; + case LEAVE: + sat = LeaveBusiness.builder().build(); + break; + case EVECTION: + sat = EvectionBusiness.builder().build(); + break; + case REISSUE_A_CARD: + sat = ReissueACardBusiness.builder().build(); + break; + default: + break; + } + + return sat; + + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/TransferPositionBusiness.java b/src/main/java/cn/timer/api/utils/router/business/TransferPositionBusiness.java new file mode 100644 index 0000000..8c2ca1a --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/TransferPositionBusiness.java @@ -0,0 +1,43 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 调岗-业务 + * @author Tang + * + */ +@Builder +public class TransferPositionBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + + // 申请人 + String applicant = jsonObj.get("__applicant",FromData.class).getValue(); + // 申请原因 + String ReasonForApplication = jsonObj.get("__ReasonForApplication",FromData.class).getValue(); + // 调入部门 + String TransferInDepartment = jsonObj.get("__TransferInDepartment",FromData.class).getValue(); + // 调入岗位 + String TransferInPosition = jsonObj.get("__TransferInPosition",FromData.class).getValue(); + // 生效日期 + String effectiveDate = jsonObj.get("__effectiveDate",FromData.class).getValue(); + // 备注 + String Remarks = jsonObj.get("Remarks",FromData.class).getValue(); + // 上传文件 + String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); + + // 调 员工管理 业务 + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/business/WorkOvertimeBusiness.java b/src/main/java/cn/timer/api/utils/router/business/WorkOvertimeBusiness.java new file mode 100644 index 0000000..d592b11 --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/business/WorkOvertimeBusiness.java @@ -0,0 +1,41 @@ +package cn.timer.api.utils.router.business; + +import cn.hutool.json.JSONObject; +import cn.timer.api.dto.spmk.FromData; +import lombok.Builder; + +/** + * 加班-业务 + * @author Tang + * + */ +@Builder +public class WorkOvertimeBusiness extends SpmkAssoBusiness { + + @Override + public void handleApprove(JSONObject jsonObj) { + // TODO Auto-generated method stub + // 发起人企业id + String orgCode = jsonObj.get("orgCode",FromData.class).getValue(); + // 发起人id + String id = jsonObj.get("id",FromData.class).getValue(); + // 发起人名称 + String initiator = jsonObj.get("initiator",FromData.class).getValue(); + + // 开始时间 + String startTime = jsonObj.get("__startTime",FromData.class).getValue(); + // 结束时间 + String endTime = jsonObj.get("__endTime",FromData.class).getValue(); + // 时长 + String timeLong = jsonObj.get("__timeLong",FromData.class).getValue(); + // 加班补偿方式 + String compensate = jsonObj.get("__compensate",FromData.class).getValue(); + // 加班原因 + String OvertimeReason = jsonObj.get("__OvertimeReason",FromData.class).getValue(); + // 上传文件 + String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); + + // 调 考勤管理 业务 + } + +} diff --git a/src/main/java/cn/timer/api/utils/router/enums/ApproveEnum.java b/src/main/java/cn/timer/api/utils/router/enums/ApproveEnum.java new file mode 100644 index 0000000..8aa4b84 --- /dev/null +++ b/src/main/java/cn/timer/api/utils/router/enums/ApproveEnum.java @@ -0,0 +1,43 @@ +package cn.timer.api.utils.router.enums; + +public enum ApproveEnum { + + DEFAULT(0, "默认", 1), REGULARIZATION(1, "转正", 1), RESIGNATION(2, "离职", 1), TRANSFER_POSITION(3, "调岗", 1), + RECRUIT(4, "招聘", 1), WORK_OVERTIME(5, "加班", 2), LEAVE(6, "请假", 2), EVECTION(7, "出差", 2), REISSUE_A_CARD(8, "补卡", 2), + WAGE_ADJUSTMENT(9, "调薪", 3),; + + private Integer type; + + private String desc; + + private Integer businessType; + + ApproveEnum(Integer type, String desc, Integer businessType) { + this.type = type; + this.desc = desc; + this.businessType = businessType; + } + + public Integer getType() { + return this.type; + } + + public static ApproveEnum getEnums(Integer type) { + + for (ApproveEnum approveEnum : values()) { + if (approveEnum.getType() == type) { + return approveEnum; + } + } + return null; + } + + public String getDesc() { + return this.desc; + } + + public Integer getBusinessType() { + return this.businessType; + } + +} diff --git a/src/main/resources/mapping/spmk/SpmkApprovalGMapper.xml b/src/main/resources/mapping/spmk/SpmkApprovalGMapper.xml index 6cd2452..ec3be6c 100644 --- a/src/main/resources/mapping/spmk/SpmkApprovalGMapper.xml +++ b/src/main/resources/mapping/spmk/SpmkApprovalGMapper.xml @@ -60,7 +60,8 @@ b.is_opinion SpmkCustomApproval_is_opinion, b.update_time SpmkCustomApproval_update_time, b.create_time SpmkCustomApproval_create_time, - b.asso_type SpmkCustomApproval_asso_type<!-- , + b.asso_type SpmkCustomApproval_asso_type, + b.is_allvisible SpmkCustomApproval_is_allvisible<!-- , b.froms SpmkCustomApproval_froms, b.router SpmkCustomApproval_router --> </sql> @@ -71,12 +72,23 @@ <include refid="Base_Column_List_Alias_ca" /> FROM spmk_approval_g a - LEFT JOIN spmk_custom_approval b ON a.id = b.approval_g_id + LEFT JOIN spmk_custom_approval b + ON a.id = b.approval_g_id AND ( b.id IN ( + SELECT custom_approval_id FROM spmk_initiator_config WHERE asso_id = #{emp_num} AND type = 1 GROUP BY custom_approval_id + <if test="deptIds != null and deptIds.size() > 0"> + UNION + SELECT custom_approval_id FROM spmk_initiator_config WHERE + asso_id IN + ( + <foreach item="it" index="index" collection="deptIds" separator="," close="" > + #{it} + </foreach> + ) AND type IN (2,3) GROUP BY custom_approval_id + </if> + ) OR b.is_allvisible = 1) WHERE a.org_code = #{org_code} -<!-- AND b.id IN ( - SELECT custom_approval_id FROM spmk_initiator_config WHERE asso_id = #{emp_num} AND type = 1 GROUP BY custom_approval_id - ) --> + ORDER BY a.ranks, b.ranks </select> diff --git a/src/main/resources/mapping/spmk/SpmkCustomApprovalMapper.xml b/src/main/resources/mapping/spmk/SpmkCustomApprovalMapper.xml index b878065..2351665 100644 --- a/src/main/resources/mapping/spmk/SpmkCustomApprovalMapper.xml +++ b/src/main/resources/mapping/spmk/SpmkCustomApprovalMapper.xml @@ -16,6 +16,7 @@ <result column="update_time" property="updateTime" /> <result column="create_time" property="createTime" /> <result column="asso_type" property="assoType" /> + <result column="is_allvisible" property="isAllvisible" /> <result column="froms" property="froms" /> <result column="router" property="router" /> </resultMap> @@ -33,6 +34,7 @@ update_time, create_time, asso_type, + is_allvisible, froms, router </sql> @@ -50,6 +52,7 @@ update_time SpmkCustomApproval_update_time, create_time SpmkCustomApproval_create_time, asso_type SpmkCustomApproval_asso_type, + is_allvisible SpmkCustomApproval_is_allvisible, froms SpmkCustomApproval_froms, router SpmkCustomApproval_router </sql> @@ -102,6 +105,9 @@ <if test ='null != assoType'> asso_type, </if> + <if test ='null != isAllvisible'> + is_allvisible, + </if> <if test ='null != froms'> froms, </if> @@ -143,6 +149,9 @@ <if test ='null != assoType'> #{assoType}, </if> + <if test ='null != isAllvisible'> + #{isAllvisible}, + </if> <if test ='null != froms'> #{froms}, </if> @@ -171,6 +180,7 @@ <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 != isAllvisible'>is_allvisible = #{isAllvisible},</if> <if test ='null != froms'>froms = #{froms},</if> <if test ='null != router'>router = #{router}</if> </set> -- libgit2 0.26.0