java110
2023-08-24 45dec37d168f3d20def403c98a71a287961a72d0
service-store/src/main/java/com/java110/store/smo/impl/ResourceAuditFlowV1InnerServiceSMOImpl.java
@@ -16,13 +16,15 @@
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.resourceAuditFlow.ResourceAuditFlowDto;
import com.java110.po.resourceAuditFlow.ResourceAuditFlowPo;
import com.java110.dto.resource.ResourceAuditFlowDto;
import com.java110.po.resource.ResourceAuditFlowPo;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.dto.user.UserDto;
import com.java110.dto.PageDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
@@ -44,7 +46,8 @@
    @Autowired
    private IResourceAuditFlowV1ServiceDao resourceAuditFlowV1ServiceDaoImpl;
    @Autowired
    private IOaWorkflowInnerServiceSMO oaWorkflowInnerServiceSMOImpl;
    @Override
    public int saveResourceAuditFlow(@RequestBody  ResourceAuditFlowPo resourceAuditFlowPo) {
@@ -77,7 +80,7 @@
        }
        List<ResourceAuditFlowDto> resourceAuditFlows = BeanConvertUtil.covertBeanList(resourceAuditFlowV1ServiceDaoImpl.getResourceAuditFlowInfo(BeanConvertUtil.beanCovertMap(resourceAuditFlowDto)), ResourceAuditFlowDto.class);
        refreshWorkflow(resourceAuditFlows);
        return resourceAuditFlows;
    }
@@ -86,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);
                }
            }
        }
    }
}