| | |
| | | private String customerName; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty("物料编码") |
| | | @Excel(name = "物料编码") |
| | | private String materialCode; |
| | | |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | @ApiModelProperty("产品名称") |
| | | @Excel(name = "产品名称") |
| | | private String productName; |
| | | |
| | | /** |
| | | * 产品规格 |
| | | */ |
| | | @ApiModelProperty("产品规格") |
| | | @Excel(name = "产品规格") |
| | | private String productSpec; |
| | | |
| | | /** |
| | | * 关联物料信息表ID |
| | | */ |
| | | @ApiModelProperty("关联物料信息表ID") |
| | |
| | | plan.setCustomerName(formData.getString("textField_lbkozohg")); |
| | | |
| | | String materialCode = row.getString("textField_l9xo62q5"); |
| | | plan.setMaterialCode(materialCode); |
| | | // 根据物料编码查询物料信息表,关联物料ID |
| | | if (StringUtils.isNotEmpty(materialCode)) { |
| | | LambdaQueryWrapper<ProductMaterialSku> skuQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | ProductMaterialSku sku = productMaterialSkuService.getOne(skuQueryWrapper); |
| | | if (sku != null) { |
| | | plan.setProductMaterialSkuId(sku.getId()); |
| | | if (sku.getMaterialId() != null) { |
| | | // 设置产品名称 |
| | | ProductMaterial material = productMaterialService.getById(sku.getMaterialId()); |
| | | if (material != null) { |
| | | plan.setProductName(material.getMaterialName()); |
| | | } |
| | | } |
| | | // 设置规格型号 |
| | | plan.setProductSpec(sku.getSpecification()); |
| | | } |
| | | } |
| | | |
| | |
| | | ProductMaterialSku sku = productMaterialSkuService.getOne(skuQueryWrapper); |
| | | if (sku != null) { |
| | | entity.setProductMaterialSkuId(sku.getId()); |
| | | if (sku.getMaterialId() != null) { |
| | | ProductMaterial material = productMaterialService.getById(sku.getMaterialId()); |
| | | if (material != null) { |
| | | entity.setProductName(material.getMaterialName()); |
| | | } |
| | | } |
| | | entity.setProductSpec(sku.getSpecification()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | <select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto"> |
| | | SELECT |
| | | material_code, |
| | | product_name, |
| | | product_spec, |
| | | length, |
| | | width, |
| | | height, |
| | | COALESCE(SUM(quantity),0) AS quantity, |
| | | COALESCE(SUM(volume),0) AS volume |
| | | FROM production_plan |
| | | sku.material_code, |
| | | pm.material_name AS product_name, |
| | | sku.specification AS product_spec, |
| | | pp.length, |
| | | pp.width, |
| | | pp.height, |
| | | COALESCE(SUM(pp.quantity),0) AS quantity, |
| | | COALESCE(SUM(pp.volume),0) AS volume |
| | | FROM production_plan pp |
| | | LEFT JOIN product_material_sku sku |
| | | ON pp.product_material_sku_id = sku.id |
| | | LEFT JOIN product_material pm |
| | | ON sku.material_id = pm.id |
| | | <where> |
| | | <if test="materialCode != null and materialCode != ''"> |
| | | AND material_code LIKE CONCAT('%', #{materialCode}, '%') |
| | | AND sku.material_code LIKE CONCAT('%', #{materialCode}, '%') |
| | | </if> |
| | | |
| | | <if test="productName != null and productName != ''"> |
| | | AND product_name LIKE CONCAT('%', #{productName}, '%') |
| | | AND pm.material_name LIKE CONCAT('%', #{productName}, '%') |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | material_code, |
| | | product_name, |
| | | product_spec, |
| | | length, |
| | | width, |
| | | height |
| | | sku.material_code, |
| | | pm.material_name, |
| | | sku.specification, |
| | | pp.length, |
| | | pp.width, |
| | | pp.height |
| | | </select> |
| | | |
| | | <select id="selectWithMaterialByIds" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto"> |