dianjicheexcel
This commit is contained in:
parent
8b5f078861
commit
61bdb66fe2
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车表; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheLocomotives")
|
||||
public class DianjicheLocomotivesController {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三个班实际完成量; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheMining")
|
||||
public class DianjicheMiningController {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储大厂要矿时间及操作记录; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-15
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheMiningSchedule")
|
||||
public class DianjicheMiningScheduleController {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三班累计; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheProductionTasks1")
|
||||
public class DianjicheProductionTasks1Controller {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产任务表,存储单台电机车的生产任务基础信息; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheProductionTasks")
|
||||
public class DianjicheProductionTasksController {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储单台电机车的生产任务完成情况; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheSingleLocomotiveTasks")
|
||||
public class DianjicheSingleLocomotiveTasksController {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储所有作业站点信息; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheStations")
|
||||
public class DianjicheStationsController {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车作业时间统计台帐; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheTimetable")
|
||||
public class DianjicheTimetableController {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车综合运输报表的表头; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dianjicheTransportreport")
|
||||
public class DianjicheTransportreportController {
|
||||
|
||||
}
|
||||
@ -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<DianjicheMiningSchedule> uploadsaveDianjicheMiningSchedule = dianjicheMiningScheduleService.uploadsave(file);
|
||||
List<DianjicheTimetable> uploadsaveDianjicheTimetable = dianjicheTimetableService.uploadsave(file);
|
||||
List<DianjicheMining> uploadsaveDianjicheMining = dianjicheMiningService.uploadsave(file);
|
||||
dianjicheMiningScheduleService.saveBatch(uploadsaveDianjicheMiningSchedule);
|
||||
dianjicheTimetableService.saveBatch(uploadsaveDianjicheTimetable);
|
||||
dianjicheMiningService.saveBatch(uploadsaveDianjicheMining);
|
||||
return Result.successResult();
|
||||
}
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车表;
|
||||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
100
src/main/java/com/jdc/jdcproject/entity/DianjicheMining.java
Normal file
100
src/main/java/com/jdc/jdcproject/entity/DianjicheMining.java
Normal file
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三个班实际完成量;
|
||||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储大厂要矿时间及操作记录;
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产任务表,存储单台电机车的生产任务基础信息;
|
||||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三班累计;
|
||||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储单台电机车的生产任务完成情况;
|
||||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储所有作业站点信息;
|
||||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车作业时间统计台帐;
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车综合运输报表的表头;
|
||||
* </p>
|
||||
*
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheLocomotives;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车表; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheLocomotivesMapper extends BaseMapper<DianjicheLocomotives> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheMining;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三个班实际完成量; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheMiningMapper extends BaseMapper<DianjicheMining> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheMiningSchedule;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储大厂要矿时间及操作记录; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-15
|
||||
*/
|
||||
public interface DianjicheMiningScheduleMapper extends BaseMapper<DianjicheMiningSchedule> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheProductionTasks1;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三班累计; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheProductionTasks1Mapper extends BaseMapper<DianjicheProductionTasks1> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheProductionTasks;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产任务表,存储单台电机车的生产任务基础信息; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheProductionTasksMapper extends BaseMapper<DianjicheProductionTasks> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheSingleLocomotiveTasks;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储单台电机车的生产任务完成情况; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheSingleLocomotiveTasksMapper extends BaseMapper<DianjicheSingleLocomotiveTasks> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheStations;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储所有作业站点信息; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheStationsMapper extends BaseMapper<DianjicheStations> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheTimetable;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车作业时间统计台帐; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheTimetableMapper extends BaseMapper<DianjicheTimetable> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheTransportreport;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车综合运输报表的表头; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface DianjicheTransportreportMapper extends BaseMapper<DianjicheTransportreport> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheLocomotivesMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheMiningMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheMiningScheduleMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheProductionTasks1Mapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheProductionTasksMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheSingleLocomotiveTasksMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheStationsMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheTimetableMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DianjicheTransportreportMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheLocomotives;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车表; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheLocomotivesService extends IService<DianjicheLocomotives> {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储大厂要矿时间及操作记录; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-15
|
||||
*/
|
||||
public interface IDianjicheMiningScheduleService extends IService<DianjicheMiningSchedule> {
|
||||
|
||||
List<DianjicheMiningSchedule> uploadsave(MultipartFile file);
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三个班实际完成量; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheMiningService extends IService<DianjicheMining> {
|
||||
|
||||
List<DianjicheMining> uploadsave(MultipartFile file);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheProductionTasks1;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三班累计; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheProductionTasks1Service extends IService<DianjicheProductionTasks1> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheProductionTasks;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产任务表,存储单台电机车的生产任务基础信息; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheProductionTasksService extends IService<DianjicheProductionTasks> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheSingleLocomotiveTasks;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储单台电机车的生产任务完成情况; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheSingleLocomotiveTasksService extends IService<DianjicheSingleLocomotiveTasks> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheStations;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储所有作业站点信息; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheStationsService extends IService<DianjicheStations> {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车作业时间统计台帐; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheTimetableService extends IService<DianjicheTimetable> {
|
||||
|
||||
List<DianjicheTimetable> uploadsave(MultipartFile file);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DianjicheTransportreport;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车综合运输报表的表头; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
public interface IDianjicheTransportreportService extends IService<DianjicheTransportreport> {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车表; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheLocomotivesServiceImpl extends ServiceImpl<DianjicheLocomotivesMapper, DianjicheLocomotives> implements IDianjicheLocomotivesService {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储大厂要矿时间及操作记录; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-15
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheMiningScheduleServiceImpl extends ServiceImpl<DianjicheMiningScheduleMapper, DianjicheMiningSchedule> implements IDianjicheMiningScheduleService {
|
||||
|
||||
@Override
|
||||
public List<DianjicheMiningSchedule> uploadsave(MultipartFile file) {
|
||||
EasyExcelListener<DianjicheMiningScheduleExcel> listener = new EasyExcelListener<DianjicheMiningScheduleExcel>();
|
||||
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<DianjicheMiningScheduleExcel> datas = listener.getDatas();
|
||||
Map<Integer, String> integerStringMap = (Map<Integer, String>) datas.get(0);
|
||||
String datestr = integerStringMap.get(0).replace("运矿时间","");
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd");
|
||||
List<DianjicheMiningSchedule> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三个班实际完成量; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheMiningServiceImpl extends ServiceImpl<DianjicheMiningMapper, DianjicheMining> implements IDianjicheMiningService {
|
||||
|
||||
@Override
|
||||
public List<DianjicheMining> uploadsave(MultipartFile file) {
|
||||
EasyExcelListener<Map<Integer, Object>> listener = new EasyExcelListener<Map<Integer, Object>>();
|
||||
List<DianjicheMining> 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<Map<Integer, Object>> datas = listener.getDatas();
|
||||
Map<Integer, Object> integerStringMap = datas.get(0);
|
||||
String datestr = String.valueOf(integerStringMap.get(0)).replace("份运矿量统计表", "");
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd");
|
||||
List<List<DianjicheMining>> 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<DianjicheMining> dianjicheMiningList(Map<Integer, Object> row, Date parse){
|
||||
List<DianjicheMining> dianjicheminings = new ArrayList<>();
|
||||
Set<Integer> processedShifts = new HashSet<>();
|
||||
for (Map.Entry<Integer, Object> 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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三班累计; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheProductionTasks1ServiceImpl extends ServiceImpl<DianjicheProductionTasks1Mapper, DianjicheProductionTasks1> implements IDianjicheProductionTasks1Service {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产任务表,存储单台电机车的生产任务基础信息; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheProductionTasksServiceImpl extends ServiceImpl<DianjicheProductionTasksMapper, DianjicheProductionTasks> implements IDianjicheProductionTasksService {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储单台电机车的生产任务完成情况; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheSingleLocomotiveTasksServiceImpl extends ServiceImpl<DianjicheSingleLocomotiveTasksMapper, DianjicheSingleLocomotiveTasks> implements IDianjicheSingleLocomotiveTasksService {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储所有作业站点信息; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheStationsServiceImpl extends ServiceImpl<DianjicheStationsMapper, DianjicheStations> implements IDianjicheStationsService {
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车作业时间统计台帐; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheTimetableServiceImpl extends ServiceImpl<DianjicheTimetableMapper, DianjicheTimetable> 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<DianjicheTimetable> uploadsave(MultipartFile file) {
|
||||
EasyExcelListener<Map<Integer, Object>> listener = new EasyExcelListener<Map<Integer, Object>>();
|
||||
List<DianjicheTimetable> 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<Map<Integer, Object>> datas = listener.getDatas();
|
||||
|
||||
Map<Integer, Object> integerStringMap = datas.get(0);
|
||||
String datestr = String.valueOf(integerStringMap.get(0)).replace("电机车作业时间统计台帐", "");
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd");
|
||||
List<List<DianjicheTimetable>> 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<DianjicheTimetable> buildTimetable(Map<Integer, Object> row,Date parse) {
|
||||
List<DianjicheTimetable> list = new ArrayList<>();
|
||||
Set<Integer> processedShifts = new HashSet<>();
|
||||
for (Map.Entry<Integer, Object> 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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电机车综合运输报表的表头; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-06-14
|
||||
*/
|
||||
@Service
|
||||
public class DianjicheTransportreportServiceImpl extends ServiceImpl<DianjicheTransportreportMapper, DianjicheTransportreport> implements IDianjicheTransportreportService {
|
||||
|
||||
}
|
||||
@ -55,7 +55,7 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> 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();
|
||||
|
||||
@ -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<T> extends AnalysisEventListener<T> {
|
||||
/**
|
||||
* 自定义用于暂时存储data
|
||||
* 可以通过实例获取该值
|
||||
*/
|
||||
private List<T> 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<Integer, String> headMap, AnalysisContext context) {
|
||||
datas.add((T) headMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*
|
||||
* @return 返回读取的数据集合
|
||||
**/
|
||||
public List<T> getDatas() {
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置读取的数据集合
|
||||
*
|
||||
* @param datas 设置读取的数据集合
|
||||
**/
|
||||
public void setDatas(List<T> datas) {
|
||||
this.datas = datas;
|
||||
}
|
||||
|
||||
}
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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<Map<Integer, Object>> listener = new EasyExcelListener<Map<Integer, Object>>();
|
||||
try (ExcelReader excelReader = EasyExcel.read(fileName).build()) {
|
||||
ReadSheet readSheet =
|
||||
EasyExcel.readSheet(2).headRowNumber(6).registerReadListener(listener).build();
|
||||
excelReader.read(readSheet);
|
||||
List<Map<Integer, Object>> datas = listener.getDatas();
|
||||
Map<Integer, Object> integerStringMap = datas.get(0);
|
||||
String datestr = String.valueOf(integerStringMap.get(0)).replace("份运矿量统计表", "");
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd");
|
||||
List<List<DianjicheMining>> 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<DianjicheMining> 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<List<DianjicheTimetable>> 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<DianjicheTimetable> 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<DianjicheMining> dianjicheMiningList(Map<Integer, Object> row,Date parse){
|
||||
List<DianjicheMining> dianjicheminings = new ArrayList<>();
|
||||
Set<Integer> processedShifts = new HashSet<>();
|
||||
for (Map.Entry<Integer, Object> 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<DianjicheTimetable> buildTimetable(Map<Integer, Object> row,Date parse) {
|
||||
List<DianjicheTimetable> list = new ArrayList<>();
|
||||
Set<Integer> processedShifts = new HashSet<>();
|
||||
for (Map.Entry<Integer, Object> 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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<Map<String, Object>> {
|
||||
public class ExcelListener<T> extends AnalysisEventListener<T> {
|
||||
|
||||
@Override
|
||||
|
||||
/* @Override
|
||||
public void invoke(Map<String,Object> data, AnalysisContext context) {
|
||||
System.out.println("读取到数据:" + data);
|
||||
}
|
||||
@ -19,5 +24,54 @@ public class ExcelListener extends AnalysisEventListener<Map<String, Object>> {
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext context) {
|
||||
System.out.println("所有数据读取完成");
|
||||
}*/
|
||||
/**
|
||||
* 自定义用于暂时存储data
|
||||
* 可以通过实例获取该值
|
||||
*/
|
||||
private List<T> 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<Integer, String> headMap, AnalysisContext context) {
|
||||
datas.add((T) headMap);
|
||||
}
|
||||
/**
|
||||
* 返回数据
|
||||
*
|
||||
* @return 返回读取的数据集合
|
||||
**/
|
||||
public List<T> getDatas() {
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置读取的数据集合
|
||||
*
|
||||
* @param datas 设置读取的数据集合
|
||||
**/
|
||||
public void setDatas(List<T> datas) {
|
||||
this.datas = datas;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
src/test/副本2025年4月份电机车运输综合报表(已自动还原).xlsx
Normal file
BIN
src/test/副本2025年4月份电机车运输综合报表(已自动还原).xlsx
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user