Browse Source

APP接口查询条件修正

Sun 3 years ago
parent
commit
5d73c76f9b

+ 1 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java

@@ -26,7 +26,7 @@ import com.ruoyi.system.service.ISysConfigService;
 
 /**
  * 参数配置 信息操作处理
- * 
+ *
  * @author ruoyi
  */
 @RestController
@@ -39,7 +39,6 @@ public class SysConfigController extends BaseController
     /**
      * 获取参数配置列表
      */
-    @PreAuthorize("@ss.hasPermi('system:config:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysConfig config)
     {

+ 3 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWarehousebillsitemsSummaryController.java

@@ -11,7 +11,6 @@ import com.ruoyi.reportManagement.domain.TWareHouseItemsExcel;
 import com.ruoyi.reportManagement.service.ITWhgenlegService;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
-import com.ruoyi.warehouseBusiness.service.ITWarehousebillsitemsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -34,9 +33,6 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
     private ITWarehouseBillsService itWarehouseBillsService;
 
     @Autowired
-    private ITWarehousebillsitemsService itWarehousebillsitemsService;
-
-    @Autowired
     private ITWhgenlegService itWhgenlegService;
 
     /**
@@ -79,12 +75,12 @@ public class TWarehousebillsitemsSummaryController extends BaseController {
     }
 
     /**
-     * 本月出入库列表
+     * 出入库列表
      */
     @GetMapping("/inAndOutStockMonthList")
-    public TableDataInfo inAndOutStockMonthList() {
+    public TableDataInfo inAndOutStockList() {
         startPage();
-        return getDataTable(itWarehousebillsitemsService.inAndOutStockMonthList());
+        return getDataTable(itWarehouseBillsService.inAndOutStockList());
     }
 
     /**

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

@@ -301,4 +301,11 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
      * @return
      */
     List<Map<String, Object>> selecStorageFeeList(TWarehouseBills tWarehousebills);
+
+    /**
+     * 出入库列表
+     * @param external 外部用户
+     * @return
+     */
+    public List<Map<String, Object>> inAndOutStockList(@Param("external") String external);
 }

+ 0 - 11
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsitemsMapper.java

@@ -299,15 +299,4 @@ public interface TWarehousebillsitemsMapper extends BaseMapper<TWarehousebillsit
                                                        @Param("beginDate") String beginDate,
                                                        @Param("endDate") String endDate,
                                                        @Param("external") String external);
-
-    /**
-     * 本月出入库列表
-     * @param beginDate 起始时间
-     * @param endDate 截止时间
-     * @param external 外部用户
-     * @return
-     */
-    public List<Map<String, Object>> inAndOutStockMonthList(@Param("beginDate") String beginDate,
-                                                       @Param("endDate") String endDate,
-                                                       @Param("external") String external);
 }

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

@@ -771,4 +771,11 @@ public interface ITWarehouseBillsService {
      */
     public Map<String, String> cycleStockStatistics();
 
+    /**
+     * 出入库列表
+     *
+     * @return
+     */
+    public List<Map<String, Object>> inAndOutStockList();
+
 }

+ 0 - 8
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehousebillsitemsService.java

@@ -83,12 +83,4 @@ public interface ITWarehousebillsitemsService {
      * @return
      */
     AjaxResult warehouseComparison(WarehouseDTO warehouseDto);
-
-    /**
-     * 本月出入库列表
-     *
-     * @return
-     */
-    public List<Map<String, Object>> inAndOutStockMonthList();
-
 }

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

@@ -7761,4 +7761,19 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         return String.valueOf(statistics.get("total"));
     }
 
+    /**
+     * 出入库列表
+     *
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> inAndOutStockList() {
+        String external = null;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if ("外部用户".equals(user.getDept().getDeptName())) {
+            external = user.getUserName();
+        }
+
+        return tWarehouseBillsMapper.inAndOutStockList(external);
+    }
 }

+ 0 - 18
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsitemsServiceImpl.java

@@ -231,22 +231,4 @@ public class TWarehousebillsitemsServiceImpl implements ITWarehousebillsitemsSer
         return AjaxResult.success(secondItemsList);
     }
 
-    /**
-     * 本月出入库列表
-     *
-     * @return
-     */
-    @Override
-    public List<Map<String, Object>> inAndOutStockMonthList() {
-        String beginOfMonth = DateUtils.beginOfMonth();
-        String endOfMonth = DateUtils.endOfMonth();
-        String external = null;
-        SysUser user = SecurityUtils.getLoginUser().getUser();
-        if ("外部用户".equals(user.getDept().getDeptName())) {
-            external = user.getUserName();
-        }
-
-        return tWarehousebillsitemsMapper.inAndOutStockMonthList(beginOfMonth, endOfMonth, external);
-    }
-
 }

+ 11 - 8
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -1068,7 +1068,7 @@
             <if test="beginDate != null and beginDate != ''">and f_bsdate &gt;= #{beginDate}</if>
             <if test="endDate != null and endDate != ''">and f_bsdate &lt; #{endDate}</if>
             <if test="external != null and external != ''">
