wangliang %!s(int64=3) %!d(string=hai) anos
pai
achega
76621d6608

+ 19 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlow.java

@@ -38,6 +38,25 @@ public class TFFlow extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "是否发布,0:否,1:是")
     private Boolean publish;
 
+    public TFFlow() {
+
+    }
+
+    public TFFlow(Long schoolId, Long orgId, String name, Long userId) {
+        this.schoolId = schoolId;
+        this.orgId = orgId;
+        this.name = name;
+        setCreateId(userId);
+    }
+
+    public TFFlow(Long schoolId, Long orgId, String name, Boolean publish, Long userId) {
+        this.schoolId = schoolId;
+        this.orgId = orgId;
+        this.name = name;
+        this.publish = publish;
+        setCreateId(userId);
+    }
+
     public Long getSchoolId() {
         return schoolId;
     }

+ 14 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowMapper.java

@@ -1,7 +1,11 @@
 package com.qmth.distributed.print.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.distributed.print.business.entity.TFFlow;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +17,14 @@ import com.qmth.distributed.print.business.entity.TFFlow;
  */
 public interface TFFlowMapper extends BaseMapper<TFFlow> {
 
+    /**
+     * 流程列表
+     *
+     * @param iPage
+     * @param name
+     * @param schoolId
+     * @param orgId
+     * @return
+     */
+    IPage<TFFlow> list(IPage<Map> iPage, @Param("name") String name, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId);
 }

+ 14 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowService.java

@@ -1,7 +1,11 @@
 package com.qmth.distributed.print.business.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.entity.TFFlow;
+import com.qmth.teachcloud.common.entity.SysRole;
+
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +17,14 @@ import com.qmth.distributed.print.business.entity.TFFlow;
  */
 public interface TFFlowService extends IService<TFFlow> {
 
+    /**
+     * 流程列表
+     *
+     * @param iPage
+     * @param name
+     * @param schoolId
+     * @param orgId
+     * @return
+     */
+    IPage<TFFlow> list(IPage<Map> iPage, String name, Long schoolId, Long orgId);
 }

+ 20 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowServiceImpl.java

@@ -1,11 +1,15 @@
 package com.qmth.distributed.print.business.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.entity.TFFlow;
 import com.qmth.distributed.print.business.mapper.TFFlowMapper;
 import com.qmth.distributed.print.business.service.TFFlowService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Map;
+
 /**
  * <p>
  * 流程表 服务实现类
@@ -17,4 +21,20 @@ import org.springframework.stereotype.Service;
 @Service
 public class TFFlowServiceImpl extends ServiceImpl<TFFlowMapper, TFFlow> implements TFFlowService {
 
+    @Resource
+    TFFlowMapper tfFlowMapper;
+
+    /**
+     * 流程列表
+     *
+     * @param iPage
+     * @param name
+     * @param schoolId
+     * @param orgId
+     * @return
+     */
+    @Override
+    public IPage<TFFlow> list(IPage<Map> iPage, String name, Long schoolId, Long orgId) {
+        return tfFlowMapper.list(iPage, name, schoolId, orgId);
+    }
 }

+ 14 - 0
distributed-print-business/src/main/resources/mapper/TFFlowMapper.xml

@@ -2,4 +2,18 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.distributed.print.business.mapper.TFFlowMapper">
 
