Przeglądaj źródła

新增 农事系统基地管理迁移SAAS平台

zhaiyifei 11 miesięcy temu
rodzic
commit
0c9b9c0982

+ 2 - 4
src/main/java/com/yunfeiyun/agmp/fms/controller/WmsWarehouseController.java

@@ -51,12 +51,10 @@ public class WmsWarehouseController extends BaseController
     @PreAuthorize("@ss.hasPermi('wms:warehouse:list')")
     @GetMapping("/list")
     public TableDataInfo list(WmsWarehouseListReqVo wmsWarehouse) {
-        // boolean b = SecurityUtils.isValidate();
-        // TODO:昌黎项目无需过滤仓库
-        boolean b = false;
+        boolean b = SecurityUtils.isValidate();
         if (b) {
             List<String> warehouseIds = dataAuthUtil.getManagerWarehouse();
-            if (warehouseIds.size() == 0) {
+            if (warehouseIds.isEmpty()) {
                 return getDataTable(new ArrayList<>());
             }
             wmsWarehouse.setWarehouseIds(warehouseIds);

+ 30 - 33
src/main/resources/mapper/WmsWarehouseMapper.xml

@@ -10,45 +10,47 @@
     </sql>
 
     <select id="selectWmsWarehouseList" parameterType="WmsWarehouse" resultType="WmsWarehouse">
-        select WmsWarehouse.warehouseId, warehouseName, warehouseType, warehouseUsestatus, warehouseManager,
-        warehouseManagername, warehouseCreator, warehouseCreatorname, warehouseCreateddate,WmsWarehouse.tid
-        from WmsWarehouse
-        LEFT JOIN FmsLandHouse on WmsWarehouse.warehouseId = FmsLandHouse.warehouseId
+        select w.warehouseId, warehouseName, warehouseType, warehouseUsestatus, warehouseManager,
+            warehouseManagername, warehouseCreator, warehouseCreatorname, warehouseCreateddate, w.tid
+        FROM WmsWarehouse as w
+            LEFT JOIN FmsLandHouse AS f on w.warehouseId = f.warehouseId
         <where>
             <if test="warehouseName != null  and warehouseName != ''">and warehouseName like concat('%',
                 #{warehouseName}, '%')
             </if>
-            <if test="warehouseType != null  and warehouseType != '' and warehouseType != '-1'">and warehouseType =
-                #{warehouseType}
+            <if test="warehouseType != null  and warehouseType != '' and warehouseType != '-1'">
+                and warehouseType = #{warehouseType}
             </if>
             <if test="warehouseUsestatus != null  and warehouseUsestatus != ''">and warehouseUsestatus =
                 #{warehouseUsestatus}
             </if>
-            <if test="warehouseManager != null  and warehouseManager != ''">and warehouseManager = #{warehouseManager}
+            <if test="warehouseManager != null  and warehouseManager != ''">
+                and warehouseManager = #{warehouseManager}
             </if>
-            <if test="warehouseManagername != null  and warehouseManagername != ''">and warehouseManagername like
-                concat('%', #{warehouseManagername}, '%')
+            <if test="warehouseManagername != null  and warehouseManagername != ''">
+                and warehouseManagername like concat('%', #{warehouseManagername}, '%')
             </if>
-            <if test="warehouseCreator != null  and warehouseCreator != ''">and warehouseCreator = #{warehouseCreator}
+            <if test="warehouseCreator != null  and warehouseCreator != ''">
+                and warehouseCreator = #{warehouseCreator}
             </if>
-            <if test="warehouseCreatorname != null  and warehouseCreatorname != ''">and warehouseCreatorname like
-                concat('%', #{warehouseCreatorname}, '%')
+            <if test="warehouseCreatorname != null  and warehouseCreatorname != ''">
+                and warehouseCreatorname like concat('%', #{warehouseCreatorname}, '%')
             </if>
-            <if test="warehouseCreateddate != null  and warehouseCreateddate != ''">and warehouseCreateddate =
-                #{warehouseCreateddate}
+            <if test="warehouseCreateddate != null  and warehouseCreateddate != ''">
+                and warehouseCreateddate = #{warehouseCreateddate}
             </if>
             <if test="warehouseIds != null  and warehouseIds.size > 0">
-                and warehouseId in
+                and w.warehouseId in
                 <foreach item="warehouseId" collection="warehouseIds" open="(" separator="," close=")">
                     #{warehouseId}
                 </foreach>
             </if>
             <if test="landId != null and landId != ''">
-                and FmsLandHouse.landId = #{landId}
+                and f.landId = #{landId}
             </if>
-            <if test="tid != null and tid != '-1'">and WmsWarehouse.tid = #{tid}</if>
+            <if test="tid != null and tid != '-1'">and w.tid = #{tid}</if>
         </where>
-        group by WmsWarehouse.warehouseId
+        group by w.warehouseId
     </select>
 
     <select id="selectWmsWarehouseByWarehouseId" parameterType="String" resultType="WmsWarehouse">
@@ -58,24 +60,19 @@
     </select>
     <select id="selectUserManagerWarehouseIds" resultType="java.lang.String">
         (
-        SELECT
-        warehouseId
-        FROM
-        FmsLandHouse
-        WHERE
-        landId IN ( SELECT landId FROM FmsLand WHERE landManager = #{userId}
-        <if test="tid != null and tid != '-1'">and tid = #{tid}</if>
-        )
+            SELECT warehouseId
+            FROM FmsLandHouse
+            WHERE landId IN (
+                SELECT landId
+                FROM FmsLand
+                WHERE landManager = #{userId} and tid = #{tid}
+            )
         )
         UNION ALL
         (
-        SELECT
-        warehouseId
-        FROM
-        WmsWarehouse
-        WHERE
-        warehouseManager = #{userId}
-        <if test="tid != null and tid != '-1'">and tid = #{tid}</if>
+            SELECT warehouseId
+            FROM WmsWarehouse
+            WHERE warehouseManager = #{userId} and tid = #{tid}
         )
     </select>