소스 검색

问题修改

zhs 2 년 전
부모
커밋
1517029bf2

+ 11 - 0
src/main/java/com/tld/controller/QueryListController.java

@@ -331,5 +331,16 @@ public class QueryListController {
         return queryListService.getPdaTask(user);
     }
 
+    /**
+     * 查询pda任务数量
+     * @param user 参数
+     * @return 返回结果
+     */
+    @GetMapping("getTaskNum")
+    public Map<String, Object> getTaskNum(User user){
+        return queryListService.getTaskNum(user);
+    }
+
+
 }
 

+ 22 - 0
src/main/java/com/tld/mapper/QueryListMapper.java

@@ -91,4 +91,26 @@ public interface QueryListMapper {
     List<Map<String, Object>> getTestTwo();
 
     List<Map<String, Object>> getPdaTask(User user);
+
+    int getShangjia(User user);
+
+    int getJihua(User user);
+
+    int getYaoqing(User user);
+
+    int getBanChenPin(User user);
+
+    int getChanChenPin(User user);
+
+    int getXiaoShou(User user);
+
+    int getQiTaRu(User user);
+
+    int getQiTaChu(User user);
+
+    int getYiKu(User user);
+
+    int getZhuiSu(User user);
+
+    int getBanChenPinChu(User user);
 }

+ 2 - 0
src/main/java/com/tld/service/QueryListService.java

@@ -69,4 +69,6 @@ public interface QueryListService {
     Map<String, Object> getFinishedGoods(ReceiveGoods receiveGoods);
 
     Map<String, Object> getPdaTask(User user);
+
+    Map<String, Object> getTaskNum(User user);
 }

+ 25 - 0
src/main/java/com/tld/service/impl/QueryListServiceImpl.java

@@ -903,4 +903,29 @@ public class QueryListServiceImpl implements QueryListService {
         }
         return map;
     }
+
+    @Override
+    public Map<String, Object> getTaskNum(User user) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            map.put("shangjia", queryListMapper.getShangjia(user));//上架入库
+            map.put("jiahua", queryListMapper.getJihua(user));//计划出库
+            map.put("yaoqing", queryListMapper.getYaoqing(user));//邀请出库
+            map.put("banchengpin", queryListMapper.getBanChenPin(user));//半成品入库
+            map.put("chanchengpin", queryListMapper.getChanChenPin(user));//产成品入库
+            map.put("chanchengpinchuku", queryListMapper.getBanChenPinChu(user));//半成品出库
+            map.put("xiaoshou", queryListMapper.getXiaoShou(user));//销售发货
+            map.put("qitaruku", queryListMapper.getQiTaRu(user));//其他入库
+            map.put("qitachuku", queryListMapper.getQiTaChu(user));//其他出库
+            map.put("yiku", queryListMapper.getYiKu(user));//移库
+            map.put("zhuisu", queryListMapper.getZhuiSu(user));//发货追溯
+
+            map.put("msg", "200");
+        } catch (Exception e){
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
 }

+ 113 - 0
src/main/resources/mapper/QueryListMappeer.xml

@@ -1261,6 +1261,119 @@
         </trim>
         ORDER BY a.id DESC
     </select>
+    <!-- 查询质检单任务数量 -->
+    <select id="getShangjia" resultType="int">
+        select count(*) from tld_receive_goods where (warehousing_num + 0) <![CDATA[<]]> (qualified_num + 0)
+    </select>
+    <!-- 查询生产领料任务数量 -->
+    <select id="getJihua" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_ask_goods a
+            JOIN tld_material b on a.material_id = b.tld_id
+        WHERE
+            ( a.out_num + 0 ) <![CDATA[<]]> (
+            a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+            and b.part_type != '半成品' and b.part_type != '产成品'
+    </select>
+    <!-- 查询非生产领料任务数量 -->
+    <select id="getYaoqing" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_invite a
+            JOIN tld_material b on a.material_id = b.tld_id
+        WHERE
+            ( a.out_num + 0 ) <![CDATA[<]]> (
+            a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+          and b.part_type != '半成品' and b.part_type != '产成品'
+    </select>
+    <!-- 查询半成品入库任务数量 -->
+    <select id="getBanChenPin" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_notice a
+            join tld_material b on a.material_id = b.tld_id
+        where b.part_type = "半成品" and (warehousing_num + 0) <![CDATA[<]]> (
+        a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+    </select>
+    <!-- 查询产成品入库任务数量 -->
+    <select id="getChanChenPin" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_notice a
+            JOIN tld_material b on a.material_id = b.tld_id
+        where b.part_type = "产成品" and (warehousing_num + 0) <![CDATA[<]]> (
+            a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+    </select>
+    <!-- 销售发货任务数量 -->
+    <select id="getXiaoShou" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_delivery a
+            JOIN tld_material b ON a.material_id = b.tld_id
+        where (out_num + 0) <![CDATA[<]]> (
+        a.gs_delivery_num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId}) and a.status = "0"
+    </select>
+    <!-- 查询其他入库任务数量 -->
+    <select id="getQiTaRu" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_notices a
+            JOIN tld_material b ON a.material_id = b.tld_id
+        where (a.warehousing_num + 0) <![CDATA[<]]> (
+        a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+    </select>
+    <!-- 查询其他出库任务数量 -->
+    <select id="getQiTaChu" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_enquiry a
+            JOIN tld_material b ON a.material_id = b.tld_id
+        where (a.out_num + 0) <![CDATA[<]]> (
+            a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+    </select>
+    <!-- 查询移库任务数量 -->
+    <select id="getYiKu" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_warehouse_transfer a
+            JOIN tld_material b ON a.material_id = b.tld_id
+        where (a.out_num + 0) <![CDATA[<]]> (
+            a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+    </select>
+    <!-- 查询发货追溯任务数量 -->
+    <select id="getZhuiSu" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_warehouse_transfer a
+            JOIN tld_material b ON a.material_id = b.tld_id
+        where (a.out_num + 0) <![CDATA[<]]> (
+            a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+    </select>
+    <!-- 查询发货追溯任务数量 -->
+    <select id="getBanChenPinChu" resultType="int">
+        SELECT
+            count(*)
+        FROM
+            tld_ask_goods a
+            JOIN tld_material b on a.material_id = b.tld_id
+        WHERE
+            ( a.out_num + 0 ) <![CDATA[<]]> (
+            a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+            and b.part_type = '半成品'
+    </select>
+
+
+
 
     <select id="storageLocationNum" resultType="java.util.Map">
         SELECT