Преглед на файлове

Merge remote-tracking branch 'origin/master'

24282 преди 1 година
родител
ревизия
d69d682b16

+ 4 - 10
sd-business/src/main/java/com/sd/business/controller/in/InOutStorageBomController.java

@@ -8,6 +8,7 @@ import com.sd.business.entity.in.dto.InOutStorageBomSelectDto;
 import com.sd.business.entity.in.vo.InOutStorageBomExportVo;
 import com.sd.business.entity.in.vo.InOutStorageBomVo;
 import com.sd.business.service.in.InOutStorageBomService;
+import com.sd.framework.util.TemplateExcelUtil;
 import com.sd.framework.util.excel.util.ExcelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -55,19 +56,12 @@ public class InOutStorageBomController {
         Page<InOutStorageBomVo> page = inOutStorageBomService.getPage(dto);
         List<InOutStorageBomVo> list = page.getRecords();
         String fileName;
-        Map<String, String> keys = new HashMap<>();
         if (Objects.equals(dto.getType(), 1)) {
-            fileName = "入库明细表";
-            keys.put("code", "入库单号");
-            keys.put("createTime", "入库时间");
-            keys.put("detailTypeValue", "入库类型");
+            fileName = "入库单";
         } else {
-            fileName = "出库库明细表";
-            keys.put("code", "出库单号");
-            keys.put("createTime", "出库时间");
-            keys.put("detailTypeValue", "出库类型");
+            fileName = "出库单";
         }
-        ExcelUtil.export(response, fileName, "导出数据", list, ExcelUtil.getClassNew(new InOutStorageBomVo(), keys));
+        TemplateExcelUtil.writeBrowser("inOutStorageDetails.xlsx", fileName, response, list);
     }
 
     /**

+ 0 - 2
sd-business/src/main/java/com/sd/business/entity/in/po/InOutStorageBom.java

@@ -1,6 +1,5 @@
 package com.sd.business.entity.in.po;
 
-import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.ruoyi.common.core.domain.BasePo;
 import com.sd.business.entity.inventory.bo.InOutFun;
@@ -38,7 +37,6 @@ public class InOutStorageBom extends BasePo implements InOutFun {
     /**
      * 数量
      */
-    @ExcelProperty(value = "数量", index = 8)
     @NotNull(message = "出入库数量不能为空")
     @DecimalMin(value = "0.01", message = "出入库数量必须大于0")
     private BigDecimal quantity;

+ 22 - 0
sd-business/src/main/java/com/sd/business/entity/in/vo/InOutStorageBomExportVo.java

@@ -1,16 +1,21 @@
 package com.sd.business.entity.in.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.sd.business.entity.in.emums.InDetailTypeEnum;
+import com.sd.business.entity.in.emums.OutDetailTypeEnum;
 import lombok.Getter;
 import lombok.Setter;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.Objects;
 
 @Getter
 @Setter
+@ExcelIgnoreUnannotated
 public class InOutStorageBomExportVo {
     /**
      * 出入库单号
@@ -34,6 +39,16 @@ public class InOutStorageBomExportVo {
     private String warehouseName;
 
     /**
+     * 类型 1入库 0出库
+     */
+    private Integer type;
+
+    /**
+     * 出入库明细
+     */
+    private Integer detailType;
+
+    /**
      * 出入库明细类型值
      */
     @ColumnWidth(20)
@@ -82,4 +97,11 @@ public class InOutStorageBomExportVo {
     @ExcelProperty(value = "操作人", index = 9)
     private String applicant;
 
+
+    public String getDetailTypeValue() {
+        if (Objects.equals(type, 1)) {
+            return InDetailTypeEnum.getInDetailType(detailType).getValue();
+        }
+        return OutDetailTypeEnum.getOutDetailType(detailType).getValue();
+    }
 }

+ 5 - 57
sd-business/src/main/java/com/sd/business/entity/in/vo/InOutStorageBomVo.java

@@ -1,17 +1,8 @@
 package com.sd.business.entity.in.vo;
 
-import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
-import com.alibaba.excel.annotation.ExcelProperty;
-import com.alibaba.excel.annotation.write.style.ColumnWidth;
-import com.sd.business.entity.in.emums.InDetailTypeEnum;
-import com.sd.business.entity.in.emums.OutDetailTypeEnum;
 import com.sd.business.entity.in.po.InOutStorageBom;
 import lombok.Getter;
 import lombok.Setter;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-import java.util.Objects;
 
 /**
  * 出入库bom列表查询返回值实体
@@ -21,7 +12,6 @@ import java.util.Objects;
  */
 @Getter
 @Setter
-@ExcelIgnoreUnannotated
 public class InOutStorageBomVo extends InOutStorageBom {
 
     /**
@@ -37,23 +27,11 @@ public class InOutStorageBomVo extends InOutStorageBom {
     /**
      * 出入库单号
      */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "出入库单号", index = 0)
     private String code;
 
     /**
-     * 入库时间
-     */
-    @ColumnWidth(20)
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ExcelProperty(value = "出入库时间", index = 9)
-    private Date createTime;
-
-    /**
      * 申请人
      */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "申请人", index = 10)
     private String applicant;
 
     /**
@@ -64,65 +42,35 @@ public class InOutStorageBomVo extends InOutStorageBom {
     /**
      * 仓库名称
      */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "仓库", index = 4)
     private String warehouseName;
 
     /**
+     * 仓库编号
+     */
+    private String warehouseCode;
+
+    /**
      * 事业部名称
      */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "归属事业部", index = 2)
     private String departmentName;
 
     /**
      * 采购单号
      */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "采购单号", index = 1)
     private String purchaseCode;
 
     /**
      * 产品规格品号
      */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "品号", index = 6)
     private String bomSpecCode;
 
     /**
      * 产品规格品名
      */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "品名", index = 7)
     private String bomSpecName;
 
     /**
      * 备注
      */
     private String remark;
