| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanDto; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto; |
| | | import com.ruoyi.productionPlan.service.ProductionPlanService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | } |
| | | |
| | | @GetMapping("/loadProdData") |
| | | @ApiOperation("æåéå®ç产计å") |
| | | @Log(title = "æåéå®ç产计å", businessType = BusinessType.INSERT) |
| | | public AjaxResult loadProdData() { |
| | | productionPlanService.loadProdData(); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @GetMapping("/summaryByProductType") |
| | | @ApiOperation("æç
§äº§åç±»å«æ±æ»ç»è®¡éæ±é") |
| | | @Log(title = "æç
§äº§åç±»å«æ±æ»ç»è®¡éæ±é", businessType = BusinessType.OTHER) |
| | | public AjaxResult summaryByProductType(ProductionPlanSummaryDto query) { |
| | | List<ProductionPlanSummaryDto> list = productionPlanService.summaryByProductType(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.productionPlan.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <br> |
| | | * éå®çäº§éæ± - 产åç±»åæ±æ»DTO |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/03/11 10:24 |
| | | */ |
| | | @Data |
| | | @ApiModel("çäº§éæ±äº§åæ±æ»") |
| | | public class ProductionPlanSummaryDto { |
| | | |
| | | /** |
| | | * ç©æç¼ç |
| | | */ |
| | | @ApiModelProperty("ç©æç¼ç ") |
| | | private String materialCode; |
| | | |
| | | /** |
| | | * 产ååç§° |
| | | */ |
| | | @ApiModelProperty("产ååç§°") |
| | | private String productName; |
| | | |
| | | /** |
| | | * 产åè§æ ¼ |
| | | */ |
| | | @ApiModelProperty("产åè§æ ¼") |
| | | private String productSpec; |
| | | |
| | | /** |
| | | * 产åé¿åº¦ |
| | | */ |
| | | @ApiModelProperty("产åé¿åº¦") |
| | | private Integer length; |
| | | |
| | | /** |
| | | * 产å宽度 |
| | | */ |
| | | @ApiModelProperty("产å宽度") |
| | | private Integer width; |
| | | |
| | | /** |
| | | * 产åé«åº¦ |
| | | */ |
| | | @ApiModelProperty("产åé«åº¦") |
| | | private Integer height; |
| | | |
| | | /** |
| | | * æ±æ»åæ° |
| | | */ |
| | | @ApiModelProperty("æ±æ»åæ°") |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * æ±æ»æ¹æ° |
| | | */ |
| | | @ApiModelProperty("æ±æ»æ¹æ°") |
| | | private BigDecimal volume; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanDto; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto; |
| | | import com.ruoyi.productionPlan.pojo.ProductionPlan; |
| | | import com.ruoyi.staff.dto.StaffLeaveDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | */ |
| | | public interface ProductionPlanMapper extends BaseMapper<ProductionPlan> { |
| | | IPage<ProductionPlanDto> listPage(Page page, @Param("c") ProductionPlanDto productionPlanDto); |
| | | |
| | | List<ProductionPlanSummaryDto> selectSummaryByProductType(ProductionPlanSummaryDto query); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanDto; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto; |
| | | import com.ruoyi.productionPlan.pojo.ProductionPlan; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | * 宿¶åæ¥ |
| | | */ |
| | | void syncProdDataJob(); |
| | | |
| | | /** |
| | | * æç
§äº§åç±»å«æ±æ»ç»è®¡éæ±é |
| | | */ |
| | | List<ProductionPlanSummaryDto> summaryByProductType(ProductionPlanSummaryDto query); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.framework.config.AliDingConfig; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanDto; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto; |
| | | import com.ruoyi.productionPlan.mapper.ProductionPlanMapper; |
| | | import com.ruoyi.productionPlan.pojo.ProductionPlan; |
| | | import com.ruoyi.productionPlan.service.ProductionPlanService; |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductionPlanSummaryDto> summaryByProductType(ProductionPlanSummaryDto query) { |
| | | return baseMapper.selectSummaryByProductType(query); |
| | | } |
| | | } |
| | |
| | | WHERE 1 = 1 |
| | | </select> |
| | | |
| | | <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 |
| | | <where> |
| | | <if test="materialCode != null and materialCode != ''"> |
| | | AND material_code LIKE CONCAT('%', #{materialCode}, '%') |
| | | </if> |
| | | |
| | | <if test="productName != null and productName != ''"> |
| | | AND product_name LIKE CONCAT('%', #{productName}, '%') |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | material_code, |
| | | product_name, |
| | | product_spec, |
| | | length, |
| | | width, |
| | | height |
| | | </select> |
| | | |
| | | </mapper> |