ソースを参照

供应商修护

caozj 2 年 前
コミット
38dad40c20

+ 7 - 0
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/service/IFlowApplycheckService.java

@@ -45,4 +45,11 @@ public interface IFlowApplycheckService extends IService<FlowApplycheck> {
      * @return
      */
     Integer getListCount(Map<String, Object> condition);
+
+    /**
+     * 获取流程
+     * @param businessId
+     * @return
+     */
+    List<FlowApplycheck> FlowDetail(String businessId);
 }

+ 10 - 0
hx-saas-project/saas-flow/src/main/java/com/fjhx/flow/service/impl/FlowApplycheckServiceImpl.java

@@ -53,4 +53,14 @@ public class FlowApplycheckServiceImpl extends ServiceImpl<FlowApplycheckMapper,
     public Integer getListCount(Map<String, Object> condition) {
         return baseMapper.getTaskListCount(condition);
     }
+
+    /**
+     * 获取流程
+     * @param businessId
+     * @return
+     */
+    @Override
+    public List<FlowApplycheck> FlowDetail(String businessId) {
+        return null;
+    }
 }

+ 1 - 1
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -99,7 +99,7 @@
             <if test="search neq null and search neq '' ">
                 AND ((INSTR(t1.`name`, #{search}) > 0) OR (INSTR(t1.`code`, #{search}) > 0) )
             </if>
-            <if test="technologyType neq null and technologyType neq '' ">
+            <if test="technologyType neq null and technologyType neq ''">
                 AND t3.technology_type = #{technologyType}
             </if>
             <if test="purpose neq null and purpose neq '' ">

+ 18 - 0
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java

@@ -22,6 +22,24 @@ import java.util.Map;
 public interface SupplierMapper extends BaseMapper<Supplier> {
 
     /**
+     * 全部列表
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<Supplier> getSumList(Map<String, Object> condition);
+
+    /**
+     * 全部列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    Integer getSumListCount(Map<String, Object> condition);
+
+    /**
      * 列表
      *
      * @param condition

+ 68 - 32
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -2,40 +2,69 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.supplier.mapper.SupplierMapper">
 
-    <select id="getList" resultType="com.fjhx.entity.supplier.Supplier">
+    <select id="getSumList" resultType="com.fjhx.entity.supplier.Supplier">
         SELECT
             t1.*,
-            t3.CategoryCode,
             t3.TechnologyType AS TechnologyType,
-            t3.Purpose AS Purpose,
-            t4.`Name` AS materialCategoryName,
-            t4.ID,
             (<include refid="warningCount_filed"/> ) AS warningCount,
             (<include refid="warningTypeCount_filed"/> ) AS warningTypeCount,
             (select `Name` from material_category where `Code` = t1.CategoryCode) AS categoryName
         FROM
             supplier t1
-        LEFT JOIN supplier_price t2 ON t1.id = t2.FactoryId
-        LEFT JOIN material t3 ON t2.MaterialCode = t3.`Code`
-        LEFT JOIN material_category t4 ON t3.CategoryCode = t4.`Code`
+        LEFT JOIN supplier_price sp ON t1.ID = sp.FactoryId
+        LEFT JOIN material t3 ON t3.`Code` = sp.MaterialCode
         <include refid="list_condition"/>
+        AND t3.IsDelete = 0
         GROUP BY t1.ID
         ORDER BY t1.CreatedTime DESC
         <include refid="sql_limit"/>
     </select>
+
+    <select id="getSumListCount" resultType="java.lang.Integer">
+        SELECT
+            Count( 1 )
+        FROM
+        (
+            SELECT
+                count(1)
+            FROM
+                supplier t1
+            LEFT JOIN supplier_price sp ON t1.ID = sp.FactoryId
+            LEFT JOIN material t3 ON t3.`Code` = sp.MaterialCode
+        <include refid="list_condition"/>
+            GROUP BY t1.ID
+        )AS a
+    </select>
+    <select id="getList" resultType="com.fjhx.entity.supplier.Supplier">
+        SELECT
+            t1.*,
+            t3.TechnologyType AS TechnologyType,
+            (<include refid="warningCount_filed"/> ) AS warningCount,
+            (<include refid="warningTypeCount_filed"/> ) AS warningTypeCount,
+            (select `Name` from material_category where `Code` = t1.CategoryCode) AS categoryName
+        FROM
+            material t3
+        LEFT JOIN supplier_price sp ON t3.`Code` = sp.MaterialCode
+        LEFT JOIN supplier t1 ON sp.FactoryId = t1.ID
+        <include refid="list_condition"/>
+        AND t3.IsDelete = 0
+        GROUP BY t1.ID
+        ORDER BY t3.TechnologyType
+        <include refid="sql_limit"/>
+    </select>
     <select id="getListCount" resultType="java.lang.Integer">
         SELECT
             Count( 1 )
         FROM
         (
             SELECT
-                count( 1 )
+                count(1)
             FROM
-            supplier t1
-            LEFT JOIN supplier_price t2 ON t1.id = t2.FactoryId
-            LEFT JOIN material t3 ON t2.MaterialCode = t3.`Code`
-            LEFT JOIN material_category t4 ON t3.CategoryCode = t4.`Code`
+            material t3
+            LEFT JOIN supplier_price sp ON t3.`Code` = sp.MaterialCode
+            LEFT JOIN supplier t1 ON sp.FactoryId = t1.ID
             <include refid="list_condition"/>
+            AND t3.IsDelete = 0
             GROUP BY t1.ID
         )AS a
     </select>
@@ -53,12 +82,12 @@
             FORMAT(IFNULL((<include refid="lastMonthMoney_filed"/>),0),2)AS lastMonthMoney,
             FORMAT(IFNULL((<include refid="monthMoney_filed"/>),0),2)AS monthMoney
         FROM
-            supplier t1
-        LEFT JOIN supplier_price t2 ON t1.id = t2.FactoryId
-        LEFT JOIN material t3 ON t2.MaterialCode = t3.`Code`
+            material t3
+        LEFT JOIN supplier_price sp ON t3.`Code` = sp.MaterialCode
+        LEFT JOIN supplier t1 ON sp.FactoryId = t1.ID
         <include refid="list_condition"/>
         GROUP BY t1.ID
-        ORDER BY t1.CreatedTime DESC
+        ORDER BY t3.TechnologyType
         <include refid="sql_limit"/>
     </select>
     <select id="getPurListCount" resultType="java.lang.Integer">
@@ -69,27 +98,35 @@
             SELECT
                 count(1)
             FROM
-            supplier t1
-            LEFT JOIN supplier_price t2 ON t1.id = t2.FactoryId
-            LEFT JOIN material t3 ON t2.MaterialCode = t3.`Code`
+            material t3
+            LEFT JOIN supplier_price sp ON t3.`Code` = sp.MaterialCode
+            LEFT JOIN supplier t1 ON sp.FactoryId = t1.ID
             <include refid="list_condition"/>
             GROUP BY t1.ID
         ) AS a
     </select>
     <select id="getGroupByCategory" resultType="com.fjhx.entity.supplier.Supplier">
         SELECT
-            count( 1 ) AS CategoryCount,
-            t3.TechnologyType AS TechnologyType
+            TechnologyType AS TechnologyType,
+            Count( 1 ) AS CategoryCount
         FROM
-            supplier t1
-        LEFT JOIN supplier_price t2 ON t1.id = t2.FactoryId
-        LEFT JOIN material t3 ON t2.MaterialCode = t3.`Code`
-        WHERE
-            t3.TechnologyType IS NOT NULL
-            AND t1.IsDelete = 0
+            (
+                SELECT
+                    t1.ID,
+                    t1.`Name`,
+                    t3.TechnologyType AS TechnologyType
+                FROM
+                    material t3
+                LEFT JOIN supplier_price sp ON t3.`Code` = sp.MaterialCode
+                LEFT JOIN supplier t1 ON sp.FactoryId = t1.ID
+                <include refid="list_condition"/>
+                AND t3.IsDelete = 0
+                GROUP BY t1.ID
+                    ) detail
         GROUP BY
-            t3.TechnologyType
-        ORDER BY t3.TechnologyType ASC
+            TechnologyType
+        ORDER BY
+            TechnologyType
     </select>
     <select id="getSuById" resultType="com.fjhx.entity.supplier.Supplier">
         SELECT
@@ -266,11 +303,10 @@
     <sql id="list_condition">
         <where>
             t1.IsDelete = 0
-            AND t1.CategoryCode NOT IN ("02.","02.003.")
             <if test="search neq null and search neq '' ">
                 AND ((INSTR(t1.`Name`, #{search}) > 0) OR (INSTR(t1.`Code`, #{search}) > 0) )
             </if>
-            <if test="TechnologyType neq null and TechnologyType neq '' ">
+            <if test="TechnologyType neq null and TechnologyType neq ''">
                 AND t3.TechnologyType = #{TechnologyType}
             </if>
             <if test="Purpose neq null and Purpose neq '' ">

+ 10 - 0
hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

@@ -50,6 +50,11 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
      */
     @Override
     public List<Supplier> getList(Map<String, Object> condition){
+        if(ObjectUtil.isNotEmpty(condition.get("TechnologyType"))&&
+                StringUtil.equals(condition.get("TechnologyType").toString(),"99")){
+            condition.put("TechnologyType",null);
+            return baseMapper.getSumList(condition);
+        }
         return baseMapper.getList(condition);
     }
 
@@ -60,6 +65,11 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
      */
     @Override
     public Integer getListCount(Map<String, Object> condition) {
+        if(ObjectUtil.isNotEmpty(condition.get("TechnologyType"))&&
+                StringUtil.equals(condition.get("TechnologyType").toString(),"99")){
+            condition.put("TechnologyType",null);
+            return baseMapper.getSumListCount(condition);
+        }
         return baseMapper.getListCount(condition);
     }