赵士淞
2023-04-25 b6172d4506c9cd13864bfa9c710a9d7aab7646a2
营业费用(Flowable)
5 files modified
30 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessExpenseDto.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/impl/BusinessExpenseServiceFlowableImpl.java 14 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/resources/config/application-dev.yml 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/resources/config/application-prod.yml 4 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/business/expenseFlowable/report.vue 5 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessExpenseDto.java
@@ -62,4 +62,7 @@
    /** 流程实例ID */
    private String processInstanceId;
    /** 审批状态 */
    private String approve;
}
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);
    }
}
eladmin-master/eladmin-system/src/main/resources/config/application-dev.yml
@@ -126,3 +126,7 @@
  # 文件大小 /M
  maxSize: 100
  avatarMaxSize: 5
# Flowable
flowable:
  url: http://localhost:8888
eladmin-master/eladmin-system/src/main/resources/config/application-prod.yml
@@ -135,3 +135,7 @@
  # 文件大小 /M
  maxSize: 100
  avatarMaxSize: 5
# Flowable
flowable:
  url: http://localhost:8888
eladmin-web-master/src/views/business/expenseFlowable/report.vue
@@ -122,10 +122,9 @@
          </template>
        </el-table-column>
        <el-table-column prop="remarks" label="备注" />
        <el-table-column prop="createTime" label="创建时间" />
        <el-table-column label="操作" width="150px" align="center">
        <el-table-column prop="createTime" label="审批状态">
          <template slot-scope="scope">
            {{ scope.row.id }}
            {{ scope.row.approve == 'true' ? '同意' : scope.row.approve == 'false' ? '拒绝' : '审核中' }}
          </template>
        </el-table-column>
      </el-table>