增加产品规格中的物料编号,以及根据规格关联查询物料编号
| | |
| | | */ |
| | | @Data |
| | | public class ProductModelExportDto { |
| | | @Excel(name = "物料编号") |
| | | private String materialCode; |
| | | |
| | | @Excel(name = "规格型号") |
| | | private String model; |
| | |
| | | private String productName; |
| | | |
| | | /** |
| | | * 物料编号 |
| | | */ |
| | | @Excel(name = "物料编号") |
| | | private String materialCode; |
| | | |
| | | /** |
| | | * 规格型号 |
| | | */ |
| | | @Excel(name = "规格型号") |
| | |
| | | ProductModel item = productModelList.get(i); |
| | | int rowNum = i + 2; |
| | | |
| | | if (StringUtils.isEmpty(item.getMaterialCode())) { |
| | | return AjaxResult.error("第 " + rowNum + " 行导入失败: [物料编号] 不能为空"); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(item.getModel())) { |
| | | return AjaxResult.error("第 " + rowNum + " 行导入失败: [规格型号] 不能为空"); |
| | | } |
| | |
| | | Long productId = product.getProductId(); |
| | | if (productId != null && productMap.containsKey(productId)) { |
| | | product.setProductCategory(productMap.get(productId)); |
| | | product.setProductId(productId); |
| | | } |
| | | |
| | | Long productModelId = product.getProductModelId(); |
| | | if (productModelId != null && modelMap.containsKey(productModelId)) { |
| | | product.setSpecificationModel(modelMap.get(productModelId)); |
| | | product.setProductModelId(productModelId); |
| | | } |
| | | } |
| | | |
| | |
| | | @TableField(exist = false) |
| | | //是否可编辑 |
| | | private Boolean isEdit; |
| | | |
| | | /** |
| | | * 客户地址 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String companyAddress; |
| | | |
| | | /** |
| | | * 客户联系电话 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String contactPhone; |
| | | } |
| | | |
| | |
| | | private String productCategory; |
| | | |
| | | /** |
| | | * 物料编号 |
| | | */ |
| | | @Excel(name = "物料编号") |
| | | private String materialCode; |
| | | |
| | | /** |
| | | * 规格型号 |
| | | */ |
| | | @Excel(name = "规格型号") |
| | |
| | | T1.salesman, |
| | | T1.customer_id, |
| | | T1.customer_name, |
| | | T3.company_address, |
| | | T3.contact_phone, |
| | | T1.entry_person, |
| | | T1.remarks, |
| | | T1.attachment_materials, |
| | |
| | | END AS is_fh |
| | | FROM sales_ledger T1 |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | | LEFT JOIN customer T3 ON T1.customer_id = T3.id |
| | | LEFT JOIN ( |
| | | SELECT sales_ledger_id, |
| | | COUNT(*) as total_count, |
| | |
| | | <select id="selectSalesLedgerProductList" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> |
| | | SELECT |
| | | T1.*, |
| | | T3.material_code, |
| | | CASE |
| | | WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >= IFNULL(T1.quantity, 0) THEN 1 |
| | | ELSE 0 |
| | |
| | | FROM |
| | | sales_ledger_product T1 |
| | | LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id |
| | | LEFT JOIN product_model T3 ON T1.product_model_id = T3.id |
| | | <where> |
| | | <if test="salesLedgerProduct.salesLedgerId != null"> |
| | | AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId} |