|
@@ -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);
|