hace 1 año
padre
commit
61686c833b
Se han modificado 18 ficheros con 792 adiciones y 62 borrados
  1. 27 0
      platform-dao/src/main/java/com/platform/dao/dto/store/InStoreFormDTO.java
  2. 25 0
      platform-dao/src/main/java/com/platform/dao/dto/store/OutStoreFormDTO.java
  3. 2 2
      platform-dao/src/main/java/com/platform/dao/vo/export/sqarepartmanage/ExportSparePartInfoVO.java
  4. 124 32
      platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportInStoreDetailVO.java
  5. 90 0
      platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportInStoreFormVO.java
  6. 54 13
      platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportOutStoreDetailVO.java
  7. 90 0
      platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportOutStoreFormVO.java
  8. 21 0
      platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportSpareStoreVO.java
  9. 1 0
      platform-dao/src/main/java/com/platform/dao/vo/query/sparepartmanage/SparePartInfoVO.java
  10. 2 1
      platform-dao/src/main/java/com/platform/dao/vo/query/store/InStoreFormVO.java
  11. 1 0
      platform-dao/src/main/java/com/platform/dao/vo/query/store/OutStoreFormVO.java
  12. 3 1
      platform-dao/src/main/resources/mapper/sqarepartmanage/SparePartInfoMapper.xml
  13. 119 3
      platform-dao/src/main/resources/mapper/store/InStoreFormMapper.xml
  14. 209 3
      platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml
  15. 9 3
      platform-rest/src/main/java/com/platform/rest/controller/report/InStoreDetailReportController.java
  16. 6 2
      platform-rest/src/main/java/com/platform/rest/controller/report/OutStoreDetailReportController.java
  17. 4 1
      platform-rest/src/main/java/com/platform/rest/controller/store/InStoreFormController.java
  18. 5 1
      platform-rest/src/main/java/com/platform/rest/controller/store/OutStoreFormController.java

+ 27 - 0
platform-dao/src/main/java/com/platform/dao/dto/store/InStoreFormDTO.java

@@ -1,5 +1,6 @@
 package com.platform.dao.dto.store;
 
+import com.alibaba.druid.support.spring.stat.SpringStatUtils;
 import com.platform.common.bean.BaseDTO;
 import com.platform.common.validation.group.UpdateGroup;
 import lombok.Data;
