src/main/java/com/ruoyi/home/service/impl/HomeServiceImpl.java
@@ -2528,7 +2528,7 @@ BigDecimal sum = salesDeliveries.stream() .map(item -> item.getPrice() != null ? new BigDecimal(item.getPrice().toString()) : BigDecimal.ZERO) .reduce(BigDecimal.ZERO, BigDecimal::add); long finalPrice = sum.divide(new BigDecimal("1000"), 0, RoundingMode.HALF_UP).longValue(); long finalPrice = sum.divide(new BigDecimal("10000"), 0, RoundingMode.HALF_UP).longValue(); map.put("price", finalPrice);//åä½w //æ»åè´§å map.put("delivery", (long) salesDeliveries.size()); src/main/java/com/ruoyi/production/mapper/ProductOrderMapper.java
@@ -35,4 +35,6 @@ IPage<FinishedPageDto> finishedPage(Page page, @Param("c") FinishedPageDto finishedPageDto); List<FinishedRatioDto> finishedRatio(@Param("productOrderId") Long productOrderId); ProductOrderDto getProductOrderDto(@Param("productOrderId") Long productOrderId); } src/main/java/com/ruoyi/productionPlan/controller/ProductOrderPlanController.java
ÎļþÒÑɾ³ý src/main/java/com/ruoyi/productionPlan/controller/TrackController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,36 @@ package com.ruoyi.productionPlan.controller; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.productionPlan.pojo.ProductOrderPlan; import com.ruoyi.productionPlan.service.ProductOrderPlanService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * <p> * å端æ§å¶å¨ * </p> * * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå ¬å¸ * @since 2026-03-11 03:02:58 */ @RestController @RequestMapping("/track") @Api(tags = "追踪è¿åº¦") public class TrackController { @Autowired private ProductOrderPlanService productOrderPlanService; @GetMapping("/trackProgressByNo") @ApiOperation("æ ¹æ®ä¸»çäº§è®¡åæ¥è¯¢è¿åº¦") public AjaxResult trackProgressByNo(String applyNo) { return AjaxResult.success(productOrderPlanService.trackProgressByNo(applyNo)); } } src/main/java/com/ruoyi/productionPlan/dto/OrderDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,19 @@ package com.ruoyi.productionPlan.dto; import com.ruoyi.production.dto.ProductOrderDto; import com.ruoyi.production.pojo.ProductionProductMain; import io.swagger.annotations.ApiModel; import lombok.Data; import java.util.List; @Data @ApiModel("ç产计å追踪è¿åº¦ç订åä¿¡æ¯") public class OrderDto { //ç产订åä¿¡æ¯ private ProductOrderDto productOrderDto; //æ¥å·¥è¯¦æ private List<ProductionProductMain> productionProductMains; } src/main/java/com/ruoyi/productionPlan/dto/TrackDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,18 @@ package com.ruoyi.productionPlan.dto; import com.ruoyi.productionPlan.pojo.ProductionPlan; import io.swagger.annotations.ApiModel; import lombok.Data; import java.util.List; @Data @ApiModel("ç产计å追踪è¿åº¦çè¿åæ°æ®") public class TrackDto { //ç产计åçä¿¡æ¯ private ProductionPlanDto productionPlanDto; //订åä¿¡æ¯ private List<OrderDto> orderDtoList; } src/main/java/com/ruoyi/productionPlan/mapper/ProductionPlanMapper.java
@@ -6,6 +6,7 @@ import com.ruoyi.productionPlan.dto.ProductionPlanDto; import com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto; import com.ruoyi.productionPlan.pojo.ProductionPlan; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -19,6 +20,7 @@ * @version 1.0 * @since 2026/03/10 9:56 */ @Mapper public interface ProductionPlanMapper extends BaseMapper<ProductionPlan> { IPage<ProductionPlanDto> listPage(Page page, @Param("c") ProductionPlanDto productionPlanDto); src/main/java/com/ruoyi/productionPlan/service/ProductOrderPlanService.java
@@ -1,5 +1,6 @@ package com.ruoyi.productionPlan.service; import com.ruoyi.productionPlan.dto.TrackDto; import com.ruoyi.productionPlan.pojo.ProductOrderPlan; import com.baomidou.mybatisplus.extension.service.IService; @@ -13,4 +14,5 @@ */ public interface ProductOrderPlanService extends IService<ProductOrderPlan> { TrackDto trackProgressByNo(String applyNo); } src/main/java/com/ruoyi/productionPlan/service/impl/ProductOrderPlanServiceImpl.java
@@ -1,10 +1,26 @@ package com.ruoyi.productionPlan.service.impl; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.production.dto.ProductOrderDto; import com.ruoyi.production.mapper.ProductOrderMapper; import com.ruoyi.production.mapper.ProductionOrderRouteMapper; import com.ruoyi.production.mapper.ProductionProductMainMapper; import com.ruoyi.production.pojo.ProductionProductMain; import com.ruoyi.productionPlan.dto.OrderDto; import com.ruoyi.productionPlan.dto.ProductionPlanDto; import com.ruoyi.productionPlan.dto.TrackDto; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.productionPlan.mapper.ProductionPlanMapper; import com.ruoyi.productionPlan.pojo.ProductOrderPlan; import com.ruoyi.productionPlan.mapper.ProductOrderPlanMapper; import com.ruoyi.productionPlan.service.ProductOrderPlanService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; /** * <p> @@ -17,4 +33,52 @@ @Service public class ProductOrderPlanServiceImpl extends ServiceImpl<ProductOrderPlanMapper, ProductOrderPlan> implements ProductOrderPlanService { @Autowired private ProductOrderPlanMapper productOrderPlanMapper; @Autowired private ProductionPlanMapper productionPlanMapper; @Autowired private ProductOrderMapper productOrderMapper; @Autowired private ProductionProductMainMapper productionProductMainMapper; @Override public TrackDto trackProgressByNo(String applyNo) { TrackDto trackDto = new TrackDto(); //çäº§è®¡åæ°æ® ProductionPlanDto planDto = new ProductionPlanDto(); planDto.setApplyNo(applyNo); ProductionPlanDto productionPlanDto = productionPlanMapper.listPage(new Page(1, -1), planDto).getRecords().get(0); trackDto.setProductionPlanDto(productionPlanDto); //çäº§è®¢åæ°æ® List<OrderDto> orderDtos = listByApplyNo(productionPlanDto); trackDto.setOrderDtoList(orderDtos); return trackDto; } private List<OrderDto> listByApplyNo(ProductionPlanDto productionPlanDto) { List<OrderDto> orderDtos = new ArrayList<>(); //1.å æ¥è¯¢è¯¥ç产计å䏿æå ³èçç产订å List<ProductOrderPlan> productOrderPlans = productOrderPlanMapper.selectList(Wrappers.<ProductOrderPlan>lambdaQuery() .eq(ProductOrderPlan::getProductionPlanId, productionPlanDto.getId())); if (CollectionUtils.isEmpty(productOrderPlans)){ return null; } productOrderPlans.forEach(productOrderPlan -> { OrderDto orderDto = new OrderDto(); //ç产订åä¿¡æ¯ 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); orderDtos.add(orderDto); }); return orderDtos; } } src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -57,6 +57,9 @@ LEFT JOIN product_material_sku pms ON pms.id = po.product_material_sku_id LEFT JOIN product_material pm ON pm.id = pms.product_id <where> <if test="c.id != null"> AND po.id = #{c.id} </if> <if test="c.npsNo != null and c.npsNo != ''"> AND po.nps_no LIKE CONCAT('%', #{c.npsNo}, '%') </if> @@ -229,4 +232,35 @@ ppi.unit)A </select> <select id="getProductOrderDto" resultType="com.ruoyi.production.dto.ProductOrderDto"> SELECT po.id, po.nps_no, po.tenant_id, po.create_time, po.update_time, po.route_id, po.quantity, po.complete_quantity, po.start_time, po.end_time, po.plan_complete_time, po.status, pm.product_name, po.strength AS strength, pr.process_route_code AS processRouteCode, pr.description, pb.id AS bomId, pb.bom_no AS bomNo, ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus, pms.model, pms.material_code AS materialCode, pms.id AS productId FROM product_order po LEFT JOIN production_order_route pr ON po.route_id = pr.id LEFT JOIN product_bom pb ON pr.bom_id = pb.id LEFT JOIN product_material_sku pms ON pms.id = po.product_material_sku_id LEFT JOIN product_material pm ON pm.id = pms.product_id WHERE po.id = #{productOrderId} </select> </mapper>