-
-    /**
-     * 仓库类型值
-     */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "仓库类型", index = 3)
-    private String warehouseTypeValue;
-
-    /**
-     * 出入库明细类型值
-     */
-    @ColumnWidth(20)
-    @ExcelProperty(value = "出入库类型", index = 5)
-    private String detailTypeValue;
-
-    public String getWarehouseTypeValue() {
-        return warehouseName;
-    }
-
-    public String getDetailTypeValue() {
-        if (Objects.equals(type, 1)) {
-            return InDetailTypeEnum.getInDetailType(detailType).getValue();
-        }
-        return OutDetailTypeEnum.getOutDetailType(detailType).getValue();
-    }
 }

+ 13 - 1
sd-business/src/main/java/com/sd/business/entity/statement/vo/DocumentByRevenueCostVo.java

@@ -2,6 +2,8 @@ package com.sd.business.entity.statement.vo;
 
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.HeadFontStyle;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import lombok.Builder;
 import lombok.Getter;
@@ -10,11 +12,18 @@ import lombok.Setter;
 import java.math.BigDecimal;
 import java.util.Date;
 
+/**
+ * 收入成本列表查询返回值实体
+ *
+ * @author
+ * @since 2023-10-11
+ */
 @Getter
 @Setter
 @Builder
 @ExcelIgnoreUnannotated
-@HeadRowHeight(30)
+@HeadRowHeight(35)
+@HeadFontStyle(fontHeightInPoints = 10)
 public class DocumentByRevenueCostVo {
 
     /**
@@ -41,6 +50,7 @@ public class DocumentByRevenueCostVo {
     /**
      * 发货时间
      */
+    @ColumnWidth(20)
     @ExcelProperty({"销售收入成本表", "销售日期"})
     private Date salesDate;
 
@@ -65,12 +75,14 @@ public class DocumentByRevenueCostVo {
     /**
      * 销售订单号
      */
+    @ColumnWidth(20)
     @ExcelProperty({"销售收入成本表", "销售订单号"})
     private String code;
 
     /**
      * 万里牛单号
      */
+    @ColumnWidth(20)
     @ExcelProperty({"销售收入成本表", "万里牛单号"})
     private String wlnCode;
 

+ 5 - 0
sd-business/src/main/java/com/sd/business/entity/warehouse/po/Warehouse.java

@@ -24,6 +24,11 @@ public class Warehouse extends BasePo {
     private String type;
 
     /**
+     * 仓库编号 E10仓库编号
+     */
+    private String code;
+
+    /**
      * 仓库名称
      */
     private String name;

+ 1 - 0
sd-business/src/main/resources/mapper/in/InOutStorageBomMapper.xml

@@ -11,6 +11,7 @@
                ios.create_time,
                w.type  warehouseType,
                w.name  warehouseName,
+               w.code  warehouseCode,
                (CASE WHEN ios.department_id = 0 THEN '胜德体育' ELSE d.name END) departmentName,
                p.code  purchaseCode,
                ios.detail_type,

+ 1 - 0
sd-business/src/main/resources/mapper/warehouse/WarehouseMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.sd.business.mapper.warehouse.WarehouseMapper">
     <select id="getPage" resultType="com.sd.business.entity.warehouse.vo.WarehouseVo">
         select w.id,
+               w.code,
                w.type,
                w.name,
                w.remark,

BIN
sd-starter/src/main/resources/template/inOutStorageDetails.xlsx