| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.enums.ContractType; |
| | | import com.ruoyi.common.oa.OAProcess; |
| | | import com.ruoyi.common.oa.OAProperty; |
| | | import com.ruoyi.common.oa.OAResult; |
| | |
| | | //获取不合格处理记录 |
| | | UnqualifiedHandlerVO vo = baseMapper.findById(pushOADto.getHandlerId()); |
| | | |
| | | // if (vo.getRequestId() != null) { |
| | | // throw new ErrorException("该不合格处理已提交过OA"); |
| | | // } |
| | | |
| | | //提交oa相关字段赋值 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | Map<String, String> mainFields = new HashMap<>(); |
| | |
| | | boolean oa = false; |
| | | try { |
| | | log.info("发起不合格处理OA审核流程"); |
| | | String unqualifiedProcessId = oaProperty.getUnqualifiedProcessId(); |
| | | //根据IFS域获取对应的流程id |
| | | if(StringUtils.isBlank(pushOADto.getContract())){ |
| | | throw new RuntimeException("IFS域【"+pushOADto.getContract()+"】不存在,OA流程提交失败"); |
| | | } |
| | | String unqualifiedProcessId = StringUtils.equals(ContractType.ZTNS.getValue(),pushOADto.getContract())?oaProperty.getUnqualifiedProcessId():oaProperty.getUnqualifiedProcessIdByKJNS(); |
| | | OAResult oaResult = OAProcess.start(mainFields, requestName, unqualifiedProcessId,SecurityUtils.getUsername()); |
| | | log.info("不合格处理OA审核流程结束,返回结果->{}" + oaResult); |
| | | log.info("{}不合格处理OA审核流程结束,返回结果->{}",unqualifiedProcessId,oaResult); |
| | | oa = oaResult.success(); |
| | | if (oa) { |
| | | String addWorkflowResult = oaResult.getAddWorkflowResult(); |
| | |
| | | //推送OA |
| | | PushOADto pushOADto = new PushOADto(); |
| | | pushOADto.setHandlerId(unqualifiedHandlerDto.getId()); |
| | | pushOADto.setContract(unqualifiedHandlerDto.getContract()); |
| | | pushOA(pushOADto); |
| | | } |
| | | return true; |