| | |
| | | import com.highdatas.mdm.entity.Maintain; |
| | | import com.highdatas.mdm.entity.MaintainDetail; |
| | | import com.highdatas.mdm.entity.TUser; |
| | | import com.highdatas.mdm.pojo.ActivitiBusinessType; |
| | | import com.highdatas.mdm.pojo.ActivitiStatus; |
| | | import com.highdatas.mdm.pojo.Page; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.pojo.*; |
| | | import com.highdatas.mdm.service.*; |
| | | import com.highdatas.mdm.service.act.*; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | IFlowsService flowsService; |
| | | |
| | | @Autowired |
| | | ITUserService userService; |
| | | |
| | | @Autowired |
| | | HistoryService historyService; |
| | |
| | | |
| | | @Override |
| | | public Flows start(String key, HttpSession session, String maintainId, ActivitiBusinessType type) { |
| | | return start(key, session, maintainId, type, null); |
| | | } |
| | | |
| | | @Override |
| | | public Flows start(String key, HttpSession session, String maintainId, ActivitiBusinessType type, Map<String, Object> params) { |
| | | |
| | | identityService.setSession( session); |
| | | Flows flows = new Flows(); |
| | |
| | | flows.setBusinessType(type); |
| | | flows.setStatus(ActivitiStatus.working); |
| | | HashMap<String, Object> variableMap = new HashMap<>(); |
| | | variableMap.put("reasson", "申请审批"); |
| | | if (params != null) { |
| | | variableMap.putAll(params); |
| | | } |
| | | variableMap.put("reason", "申请审批"); |
| | | |
| | | String workflowId = identityService.startProcess(id, key, null, variableMap); |
| | | flows.setWorkflowId(workflowId); |
| | |
| | | taskService.setSession(session); |
| | | List<String> todoTask = taskService.getTodoTask(); |
| | | if (todoTask.size() == 0) { |
| | | return Result.success(null); |
| | | return Result.success(CodeMsg.SUCCESS); |
| | | } |
| | | |
| | | Wrapper<Flows> flowsWrapper = new EntityWrapper<Flows>().in("workflow_id", todoTask).ne("business_type", ActivitiBusinessType.exists); |
| | |
| | | |
| | | for (Flows flow : records) { |
| | | String userId = flow.getUserId(); |
| | | TUser user = userService.selectOne(new EntityWrapper<TUser>().eq("user_id", userId)); |
| | | TUser user = DbUtils.getUserById(userId); |
| | | if (user == null) { |
| | | continue; |
| | | } |