+    <select id="list" resultType="com.qmth.distributed.print.business.entity.TFFlow">
+        select tff.id,tff.school_id as schoolId,tff.org_id as orgId,tff.name,tff.enable,tff.publish from t_f_flow tff
+        <where>
+            <if test="name != null and name != ''">
+                and tff.name like concat('%',#{name},'%')
+            </if>
+            <if test="schoolId != null and schoolId != ''">
+                and tff.school_id = #{schoolId}
+            </if>
+            <if test="orgId != null and orgId != ''">
+                and tff.org_id = #{orgId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 0 - 363
distributed-print/.bpmn/src/main/resources/processes/GdykdxPaperApprove.bpmn2d

@@ -1,363 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" active="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="GdykdxPaperApprove" snapToGrid="true" version="0.11.0">
-  <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1923082984"/>
-    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="43" y="46">
-      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1378258803"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="55" x="151" y="36">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="55" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0 //@connections.4 //@connections.8"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1378258803"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="23" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="&#x63d0;&#x4ea4;&#x8bd5;&#x5377;(&#x547d;&#x9898;&#x8001;&#x5e08;)"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiusertask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="1677233461"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="55" x="350" y="36">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="55" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2" incomingConnections="//@connections.1 //@connections.7"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="1677233461"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="23" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="&#x5ba1;&#x6838;&#x8bd5;&#x5377;(&#x6559;&#x7814;&#x5ba4;&#x4e3b;&#x4efb;)"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiusertask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="363475076"/>
-    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="385" y="400">
-      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="3" transparency="0.0" width="35" height="35" style="//@styles.0"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.6"/>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="554451057"/>
-    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="382" y="110">
-      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
-        <points y="20"/>
-        <points x="20"/>
-        <points x="40" y="20"/>
-        <points x="20" y="40"/>
-        <points y="20"/>
-      </graphicsAlgorithmChildren>
-      <points y="20"/>
-      <points x="20"/>
-      <points x="40" y="20"/>
-      <points x="20" y="40"/>
-      <points y="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.3 //@connections.4" incomingConnections="//@connections.2"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <anchors xsi:type="pi:ChopboxAnchor"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="30" y="10"/>
-        <points x="10" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="10" y="10"/>
-        <points x="30" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="554743638"/>
-    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="55" x="350" y="190">
-      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="55" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.5" incomingConnections="//@connections.3"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.5/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <properties key="independentObject" value="554743638"/>
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="23" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="&#x5ba1;&#x6838;&#x8bd5;&#x5377;(&#x6559;&#x5b66;&#x9662;&#x957f;)"/>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiusertask" stretchH="false" stretchV="false" proportional="false"/>
-    </children>
-  </children>
-  <children xsi:type="pi:ContainerShape" visible="true" active="true">
-    <properties key="independentObject" value="458782858"/>
-    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="382" y="300">
-      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
-        <points y="20"/>
-        <points x="20"/>
-        <points x="40" y="20"/>
-        <points x="20" y="40"/>
-        <points y="20"/>
-      </graphicsAlgorithmChildren>
-      <points y="20"/>
-      <points x="20"/>
-      <points x="40" y="20"/>
-      <points x="20" y="40"/>
-      <points y="20"/>
-    </graphicsAlgorithm>
-    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.6 //@connections.7 //@connections.8" incomingConnections="//@connections.5"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.6/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <anchors xsi:type="pi:ChopboxAnchor"/>
-    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.6/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
-      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
-    </anchors>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="30" y="10"/>
-        <points x="10" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-    <children visible="true">
-      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
-        <points x="10" y="10"/>
-        <points x="30" y="30"/>
-      </graphicsAlgorithm>
-    </children>
-  </children>
-  <styles foreground="//@colors.2" lineWidth="20" id="EVENT">
-    <renderingStyle>
-      <adaptedGradientColoredAreas definedStyleId="bpmnEventStyle" gradientType="0">
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="250" green="251" blue="252"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="250" green="251" blue="252"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-      </adaptedGradientColoredAreas>
-    </renderingStyle>
-  </styles>
-  <styles foreground="//@colors.2" lineWidth="20" id="TASK">
-    <renderingStyle>
-      <adaptedGradientColoredAreas definedStyleId="bpmnTaskStyle" gradientType="0">
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="250" green="251" blue="252"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="255" green="255" blue="204"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-        <adaptedGradientColoredAreas styleAdaption="0">
-          <gradientColor>
-            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </start>
-            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
-              <color red="229" green="229" blue="194"/>
-            </end>
-          </gradientColor>
-        </adaptedGradientColoredAreas>
-      </adaptedGradientColoredAreas>
-    </renderingStyle>
-  </styles>
-  <styles background="//@colors.2" foreground="//@colors.2" lineWidth="1" id="BPMN-POLYGON-ARROW"/>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@anchors.0" end="//@children.1/@anchors.0">
-    <properties key="independentObject" value="1857357520"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.1/@anchors.0" end="//@children.2/@anchors.0">
-    <properties key="independentObject" value="1711802157"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.2/@anchors.0" end="//@children.4/@anchors.0">
-    <properties key="independentObject" value="2132108188"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.4/@anchors.0" end="//@children.5/@anchors.0">
-    <properties key="independentObject" value="2121613270"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="22" height="16" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP" value="&#x901a;&#x8fc7;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.4/@anchors.0" end="//@children.1/@anchors.0">
-    <properties key="independentObject" value="1726891584"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="22" height="16" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP" value="&#x9a73;&#x56de;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="203" y="130"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.5/@anchors.0" end="//@children.6/@anchors.0">
-    <properties key="independentObject" value="1761403877"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.6/@anchors.0" end="//@children.3/@anchors.0">
-    <properties key="independentObject" value="1822416993"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="22" height="16" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP" value="&#x901a;&#x8fc7;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.6/@anchors.0" end="//@children.2/@anchors.0">
-    <properties key="independentObject" value="985169068"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="22" height="16" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP" value="&#x9a73;&#x56de;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="546" y="319"/>
-    <bendpoints x="546" y="63"/>
-  </connections>
-  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.6/@anchors.0" end="//@children.1/@anchors.0">
-    <properties key="independentObject" value="1514215483"/>
-    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
-    <connectionDecorators visible="true" active="true" location="0.5">
-      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="22" height="16" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP" value="&#x9a73;&#x56de;"/>
-    </connectionDecorators>
-    <connectionDecorators visible="true" locationRelative="true" location="1.0">
-      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
-        <points x="-10" y="-5" before="3" after="3"/>
-        <points/>
-        <points x="-10" y="5" before="3" after="3"/>
-        <points x="-8" before="3" after="3"/>
-      </graphicsAlgorithm>
-    </connectionDecorators>
-    <bendpoints x="203" y="321"/>
-  </connections>
-  <colors red="227" green="238" blue="249"/>
-  <colors red="255" green="255" blue="255"/>
-  <colors/>
-  <fonts name="Arial" size="8"/>
-  <fonts name="Arial" size="11"/>
-</pi:Diagram>

+ 0 - 7
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -60,12 +60,6 @@ public class SysController {
     @Resource
     CacheService cacheService;
 
-    @Resource
-    TBSessionService tbSessionService;
-
-    @Resource
-    RedisUtil redisUtil;
-
     @Resource
     PrintCommonService printCommonService;
 
@@ -253,7 +247,6 @@ public class SysController {
                 ResultUtil.error(e.getMessage());
             }
         }
-
         return ResultUtil.ok(new EditResult(basicAttachment.getId(), teachcloudCommonService.filePreview(basicAttachment.getPath()), basicAttachment.getPages()));
     }
 

