소스 검색

2023年11月6日14:33:04

纪新园 1 년 전
부모
커밋
68ea8dbf59

+ 5 - 3
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java

@@ -18,7 +18,7 @@ import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor;
 
 /**
  * 通用配置
- * 
+ *
  * @author ruoyi
  */
 @Configuration
@@ -56,7 +56,9 @@ public class ResourcesConfig implements WebMvcConfigurer
         registry.addInterceptor(bulkWareHouseInterceptor).addPathPatterns("/bulkWareHouse/**");
         registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
         registry.addInterceptor(tSeapriceQueryLogInterceptor).addPathPatterns("/**");
-        registry.addInterceptor(signInterceptor).addPathPatterns("/open/wms/**").addPathPatterns("/api/open/wareHouse/**");
+        registry.addInterceptor(signInterceptor).addPathPatterns("/open/wms/**")
+                .addPathPatterns("/api/open/wareHouse/**")
+        ;
     }
 
     /**
@@ -78,4 +80,4 @@ public class ResourcesConfig implements WebMvcConfigurer
         source.registerCorsConfiguration("/**", config);
         return new CorsFilter(source);
     }
-}
+}

+ 144 - 141
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/impl/ForeignHttpServiceImpl.java

@@ -4,18 +4,17 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.json.JSONObject;
 import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.service.ITWarehouseService;
-import com.ruoyi.ccb.domain.*;
+import com.ruoyi.ccb.domain.QueryLowerPositionR;
 import com.ruoyi.ccb.service.ForeignHttpService;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.request.InventoryQueryRequest;
 import com.ruoyi.warehouseBusiness.response.InventoryQueryResponse;
 import com.ruoyi.warehouseBusiness.response.InventoryQueryTwoResponse;
-import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
 import lombok.AllArgsConstructor;
-import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 import java.util.*;
 
 /**
@@ -25,27 +24,27 @@ import java.util.*;
  */
 @Service
 @AllArgsConstructor
