src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
@@ -1,6 +1,7 @@ package com.ruoyi.procurementrecord.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; @@ -219,10 +220,16 @@ * @param response */ @PostMapping("/exportTwo") public void exportTwo(HttpServletResponse response) { List<CustomStorage> customStorages = customStorageMapper.selectList(null); public void exportTwo(HttpServletResponse response,@RequestBody List<CustomStorage> customStorage) { if(CollectionUtils.isEmpty(customStorage)){ customStorage = customStorageMapper.selectList(null); } for (CustomStorage storage : customStorage) { // nginx 前端访问图片 storage.setUrl("http://114.132.189.42:9044"+storage.getUrl()); } ExcelUtil<CustomStorage> util = new ExcelUtil<CustomStorage>(CustomStorage.class); util.exportExcel(response, customStorages, "入库台账"); util.exportExcel(response, customStorage, "入库台账"); } src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
@@ -25,6 +25,12 @@ @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 图片 */ @Excel(name = "图片", cellType = Excel.ColumnType.IMAGE, height = 114, width = 25) private String url; // 入库时间 @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") @@ -34,61 +40,58 @@ @TableField(exist = false) private String timeStr; /** * 待出库数量 */ @Excel(name = "待出库数量") @TableField(exist = false) private BigDecimal inboundNum0; /** * 图片 */ private String url; /** * 出库数量 */ @Excel(name = "出库数量") @TableField(exist = false) private BigDecimal totalInboundNum = BigDecimal.ZERO; // 物品类型 @Excel(name = "物品类型") // @Excel(name = "物品类型") private String itemType; // 入库批次 @Excel(name = "入库批次") // @Excel(name = "入库批次") private String inboundBatches; // 入库数量 @Excel(name = "入库数量") private BigDecimal inboundNum; // 供应商名称 @Excel(name = "供应商名称") // @Excel(name = "供应商名称") private String supplierName; // 产品大类 @Excel(name = "产品大类") @Excel(name = "产品名称") private String productCategory; // 规格型号 @Excel(name = "规格型号") @Excel(name = "产品高度") private String specificationModel; // 单位 @Excel(name = "单位") private String unit; // 含税单价 @Excel(name = "含税单价") @Excel(name = "单价") private BigDecimal taxInclusiveUnitPrice; // 含税总价 @Excel(name = "含税总价") // @Excel(name = "含税总价") private BigDecimal taxInclusiveTotalPrice; // 税率(%) @Excel(name = "税率(%)") // @Excel(name = "税率(%)") private BigDecimal taxRate; // 不含税总价 @Excel(name = "不含税总价") // @Excel(name = "不含税总价") private BigDecimal taxExclusiveTotalPrice; /** * 入库用户 */ @Excel(name = "入库用户") private String createBy; /** * 待出库数量 */ @Excel(name = "待出库数量") @TableField(exist = false) private BigDecimal inboundNum0 = BigDecimal.ZERO; /** * 出库数量 */ @Excel(name = "出库数量") @TableField(exist = false) private BigDecimal totalInboundNum = BigDecimal.ZERO; /** * 入库用户id */ @@ -99,8 +102,8 @@ * 入库时间 */ @TableField(fill = FieldFill.INSERT) @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") // @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDateTime createTime; /** @@ -113,8 +116,8 @@ * 修改时间 */ @TableField(fill = FieldFill.INSERT_UPDATE) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; /** src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -273,7 +273,7 @@ @Override public void exportCopyTwo(HttpServletResponse response,Integer type) { LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); customStorageLambdaQueryWrapper.groupBy(CustomStorage::getSupplierName, CustomStorage::getProductCategory, CustomStorage::getSpecificationModel); customStorageLambdaQueryWrapper.groupBy(CustomStorage::getProductCategory, CustomStorage::getSpecificationModel); List<CustomStorage> list = customStorageMapper.selectList(customStorageLambdaQueryWrapper); // 计算待入库数量 // 查询采购记录已入库数量 @@ -285,7 +285,6 @@ } LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, type); procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, type); List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); if(CollectionUtils.isEmpty( procurementRecords)){ src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -210,7 +210,7 @@ left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 left join purchase_ledger t3 on t3.id = t2.sales_ledger_id where t1.type = 1 group by t3.supplier_name,t2.product_category,t2.specification_model group by t2.product_category,t2.specification_model </select> <select id="listCopyOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> select @@ -239,7 +239,7 @@ left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 left join sales_ledger t3 on t3.id = t2.sales_ledger_id where t1.type = 2 group by t3.customer_name,t2.product_category,t2.specification_model group by t2.product_category,t2.specification_model </select> <select id="listPageByProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto"> select