Compare commits
7 Commits
246d840a41
...
ff08e941ee
Author | SHA1 | Date | |
---|---|---|---|
ff08e941ee | |||
2965f39f28 | |||
901e565bf8 | |||
69405ab0b1 | |||
da6303841e | |||
2de1f22e16 | |||
4bda6d1df7 |
@ -0,0 +1,37 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePrecipitation;
|
||||
import com.jdc.jdcproject.entity.Equipment;
|
||||
import com.jdc.jdcproject.entity.FangpaishuiWatertreatmentrecord;
|
||||
import com.jdc.jdcproject.entity.VO.FangpaishuiWatertreatmentrecordVo;
|
||||
import com.jdc.jdcproject.service.FangpaishuiWatertreatmentrecordService;
|
||||
@ -9,12 +8,14 @@ import com.jdc.jdcproject.utils.LastDayOfMonth;
|
||||
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 org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -52,51 +53,4 @@ public class FangpaishuiWatertreatmentrecordController {
|
||||
|
||||
return Result.successResult().data("fangpaishuiWatertreatmentrecordVo",fangpaishuiWatertreatmentrecordVo);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据时间段查询处理水量和拉泥车数详细数据")
|
||||
@GetMapping("findWatertreatmentrecordDetailByMonth/{dateTime}")
|
||||
public Result findWatertreatmentrecordDetailByMonth(@PathVariable String dateTime) throws ParseException {
|
||||
String[] s = dateTime.split("到");
|
||||
List<FangpaishuiWatertreatmentrecord> fangpaishuiWatertreatmentrecords = new ArrayList<>();
|
||||
if (s.length!=0&&!s[0].isEmpty()&&!s[1].isEmpty()) {
|
||||
fangpaishuiWatertreatmentrecords = fangpaishuiWatertreatmentrecordService.findByDate(s[0], s[1]);
|
||||
}
|
||||
|
||||
return Result.successResult().data("fangpaishuiWatertreatmentrecords",fangpaishuiWatertreatmentrecords);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改处理水量和拉泥车信息")
|
||||
@PostMapping("updateWatertreatmentrecord")
|
||||
public Result updateEquipment(@RequestBody FangpaishuiWatertreatmentrecord fangpaishuiWatertreatmentrecord) {
|
||||
boolean updateflag = fangpaishuiWatertreatmentrecordService.updateById(fangpaishuiWatertreatmentrecord);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "删除处理水量和拉泥车信息")
|
||||
@DeleteMapping("deleteWatertreatmentrecord/{id}")
|
||||
public Result deleteEquipment(@PathVariable String id) {
|
||||
boolean updateflag = fangpaishuiWatertreatmentrecordService.removeById(id);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "新增处理水量和拉泥车信息")
|
||||
@PostMapping("addWatertreatmentrecord")
|
||||
public Result addEquipment(@RequestBody FangpaishuiWatertreatmentrecord fangpaishuiWatertreatmentrecord) {
|
||||
System.out.println(fangpaishuiWatertreatmentrecord);
|
||||
boolean updateflag = fangpaishuiWatertreatmentrecordService.save(fangpaishuiWatertreatmentrecord);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -0,0 +1,68 @@
|
||||
package com.jdc.jdcproject.entity.VO;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@Data
|
||||
public class DicekeTotalMiningVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "平盘名称")
|
||||
private String plateRange;
|
||||
|
||||
@Schema(description = "铲号")
|
||||
private String shovelCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String beizhu;
|
||||
|
||||
@Schema(description = "计量单位")
|
||||
private String UOM;
|
||||
|
||||
@Schema(description = "出矿量(吨)")
|
||||
private Double OreYield;
|
||||
|
||||
@Schema(description = "剥离量(吨)")
|
||||
private Double strippingTon;
|
||||
|
||||
@Schema(description = "采剥总量(吨)")
|
||||
private Double strippingAndTotalMiningTon;
|
||||
|
||||
@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 +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@Data
|
||||
public class FangpaishuiUnitVo {
|
||||
|
||||
|
@ -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