From 5156669d27703b876183108b913e74fb4fe18297 Mon Sep 17 00:00:00 2001 From: xvx <871843312@qq.com> Date: Tue, 13 May 2025 16:50:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DicekeMininglossController.java | 11 +++++--- .../DicekeTotalMiningController.java | 25 +++++++++++++------ .../entity/VO/DicekeTotalMiningVo.java | 9 ++++--- .../mapper/DicekeMininglossMapper.java | 4 ++- .../mapper/xml/DicekeMininglossMapper.xml | 4 ++- .../service/IDicekeMininglossService.java | 4 ++- .../impl/DicekeMininglossServiceImpl.java | 4 ++- 7 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/jdc/jdcproject/controller/DicekeMininglossController.java b/src/main/java/com/jdc/jdcproject/controller/DicekeMininglossController.java index 4046abf..07f8157 100644 --- a/src/main/java/com/jdc/jdcproject/controller/DicekeMininglossController.java +++ b/src/main/java/com/jdc/jdcproject/controller/DicekeMininglossController.java @@ -9,6 +9,7 @@ import com.jdc.jdcproject.service.IDicekePlateareaService; import com.jdc.jdcproject.service.IDicekeShovelService; import com.jdc.jdcproject.utils.Result; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.stereotype.Controller; @@ -43,14 +44,18 @@ public class DicekeMininglossController { @Operation(summary = "通过Month查询损失和贫化报表") @GetMapping("findLossByMonth") - public Result findLossByMonth(@RequestParam(required = false) LocalDate Month, - @RequestParam(required = false) LocalDate endMonth) { + public Result findLossByMonth(@RequestParam(required = false) + @Parameter(description = "yyyy-MM-dd",example = "2002-10-11")LocalDate Month + /*,@RequestParam(required = false) LocalDate endMonth*/) { + /* if(Month != null && endMonth != null){ //两个时间段内查询 List LossByMonthRangeVoList = dicekeMininglossService.getLossByMonthRange(Month,endMonth); System.out.println(LossByMonthRangeVoList.toString()); return Result.successResult().data("LossMonthRangeList", LossByMonthRangeVoList); - } else if (Month != null){ //Month存在 通过获取year年和month月查询此月报表 + } else + */ + if (Month != null){ //Month存在 通过获取year年和month月查询此月报表 List LossByMonthVoList = dicekeMininglossService.getLossByMonth(Month); System.out.println(LossByMonthVoList.toString()); return Result.successResult().data("LossMonthVoList", LossByMonthVoList); diff --git a/src/main/java/com/jdc/jdcproject/controller/DicekeTotalMiningController.java b/src/main/java/com/jdc/jdcproject/controller/DicekeTotalMiningController.java index 113fb4a..920738d 100644 --- a/src/main/java/com/jdc/jdcproject/controller/DicekeTotalMiningController.java +++ b/src/main/java/com/jdc/jdcproject/controller/DicekeTotalMiningController.java @@ -6,6 +6,7 @@ import com.jdc.jdcproject.service.IDicekeMininglossService; import com.jdc.jdcproject.service.IDicekeTotalMiningService; import com.jdc.jdcproject.utils.Result; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -20,6 +21,9 @@ import java.util.List; * @author xvxboo */ +/* + * 该业务只是查询diceke_miningloss表,并不存在自己的数据库。 + * */ @RestController @RequestMapping("/dicekeTotalMining") public class DicekeTotalMiningController { @@ -30,8 +34,9 @@ public class DicekeTotalMiningController { private IDicekeMininglossService dicekeMininglossService; @Operation(summary = "通过Month查询采剥量报表") - @GetMapping("findTotalMiningByMonth") - public Result findTotalMiningByMonth(@RequestParam(required = false) LocalDate Month){ + @GetMapping("findTotalMiningByMonth/{Month}") + public Result findTotalMiningByMonth(@RequestParam(required = false) + @Parameter(description = "yyyy-MM-dd",example = "2002-10-11")LocalDate Month){ List totalMiningVoList = dicekeTotalMiningService.getTotalMiningByMonth(Month); System.out.println(totalMiningVoList.toString()); return Result.successResult().data("totalMiningVoList",totalMiningVoList); @@ -61,10 +66,16 @@ public class DicekeTotalMiningController { } - /* - * - * 删除直接删掉对应表的字段? - * - * */ + //TODO: 删除不清楚业务逻辑,是否直接删除所使用的diceke_miningloss表数据 + @Operation(summary = "删除采剥量报表") + @DeleteMapping("deleteTotalMining/{totalID}") + public Result deleteLoss(@PathVariable String totalID){ + boolean updateflag = dicekeMininglossService.removeById(totalID); + if(updateflag){ + return Result.successResult(); + } else { + return Result.errorResult(); + } + } } diff --git a/src/main/java/com/jdc/jdcproject/entity/VO/DicekeTotalMiningVo.java b/src/main/java/com/jdc/jdcproject/entity/VO/DicekeTotalMiningVo.java index e9998d0..80d4033 100644 --- a/src/main/java/com/jdc/jdcproject/entity/VO/DicekeTotalMiningVo.java +++ b/src/main/java/com/jdc/jdcproject/entity/VO/DicekeTotalMiningVo.java @@ -23,9 +23,10 @@ public class DicekeTotalMiningVo { @Schema(description = "备注") private String beizhu; + /* @Schema(description = "计量单位") private String UOM; - +*/ @Schema(description = "出矿量(吨)") private Double OreYield; @@ -35,7 +36,7 @@ public class DicekeTotalMiningVo { @Schema(description = "采剥总量(吨)") private Double strippingAndTotalMiningTon; - @Schema(description = "月份") + @Schema(description = "月份",name="月份") private LocalDate month; public DicekeTotalMiningVo(String totalID, @@ -51,7 +52,7 @@ public class DicekeTotalMiningVo { this.plateID = plateID; this.shovelID = shovelID; this.beizhu = beizhu; - this.UOM = UOM; +// this.UOM = UOM; OreYield = oreYield; this.strippingTon = strippingTon; this.strippingAndTotalMiningTon = strippingAndTotalMiningTon; @@ -65,7 +66,7 @@ public class DicekeTotalMiningVo { ", plateID='" + plateID + '\'' + ", shovelID='" + shovelID + '\'' + ", beizhu='" + beizhu + '\'' + - ", UOM='" + UOM + '\'' + +// ", UOM='" + UOM + '\'' + ", OreYield=" + OreYield + ", strippingTon=" + strippingTon + ", strippingAndTotalMiningTon=" + strippingAndTotalMiningTon + diff --git a/src/main/java/com/jdc/jdcproject/mapper/DicekeMininglossMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DicekeMininglossMapper.java index 3ed53c1..199f41d 100644 --- a/src/main/java/com/jdc/jdcproject/mapper/DicekeMininglossMapper.java +++ b/src/main/java/com/jdc/jdcproject/mapper/DicekeMininglossMapper.java @@ -22,8 +22,10 @@ public interface DicekeMininglossMapper extends BaseMapper { List findAllLoss(); - +/* +// 两个时间内查询 List findLossByMonthRange(int SmonthM, int SmonthY, int endMonthM, int endMonthY); +*/ List findLossByMonth(int monthV,int year); diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMininglossMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMininglossMapper.xml index d2e5f41..0d2fde4 100644 --- a/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMininglossMapper.xml +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMininglossMapper.xml @@ -19,7 +19,8 @@ LEFT JOIN diceke_platearea dp ON dml.PlateID = dp.PlateID LEFT JOIN diceke_shovel ds ON dml.ShovelID = ds.ShovelID - +