| | |
| | | import me.zhengjie.modules.project.service.dto.ProjectDto; |
| | | import me.zhengjie.utils.ObjectUtil; |
| | | import me.zhengjie.utils.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @RequiredArgsConstructor |
| | | public class BusinessExpenseServiceFlowableImpl implements BusinessExpenseFlowableService { |
| | | |
| | | @Value("${flowable.url}") |
| | | private String flowableUrl; |
| | | |
| | | private final Api api; |
| | | private final BusinessPlanService businessPlanService; |
| | | private final ProjectService projectService; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, Object> report() throws Exception { |
| | | // 发起通信 |
| | | Object returnObject = api.post("http://localhost:8888/api/common/report?key=" + "businessExpenseApply" + "&userId=" + SecurityUtils.getCurrentUserId(), new HashMap<>()); |
| | | Object returnObject = api.post(flowableUrl + "/api/common/report?key=" + "businessExpenseApply" + "&userId=" + SecurityUtils.getCurrentUserId(), new HashMap<>()); |
| | | // 查询处理 |
| | | return queryHandle(returnObject); |
| | | } |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, Object> approve() throws Exception { |
| | | // 发起通信 |
| | | Object returnObject = api.post("http://localhost:8888/api/common/approve?key=" + "businessExpenseApply" + "&userId=" + SecurityUtils.getCurrentUserId(), new HashMap<>()); |
| | | Object returnObject = api.post(flowableUrl + "/api/common/approve?key=" + "businessExpenseApply" + "&userId=" + SecurityUtils.getCurrentUserId(), new HashMap<>()); |
| | | // 查询处理 |
| | | return queryHandle(returnObject); |
| | | } |
| | |
| | | Map<String, Object> params = ObjectUtil.toObjectMap(resources); |
| | | params.put("approver", "1,2,3,4,5"); |
| | | // 发起通信 |
| | | api.post("http://localhost:8888/api/common/run?key=" + "businessExpenseApply" + "&userId=" + SecurityUtils.getCurrentUserId(), params); |
| | | api.post(flowableUrl + "/api/common/run?key=" + "businessExpenseApply" + "&userId=" + SecurityUtils.getCurrentUserId(), params); |
| | | } |
| | | |
| | | /** |
| | |
| | | Map<String, Object> paramsMap = new HashMap<>(); |
| | | paramsMap.put("approve", "true"); |
| | | // 发起通信 |
| | | api.post("http://localhost:8888/api/common/next?processInstanceId=" + processInstanceId, paramsMap); |
| | | api.post(flowableUrl + "/api/common/next?processInstanceId=" + processInstanceId, paramsMap); |
| | | } |
| | | |
| | | /** |
| | |
| | | Map<String, Object> paramsMap = new HashMap<>(); |
| | | paramsMap.put("approve", "false"); |
| | | // 发起通信 |
| | | api.post("http://localhost:8888/api/common/next?processInstanceId=" + processInstanceId, paramsMap); |
| | | api.post(flowableUrl + "/api/common/next?processInstanceId=" + processInstanceId, paramsMap); |
| | | } |
| | | } |