zss
12 小时以前 62e9b968c6f6a624b8d633c3c9551f1c814ea6e4
生产计划追踪进度2.0
已修改9个文件
55 ■■■■ 文件已修改
src/main/java/com/ruoyi/production/mapper/ProductionProductMainMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/controller/TrackController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/dto/OrderDto.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/mapper/ProductionPlanMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/service/ProductOrderPlanService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductMainMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/mapper/ProductionProductMainMapper.java
@@ -33,4 +33,6 @@
    IPage<ProductionProductMainDto> listProductionDetails(@Param("ew") SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page);
    ArrayList<Long> listMain(List<Long> idList);
    List<ProductionProductMainDto> selectProductionProductMainDto(@Param("productOrderId") Long productOrderId);
}
src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java
@@ -298,6 +298,7 @@
                                paramEntity.setParamFormat(orderParam.getParamFormat());
                                paramEntity.setValueMode(orderParam.getValueMode());
                                paramEntity.setUnit(orderParam.getUnit());
                                paramEntity.setStandardValue(orderParam.getStandardValue());
                            }
                        }
                        productionProductRouteItemParamService.save(paramEntity);
src/main/java/com/ruoyi/productionPlan/controller/TrackController.java
@@ -29,8 +29,8 @@
    @GetMapping("/trackProgressByNo")
    @ApiOperation("根据主生产计划查询进度")
    public AjaxResult trackProgressByNo(String applyNo) {
        return AjaxResult.success(productOrderPlanService.trackProgressByNo(applyNo));
    public AjaxResult trackProgressByNo(Long productionPlanId) {
        return AjaxResult.success(productOrderPlanService.trackProgressByNo(productionPlanId));
    }
}
src/main/java/com/ruoyi/productionPlan/dto/OrderDto.java
@@ -1,6 +1,7 @@
package com.ruoyi.productionPlan.dto;
import com.ruoyi.production.dto.ProductOrderDto;
import com.ruoyi.production.dto.ProductionProductMainDto;
import com.ruoyi.production.pojo.ProductionProductMain;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@@ -15,5 +16,5 @@
    private ProductOrderDto productOrderDto;
    //报工详情
    private List<ProductionProductMain> productionProductMains;
    private List<ProductionProductMainDto> productionProductMainDtos;
}
src/main/java/com/ruoyi/productionPlan/mapper/ProductionPlanMapper.java
@@ -28,4 +28,5 @@
    List<ProductionPlanDto> selectWithMaterialByIds(@Param("ids") List<Long> ids);
    ProductionPlanDto selectProductionPlanDtoById(@Param("productionPlanId") Long productionPlanId);
}
src/main/java/com/ruoyi/productionPlan/service/ProductOrderPlanService.java
@@ -14,5 +14,5 @@
 */
public interface ProductOrderPlanService extends IService<ProductOrderPlan> {
    TrackDto trackProgressByNo(String applyNo);
    TrackDto trackProgressByNo(Long productionPlanId);
}
src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.production.dto.ProductOrderDto;
import com.ruoyi.production.dto.ProductionProductMainDto;
import com.ruoyi.production.mapper.ProductOrderMapper;
import com.ruoyi.production.mapper.ProductionOrderRouteMapper;
import com.ruoyi.production.mapper.ProductionProductMainMapper;
@@ -46,12 +47,10 @@
    private ProductionProductMainMapper productionProductMainMapper;
    @Override
    public TrackDto trackProgressByNo(String applyNo) {
    public TrackDto trackProgressByNo(Long productionPlanId) {
        TrackDto trackDto = new TrackDto();
        //生产计划数据
        ProductionPlanDto planDto = new ProductionPlanDto();
        planDto.setApplyNo(applyNo);
        ProductionPlanDto productionPlanDto = productionPlanMapper.listPage(new Page(1, -1), planDto).getRecords().get(0);
        ProductionPlanDto productionPlanDto=productionPlanMapper.selectProductionPlanDtoById(productionPlanId);
        trackDto.setProductionPlanDto(productionPlanDto);
        //生产订单数据
        List<OrderDto> orderDtos = listByApplyNo(productionPlanDto);
@@ -73,10 +72,8 @@
            ProductOrderDto productOrderDto=productOrderMapper.getProductOrderDto(productOrderPlan.getProductOrderId());
            orderDto.setProductOrderDto(productOrderDto);
            //报工详情
            List<ProductionProductMain> productionProductMains = productionProductMainMapper.selectList(Wrappers.<ProductionProductMain>lambdaQuery()
                    .eq(ProductionProductMain::getProductOrderId, productOrderPlan.getProductOrderId())
                    .orderByAsc(ProductionProductMain::getReportingTime));
            orderDto.setProductionProductMains(productionProductMains);
            List<ProductionProductMainDto> productionProductMainDtos = productionProductMainMapper.selectProductionProductMainDto(productOrderPlan.getProductOrderId());
            orderDto.setProductionProductMainDtos(productionProductMainDtos);
            orderDtos.add(orderDto);
        });
        return orderDtos;
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -106,6 +106,21 @@
            </if>
        </where>
    </select>
    <select id="selectProductionProductMainDto"
            resultType="com.ruoyi.production.dto.ProductionProductMainDto">
        SELECT ppm.id,
        ppm.product_no,
        ppm.post_name,
        ppm.schedule,
        ppm.reporting_time,
        ppo.quantity,
        ppo.scrap_qty,
        ppo.total_quantity
        FROM production_product_main ppm
        left join production_product_output ppo on ppm.id = ppo.product_main_id
        WHERE product_order_id=#{productOrderId}
        order by reporting_time
    </select>
    <delete id="deleteByWorkOrderIds" parameterType="java.util.List">
        DELETE FROM production_product_main
src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
@@ -128,4 +128,18 @@
        </foreach>
        ORDER BY pp.id ASC
    </select>
    <select id="selectProductionPlanDtoById"
            resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto">
        SELECT
            pp.*,
            pms.material_code AS materialCode,
            pms.model,
            pms.product_id AS productMaterialId,
            pm.product_name AS productName,
            pm.unit
        FROM production_plan pp
                 left join product_material_sku pms on pp.product_material_sku_id = pms.id
                 left join product_material pm on pms.product_id = pm.id
        WHERE  pp.id = #{productionPlanId}
    </select>
</mapper>