| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProductionProductMainDetailExportDto; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.ProductionProductMainSummaryExportDto; |
| | | import com.ruoyi.production.dto.ProductionReportDailySummaryDto; |
| | | import com.ruoyi.production.dto.ProductionReportStateDto; |
| | | import com.ruoyi.production.pojo.ProductionProductMain; |
| | |
| | | |
| | | /** |
| | | * æ¥å·¥æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param productionProductMainDto |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * æ¥å·¥æ°å¢æ´æ° |
| | | * |
| | | * @param productionProductMainDto |
| | | * @return |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * æ¥å·¥å°è´¦æ±æ»å¯¼åº |
| | | */ |
| | | @ApiOperation("æ¥å·¥å°è´¦æ±æ»å¯¼åº") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "workOrderIds", value = "å·¥åIDå表, å¯ä¼ å¤ä¸ª", allowMultiple = true, dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "workOrderNo", value = "å·¥åç¼å·(模ç³)", dataType = "string", paramType = "query"), |
| | | @ApiImplicitParam(name = "workOrderStatus", value = "å·¥åç¶æ", dataType = "string", paramType = "query") |
| | | }) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ProductionProductMainDto productionProductMainDto) { |
| | | List<ProductionProductMainDto> list; |
| | | list = productionProductMainService.listPageProductionProductMainDto(new Page<>(1, -1), productionProductMainDto).getRecords(); |
| | | ExcelUtil<ProductionProductMainDto> util = new ExcelUtil<ProductionProductMainDto>(ProductionProductMainDto.class); |
| | | util.exportExcel(response, list, "ç产æ¥å·¥æ°æ®"); |
| | | List<ProductionProductMainSummaryExportDto> list = productionProductMainService.listSummaryExportData(productionProductMainDto); |
| | | ExcelUtil<ProductionProductMainSummaryExportDto> util = new ExcelUtil<>(ProductionProductMainSummaryExportDto.class); |
| | | util.exportExcel(response, list, "ç产æ¥å·¥æ±æ»æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥å·¥æç»å¯¼åº |
| | | */ |
| | | @ApiOperation("æ¥å·¥æç»å¯¼åº") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "workOrderIds", value = "å·¥åIDå表, å¯ä¼ å¤ä¸ª", allowMultiple = true, dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "workOrderId", value = "å·¥åID", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "startDate", value = "å¼å§æ¥æ(æç»ææ¶é´è¿æ»¤, yyyy-MM-dd)", dataType = "string", paramType = "query"), |
| | | @ApiImplicitParam(name = "endDate", value = "ç»ææ¥æ(æç»ææ¶é´è¿æ»¤, yyyy-MM-dd)", dataType = "string", paramType = "query") |
| | | }) |
| | | @PostMapping("/exportDetail") |
| | | public void exportDetail(HttpServletResponse response, ProductionProductMainDto productionProductMainDto) { |
| | | List<ProductionProductMainDetailExportDto> list = productionProductMainService.listDetailExportData(productionProductMainDto); |
| | | ExcelUtil<ProductionProductMainDetailExportDto> util = new ExcelUtil<>(ProductionProductMainDetailExportDto.class); |
| | | util.exportExcel(response, list, "ç产æ¥å·¥æç»æ°æ®"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class ProductionProductMainDetailExportDto { |
| | | |
| | | @Excel(name = "产åç¼å·", sort = 1) |
| | | private String productNo; |
| | | |
| | | @Excel(name = "æä½äººå", sort = 2) |
| | | private String nickName; |
| | | |
| | | @Excel(name = "å·¥åº", sort = 3) |
| | | private String process; |
| | | |
| | | @Excel(name = "å·¥åå·", sort = 4) |
| | | private String workOrderNo; |
| | | |
| | | @Excel(name = "éå®ååå·", sort = 5) |
| | | private String salesContractNo; |
| | | |
| | | @Excel(name = "ç产订åå·", sort = 6) |
| | | private String productOrderNpsNo; |
| | | |
| | | @Excel(name = "产ååç§°", sort = 7) |
| | | private String productName; |
| | | |
| | | @Excel(name = "产åè§æ ¼åå·", sort = 8) |
| | | private String productModelName; |
| | | |
| | | @Excel(name = "åæ ¼æ°é", sort = 9) |
| | | private BigDecimal quantity; |
| | | |
| | | @Excel(name = "ä¸åæ ¼æ°é", sort = 10) |
| | | private BigDecimal scrapQty; |
| | | |
| | | @Excel(name = "åä½", sort = 11) |
| | | private String unit; |
| | | |
| | | @Excel(name = "å·¥åºæ åå·¥æ¶(å°æ¶)", sort = 12) |
| | | private BigDecimal processStandardHours; |
| | | |
| | | @Excel(name = "å®é
æ¥å·¥å·¥æ¶(å°æ¶)", sort = 13) |
| | | private BigDecimal actualReportHours; |
| | | |
| | | @Excel(name = "æ¯äººæ¯æ¥å·¥æ¶(å°æ¶)", sort = 14) |
| | | private BigDecimal dailyPersonHours; |
| | | |
| | | @Excel(name = "å建æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 15) |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | |
| | | @ApiModelProperty(value = "ç»ææ¥æ(æç»æ¥è¯¢ç¨)") |
| | | private LocalDate endDate; |
| | | |
| | | @ApiModelProperty(value = "å·¥åIDå表(æç»å¯¼åºç¨)") |
| | | private List<Long> workOrderIds; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "æ¥æ(æç»/æ±æ»ä¸ä½¿ç¨)") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ProductionProductMainSummaryExportDto { |
| | | |
| | | @Excel(name = "å·¥åº", sort = 1) |
| | | private String process; |
| | | |
| | | @Excel(name = "å·¥åå·", sort = 2) |
| | | private String workOrderNo; |
| | | |
| | | @Excel(name = "éå®ååå·", sort = 3) |
| | | private String salesContractNo; |
| | | |
| | | @Excel(name = "ç产订åå·", sort = 4) |
| | | private String productOrderNpsNo; |
| | | |
| | | @Excel(name = "产ååç§°", sort = 5) |
| | | private String productName; |
| | | |
| | | @Excel(name = "产åè§æ ¼åå·", sort = 6) |
| | | private String productModelName; |
| | | |
| | | @Excel(name = "åä½", sort = 7) |
| | | private String unit; |
| | | |
| | | @Excel(name = "æ»å·¥æ¶", sort = 8) |
| | | private BigDecimal projectTotalHours; |
| | | |
| | | @Excel(name = "å·¥åºæ åå·¥æ¶(å°æ¶)", sort = 9) |
| | | private BigDecimal processStandardHours; |
| | | |
| | | @Excel(name = "å®é
æ¥å·¥å·¥æ¶(å°æ¶)", sort = 10) |
| | | private BigDecimal actualReportHours; |
| | | |
| | | @Excel(name = "æ¯äººæ¯æ¥å·¥æ¶(å°æ¶)", sort = 11) |
| | | private BigDecimal dailyPersonHours; |
| | | |
| | | @Excel(name = "äº§åºæ»æ°é", sort = 12) |
| | | private BigDecimal outputTotalQuantity; |
| | | |
| | | @Excel(name = "æ¥åºæ»æ°é", sort = 13) |
| | | private BigDecimal scrapTotalQuantity; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.production.dto.ProductionProductMainDetailExportDto; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.ProductionProductMainSummaryExportDto; |
| | | import com.ruoyi.production.dto.ProductionReportDailySummaryDto; |
| | | import com.ruoyi.production.dto.ProductionReportStateDto; |
| | | import com.ruoyi.production.pojo.ProductionProductMain; |
| | |
| | | |
| | | IPage<ProductionProductMainDto> listPageProductionProductMainDetailDto(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto); |
| | | |
| | | List<ProductionProductMainSummaryExportDto> listSummaryExportData(ProductionProductMainDto productionProductMainDto); |
| | | |
| | | List<ProductionProductMainDetailExportDto> listDetailExportData(ProductionProductMainDto productionProductMainDto); |
| | | |
| | | Boolean addProductMain(ProductionProductMainDto productionProductMainDto); |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.production.dto.ProductionProductMainDetailExportDto; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.ProductionProductMainSummaryExportDto; |
| | | import com.ruoyi.production.dto.ProductionReportDailySummaryDto; |
| | | import com.ruoyi.production.dto.ProductionReportStateDto; |
| | | import com.ruoyi.production.enums.ProductProcessEnum; |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductionProductMainSummaryExportDto> listSummaryExportData(ProductionProductMainDto productionProductMainDto) { |
| | | return listPageProductionProductMainDto(new Page<>(1, -1), productionProductMainDto) |
| | | .getRecords() |
| | | .stream() |
| | | .map(item -> { |
| | | ProductionProductMainSummaryExportDto exportDto = new ProductionProductMainSummaryExportDto(); |
| | | exportDto.setProcess(item.getProcess()); |
| | | exportDto.setWorkOrderNo(item.getWorkOrderNo()); |
| | | exportDto.setSalesContractNo(item.getSalesContractNo()); |
| | | exportDto.setProductOrderNpsNo(item.getProductOrderNpsNo()); |
| | | exportDto.setProductName(item.getProductName()); |
| | | exportDto.setProductModelName(item.getProductModelName()); |
| | | exportDto.setUnit(item.getUnit()); |
| | | exportDto.setProjectTotalHours(item.getProjectTotalHours()); |
| | | exportDto.setProcessStandardHours(item.getProcessStandardHours()); |
| | | exportDto.setActualReportHours(item.getActualReportHours()); |
| | | exportDto.setDailyPersonHours(item.getDailyPersonHours()); |
| | | exportDto.setOutputTotalQuantity(item.getOutputTotalQuantity()); |
| | | exportDto.setScrapTotalQuantity(item.getScrapTotalQuantity()); |
| | | return exportDto; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductionProductMainDetailExportDto> listDetailExportData(ProductionProductMainDto productionProductMainDto) { |
| | | return listPageProductionProductMainDetailDto(new Page<>(1, -1), productionProductMainDto) |
| | | .getRecords() |
| | | .stream() |
| | | .map(item -> { |
| | | ProductionProductMainDetailExportDto exportDto = new ProductionProductMainDetailExportDto(); |
| | | exportDto.setProductNo(item.getProductNo()); |
| | | exportDto.setNickName(item.getNickName()); |
| | | exportDto.setProcess(item.getProcess()); |
| | | exportDto.setWorkOrderNo(item.getWorkOrderNo()); |
| | | exportDto.setSalesContractNo(item.getSalesContractNo()); |
| | | exportDto.setProductOrderNpsNo(item.getProductOrderNpsNo()); |
| | | exportDto.setProductName(item.getProductName()); |
| | | exportDto.setProductModelName(item.getProductModelName()); |
| | | exportDto.setQuantity(item.getQuantity()); |
| | | exportDto.setScrapQty(item.getScrapQty()); |
| | | exportDto.setUnit(item.getUnit()); |
| | | exportDto.setProcessStandardHours(item.getProcessStandardHours()); |
| | | exportDto.setActualReportHours(item.getActualReportHours()); |
| | | exportDto.setDailyPersonHours(item.getDailyPersonHours()); |
| | | exportDto.setCreateTime(item.getCreateTime()); |
| | | return exportDto; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | private void fillHourDefaults(List<ProductionProductMainDto> records) { |
| | | if (records == null || records.isEmpty()) { |
| | | return; |
| | |
| | | left join sales_ledger sl on sl.id = po.sales_ledger_id |
| | | left join sys_user u on u.user_id = ppm.user_id |
| | | <where> |
| | | and ppm.status = 1 |
| | | and ifnull(ppo.quantity, 0) > 0 |
| | | <if test="c.workOrderIds != null and c.workOrderIds.size() > 0"> |
| | | and ppm.work_order_id in |
| | | <foreach collection="c.workOrderIds" item="workOrderId" open="(" separator="," close=")"> |
| | | #{workOrderId} |
| | | </foreach> |
| | | </if> |
| | | <if test="c.nickName != null and c.nickName != ''"> |
| | | and u.nick_name like concat('%',#{c.nickName},'%') |
| | | </if> |
| | |
| | | left join sales_ledger sl on sl.id = po.sales_ledger_id |
| | | left join sys_user u on u.user_id = ppm.user_id |
| | | <where> |
| | | and ppm.status = 1 |
| | | and ifnull(ppo.quantity, 0) > 0 |
| | | <if test="c.workOrderIds != null and c.workOrderIds.size() > 0"> |
| | | and ppm.work_order_id in |
| | | <foreach collection="c.workOrderIds" item="workOrderId" open="(" separator="," close=")"> |
| | | #{workOrderId} |
| | | </foreach> |
| | | </if> |
| | | <if test="c.workOrderId != null"> |
| | | and ppm.work_order_id = #{c.workOrderId} |
| | | </if> |