|  | @@ -3,6 +3,7 @@ package com.ruoyi.basicData.service.impl;
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONArray;
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 | 
	
		
			
				|  |  | +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
	
		
			
				|  |  |  import com.ruoyi.basicData.domain.TCorps;
 | 
	
		
			
				|  |  |  import com.ruoyi.basicData.domain.TCustomerContact;
 | 
	
		
			
				|  |  |  import com.ruoyi.basicData.domain.TWarehouseArea;
 | 
	
	
		
			
				|  | @@ -21,6 +22,7 @@ import com.ruoyi.common.exception.CustomException;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.DateUtils;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.SecurityUtils;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.StringUtils;
 | 
	
		
			
				|  |  | +import com.ruoyi.system.service.ISysDictDataService;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.domain.TAnnex;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
 | 
	
	
		
			
				|  | @@ -31,7 +33,6 @@ import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.request.InventoryQueryRequest;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.response.InventoryQueryResponse;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
 | 
	
		
			
				|  |  | -import org.apache.ibatis.annotations.Param;
 | 
	
		
			
				|  |  |  import org.springframework.beans.BeanUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
	
		
			
				|  | @@ -71,6 +72,9 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private BillnoSerialServiceImpl billnoSerialServiceImpl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ISysDictDataService sysDictDataService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 查询仓库
 | 
	
	
		
			
				|  | @@ -85,7 +89,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |          if (Objects.nonNull(tWarehouse)) {
 | 
	
		
			
				|  |  |              BeanUtils.copyProperties(tWarehouse, warehouseInfoVO);
 | 
	
		
			
				|  |  |              TAnnex annex = new TAnnex();
 | 
	
		
			
				|  |  | -            annex.setfPid(tWarehouse.getfId());
 | 
	
		
			
				|  |  | +            annex.setfPid(fId);
 | 
	
		
			
				|  |  |              annex.setfActid(AnnexActEnum.WAREHOUSE.getType());
 | 
	
		
			
				|  |  |              List<TAnnex> annexList = annexMapper.selectTAnnexList(annex);
 | 
	
		
			
				|  |  |              warehouseInfoVO.setAnnexList(annexList);
 | 
	
	
		
			
				|  | @@ -117,7 +121,43 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<TWarehouse> selectTWarehouseList(TWarehouse tWarehouse) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.selectTWarehouseList(tWarehouse);
 | 
	
		
			
				|  |  | +        List<TWarehouse> list = tWarehouseMapper.selectTWarehouseList(tWarehouse);
 | 
	
		
			
				|  |  | +        return list;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 查询仓库列表
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @param tWarehouse 仓库
 | 
	
		
			
				|  |  | +     * @return 仓库
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public List<WarehouseInfoVO> selectTWarehouseListAll(TWarehouse tWarehouse) {
 | 
	
		
			
				|  |  | +        List<TWarehouse> list = tWarehouseMapper.selectTWarehouseList(tWarehouse);
 | 
	
		
			
				|  |  | +        List<Long> ids = list.stream().map(TWarehouse::getfId).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +        TAnnex annex = new TAnnex();
 | 
	
		
			
				|  |  | +        StringBuilder pids = new StringBuilder();
 | 
	
		
			
				|  |  | +        for (Long id : ids) {
 | 
	
		
			
				|  |  | +            pids.append(id).append(",");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (ObjectUtils.isNotNull(pids) && pids.length() > 0) {
 | 
	
		
			
				|  |  | +            annex.setIds(pids.substring(0, pids.length() - 1));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        annex.setfActid(AnnexActEnum.WAREHOUSE.getType());
 | 
	
		
			
				|  |  | +        List<TAnnex> annexList = annexMapper.selectListByPId(annex);
 | 
	
		
			
				|  |  | +        List<WarehouseInfoVO> tWarehouseList = new ArrayList<>();
 | 
	
		
			
				|  |  | +        for (TWarehouse tWarehouse1 : list) {
 | 
	
		
			
				|  |  | +            WarehouseInfoVO warehouseInfoVO = new WarehouseInfoVO();
 | 
	
		
			
				|  |  | +            BeanUtils.copyProperties(tWarehouse1, warehouseInfoVO);
 | 
	
		
			
				|  |  | +            warehouseInfoVO.setfProperties(sysDictDataService.selectDictLabel("warehouse_properties", tWarehouse1.getfProperties()));
 | 
	
		
			
				|  |  | +            warehouseInfoVO.setfType(sysDictDataService.selectDictLabel("warehouse_type", tWarehouse1.getfType()));
 | 
	
		
			
				|  |  | +            warehouseInfoVO.setfGoodsType(sysDictDataService.selectDictLabel("data_goods_category", tWarehouse1.getfGoodsType()));
 | 
	
		
			
				|  |  | +            if (ObjectUtils.isNotNull(annexList) && annexList.size() > 0) {
 | 
	
		
			
				|  |  | +                warehouseInfoVO.setAnnexList(annexList.stream().filter(e -> ObjectUtils.isNotNull(e.getfPid()) && e.getfPid().equals(tWarehouse1.getfId())).collect(Collectors.toList()));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            tWarehouseList.add(warehouseInfoVO);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return tWarehouseList;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -131,7 +171,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |          SysUser user = SecurityUtils.getLoginUser().getUser();
 | 
	
		
			
				|  |  |          Long corpId = null;
 | 
	
		
			
				|  |  |          if ("外部用户".equals(user.getDept().getDeptName())) {
 | 
	
		
			
				|  |  | -            customerContact.setfTel(SecurityUtils.getLoginUser().getUser().getUserName());
 | 
	
		
			
				|  |  | +            customerContact.setfTel(user.getUserName());
 | 
	
		
			
				|  |  |              List<TCustomerContact> tCustomerContacts = customerContactMapper.selectTCustomerContactList(customerContact);
 | 
	
		
			
				|  |  |              if (CollectionUtils.isNotEmpty(tCustomerContacts)) {
 | 
	
		
			
				|  |  |                  corpId = tCustomerContacts.get(0).getfPid();
 | 
	
	
		
			
				|  | @@ -467,7 +507,8 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<TWarehouse> lazyList(TWarehouse tWarehouse) {
 | 
	
		
			
				|  |  |          if (StringUtils.isNull(tWarehouse.getParentId()) && StringUtils.isEmpty(tWarehouse.getfName()) &&
 | 
	
		
			
				|  |  | -                StringUtils.isNull(tWarehouse.getfStatus())) {
 | 
	
		
			
				|  |  | +                StringUtils.isNull(tWarehouse.getfStatus()) && StringUtils.isNull(tWarehouse.getfProperties()) &&
 | 
	
		
			
				|  |  | +                StringUtils.isNull(tWarehouse.getfAddr()) && StringUtils.isNull(tWarehouse.getfType()) && StringUtils.isNull(tWarehouse.getfGoodsType())) {
 | 
	
		
			
				|  |  |              tWarehouse.setParentId(0L);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return tWarehouseMapper.lazyList(tWarehouse);
 | 
	
	
		
			
				|  | @@ -489,19 +530,19 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |                                                                 String materialQuality,
 | 
	
		
			
				|  |  |                                                                 String level,
 | 
	
		
			
				|  |  |                                                                 Integer pageNo,
 | 
	
		
			
				|  |  | -                                                               Integer pageSize){
 | 
	
		
			
				|  |  | -        if ("null".equals(warehouseCode)){
 | 
	
		
			
				|  |  | +                                                               Integer pageSize) {
 | 
	
		
			
				|  |  | +        if ("null".equals(warehouseCode)) {
 | 
	
		
			
				|  |  |              warehouseCode = null;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.queryGoodsAccountByPageV1(warehouseCode, ownerSocialIdentifier,ownerCode,ownerName, goodsName, specifications,
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.queryGoodsAccountByPageV1(warehouseCode, ownerSocialIdentifier, ownerCode, ownerName, goodsName, specifications,
 | 
	
		
			
				|  |  |                  producing, materialQuality, level, pageNo, pageSize);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @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){
 | 
	
		
			
				|  |  | -        if ("null".equals(warehouseCode)){
 | 
	
		
			
				|  |  | +    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) {
 | 
	
		
			
				|  |  | +        if ("null".equals(warehouseCode)) {
 | 
	
		
			
				|  |  |              warehouseCode = null;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return tWarehouseMapper.queryGoodsAccountDetailByPageV1(warehouseCode, ownerName, ownerCode, ownerSocialIdentifier, goodsName, specifications,
 | 
	
	
		
			
				|  | @@ -509,7 +550,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  获取仓库详细信息
 | 
	
		
			
				|  |  | +     * 获取仓库详细信息
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public TWarehouse getWareHouseInfo(String wareHouseId) {
 | 
	
	
		
			
				|  | @@ -517,7 +558,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  获取最新的库存数据
 | 
	
		
			
				|  |  | +     * 获取最新的库存数据
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Map<String, Object> getStorageInfo(String wareHouseId) {
 | 
	
	
		
			
				|  | @@ -525,71 +566,71 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  库存吞吐趋势信息
 | 
	
		
			
				|  |  | +     * 库存吞吐趋势信息
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<Map<String, Object>> getTimeStorageInfo(String wareHouseId, String startTime, String endTime) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getTimeStorageInfo(wareHouseId,startTime,endTime);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getTimeStorageInfo(wareHouseId, startTime, endTime);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  库存吞吐趋势信息
 | 
	
		
			
				|  |  | +     * 库存吞吐趋势信息
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<Map<String, Object>> getTimeThroughputInfo(String wareHouseId, String startTime, String endTime) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getTimeThroughputInfo(wareHouseId,startTime,endTime);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getTimeThroughputInfo(wareHouseId, startTime, endTime);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  货物保管信息
 | 
	
		
			
				|  |  | +     * 货物保管信息
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Map<String, Object> getCargoInfo(String wareHouseId, String startTime, String endTime, String isPledge) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getCargoInfo(wareHouseId,startTime,endTime,isPledge);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getCargoInfo(wareHouseId, startTime, endTime, isPledge);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  货物保管信息
 | 
	
		
			
				|  |  | +     * 货物保管信息
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<Map<String, Object>> getGoodsList(String wareHouseId, String startTime, String endTime) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getGoodsList(wareHouseId,startTime,endTime);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getGoodsList(wareHouseId, startTime, endTime);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  仓库保管趋势
 | 
	
		
			
				|  |  | +     * 仓库保管趋势
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<Map<String, Object>> getCargoInfoTrend(String wareHouseId, String startTime, String endTime, String FTradeModeId) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getCargoInfoTrend(wareHouseId,startTime,endTime,FTradeModeId);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getCargoInfoTrend(wareHouseId, startTime, endTime, FTradeModeId);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  获取货物品类top值
 | 
	
		
			
				|  |  | +     * 获取货物品类top值
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<Map<String, Object>> getStorageTop(String wareHouseId, Integer countType, Integer topCnt) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getStorageTop(wareHouseId,countType,topCnt);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getStorageTop(wareHouseId, countType, topCnt);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  获取货主仓库top值
 | 
	
		
			
				|  |  | +     * 获取货主仓库top值
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<Map<String, Object>> getGoodsTop(String wareHouseId, Integer countType, Integer topCnt) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getGoodsTop(wareHouseId,countType,topCnt);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getGoodsTop(wareHouseId, countType, topCnt);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  过户交易信息获取
 | 
	
		
			
				|  |  | +     * 过户交易信息获取
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<Map<String, Object>> getTransferTransaction(String wareHouseId, String startTime, String endTime) {
 | 
	
		
			
				|  |  | -        return tWarehouseMapper.getTransferTransaction(wareHouseId,startTime,endTime);
 | 
	
		
			
				|  |  | +        return tWarehouseMapper.getTransferTransaction(wareHouseId, startTime, endTime);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  最新的作业统计
 | 
	
		
			
				|  |  | +     * 最新的作业统计
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Map<String, Object> getWorkInfo(String wareHouseId, String countType) {
 | 
	
	
		
			
				|  | @@ -597,15 +638,15 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  作业统计趋势数据
 | 
	
		
			
				|  |  | +     * 作业统计趋势数据
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public List<Map<String, Object>> getWorkTrend(String wareHouseId,  String startTime, String endTime, String countType) {
 | 
	
		
			
				|  |  | +    public List<Map<String, Object>> getWorkTrend(String wareHouseId, String startTime, String endTime, String countType) {
 | 
	
		
			
				|  |  |          return tWarehouseMapper.getWorkTrend(wareHouseId, startTime, endTime, countType);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *  获取仓库详细信息
 | 
	
		
			
				|  |  | +     * 获取仓库详细信息
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<InventoryQueryResponse> inventoryQueries(InventoryQueryRequest inventoryQueryRequest) {
 |