Parcourir la source

安品首页加接口

lazhaoqian il y a 3 ans
Parent
commit
4db6814707

+ 11 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/anpin/StockControl.java

@@ -436,7 +436,17 @@ public class StockControl extends BaseController {
     @GetMapping("/statistics")
     public AjaxResult statistics(TWarehouseBills tWarehouseBills)
     {
-        List<Map<String, Object>> statistics = tWarehousebillsService.statistics(tWarehouseBills);
+        List<Map<String, Object>> statistics = new ArrayList<>();
+        if (tWarehouseBills.getfMblno().equals("外部用户")){
+            statistics = null;
+        }else if (tWarehouseBills.getfMblno().equals("超级管理员")
+        || tWarehouseBills.getfMblno().equals("财务经理")
+                || tWarehouseBills.getfMblno().equals("主管")
+                || tWarehouseBills.getfMblno().equals("会计")){
+            statistics = tWarehousebillsService.statistics(tWarehouseBills);
+        }else {
+            statistics = tWarehousebillsService.statisticsNew(tWarehouseBills);
+        }
         return AjaxResult.success(statistics);
     }
 

+ 2 - 2
ruoyi-admin/src/main/resources/application-druid.yml

@@ -8,8 +8,8 @@ spring:
       master:
 #        url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  #       url: jdbc:mysql://115.29.151.39:3306/sys?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-        url: jdbc:mysql://124.70.179.5:3306/AnPingTest?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-        #url: jdbc:mysql://124.70.179.5:3306/AnPinJingYuan?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+        #url: jdbc:mysql://124.70.179.5:3306/AnPingTest?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://124.70.179.5:3306/AnPinJingYuan?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
         username: root
         password: daasan7ujm^YHN
 

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java

@@ -251,4 +251,10 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
      * @return
      */
     List<Map<String,Object>> statistics (TWarehouseBills tWarehousebills);
+    /**
+     * 首页统计 采购 出库 入库 销售
+     * @param tWarehousebills
+     * @return
+     */
+    List<Map<String,Object>> statisticsNew (TWarehouseBills tWarehousebills);
 }

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java

@@ -558,4 +558,10 @@ public interface ITWarehouseBillsService {
      * @return
      */
     List<Map<String,Object>> statistics (TWarehouseBills tWarehousebills);
+    /**
+     * 首页统计 出库 入库
+     * @param tWarehousebills
+     * @return
+     */
+    List<Map<String,Object>> statisticsNew (TWarehouseBills tWarehousebills);
 }

+ 4 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -2307,6 +2307,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     public List<Map<String, Object>> statistics(TWarehouseBills tWarehousebills) {
         return tWarehouseBillsMapper.statistics(tWarehousebills);
     }
+    @Override
+    public List<Map<String, Object>> statisticsNew(TWarehouseBills tWarehousebills) {
+        return tWarehouseBillsMapper.statisticsNew(tWarehousebills);
+    }
 
     /**
      * app仓储新行提交业务

+ 84 - 0
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -3399,4 +3399,88 @@
         f_billtype
         ) fail ON temp.billType = fail.billType
     </select>
+    <select id="statisticsNew" resultType="map">
+        SELECT
+        temp.billType,
+        CASE
+
+        WHEN temp.billType = 'CK' THEN
+        '出库'
+        WHEN temp.billType = 'RK' THEN
+        '入库'
+        WHEN temp.billType = 'SQ' THEN
+        '采购'
+        WHEN temp.billType = 'XS' THEN
+        '销售'
+        END AS billTypeName,
+        IFNULL( temp.num, 0 ) AS allNum,
+        IFNULL( temp.money, 0 ) AS allMoney,
+        IFNULL( success.num, 0 ) AS entryNum,
+        IFNULL( success.money, 0 ) AS entryMoney,
+        IFNULL( fail.num, 0 ) AS notNum,
+        IFNULL( fail.money, 0 ) AS notMoney
+        FROM
+        (
+        SELECT
+        f_billstatus AS billStatus,
+        f_billtype AS billType,
+        COUNT( 1 ) AS num,
+        IFNULL( SUM( f_money ), 0 ) AS money
+        FROM
+        t_warehousebills
+        WHERE
+        del_flag = 0
+        AND f_billtype IN ('CK','RK')
+        <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+            and f_bsdate &gt;= #{timeInterval[0]}
+        </if>
+        <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+            and f_bsdate &lt;= #{timeInterval[1]}
+        </if>
+        GROUP BY
+        f_billtype
+        ) temp
+        LEFT JOIN (
+        SELECT
+        f_billstatus AS billStatus,
+        f_billtype AS billType,
+        COUNT( 1 ) AS num,
+        IFNULL( SUM( f_money ), 0 ) AS money
+        FROM
+        t_warehousebills
+        WHERE
+        del_flag = 0
+        AND f_billtype IN ('CK','RK')
+        AND f_billstatus = 6
+        <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+            and f_bsdate &gt;= #{timeInterval[0]}
+        </if>
+        <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+            and f_bsdate &lt;= #{timeInterval[1]}
+        </if>
+        GROUP BY
+        f_billtype
+        ) success ON temp.billType = success.billType
+        LEFT JOIN (
+        SELECT
+        f_billstatus AS billStatus,
+        f_billtype AS billType,
+        COUNT( 1 ) AS num,
+        IFNULL( SUM( f_money ), 0 ) AS money
+        FROM
+        t_warehousebills
+        WHERE
+        del_flag = 0
+        AND f_billtype IN ('CK','RK')
+        AND f_billstatus != 6
+        <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+            and f_bsdate &gt;= #{timeInterval[0]}
+        </if>
+        <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+            and f_bsdate &lt;= #{timeInterval[1]}
+        </if>
+        GROUP BY
+        f_billtype
+        ) fail ON temp.billType = fail.billType
+    </select>
 </mapper>