Browse Source

二线出岛放行业务bug修复

wenjinbiao 2 months ago
parent
commit
48b72245e8

+ 22 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qysecondlinewarehouse/controller/QySecondlineWarehouseController.java

@@ -13,15 +13,19 @@
 package vip.xiaonuo.biz.modular.qysecondlinewarehouse.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.URLUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
+import vip.xiaonuo.biz.modular.dict.service.BizDictService;
 import vip.xiaonuo.common.annotation.CommonLog;
 import vip.xiaonuo.common.pojo.CommonResult;
 import vip.xiaonuo.biz.modular.qysecondlinewarehouse.entity.QySecondlineWarehouse;
@@ -51,7 +55,8 @@ import java.util.HashMap;
 @RestController
 @Validated
 public class QySecondlineWarehouseController {
-
+    @Autowired
+    BizDictService bizDictService;
     @Resource
     private QySecondlineWarehouseService qySecondlineWarehouseService;
 
@@ -109,8 +114,24 @@ public class QySecondlineWarehouseController {
     @SaCheckPermission("/biz/qysecondlinewarehouse/export")
     @PostMapping("/biz/qysecondlinewarehouse/export")
     public void export(@RequestBody @Valid QySecondlineWarehousePageParam qySecondlineWarehousePageParam, HttpServletResponse response) {
+        qySecondlineWarehousePageParam.setSize(Integer.MAX_VALUE);
         Page<QySecondlineWarehouse> page =  qySecondlineWarehouseService.page(qySecondlineWarehousePageParam);
         List<QySecondlineWarehouse> records = page.getRecords();
+        if(CollectionUtil.isNotEmpty(records)) {
+            records.parallelStream().forEach(r -> {
+                if(ObjectUtil.isNotEmpty(r.getAccountType())){
+                    String accountType = bizDictService.getNameByType("tzlx", r.getAccountType());
+                    r.setAccountType(accountType);
+                }
+                if(ObjectUtil.isNotEmpty(r.getBusinessType())){
+                    r.setBusinessType(r.getBusinessType().equals("1") ? "出库单":"入库单");
+                }
+                if(ObjectUtil.isNotEmpty(r.getMeasurementUnit())){
+                    String measurementUnit = bizDictService.getNameByType("measurement unit", r.getMeasurementUnit());
+                    r.setMeasurementUnit(measurementUnit);
+                }
+            });
+        }
         exportExcel(response,QySecondlineWarehouse.class,records,"二线出岛业务记账管理");
     }
 

+ 4 - 4
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qysecondlinewarehouse/entity/QySecondlineWarehouse.java

@@ -105,15 +105,15 @@ public class QySecondlineWarehouse {
     private String secondlineOutislandNumber;
 
     /** 出库单号 */
-    @Schema(description = "出库单号")
+    @Schema(description = "出/入库单号")
     @ColumnWidth(12)
-    @ExcelProperty(index = 12,value = "出库单号")
+    @ExcelProperty(index = 12,value = "出/入库单号")
     private String warehouseNumber;
 
     /** 出库日期 */
-    @Schema(description = "出日期")
+    @Schema(description = "出/入日期")
     @ColumnWidth(12)
-    @ExcelProperty(index = 13,value = "出日期")
+    @ExcelProperty(index = 13,value = "出/入日期")
     private Date warehouseTime;
 
     /** 记账日期 */

+ 5 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qysecondlinewarehouse/param/QySecondlineWarehousePageParam.java

@@ -17,6 +17,7 @@ import lombok.Getter;
 import lombok.Setter;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 二线出岛业务记账管理查询参数
@@ -109,9 +110,11 @@ public class QySecondlineWarehousePageParam {
     private String endAccountTime;
 
     @Schema(description = "记账数量min")
-    private String accountNumberMin;
+    private Integer accountNumberMin;
 
     @Schema(description = "记账数量Max")
-    private String accountNumberMax;
+    private Integer accountNumberMax;
+
+    private List<String> ids;
 
 }

+ 21 - 7
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qysecondlinewarehouse/service/impl/QySecondlineWarehouseServiceImpl.java

@@ -30,11 +30,13 @@ import com.itextpdf.text.pdf.PdfWriter;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.biz.modular.dict.service.BizDictService;
 import vip.xiaonuo.biz.modular.qyfrontlinewarehouse.entity.QyFrontlineWarehouse;
 import vip.xiaonuo.biz.modular.qyfrontlinewarehouse.param.QyFrontlineWarehouseIdParam;
 import vip.xiaonuo.biz.modular.qyfrontlinewarehouse.param.QyFrontlineWarehousePageParam;
 import vip.xiaonuo.biz.modular.qyoutwarehouse.entity.QyOutWarehouse;
 import vip.xiaonuo.biz.modular.qyoutwarehouse.service.QyOutWarehouseService;
+import vip.xiaonuo.biz.modular.qysecondlinerqhfd.entity.QySecondlineRqHfd;
 import vip.xiaonuo.common.enums.CommonSortOrderEnum;
 import vip.xiaonuo.common.exception.CommonException;
 import vip.xiaonuo.common.page.CommonPageRequest;
@@ -67,9 +69,17 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
     private DevFileApi devFileApi;
     @Autowired
     QyOutWarehouseService qyOutWarehouseService;
+
+    @Autowired
+    BizDictService bizDictService;
     @Override
     public Page<QySecondlineWarehouse> page(QySecondlineWarehousePageParam qySecondlineWarehousePageParam) {
         QueryWrapper<QySecondlineWarehouse> queryWrapper = new QueryWrapper<QySecondlineWarehouse>().checkSqlInjection();
+
+        if(ObjectUtil.isNotEmpty(qySecondlineWarehousePageParam.getIds())) {
+            queryWrapper.lambda().in(QySecondlineWarehouse::getId, qySecondlineWarehousePageParam.getIds());
+        }
+
         if(ObjectUtil.isNotEmpty(qySecondlineWarehousePageParam.getCompanyCode())) {
             queryWrapper.lambda().like(QySecondlineWarehouse::getCompanyCode, qySecondlineWarehousePageParam.getCompanyCode());
         }
@@ -124,7 +134,7 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
             queryWrapper.orderBy(true, qySecondlineWarehousePageParam.getSortOrder().equalsIgnoreCase(CommonSortOrderEnum.ASC.getValue()),
                     StrUtil.toUnderlineCase(qySecondlineWarehousePageParam.getSortField()));
         } else {
-            queryWrapper.lambda().orderByAsc(QySecondlineWarehouse::getId);
+            queryWrapper.lambda().orderByDesc(QySecondlineWarehouse::getId);
         }
         return this.page(CommonPageRequest.defaultPage(), queryWrapper);
     }
@@ -299,7 +309,8 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
             PdfPCell specsCell = CommonPdfUtil.createCenterPdfPCell(item.getSpecs(), 1, 1, CommonPdfUtil.NORMALFONT);
 
             PdfPCell accountNumberCell = CommonPdfUtil.createCenterPdfPCell(item.getAccountNumber(), 1, 1, CommonPdfUtil.NORMALFONT);
-            PdfPCell unitCell = CommonPdfUtil.createCenterPdfPCell(item.getMeasurementUnit(), 1, 1, CommonPdfUtil.NORMALFONT);
+            String measurementUnit = bizDictService.getNameByType("measurement unit", item.getMeasurementUnit());
+            PdfPCell unitCell = CommonPdfUtil.createCenterPdfPCell(measurementUnit, 1, 1, CommonPdfUtil.NORMALFONT);
             BigDecimal subAmount = BigDecimal.ZERO;
             try {
                 subAmount = new BigDecimal(item.getAccountNumber()).multiply(new BigDecimal(item.getUnitPrice()));
@@ -401,8 +412,8 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
         PdfPCell accountNumberHead = CommonPdfUtil.createCenterPdfPCell("记账数量", 1, 1, CommonPdfUtil.NORMALFONT);
         PdfPCell unitHead = CommonPdfUtil.createCenterPdfPCell("法定计量单位", 1, 1, CommonPdfUtil.NORMALFONT);
         PdfPCell frontlineRelesasNumberHead = CommonPdfUtil.createCenterPdfPCell("二线出岛申请单号", 1, 1, CommonPdfUtil.NORMALFONT);
-        PdfPCell warehouseNumberHead = CommonPdfUtil.createCenterPdfPCell("出库单号", 1, 1, CommonPdfUtil.NORMALFONT);
-        PdfPCell warehouseTimeHead = CommonPdfUtil.createCenterPdfPCell("出库日期", 1, 1, CommonPdfUtil.NORMALFONT);
+        PdfPCell warehouseNumberHead = CommonPdfUtil.createCenterPdfPCell("出/入库单号", 1, 1, CommonPdfUtil.NORMALFONT);
+        PdfPCell warehouseTimeHead = CommonPdfUtil.createCenterPdfPCell("出/入库日期", 1, 1, CommonPdfUtil.NORMALFONT);
         PdfPCell accountTimeHead = CommonPdfUtil.createCenterPdfPCell("记账时间", 1, 1, CommonPdfUtil.NORMALFONT);
 
         pdfPTable.addCell(indexNoHead);
@@ -427,13 +438,16 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
             PdfPCell indexNoCell = CommonPdfUtil.createCenterPdfPCell(String.valueOf(i), 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell companyCodeCell = CommonPdfUtil.createCenterPdfPCell(item.getCompanyCode(), 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell companyNameCell = CommonPdfUtil.createCenterPdfPCell(item.getCompanyName(), 1, 1, CommonPdfUtil.NORMALFONT);
-            PdfPCell accountTypeCell = CommonPdfUtil.createCenterPdfPCell(item.getAccountType(), 1, 1, CommonPdfUtil.NORMALFONT);
+            String accountType = bizDictService.getNameByType("tzlx",item.getAccountType());
+            PdfPCell accountTypeCell = CommonPdfUtil.createCenterPdfPCell(accountType, 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell accountCodeCell = CommonPdfUtil.createCenterPdfPCell(item.getAccountCode(), 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell commodityCodeCell = CommonPdfUtil.createCenterPdfPCell(item.getCommodityCode(), 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell commodityNameCell = CommonPdfUtil.createCenterPdfPCell(item.getCommodityName(), 1, 1, CommonPdfUtil.NORMALFONT);
-            PdfPCell businessTypeCell = CommonPdfUtil.createCenterPdfPCell(item.getBusinessType(), 1, 1, CommonPdfUtil.NORMALFONT);
+            String businessType = item.getBusinessType().equals("1") ? "出库单" : "入库单";
+            PdfPCell businessTypeCell = CommonPdfUtil.createCenterPdfPCell(businessType, 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell accountNumberCell = CommonPdfUtil.createCenterPdfPCell(item.getAccountNumber(), 1, 1, CommonPdfUtil.NORMALFONT);
-            PdfPCell unitCell = CommonPdfUtil.createCenterPdfPCell(item.getMeasurementUnit(), 1, 1, CommonPdfUtil.NORMALFONT);
+            String measurementUnit = bizDictService.getNameByType("measurement unit", item.getMeasurementUnit());
+            PdfPCell unitCell = CommonPdfUtil.createCenterPdfPCell(measurementUnit, 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell frontlineRelesasNumberCell = CommonPdfUtil.createCenterPdfPCell(item.getSecondlineOutislandNumber(), 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell warehouseNumberCell = CommonPdfUtil.createCenterPdfPCell(item.getWarehouseNumber(), 1, 1, CommonPdfUtil.NORMALFONT);
             PdfPCell warehouseTimeCell = CommonPdfUtil.createCenterPdfPCell(item.getWarehouseTime() != null ? dateFormat.format(item.getAccountTime()) : "", 1, 1, CommonPdfUtil.NORMALFONT);