Browse Source

中电 仓库 2023年6月9日17:17:34

纪新园 2 years ago
parent
commit
23dc3d53f7

+ 18 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TWarehouseController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.web.controller.warehouse.basicData;
 
 
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.ruoyi.basicData.service.ITWarehouseService;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
@@ -12,7 +13,12 @@ import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.service.ISysDictDataService;
+import com.ruoyi.warehouseBusiness.domain.TAnnex;
 import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
+import com.ruoyi.warehouseBusiness.domain.enums.AnnexActEnum;
+import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;
+import com.ruoyi.warehouseBusiness.service.ITAnnexService;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -22,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 仓库Controller
@@ -43,7 +50,17 @@ public class TWarehouseController extends BaseController {
     public AjaxResult list(TWarehouse tWarehouse) {
         // startPage();
         List<TWarehouse> list = tWarehouseService.selectTWarehouseList(tWarehouse);
-        return AjaxResult.success(list); // getDataTable(list);
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 查询仓库列表
+     */
+    @GetMapping("/listAll")
+    public AjaxResult listAll(TWarehouse tWarehouse) {
+        // startPage();
+        List<WarehouseInfoVO> list = tWarehouseService.selectTWarehouseListAll(tWarehouse);
+        return AjaxResult.success(list);
     }
 
     /**

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/TWarehouse.java

@@ -15,7 +15,7 @@ import java.util.List;
  * 仓库对象 t_warehouse
  *
  * @author ruoyi
- * @date 2021-01-07
+ * @date 2021-01-07fGoodsType
  */
 public class TWarehouse extends BaseEntity
 {

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java

@@ -111,4 +111,6 @@ public interface SysDictDataMapper {
      * @return
      */
     List<SysDictData> selectByTypes(@Param("typeList") List<String> typeList);
+
+    String getDictLabelMultipleChoice(String dictType, String dictValue);
 }

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java

@@ -67,4 +67,13 @@ public interface ISysDictDataService
      * @return 字典标签
      */
     public String selectDictValue(String dictType, String dictData);
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息(多选值)
+     *
+     * @param dictType 字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    public String getDictLabelMultipleChoice(String dictType, String dictValue);
 }

+ 12 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java

@@ -57,6 +57,18 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     }
 
     /**
+     * 根据字典类型和字典键值查询字典数据信息(多选值)
+     *
+     * @param dictType 字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    @Override
+    public String getDictLabelMultipleChoice(String dictType, String dictValue) {
+        return dictDataMapper.getDictLabelMultipleChoice(dictType, dictValue);
+    }
+
+    /**
      * 根据字典数据ID查询信息
      * 
      * @param dictCode 字典数据ID

+ 6 - 1
ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml

@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 
 	<select id="selectDictLabel" resultType="String">
-		select dict_label from sys_dict_data
+		select GROUP_CONCAT(dict_label SEPARATOR ', ') AS dict_label from sys_dict_data
 		where dict_type = #{dictType} and dict_value = #{dictValue}
 	</select>
 	<select id="selectDictValue" resultType="String">
@@ -73,6 +73,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		</foreach>
 		and status = 0
 	</select>
+    <select id="getDictLabelMultipleChoice" resultType="java.lang.String">
+		select dict_label from sys_dict_data
+		where dict_type = #{dictType} and FIND_IN_SET(dict_value,#{dictValue})
+
+	</select>
 
     <delete id="deleteDictDataById" parameterType="Long">
  		delete from sys_dict_data where dict_code = #{dictCode}

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java

@@ -41,6 +41,8 @@ public interface ITWarehouseService {
      */
     public List<TWarehouse> selectTWarehouseList(TWarehouse tWarehouse);
 
+    public List<WarehouseInfoVO> selectTWarehouseListAll(TWarehouse tWarehouse);
+
     public List<TWarehouse> selectTWarehouseLists(TWarehouse tWarehouse);
 
     public List<Map<String, Object>> appGetWarehouseList();

+ 75 - 34
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java

@@ -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) {

+ 15 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TAnnex.java

@@ -1,10 +1,13 @@
 package com.ruoyi.warehouseBusiness.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
 
+import java.util.List;
+
 /**
  * 业务附件对象 t_annex
  *
@@ -66,6 +69,18 @@ public class TAnnex extends BaseEntity {
      */
     private String delFlag;
 
+
+    @TableField(exist = false)
+    private String ids;
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
+
     public void setfId(Long fId) {
         this.fId = fId;
     }

+ 4 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TAnnexMapper.java

@@ -1,6 +1,6 @@
 package com.ruoyi.warehouseBusiness.mapper;
 
-
+import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.ruoyi.warehouseBusiness.domain.TAnnex;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -14,7 +14,7 @@ import java.util.List;
  * @date 2021-11-19
  */
 @Mapper
-public interface TAnnexMapper {
+public interface TAnnexMapper extends BaseMapper<TAnnex> {
     /**
      * 查询业务附件
      *
@@ -69,4 +69,6 @@ public interface TAnnexMapper {
      * @return
      */
     int deleteByPid(@Param("pid") Long fPid, @Param("actId") Long actId);
+
+    List<TAnnex> selectListByPId(TAnnex annex);
 }

+ 4 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITAnnexService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.warehouseBusiness.service;
 
 
+import com.baomidou.mybatisplus.service.IService;
 import com.ruoyi.warehouseBusiness.domain.TAnnex;
 
 import java.util.List;
@@ -11,7 +12,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2021-11-19
  */
-public interface ITAnnexService {
+public interface ITAnnexService extends IService<TAnnex> {
     /**
      * 查询业务附件
      *
@@ -59,4 +60,6 @@ public interface ITAnnexService {
      * @return 结果
      */
     public int deleteTAnnexById(Long fId);
+
+    List<TAnnex> selectListByPId(TAnnex annex);
 }

+ 14 - 10
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TAnnexServiceImpl.java

@@ -1,10 +1,10 @@
 package com.ruoyi.warehouseBusiness.service.impl;
 
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.warehouseBusiness.domain.TAnnex;
 import com.ruoyi.warehouseBusiness.mapper.TAnnexMapper;
 import com.ruoyi.warehouseBusiness.service.ITAnnexService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -16,9 +16,8 @@ import java.util.List;
  * @date 2021-11-19
  */
 @Service
-public class TAnnexServiceImpl implements ITAnnexService {
-    @Autowired
-    private TAnnexMapper tAnnexMapper;
+public class TAnnexServiceImpl extends ServiceImpl<TAnnexMapper, TAnnex> implements ITAnnexService {
+
 
     /**
      * 查询业务附件
@@ -28,7 +27,7 @@ public class TAnnexServiceImpl implements ITAnnexService {
      */
     @Override
     public TAnnex selectTAnnexById(Long fId) {
-        return tAnnexMapper.selectTAnnexById(fId);
+        return baseMapper.selectTAnnexById(fId);
     }
 
     /**
@@ -39,7 +38,7 @@ public class TAnnexServiceImpl implements ITAnnexService {
      */
     @Override
     public List<TAnnex> selectTAnnexList(TAnnex tAnnex) {
-        return tAnnexMapper.selectTAnnexList(tAnnex);
+        return baseMapper.selectTAnnexList(tAnnex);
     }
 
     /**
@@ -51,7 +50,7 @@ public class TAnnexServiceImpl implements ITAnnexService {
     @Override
     public int insertTAnnex(TAnnex tAnnex) {
         tAnnex.setCreateTime(DateUtils.getNowDate());
-        return tAnnexMapper.insertTAnnex(tAnnex);
+        return baseMapper.insertTAnnex(tAnnex);
     }
 
     /**
@@ -63,7 +62,7 @@ public class TAnnexServiceImpl implements ITAnnexService {
     @Override
     public int updateTAnnex(TAnnex tAnnex) {
         tAnnex.setUpdateTime(DateUtils.getNowDate());
-        return tAnnexMapper.updateTAnnex(tAnnex);
+        return baseMapper.updateTAnnex(tAnnex);
     }
 
     /**
@@ -74,7 +73,7 @@ public class TAnnexServiceImpl implements ITAnnexService {
      */
     @Override
     public int deleteTAnnexByIds(Long[] fIds) {
-        return tAnnexMapper.deleteTAnnexByIds(fIds);
+        return baseMapper.deleteTAnnexByIds(fIds);
     }
 
     /**
@@ -85,6 +84,11 @@ public class TAnnexServiceImpl implements ITAnnexService {
      */
     @Override
     public int deleteTAnnexById(Long fId) {
-        return tAnnexMapper.deleteTAnnexById(fId);
+        return baseMapper.deleteTAnnexById(fId);
+    }
+
+    @Override
+    public List<TAnnex> selectListByPId(TAnnex annex) {
+        return baseMapper.selectListByPId(annex);
     }
 }

+ 17 - 8
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -82,6 +82,10 @@
             <if test="fCharg != null ">and f_charg = #{fCharg}</if>
             <if test="fStatus != null  and fStatus != ''">and f_status = #{fStatus}</if>
             <if test="supervise != null and supervise != ''">and supervise = #{supervise}</if>
+            <if test="fProperties != null and fProperties != ''">and f_properties like concat('%', #{fProperties}, '%')</if>
+            <if test="fType != null and fType != ''">and f_type like concat('%', #{fType}, '%')</if>
+            <if test="fGoodsType != null and fGoodsType != ''">and f_goods_type like concat('%', #{fGoodsType}, '%')</if>
+            <if test="fCoverArea != null and fCoverArea != ''">and f_cover_area like concat('%', #{fCoverArea}, '%')</if>
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
@@ -92,14 +96,14 @@
         select
             ware.f_id, ware.parent_id, ware.ancestors, ware.order_num, ware.f_no, ware.f_name, ware.f_cname, ware.f_totalgross, ware.f_location,
                ware.f_addr, ware.f_contacts, ware.f_tel, ware.f_charg, ware.f_is_bonded, ware.remark, ware.supervise, ware.f_status,
-               ware.f_properties, ware.f_type, ware.f_goods_type, ware.f_cover_area
+               ware.f_properties, ware.f_type, ware.f_goods_type, ware.f_cover_area,
             (
             SELECT
-                CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
+                CASE WHEN count( * ) > 0 THEN 1 ELSE 0 END
             FROM
-                t_warehouse
+                t_warehouse tw
             WHERE
-                parent_id = ware.f_id AND del_flag = '0'
+                tw.parent_id = ware.f_id AND tw.del_flag = '0'
             ) AS "has_children"
         from t_warehouse ware
         <where>
@@ -109,6 +113,11 @@
             <if test="fCname != null  and fCname != ''">and ware.f_cname like concat('%', #{fCname}, '%')</if>
             <if test="fStatus != null  and fStatus != ''">and ware.f_status = #{fStatus}</if>
             <if test="supervise != null and supervise != ''">and ware.supervise = #{supervise}</if>
+            <if test="fProperties != null and fProperties != ''">and f_properties like concat('%', #{fProperties}, '%')</if>
+            <if test="fType != null and fType != ''">and f_type like concat('%', #{fType}, '%')</if>
+            <if test="fGoodsType != null and fGoodsType != ''">and f_goods_type like concat('%', #{fGoodsType}, '%')</if>
+            <if test="fCoverArea != null and fCoverArea != ''">and f_cover_area like concat('%', #{fCoverArea}, '%')</if>
+            <if test="fAddr != null  and fAddr != ''">and f_addr like concat('%', #{fAddr}, '%')</if>
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
@@ -192,10 +201,10 @@
             <if test="fLocation != null">#{fLocation},</if>
             <if test="fWarehouseInformation != null">#{fWarehouseInformation},</if>
             <if test="supervise != null">#{supervise},</if>
-            <if test="fProperties != null">#{supervise},</if>
-            <if test="fType != null">#{supervise},</if>
-            <if test="fGoodsType != null">#{supervise},</if>
-            <if test="fCoverArea != null">#{supervise},</if>
+            <if test="fProperties != null">#{fProperties},</if>
+            <if test="fType != null">#{fType},</if>
+            <if test="fGoodsType != null">#{fGoodsType},</if>
+            <if test="fCoverArea != null">#{fCoverArea},</if>
         </trim>
     </insert>
 

+ 14 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TAnnexMapper.xml

@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTAnnexList" parameterType="TAnnex" resultMap="TAnnexResult">
         <include refid="selectTAnnexVo"/>
         <where>  
-            <if test="fPid != null "> and f_pid = #{fPid}</if>
+            <if test="fPid != null "> and find_in_set(f_pid,#{fPid})</if>
             <if test="fActid != null "> and f_actid = #{fActid}</if>
             <if test="fLineno != null  and fLineno != ''"> and f_lineno = #{fLineno}</if>
             <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
@@ -42,7 +42,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTAnnexVo"/>
         where f_id = #{fId}
     </select>
-        
+    <select id="selectListByPId" resultMap="TAnnexResult">
+        <include refid="selectTAnnexVo"/>
+        <where>
+            <if test="fPid != null "> and f_pid in #{fPid}</if>
+            <if test="fActid != null "> and f_actid = #{fActid}</if>
+            <if test="fLineno != null  and fLineno != ''"> and f_lineno = #{fLineno}</if>
+            <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
+            <if test="fDesc != null  and fDesc != ''"> and f_desc = #{fDesc}</if>
+            <if test="fUrl != null  and fUrl != ''"> and f_url = #{fUrl}</if>
+            <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
+        </where>
+    </select>
+
     <insert id="insertTAnnex" parameterType="TAnnex" useGeneratedKeys="true" keyProperty="fId">
         insert into t_annex
         <trim prefix="(" suffix=")" suffixOverrides=",">