-public class ForeignHttpServiceImpl implements ForeignHttpService{
+public class ForeignHttpServiceImpl implements ForeignHttpService {
 
     @Autowired
     private ITWarehouseService itWarehouseService;
 
     @Override
     public QueryLowerPositionR queryLowerPositionV1(String position) {
-        List<Map<String,Object>> mapList = new ArrayList<>();
+        List<Map<String, Object>> mapList = new ArrayList<>();
         TWarehouse tWarehouse = new TWarehouse();
         tWarehouse.setDelFlag("0");
         tWarehouse.setfStatus("0");
-        if (ObjectUtil.isNotNull(position)){
+        if (ObjectUtil.isNotNull(position)) {
             tWarehouse.setParentId(Long.valueOf(position));
-        }else {
+        } else {
             tWarehouse.setParentId(100l);
         }
         List<TWarehouse> list = itWarehouseService.selectTWarehouseList(tWarehouse);
-        for (TWarehouse tWarehouse_:list) {
-            Map<String,Object> map = new HashMap<>();
-            map.put("code",tWarehouse_.getfId());
-            map.put("name",tWarehouse_.getfName());
+        for (TWarehouse tWarehouse_ : list) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("code", tWarehouse_.getfId());
+            map.put("name", tWarehouse_.getfName());
             mapList.add(map);
         }
         QueryLowerPositionR queryLowerPositionR = new QueryLowerPositionR();
@@ -57,16 +56,16 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
 
     @Override
     public Map<String, Object> queryPositionV1(String position) {
-        Map<String,Object> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
         TWarehouse tWarehouse = itWarehouseService.selectByCode(position);
-        if (ObjectUtil.isNotNull(tWarehouse)){
-            map.put("code",tWarehouse.getfId());
-            map.put("name",tWarehouse.getfName());
+        if (ObjectUtil.isNotNull(tWarehouse)) {
+            map.put("code", tWarehouse.getfId());
+            map.put("name", tWarehouse.getfName());
         }
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","成功");
-        mapR.put("data",map);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "成功");
+        mapR.put("data", map);
         return mapR;
     }
 
@@ -84,9 +83,8 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
                                                                String materialQuality,
                                                                String level,
                                                                Integer pageNo,
-                                                               Integer pageSize)
-    {
-        return itWarehouseService.queryGoodsAccountByPageV1(warehouseCode,ownerSocialIdentifier,ownerCode, ownerName, goodsName, specifications,
+                                                               Integer pageSize) {
+        return itWarehouseService.queryGoodsAccountByPageV1(warehouseCode, ownerSocialIdentifier, ownerCode, ownerName, goodsName, specifications,
                 producing, materialQuality, level, pageNo, pageSize);
 
     }
@@ -95,51 +93,51 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 查询台账明细
      */
     @Override
-    public List<Map<String, Object>> queryGoodsAccountDetailByPageV1(String warehouseCode,String ownerName,String ownerCode,String ownerSocialIdentifier,String goodsName,String specifications,
-                                                                     String producing,String materialQuality,String level, String receiptDoc,String billOfLading,
-                                                                     String areaName,String areaCode,String slotName,String slotCode,Integer pageNo,Integer pageSize){
+    public List<Map<String, Object>> queryGoodsAccountDetailByPageV1(String warehouseCode, String ownerName, String ownerCode, String ownerSocialIdentifier, String goodsName, String specifications,
+                                                                     String producing, String materialQuality, String level, String receiptDoc, String billOfLading,
+                                                                     String areaName, String areaCode, String slotName, String slotCode, Integer pageNo, Integer pageSize) {
         return itWarehouseService.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, ownerSocialIdentifier, goodsName, specifications,
                 producing, materialQuality, level, receiptDoc, billOfLading, areaName, areaCode, slotName, slotCode, pageNo, pageSize);
     }
 
     /**
-     *  获取仓库详细信息
+     * 获取仓库详细信息
      */
     @Override
     public Map<String, Object> getWareHouseInfo(String wareHouseId) {
-        Map<String,Object> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
         TWarehouse tWarehouse = itWarehouseService.getWareHouseInfo(wareHouseId);
-        if (ObjectUtil.isNotNull(tWarehouse)){
-            map.put("wareHouseId",tWarehouse.getfId());
-            map.put("name",tWarehouse.getfName());
-            map.put("type","");
-            map.put("scope","");
-            map.put("area","");
+        if (ObjectUtil.isNotNull(tWarehouse)) {
+            map.put("wareHouseId", tWarehouse.getfId());
+            map.put("name", tWarehouse.getfName());
+            map.put("type", "");
+            map.put("scope", "");
+            map.put("area", "");
         }
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",map);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", map);
         return mapR;
     }
 
     /**
-     *  获取最新的库存数据
+     * 获取最新的库存数据
      */
     @Override
     public Map<String, Object> getStorageInfo(String wareHouseId) {
-        Map<String,Object> mapR = new HashMap<>();
+        Map<String, Object> mapR = new HashMap<>();
 
-        Map<String,Object> map= itWarehouseService.getStorageInfo(wareHouseId);
+        Map<String, Object> map = itWarehouseService.getStorageInfo(wareHouseId);
 
-        if (map == null){
-            mapR.put("data",new HashMap<>());
-        }else {
-            mapR.put("data",map);
+        if (map == null) {
+            mapR.put("data", new HashMap<>());
+        } else {
+            mapR.put("data", map);
         }
 
-        mapR.put("code","0");
-        mapR.put("msg","OK");
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
         return mapR;
     }
 
@@ -147,29 +145,33 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 库存吞吐趋势信息
      */
     @Override
-    public Map<String, Object> getStorageTrend(String wareHouseId,String startTime,String endTime){
-        Map<String,Object> data = new HashMap<>();
+    public Map<String, Object> getStorageTrend(String wareHouseId, String startTime, String endTime) {
+        Map<String, Object> data = new HashMap<>();
 
-        List<Map<String,Object>> storageInfo = itWarehouseService.getTimeStorageInfo(wareHouseId,startTime,endTime);
+        System.out.println("=================仓库id:=================" + wareHouseId);
+        System.out.println("=================开始时间:=================" + startTime);
+        System.out.println("=================结束时间:=================" + endTime);
+
+        List<Map<String, Object>> storageInfo = itWarehouseService.getTimeStorageInfo(wareHouseId, startTime, endTime);
         storageInfo.removeAll(Collections.singleton(null));
-        if (storageInfo == null){
-            data.put("storageInfo", new ArrayList<Map<String,Object>>());
-        }else {
+        if (storageInfo == null) {
+            data.put("storageInfo", new ArrayList<Map<String, Object>>());
+        } else {
             data.put("storageInfo", storageInfo);
         }
 
-        List<Map<String, Object>> throughputInfo = itWarehouseService.getTimeThroughputInfo(wareHouseId,startTime,endTime);
+        List<Map<String, Object>> throughputInfo = itWarehouseService.getTimeThroughputInfo(wareHouseId, startTime, endTime);
         throughputInfo.removeAll(Collections.singleton(null));
-        if (throughputInfo == null){
-            data.put("throughputInfo", new ArrayList<Map<String,Object>>());
-        }else {
+        if (throughputInfo == null) {
+            data.put("throughputInfo", new ArrayList<Map<String, Object>>());
+        } else {
             data.put("throughputInfo", throughputInfo);
         }
 
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
@@ -177,28 +179,28 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 货物保管信息
      */
     @Override
-    public Map<String, Object> getCargoInfo(String wareHouseId,String startTime,String endTime){
-        Map<String,Object> data = new HashMap<>();
+    public Map<String, Object> getCargoInfo(String wareHouseId, String startTime, String endTime) {
+        Map<String, Object> data = new HashMap<>();
 
         //质押保管
-        Map<String, Object> normaGoods = itWarehouseService.getCargoInfo(wareHouseId,startTime,endTime,"0");
-        if (normaGoods != null){
+        Map<String, Object> normaGoods = itWarehouseService.getCargoInfo(wareHouseId, startTime, endTime, "0");
+        if (normaGoods != null) {
             data.put("normaGoods", normaGoods.get("FGrossweight"));
         }
 
         //普通保管
-        Map<String, Object> pledgeGoods = itWarehouseService.getCargoInfo(wareHouseId,startTime,endTime,null);
-        if (pledgeGoods != null){
+        Map<String, Object> pledgeGoods = itWarehouseService.getCargoInfo(wareHouseId, startTime, endTime, null);
+        if (pledgeGoods != null) {
             data.put("pledgeGoods", pledgeGoods.get("FGrossweight"));
         }
 
 
-        List<Map<String, Object>> goodsList = itWarehouseService.getGoodsList(wareHouseId,startTime,endTime);
+        List<Map<String, Object>> goodsList = itWarehouseService.getGoodsList(wareHouseId, startTime, endTime);
         data.put("goods", goodsList);
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
@@ -206,26 +208,26 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 仓库保管趋势
      */
     @Override
-    public Map<String, Object> getCargoInfoTrend(String wareHouseId,String startTime,String endTime){
-        Map<String,Object> data = new HashMap<>();
+    public Map<String, Object> getCargoInfoTrend(String wareHouseId, String startTime, String endTime) {
+        Map<String, Object> data = new HashMap<>();
 
         //报税现货
-        List<Map<String, Object>> freeTaxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"1");
+        List<Map<String, Object>> freeTaxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId, startTime, endTime, "1");
         data.put("freeTaxCurGoods", freeTaxCurGoods);
         //非报税现货
-        List<Map<String, Object>> taxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"2");
+        List<Map<String, Object>> taxCurGoods = itWarehouseService.getCargoInfoTrend(wareHouseId, startTime, endTime, "2");
         data.put("taxCurGoods", taxCurGoods);
         //非报税期货
-        List<Map<String, Object>> taxForGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"非保税期货");
+        List<Map<String, Object>> taxForGoods = itWarehouseService.getCargoInfoTrend(wareHouseId, startTime, endTime, "非保税期货");
         data.put("taxForGoods", taxForGoods);
         //报税期货
-        List<Map<String, Object>> freeTaxForGoods = itWarehouseService.getCargoInfoTrend(wareHouseId,startTime,endTime,"保税期货");
+        List<Map<String, Object>> freeTaxForGoods = itWarehouseService.getCargoInfoTrend(wareHouseId, startTime, endTime, "保税期货");
         data.put("freeTaxForGoods", freeTaxForGoods);
 
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
@@ -233,25 +235,25 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 获取货物品类top值
      */
     @Override
-    public Map<String, Object> getStorageTop(String wareHouseId, Integer countType, Integer topCnt){
+    public Map<String, Object> getStorageTop(String wareHouseId, Integer countType, Integer topCnt) {
         List<Map<String, Object>> data = new ArrayList<>();
-        if (1 == countType){
-             data = itWarehouseService.getStorageTopS(wareHouseId,countType,topCnt);
-        }else if (2 == countType){
-             data = itWarehouseService.getStorageTop(wareHouseId,countType,topCnt);
+        if (1 == countType) {
+            data = itWarehouseService.getStorageTopS(wareHouseId, countType, topCnt);
+        } else if (2 == countType) {
+            data = itWarehouseService.getStorageTop(wareHouseId, countType, topCnt);
         }
 
-        if (data.size() > 0){
-            for (int i = 0; i < data.size(); i++){
+        if (data.size() > 0) {
+            for (int i = 0; i < data.size(); i++) {
                 Map<String, Object> map = data.get(i);
                 map.put("top", i + 1);
             }
         }
 
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
@@ -259,21 +261,21 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 获取货主仓库top值
      */
     @Override
-    public Map<String, Object> getGoodsTop(String wareHouseId, Integer countType, Integer topCnt){
+    public Map<String, Object> getGoodsTop(String wareHouseId, Integer countType, Integer topCnt) {
 
-        List<Map<String, Object>> data = itWarehouseService.getGoodsTop(wareHouseId,countType,topCnt);
+        List<Map<String, Object>> data = itWarehouseService.getGoodsTop(wareHouseId, countType, topCnt);
 
-        if (data.size() > 0){
-            for (int i = 0; i < data.size(); i++){
+        if (data.size() > 0) {
+            for (int i = 0; i < data.size(); i++) {
                 Map<String, Object> map = data.get(i);
                 map.put("top", i + 1);
             }
         }
 
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
@@ -281,15 +283,15 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 过户交易信息获取
      */
     @Override
-    public Map<String, Object> getTransferInfo(String wareHouseId,String startTime,String endTime){
-        Map<String,Object> data = new HashMap<>();
+    public Map<String, Object> getTransferInfo(String wareHouseId, String startTime, String endTime) {
+        Map<String, Object> data = new HashMap<>();
 
         //普通过户量
         List<Map<String, Object>> normalTransferList = itWarehouseService.getTransferTransaction(wareHouseId, startTime, endTime);
         normalTransferList.removeAll(Collections.singleton(null));
-        if (normalTransferList == null){
-            data.put("normalTransferList", new ArrayList<Map<String,Object>>());
-        }else {
+        if (normalTransferList == null) {
+            data.put("normalTransferList", new ArrayList<Map<String, Object>>());
+        } else {
             data.put("normalTransferList", normalTransferList);
         }
 
@@ -297,41 +299,41 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         //仓单过户量
         List<Map<String, Object>> receiptTransferList = new ArrayList<>();
         receiptTransferList.removeAll(Collections.singleton(null));
-        if (receiptTransferList == null){
-            data.put("receiptTransferList", new ArrayList<Map<String,Object>>());
-        }else {
+        if (receiptTransferList == null) {
+            data.put("receiptTransferList", new ArrayList<Map<String, Object>>());
+        } else {
             data.put("receiptTransferList", receiptTransferList);
         }
 
 
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
     /**
-     *  最新的作业统计
+     * 最新的作业统计
      */
     @Override
     public Map<String, Object> getWorkInfo(String wareHouseId) {
         Map<String, Object> data = new HashMap<>();
 
         //入库
-        Map<String,Object> map= itWarehouseService.getWorkInfo(wareHouseId, "SJRK");
+        Map<String, Object> map = itWarehouseService.getWorkInfo(wareHouseId, "SJRK");
         data.put("input", map.get("Fgrossweight"));
         data.put("inputReceiptCnt", map.get("count"));
 
         //出库
-        Map<String,Object> map2= itWarehouseService.getWorkInfo(wareHouseId, "SJCK");
+        Map<String, Object> map2 = itWarehouseService.getWorkInfo(wareHouseId, "SJCK");
         data.put("output", map2.get("Fgrossweight"));
         data.put("outputReceiptCnt", map2.get("count"));
 
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
@@ -339,32 +341,32 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * 作业统计趋势数据
      */
     @Override
-    public Map<String, Object> getWorkTrend(String wareHouseId,String startTime,String endTime){
-        Map<String,Object> data = new HashMap<>();
+    public Map<String, Object> getWorkTrend(String wareHouseId, String startTime, String endTime) {
+        Map<String, Object> data = new HashMap<>();
 
         //入库单据
-        List<Map<String, Object>> inputReceiptList = itWarehouseService.getWorkTrend(wareHouseId,startTime,endTime, "SJRK");
+        List<Map<String, Object>> inputReceiptList = itWarehouseService.getWorkTrend(wareHouseId, startTime, endTime, "SJRK");
         inputReceiptList.removeAll(Collections.singleton(null));
-        if (inputReceiptList == null){
-            data.put("inputReceiptList", new ArrayList<Map<String,Object>>());
-        }else {
+        if (inputReceiptList == null) {
+            data.put("inputReceiptList", new ArrayList<Map<String, Object>>());
+        } else {
             data.put("inputReceiptList", inputReceiptList);
         }
 
         //出库单据
-        List<Map<String, Object>> outputReceiptList = itWarehouseService.getWorkTrend(wareHouseId,startTime,endTime, "SJCK");
+        List<Map<String, Object>> outputReceiptList = itWarehouseService.getWorkTrend(wareHouseId, startTime, endTime, "SJCK");
         outputReceiptList.removeAll(Collections.singleton(null));
-        if (outputReceiptList == null){
-            data.put("outputReceiptList", new ArrayList<Map<String,Object>>());
-        }else {
+        if (outputReceiptList == null) {
+            data.put("outputReceiptList", new ArrayList<Map<String, Object>>());
+        } else {
             data.put("outputReceiptList", outputReceiptList);
         }
 
 
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
-        mapR.put("data",data);
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
+        mapR.put("data", data);
         return mapR;
     }
 
@@ -372,10 +374,10 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      * WMS作业通知数字仓库系统接
      */
     @Override
-    public Map<String, Object> workNoticeV1(JSONObject jsonObject){
-        Map<String,Object> mapR = new HashMap<>();
-        mapR.put("code","0");
-        mapR.put("msg","OK");
+    public Map<String, Object> workNoticeV1(JSONObject jsonObject) {
+        Map<String, Object> mapR = new HashMap<>();
+        mapR.put("code", "0");
+        mapR.put("msg", "OK");
         return mapR;
     }
 
@@ -386,7 +388,8 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
     public List<InventoryQueryResponse> inventoryQueries(InventoryQueryRequest inventoryQueryRequest) {
         return itWarehouseService.inventoryQueries(inventoryQueryRequest);
     }
-/**
+
+    /**
      * 获取仓库详细信息
      */
     @Override
@@ -399,7 +402,7 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      */
     @Override
     public int receiptRegister(String ownerName, String identifier, String numbers) {
-        return itWarehouseService.receiptRegister(ownerName,identifier,numbers);
+        return itWarehouseService.receiptRegister(ownerName, identifier, numbers);
     }
 
     /**
@@ -407,7 +410,7 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      */
     @Override
     public TCorps verification(String name, String identifier) {
-        return itWarehouseService.verification(name,identifier);
+        return itWarehouseService.verification(name, identifier);
     }
 
     /**
@@ -423,6 +426,6 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
      */
     @Override
     public int receiptCancel(String ownerName, String identifier, String numbers) {
-        return itWarehouseService.receiptCancel(ownerName,identifier,numbers);
+        return itWarehouseService.receiptCancel(ownerName, identifier, numbers);
     }
 }

+ 34 - 32
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -530,7 +530,7 @@
             <if test="endTime != null and endTime != ''">
                 and f_bsdate &lt;= #{endTime}
             </if>
-            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+            <if test="(startTime == null and endTime == null) or (startTime == '' and endTime == '')">
                 and f_bsdate>=date(now()) and f_bsdate &lt; DATE_ADD(date(now()),INTERVAL 1 DAY)
             </if>
         </where>
@@ -551,7 +551,7 @@
             <if test="endTime != null and endTime != ''">
                 and f_bsdate &lt;= #{endTime}
             </if>
-            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+            <if test="(startTime == null and endTime == null) or (startTime == '' and endTime == '')">
                 and f_bsdate>=date(now()) and f_bsdate &lt; DATE_ADD(date(now()),INTERVAL 1 DAY)
             </if>
         </where>
@@ -572,7 +572,7 @@
             <if test="endTime != null and endTime != ''">
                 and f_bsdate &lt;= #{endTime}
             </if>
-            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+            <if test="(startTime == null and endTime == null) or (startTime == '' and endTime == '')">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(f_bsdate)
             </if>
         </where>
@@ -580,34 +580,36 @@
 
     <select id="getGoodsList" resultType="map">
         SELECT
-            SDD.dict_label AS goodsType,
-            ROUND( SUM(TW.f_grossweight) / 1000, 2 ) as count,
-            round(
-                SUM(TW.f_grossweight) * 100 /(
-                  SELECT
-                    SUM(f_grossweight) as total
-                  FROM
-                    t_warehousebills
-                ),
-                2
-            ) as rate
+        SDD.dict_label AS goodsType,
+        IF(da.count,da.count,0.00)  AS count,
+        IF(da.rate ,da.rate ,0.00) AS rate
         FROM
-            t_warehousebills TW
-            LEFT JOIN sys_dict_data SDD ON SDD.dict_type = 'data_trademodes' AND SDD.dict_value = TW.f_trademodeid
-        <where>
-            TW.f_warehouseid = #{wareHouseId}
-            <if test="startTime != null and startTime != ''">
-                and TW.f_bsdate >= #{startTime}
-            </if>
-            <if test="endTime != null and endTime != ''">
-                and TW.f_bsdate &lt;= #{endTime}
-            </if>
-            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
-                and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)
-            </if>
-        </where>
+        sys_dict_data SDD
+        LEFT JOIN (SELECT
+        SD.dict_code AS dict_code,
+        ROUND( SUM( TW.f_grossweight ) / 1000, 2 ) AS count,
+        round( SUM( TW.f_grossweight ) * 100 /( SELECT SUM( f_grossweight ) AS total FROM t_warehousebills ), 2 ) AS rate
+        FROM
+        sys_dict_data SD
+        JOIN t_warehousebills TW  ON  SD.dict_value = TW.f_trademodeid
+        WHERE
+        TW.f_warehouseid = #{wareHouseId}
+        <if test="startTime != null and startTime != ''">
+            and TW.f_bsdate >= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            and TW.f_bsdate &lt;= #{endTime}
+        </if>
+        <if test="(startTime == null and endTime == null) or (startTime == '' and endTime == '')">
+            and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)
+        </if>
+        and SD.dict_type = 'data_trademodes'
+        GROUP BY
+        SD.dict_label) da on SDD.dict_code = da.dict_code
+        WHERE
+        SDD.dict_type = 'data_trademodes'
         GROUP BY
-            SDD.dict_label
+        SDD.dict_label
     </select>
 
     <select id="getCargoInfoTrend" resultType="map">
@@ -627,7 +629,7 @@
             <if test="endTime != null and endTime != ''">
                 and TW.f_bsdate &lt;= #{endTime}
             </if>
-            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+            <if test="(startTime == null and endTime == null) or (startTime == '' and endTime == '')">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)
             </if>
         </where>
@@ -690,7 +692,7 @@
             <if test="endTime != null and endTime != ''">
                 and f_bsdate &lt;= #{endTime}
             </if>
-            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+            <if test="(startTime == null and endTime == null) or (startTime == '' and endTime == '')">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(f_bsdate)
             </if>
         </where>
@@ -730,7 +732,7 @@
             <if test="endTime != null and endTime != ''">
                 and TW.f_bsdate &lt;= #{endTime}
             </if>
-            <if test="startTime == null and endTime == null and startTime == '' and endTime == ''">
+            <if test="(startTime == null and endTime == null) or (startTime == '' and endTime == '')">
                 and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(TW.f_bsdate)
             </if>
         </where>