Browse Source

[CODE]: 小程序:仓库、库存总账查询

maxianghua 4 years ago
parent
commit
12c2466941

+ 30 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/AppletsController.java

@@ -2,15 +2,19 @@ package com.ruoyi.web.controller.warehouse.warehouseBusiness;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.basicData.service.ITWarehouseService;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.service.ITWhgenlegService;
 import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +35,12 @@ public class AppletsController extends BaseController {
     @Autowired
     private ITWarehouseBillsService itWarehouseBillsService;
 
+    @Autowired
+    private ITWarehouseService  itWarehouseService;
+
+    @Autowired
+    private ITWhgenlegService tWhgenlegService;
+
     /**
      *  待办数
      */
@@ -108,6 +118,26 @@ public class AppletsController extends BaseController {
         return itWarehouseBillsService.addCreditItems(tEnclosure,warehousebillsitems,billsType,loginUser);
     }
 
+    /**
+     *  仓库
+     */
+    @GetMapping("/warehouse")
+    public TableDataInfo warehouse() {
+        startPage();
+        TWarehouse tWarehouse =new TWarehouse();
+        tWarehouse.setParentId(100L);
+        List<TWarehouse> list = itWarehouseService.selectTWarehouseList(tWarehouse);
+        return getDataTable(list);
+    }
 
+    /**
+     * 查询库存总账列表
+     */
+    @GetMapping("/tWhgenlegList")
+    public TableDataInfo warehouselist(TWhgenleg tWhgenleg) {
+        startPage();
+        List<Map<String, Object>> list = tWhgenlegService.selectWhgenlegList(tWhgenleg);
+        return getDataTable(list);
+    }
 
 }

+ 19 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java

@@ -220,6 +220,25 @@ public class TWhgenleg extends BaseEntity {
     @Excel(name = "仓库")
     private Long fLocation;
 
+    private String timeStartBsdate;
+    private String timeEndBsdate;
+
+    public String getTimeStartBsdate() {
+        return timeStartBsdate;
+    }
+
+    public void setTimeStartBsdate(String timeStartBsdate) {
+        this.timeStartBsdate = timeStartBsdate;
+    }
+
+    public String getTimeEndBsdate() {
+        return timeEndBsdate;
+    }
+
+    public void setTimeEndBsdate(String timeEndBsdate) {
+        this.timeEndBsdate = timeEndBsdate;
+    }
+
     public void setorgStorageDate(List<String> orgStorageDate) {
         this.orgStorageDate = orgStorageDate;
     }

+ 1 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -81,6 +81,7 @@ public interface TWhgenlegMapper {
     public int updateTWhgenlegData(@Param("map") Map<String, Object> map);
 
     List<Map<String, Object>> selectInventoryList(TWhgenleg tWhgenleg);
+    List<Map<String, Object>> selectWhgenlegList(TWhgenleg tWhgenleg);
 
     List<Map<String, Object>> selectGoodsList();
     List<Map<String, Object>> selectGoodsListWhouse(Long fId);

+ 1 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java

@@ -95,6 +95,7 @@ public interface ITWhgenlegService {
      */
     List<Map<String, Object>> selectDateFQtyblcListList();
 
+    List<Map<String, Object>> selectWhgenlegList(TWhgenleg tWhgenleg);
 
 
 }

+ 14 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -331,6 +331,20 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
         return countList;
     }
 
+    @Override
+    public List<Map<String, Object>> selectWhgenlegList(TWhgenleg tWhgenleg) {
+        if(StringUtils.isNotNull(tWhgenleg.getfWarehouseLocationid())){
+            // 获取仓库信息
+            TWarehouse tWarehouse =  tWarehouseMapper.selectTWarehouseById(tWhgenleg.getfWarehouseLocationid());
+            if(tWarehouse.getfLocation()==1){
+                tWhgenleg.setfLocation(1L);
+            }else {
+                tWhgenleg.setfLocation(0L);
+            }
+        }
+        return tWhgenlegMapper.selectWhgenlegList(tWhgenleg);
+    }
+
     /**
      *
      * @param fOriginalbilldate 根据该字段进行合并

+ 1 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -34,6 +34,7 @@
     <select id="selectTWarehouseList" parameterType="TWarehouse" resultMap="TWarehouseResult">
         <include refid="selectTWarehouseVo"/>
         <where>
+            <if test="parentId != null  and parentId != ''"> and parent_id = #{parentId} </if>
             <if test="ancestors != null  and ancestors != ''"> and ancestors like concat('%', #{ancestors}, '%')</if>
             <if test="fNo != null  and fNo != ''"> and f_no like concat('%', #{fNo}, '%')</if>
             <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>

+ 62 - 0
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -541,5 +541,67 @@
             <if test="warehouse.fMblno != null">and wh.f_mblno = #{warehouse.fMblno}</if>
         </where>
     </select>
+    <select id="selectWhgenlegList" resultType="java.util.Map">
+        select
+            DISTINCT
+            leg.f_id AS fId,
+            corp.f_name AS fCorpid,
+            DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
+            ware.f_warehouse_information AS fWarehouseids,
+            leg.f_mblno AS fMblno,
+            goods.f_name AS fGoodsids,
+            dict.dict_label AS fBusinessTypes,
+            leg.f_marks AS fMarks,
+            leg.f_qtyblc AS fQtyblc,
+            leg.f_grossweightblc AS fGrossweightblc,
+            leg.f_netweightblc AS fNetweightblc
+        FROM
+            t_whgenleg leg
+            LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
+            LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
+            LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
+            LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
+            LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
+        <where>
+            dict.status = '0'
+            AND dict.dict_type = 'storage_type'
+            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
+            <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
+            <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
+            <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
+            <if test='timeStartBsdate != null and timeStartBsdate!= ""'>
+                and leg.f_originalbilldate &gt;= #{timeStartBsdate}
+            </if>
+            <if test='timeEndBsdate != null  timeEndBsdate!= ""'>
+                and leg.f_originalbilldate &lt;= #{timeEndBsdate}
+            </if>
+            <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
+            <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
+            <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
+            <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
+            <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
+            <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
+            <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
+            <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
+            <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
+            <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
+            <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
+            <if test="fMarks != null  and fMarks != ''">and leg.f_marks = #{fMarks}</if>
+            <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
+            <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
+            <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
+            <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
+            <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
+            <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno = #{fCntrno}</if>
+            <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
+            <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
+            <if test="fLocation != null  and fLocation ==1 ">
+                and leg.f_warehouse_locationid = #{fWarehouseLocationid}
+            </if>
+            <if test="fLocation != null  and fLocation ==0 ">
+                and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')
+            </if>
+        </where>
+    </select>
 
 </mapper>