赵士淞
2023-04-25 b6172d4506c9cd13864bfa9c710a9d7aab7646a2
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/impl/BusinessExpenseServiceFlowableImpl.java
@@ -27,6 +27,7 @@
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;
@@ -45,6 +46,9 @@
@RequiredArgsConstructor
public class BusinessExpenseServiceFlowableImpl implements BusinessExpenseFlowableService {
    @Value("${flowable.url}")
    private String flowableUrl;
    private final Api api;
    private final BusinessPlanService businessPlanService;
    private final ProjectService projectService;
@@ -57,7 +61,7 @@
    @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);
    }
@@ -70,7 +74,7 @@
    @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);
    }
@@ -121,7 +125,7 @@
        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);
    }
    /**
@@ -135,7 +139,7 @@
        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);
    }
    /**
@@ -149,6 +153,6 @@
        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);
    }
}