Compare commits

..

8 Commits

19 changed files with 507 additions and 85 deletions

View File

@ -1,6 +1,7 @@
package com.jdc.jdcproject.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jdc.jdcproject.entity.DicekeMiningloss;
import com.jdc.jdcproject.entity.DicekePlatearea;
import com.jdc.jdcproject.entity.DicekeShovel;
@ -9,6 +10,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;
@ -33,29 +35,51 @@ public class DicekeMininglossController {
private IDicekeMininglossService dicekeMininglossService;
@Operation(summary = "查询损失和贫化报表")
@GetMapping("findAllMininggloss")
@GetMapping("findAllMiningloss")
public Result findAllLoss(){
List<DicekeMininglossVo> dicekeMininglossVoList = dicekeMininglossService.findAllLoss();
System.out.println(dicekeMininglossVoList.toString());
return Result.successResult().data("dicekeMininglossVoList", dicekeMininglossVoList);
}
@Operation(summary = "分页查询")
@GetMapping("lossPageList")
public Result lossPageList(@RequestParam(defaultValue = "1") int pageNum){
return Result.successResult().data("Page",dicekeMininglossService.getPage(pageNum));
}
@Operation(summary = "查当前或上一个月")
@GetMapping("findMonth")
public Result findMonth() {
LocalDate currentDate = LocalDate.now();
List<DicekeMininglossVo> LossMonthList = dicekeMininglossService.getLossByMonth(currentDate);
System.out.println(LossMonthList.toString());
return Result.successResult().data("LossMonthVoList", LossMonthList);
}
@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 LossMonth
/*,@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月查询此月报表
List<DicekeMininglossVo> LossByMonthVoList = dicekeMininglossService.getLossByMonth(Month);
} else
*/
if (LossMonth != null){ //Month存在 通过获取year年和month月查询此月报表
List<DicekeMininglossVo> LossByMonthVoList = dicekeMininglossService.getLossByMonth(LossMonth);
System.out.println(LossByMonthVoList.toString());
return Result.successResult().data("LossMonthVoList", LossByMonthVoList);
} else {
return null;
return Result.errorResult().data("时间为空",null);
}
}
@ -90,18 +114,17 @@ public class DicekeMininglossController {
@Operation(summary = "新增损失和贫化信息")
@PostMapping("savedicekeMiningloss")
public Result saveLoss(@RequestBody DicekeMininglossVo dicekeMininglossVo){
public Result saveLoss(@RequestBody DicekeMiningloss dicekeMiningloss){
int savedml = dicekeMininglossService.savedml(dicekeMininglossVo);
if(savedml == 1) {
return Result.errorResult().data("平盘不存在",savedml);
} else if (savedml == 2) {
return Result.errorResult().data("电铲不存在",savedml);
} else {
boolean updateflag = dicekeMininglossService.save(dicekeMiningloss);
if (updateflag){
return Result.successResult();
} else {
return Result.errorResult();
}
}
}

View File

@ -1,9 +1,12 @@
package com.jdc.jdcproject.controller;
import com.jdc.jdcproject.entity.DicekeMiningloss;
import com.jdc.jdcproject.entity.VO.DicekeTotalMiningVo;
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.*;
@ -18,20 +21,61 @@ import java.util.List;
* @author xvxboo
*/
/*
* 该业务只是查询diceke_miningloss表并不存在自己的数据库
* */
@RestController
@RequestMapping("/dicekeTotalMining")
public class DicekeTotalMiningController {
@Autowired
private IDicekeTotalMiningService iDicekeTotalMiningService;
private IDicekeTotalMiningService dicekeTotalMiningService;
@Autowired
private IDicekeMininglossService dicekeMininglossService;
@Operation(summary = "通过Month查询采剥量报表")
@GetMapping("findTotalMiningByMonth")
public Result findTotalMiningByMonth(@RequestParam(required = false) LocalDate Month){
List<DicekeTotalMiningVo> totalMiningVoList = iDicekeTotalMiningService.getTotalMiningByMonth(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);
}
@Operation(summary = "修改采剥量报表")
@PostMapping("updateTotalMining")
public Result updateTotalMining(@RequestBody DicekeTotalMiningVo dtm){
DicekeMiningloss dml = new DicekeMiningloss();
dml.setLossID(dtm.getTotalID());
dml.setPlateID(dtm.getPlateID());
dml.setShovelID(dtm.getShovelID());
dml.setBeizhu(dtm.getBeizhu());
dml.setStrippingTon(dtm.getStrippingTon());
dml.setStrippingAndTotalMiningTon(dtm.getStrippingAndTotalMiningTon());
dml.setMonth(dtm.getMonth());
boolean updateFlag = dicekeMininglossService.updateById(dml);
if (updateFlag){
return Result.successResult();
} else {
return Result.errorResult();
}
}
//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

@ -2,20 +2,23 @@ package com.jdc.jdcproject.controller;
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
import com.jdc.jdcproject.entity.FangpaishuiUnit;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
import com.jdc.jdcproject.entity.FangpaishuiWatertreatmentrecord;
import com.jdc.jdcproject.entity.VO.*;
import com.jdc.jdcproject.service.EquipmentService;
import com.jdc.jdcproject.service.FangpaishuiPumpoperationrecordService;
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 java.sql.SQLOutput;
import java.text.ParseException;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/FangpaishuiPumpoperationrecordController")
@ -78,4 +81,22 @@ public class FangpaishuiPumpoperationrecordController {
return Result.errorResult();
}
}
@Operation(summary = "根据月查询排/倒水月报表")
@GetMapping("findFangpaishuiPumpoperationrecordByMonth/{date}")
public Result findWatertreatmentrecordByMonth(@PathVariable String date) throws ParseException {
String[] s = date.split("-");
int year = Integer.parseInt(s[0]);
int month = Integer.parseInt(s[1]);
LastDayOfMonth lastDayOfMonth = new LastDayOfMonth();
String upDay = lastDayOfMonth.getLastDayOfMonth(year, month-1);
String lastDay = lastDayOfMonth.getLastDayOfMonth(year, month);
upDay = lastDayOfMonth.dateCalculations(upDay,5);
lastDay = lastDayOfMonth.dateCalculations(lastDay,6);
FangpaishuiPumpoperationrecordReportByYearCountVo fangpaishuiPumpoperationrecordReportByYearCountVo =fangpaishuiPumpoperationrecordService.findAll(upDay,lastDay);
return Result.successResult().data("fangpaishuiPumpoperationrecordReportByYearCountVo",fangpaishuiPumpoperationrecordReportByYearCountVo);
}
}

View File

@ -35,10 +35,14 @@ public class DicekeMiningloss implements Serializable {
@Schema(description = "月份")
private LocalDate month;
@Schema(description = "剥离量(吨)")
@Schema(description = "圈定矿量(吨)")
private Double DefineMineralReserves;
@Schema(description = "剥离量(吨)")
private Double strippingTon;
@Schema(description = "采剥总量(吨)")
@Schema(description = "实采总量(吨)")
private Double strippingAndTotalMiningTon;
@Schema(description = "采下废石(吨)")
@ -47,25 +51,34 @@ public class DicekeMiningloss implements Serializable {
@Schema(description = "贫化率(%")
private Double dilutionRate;
@Schema(description = "损失矿量(吨)")
private Double LossMineralTon;
@Schema(description = "损失率(%")
private Double lossRate;
@Schema(description = "配矿配矿量(吨)")
private Double allocationTon;
@Schema(description = "备注")
private String beizhu;
@Override
public String toString() {
return "DicekeMiningloss{" +
"lossID = " + lossID +
", plateID = " + plateID +
", shovelID = " + shovelID +
", month = " + month +
", strippingTon = " + strippingTon +
", strippingAndTotalMiningTon = " + strippingAndTotalMiningTon +
", wasteRockTon = " + wasteRockTon +
", dilutionRate = " + dilutionRate +
", lossRate = " + lossRate +
", allocationTon = " + allocationTon +
"}";
"lossID='" + lossID + '\'' +
", plateID='" + plateID + '\'' +
", shovelID='" + shovelID + '\'' +
", month=" + month +
", DefineMineralReserves=" + DefineMineralReserves +
", strippingTon=" + strippingTon +
", strippingAndTotalMiningTon=" + strippingAndTotalMiningTon +
", wasteRockTon=" + wasteRockTon +
", dilutionRate=" + dilutionRate +
", LossMineralTon=" + LossMineralTon +
", lossRate=" + lossRate +
", allocationTon=" + allocationTon +
", beizhu='" + beizhu + '\'' +
'}';
}
}

View File

@ -26,10 +26,13 @@ public class DicekeMininglossVo {
@Schema(description = "月份")
private LocalDate month;
@Schema(description = "圈定矿量(吨)")
private Double DefineMineralReserves;
@Schema(description = "剥离量(吨)")
private Double strippingTon;
@Schema(description = "总量(吨)")
@Schema(description = "采总量(吨)")
private Double strippingAndTotalMiningTon;
@Schema(description = "采下废石(吨)")
@ -38,6 +41,9 @@ public class DicekeMininglossVo {
@Schema(description = "贫化率(%")
private Double dilutionRate;
@Schema(description = "损失矿量(吨)")
private Double LossMineralTon;
@Schema(description = "损失率(%")
private Double lossRate;
@ -49,18 +55,18 @@ public class DicekeMininglossVo {
@Override
public String toString() {
return "DicekeMiningloss{" +
"lossID = " + lossID +
", plateID = " + plateRange +
", shovelID = " + shovelCode +
", month = " + month +
", strippingTon = " + strippingTon +
", strippingAndTotalMiningTon = " + strippingAndTotalMiningTon +
", wasteRockTon = " + wasteRockTon +
", dilutionRate = " + dilutionRate +
", lossRate = " + lossRate +
", allocationTon = " + allocationTon +
", beizhu = " + beizhu +
"}";
return "DicekeMininglossVo{" +
"lossID='" + lossID + '\'' +
", plateRange='" + plateRange + '\'' +
", shovelCode='" + shovelCode + '\'' +
", month=" + month +
", DefineMineralReserves=" + DefineMineralReserves +
", strippingAndTotalMiningTon=" + strippingAndTotalMiningTon +
", wasteRockTon=" + wasteRockTon +
", dilutionRate=" + dilutionRate +
", lossRate=" + lossRate +
", allocationTon=" + allocationTon +
", beizhu='" + beizhu + '\'' +
'}';
}
}

View File

@ -10,18 +10,23 @@ public class DicekeTotalMiningVo {
private static final long serialVersionUID = 1L;
@Schema(description = "平盘名称")
private String plateRange;
@Schema(description = "TotalID") /*传LossID,涉及修改或删除Loss表*/
@TableId("TotalID")
private String TotalID;
@Schema(description = "铲号")
private String shovelCode;
@Schema(description = "外键关联平盘表")
private String plateID;
@Schema(description = "外键关联铲号表")
private String shovelID;
@Schema(description = "备注")
private String beizhu;
/*
@Schema(description = "计量单位")
private String UOM;
*/
@Schema(description = "出矿量(吨)")
private Double OreYield;
@ -31,21 +36,23 @@ public class DicekeTotalMiningVo {
@Schema(description = "采剥总量(吨)")
private Double strippingAndTotalMiningTon;
@Schema(description = "月份")
@Schema(description = "月份",name="月份")
private LocalDate month;
public DicekeTotalMiningVo(String plateRange,
String shovelCode,
public DicekeTotalMiningVo(String totalID,
String plateID,
String shovelID,
String beizhu,
String UOM,
Double oreYield,
Double strippingTon,
Double strippingAndTotalMiningTon,
LocalDate month) {
this.plateRange = plateRange;
this.shovelCode = shovelCode;
TotalID = totalID;
this.plateID = plateID;
this.shovelID = shovelID;
this.beizhu = beizhu;
this.UOM = UOM;
// this.UOM = UOM;
OreYield = oreYield;
this.strippingTon = strippingTon;
this.strippingAndTotalMiningTon = strippingAndTotalMiningTon;
@ -55,10 +62,11 @@ public class DicekeTotalMiningVo {
@Override
public String toString() {
return "DicekeTotalMiningVo{" +
"plateRange='" + plateRange + '\'' +
", shovelCode='" + shovelCode + '\'' +
"TotalID='" + TotalID + '\'' +
", plateID='" + plateID + '\'' +
", shovelID='" + shovelID + '\'' +
", beizhu='" + beizhu + '\'' +
", UOM='" + UOM + '\'' +
// ", UOM='" + UOM + '\'' +
", OreYield=" + OreYield +
", strippingTon=" + strippingTon +
", strippingAndTotalMiningTon=" + strippingAndTotalMiningTon +

View File

@ -0,0 +1,32 @@
package com.jdc.jdcproject.entity.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class FangpaishuiPumpoperationrecordReportByMonthCountVo implements Serializable {
@Schema(description = "排/倒明细总")
private List<FangpaishuiPumpoperationrecordReportVo> fangpaishuiPumpoperationrecordReportVos;
@Schema(description = "所有泵站月总排和倒水量")
private int VolumeAllByMouth;
@Schema(description = "所有泵站年总排和倒水量")
private int VolumeAllByYear;
@Schema(description = "类型")
private String type;
}

View File

@ -0,0 +1,28 @@
package com.jdc.jdcproject.entity.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class FangpaishuiPumpoperationrecordReportByYearCountVo implements Serializable {
@Schema(description = "合计报表")
private List<FangpaishuiPumpoperationrecordReportByMonthCountVo> fangpaishuiPumpoperationrecordReportByMonthCountVos;
@Schema(description = "月总排和倒水量")
private int VolumeByMouthCount;
@Schema(description = "年总排和倒水量")
private int VolumeByYearCount;
}

View File

@ -0,0 +1,29 @@
package com.jdc.jdcproject.entity.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class FangpaishuiPumpoperationrecordReportVo implements Serializable {
@Schema(description = "泵站名称")
private String EquipmentName;
@Schema(description = "日志数据")
private List<FangpaishuiPumpoperationrecordVo> fangpaishuiPumpoperationrecordVos;
@Schema(description = "本泵站月总排/倒水量")
private int VolumeByMouth;
}

View File

@ -1,8 +1,10 @@
package com.jdc.jdcproject.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jdc.jdcproject.entity.DicekeMiningloss;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jdc.jdcproject.entity.VO.DicekeMininglossVo;
import com.jdc.jdcproject.entity.VO.DicekeTotalMiningVo;
import org.apache.ibatis.annotations.Mapper;
import java.time.LocalDate;
@ -21,9 +23,14 @@ 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);
Page<DicekeMininglossVo> selectLossPage(Page<DicekeMininglossVo> page);
}

View File

@ -2,8 +2,10 @@ package com.jdc.jdcproject.mapper;
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordReportVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -16,6 +18,11 @@ import java.util.List;
public interface FangpaishuiPumpoperationrecordMapper extends BaseMapper<FangpaishuiPumpoperationrecord> {
List<FangpaishuiPumpoperationrecordVo> findDetail(FangpaishuiPumpoperationrecordVo vo);
List<FangpaishuiPumpoperationrecordVo> findAll(String upDate, String lastDate);
int findCount(@Param("type")String type, @Param("upDate")String upDate, @Param("lastDate") String lastDate);
}

View File

@ -7,10 +7,11 @@
select dml.LossID,
dp.PlateRange,
ds.ShovelCode,
dml.StrippingTon,
dml.DefineMineralReserves,
dml.StrippingAndTotalMiningTon,
dml.WasteRockTon,
dml.DilutionRate,
dml.LossMineralTon,
dml.LossRate,
dml.AllocationTon,
dml.Month,
@ -19,7 +20,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,15 +41,18 @@
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,
dp.PlateRange,
ds.ShovelCode,
dml.DefineMineralReserves,
dml.StrippingTon,
dml.StrippingAndTotalMiningTon,
dml.WasteRockTon,
dml.DilutionRate,
dml.LossMineralTon,
dml.LossRate,
dml.AllocationTon,
dml.Month,
@ -57,4 +62,23 @@
LEFT JOIN diceke_shovel ds ON dml.ShovelID = ds.ShovelID
WHERE YEAR(dml.Month) = #{year} AND MONTH(dml.Month) = #{monthV}
</select>
<select id="selectLossPage" resultType="com.jdc.jdcproject.entity.VO.DicekeMininglossVo">
select dml.LossID,
dp.PlateRange,
ds.ShovelCode,
dml.DefineMineralReserves,
dml.StrippingAndTotalMiningTon,
dml.WasteRockTon,
dml.DilutionRate,
dml.LossMineralTon,
dml.LossRate,
dml.AllocationTon,
dml.Month,
dml.beizhu FROM diceke_miningloss dml
LEFT JOIN diceke_platearea dp ON dml.PlateID = dp.PlateID
LEFT JOIN diceke_shovel ds ON dml.ShovelID = ds.ShovelID
</select>
</mapper>

View File

@ -26,5 +26,39 @@
</where>
</select>
<select id="findAll" parameterType="com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo" resultType="com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo">
SELECT
fp.RecordID,
e.EquipmentId,
e.EquipmentName,
fn.UnitId,
fn.UnitCode,
fn.RatedCapacity,
fp.OperationType,
fp.Sailings,
fp.StartupTime,
fp.EndTime,
fp.OperationTime,
fp.Volume,
fp.MONTH
FROM
fangpaishui_pumpoperationrecord fp
LEFT JOIN fangpaishui_unit fn ON fn.UnitID = fp.UnitID
JOIN equipment e ON fn.EquipmentId = e.EquipmentId
WHERE
fp.Month BETWEEN '${upDate}' AND '${lastDate}'
</select>
<select id="findCount" resultType="int">
SELECT
SUM(Volume)
FROM
fangpaishui_pumpoperationrecord
WHERE
Month BETWEEN '${upDate}' AND '${lastDate}'
and
OperationType = '${type}'
</select>
</mapper>

View File

@ -2,6 +2,8 @@ package com.jdc.jdcproject.service;
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordReportByYearCountVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordReportVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiUnitVo;
@ -13,5 +15,12 @@ import java.util.List;
* @createDate 2025-05-07 13:37:49
*/
public interface FangpaishuiPumpoperationrecordService extends IService<FangpaishuiPumpoperationrecord> {
//查询泵站操作明细
List<FangpaishuiPumpoperationrecordVo> findDetail(FangpaishuiPumpoperationrecordVo vo);
//查询泵站操作总报表
FangpaishuiPumpoperationrecordReportByYearCountVo findAll(String upDate, String lastDate);
//查询操作时间节点查询年总量
int findCount(String type,String lastDate);
}

View File

@ -1,9 +1,9 @@
package com.jdc.jdcproject.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
import java.time.LocalDate;
import java.util.List;
@ -20,11 +20,19 @@ public interface IDicekeMininglossService extends IService<DicekeMiningloss> {
List<DicekeMininglossVo> findAllLoss();
Page<DicekeMininglossVo> getPage(int pageNum);
/*
int savedml(DicekeMininglossVo dicekeMininglossVo);
*/
/*
// 两个时间内查询
List<DicekeMininglossVo> getLossByMonthRange(LocalDate Month, LocalDate endMonth);
*/
List<DicekeMininglossVo> getLossByMonth(LocalDate currentDate);
List<DicekeMininglossVo> getLossByMonth(LocalDate Month);
}

View File

@ -1,6 +1,7 @@
package com.jdc.jdcproject.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jdc.jdcproject.entity.DicekeMiningloss;
import com.jdc.jdcproject.entity.DicekePlatearea;
import com.jdc.jdcproject.entity.DicekeShovel;
@ -10,10 +11,6 @@ import com.jdc.jdcproject.mapper.DicekePlateareaMapper;
import com.jdc.jdcproject.mapper.DicekeShovelMapper;
import com.jdc.jdcproject.service.IDicekeMininglossService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jdc.jdcproject.service.IDicekePlateareaService;
import com.jdc.jdcproject.service.IDicekeShovelService;
import com.jdc.jdcproject.utils.Result;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -43,7 +40,8 @@ public class DicekeMininglossServiceImpl extends ServiceImpl<DicekeMininglossMap
return baseMapper.findAllLoss();
}
/*
// 两个时间内查询
@Override
public List<DicekeMininglossVo> getLossByMonthRange(LocalDate month, LocalDate endMonth) {
@ -72,22 +70,41 @@ public class DicekeMininglossServiceImpl extends ServiceImpl<DicekeMininglossMap
}
}
*/
@Override
public List<DicekeMininglossVo> getLossByMonth(LocalDate month) {
int year = month.getYear();
int monthV = month.getMonthValue();
return baseMapper.findLossByMonth(monthV,year);
public List<DicekeMininglossVo> getLossByMonth(LocalDate currentDate) {
int year = currentDate.getYear();
int monthV = currentDate.getMonthValue();
List<DicekeMininglossVo> lossMonthList = baseMapper.findLossByMonth(monthV, year);
if (lossMonthList.isEmpty()) {
LocalDate lastMonth;
if (currentDate.getMonthValue() == 1) {
lastMonth = LocalDate.of(currentDate.getYear() - 1, 12, 1);
} else {
lastMonth = LocalDate.of(currentDate.getYear(), currentDate.getMonthValue() - 1, 1);
}
return baseMapper.findLossByMonth(lastMonth.getMonthValue(),lastMonth.getYear());
}
return lossMonthList;
}
@Override
public Page<DicekeMininglossVo> getPage(int pageNum) {
Page<DicekeMininglossVo> page = new Page<>(pageNum, 30);
return baseMapper.selectLossPage(page);
}
/*
@Override
public int savedml(DicekeMininglossVo dicekeMininglossVo) {
/*
*//*
QueryWrapper<DicekePlatearea> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("plateRange",dicekeMininglossVo.getPlateRange());
DicekePlatearea dp = dicekePlateareaService.getOne(queryWrapper);
*/
*//*
//平盘和电铲查找是否单独一个工具类如果使用次数多
DicekePlatearea dp = dicekePlateareaMapper.selectOne(
@ -114,7 +131,7 @@ public class DicekeMininglossServiceImpl extends ServiceImpl<DicekeMininglossMap
dml.setShovelID(ds.getShovelID());
dml.setPlateID(dp.getPlateID());
dml.setMonth(dicekeMininglossVo.getMonth());
dml.setStrippingTon(dicekeMininglossVo.getStrippingTon());
dml.setDefineMineralReserves(dicekeMininglossVo.getDefineMineralReserves());
dml.setStrippingAndTotalMiningTon(dicekeMininglossVo.getStrippingAndTotalMiningTon());
dml.setWasteRockTon(dicekeMininglossVo.getWasteRockTon());
dml.setDilutionRate(dicekeMininglossVo.getDilutionRate());
@ -123,6 +140,7 @@ public class DicekeMininglossServiceImpl extends ServiceImpl<DicekeMininglossMap
dicekeMininglossMapper.insert(dml);
return 20000;
}
*/

View File

@ -30,6 +30,7 @@ public class DicekeTotalMiningServiceImpl extends ServiceImpl<DicekeMininglossMa
List<DicekeTotalMiningVo> totalMiningList = new ArrayList<>();
//将mininglossListt赋值给totalMiningList
for (DicekeMininglossVo dmlVoLItem : mininglossVoList){
String TotalID = dmlVoLItem.getLossID();
String plateR = dmlVoLItem.getPlateRange();
String shovelC = dmlVoLItem.getShovelCode();
String beiZ = dmlVoLItem.getBeizhu();
@ -40,7 +41,7 @@ public class DicekeTotalMiningServiceImpl extends ServiceImpl<DicekeMininglossMa
Double strippingAndTMT = dmlVoLItem.getStrippingAndTotalMiningTon();
LocalDate mon = dmlVoLItem.getMonth();
DicekeTotalMiningVo dtmVoItem = new DicekeTotalMiningVo(plateR,
DicekeTotalMiningVo dtmVoItem = new DicekeTotalMiningVo(TotalID,plateR,
shovelC,beiZ,uom,oreY,strippingT,strippingAndTMT,mon);
totalMiningList.add(dtmVoItem);

View File

@ -2,12 +2,19 @@ package com.jdc.jdcproject.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jdc.jdcproject.entity.FangpaishuiPumpoperationrecord;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordReportByMonthCountVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordReportByYearCountVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordReportVo;
import com.jdc.jdcproject.entity.VO.FangpaishuiPumpoperationrecordVo;
import com.jdc.jdcproject.service.FangpaishuiPumpoperationrecordService;
import com.jdc.jdcproject.mapper.FangpaishuiPumpoperationrecordMapper;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author 95262
@ -22,6 +29,109 @@ public class FangpaishuiPumpoperationrecordServiceImpl extends ServiceImpl<Fangp
public List<FangpaishuiPumpoperationrecordVo> findDetail(FangpaishuiPumpoperationrecordVo vo) {
return baseMapper.findDetail(vo);
}
@Override
public FangpaishuiPumpoperationrecordReportByYearCountVo findAll(String upDate, String lastDate) {
List<FangpaishuiPumpoperationrecordVo> fangpaishuiPumpoperationrecordVos = baseMapper.findAll(upDate,lastDate);
//根据类型分组排水/倒水
Map<String, List<FangpaishuiPumpoperationrecordVo>> stringListMap = fangpaishuiPumpoperationrecordVos.stream().collect(Collectors.groupingBy(FangpaishuiPumpoperationrecordVo::getOperationType));
List<FangpaishuiPumpoperationrecordVo> fangpaishuiPumpoperationrecordVoPais = new ArrayList<>();
List<FangpaishuiPumpoperationrecordVo> fangpaishuiPumpoperationrecordVoDao = new ArrayList<>();
Set<Map.Entry<String, List<FangpaishuiPumpoperationrecordVo>>> entries = stringListMap.entrySet();
for(Map.Entry m : entries){
if (m.getKey().equals("排水")){
fangpaishuiPumpoperationrecordVoPais.addAll((List<FangpaishuiPumpoperationrecordVo>) m.getValue());
}else {
fangpaishuiPumpoperationrecordVoDao.addAll((List<FangpaishuiPumpoperationrecordVo>) m.getValue());
}
}
//排水根据机组合并数据
fangpaishuiPumpoperationrecordVoPais = fangpaishuiPumpoperationrecordVoPais.stream().collect(Collectors.toMap(FangpaishuiPumpoperationrecordVo::getUnitID, a -> a, (o1,o2)-> {
o1.setOperationTime(o1.getOperationTime() + o2.getOperationTime());
o1.setVolume(o1.getVolume () + o2.getVolume ());
return o1;
})).values().stream().collect(Collectors.toList());
//倒水根据机组合并数据
fangpaishuiPumpoperationrecordVoDao = fangpaishuiPumpoperationrecordVoDao.stream().collect(Collectors.toMap(FangpaishuiPumpoperationrecordVo::getUnitID, a -> a, (o1,o2)-> {
o1.setOperationTime(o1.getOperationTime() + o2.getOperationTime());
o1.setVolume(o1.getVolume () + o2.getVolume ());
return o1;
})).values().stream().collect(Collectors.toList());
//排水根据泵站分组
Map<String, List<FangpaishuiPumpoperationrecordVo>> paiMap = fangpaishuiPumpoperationrecordVoPais.stream().collect(Collectors.groupingBy(FangpaishuiPumpoperationrecordVo::getEquipmentName));
Set<Map.Entry<String, List<FangpaishuiPumpoperationrecordVo>>> paiEntries = paiMap.entrySet();
List<FangpaishuiPumpoperationrecordReportVo> fangpaishuiPumpoperationrecordReportVosPai = new ArrayList<>();
for(Map.Entry m : paiEntries){
FangpaishuiPumpoperationrecordReportVo vo = new FangpaishuiPumpoperationrecordReportVo();
vo.setEquipmentName((String) m.getKey());
vo.setFangpaishuiPumpoperationrecordVos((List<FangpaishuiPumpoperationrecordVo>) m.getValue());
int VolumeByMouth =0;
for (FangpaishuiPumpoperationrecordVo fangpaishuiPumpoperationrecordVo : (List<FangpaishuiPumpoperationrecordVo>) m.getValue()) {
VolumeByMouth+=fangpaishuiPumpoperationrecordVo.getVolume();
}
vo.setVolumeByMouth(VolumeByMouth);
fangpaishuiPumpoperationrecordReportVosPai.add(vo);
}
//倒水根据泵站分组
Map<String, List<FangpaishuiPumpoperationrecordVo>> paiMap1 = fangpaishuiPumpoperationrecordVoDao.stream().collect(Collectors.groupingBy(FangpaishuiPumpoperationrecordVo::getEquipmentName));
Set<Map.Entry<String, List<FangpaishuiPumpoperationrecordVo>>> paiEntries1 = paiMap1.entrySet();
List<FangpaishuiPumpoperationrecordReportVo> fangpaishuiPumpoperationrecordReportVosDao = new ArrayList<>();
for(Map.Entry m : paiEntries1){
FangpaishuiPumpoperationrecordReportVo vo = new FangpaishuiPumpoperationrecordReportVo();
vo.setEquipmentName((String) m.getKey());
vo.setFangpaishuiPumpoperationrecordVos((List<FangpaishuiPumpoperationrecordVo>) m.getValue());
int VolumeByMouth =0;
for (FangpaishuiPumpoperationrecordVo fangpaishuiPumpoperationrecordVo : (List<FangpaishuiPumpoperationrecordVo>) m.getValue()) {
VolumeByMouth+=fangpaishuiPumpoperationrecordVo.getVolume();
}
vo.setVolumeByMouth(VolumeByMouth);
fangpaishuiPumpoperationrecordReportVosDao.add( vo);
}
FangpaishuiPumpoperationrecordReportByMonthCountVo fPai = new FangpaishuiPumpoperationrecordReportByMonthCountVo();
fPai.setFangpaishuiPumpoperationrecordReportVos(fangpaishuiPumpoperationrecordReportVosPai);
int VolumeAllByMouth = 0;
for (FangpaishuiPumpoperationrecordReportVo fangpaishuiPumpoperationrecordReportVo : fangpaishuiPumpoperationrecordReportVosPai) {
VolumeAllByMouth+=fangpaishuiPumpoperationrecordReportVo.getVolumeByMouth();
}
fPai.setVolumeAllByMouth(VolumeAllByMouth);
fPai.setType("排水");
fPai.setVolumeAllByYear(findCount("排水",lastDate));
FangpaishuiPumpoperationrecordReportByMonthCountVo fDao = new FangpaishuiPumpoperationrecordReportByMonthCountVo();
fDao.setFangpaishuiPumpoperationrecordReportVos(fangpaishuiPumpoperationrecordReportVosDao);
int VolumeAllByMouth1 = 0;
for (FangpaishuiPumpoperationrecordReportVo fangpaishuiPumpoperationrecordReportVo : fangpaishuiPumpoperationrecordReportVosDao) {
VolumeAllByMouth1+=fangpaishuiPumpoperationrecordReportVo.getVolumeByMouth();
}
fDao.setVolumeAllByMouth(VolumeAllByMouth1);
fDao.setType("倒水");
fDao.setVolumeAllByYear(findCount("倒水",lastDate));
FangpaishuiPumpoperationrecordReportByYearCountVo fangpaishuiPumpoperationrecordReportByYearCountVo = new FangpaishuiPumpoperationrecordReportByYearCountVo();
List<FangpaishuiPumpoperationrecordReportByMonthCountVo> all = new ArrayList<>();
all.add(fDao);
all.add(fPai);
fangpaishuiPumpoperationrecordReportByYearCountVo.setFangpaishuiPumpoperationrecordReportByMonthCountVos(all);
fangpaishuiPumpoperationrecordReportByYearCountVo.setVolumeByMouthCount(fDao.getVolumeAllByMouth()+fPai.getVolumeAllByMouth());
fangpaishuiPumpoperationrecordReportByYearCountVo.setVolumeByYearCount(fDao.getVolumeAllByYear()+fPai.getVolumeAllByYear());
return fangpaishuiPumpoperationrecordReportByYearCountVo;
}
@Override
public int findCount(String type, String lastDate) {
int year = Integer.valueOf(lastDate.substring(0,4)).intValue()-1;
String update =String.valueOf(year)+"-12-26";
return baseMapper.findCount(type,update,lastDate);
}
}

View File

@ -30,7 +30,7 @@ public final class MD5 {
}
public static void main(String[] args) {
System.out.println(MD5.encrypt("111111"));
System.out.println(MD5.encrypt("123456789"));
}
}