Browse Source

核注核放bug修改

wenjinbiao 8 months ago
parent
commit
62c0e479d6

+ 16 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyfrontlinewarehouse/service/impl/QyFrontlineWarehouseServiceImpl.java

@@ -15,6 +15,7 @@ package vip.xiaonuo.biz.modular.qyfrontlinewarehouse.service.impl;
 import cn.afterturn.easypoi.pdf.PdfExportUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollStreamUtil;
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -28,6 +29,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.biz.modular.qyinwarehouse.entity.QyInWarehouse;
+import vip.xiaonuo.biz.modular.qyinwarehouse.service.QyInWarehouseService;
 import vip.xiaonuo.common.enums.CommonSortOrderEnum;
 import vip.xiaonuo.common.exception.CommonException;
 import vip.xiaonuo.common.page.CommonPageRequest;
@@ -61,6 +64,8 @@ public class QyFrontlineWarehouseServiceImpl extends ServiceImpl<QyFrontlineWare
 
     @Autowired
     private DevFileApi devFileApi;
+    @Autowired
+    private QyInWarehouseService qyInWarehouseService;
 
     @Override
     public Page<QyFrontlineWarehouse> page(QyFrontlineWarehousePageParam qyFrontlineWarehousePageParam) {
@@ -184,8 +189,18 @@ public class QyFrontlineWarehouseServiceImpl extends ServiceImpl<QyFrontlineWare
 
         queryWrapper.lambda().eq(QyFrontlineWarehouse::getWarehouseNumber,qyFrontlineWarehouse.getWarehouseNumber());
 
+
+
         List<QyFrontlineWarehouse> list = this.list(queryWrapper);
 
+        String warehouseNumber = qyFrontlineWarehouse.getWarehouseNumber();
+        QueryWrapper<QyInWarehouse> qyInWarehouseQuery= new QueryWrapper<QyInWarehouse>().checkSqlInjection();
+        List<QyInWarehouse> warehouses = qyInWarehouseService.list(qyInWarehouseQuery);
+        QyInWarehouse qyInWarehouse = null;
+        if(CollectionUtil.isNotEmpty(warehouses)){
+            qyInWarehouse = CollectionUtil.getFirst(warehouses);
+        }
+
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         Document document = CommonPdfUtil.createDocument();
         PdfWriter.getInstance(document, os);
@@ -232,7 +247,7 @@ public class QyFrontlineWarehouseServiceImpl extends ServiceImpl<QyFrontlineWare
 
         //第三行内容_往来对象
         String wldxName = "往来对象:";
-        PdfPCell wldxHead = CommonPdfUtil.createCenterPdfPCell(wldxName+"哈尔滨怡康药业邮箱公司", 1, 3, CommonPdfUtil.NORMALFONT);
+        PdfPCell wldxHead = CommonPdfUtil.createCenterPdfPCell(wldxName+(qyInWarehouse == null ? "":qyInWarehouse.getFhqymc()), 1, 3, CommonPdfUtil.NORMALFONT);
         wldxHead.setHorizontalAlignment(Element.ALIGN_LEFT);
         pdfPTable.addCell(wldxHead);
 

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

@@ -14,6 +14,7 @@ package vip.xiaonuo.biz.modular.qysecondlinewarehouse.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollStreamUtil;
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -32,6 +33,8 @@ import org.springframework.transaction.annotation.Transactional;
 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.common.enums.CommonSortOrderEnum;
 import vip.xiaonuo.common.exception.CommonException;
 import vip.xiaonuo.common.page.CommonPageRequest;
@@ -62,6 +65,8 @@ import java.util.List;
 public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWarehouseMapper, QySecondlineWarehouse> implements QySecondlineWarehouseService {
     @Autowired
     private DevFileApi devFileApi;
+    @Autowired
+    QyOutWarehouseService qyOutWarehouseService;
     @Override
     public Page<QySecondlineWarehouse> page(QySecondlineWarehousePageParam qySecondlineWarehousePageParam) {
         QueryWrapper<QySecondlineWarehouse> queryWrapper = new QueryWrapper<QySecondlineWarehouse>().checkSqlInjection();
@@ -185,6 +190,12 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
         PdfWriter.getInstance(document, os);
         document.open();
 
+        QueryWrapper<QyOutWarehouse> qyOutWarehouseQuery = new QueryWrapper<QyOutWarehouse>().checkSqlInjection();
+        List<QyOutWarehouse> qyOutWarehouses = qyOutWarehouseService.list(qyOutWarehouseQuery);
+        QyOutWarehouse qyOutWarehouse = null;
+        if(CollectionUtil.isNotEmpty(qyOutWarehouses)){
+            qyOutWarehouse = CollectionUtil.getFirst(qyOutWarehouses);
+        }
 
 
         String headName = "出库单";
@@ -221,7 +232,7 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
 
         //第三行内容_往来对象
         String wldxName = "往来对象:";
-        PdfPCell wldxHead = CommonPdfUtil.createCenterPdfPCell(wldxName+"哈尔滨怡康药业邮箱公司", 1, 3, CommonPdfUtil.NORMALFONT);
+        PdfPCell wldxHead = CommonPdfUtil.createCenterPdfPCell(wldxName+(qyOutWarehouse == null? "" : qyOutWarehouse.getShqymc()), 1, 3, CommonPdfUtil.NORMALFONT);
         wldxHead.setHorizontalAlignment(Element.ALIGN_LEFT);
         pdfPTable.addCell(wldxHead);