@@ -23,6 +24,32 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class InStoreFormDTO extends BaseDTO implements Serializable {
+    private String producerName;
+    private String supplierName;
+    private List<String> spareIdList;
+    private List<Integer> warnStatusList;
+    private List<Integer> forecastStatusList;
+    private String typeId;
+    private Integer isSpecial;
+    private String name;
+    private Integer warnStatus;
+    private Integer forecastStatus;
+    private String ggxh;
+    private String initNo;
+    private Integer yt;
+//    private String storeId;
+    private Integer level;
+    private List<String> typeIds;
+    private String producerId;
+    private String supplierId;
+    private String parentTypeId;
+    private String parentNo;
+    private String childNo;
+    private Boolean searchMinStockWarn;
+//    private Boolean searchType;
+    private String brand;
+
+
     private String YearMonth;
     private String spareName;
     private LocalDateTime searchTimeStart;

+ 25 - 0
platform-dao/src/main/java/com/platform/dao/dto/store/OutStoreFormDTO.java

@@ -24,6 +24,31 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class OutStoreFormDTO extends BaseDTO implements Serializable {
+    private String producerName;
+    private String supplierName;
+    private List<String> spareIdList;
+    private List<Integer> warnStatusList;
+    private List<Integer> forecastStatusList;
+    private String typeId;
+    private Integer isSpecial;
+    private String name;
+    private Integer warnStatus;
+    private Integer forecastStatus;
+    private String ggxh;
+    private String initNo;
+    private Integer yt;
+    //    private String storeId;
+    private Integer level;
+    private List<String> typeIds;
+    private String producerId;
+    private String supplierId;
+    private String parentTypeId;
+    private String parentNo;
+    private String childNo;
+    private Boolean searchMinStockWarn;
+    private Integer searchType;
+    private String brand;
+
 
     private LocalDateTime searchTimeStart;
     private LocalDateTime searchTimeEnd;

+ 2 - 2
platform-dao/src/main/java/com/platform/dao/vo/export/sqarepartmanage/ExportSparePartInfoVO.java

@@ -112,8 +112,8 @@ public class ExportSparePartInfoVO implements Serializable {
     @Excel(name = "生产商", orderNum = "13")
     private String producerName;
 
-    @Excel(name = "用途", orderNum = "14")
-    private String ytStr;
+    @Excel(name = "用途", orderNum = "14",dicCode = "SPARE_USE_TYPE")
+    private Integer yt;
 
     @Excel(name = "关联设备号", orderNum = "15")
     private String sbNo;

+ 124 - 32
platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportInStoreDetailVO.java

@@ -24,27 +24,27 @@ public class ExportInStoreDetailVO implements Serializable {
   @Excel(name = "主键", orderNum = "1")
   private String id;
 
-    /**
-   * 入库单id
-   */
-  @Excel(name = "入库单id", orderNum = "2")
-  private String inId;
-
-    /**
-   * 入库单号
-   */
-  @Excel(name = "入库单号", orderNum = "3")
-  private String inNo;
-
-    /**
-   * 入库仓库id
-   */
-  @Excel(name = "入库仓库id", orderNum = "4")
-  private String storeId;
-
-    /**
-   * 备件id
-   */
+//    /**
+//   * 入库单id
+//   */
+//  @Excel(name = "入库单id", orderNum = "2")
+//  private String inId;
+//
+//    /**
+//   * 入库单号
+//   */
+//  @Excel(name = "入库单号", orderNum = "3")
+//  private String inNo;
+//
+//    /**
+//   * 入库仓库id
+//   */
+//  @Excel(name = "入库仓库id", orderNum = "4")
+//  private String storeId;
+//
+//    /**
+//   * 备件id
+//   */
   @Excel(name = "备件id", orderNum = "5")
   private String spareId;
 
@@ -52,19 +52,19 @@ public class ExportInStoreDetailVO implements Serializable {
    * 入库数量
    */
   @Excel(name = "入库数量", orderNum = "6")
-  private BigDecimal num;
+  private BigDecimal totalNum;
 
-    /**
-   * 入库单价
-   */
-  @Excel(name = "入库单价", orderNum = "7")
-  private Double price;
+//    /**
+//   * 入库单价
+//   */
+//  @Excel(name = "入库单价", orderNum = "7")
+//  private Double price;
 
-    /**
-   * 入库总价
-   */
-  @Excel(name = "入库总价", orderNum = "8")
-  private Double totalPrice;
+//    /**
+//   * 入库总价
+//   */
+//  @Excel(name = "入库总价", orderNum = "8")
+//  private Double totalPrice;
 
     /**
    * 创建人
@@ -91,4 +91,96 @@ public class ExportInStoreDetailVO implements Serializable {
   private LocalDateTime updateTime;
 
 
+
+  /**
+   * 大类编码名称
+   */
+  @Excel(name = "备件类别", orderNum = "13")
+  private String typeName;
+
+  /**
+   * 备件编码
+   */
+  @Excel(name = "备件编码", orderNum = "14")
+  private String no;
+
+  /**
+   * 名称
+   */
+  @Excel(name = "备件名称", orderNum = "15")
+  private String name;
+
+  /**
+   * 规格型号:使用的sb_guige
+   */
+  @Excel(name = "规格型号", orderNum = "16")
+  private String ggxh;
+
+  @Excel(name = "品牌", orderNum = "17")
+  private String brand;
+
+  /**
+   * 单价
+   */
+  @Excel(name = "备件价值", orderNum = "18")
+  private Double initialValue;
+
+  /**
+   * 计量单位: 1-件;2-台;3-条; 4-个
+   */
+  @Excel(name = "计量单位", orderNum = "19")
+  private String unit;
+
+  /**
+   * 当前库存
+   */
+  @Excel(name = "当前库存", orderNum = "20")
+  private BigDecimal currentStock;
+
+  /**
+   * 最高库存
+   */
+  @Excel(name = "最高库存", orderNum = "21")
+  private BigDecimal maxStock;
+
+  /**
+   * 最低库存
+   */
+  @Excel(name = "最低库存", orderNum = "22")
+  private BigDecimal minStock;
+
+
+//    /**
+//     * 寿命周期:月
+//     */
+//    @Excel(name = "寿命周期(月)", orderNum = "11")
+//    private BigDecimal agePeriod;
+
+  /**
+   * 备件等级:1-一级; 2-二级;3-三级
+   */
+  @Excel(name = "备件等级", orderNum = "23", dicCode = "SPARE_PART_INFO_LEVEL")
+  private Integer level;
+  /**
+   * 使用周期:月
+   */
+//    @Excel(name = "使用周期(月)", orderNum = "10")
+//    private BigDecimal usePeriod;
+
+//    /**
+//     * 采购到货周期:天
+//     */
+//    @Excel(name = "采购到货周期(天)", orderNum = "12")
+//    private BigDecimal purchasePeriod;
+  /**
+   * 生产商
+   */
+  @Excel(name = "生产商", orderNum = "24")
+  private String producerName;
+
+  @Excel(name = "用途", orderNum = "25",dicCode = "SPARE_USE_TYPE")
+  private String yt;
+
+
+
 }

+ 90 - 0
platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportInStoreFormVO.java

@@ -4,6 +4,7 @@ import com.platform.office.annotation.Excel;
 import lombok.Data;
 import lombok.experimental.Accessors;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDate;
 
@@ -77,5 +78,94 @@ public class ExportInStoreFormVO implements Serializable {
   @Excel(name = "更新日期", orderNum = "10")
   private LocalDateTime updateTime;
 
+  /**
+   * 大类编码名称
+   */
+  @Excel(name = "备件类别", orderNum = "2")
+  private String typeName;
+
+  /**
+   * 备件编码
+   */
+  @Excel(name = "备件编码", orderNum = "3")
+  private String no;
+
+  /**
+   * 名称
+   */
+  @Excel(name = "备件名称", orderNum = "4")
+  private String name;
+
+  /**
+   * 规格型号:使用的sb_guige
+   */
+  @Excel(name = "规格型号", orderNum = "5")
+  private String ggxh;
+
+  @Excel(name = "品牌", orderNum = "6")
+  private String brand;
+
+  /**
+   * 单价
+   */
+  @Excel(name = "备件价值", orderNum = "7")
+  private Double initialValue;
+
+  /**
+   * 计量单位: 1-件;2-台;3-条; 4-个
+   */
+  @Excel(name = "计量单位", orderNum = "8")
+  private String unit;
+
+  /**
+   * 当前库存
+   */
+  @Excel(name = "当前库存", orderNum = "9")
+  private BigDecimal currentStock;
+
+  /**
+   * 最高库存
+   */
+  @Excel(name = "最高库存", orderNum = "10")
+  private BigDecimal maxStock;
+
+  /**
+   * 最低库存
+   */
+  @Excel(name = "最低库存", orderNum = "11")
+  private BigDecimal minStock;
+
+
+//    /**
+//     * 寿命周期:月
+//     */
+//    @Excel(name = "寿命周期(月)", orderNum = "11")
+//    private BigDecimal agePeriod;
+
+  /**
+   * 备件等级:1-一级; 2-二级;3-三级
+   */
+  @Excel(name = "备件等级", orderNum = "12", dicCode = "SPARE_PART_INFO_LEVEL")
+  private Integer level;
+  /**
+   * 使用周期:月
+   */
+//    @Excel(name = "使用周期(月)", orderNum = "10")
+//    private BigDecimal usePeriod;
+
+//    /**
+//     * 采购到货周期:天
+//     */
+//    @Excel(name = "采购到货周期(天)", orderNum = "12")
+//    private BigDecimal purchasePeriod;
+  /**
+   * 生产商
+   */
+  @Excel(name = "生产商", orderNum = "13")
+  private String producerName;
+
+  @Excel(name = "用途", orderNum = "14")
+  private String ytStr;
+
 
 }

+ 54 - 13
platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportOutStoreDetailVO.java

@@ -23,22 +23,22 @@ public class ExportOutStoreDetailVO implements Serializable {
   @Excel(name = "主键", orderNum = "1")
   private String id;
 
-    /**
-   * 出库单id
-   */
-  @Excel(name = "出库单id", orderNum = "2")
-  private String outId;
-
-    /**
-   * 出库单号
-   */
-  @Excel(name = "出库单号", orderNum = "3")
-  private String outNo;
+//    /**
+//   * 出库单id
+//   */
+//  @Excel(name = "出库单id", orderNum = "2")
+//  private String outId;
+//
+//    /**
+//   * 出库单号
+//   */
+//  @Excel(name = "出库单号", orderNum = "3")
+//  private String outNo;
 
     /**
    * 入库仓库id
    */
-  @Excel(name = "库仓库id", orderNum = "4")
+  @Excel(name = "库仓库id", orderNum = "4")
   private String storeId;
 
     /**
@@ -51,7 +51,7 @@ public class ExportOutStoreDetailVO implements Serializable {
    * 出库数量
    */
   @Excel(name = "出库数量", orderNum = "6")
-  private Integer num;
+  private Integer totalNum;
 
     /**
    * 创建人
@@ -89,5 +89,46 @@ public class ExportOutStoreDetailVO implements Serializable {
   @Excel(name = "更新日期", orderNum = "12")
   private LocalDateTime updateTime;
 
+  @Excel(name = "备件类别", orderNum = "13")
+  private String typeId;
+
+  @Excel(name = "备件编码", orderNum = "14")
+  private String no;
+
+  @Excel(name = "备件名称", orderNum = "15")
+  private String name;
+
+  @Excel(name = "规格型号", orderNum = "16")
+  private String ggxh;
+
+  @Excel(name = "品牌", orderNum = "17")
+  private String brand;
+
+  @Excel(name = "备件价值", orderNum = "18")
+  private String initialValue;
+
+  @Excel(name = "计量单位", orderNum = "19")
+  private String unit;
+
+  @Excel(name = "当前库存", orderNum = "20")
+  private String currentStock;
+
+  @Excel(name = "最高库存", orderNum = "21")
+  private String maxStock;
+
+  @Excel(name = "最低库存", orderNum = "22")
+  private String minStock;
+
+  @Excel(name = "等级", orderNum = "23")
+  private String level;
+
+  @Excel(name = "生产商", orderNum = "24")
+  private String producerId;
+
+  @Excel(name = "用途", orderNum = "25")
+  private String yt;
+
+
+
 
 }

+ 90 - 0
platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportOutStoreFormVO.java

@@ -4,6 +4,7 @@ import com.platform.office.annotation.Excel;
 import lombok.Data;
 import lombok.experimental.Accessors;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDate;
 
@@ -77,5 +78,94 @@ public class ExportOutStoreFormVO implements Serializable {
   @Excel(name = "更新日期", orderNum = "10")
   private LocalDateTime updateTime;
 
+  /**
+   * 大类编码名称
+   */
+  @Excel(name = "备件类别", orderNum = "2")
+  private String typeName;
+
+  /**
+   * 备件编码
+   */
+  @Excel(name = "备件编码", orderNum = "3")
+  private String no;
+
+  /**
+   * 名称
+   */
+  @Excel(name = "备件名称", orderNum = "4")
+  private String name;
+
+  /**
+   * 规格型号:使用的sb_guige
+   */
+  @Excel(name = "规格型号", orderNum = "5")
+  private String ggxh;
+
+  @Excel(name = "品牌", orderNum = "6")
+  private String brand;
+
+  /**
+   * 单价
+   */
+  @Excel(name = "备件价值", orderNum = "7")
+  private Double initialValue;
+
+  /**
+   * 计量单位: 1-件;2-台;3-条; 4-个
+   */
+  @Excel(name = "计量单位", orderNum = "8")
+  private String unit;
+
+  /**
+   * 当前库存
+   */
+  @Excel(name = "当前库存", orderNum = "9")
+  private BigDecimal currentStock;
+
+  /**
+   * 最高库存
+   */
+  @Excel(name = "最高库存", orderNum = "10")
+  private BigDecimal maxStock;
+
+  /**
+   * 最低库存
+   */
+  @Excel(name = "最低库存", orderNum = "11")
+  private BigDecimal minStock;
+
+
+//    /**
+//     * 寿命周期:月
+//     */
+//    @Excel(name = "寿命周期(月)", orderNum = "11")
+//    private BigDecimal agePeriod;
+
+  /**
+   * 备件等级:1-一级; 2-二级;3-三级
+   */
+  @Excel(name = "备件等级", orderNum = "12", dicCode = "SPARE_PART_INFO_LEVEL")
+  private Integer level;
+  /**
+   * 使用周期:月
+   */
+//    @Excel(name = "使用周期(月)", orderNum = "10")
+//    private BigDecimal usePeriod;
+
+//    /**
+//     * 采购到货周期:天
+//     */
+//    @Excel(name = "采购到货周期(天)", orderNum = "12")
+//    private BigDecimal purchasePeriod;
+  /**
+   * 生产商
+   */
+  @Excel(name = "生产商", orderNum = "13")
+  private String producerName;
+
+  @Excel(name = "用途", orderNum = "14")
+  private String ytStr;
+
 
 }

+ 21 - 0
platform-dao/src/main/java/com/platform/dao/vo/export/store/ExportSpareStoreVO.java

@@ -80,4 +80,25 @@ public class ExportSpareStoreVO implements Serializable {
     @Excel(name = "总价", orderNum = "11")
     private String totalPrice;
 
+    @Excel(name = "备件类别", orderNum = "12")
+    private String spareTypeName;
+
+    @Excel(name = "品牌", orderNum = "13")
+    private String brand;
+
+    @Excel(name = "最高库存", orderNum = "14")
+    private Integer maxStock;
+
+    @Excel(name = "最低库存", orderNum = "15")
+    private String minStock;
+
+    @Excel(name = "等级", orderNum = "16",dicCode = "SPARE_PART_INFO_LEVEL")
+    private String level;
+
+    @Excel(name = "生产商", orderNum = "17")
+    private String producerName;
+
+    @Excel(name = "用途", orderNum = "18",dicCode = "SPARE_USE_TYPE")
+    private Integer yt;
+
 }

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/vo/query/sparepartmanage/SparePartInfoVO.java

@@ -28,6 +28,7 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class SparePartInfoVO extends BaseVO implements Serializable {
+    private String producerName;
 
     private String sbNo;
 

+ 2 - 1
platform-dao/src/main/java/com/platform/dao/vo/query/store/InStoreFormVO.java

@@ -25,7 +25,8 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class InStoreFormVO extends BaseVO implements Serializable {
-
+    private String producerName;
+private String name;
     private String typeId;
     private String no;
     private String ggxh;

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/vo/query/store/OutStoreFormVO.java

@@ -25,6 +25,7 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class OutStoreFormVO extends BaseVO implements Serializable {
+    private String name;
     private String typeId;
     private String no;
     private String ggxh;

+ 3 - 1
platform-dao/src/main/resources/mapper/sqarepartmanage/SparePartInfoMapper.xml

@@ -82,10 +82,12 @@ warn_status,forecast_status,
     </sql>
     <select id="selectPageList" parameterType="com.platform.dao.dto.sqarepartmanage.SparePartInfoDTO"
             resultType="com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO">
-        select info.*, SUM(spareStore.num) currentStock,store.id as storeId,store.name as storeName
+        select info.*, SUM(spareStore.num) currentStock,store.id as storeId,store.name as storeName,
+        producer.name as producerName
         from t_spare_part_info info
         LEFT JOIN t_spare_store spareStore on spareStore.spare_id = info.id
         left join t_store store on store.id = spareStore.store_id
+        left join t_firm_producer producer on producer.id = info.producer_id
         <if test="producerName != null and producerName != ''">
             LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
         </if>

+ 119 - 3
platform-dao/src/main/resources/mapper/store/InStoreFormMapper.xml

@@ -125,6 +125,12 @@
         left join t_spare_part_info info on info.id = instoreform.spare_id
         left join t_spare_store spareStore on
         spareStore.spare_id = instoreform.spare_id
+        <if test="producerName != null and producerName != ''">
+            LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
+        </if>
+        <if test="supplierName != null and supplierName != ''">
+            LEFT JOIN t_supplier supplier on supplier.id = info.supplier_id
+        </if>
         <where>
             <include refid="List_Condition"/>
             <if test="useCompany != null and useCompany != ''">
@@ -142,6 +148,98 @@
             <if test="searchTimeEnd!=null">
                 and instoreform.created_time <![CDATA[<=]]>#{searchTimeEnd}
             </if>
+            <if test="spareIdList != null and spareIdList.size > 0">
+                and sparestore.spare_id in
+                <foreach item="item" index="index" collection="spareIdList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="warnStatusList != null and warnStatusList.size > 0">
+                AND info.warn_status in
+                <foreach item="item" index="index" collection="warnStatusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="forecastStatusList != null and forecastStatusList.size > 0">
+                AND info.forecast_status in
+                <foreach item="item" index="index" collection="forecastStatusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="typeId != null and typeId != ''">
+                and info.type_id = #{typeId}
+            </if>
+            <if test="isSpecial != null and isSpecial != ''">
+                and info.is_special = #{isSpecial}
+            </if>
+            <if test="producerName != null and producerName != ''">
+                AND producer.name like concat('%',#{producerName},'%')
+            </if>
+            <if test="supplierName != null and supplierName != ''">
+                AND supplier.name like concat('%',#{supplierName},'%')
+            </if>
+            <if test="name != null and name != ''">
+                AND info.name = #{name}
+            </if>
+            <if test="warnStatus != null and warnStatus != ''">
+                AND info.warn_status = #{warnStatus}
+            </if>
+            <if test="forecastStatus != null and forecastStatus != ''">
+                AND info.forecast_status = #{forecastStatus}
+            </if>
+            <if test="ggxh != null and ggxh != ''">
+                AND info.ggxh like concat('%',#{ggxh},'%')
+            </if>
+            <if test="initNo != null and initNo != ''">
+                AND info.init_no like concat('%',#{initNo},'%')
+            </if>
+            <if test="yt != null">
+                AND info.yt=#{yt}
+            </if>
+            <if test="storeId != null and storeId != ''">
+                AND spare.store_id=#{storeId}
+            </if>
+            <if test="level != null and level != ''">
+                AND info.level=#{level}
+            </if>
+            <if test="typeIds != null and typeIds.size > 0">
+                AND info.type_id in
+                <foreach item="item" index="index" collection="typeIds" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="producerId != null and producerId != ''">
+                AND info.producer_id=#{producerId}
+            </if>
+            <if test="supplierId != null and producerId != ''">
+                AND info.supplier_id=#{supplierId}
+            </if>
+            <if test="parentTypeId != null and parentTypeId != ''">
+                AND info.parent_type_id=#{parentTypeId}
+            </if>
+            <!-- <if test="typeId != null and typeId != ''">
+                 AND info.type_id=#{typeId}
+             </if>-->
+            <if test="parentNo != null and parentNo != ''">
+                AND info.parent_no=#{parentNo}
+            </if>
+            <if test="childNo != null and childNo != ''">
+                AND info.child_no=#{childNo}
+            </if>
+            <if test="searchMinStockWarn">
+                AND info.min_stock is not null
+            </if>
+            <if test="searchMinStockWarn">
+                AND info.warn_status = 0
+            </if>
+<!--            <if test="searchType">-->
+<!--                AND info.type_id not in (select id from t_spare_type)-->
+<!--            </if>-->
+            <if test="brand!=null">
+                and info.brand like concat('%',#{brand},'%')
+            </if>
+
         </where>
         GROUP BY instoreform.spare_id
     </select>
@@ -197,10 +295,21 @@
 
     <select id="getInStoreForm" parameterType="com.platform.dao.dto.store.InStoreFormDTO"
             resultType="com.platform.dao.vo.query.store.InStoreFormVO">
-        select instore.*,info.brand ,info.name,info.initial_value as price,info.ggxh from
+        select instore.*,info.brand ,
+        info.name,info.initial_value as price,info.ggxh,
+        type.name as typeName,info.no,
+        info.unit,sum(spareStore.num) as currentStock,
+        info.max_stock,info.min_stock,
+        info.level,
+        producer.name as producerName,
+        info.yt
+         from
         t_in_store_form instore
         left join t_spare_part_info info
         on instore.spare_id = info.id
+        left join t_spare_type type on type.id=info.type_id
+        left join t_spare_store spareStore on spareStore.spare_id = info.id
+        left join t_firm_producer producer on producer.id = info.producer_id
         <where>
             <if test="keyword!=null and keyword!=''">
                 and (info.name like concat('%',#{keyword},'%')
@@ -208,6 +317,7 @@
                 )
             </if>
         </where>
+        group by info.id
     </select>
 
     <select id="getInStoreSpareNum" parameterType="com.platform.dao.dto.store.InStoreFormDTO"
@@ -226,10 +336,16 @@
 
     <select id="getInStoreFormCollect" resultType="com.platform.dao.vo.query.store.InStoreFormVO"
             parameterType="com.platform.dao.dto.store.InStoreFormDTO">
-            select info.*,if(sum(form.in_num is null),0,form.in_num) totalNum,if(sum(form.in_num is null),0,form.in_num)*info.initial_value as totalPrice  from t_spare_part_info info
-            left join t_in_store_form form on info.id = form.spare_id
+            select info.*,sum(form.in_num ) totalNum,
+            form.id inId,form.in_no inNo,store.id storeId,spareStore.spare_id spareId,
+              spareType.name as typeName,sum(spareStore.num) currentStock,producer.name as producerName
+              from t_spare_part_info info
+
+            inner join t_in_store_form form on info.id = form.spare_id
             left join t_spare_store spareStore on spareStore.spare_id = info.id
             left join t_store store on store.id = spareStore.store_id
+            left join t_spare_type spareType on spareType.id = info.type_id
+            left join t_firm_producer producer on producer.id = info.producer_id
             <where>
                 <if test="storeId!=null and storeId!=''">
                     store.id = #{storeId}

+ 209 - 3
platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml

@@ -105,6 +105,12 @@
         left join t_spare_part_info info on outstoreform.spare_id = info.id
         left join t_spare_store spareStore on
         spareStore.spare_id = outstoreform.spare_id
+        <if test="producerName != null and producerName != ''">
+            LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
+        </if>
+        <if test="supplierName != null and supplierName != ''">
+            LEFT JOIN t_supplier supplier on supplier.id = info.supplier_id
+        </if>
         <where>
             <include refid="List_Condition"/>
             <if test="useCompany != null and useCompany != ''">
@@ -122,6 +128,97 @@
             <if test="searchTimeEnd!=null ">
                 and outstoreform.created_time <![CDATA[<=]]> #{searchTimeEnd}
             </if>
+            <if test="spareIdList != null and spareIdList.size > 0">
+                and sparestore.spare_id in
+                <foreach item="item" index="index" collection="spareIdList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="warnStatusList != null and warnStatusList.size > 0">
+                AND info.warn_status in
+                <foreach item="item" index="index" collection="warnStatusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="forecastStatusList != null and forecastStatusList.size > 0">
+                AND info.forecast_status in
+                <foreach item="item" index="index" collection="forecastStatusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="typeId != null and typeId != ''">
+                and info.type_id = #{typeId}
+            </if>
+            <if test="isSpecial != null and isSpecial != ''">
+                and info.is_special = #{isSpecial}
+            </if>
+            <if test="producerName != null and producerName != ''">
+                AND producer.name like concat('%',#{producerName},'%')
+            </if>
+            <if test="supplierName != null and supplierName != ''">
+                AND supplier.name like concat('%',#{supplierName},'%')
+            </if>
+            <if test="name != null and name != ''">
+                AND info.name = #{name}
+            </if>
+            <if test="warnStatus != null and warnStatus != ''">
+                AND info.warn_status = #{warnStatus}
+            </if>
+            <if test="forecastStatus != null and forecastStatus != ''">
+                AND info.forecast_status = #{forecastStatus}
+            </if>
+            <if test="ggxh != null and ggxh != ''">
+                AND info.ggxh like concat('%',#{ggxh},'%')
+            </if>
+            <if test="initNo != null and initNo != ''">
+                AND info.init_no like concat('%',#{initNo},'%')
+            </if>
+            <if test="yt != null">
+                AND info.yt=#{yt}
+            </if>
+            <if test="storeId != null and storeId != ''">
+                AND spare.store_id=#{storeId}
+            </if>
+            <if test="level != null and level != ''">
+                AND info.level=#{level}
+            </if>
+            <if test="typeIds != null and typeIds.size > 0">
+                AND info.type_id in
+                <foreach item="item" index="index" collection="typeIds" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="producerId != null and producerId != ''">
+                AND info.producer_id=#{producerId}
+            </if>
+            <if test="supplierId != null and producerId != ''">
+                AND info.supplier_id=#{supplierId}
+            </if>
+            <if test="parentTypeId != null and parentTypeId != ''">
+                AND info.parent_type_id=#{parentTypeId}
+            </if>
+            <!-- <if test="typeId != null and typeId != ''">
+                 AND info.type_id=#{typeId}
+             </if>-->
+            <if test="parentNo != null and parentNo != ''">
+                AND info.parent_no=#{parentNo}
+            </if>
+            <if test="childNo != null and childNo != ''">
+                AND info.child_no=#{childNo}
+            </if>
+            <if test="searchMinStockWarn">
+                AND info.min_stock is not null
+            </if>
+            <if test="searchMinStockWarn">
+                AND info.warn_status = 0
+            </if>
+<!--            <if test="searchType">-->
+<!--                AND info.type_id not in (select id from t_spare_type)-->
+<!--            </if>-->
+            <if test="brand!=null">
+                and info.brand like concat('%',#{brand},'%')
+            </if>
         </where>
         group by outstoreform.spare_id
     </select>
@@ -142,10 +239,20 @@
 
     <select id="getOutStoreForm" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
             resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
-        select outstore.*,info.brand ,info.name,info.initial_value as price,info.ggxh from
+        select outstore.*,info.brand ,info.name,info.initial_value as price,info.ggxh,
+        type.name as typeName,info.no,
+        info.unit,sum(spareStore.num) as currentStock,
+        info.max_stock,info.min_stock,
+        info.level,
+        producer.name as producerName,
+        info.yt
+         from
         t_out_store_form outstore
         left join t_spare_part_info info
         on outstore.spare_id = info.id
+        left join t_spare_type type on type.id=info.type_id
+        left join t_spare_store spareStore on spareStore.spare_id = info.id
+        left join t_firm_producer producer on producer.id = info.producer_id
         <where>
             <if test="keyword!=null and keyword!=''">
                 and (info.name like concat('%',#{keyword},'%')
@@ -153,6 +260,7 @@
                 )
             </if>
         </where>
+        group by info.id
     </select>
 
     <select id="getOutStoreSpareNum" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
@@ -171,10 +279,16 @@
 
     <select id="getOutStoreFormCollect" resultType="com.platform.dao.vo.query.store.OutStoreFormVO"
             parameterType="com.platform.dao.dto.store.OutStoreFormDTO">
-        select info.*,if(sum(form.in_num is null),0,form.in_num) totalNum,if(sum(form.in_num is null),0,form.in_num)*info.initial_value as totalPrice  from t_spare_part_info info
-        left join t_out_store_form form on info.id = form.spare_id
+        select info.*,sum(form.out_num ) totalNum,sum(form.out_num )*info.initial_value as totalPrice,form.id outId,form.out_no outNo,store.id storeId,spareStore.spare_id spareId  from t_spare_part_info info
+        right join t_out_store_form form on info.id = form.spare_id
         left join t_spare_store spareStore on spareStore.spare_id = info.id
         left join t_store store on store.id = spareStore.store_id
+        <if test="producerName != null and producerName != ''">
+            LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
+        </if>
+        <if test="supplierName != null and supplierName != ''">
+            LEFT JOIN t_supplier supplier on supplier.id = info.supplier_id
+        </if>
         <where>
             <if test="storeId!=null and storeId!=''">
                 store.id = #{storeId}
@@ -185,7 +299,99 @@
             <if test="searchTimeEnd!=null and searchTimeEnd!=''">
                 form.created_time <![CDATA[<=]]> #{searchTimeEnd}
             </if>
+            <if test="spareIdList != null and spareIdList.size > 0">
+                and sparestore.spare_id in
+                <foreach item="item" index="index" collection="spareIdList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="warnStatusList != null and warnStatusList.size > 0">
+                AND info.warn_status in
+                <foreach item="item" index="index" collection="warnStatusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="forecastStatusList != null and forecastStatusList.size > 0">
+                AND info.forecast_status in
+                <foreach item="item" index="index" collection="forecastStatusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="typeId != null and typeId != ''">
+                and info.type_id = #{typeId}
+            </if>
+            <if test="isSpecial != null and isSpecial != ''">
+                and info.is_special = #{isSpecial}
+            </if>
+            <if test="producerName != null and producerName != ''">
+                AND producer.name like concat('%',#{producerName},'%')
+            </if>
+            <if test="supplierName != null and supplierName != ''">
+                AND supplier.name like concat('%',#{supplierName},'%')
+            </if>
+            <if test="name != null and name != ''">
+                AND info.name = #{name}
+            </if>
+            <if test="warnStatus != null and warnStatus != ''">
+                AND info.warn_status = #{warnStatus}
+            </if>
+            <if test="forecastStatus != null and forecastStatus != ''">
+                AND info.forecast_status = #{forecastStatus}
+            </if>
+            <if test="ggxh != null and ggxh != ''">
+                AND info.ggxh like concat('%',#{ggxh},'%')
+            </if>
+            <if test="initNo != null and initNo != ''">
+                AND info.init_no like concat('%',#{initNo},'%')
+            </if>
+            <if test="yt != null">
+                AND info.yt=#{yt}
+            </if>
+            <if test="storeId != null and storeId != ''">
+                AND spare.store_id=#{storeId}
+            </if>
+            <if test="level != null and level != ''">
+                AND info.level=#{level}
+            </if>
+            <if test="typeIds != null and typeIds.size > 0">
+                AND info.type_id in
+                <foreach item="item" index="index" collection="typeIds" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="producerId != null and producerId != ''">
+                AND info.producer_id=#{producerId}
+            </if>
+            <if test="supplierId != null and producerId != ''">
+                AND info.supplier_id=#{supplierId}
+            </if>
+            <if test="parentTypeId != null and parentTypeId != ''">
+                AND info.parent_type_id=#{parentTypeId}
+            </if>
+            <!-- <if test="typeId != null and typeId != ''">
+                 AND info.type_id=#{typeId}
+             </if>-->
+            <if test="parentNo != null and parentNo != ''">
+                AND info.parent_no=#{parentNo}
+            </if>
+            <if test="childNo != null and childNo != ''">
+                AND info.child_no=#{childNo}
+            </if>
+            <if test="searchMinStockWarn">
+                AND info.min_stock is not null
+            </if>
+            <if test="searchMinStockWarn">
+                AND info.warn_status = 0
+            </if>
+            <if test="searchType">
+                AND info.type_id not in (select id from t_spare_type)
+            </if>
+            <if test="brand!=null">
+                and info.brand like concat('%',#{brand},'%')
+            </if>
         </where>
+
         group by info.id
 
     </select>

+ 9 - 3
platform-rest/src/main/java/com/platform/rest/controller/report/InStoreDetailReportController.java

@@ -6,10 +6,13 @@ import com.platform.common.util.R;
 import com.platform.common.validation.group.AddGroup;
 import com.platform.common.validation.group.UpdateGroup;
 import com.platform.dao.dto.store.InStoreDetailDTO;
+import com.platform.dao.dto.store.InStoreFormDTO;
 import com.platform.dao.entity.store.InStoreDetail;
+import com.platform.dao.mapper.store.InStoreFormMapper;
 import com.platform.dao.util.ExcelUtil;
 import com.platform.dao.vo.export.store.ExportInStoreDetailVO;
 import com.platform.dao.vo.query.store.InStoreDetailVO;
+import com.platform.dao.vo.query.store.InStoreFormVO;
 import com.platform.rest.log.annotation.SysLog;
 import com.platform.service.store.InStoreDetailService;
 import lombok.AllArgsConstructor;
@@ -30,6 +33,7 @@ import java.util.List;
 @AllArgsConstructor
 @RequestMapping("/report/store/in-store-details")
 public class InStoreDetailReportController {
+  private final InStoreFormMapper inStoreFormMapper;
 
   private final  InStoreDetailService inStoreDetailService;
 
@@ -66,9 +70,11 @@ public class InStoreDetailReportController {
   @GetMapping("/export")
   @SysLog("入库详情导出")
   @PreAuthorize("@pms.hasPermission('store-in-store-details-export')")
-  public void export(HttpServletResponse response, InStoreDetailDTO inStoreDetailDTO) {
-    List<InStoreDetail> list = inStoreDetailService.getModelListByDTO(inStoreDetailDTO);
-    ExcelUtil.exportResponseDict(response, ExportInStoreDetailVO.class, BeanConverterUtil.copyListProperties(list, ExportInStoreDetailVO.class), "入库详情");
+  public void export(HttpServletResponse response, InStoreFormDTO inStoreFormDTO) {
+
+    List<InStoreFormVO> inStoreFormVOS = inStoreFormMapper.getInStoreFormCollect(inStoreFormDTO);
+//    List<InStoreDetail> list = inStoreDetailService.getModelListByDTO(inStoreDetailDTO);
+    ExcelUtil.exportResponseDict(response, ExportInStoreDetailVO.class, BeanConverterUtil.copyListProperties(inStoreFormVOS, ExportInStoreDetailVO.class), "入库详情");
   }
 
 }

+ 6 - 2
platform-rest/src/main/java/com/platform/rest/controller/report/OutStoreDetailReportController.java

@@ -6,10 +6,13 @@ import com.platform.common.util.R;
 import com.platform.common.validation.group.AddGroup;
 import com.platform.common.validation.group.UpdateGroup;
 import com.platform.dao.dto.store.OutStoreDetailDTO;
+import com.platform.dao.dto.store.OutStoreFormDTO;
 import com.platform.dao.entity.store.OutStoreDetail;
+import com.platform.dao.mapper.store.OutStoreFormMapper;
 import com.platform.dao.util.ExcelUtil;
 import com.platform.dao.vo.export.store.ExportOutStoreDetailVO;
 import com.platform.dao.vo.query.store.OutStoreDetailVO;
+import com.platform.dao.vo.query.store.OutStoreFormVO;
 import com.platform.rest.log.annotation.SysLog;
 import com.platform.service.store.OutStoreDetailService;
 import lombok.AllArgsConstructor;
@@ -32,6 +35,7 @@ import java.util.List;
 public class OutStoreDetailReportController {
 
   private final  OutStoreDetailService outStoreDetailService;
+  private final OutStoreFormMapper outStoreFormMapper;
 
   /**
    * 通过id查询单条记录
@@ -66,8 +70,8 @@ public class OutStoreDetailReportController {
   @GetMapping("/export")
   @SysLog("出库详情导出")
   @PreAuthorize("@pms.hasPermission('store-out-store-details-export')")
-  public void export(HttpServletResponse response, OutStoreDetailDTO outStoreDetailDTO) {
-    List<OutStoreDetail> list = outStoreDetailService.getModelListByDTO(outStoreDetailDTO);
+  public void export(HttpServletResponse response, OutStoreFormDTO outStoreFormDTO) {
+    List<OutStoreFormVO> list = outStoreFormMapper.getOutStoreFormCollect(outStoreFormDTO);
     ExcelUtil.exportResponseDict(response, ExportOutStoreDetailVO.class, BeanConverterUtil.copyListProperties(list, ExportOutStoreDetailVO.class), "出库详情");
   }
 

+ 4 - 1
platform-rest/src/main/java/com/platform/rest/controller/store/InStoreFormController.java

@@ -4,6 +4,7 @@ import com.platform.common.util.R;
 import com.platform.dao.dto.store.InStoreFormDTO;
 import com.platform.dao.dto.store.OutStoreFormDTO;
 import com.platform.dao.entity.store.InStoreForm;
+import com.platform.dao.mapper.store.InStoreFormMapper;
 import com.platform.dao.vo.export.store.ExportInStoreSpareNumVO;
 import com.platform.service.store.InStoreFormService;
 import com.platform.dao.util.ExcelUtil;
@@ -36,6 +37,8 @@ public class InStoreFormController {
 
   private final  InStoreFormService inStoreFormService;
 
+  private final InStoreFormMapper inStoreFormMapper;
+
   /**
    * 通过id查询单条记录
    *
@@ -166,7 +169,7 @@ public class InStoreFormController {
   @SysLog("入库登记表导出")
   @PreAuthorize("@pms.hasPermission('store-in-store-forms-export')")
   public void export(HttpServletResponse response, InStoreFormDTO inStoreFormDTO) {
-    List<InStoreForm> list = inStoreFormService.getModelListByDTO(inStoreFormDTO);
+    List<InStoreFormVO> list = inStoreFormMapper.getInStoreForm(inStoreFormDTO);
     ExcelUtil.exportResponseDict(response, ExportInStoreFormVO.class, BeanConverterUtil.copyListProperties(list, ExportInStoreFormVO.class), "入库登记表");
   }
 

+ 5 - 1
platform-rest/src/main/java/com/platform/rest/controller/store/OutStoreFormController.java

@@ -4,6 +4,7 @@ import com.platform.common.util.R;
 import com.platform.dao.dto.store.InStoreFormDTO;
 import com.platform.dao.dto.store.OutStoreFormDTO;
 import com.platform.dao.entity.store.OutStoreForm;
+import com.platform.dao.mapper.store.OutStoreFormMapper;
 import com.platform.dao.vo.export.store.ExportInStoreSpareNumVO;
 import com.platform.dao.vo.export.store.ExportOutStoreSpareNumVO;
 import com.platform.dao.vo.query.store.InStoreFormVO;
@@ -38,6 +39,8 @@ public class OutStoreFormController {
 
   private final  OutStoreFormService outStoreFormService;
 
+  private final OutStoreFormMapper outStoreFormMapper;
+
   /**
    * 通过id查询单条记录
    *
@@ -166,7 +169,8 @@ public class OutStoreFormController {
   @SysLog("出库登记单导出")
   @PreAuthorize("@pms.hasPermission('store-out-store-forms-export')")
   public void export(HttpServletResponse response, OutStoreFormDTO outStoreFormDTO) {
-    List<OutStoreForm> list = outStoreFormService.getModelListByDTO(outStoreFormDTO);
+//    List<OutStoreForm> list = outStoreFormService.getModelListByDTO(outStoreFormDTO);
+    List<OutStoreFormVO> list = outStoreFormMapper.getOutStoreForm(outStoreFormDTO);
     ExcelUtil.exportResponseDict(response, ExportOutStoreFormVO.class, BeanConverterUtil.copyListProperties(list, ExportOutStoreFormVO.class), "出库登记单");
   }