zhs 2 rokov pred
rodič
commit
301adf6651

+ 2 - 0
src/main/java/com/tld/controller/QueryListController.java

@@ -3,6 +3,7 @@ package com.tld.controller;
 import com.tld.model.*;
 import com.tld.model.Error;
 import com.tld.service.QueryListService;
+import com.tld.util.PassToken;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 
@@ -87,6 +88,7 @@ public class QueryListController {
      * @return 返回结果
      */
     @GetMapping("exportStorageLocation")
+    @PassToken
     public void exportStorageLocation(Inventory inventory,HttpServletResponse response){
         queryListService.exportStorageLocation(inventory,response);
     }

+ 1 - 0
src/main/java/com/tld/excel/ExcelUtils.java

@@ -877,6 +877,7 @@ public class ExcelUtils {
         // 是否为字符串
         if (o instanceof String) {
             String s = o.toString();
+            System.out.println(s);
             // 当数字类型长度超过8位时,改为字符串类型显示(Excel数字超过一定长度会显示为科学计数法)
             if (isNumeric(s) && s.length() < 8) {
                 cell.setCellType(CellType.NUMERIC);

+ 1 - 1
src/main/java/com/tld/service/impl/QueryListServiceImpl.java

@@ -96,7 +96,7 @@ public class QueryListServiceImpl implements QueryListService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("会计年度", "会计期间", "仓库编号", "仓库名称", "库位名称", "物料编号", "物料名称", "主计量单位", "库存数量", "WBS编号", "安全库存", "库龄(天)", "核算分类名称", "物料分类名称", "所属公司编号", "所属公司名车才能够");
+            List<Object> head = Arrays.asList("会计年度", "会计期间", "仓库编号", "仓库名称", "库位名称", "物料编号", "物料名称", "主计量单位", "库存数量", "WBS编号", "安全库存", "库龄(天)", "核算分类名称", "物料分类名称", "所属公司编号", "所属公司");
             //查询数据
             List<Map<String, Object>> list = queryListMapper.getStorageLocation(inventory);
             sheetDataList.add(head);

+ 6 - 6
src/main/resources/mapper/QueryListMappeer.xml

@@ -183,13 +183,13 @@
             b.storage_location_name as storageLocationName,
             c.code as code,
             c.name as name,
-            ifnull(c.unit_of_measurement, ""),
+            ifnull(c.unit_of_measurement, "暂无单位") as unit_of_measurement,
             sum( a.amount ) AS sum,
-            a.wbs as wbs,
-            ifnull(c.max_num, 0),
-            DATEDIFF(now(),scrq),
-            c.part_type,
-            c.wllb_class,
+            if(a.wbs = "", " ", a.wbs) as wbs,
+            ifnull(c.max_num, 0) as max_num,
+            DATEDIFF(now(),scrq) as day,
+            ifnull(c.part_type, "暂无分类") as part_type,
+            ifnull(c.wllb_class, "暂无分类") as wllb_class,
             p.code as companyCode,
             p.name as companyName
         FROM tld_inventory a