+ 116 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/TFFlowController.java

@@ -1,8 +1,42 @@
 package com.qmth.distributed.print.api;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.annotation.BOOL;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.boot.api.exception.ApiException;
+import com.qmth.distributed.print.business.bean.result.EditResult;
+import com.qmth.distributed.print.business.entity.TFFlow;
+import com.qmth.distributed.print.business.service.ActivitiService;
+import com.qmth.distributed.print.business.service.PrintCommonService;
+import com.qmth.distributed.print.business.service.TFFlowService;
+import com.qmth.teachcloud.common.bean.result.LoginResult;
+import com.qmth.teachcloud.common.entity.BasicAttachment;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.common.enums.FieldUniqueEnum;
+import com.qmth.teachcloud.common.enums.UploadFileEnum;
+import com.qmth.teachcloud.common.service.BasicAttachmentService;
+import com.qmth.teachcloud.common.util.Result;
+import com.qmth.teachcloud.common.util.ResultUtil;
+import com.qmth.teachcloud.common.util.ServletUtil;
+import io.swagger.annotations.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Objects;
 
 /**
  * <p>
@@ -12,8 +46,89 @@ import org.springframework.web.bind.annotation.RestController;
  * @author wangliang
  * @since 2021-08-02
  */
+@Api(tags = "流程Controller")
 @RestController
