diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheLocomotivesController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheLocomotivesController.java new file mode 100644 index 0000000..43809b0 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheLocomotivesController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 电机车表; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheLocomotives") +public class DianjicheLocomotivesController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheMiningController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheMiningController.java new file mode 100644 index 0000000..f1dde4f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheMiningController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 三个班实际完成量; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheMining") +public class DianjicheMiningController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheMiningScheduleController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheMiningScheduleController.java new file mode 100644 index 0000000..5e70437 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheMiningScheduleController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 存储大厂要矿时间及操作记录; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-15 + */ +@Controller +@RequestMapping("/dianjicheMiningSchedule") +public class DianjicheMiningScheduleController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheProductionTasks1Controller.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheProductionTasks1Controller.java new file mode 100644 index 0000000..95893c7 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheProductionTasks1Controller.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 三班累计; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheProductionTasks1") +public class DianjicheProductionTasks1Controller { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheProductionTasksController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheProductionTasksController.java new file mode 100644 index 0000000..38124dd --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheProductionTasksController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 生产任务表,存储单台电机车的生产任务基础信息; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheProductionTasks") +public class DianjicheProductionTasksController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheSingleLocomotiveTasksController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheSingleLocomotiveTasksController.java new file mode 100644 index 0000000..e1970a6 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheSingleLocomotiveTasksController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 存储单台电机车的生产任务完成情况; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheSingleLocomotiveTasks") +public class DianjicheSingleLocomotiveTasksController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheStationsController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheStationsController.java new file mode 100644 index 0000000..a22b280 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheStationsController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 存储所有作业站点信息; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheStations") +public class DianjicheStationsController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheTimetableController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheTimetableController.java new file mode 100644 index 0000000..bcf74a2 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheTimetableController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 电机车作业时间统计台帐; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheTimetable") +public class DianjicheTimetableController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DianjicheTransportreportController.java b/src/main/java/com/jdc/jdcproject/controller/DianjicheTransportreportController.java new file mode 100644 index 0000000..a0c7c88 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DianjicheTransportreportController.java @@ -0,0 +1,18 @@ +package com.jdc.jdcproject.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.stereotype.Controller; + +/** + *

