| | |
| | | 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; |
| | |
| | | * @param response |
| | | */ |
| | | @PostMapping("/exportTwo") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | List<CustomStorage> customStorages = customStorageMapper.selectList(null); |
| | | public void exportTwo(HttpServletResponse response,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, "入库台账"); |
| | | } |
| | | |
| | | |
| | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @Excel(name = "图片", cellType = Excel.ColumnType.IMAGE) |
| | | private String url; |
| | | /** |
| | | * 出库数量 |
| | |
| | | @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); |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | |
| | | } |
| | | 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)){ |
| | |
| | | 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 |
| | |
| | | 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 |