java110
2023-08-24 45dec37d168f3d20def403c98a71a287961a72d0
service-store/src/main/java/com/java110/store/smo/impl/ResourceAuditFlowV1InnerServiceSMOImpl.java
@@ -16,6 +16,9 @@
package com.java110.store.smo.impl;
import com.java110.dto.itemRelease.ItemReleaseTypeDto;
import com.java110.dto.oaWorkflow.OaWorkflowDto;
import com.java110.intf.oa.IOaWorkflowInnerServiceSMO;
import com.java110.store.dao.IResourceAuditFlowV1ServiceDao;
import com.java110.intf.store.IResourceAuditFlowV1InnerServiceSMO;
import com.java110.dto.resource.ResourceAuditFlowDto;
@@ -27,6 +30,7 @@
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
@@ -42,7 +46,8 @@
    @Autowired
    private IResourceAuditFlowV1ServiceDao resourceAuditFlowV1ServiceDaoImpl;
    @Autowired
    private IOaWorkflowInnerServiceSMO oaWorkflowInnerServiceSMOImpl;
    @Override
    public int saveResourceAuditFlow(@RequestBody  ResourceAuditFlowPo resourceAuditFlowPo) {
@@ -75,7 +80,7 @@
        }
        List<ResourceAuditFlowDto> resourceAuditFlows = BeanConvertUtil.covertBeanList(resourceAuditFlowV1ServiceDaoImpl.getResourceAuditFlowInfo(BeanConvertUtil.beanCovertMap(resourceAuditFlowDto)), ResourceAuditFlowDto.class);
        refreshWorkflow(resourceAuditFlows);
        return resourceAuditFlows;
    }
@@ -84,4 +89,30 @@
    public int queryResourceAuditFlowsCount(@RequestBody ResourceAuditFlowDto resourceAuditFlowDto) {
        return resourceAuditFlowV1ServiceDaoImpl.queryResourceAuditFlowsCount(BeanConvertUtil.beanCovertMap(resourceAuditFlowDto));    }
    /**
     * 查询工作流信息
     *
     * @param resourceAuditFlows
     */
    private void refreshWorkflow(List<ResourceAuditFlowDto> resourceAuditFlows) {
        if(resourceAuditFlows == null || resourceAuditFlows.size()< 1){
            return ;
        }
        List<String> flowIds = new ArrayList<>();
        for (ResourceAuditFlowDto resourceAuditFlowDto : resourceAuditFlows) {
            flowIds.add(resourceAuditFlowDto.getFlowId());
        }
        OaWorkflowDto oaWorkflowDto = new OaWorkflowDto();
        oaWorkflowDto.setFlowIds(flowIds.toArray(new String[flowIds.size()]));
        List<OaWorkflowDto> oaWorkflowDtos = oaWorkflowInnerServiceSMOImpl.queryOaWorkflows(oaWorkflowDto);
        for (ResourceAuditFlowDto resourceAuditFlowDto : resourceAuditFlows) {
            for (OaWorkflowDto tmpOaWorkflowDto : oaWorkflowDtos) {
                if (resourceAuditFlowDto.getFlowId().equals(tmpOaWorkflowDto.getFlowId())) {
                    BeanConvertUtil.covertBean(tmpOaWorkflowDto, resourceAuditFlowDto);
                }
            }
        }
    }
}