-@RequestMapping("/t-fflow")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.flow}")
+@Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
 public class TFFlowController {
+    private final static Logger log = LoggerFactory.getLogger(TFFlowController.class);
+
+    @Resource
+    PrintCommonService printCommonService;
+
+    @Resource
+    BasicAttachmentService basicAttachmentService;
+
+    @Resource
+    ActivitiService activitiService;
+
+    @Resource
+    TFFlowService tfFlowService;
+
+    @ApiOperation(value = "注册流程")
+    @Transactional
+    @ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/register", method = RequestMethod.POST)
+    public Result register(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+                           @ApiParam(value = "上传文件类型", required = true) @RequestParam UploadFileEnum type,
+                           @ApiParam(value = "流程文件名称", required = false) @RequestParam(required = false) String name,
+                           @ApiParam(value = "流程是否发布,true:发布,false:不发布", required = false) @RequestParam(required = false) Boolean publish) {
+        BasicAttachment basicAttachment = null;
+        try {
+            int temp = file.getOriginalFilename().lastIndexOf(".");
+            String fileName = file.getOriginalFilename().substring(0, temp);
+            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
+            if (!format.equalsIgnoreCase(".bpmn") && !format.contains("bpmn20.xml")) {
+                throw ExceptionResultEnum.ERROR.exception("上传的流程文件格式只能为.bmpn或bpmn20.xml");
+            }
+            basicAttachment = printCommonService.saveAttachment(file, ServletUtil.getRequestMd5(), type);
+            if (Objects.isNull(basicAttachment)) {
+                throw ExceptionResultEnum.ATTACHMENT_ERROR.exception();
+            }
+            activitiService.uploadDeployment(file);
+            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+            Long schoolId = Objects.nonNull(ServletUtil.getRequestHeaderSchoolIdByNotVaild()) && !Objects.equals("", ServletUtil.getRequestHeaderSchoolIdByNotVaild()) ? Long.parseLong(ServletUtil.getRequestHeaderSchoolIdByNotVaild().toString()) : sysUser.getSchoolId();
+            TFFlow tfFlow = new TFFlow(schoolId, sysUser.getOrgId(), Objects.isNull(name) ? fileName : name, publish, sysUser.getId());
+            tfFlowService.save(tfFlow);
+        } catch (Exception e) {
+            log.error("请求出错", e);
+            if (Objects.nonNull(basicAttachment)) {
+                basicAttachmentService.deleteAttachment(basicAttachment);
+            }
+            if (e instanceof DuplicateKeyException) {
+                String errorColumn = e.getCause().toString();
+                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
+                throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
+            } else if (e instanceof ApiException) {
+                ResultUtil.error((ApiException) e, e.getMessage());
+            } else {
+                ResultUtil.error(e.getMessage());
+            }
+        }
+        return ResultUtil.ok(new EditResult(basicAttachment.getId()));
+    }
+
+    @ApiOperation(value = "发布流程")
+    @ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/publish", method = RequestMethod.POST)
+    public Result publish(@ApiParam(value = "流程文件id", required = true) @RequestParam String id) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        UpdateWrapper<TFFlow> tfFlowUpdateWrapper = new UpdateWrapper<>();
+        tfFlowUpdateWrapper.lambda().eq(TFFlow::getId, id)
+                .set(TFFlow::getPublish, true)
+                .set(TFFlow::getUpdateId, sysUser.getId())
+                .set(TFFlow::getUpdateTime, System.currentTimeMillis());
+        return ResultUtil.ok(tfFlowService.update(tfFlowUpdateWrapper));
+    }
 
+    @ApiOperation(value = "流程列表")
+    @ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = TFFlow.class)})
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public Result list(@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name,
+                       @ApiParam(value = "页码", required = false) @RequestParam(value = "pageNumber", required = true) Integer pageNumber,
+                       @ApiParam(value = "数量", required = false) @RequestParam(value = "pageSize", required = true) Integer pageSize) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        Long schoolId = Objects.nonNull(ServletUtil.getRequestHeaderSchoolIdByNotVaild()) && !Objects.equals("", ServletUtil.getRequestHeaderSchoolIdByNotVaild()) ? Long.parseLong(ServletUtil.getRequestHeaderSchoolIdByNotVaild().toString()) : sysUser.getSchoolId();
+        return ResultUtil.ok(tfFlowService.list(new Page<>(pageNumber, pageSize), name, schoolId, sysUser.getOrgId()));
+    }
 }

