| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.basic.dto.ProductModelExportDto; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | String trimmed = value.trim(); |
| | | return trimmed.isEmpty() ? null : trimmed; |
| | | } |
| | | |
| | | @Override |
| | | public void exportProductModel(HttpServletResponse response, ProductDto productDto) { |
| | | Page<ProductModel> page = new Page<>(-1, -1); |
| | | List<ProductModel> list = modelListPage(page, productDto).getRecords(); |
| | | List<ProductModelExportDto> exportList = new ArrayList<>(); |
| | | for (ProductModel productModel : list) { |
| | | ProductModelExportDto dto = new ProductModelExportDto(); |
| | | dto.setProductCode(productModel.getProductCode()); |
| | | dto.setModel(productModel.getModel()); |
| | | dto.setUnit(productModel.getUnit()); |
| | | exportList.add(dto); |
| | | } |
| | | ExcelUtil<ProductModelExportDto> util = new ExcelUtil<>(ProductModelExportDto.class); |
| | | util.exportExcel(response, exportList, "产品规格型号"); |
| | | } |
| | | } |