+ * 电机车综合运输报表的表头; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Controller +@RequestMapping("/dianjicheTransportreport") +public class DianjicheTransportreportController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/EasyExcelController.java b/src/main/java/com/jdc/jdcproject/controller/EasyExcelController.java new file mode 100644 index 0000000..95cff28 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/EasyExcelController.java @@ -0,0 +1,51 @@ +package com.jdc.jdcproject.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; + +import com.jdc.jdcproject.entity.DianjicheMining; +import com.jdc.jdcproject.entity.DianjicheMiningSchedule; +import com.jdc.jdcproject.entity.DianjicheTimetable; +import com.jdc.jdcproject.entity.excel.DianjicheMiningScheduleExcel; +import com.jdc.jdcproject.service.IDianjicheMiningScheduleService; +import com.jdc.jdcproject.service.IDianjicheMiningService; +import com.jdc.jdcproject.service.IDianjicheTimetableService; +import com.jdc.jdcproject.service.impl.DianjicheMiningServiceImpl; +import com.jdc.jdcproject.service.impl.DianjicheTimetableServiceImpl; +import com.jdc.jdcproject.utils.EasyExcelListener; +import com.jdc.jdcproject.utils.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +@RestController("excel") +public class EasyExcelController { + + @Autowired + private IDianjicheMiningScheduleService dianjicheMiningScheduleService; + + @Autowired + private IDianjicheTimetableService dianjicheTimetableService; + + @Autowired + private IDianjicheMiningService dianjicheMiningService; + + @PostMapping(value = "dianjicheexcelupload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public Result upload(@RequestPart("file") MultipartFile file) throws IOException { + List uploadsaveDianjicheMiningSchedule = dianjicheMiningScheduleService.uploadsave(file); + List uploadsaveDianjicheTimetable = dianjicheTimetableService.uploadsave(file); + List uploadsaveDianjicheMining = dianjicheMiningService.uploadsave(file); + dianjicheMiningScheduleService.saveBatch(uploadsaveDianjicheMiningSchedule); + dianjicheTimetableService.saveBatch(uploadsaveDianjicheTimetable); + dianjicheMiningService.saveBatch(uploadsaveDianjicheMining); + return Result.successResult(); + } + +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheLocomotives.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheLocomotives.java new file mode 100644 index 0000000..864c426 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheLocomotives.java @@ -0,0 +1,52 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * 电机车表; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiChe_Locomotives") +@Schema(name = "DianjicheLocomotives", description = "电机车表;") +public class DianjicheLocomotives implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键,电机车编号(如 1501)") + @TableId("Locomotive_id") + private String locomotiveId; + + @Schema(description = "电机车名称(如 1501机台)") + private Integer name; + + public String getLocomotiveId() { + return locomotiveId; + } + + public void setLocomotiveId(String locomotiveId) { + this.locomotiveId = locomotiveId; + } + + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + @Override + public String toString() { + return "DianjicheLocomotives{" + + "locomotiveId = " + locomotiveId + + ", name = " + name + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheMining.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheMining.java new file mode 100644 index 0000000..3ec0ffb --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheMining.java @@ -0,0 +1,100 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * 三个班实际完成量; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiChe_mining") +@Schema(name = "DianjicheMining", description = "三个班实际完成量;") +public class DianjicheMining implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + private String planId; + + @Schema(description = "外键, 关联班次表") + private String shiftId; + + @Schema(description = "日期") + private Date date; + + @Schema(description = "实际车数") + private String actualVehicles; + + @Schema(description = "实际吨数") + private String actualTons; + + @Schema(description = "实际列数") + private String actualColumns; + + public String getPlanId() { + return planId; + } + + public void setPlanId(String planId) { + this.planId = planId; + } + + public String getShiftId() { + return shiftId; + } + + public void setShiftId(String shiftId) { + this.shiftId = shiftId; + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } + + public String getActualVehicles() { + return actualVehicles; + } + + public void setActualVehicles(String actualVehicles) { + this.actualVehicles = actualVehicles; + } + + public String getActualTons() { + return actualTons; + } + + public void setActualTons(String actualTons) { + this.actualTons = actualTons; + } + + public String getActualColumns() { + return actualColumns; + } + + public void setActualColumns(String actualColumns) { + this.actualColumns = actualColumns; + } + + @Override + public String toString() { + return "DianjicheMining{" + + "planId = " + planId + + ", shiftId = " + shiftId + + ", date = " + date + + ", actualVehicles = " + actualVehicles + + ", actualTons = " + actualTons + + ", actualColumns = " + actualColumns + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheMiningSchedule.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheMiningSchedule.java new file mode 100644 index 0000000..d2fa31e --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheMiningSchedule.java @@ -0,0 +1,60 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalTime; +import java.util.Date; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + *

+ * 存储大厂要矿时间及操作记录; + *

+ * + * @author haoyanlu + * @since 2025-06-15 + */ +@TableName("DianJiChe_mining_schedule") +@Data +@Schema(name = "DianjicheMiningSchedule", description = "存储大厂要矿时间及操作记录;") +public class DianjicheMiningSchedule implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + @TableId(value = "ScheduleId") + private String scheduleId; + + @Schema(description = "日期") + private Date date; + + @Schema(description = "白班还是夜班") + private String shiftType; + + @Schema(description = "白班要矿时间") + private LocalTime dayShiftTime; + + @Schema(description = "白班下矿时间") + private LocalTime dayDownTime; + + @Schema(description = "白班11节车数") + private String dayTrainCount; + + @Schema(description = "夜班早晨7点以后下") + private String after7; + + @Schema(description = "白班早晨8点以后回") + private String after8; + + @Schema(description = "夜班要矿时间") + private LocalTime nightShiftTime; + + @Schema(description = "夜班下矿时间") + private LocalTime nightDownTime; + + @Schema(description = "夜班11节列车数") + private String nightTrainCount; +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheProductionTasks.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheProductionTasks.java new file mode 100644 index 0000000..ac6ada6 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheProductionTasks.java @@ -0,0 +1,137 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.math.BigDecimal; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * 生产任务表,存储单台电机车的生产任务基础信息; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiChe_production_tasks") +@Schema(name = "DianjicheProductionTasks", description = "生产任务表,存储单台电机车的生产任务基础信息;") +public class DianjicheProductionTasks implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + @TableId("task_id") + private Integer taskId; + + @Schema(description = "外键,关联电机车表") + private Integer locomotiveId; + + @Schema(description = "外键, 关联班次表,0,1,2代表甲乙丙三个班") + private Integer shiftId; + + @Schema(description = "只显示月数几月的计划") + private Integer month; + + @Schema(description = "计划台班数") + private Integer plannedShifts; + + @Schema(description = "实际台班数") + private Integer actualShifts; + + @Schema(description = "台班效率(百分比)") + private BigDecimal efficiency; + + @Schema(description = "车数") + private Integer vehicles; + + @Schema(description = "吨数") + private Integer tons; + + public Integer getTaskId() { + return taskId; + } + + public void setTaskId(Integer taskId) { + this.taskId = taskId; + } + + public Integer getLocomotiveId() { + return locomotiveId; + } + + public void setLocomotiveId(Integer locomotiveId) { + this.locomotiveId = locomotiveId; + } + + public Integer getShiftId() { + return shiftId; + } + + public void setShiftId(Integer shiftId) { + this.shiftId = shiftId; + } + + public Integer getMonth() { + return month; + } + + public void setMonth(Integer month) { + this.month = month; + } + + public Integer getPlannedShifts() { + return plannedShifts; + } + + public void setPlannedShifts(Integer plannedShifts) { + this.plannedShifts = plannedShifts; + } + + public Integer getActualShifts() { + return actualShifts; + } + + public void setActualShifts(Integer actualShifts) { + this.actualShifts = actualShifts; + } + + public BigDecimal getEfficiency() { + return efficiency; + } + + public void setEfficiency(BigDecimal efficiency) { + this.efficiency = efficiency; + } + + public Integer getVehicles() { + return vehicles; + } + + public void setVehicles(Integer vehicles) { + this.vehicles = vehicles; + } + + public Integer getTons() { + return tons; + } + + public void setTons(Integer tons) { + this.tons = tons; + } + + @Override + public String toString() { + return "DianjicheProductionTasks{" + + "taskId = " + taskId + + ", locomotiveId = " + locomotiveId + + ", shiftId = " + shiftId + + ", month = " + month + + ", plannedShifts = " + plannedShifts + + ", actualShifts = " + actualShifts + + ", efficiency = " + efficiency + + ", vehicles = " + vehicles + + ", tons = " + tons + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheProductionTasks1.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheProductionTasks1.java new file mode 100644 index 0000000..a1c1220 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheProductionTasks1.java @@ -0,0 +1,122 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * 三班累计; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiChe_production_tasks1") +@Schema(name = "DianjicheProductionTasks1", description = "三班累计;") +public class DianjicheProductionTasks1 implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + private Integer taskId; + + @Schema(description = "班次0,1,2,3表示甲乙丙全车间") + private Integer shift; + + @Schema(description = "只显示月数几月的计划") + private Integer month; + + @Schema(description = "计划台班数三班累计") + private Integer plannedShifts; + + @Schema(description = "实际台班数三班累计") + private Integer actualShifts; + + @Schema(description = "台班效率(百分比)") + private Integer efficiency; + + @Schema(description = "车数三班累计") + private Integer vehicles; + + @Schema(description = "吨数三班累计") + private Integer tons; + + public Integer getTaskId() { + return taskId; + } + + public void setTaskId(Integer taskId) { + this.taskId = taskId; + } + + public Integer getShift() { + return shift; + } + + public void setShift(Integer shift) { + this.shift = shift; + } + + public Integer getMonth() { + return month; + } + + public void setMonth(Integer month) { + this.month = month; + } + + public Integer getPlannedShifts() { + return plannedShifts; + } + + public void setPlannedShifts(Integer plannedShifts) { + this.plannedShifts = plannedShifts; + } + + public Integer getActualShifts() { + return actualShifts; + } + + public void setActualShifts(Integer actualShifts) { + this.actualShifts = actualShifts; + } + + public Integer getEfficiency() { + return efficiency; + } + + public void setEfficiency(Integer efficiency) { + this.efficiency = efficiency; + } + + public Integer getVehicles() { + return vehicles; + } + + public void setVehicles(Integer vehicles) { + this.vehicles = vehicles; + } + + public Integer getTons() { + return tons; + } + + public void setTons(Integer tons) { + this.tons = tons; + } + + @Override + public String toString() { + return "DianjicheProductionTasks1{" + + "taskId = " + taskId + + ", shift = " + shift + + ", month = " + month + + ", plannedShifts = " + plannedShifts + + ", actualShifts = " + actualShifts + + ", efficiency = " + efficiency + + ", vehicles = " + vehicles + + ", tons = " + tons + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheSingleLocomotiveTasks.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheSingleLocomotiveTasks.java new file mode 100644 index 0000000..2be088f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheSingleLocomotiveTasks.java @@ -0,0 +1,162 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * 存储单台电机车的生产任务完成情况; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiche_single_locomotive_tasks") +@Schema(name = "DianjicheSingleLocomotiveTasks", description = "存储单台电机车的生产任务完成情况;") +public class DianjicheSingleLocomotiveTasks implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + @TableId("Task_id") + private Integer taskId; + + @Schema(description = "外键, 关联电机车表") + private Integer locomotiveId; + + @Schema(description = "外键, 关联班次表") + private Integer shiftId; + + @Schema(description = "外键,关联站点表") + private String stationId; + + @Schema(description = "车数") + private Integer vehicles; + + @Schema(description = "吨数") + private Integer tons; + + @Schema(description = "停车台时的类型(故障,停电,待命,其他)") + private Integer statusTypes; + + @Schema(description = "作业台时") + private Integer worktime; + + @Schema(description = "停车台时") + private String faulttime; + + @Schema(description = "作业日期") + private LocalDateTime date; + + @Schema(description = "停车时间百分比") + private BigDecimal faulttimeRate; + + public Integer getTaskId() { + return taskId; + } + + public void setTaskId(Integer taskId) { + this.taskId = taskId; + } + + public Integer getLocomotiveId() { + return locomotiveId; + } + + public void setLocomotiveId(Integer locomotiveId) { + this.locomotiveId = locomotiveId; + } + + public Integer getShiftId() { + return shiftId; + } + + public void setShiftId(Integer shiftId) { + this.shiftId = shiftId; + } + + public String getStationId() { + return stationId; + } + + public void setStationId(String stationId) { + this.stationId = stationId; + } + + public Integer getVehicles() { + return vehicles; + } + + public void setVehicles(Integer vehicles) { + this.vehicles = vehicles; + } + + public Integer getTons() { + return tons; + } + + public void setTons(Integer tons) { + this.tons = tons; + } + + public Integer getStatusTypes() { + return statusTypes; + } + + public void setStatusTypes(Integer statusTypes) { + this.statusTypes = statusTypes; + } + + public Integer getWorktime() { + return worktime; + } + + public void setWorktime(Integer worktime) { + this.worktime = worktime; + } + + public String getFaulttime() { + return faulttime; + } + + public void setFaulttime(String faulttime) { + this.faulttime = faulttime; + } + + public LocalDateTime getDate() { + return date; + } + + public void setDate(LocalDateTime date) { + this.date = date; + } + + public BigDecimal getFaulttimeRate() { + return faulttimeRate; + } + + public void setFaulttimeRate(BigDecimal faulttimeRate) { + this.faulttimeRate = faulttimeRate; + } + + @Override + public String toString() { + return "DianjicheSingleLocomotiveTasks{" + + "taskId = " + taskId + + ", locomotiveId = " + locomotiveId + + ", shiftId = " + shiftId + + ", stationId = " + stationId + + ", vehicles = " + vehicles + + ", tons = " + tons + + ", statusTypes = " + statusTypes + + ", worktime = " + worktime + + ", faulttime = " + faulttime + + ", date = " + date + + ", faulttimeRate = " + faulttimeRate + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheStations.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheStations.java new file mode 100644 index 0000000..dad7119 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheStations.java @@ -0,0 +1,62 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * 存储所有作业站点信息; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiChe_stations") +@Schema(name = "DianjicheStations", description = "存储所有作业站点信息;") +public class DianjicheStations implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + private Integer stationId; + + @Schema(description = "站点名称(东川河, 西川河,百花岭)") + private Integer name; + + @Schema(description = "站点类型 (装车站, 卸车站)") + private Integer type; + + public Integer getStationId() { + return stationId; + } + + public void setStationId(Integer stationId) { + this.stationId = stationId; + } + + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + @Override + public String toString() { + return "DianjicheStations{" + + "stationId = " + stationId + + ", name = " + name + + ", type = " + type + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheTimetable.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheTimetable.java new file mode 100644 index 0000000..99d46a8 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheTimetable.java @@ -0,0 +1,49 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + *

+ * 电机车作业时间统计台帐; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiChe_TimeTable") +@Schema(name = "DianjicheTimetable", description = "电机车作业时间统计台帐;") +@Data +public class DianjicheTimetable implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + @TableId("Timeid") + private String timeId; + + @Schema(description = "外键, 关联班次表,0,1,2代表甲乙丙三个班") + private Integer shiftId; + + @Schema(description = "总时间min单位") + private Integer totaltime; + + @Schema(description = "生产时间min单位") + private Integer productiontime; + + @Schema(description = "非生产时间min单位") + private Integer nonProductivetime; + + @Schema(description = "操作时间单位") + private Date date; + + @Schema(description = "台数") + private Integer units; + +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DianjicheTransportreport.java b/src/main/java/com/jdc/jdcproject/entity/DianjicheTransportreport.java new file mode 100644 index 0000000..45bebdf --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DianjicheTransportreport.java @@ -0,0 +1,292 @@ +package com.jdc.jdcproject.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * 电机车综合运输报表的表头; + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@TableName("DianJiChe_TransportReport") +@Schema(name = "DianjicheTransportreport", description = "电机车综合运输报表的表头;") +public class DianjicheTransportreport implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + private Integer reportId; + + @Schema(description = "报表计划车数") + private Integer plannedVehicles; + + @Schema(description = "报表计划吨数") + private Integer plannedTons; + + @Schema(description = "西站实际车数") + private Integer actualVehicleswest; + + @Schema(description = "东站实际车数") + private Integer actualVehiclesesat; + + @Schema(description = "西站实际吨数") + private Integer actualTonswest; + + @Schema(description = "东站实际吨数") + private Integer actualTonseast; + + @Schema(description = "大厂实际车数") + private Integer actualVehiclesbig; + + @Schema(description = "大厂实际吨数") + private Integer actualTonsbig; + + @Schema(description = "大厂实际列数") + private Integer actualColumnsbig; + + @Schema(description = "大厂实际公里数") + private Integer actualKilometerbig; + + @Schema(description = "完成计划(百分比)") + private Long completion; + + @Schema(description = "累计车数") + private Integer cumulativeVehicles; + + @Schema(description = "累计吨数") + private Integer cumulativeTons; + + @Schema(description = "实际累计台班数") + private Integer actualUnits; + + @Schema(description = "作业率(百分比)") + private BigDecimal jobRate; + + @Schema(description = "出车率(百分比)") + private BigDecimal carRate; + + @Schema(description = "电机车综合效率(吨公里/吨台班 )") + private BigDecimal efficiency; + + @Schema(description = "电机车效率(吨/台班)") + private BigDecimal efficiency1; + + @Schema(description = "列车周转时间(min)") + private Integer trainTime; + + @Schema(description = "装车质量(吨/列)") + private BigDecimal quality; + + @Schema(description = "填报时间") + private LocalDateTime date; + + public Integer getReportId() { + return reportId; + } + + public void setReportId(Integer reportId) { + this.reportId = reportId; + } + + public Integer getPlannedVehicles() { + return plannedVehicles; + } + + public void setPlannedVehicles(Integer plannedVehicles) { + this.plannedVehicles = plannedVehicles; + } + + public Integer getPlannedTons() { + return plannedTons; + } + + public void setPlannedTons(Integer plannedTons) { + this.plannedTons = plannedTons; + } + + public Integer getActualVehicleswest() { + return actualVehicleswest; + } + + public void setActualVehicleswest(Integer actualVehicleswest) { + this.actualVehicleswest = actualVehicleswest; + } + + public Integer getActualVehiclesesat() { + return actualVehiclesesat; + } + + public void setActualVehiclesesat(Integer actualVehiclesesat) { + this.actualVehiclesesat = actualVehiclesesat; + } + + public Integer getActualTonswest() { + return actualTonswest; + } + + public void setActualTonswest(Integer actualTonswest) { + this.actualTonswest = actualTonswest; + } + + public Integer getActualTonseast() { + return actualTonseast; + } + + public void setActualTonseast(Integer actualTonseast) { + this.actualTonseast = actualTonseast; + } + + public Integer getActualVehiclesbig() { + return actualVehiclesbig; + } + + public void setActualVehiclesbig(Integer actualVehiclesbig) { + this.actualVehiclesbig = actualVehiclesbig; + } + + public Integer getActualTonsbig() { + return actualTonsbig; + } + + public void setActualTonsbig(Integer actualTonsbig) { + this.actualTonsbig = actualTonsbig; + } + + public Integer getActualColumnsbig() { + return actualColumnsbig; + } + + public void setActualColumnsbig(Integer actualColumnsbig) { + this.actualColumnsbig = actualColumnsbig; + } + + public Integer getActualKilometerbig() { + return actualKilometerbig; + } + + public void setActualKilometerbig(Integer actualKilometerbig) { + this.actualKilometerbig = actualKilometerbig; + } + + public Long getCompletion() { + return completion; + } + + public void setCompletion(Long completion) { + this.completion = completion; + } + + public Integer getCumulativeVehicles() { + return cumulativeVehicles; + } + + public void setCumulativeVehicles(Integer cumulativeVehicles) { + this.cumulativeVehicles = cumulativeVehicles; + } + + public Integer getCumulativeTons() { + return cumulativeTons; + } + + public void setCumulativeTons(Integer cumulativeTons) { + this.cumulativeTons = cumulativeTons; + } + + public Integer getActualUnits() { + return actualUnits; + } + + public void setActualUnits(Integer actualUnits) { + this.actualUnits = actualUnits; + } + + public BigDecimal getJobRate() { + return jobRate; + } + + public void setJobRate(BigDecimal jobRate) { + this.jobRate = jobRate; + } + + public BigDecimal getCarRate() { + return carRate; + } + + public void setCarRate(BigDecimal carRate) { + this.carRate = carRate; + } + + public BigDecimal getEfficiency() { + return efficiency; + } + + public void setEfficiency(BigDecimal efficiency) { + this.efficiency = efficiency; + } + + public BigDecimal getEfficiency1() { + return efficiency1; + } + + public void setEfficiency1(BigDecimal efficiency1) { + this.efficiency1 = efficiency1; + } + + public Integer getTrainTime() { + return trainTime; + } + + public void setTrainTime(Integer trainTime) { + this.trainTime = trainTime; + } + + public BigDecimal getQuality() { + return quality; + } + + public void setQuality(BigDecimal quality) { + this.quality = quality; + } + + public LocalDateTime getDate() { + return date; + } + + public void setDate(LocalDateTime date) { + this.date = date; + } + + @Override + public String toString() { + return "DianjicheTransportreport{" + + "reportId = " + reportId + + ", plannedVehicles = " + plannedVehicles + + ", plannedTons = " + plannedTons + + ", actualVehicleswest = " + actualVehicleswest + + ", actualVehiclesesat = " + actualVehiclesesat + + ", actualTonswest = " + actualTonswest + + ", actualTonseast = " + actualTonseast + + ", actualVehiclesbig = " + actualVehiclesbig + + ", actualTonsbig = " + actualTonsbig + + ", actualColumnsbig = " + actualColumnsbig + + ", actualKilometerbig = " + actualKilometerbig + + ", completion = " + completion + + ", cumulativeVehicles = " + cumulativeVehicles + + ", cumulativeTons = " + cumulativeTons + + ", actualUnits = " + actualUnits + + ", jobRate = " + jobRate + + ", carRate = " + carRate + + ", efficiency = " + efficiency + + ", efficiency1 = " + efficiency1 + + ", trainTime = " + trainTime + + ", quality = " + quality + + ", date = " + date + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/excel/DianjicheMiningScheduleExcel.java b/src/main/java/com/jdc/jdcproject/entity/excel/DianjicheMiningScheduleExcel.java new file mode 100644 index 0000000..9a1eb35 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/excel/DianjicheMiningScheduleExcel.java @@ -0,0 +1,45 @@ +package com.jdc.jdcproject.entity.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Schema(name = "DianjicheMiningScheduleVo", description = "要矿时间excel表") +@Data +public class DianjicheMiningScheduleExcel { + @ExcelProperty(value = "日期",index = 0) + private String date; + + @ExcelProperty(value = "白班", index = 1) + private String dayShift; + + @ExcelProperty(value = "大厂要矿时间",index = 2) + private String dayRequestTime; + + @ExcelProperty(value = "下去时间",index = 3) + private String dayDownTime; + + @ExcelProperty(value = "11节列数",index = 4) + private String day11Count; + + @ExcelProperty(value = "夜班",index = 5) + private String nightShift; + + @ExcelProperty(value = "大厂要矿时间",index = 6) + private String nightRequestTime; + + @ExcelProperty(value = "下去时间",index = 7) + private String nightDownTime; + + @ExcelProperty(value = "11节列数",index = 8) + private String night11Count; + + @ExcelProperty(value = "夜班早晨7点以后下",index = 9) + private String nightAfter7; + + @ExcelProperty(value = "白班早晨8点以后回来",index = 10) + private String dayAfter8Return; +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheLocomotivesMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheLocomotivesMapper.java new file mode 100644 index 0000000..7e072f8 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheLocomotivesMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheLocomotives; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 电机车表; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheLocomotivesMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheMiningMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheMiningMapper.java new file mode 100644 index 0000000..c5f43b1 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheMiningMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheMining; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 三个班实际完成量; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheMiningMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheMiningScheduleMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheMiningScheduleMapper.java new file mode 100644 index 0000000..e3f001c --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheMiningScheduleMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheMiningSchedule; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 存储大厂要矿时间及操作记录; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-15 + */ +public interface DianjicheMiningScheduleMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheProductionTasks1Mapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheProductionTasks1Mapper.java new file mode 100644 index 0000000..6ca41a8 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheProductionTasks1Mapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheProductionTasks1; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 三班累计; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheProductionTasks1Mapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheProductionTasksMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheProductionTasksMapper.java new file mode 100644 index 0000000..1afb79f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheProductionTasksMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheProductionTasks; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 生产任务表,存储单台电机车的生产任务基础信息; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheProductionTasksMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheSingleLocomotiveTasksMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheSingleLocomotiveTasksMapper.java new file mode 100644 index 0000000..974330c --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheSingleLocomotiveTasksMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheSingleLocomotiveTasks; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 存储单台电机车的生产任务完成情况; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheSingleLocomotiveTasksMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheStationsMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheStationsMapper.java new file mode 100644 index 0000000..6efdfc8 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheStationsMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheStations; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 存储所有作业站点信息; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheStationsMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheTimetableMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheTimetableMapper.java new file mode 100644 index 0000000..8c9080d --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheTimetableMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheTimetable; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 电机车作业时间统计台帐; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheTimetableMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DianjicheTransportreportMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DianjicheTransportreportMapper.java new file mode 100644 index 0000000..bf9d4b8 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DianjicheTransportreportMapper.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.mapper; + +import com.jdc.jdcproject.entity.DianjicheTransportreport; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 电机车综合运输报表的表头; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface DianjicheTransportreportMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheLocomotivesMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheLocomotivesMapper.xml new file mode 100644 index 0000000..abb8eff --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheLocomotivesMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheMiningMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheMiningMapper.xml new file mode 100644 index 0000000..cda0345 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheMiningMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheMiningScheduleMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheMiningScheduleMapper.xml new file mode 100644 index 0000000..3ac5d3f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheMiningScheduleMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheProductionTasks1Mapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheProductionTasks1Mapper.xml new file mode 100644 index 0000000..60379f1 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheProductionTasks1Mapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheProductionTasksMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheProductionTasksMapper.xml new file mode 100644 index 0000000..7f62b57 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheProductionTasksMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheSingleLocomotiveTasksMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheSingleLocomotiveTasksMapper.xml new file mode 100644 index 0000000..ef400d1 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheSingleLocomotiveTasksMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheStationsMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheStationsMapper.xml new file mode 100644 index 0000000..0dae039 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheStationsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheTimetableMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheTimetableMapper.xml new file mode 100644 index 0000000..2e8e80e --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheTimetableMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheTransportreportMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheTransportreportMapper.xml new file mode 100644 index 0000000..7f556b1 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DianjicheTransportreportMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheLocomotivesService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheLocomotivesService.java new file mode 100644 index 0000000..b11ed8c --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheLocomotivesService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheLocomotives; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 电机车表; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheLocomotivesService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheMiningScheduleService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheMiningScheduleService.java new file mode 100644 index 0000000..8130d85 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheMiningScheduleService.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheMiningSchedule; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + *

+ * 存储大厂要矿时间及操作记录; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-15 + */ +public interface IDianjicheMiningScheduleService extends IService { + + List uploadsave(MultipartFile file); +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheMiningService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheMiningService.java new file mode 100644 index 0000000..b20f4fb --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheMiningService.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheMining; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + *

+ * 三个班实际完成量; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheMiningService extends IService { + + List uploadsave(MultipartFile file); +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheProductionTasks1Service.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheProductionTasks1Service.java new file mode 100644 index 0000000..dbac363 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheProductionTasks1Service.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheProductionTasks1; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 三班累计; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheProductionTasks1Service extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheProductionTasksService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheProductionTasksService.java new file mode 100644 index 0000000..62610f9 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheProductionTasksService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheProductionTasks; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 生产任务表,存储单台电机车的生产任务基础信息; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheProductionTasksService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheSingleLocomotiveTasksService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheSingleLocomotiveTasksService.java new file mode 100644 index 0000000..9036638 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheSingleLocomotiveTasksService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheSingleLocomotiveTasks; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 存储单台电机车的生产任务完成情况; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheSingleLocomotiveTasksService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheStationsService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheStationsService.java new file mode 100644 index 0000000..0da2a22 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheStationsService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheStations; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 存储所有作业站点信息; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheStationsService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheTimetableService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheTimetableService.java new file mode 100644 index 0000000..c99a8f1 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheTimetableService.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheTimetable; +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + *

+ * 电机车作业时间统计台帐; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheTimetableService extends IService { + + List uploadsave(MultipartFile file); +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDianjicheTransportreportService.java b/src/main/java/com/jdc/jdcproject/service/IDianjicheTransportreportService.java new file mode 100644 index 0000000..465dc8e --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDianjicheTransportreportService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DianjicheTransportreport; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 电机车综合运输报表的表头; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +public interface IDianjicheTransportreportService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheLocomotivesServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheLocomotivesServiceImpl.java new file mode 100644 index 0000000..2fa003f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheLocomotivesServiceImpl.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service.impl; + +import com.jdc.jdcproject.entity.DianjicheLocomotives; +import com.jdc.jdcproject.mapper.DianjicheLocomotivesMapper; +import com.jdc.jdcproject.service.IDianjicheLocomotivesService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 电机车表; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheLocomotivesServiceImpl extends ServiceImpl implements IDianjicheLocomotivesService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheMiningScheduleServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheMiningScheduleServiceImpl.java new file mode 100644 index 0000000..c2e071e --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheMiningScheduleServiceImpl.java @@ -0,0 +1,76 @@ +package com.jdc.jdcproject.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.jdc.jdcproject.entity.DianjicheMiningSchedule; +import com.jdc.jdcproject.entity.excel.DianjicheMiningScheduleExcel; +import com.jdc.jdcproject.mapper.DianjicheMiningScheduleMapper; +import com.jdc.jdcproject.service.IDianjicheMiningScheduleService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jdc.jdcproject.utils.EasyExcelListener; +import org.apache.velocity.runtime.directive.Foreach; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import static com.fasterxml.jackson.databind.type.LogicalType.Map; + +/** + *

+ * 存储大厂要矿时间及操作记录; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-15 + */ +@Service +public class DianjicheMiningScheduleServiceImpl extends ServiceImpl implements IDianjicheMiningScheduleService { + + @Override + public List uploadsave(MultipartFile file) { + EasyExcelListener listener = new EasyExcelListener(); + try (ExcelReader excelReader = EasyExcel.read(file.getInputStream()).build()) { + ReadSheet readSheet = + EasyExcel.readSheet(5).headRowNumber(3).head(DianjicheMiningScheduleExcel.class).registerReadListener(listener).build(); + excelReader.read(readSheet); + List datas = listener.getDatas(); + Map integerStringMap = (Map) datas.get(0); + String datestr = integerStringMap.get(0).replace("运矿时间",""); + SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd"); + List dianjicheMiningScheduleList = new ArrayList<>(); + for (int i = 2; i < 39; i++) { + DianjicheMiningSchedule dianjicheMiningSchedule = new DianjicheMiningSchedule(); + System.out.println(i+"--------------------------------------"+datas.get(i).getDate()); + if (datas.get(i).getDate().contains("合")){ + continue; + } + dianjicheMiningSchedule.setDate(format.parse(datestr+datas.get(i).getDate())); + dianjicheMiningSchedule.setShiftType(null); + dianjicheMiningSchedule.setDayShiftTime(datas.get(i).getDayRequestTime() == null ? null : LocalTime.parse(datas.get(i).getDayRequestTime(), DateTimeFormatter.ofPattern("H.mm"))); + dianjicheMiningSchedule.setDayDownTime(datas.get(i).getDayDownTime() == null ? null : LocalTime.parse(datas.get(i).getDayDownTime(), DateTimeFormatter.ofPattern("H.mm"))); + dianjicheMiningSchedule.setNightShiftTime(datas.get(i).getNightRequestTime() == null ? null : LocalTime.parse(datas.get(i).getNightRequestTime(), DateTimeFormatter.ofPattern("H.mm"))); + dianjicheMiningSchedule.setNightDownTime(datas.get(i).getNightDownTime() == null ? null : LocalTime.parse(datas.get(i).getNightDownTime(), DateTimeFormatter.ofPattern("H.mm"))); + dianjicheMiningSchedule.setDayTrainCount(datas.get(i).getDay11Count()); + dianjicheMiningSchedule.setNightTrainCount(datas.get(i).getNight11Count()); + dianjicheMiningSchedule.setAfter7(datas.get(i).getNightAfter7()); + dianjicheMiningSchedule.setAfter8(datas.get(i).getDayAfter8Return()); + System.out.println(dianjicheMiningSchedule.toString()); + dianjicheMiningScheduleList.add(dianjicheMiningSchedule); + } + return dianjicheMiningScheduleList; + } catch (IOException | ParseException e) { + throw new RuntimeException(e); + } + } +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheMiningServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheMiningServiceImpl.java new file mode 100644 index 0000000..67591ef --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheMiningServiceImpl.java @@ -0,0 +1,106 @@ +package com.jdc.jdcproject.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.jdc.jdcproject.entity.DianjicheMining; +import com.jdc.jdcproject.entity.DianjicheTimetable; +import com.jdc.jdcproject.mapper.DianjicheMiningMapper; +import com.jdc.jdcproject.service.IDianjicheMiningService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jdc.jdcproject.utils.EasyExcelListener; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 三个班实际完成量; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheMiningServiceImpl extends ServiceImpl implements IDianjicheMiningService { + + @Override + public List uploadsave(MultipartFile file) { + EasyExcelListener> listener = new EasyExcelListener>(); + List flatList = new ArrayList<>(); + try (ExcelReader excelReader = EasyExcel.read(file.getInputStream()).build()) { + ReadSheet readSheet = + EasyExcel.readSheet(2).headRowNumber(6).registerReadListener(listener).build(); + excelReader.read(readSheet); + List> datas = listener.getDatas(); + Map integerStringMap = datas.get(0); + String datestr = String.valueOf(integerStringMap.get(0)).replace("份运矿量统计表", ""); + SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd"); + List> dianjicheminings = new ArrayList<>(); + for (int i = 5; i < 45; i++) { + if (!datas.get(i).get(0).equals("上旬") && + !datas.get(i).get(0).equals("中旬") && + !datas.get(i).get(0).equals("下旬") && + !datas.get(i).get(0).equals("月计")) { + Date parse = format.parse(datestr + datas.get(i).get(0)); + dianjicheminings.add(dianjicheMiningList(datas.get(i), parse)); + } + } + + flatList = dianjicheminings.stream() + .filter(subList -> subList != null) // 过滤null子列表 + .flatMap(List::stream) // 扁平化流 + .collect(Collectors.toList()); + } catch (Exception e) { + throw new RuntimeException(e); + } + return flatList; + } + private static List dianjicheMiningList(Map row, Date parse){ + List dianjicheminings = new ArrayList<>(); + Set processedShifts = new HashSet<>(); + for (Map.Entry entry : row.entrySet()){ + if (10<=entry.getKey() && entry.getKey()<=11){ + if (!processedShifts.contains(0)){ + DianjicheMining dianjicheMining = new DianjicheMining(); + dianjicheMining.setShiftId("0"); + dianjicheMining.setActualVehicles((String) row.get(10) == null ? "0" : row.get(10).toString()); + dianjicheMining.setActualColumns((String) row.get(11) == null ? "0" : row.get(11).toString()); + dianjicheMining.setDate(parse); + dianjicheMining.setActualTons("60"); + dianjicheminings.add(dianjicheMining); + processedShifts.add(0); + } + } else if (12<=entry.getKey() && entry.getKey()<=13) { + if (!processedShifts.contains(1)){ + DianjicheMining dianjicheMining = new DianjicheMining(); + dianjicheMining.setShiftId("1"); + dianjicheMining.setActualVehicles((String) row.get(12) == null ? "0" : row.get(12).toString()); + dianjicheMining.setActualColumns((String) row.get(13) == null ? "0" : row.get(13).toString()); + dianjicheMining.setDate(parse); + dianjicheMining.setActualTons("60"); + dianjicheminings.add(dianjicheMining); + processedShifts.add(1); + } + }else if (14 <= entry.getKey() && entry.getKey() <= 15){ + if (!processedShifts.contains(2)){ + DianjicheMining dianjicheMining = new DianjicheMining(); + dianjicheMining.setShiftId("2"); + dianjicheMining.setActualVehicles((String) row.get(14) == null ? "0" : row.get(14).toString()); + dianjicheMining.setActualColumns((String) row.get(15) == null ? "0" : row.get(15).toString()); + dianjicheMining.setDate(parse); + dianjicheMining.setActualTons("60"); + dianjicheminings.add(dianjicheMining); + processedShifts.add(2); + } + } + } + + return dianjicheminings; + } +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheProductionTasks1ServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheProductionTasks1ServiceImpl.java new file mode 100644 index 0000000..5ef803d --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheProductionTasks1ServiceImpl.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service.impl; + +import com.jdc.jdcproject.entity.DianjicheProductionTasks1; +import com.jdc.jdcproject.mapper.DianjicheProductionTasks1Mapper; +import com.jdc.jdcproject.service.IDianjicheProductionTasks1Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 三班累计; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheProductionTasks1ServiceImpl extends ServiceImpl implements IDianjicheProductionTasks1Service { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheProductionTasksServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheProductionTasksServiceImpl.java new file mode 100644 index 0000000..bab29dd --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheProductionTasksServiceImpl.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service.impl; + +import com.jdc.jdcproject.entity.DianjicheProductionTasks; +import com.jdc.jdcproject.mapper.DianjicheProductionTasksMapper; +import com.jdc.jdcproject.service.IDianjicheProductionTasksService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 生产任务表,存储单台电机车的生产任务基础信息; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheProductionTasksServiceImpl extends ServiceImpl implements IDianjicheProductionTasksService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheSingleLocomotiveTasksServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheSingleLocomotiveTasksServiceImpl.java new file mode 100644 index 0000000..18be5b8 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheSingleLocomotiveTasksServiceImpl.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service.impl; + +import com.jdc.jdcproject.entity.DianjicheSingleLocomotiveTasks; +import com.jdc.jdcproject.mapper.DianjicheSingleLocomotiveTasksMapper; +import com.jdc.jdcproject.service.IDianjicheSingleLocomotiveTasksService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 存储单台电机车的生产任务完成情况; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheSingleLocomotiveTasksServiceImpl extends ServiceImpl implements IDianjicheSingleLocomotiveTasksService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheStationsServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheStationsServiceImpl.java new file mode 100644 index 0000000..b4a9de1 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheStationsServiceImpl.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service.impl; + +import com.jdc.jdcproject.entity.DianjicheStations; +import com.jdc.jdcproject.mapper.DianjicheStationsMapper; +import com.jdc.jdcproject.service.IDianjicheStationsService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 存储所有作业站点信息; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheStationsServiceImpl extends ServiceImpl implements IDianjicheStationsService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheTimetableServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheTimetableServiceImpl.java new file mode 100644 index 0000000..dec2ce2 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheTimetableServiceImpl.java @@ -0,0 +1,121 @@ +package com.jdc.jdcproject.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.jdc.jdcproject.entity.DianjicheTimetable; +import com.jdc.jdcproject.mapper.DianjicheTimetableMapper; +import com.jdc.jdcproject.service.IDianjicheTimetableService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jdc.jdcproject.utils.EasyExcelListener; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 电机车作业时间统计台帐; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheTimetableServiceImpl extends ServiceImpl implements IDianjicheTimetableService { + + + + private static Integer toInteger(Object obj) { + if (obj == null) return 0; + if (obj instanceof Number) return ((Number) obj).intValue(); + try { + return Integer.parseInt(obj.toString()); + } catch (NumberFormatException e) { + return 0; + } + } + + @Override + public List uploadsave(MultipartFile file) { + EasyExcelListener> listener = new EasyExcelListener>(); + List flatList = new ArrayList<>(); + try (ExcelReader excelReader = EasyExcel.read(file.getInputStream()).build()) { + ReadSheet readSheet = + EasyExcel.readSheet(4).headRowNumber(6).registerReadListener(listener).build(); + excelReader.read(readSheet); + List> datas = listener.getDatas(); + + Map integerStringMap = datas.get(0); + String datestr = String.valueOf(integerStringMap.get(0)).replace("电机车作业时间统计台帐", ""); + SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd"); + List> dianjicheTimetables = new ArrayList<>(); + + for (int i = 6; i < datas.size(); i++) { + if (!datas.get(i).get(0).equals("上旬") && + !datas.get(i).get(0).equals("中旬") && + !datas.get(i).get(0).equals("下旬") && + !datas.get(i).get(0).equals("月计")) { + Date parse = format.parse(datestr + datas.get(i).get(0)); + dianjicheTimetables.add(buildTimetable(datas.get(i),parse)); + } + } + flatList = dianjicheTimetables.stream() + .filter(subList -> subList != null) // 过滤null子列表 + .flatMap(List::stream) // 扁平化流 + .collect(Collectors.toList()); + } catch (Exception e) { + throw new RuntimeException(e); + } + return flatList; + + } + private static List buildTimetable(Map row,Date parse) { + List list = new ArrayList<>(); + Set processedShifts = new HashSet<>(); + for (Map.Entry entry : row.entrySet()) { + if (6 <= entry.getKey() && entry.getKey() <11) { + if (!processedShifts.contains(0)){ + DianjicheTimetable tt = new DianjicheTimetable(); + tt.setDate(parse); + tt.setShiftId(0); + tt.setUnits(toInteger(row.get(6))); + tt.setTotaltime(toInteger(row.get(7))); + tt.setProductiontime(toInteger(row.get(8))); + tt.setNonProductivetime(toInteger(row.get(9))); + list.add(tt); + processedShifts.add(0); + } + }else if (11 <= entry.getKey() && entry.getKey() < 16 ){ + if (!processedShifts.contains(1)){ + DianjicheTimetable tt = new DianjicheTimetable(); + tt.setDate(parse); + tt.setShiftId(1); + tt.setUnits(toInteger(row.get(11))); + tt.setTotaltime(toInteger(row.get(12))); + tt.setProductiontime(toInteger(row.get(13))); + tt.setNonProductivetime(toInteger(row.get(14))); + list.add(tt); + processedShifts.add(1); + } + }else if (16 <= entry.getKey() && entry.getKey() < 20){ + if (!processedShifts.contains(2)){ + DianjicheTimetable tt = new DianjicheTimetable(); + tt.setDate(parse); + tt.setShiftId(2); + tt.setUnits(toInteger(row.get(16))); + tt.setTotaltime(toInteger(row.get(17))); + tt.setProductiontime(toInteger(row.get(18))); + tt.setNonProductivetime(toInteger(row.get(19))); + list.add(tt); + processedShifts.add(2); + } + } + } + return list; + } +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DianjicheTransportreportServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheTransportreportServiceImpl.java new file mode 100644 index 0000000..89f82a4 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DianjicheTransportreportServiceImpl.java @@ -0,0 +1,20 @@ +package com.jdc.jdcproject.service.impl; + +import com.jdc.jdcproject.entity.DianjicheTransportreport; +import com.jdc.jdcproject.mapper.DianjicheTransportreportMapper; +import com.jdc.jdcproject.service.IDianjicheTransportreportService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 电机车综合运输报表的表头; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-06-14 + */ +@Service +public class DianjicheTransportreportServiceImpl extends ServiceImpl implements IDianjicheTransportreportService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/UsersServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/UsersServiceImpl.java index c16d1e1..a382350 100644 --- a/src/main/java/com/jdc/jdcproject/service/impl/UsersServiceImpl.java +++ b/src/main/java/com/jdc/jdcproject/service/impl/UsersServiceImpl.java @@ -55,7 +55,7 @@ public class UsersServiceImpl extends ServiceImpl implements } // 校验密码 - if (!MD5.encrypt(password).equals(users.getPassword())) { + if (!password.equals(users.getPassword())) { // if (passwprd.equals(users.getPassword())) { // 密码错误,增加错误次数 Integer errorCount = users.getErrlogincount() == null ? 0 : users.getErrlogincount(); diff --git a/src/main/java/com/jdc/jdcproject/utils/EasyExcelListener.java b/src/main/java/com/jdc/jdcproject/utils/EasyExcelListener.java new file mode 100644 index 0000000..fb392fb --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/utils/EasyExcelListener.java @@ -0,0 +1,62 @@ +package com.jdc.jdcproject.utils; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.excel.metadata.data.ReadCellData; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class EasyExcelListener extends AnalysisEventListener { + /** + * 自定义用于暂时存储data + * 可以通过实例获取该值 + */ + private List datas = new ArrayList<>(); + + /** + * 每解析一行都会回调invoke()方法 + * + * @param object 读取后的数据对象 + * @param context 内容 + */ + @Override + @SuppressWarnings("unchecked") + public void invoke(Object object, AnalysisContext context) { + T map = (T) object; + //数据存储到list,供批量处理,或后续自己业务逻辑处理。 + datas.add(map); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + //解析结束销毁不用的资源 + //注意不要调用datas.clear(),否则getDatas为null + System.out.println("所有数据读取完成"); + } + + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + datas.add((T) headMap); + } + + /** + * 返回数据 + * + * @return 返回读取的数据集合 + **/ + public List getDatas() { + return datas; + } + + /** + * 设置读取的数据集合 + * + * @param datas 设置读取的数据集合 + **/ + public void setDatas(List datas) { + this.datas = datas; + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 87e295d..d24d478 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,7 +3,7 @@ spring: name: jdcProject datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/kszy?serverTimezone=GMT%2B8 + url: jdbc:mysql://124.71.209.231:3306/kszy?serverTimezone=GMT%2B8 password: 11235813 username: root diff --git a/src/test/java/com/jdc/jdcproject/EasyexcelReader.java b/src/test/java/com/jdc/jdcproject/EasyexcelReader.java index 5f937c0..3433112 100644 --- a/src/test/java/com/jdc/jdcproject/EasyexcelReader.java +++ b/src/test/java/com/jdc/jdcproject/EasyexcelReader.java @@ -1,16 +1,187 @@ package com.jdc.jdcproject; import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.jdc.jdcproject.entity.DianjicheMining; +import com.jdc.jdcproject.entity.DianjicheMiningSchedule; +import com.jdc.jdcproject.entity.DianjicheTimetable; +import com.jdc.jdcproject.entity.excel.DianjicheMiningScheduleExcel; +import com.jdc.jdcproject.utils.EasyExcelListener; +import org.apache.poi.ss.formula.functions.T; + +import java.io.IOException; +import java.text.BreakIterator; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.*; +import java.util.stream.Collectors; public class EasyexcelReader { - public static void main(String[] args) { - String fileName = "D:\\ProgramFiles\\project\\JdcProject\\src\\test\\test.xlsx"; + /* public static void main(String[] args) { + String fileName = "D:\\study\\javaprojec\\JdcProject\\src\\test\\副本2025年4月份电机车运输综合报表.xlsx"; - EasyExcel.read(fileName, new ExcelListener(data->{ + EasyExcel.read(fileName, new ExcelListener()) + .headRowNumber(3) + .sheet(5) + .doRead(); + }*/ + public static void main(String[] args) throws ParseException { + String fileName = "D:\\study\\javaprojec\\JdcProject\\src\\test\\副本2025年4月份电机车运输综合报表.xlsx"; + EasyExcelListener> listener = new EasyExcelListener>(); + try (ExcelReader excelReader = EasyExcel.read(fileName).build()) { + ReadSheet readSheet = + EasyExcel.readSheet(2).headRowNumber(6).registerReadListener(listener).build(); + excelReader.read(readSheet); + List> datas = listener.getDatas(); + Map integerStringMap = datas.get(0); + String datestr = String.valueOf(integerStringMap.get(0)).replace("份运矿量统计表", ""); + SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd"); + List> dianjicheminings = new ArrayList<>(); + for (int i = 5; i < 45; i++) { + if (!datas.get(i).get(0).equals("上旬") && + !datas.get(i).get(0).equals("中旬") && + !datas.get(i).get(0).equals("下旬") && + !datas.get(i).get(0).equals("月计")) { + Date parse = format.parse(datestr + datas.get(i).get(0)); + dianjicheminings.add(dianjicheMiningList(datas.get(i), parse)); + } + } + + List flatList = dianjicheminings.stream() + .filter(subList -> subList != null) + .flatMap(List::stream) + .collect(Collectors.toList()); + System.out.println(flatList.size()); + for (int i = 0; i < flatList.size(); i++) { + System.out.println(flatList.get(i)); + } + + + /* List> dianjicheTimetables = new ArrayList<>(); + + for (int i = 6; i < datas.size(); i++) { + if (!datas.get(i).get(0).equals("上旬") && + !datas.get(i).get(0).equals("中旬") && + !datas.get(i).get(0).equals("下旬") && + !datas.get(i).get(0).equals("月计")) { + Date parse = format.parse(datestr + datas.get(i).get(0)); + dianjicheTimetables.add(buildTimetable(datas.get(i),parse)); + } + } + List flatList = dianjicheTimetables.stream() + .filter(subList -> subList != null) + .flatMap(List::stream) + .collect(Collectors.toList()); + for (int i = 0; i < flatList.size(); i++) { + System.out.println(flatList.get(i)); + }*/ + } - }))// 从第3行开始是数据 - .sheet() - .doRead(); } + + + private static List dianjicheMiningList(Map row,Date parse){ + List dianjicheminings = new ArrayList<>(); + Set processedShifts = new HashSet<>(); + for (Map.Entry entry : row.entrySet()){ + if (10<=entry.getKey() && entry.getKey()<=11){ + if (!processedShifts.contains(0)){ + DianjicheMining dianjicheMining = new DianjicheMining(); + dianjicheMining.setShiftId("0"); + dianjicheMining.setActualVehicles((String) row.get(10) == null ? "0" : row.get(10).toString()); + dianjicheMining.setActualColumns((String) row.get(11) == null ? "0" : row.get(11).toString()); + dianjicheMining.setDate(parse); + dianjicheMining.setActualTons("60"); + dianjicheminings.add(dianjicheMining); + processedShifts.add(0); + } + } else if (12<=entry.getKey() && entry.getKey()<=13) { + if (!processedShifts.contains(1)){ + DianjicheMining dianjicheMining = new DianjicheMining(); + dianjicheMining.setShiftId("1"); + dianjicheMining.setActualVehicles((String) row.get(12) == null ? "0" : row.get(12).toString()); + dianjicheMining.setActualColumns((String) row.get(13) == null ? "0" : row.get(13).toString()); + dianjicheMining.setDate(parse); + dianjicheMining.setActualTons("60"); + dianjicheminings.add(dianjicheMining); + processedShifts.add(1); + } + }else if (14 <= entry.getKey() && entry.getKey() <= 15){ + if (!processedShifts.contains(2)){ + DianjicheMining dianjicheMining = new DianjicheMining(); + dianjicheMining.setShiftId("2"); + dianjicheMining.setActualVehicles((String) row.get(14) == null ? "0" : row.get(14).toString()); + dianjicheMining.setActualColumns((String) row.get(15) == null ? "0" : row.get(15).toString()); + dianjicheMining.setDate(parse); + dianjicheMining.setActualTons("60"); + dianjicheminings.add(dianjicheMining); + processedShifts.add(2); + } + } + } + + return dianjicheminings; + } + private static List buildTimetable(Map row,Date parse) { + List list = new ArrayList<>(); + Set processedShifts = new HashSet<>(); + for (Map.Entry entry : row.entrySet()) { + if (6 <= entry.getKey() && entry.getKey() <11) { + if (!processedShifts.contains(0)){ + DianjicheTimetable tt = new DianjicheTimetable(); + tt.setDate(parse); + tt.setShiftId(0); + tt.setUnits(toInteger(row.get(6))); + tt.setTotaltime(toInteger(row.get(7))); + tt.setProductiontime(toInteger(row.get(8))); + tt.setNonProductivetime(toInteger(row.get(9))); + list.add(tt); + processedShifts.add(0); + } + }else if (11 <= entry.getKey() && entry.getKey() < 16 ){ + if (!processedShifts.contains(1)){ + DianjicheTimetable tt = new DianjicheTimetable(); + tt.setDate(parse); + tt.setShiftId(1); + tt.setUnits(toInteger(row.get(11))); + tt.setTotaltime(toInteger(row.get(12))); + tt.setProductiontime(toInteger(row.get(13))); + tt.setNonProductivetime(toInteger(row.get(14))); + list.add(tt); + processedShifts.add(1); + } + }else if (16 <= entry.getKey() && entry.getKey() < 20){ + if (!processedShifts.contains(2)){ + DianjicheTimetable tt = new DianjicheTimetable(); + tt.setDate(parse); + tt.setShiftId(2); + tt.setUnits(toInteger(row.get(16))); + tt.setTotaltime(toInteger(row.get(17))); + tt.setProductiontime(toInteger(row.get(18))); + tt.setNonProductivetime(toInteger(row.get(19))); + list.add(tt); + processedShifts.add(2); + } + } + } + return list; + } + + private static Integer toInteger(Object obj) { + if (obj == null) return 0; + if (obj instanceof Number) return ((Number) obj).intValue(); + try { + return Integer.parseInt(obj.toString()); + } catch (NumberFormatException e) { + return 0; + } + } + } diff --git a/src/test/java/com/jdc/jdcproject/ExcelListener.java b/src/test/java/com/jdc/jdcproject/ExcelListener.java index ae56f77..a97aed0 100644 --- a/src/test/java/com/jdc/jdcproject/ExcelListener.java +++ b/src/test/java/com/jdc/jdcproject/ExcelListener.java @@ -2,11 +2,16 @@ package com.jdc.jdcproject; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.excel.metadata.data.ReadCellData; + +import java.util.ArrayList; +import java.util.List; import java.util.Map; -public class ExcelListener extends AnalysisEventListener> { +public class ExcelListener extends AnalysisEventListener { - @Override + +/* @Override public void invoke(Map data, AnalysisContext context) { System.out.println("读取到数据:" + data); } @@ -19,5 +24,54 @@ public class ExcelListener extends AnalysisEventListener> { @Override public void doAfterAllAnalysed(AnalysisContext context) { System.out.println("所有数据读取完成"); + }*/ + /** + * 自定义用于暂时存储data + * 可以通过实例获取该值 + */ + private List datas = new ArrayList<>(); + + /** + * 每解析一行都会回调invoke()方法 + * + * @param object 读取后的数据对象 + * @param context 内容 + */ + @Override + @SuppressWarnings("unchecked") + public void invoke(Object object, AnalysisContext context) { + T map = (T) object; + //数据存储到list,供批量处理,或后续自己业务逻辑处理。 + datas.add(map); } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + //解析结束销毁不用的资源 + //注意不要调用datas.clear(),否则getDatas为null + System.out.println("所有数据读取完成"); + } + + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + datas.add((T) headMap); + } + /** + * 返回数据 + * + * @return 返回读取的数据集合 + **/ + public List getDatas() { + return datas; + } + + /** + * 设置读取的数据集合 + * + * @param datas 设置读取的数据集合 + **/ + public void setDatas(List datas) { + this.datas = datas; + } + } diff --git a/src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java b/src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java index f590a06..68f3156 100644 --- a/src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java +++ b/src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java @@ -14,7 +14,7 @@ public class MybatisPlusGenerator { @Test public void test() { - FastAutoGenerator.create("jdbc:mysql://localhost:3306/kszy?serverTimezone=GMT%2B8", "root", "11235813") + FastAutoGenerator.create("jdbc:mysql://124.71.209.231:3306/kszy?serverTimezone=GMT%2B8", "root", "11235813") .globalConfig(builder -> { builder.author("haoyanlu") // 设置作者 .enableSwagger() // 开启 swagger 模式 @@ -37,7 +37,8 @@ public class MybatisPlusGenerator { //.pathInfo(Collections.singletonMap(OutputFile.xml, System.getProperty("user.dir") + "/src/main/java")) // 设置mapperXml生成路径 ) .strategyConfig(builder -> - builder.addInclude("DiCeKe_MiningLoss","users","renyuanjiegou","renyuanjiegou_laowu","diceke_miningrecord","diceke_platearea","diceke_precipitation","diceke_shovel") // 设置需要生成的表名 + builder.addInclude("DianJiChe_mining_schedule") + //builder.addInclude("DianJiChe_Locomotives","DianJiChe_mining","DianJiChe_mining_schedule","DianJiChe_production_tasks","DianJiChe_production_tasks1","DianJiche_single_locomotive_tasks","DianJiChe_stations","DianJiChe_TimeTable","DianJiChe_TransportReport") // 设置需要生成的表名 ) .execute(); } diff --git a/src/test/~$副本2025年4月份电机车运输综合报表.xlsx b/src/test/~$副本2025年4月份电机车运输综合报表.xlsx deleted file mode 100644 index da8a2b1..0000000 Binary files a/src/test/~$副本2025年4月份电机车运输综合报表.xlsx and /dev/null differ diff --git a/src/test/副本2025年4月份电机车运输综合报表(已自动还原).xlsx b/src/test/副本2025年4月份电机车运输综合报表(已自动还原).xlsx new file mode 100644 index 0000000..ff1f521 Binary files /dev/null and b/src/test/副本2025年4月份电机车运输综合报表(已自动还原).xlsx differ diff --git a/src/test/副本2025年4月份电机车运输综合报表.xlsx b/src/test/副本2025年4月份电机车运输综合报表.xlsx index 9604515..946ca9c 100644 Binary files a/src/test/副本2025年4月份电机车运输综合报表.xlsx and b/src/test/副本2025年4月份电机车运输综合报表.xlsx differ