java110 лет назад: 2
Родитель
Сommit
45dec37d16

+ 30 - 17
java110-bean/src/main/java/com/java110/dto/resource/ResourceAuditFlowDto.java

@@ -1,6 +1,8 @@
 package com.java110.dto.resource;
 
 import com.java110.dto.PageDto;
+import com.java110.dto.oaWorkflow.OaWorkflowDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -12,14 +14,14 @@ import java.util.Date;
  * @Version 1.0
  * add by wuxw 2019/4/24
  **/
-public class ResourceAuditFlowDto extends PageDto implements Serializable {
+public class ResourceAuditFlowDto extends OaWorkflowDto implements Serializable {
 
     private String rafId;
-private String remark;
-private String storeId;
-private String flowId;
-private String flowName;
-private String flowType;
+    private String remark;
+    private String storeId;
+    private String flowId;
+    private String flowName;
+    private String flowType;
 
 
     private Date createTime;
@@ -30,37 +32,48 @@ private String flowType;
     public String getRafId() {
         return rafId;
     }
-public void setRafId(String rafId) {
+
+    public void setRafId(String rafId) {
         this.rafId = rafId;
     }
-public String getRemark() {
+
+    public String getRemark() {
         return remark;
     }
-public void setRemark(String remark) {
+
+    public void setRemark(String remark) {
         this.remark = remark;
     }
-public String getStoreId() {
+
+    public String getStoreId() {
         return storeId;
     }
-public void setStoreId(String storeId) {
+
+    public void setStoreId(String storeId) {
         this.storeId = storeId;
     }
-public String getFlowId() {
+
+    public String getFlowId() {
         return flowId;
     }
-public void setFlowId(String flowId) {
+
+    public void setFlowId(String flowId) {
         this.flowId = flowId;
     }
-public String getFlowName() {
+
+    public String getFlowName() {
         return flowName;
     }
-public void setFlowName(String flowName) {
+
+    public void setFlowName(String flowName) {
         this.flowName = flowName;
     }
-public String getFlowType() {
+
+    public String getFlowType() {
         return flowType;
     }
-public void setFlowType(String flowType) {
+
+    public void setFlowType(String flowType) {
         this.flowType = flowType;
     }
 

+ 6 - 4
java110-db/src/main/resources/mapper/store/ResourceAuditFlowV1ServiceDaoImplMapper.xml

@@ -18,7 +18,8 @@
     <!-- 查询物品流程信息 add by wuxw 2018-07-03 -->
     <select id="getResourceAuditFlowInfo" parameterType="Map" resultType="Map">
         select t.raf_id,t.raf_id rafId,t.remark,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id
-        storeId,t.flow_id,t.flow_id flowId,t.flow_name,t.flow_name flowName,t.flow_type,t.flow_type flowType
+        storeId,t.flow_id,t.flow_id flowId,t.flow_name,t.flow_name flowName,t.flow_type,t.flow_type flowType,
+        t.create_time createTime
         from resource_audit_flow t
         where 1 =1
         <if test="rafId !=null and rafId != ''">
@@ -59,9 +60,7 @@
         <if test="remark !=null and remark != ''">
             , t.remark= #{remark}
         </if>
-        <if test="storeId !=null and storeId != ''">
-            , t.store_id= #{storeId}
-        </if>
+
         <if test="flowId !=null and flowId != ''">
             , t.flow_id= #{flowId}
         </if>
@@ -75,6 +74,9 @@
         <if test="rafId !=null and rafId != ''">
             and t.raf_id= #{rafId}
         </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
 
     </update>
 

+ 33 - 2
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.beans.factory.annotation.Autowired;
 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 @@ public class ResourceAuditFlowV1InnerServiceSMOImpl extends BaseServiceSMO imple
 
     @Autowired
     private IResourceAuditFlowV1ServiceDao resourceAuditFlowV1ServiceDaoImpl;
-
+    @Autowired
+    private IOaWorkflowInnerServiceSMO oaWorkflowInnerServiceSMOImpl;
 
     @Override
     public int saveResourceAuditFlow(@RequestBody  ResourceAuditFlowPo resourceAuditFlowPo) {
@@ -75,7 +80,7 @@ public class ResourceAuditFlowV1InnerServiceSMOImpl extends BaseServiceSMO imple
         }
 
         List<ResourceAuditFlowDto> resourceAuditFlows = BeanConvertUtil.covertBeanList(resourceAuditFlowV1ServiceDaoImpl.getResourceAuditFlowInfo(BeanConvertUtil.beanCovertMap(resourceAuditFlowDto)), ResourceAuditFlowDto.class);
-
+        refreshWorkflow(resourceAuditFlows);
         return resourceAuditFlows;
     }
 
@@ -84,4 +89,30 @@ public class ResourceAuditFlowV1InnerServiceSMOImpl extends BaseServiceSMO imple
     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);
+                }
+            }
+        }
+    }
 }