+ 6 - 0
distributed-print/src/main/java/com/qmth/distributed/print/config/SwaggerConfig.java

@@ -34,15 +34,21 @@ public class SwaggerConfig {
         ParameterBuilder tokenPar1 = new ParameterBuilder();
         ParameterBuilder tokenPar2 = new ParameterBuilder();
         ParameterBuilder tokenPar3 = new ParameterBuilder();
+        ParameterBuilder tokenPar4 = new ParameterBuilder();
+        ParameterBuilder tokenPar5 = new ParameterBuilder();
         List<Parameter> pars = new ArrayList<>();
         tokenPar.name(SystemConstant.HEADER_PLATFORM).description("平台").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
         tokenPar1.name(SystemConstant.HEADER_DEVICE_ID).description("设备id").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
         tokenPar2.name(SystemConstant.HEADER_AUTHORIZATION).description("鉴权token").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
         tokenPar3.name(SystemConstant.HEADER_TIME).description("时间戳").modelRef(new ModelRef("long")).parameterType("header").required(false).build();
+        tokenPar4.name(SystemConstant.MD5.toLowerCase()).description("md5").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
+        tokenPar5.name(SystemConstant.SCHOOL_ID).description("学校id").modelRef(new ModelRef("long")).parameterType("header").required(false).build();
         pars.add(tokenPar.build());
         pars.add(tokenPar1.build());
         pars.add(tokenPar2.build());
         pars.add(tokenPar3.build());
+        pars.add(tokenPar4.build());
+        pars.add(tokenPar5.build());
 
         return new Docket(DocumentationType.SWAGGER_2)
                 .groupName("distributed-print")

+ 2 - 1
distributed-print/src/main/resources/application-dev.properties

@@ -59,7 +59,7 @@ aliyun.oss.url=http://${aliyun.oss.bucket}.${aliyun.oss.name}
 
 #\u7CFB\u7EDF\u914D\u7F6E
 sys.config.oss=true
-sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip,.mp3,.wav,.dll,.exe,.ftl
+sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip,.mp3,.wav,.dll,.exe,.ftl,.bpmn,.xml
 sys.config.attachmentLength=100
 sys.config.attachmentSize=200
 sys.config.serverUpload=
@@ -103,6 +103,7 @@ prefix.url.exam=admin/exam
 prefix.url.data=admin/data
 prefix.url.work=admin/work
 prefix.url.client=admin/client
+prefix.url.flow=admin/flow
 
 #\u65E5\u671F\u683C\u5F0F\u5316
 spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

+ 3 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FieldUniqueEnum.java

@@ -17,7 +17,9 @@ public enum FieldUniqueEnum {
 
     org_schoolId_code_idx("机构编码"),
 
-    org_schoolId_name_idx("机构名称");
+    org_schoolId_name_idx("机构名称"),
+
+    flow_schoolId_name_idx("流程名称");
 
     private String title;
 

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TeachcloudCommonServiceImpl.java

@@ -247,7 +247,7 @@ public class TeachcloudCommonServiceImpl implements TeachcloudCommonService {
                 int count = Objects.nonNull(sysRoleList) && sysRoleList.size() > 0 ? (int) sysRoleList.stream().filter(s -> Objects.equals(s.getName(), RoleTypeEnum.ADMIN.getDesc())).count() : 0;
                 QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
                 if (count > 0) {//超级系统管理员
-                    Long schoolId = (Long) ServletUtil.getRequestSchoolByNotVaild();
+                    Long schoolId = (Long) ServletUtil.getRequestHeaderSchoolIdByNotVaild();
                     sysPrivilegeQueryWrapper.lambda().eq(SysPrivilege::getSchoolId, schoolId)
                             .eq(SysPrivilege::getType, PrivilegeEnum.URL)
                             .eq(SysPrivilege::getProperty, PrivilegePropertyEnum.AUTH);