小修改

This commit is contained in:
xvx 2025-05-13 16:50:30 +08:00
parent fed3345b8a
commit 5156669d27
7 changed files with 43 additions and 18 deletions

View File

@ -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<DicekeMininglossVo> 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<DicekeMininglossVo> LossByMonthVoList = dicekeMininglossService.getLossByMonth(Month);
System.out.println(LossByMonthVoList.toString());
return Result.successResult().data("LossMonthVoList", LossByMonthVoList);

View File

@ -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<DicekeTotalMiningVo> 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();
}
}
}

View File

@ -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 +

View File

@ -22,8 +22,10 @@ public interface DicekeMininglossMapper extends BaseMapper<DicekeMiningloss> {
List<DicekeMininglossVo> findAllLoss();
/*
// 两个时间内查询
List<DicekeMininglossVo> findLossByMonthRange(int SmonthM, int SmonthY, int endMonthM, int endMonthY);
*/
List<DicekeMininglossVo> findLossByMonth(int monthV,int year);

View File

@ -19,7 +19,8 @@
LEFT JOIN diceke_platearea dp ON dml.PlateID = dp.PlateID
LEFT JOIN diceke_shovel ds ON dml.ShovelID = ds.ShovelID
</select>
<!--
// 两个时间内查询
<select id="findLossByMonthRange" resultType="com.jdc.jdcproject.entity.VO.DicekeMininglossVo">
select dml.LossID,
dp.PlateRange,
@ -39,6 +40,7 @@
AND
(YEAR(dml.Month) &lt; #{endMonthY} OR (YEAR(dml.Month) = #{endMonthY} AND MONTH(dml.Month) &lt;= #{endMonthM}))
</select>
-->
<select id="findLossByMonth" resultType="com.jdc.jdcproject.entity.VO.DicekeMininglossVo">
select dml.LossID,

View File

@ -22,9 +22,11 @@ public interface IDicekeMininglossService extends IService<DicekeMiningloss> {
int savedml(DicekeMininglossVo dicekeMininglossVo);
/*
// 两个时间内查询
List<DicekeMininglossVo> getLossByMonthRange(LocalDate Month, LocalDate endMonth);
*/
List<DicekeMininglossVo> getLossByMonth(LocalDate Month);
}

View File

@ -43,7 +43,8 @@ public class DicekeMininglossServiceImpl extends ServiceImpl<DicekeMininglossMap
return baseMapper.findAllLoss();
}
/*
// 两个时间内查询
@Override
public List<DicekeMininglossVo> getLossByMonthRange(LocalDate month, LocalDate endMonth) {
@ -72,6 +73,7 @@ public class DicekeMininglossServiceImpl extends ServiceImpl<DicekeMininglossMap
}
}
*/
@Override