损失与贫化返回值修改;采剥量报表通过月查询
This commit is contained in:
parent
4bda6d1df7
commit
69405ab0b1
@ -1,17 +1,37 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeTotalMiningVo;
|
||||
import com.jdc.jdcproject.service.IDicekeTotalMiningService;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥量报表; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xvxboo
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dicekeTotalMining")
|
||||
public class DicekeTotalMiningController {
|
||||
|
||||
@Autowired
|
||||
private IDicekeTotalMiningService iDicekeTotalMiningService;
|
||||
|
||||
@Operation(summary = "通过Month查询采剥量报表")
|
||||
@GetMapping("findTotalMiningByMonth")
|
||||
public Result findTotalMiningByMonth(@RequestParam(required = false) LocalDate Month){
|
||||
List<DicekeTotalMiningVo> totalMiningVoList = iDicekeTotalMiningService.getTotalMiningByMonth(Month);
|
||||
System.out.println(totalMiningVoList.toString());
|
||||
return Result.successResult().data("totalMiningVoList",totalMiningVoList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -34,5 +34,35 @@ public class DicekeTotalMiningVo {
|
||||
@Schema(description = "月份")
|
||||
private LocalDate month;
|
||||
|
||||
public DicekeTotalMiningVo(String plateRange,
|
||||
String shovelCode,
|
||||
String beizhu,
|
||||
String UOM,
|
||||
Double oreYield,
|
||||
Double strippingTon,
|
||||
Double strippingAndTotalMiningTon,
|
||||
LocalDate month) {
|
||||
this.plateRange = plateRange;
|
||||
this.shovelCode = shovelCode;
|
||||
this.beizhu = beizhu;
|
||||
this.UOM = UOM;
|
||||
OreYield = oreYield;
|
||||
this.strippingTon = strippingTon;
|
||||
this.strippingAndTotalMiningTon = strippingAndTotalMiningTon;
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DicekeTotalMiningVo{" +
|
||||
"plateRange='" + plateRange + '\'' +
|
||||
", shovelCode='" + shovelCode + '\'' +
|
||||
", beizhu='" + beizhu + '\'' +
|
||||
", UOM='" + UOM + '\'' +
|
||||
", OreYield=" + OreYield +
|
||||
", strippingTon=" + strippingTon +
|
||||
", strippingAndTotalMiningTon=" + strippingAndTotalMiningTon +
|
||||
", month=" + month +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,7 @@
|
||||
select dml.LossID,
|
||||
dp.PlateRange,
|
||||
ds.ShovelCode,
|
||||
dml.StrippingTon,
|
||||
dml.StrippingAndTotalMiningTon,
|
||||
dml.WasteRockTon,
|
||||
dml.DilutionRate,
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningloss;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jdc.jdcproject.entity.DicekeMiningloss;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMininglossVo;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeTotalMiningVo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥量报表; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xvxboo
|
||||
*/
|
||||
public interface IDicekeTotalMiningService {
|
||||
|
||||
List<DicekeTotalMiningVo> getTotalMiningByMonth(LocalDate Month);
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jdc.jdcproject.entity.DicekeMiningloss;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMininglossVo;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeTotalMiningVo;
|
||||
import com.jdc.jdcproject.mapper.DicekeMininglossMapper;
|
||||
import com.jdc.jdcproject.service.IDicekeTotalMiningService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥量报表; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xvxboo
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class DicekeTotalMiningServiceImpl extends ServiceImpl<DicekeMininglossMapper, DicekeMiningloss> implements IDicekeTotalMiningService {
|
||||
@Override
|
||||
public List<DicekeTotalMiningVo> getTotalMiningByMonth(LocalDate Month) {
|
||||
int year = Month.getYear();
|
||||
int monthV = Month.getMonthValue();
|
||||
List<DicekeMininglossVo> mininglossVoList = baseMapper.findLossByMonth(monthV, year);
|
||||
List<DicekeTotalMiningVo> totalMiningList = new ArrayList<>();
|
||||
//将mininglossListt赋值给totalMiningList
|
||||
for (DicekeMininglossVo dmlVoLItem : mininglossVoList){
|
||||
String plateR = dmlVoLItem.getPlateRange();
|
||||
String shovelC = dmlVoLItem.getShovelCode();
|
||||
String beiZ = dmlVoLItem.getBeizhu();
|
||||
String uom = "t"; /*单位:吨*/
|
||||
Double oreY = dmlVoLItem.getStrippingAndTotalMiningTon()
|
||||
- dmlVoLItem.getStrippingTon(); /*出矿量 = 采剥总量 - 剥离量*/
|
||||
Double strippingT = dmlVoLItem.getStrippingTon();
|
||||
Double strippingAndTMT = dmlVoLItem.getStrippingAndTotalMiningTon();
|
||||
LocalDate mon = dmlVoLItem.getMonth();
|
||||
|
||||
DicekeTotalMiningVo dtmVoItem = new DicekeTotalMiningVo(plateR,
|
||||
shovelC,beiZ,uom,oreY,strippingT,strippingAndTMT,mon);
|
||||
|
||||
totalMiningList.add(dtmVoItem);
|
||||
}
|
||||
return totalMiningList;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user