-                and f_corpid = (select f_corpid from t_customer_contact where f_tel = #{external})
+                and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
             </if>
         </where>
     </select>
@@ -1077,9 +1077,9 @@
         select datediff(date_format(now(),'%Y-%m-%d'),date_format(min(f_bsdate),'%Y-%m-%d')) as days
         from t_whgenleg
         where
-            f_grossweightblc > 0
+            f_grossweightblc > 5
             <if test="external != null and external != ''">
-                and f_corpid = (select f_corpid from t_customer_contact where f_tel = #{external})
+                and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
             </if>
     </select>
 
@@ -1088,16 +1088,19 @@
             tw.f_mblno as fMblno,
             tg.f_name as goodsName,
             tw.f_bsdate as fBsdate,
+            tc.f_name as customerName,
             round(tw.f_grossweightblc / 1000, 2) as fGrossweight
         from t_whgenleg tw
-        left join t_goods tg ON tg.f_id = tw.f_goodsid
+        left join t_goods tg on tg.f_id = tw.f_goodsid
+        left join t_corps tc on tw.f_corpid = tc.f_id
         where
-            tw.f_grossweightblc > 0
-            and datediff(date_format(now(),'%Y-%m-%d'),date_format(tw.f_bsdate,'%Y-%m-%d')) > 60
+            tw.f_qtyD != 0
+            and tw.f_qtyblc != 0
+            and datediff(date_format(now(),'%Y-%m-%d'),date_format(tw.f_bsdate,'%Y-%m-%d')) > 180
             <if test="external != null and external != ''">
-                and tw.f_corpid = (select f_corpid from t_customer_contact where f_tel = #{external})
+                and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
             </if>
-        order by tw.f_bsdate desc
+        order by tw.f_bsdate
     </select>
 
 </mapper>

+ 20 - 4
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -2523,10 +2523,7 @@
             and w.f_bsdate &lt;= #{timeInterval[1]}
         </if>
         <if test="external != null and external != ''">
-            and w.f_warehouseid in (
-            select distinct f_warehouseid
-            from t_customer_contact t1 left join t_whgenleg t2 on t1.f_pid = t2.f_corpid
-            where f_tel = #{external})
+            and w.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
         </if>
         <if test="external == null or external == ''">${params.dataScope}</if>
             order by w.f_id desc
@@ -2851,4 +2848,23 @@
             ORDER BY w.f_bsdate DESC, w.f_bstime DESC,w.f_id DESC,w.f_billstatus
     </select>
 
+    <select id="inAndOutStockList" resultType="map">
+        select
+        tb.f_mblno as fMblno,
+        tg.f_name as goodsName,
+        tb.f_bsdate as fBsdate,
+        round(tb.f_grossweight / 1000, 2) as fGrossweight,
+        case tb.f_billtype when 'SJRK' then '入库' when 'SJCK' then '出库' end as fBilltype,
+        tb.create_by as createBy
+        from t_warehousebills tb
+        left join t_goods tg ON tg.f_id = tb.f_goodsid
+        where
+        if(tb.f_planqty is not null, tb.f_planqty != tb.f_qty, tb.f_id != '')
+        and tb.f_billstatus != 6
+        and tb.f_billtype in ('SJRK', 'SJCK')
+        <if test="external != null and external != ''">
+            and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
+        </if>
+        order by tb.f_bsdate desc
+    </select>
 </mapper>

+ 1 - 28
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

@@ -962,35 +962,8 @@
             <if test="beginDate != null and beginDate != ''">and ts.f_bsdate &gt;= #{beginDate}</if>
             <if test="endDate != null and endDate != ''">and ts.f_bsdate &lt;= #{endDate}</if>
             <if test="external != null and external != ''">
-                and tb.f_warehouseid in (
-                select distinct f_warehouseid
-                from t_customer_contact t1 left join t_whgenleg t2 on t1.f_pid = t2.f_corpid
-                where f_tel = #{external})
+                and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
             </if>
     </select>
 
-    <select id="inAndOutStockMonthList" resultType="map">
-        select
-            ts.f_mblno as fMblno,
-            tg.f_name as goodsName,
-            ts.f_bsdate as fBsdate,
-            round(ts.f_grossweight / 1000, 2) as fGrossweight,
-            case tb.f_billtype when 'SJRK' then '入库' when 'SJCK' then '出库' end as fBilltype,
-            ts.create_by as createBy
-        from t_warehousebillsitems ts
-        left join t_warehousebills tb on ts.f_mblno = tb.f_mblno and ts.f_billno = tb.f_billno
-        left join t_goods tg ON tg.f_id = ts.f_goodsid
-        where
-            ts.f_billstatus = '40'
-            and tb.f_billtype in ('SJRK', 'SJCK')
-            <if test="beginDate != null and beginDate != ''">and ts.f_bsdate &gt;= #{beginDate}</if>
-            <if test="endDate != null and endDate != ''">and ts.f_bsdate &lt;= #{endDate}</if>
-            <if test="external != null and external != ''">
-                and tb.f_warehouseid in (
-                select distinct f_warehouseid
-                from t_customer_contact t1 left join t_whgenleg t2 on t1.f_pid = t2.f_corpid
-                where f_tel = #{external})
-            </if>
-        order by ts.f_bsdate desc
-    </select>
 </mapper>