| | |
| | | import com.highdatas.mdm.service.act.IdentityService; |
| | | import com.highdatas.mdm.service.act.TaskService; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @since 2019-12-19 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class FlowsServiceImpl extends ServiceImpl<FlowsMapper, Flows> implements IFlowsService { |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | |
| | | @Autowired |
| | | SysFieldMapper fieldMapper; |
| | | @Autowired |
| | | ITUserRoleService userRoleService; |
| | | @Autowired |
| | | IMasterModifiedService masterModifiedService; |
| | | @Autowired |
| | | IMaintainService maintainService; |
| | | @Autowired |
| | | IdentityService identityService; |
| | | @Autowired |
| | | ISysViewService viewService; |
| | | @Autowired |
| | | IMasterAuthorSubscribeService subscribeService; |
| | | @Autowired |
| | | ISysMenuService menuService; |
| | | |
| | | /** |
| | | * |
| | | * @description: 创建新字段版本 |
| | | * @param userId 用户id |
| | | * @param maintainId 数据版本id |
| | | * @param tableName 表名 |
| | | * |
| | | * @return: maintainfielid 字段版本对象 |
| | | * |
| | | */ |
| | | @Override |
| | | public MaintainField createNowVerion(String tableName, String maintainId, String userId) { |
| | | MaintainField nowMaintain = maintainFieldService.getNextMaintain(tableName, userId); |
| | |
| | | |
| | | return nowMaintain; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @description: 通过业务id获取审批状态 |
| | | * @param businessId 业务id |
| | | * @return: status |
| | | * |
| | | */ |
| | | @Override |
| | | public ActivitiStatus getStatusByBusinessId(String businessId) { |
| | | Flows flows = selectOne(new EntityWrapper<Flows>().eq("business_id", businessId)); |
| | | Flows flows = selectOne(new EntityWrapper<Flows>().eq("business_id", businessId).orderBy("create_time desc")); |
| | | if (flows == null){ |
| | | return null; |
| | | } |
| | | return flows.getStatus(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @description: 判断是否为下一节点审批人 |
| | | * @param flows 流程 |
| | | * @param userId 用户id |
| | | * @return: status |
| | | * |
| | | */ |
| | | @Override |
| | | public boolean isNextAudit(Flows flows, String userId) { |
| | | NextTaskUserInfo nestTaskAssignee = taskService.getNestTaskAssignee(flows.getWorkflowId()); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @description: 流程完成后的操作 |
| | | * @param flows 流程实例 |
| | | * |
| | | */ |
| | | |
| | | @Override |
| | | public void aduitFinish(Flows flows) { |
| | | if (flows.getBusinessType().equals(ActivitiBusinessType.maintain)){ |
| | | String maintainId = flows.getBusinessId(); |
| | | masterModifiedService.dealFlow(maintainId, flows.getStatus()); |
| | | maintainService.dealFlow(maintainId, flows.getStatus()); |
| | | } |
| | | if (flows.getBusinessType().equals(ActivitiBusinessType.field)){ |
| | | String maintainId = flows.getBusinessId(); |
| | | maintainFieldService.dealFlow(maintainId, flows.getStatus()); |
| | | } |
| | | // 新增线程 |
| | | new Thread(() -> { |
| | | log.info("处理 生成版本后的操作"); |
| | | if (flows.getBusinessType().equals(ActivitiBusinessType.maintain)){ |
| | | String maintainId = flows.getBusinessId(); |
| | | log.info("flow-maintain:" + maintainId); |
| | | masterModifiedService.dealFlow(maintainId, flows.getStatus()); |
| | | log.info("flow-masterModifiedService end"); |
| | | maintainService.dealFlow(maintainId, flows.getStatus()); |
| | | log.info("flow-maintainService end"); |
| | | viewService.dealFlow(maintainId, flows.getStatus()); |
| | | log.info("flow-viewService end"); |
| | | subscribeService.dealFlow(maintainId, flows.getStatus()); |
| | | log.info("flow-subscribeService end"); |
| | | menuService.dealFlow(maintainId, flows.getStatus(), flows.getUserId()); |
| | | log.info("flow-menuService end"); |
| | | } |
| | | if (flows.getBusinessType().equals(ActivitiBusinessType.field)){ |
| | | String maintainId = flows.getBusinessId(); |
| | | maintainFieldService.dealFlow(maintainId, flows.getStatus()); |
| | | |
| | | } |
| | | }).start(); |
| | | } |
| | | } |