| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductionSettlementDetailsDto; |
| | | import com.ruoyi.production.dto.ProductionSettlementDto; |
| | | import com.ruoyi.production.dto.ProductionSettlementTotalDto; |
| | | import com.ruoyi.production.dto.SettlementImportDto; |
| | | import com.ruoyi.production.service.IProductionSettlementBatchesService; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.time.LocalDate; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @PostMapping("/import") |
| | | @ApiOperation("导入生产成本核算表") |
| | | public AjaxResult importProductionSettlement(@RequestParam("file") MultipartFile file, @RequestParam(required = false) LocalDate periodTime, @RequestParam(required = false) String batchName) { |
| | | productionSettlementBatchesService.importProductionSettlement(file, periodTime, batchName); |
| | | public AjaxResult importProductionSettlement(@RequestParam("file") MultipartFile file, ProductionSettlementDto dto) { |
| | | productionSettlementBatchesService.importProductionSettlement(file, dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @GetMapping("/downloadTemplate") |
| | | @ApiOperation("生产成本核算导入模板") |
| | | public void export(HttpServletResponse response) { |
| | | ExcelUtil<SettlementImportDto> excelUtil = new ExcelUtil<>(SettlementImportDto.class); |
| | | excelUtil.importTemplateExcel(response, "生产成本核算导入模板"); |
| | | } |
| | | |
| | | @GetMapping("/getSettlement") |
| | | @ApiOperation("获取生产成本核算数据") |
| | | public AjaxResult getSettlement(ProductionSettlementDto dto) { |
| | | Map<String, List<ProductionSettlementDetailsDto>> map = productionSettlementBatchesService.getSettlement(dto); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | @GetMapping("/getProductTypes") |
| | | @ApiOperation("获取对应月份导入的产品类别") |
| | | public AjaxResult getProductTypes(ProductionSettlementDto dto) { |
| | | List<String> list = productionSettlementBatchesService.getProductTypes(dto); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/getSubjectNames") |
| | | @ApiOperation("获取对应月份导入的科目类别") |
| | | public AjaxResult getSubjectNames(ProductionSettlementDto dto) { |
| | | List<String> list = productionSettlementBatchesService.getSubjectNames(dto); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/getTotalCosts") |
| | | @ApiOperation("获取成本合计数据") |
| | | public AjaxResult getTotalCosts(ProductionSettlementDto dto) { |
| | | ProductionSettlementTotalDto totalCosts = productionSettlementBatchesService.getTotalCosts(dto); |
| | | return AjaxResult.success(totalCosts); |
| | | } |
| | | |
| | | |
| | | } |