diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java index e58f745..933ecb9 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java @@ -39,9 +39,11 @@ public class HygieneRecordEntity extends BaseEntity { @ApiModelProperty("实际结束时间") private Date actualEndTime; + @Size(max = 20, message = "检查人字段长度不能超过20") @ApiModelProperty("检查人") private String checkUser; + @Size(max = 1000, message = "责任区id字段长度不能超过1000") @ApiModelProperty("责任区id") private String hygieneZoneIds; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java index 415e47b..5406110 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneZoneEntity.java @@ -7,6 +7,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import javax.validation.constraints.Size; + /** * @author liwen * @date 2024-01-02 @@ -20,15 +22,18 @@ public class HygieneZoneEntity extends BaseEntity { @ApiModelProperty("卫生自查计划id") private Long hygienePlanId; + @Size(max = 50, message = "责任区字段长度不能超过50") @ApiModelProperty("责任区") private String zone; + @Size(max = 20, message = "责任人字段长度不能超过20") @ApiModelProperty("责任人") private String principal; @ApiModelProperty("检查项") private String checkItem; + @Size(max = 255, message = "检查项分值字段长度不能超过255") @ApiModelProperty("检查项分值") private String checkItemScore; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java index b8728dc..ad42f8a 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainRecordEntity.java @@ -1,7 +1,5 @@ package com.hnac.hzims.safeproduct.entity; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -18,7 +16,6 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper = true) -@ExcelIgnoreUnannotated @TableName("hzims_train_record") @ApiModel(value = "培训记录实体类") public class TrainRecordEntity extends BaseEntity { @@ -28,34 +25,27 @@ public class TrainRecordEntity extends BaseEntity { @Size(max = 50, message = "名称字段长度不能超过50") @ApiModelProperty("培训记录名称") - @ExcelProperty(value = "培训记录名称", index = 1) private String trainRecordName; @Size(max = 50, message = "编码字段长度不能超过50") @ApiModelProperty("编码") - @ExcelProperty(value = "编码", index = 0) private String code; @Size(max = 5000, message = "培训学员字段长度超出限制范围") @ApiModelProperty("培训学员") - @ExcelProperty(value = "培训学员", index = 3) private String peopleName; @ApiModelProperty("培训内容") - @ExcelProperty(value = "培训内容", index = 2) private String content; @ApiModelProperty("实际培训开始时间") - @ExcelProperty(value = "实际开始时间", index = 5) private Date actualStartTime; @ApiModelProperty("实际培训结束时间") - @ExcelProperty(value = "实际结束时间", index = 6) private Date actualEndTime; @Size(max = 250, message = "培训评价字段长度不能超过250") @ApiModelProperty("培训评价") - @ExcelProperty(value = "培训评价", index = 4) private String command; @Size(max = 1000, message = "培训图片字段长度不能超过1000") diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java new file mode 100644 index 0000000..843244d --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java @@ -0,0 +1,31 @@ +package com.hnac.hzims.safeproduct.enums; + +/** + * 培训方式枚举类 + * + * @author liwen + * @date 2024-01-15 + */ +public enum TrainMethodEnum { + + ONLINE("ONLINE", "线上"), + OFFLINE("OFFLINE", "线下"), + MIXED("MIXED", "线上+线下"); + + private final String value; + + private final String desc; + + TrainMethodEnum(String value, String desc) { + this.value = value; + this.desc = desc; + } + + public String getValue() { + return value; + } + + public String getDesc() { + return desc; + } +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java new file mode 100644 index 0000000..87880ad --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java @@ -0,0 +1,52 @@ +package com.hnac.hzims.safeproduct.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author liwen + * @date 2024-01-15 + */ +@Data +@ApiModel(value = "会议记录表VO类") +public class ConferenceRecordDetailVO { + + @ApiModelProperty("会议实际开始时间") + private Date actualStartTime; + + @ApiModelProperty("会议实际结束时间") + private Date actualEndTime; + + @ApiModelProperty("单位") + private String unit; + + @ApiModelProperty("会议地点") + private String location; + + @ApiModelProperty("主持人") + private String host; + + @ApiModelProperty("会议方式") + private String conferenceMethod; + + @ApiModelProperty("会议主题") + private String theme; + + @ApiModelProperty("记录人") + private String recorder; + + @ApiModelProperty("参会人员") + private String peopleName; + + @ApiModelProperty("会议内容") + private String content; + + @ApiModelProperty("会议图片") + private String imgPath; + + @ApiModelProperty("会议附件") + private String filePath; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java similarity index 96% rename from hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalDetailVO.java rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java index bb7bd8e..86afcbe 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java @@ -12,7 +12,7 @@ import java.util.Date; */ @Data @ApiModel(value = "演练记录表VO类") -public class RehearsalDetailVO { +public class RehearsalRecordDetailVO { @ApiModelProperty("编码") private String code; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java new file mode 100644 index 0000000..ecf6b78 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java @@ -0,0 +1,55 @@ +package com.hnac.hzims.safeproduct.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author liwen + * @date 2024-01-15 + */ +@Data +@ApiModel(value = "培训记录表VO类") +public class TrainRecordDetailVO { + + @ApiModelProperty("编码") + private String code; + + @ApiModelProperty("实际培训开始时间") + private Date actualStartTime; + + @ApiModelProperty("实际培训结束时间") + private Date actualEndTime; + + @ApiModelProperty("单位") + private String unit; + + @ApiModelProperty("培训地点") + private String location; + + @ApiModelProperty("培训方式") + private String trainMethod; + + @ApiModelProperty("培训讲师") + private String teacher; + + @ApiModelProperty("培训课程") + private String lesson; + + @ApiModelProperty("培训学员") + private String peopleName; + + @ApiModelProperty("培训内容") + private String content; + + @ApiModelProperty("培训评价") + private String command; + + @ApiModelProperty("培训图片") + private String imgPath; + + @ApiModelProperty("培训附件") + private String filePath; +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java index 658d496..e977e2b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java @@ -254,6 +254,10 @@ public class CarController extends BladeController { } @GetMapping("/exportCarMilesData") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "year", value = "年份", dataType = "query", paramType = "string") + }) @ApiOperation(value = "导出年度里程数据") @ApiOperationSupport(order = 27) public void exportCarMilesData(@ApiIgnore @RequestParam Map param, Query query, HttpServletResponse response) { diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java index 2a09af6..8b1f328 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java @@ -7,6 +7,7 @@ import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.service.IConferencePlanService; import com.hnac.hzims.safeproduct.service.IConferenceRecordService; +import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -103,8 +104,8 @@ public class ConferenceController extends BladeController { @GetMapping("/recordDetail") @ApiOperation(value = "会议记录详情") @ApiOperationSupport(order = 9) - public R recordDetail(@RequestParam Long id) { - return R.data(conferenceRecordService.getById(id)); + public R recordDetail(@RequestParam Long id) { + return R.data(conferenceRecordService.getConferenceRecordDetailById(id)); } @GetMapping("/recordPage") @@ -130,4 +131,11 @@ public class ConferenceController extends BladeController { public void exportConferenceData(@ApiIgnore @RequestParam Map param, HttpServletResponse response) { conferencePlanService.exportConferenceData(param, response); } + + @GetMapping("/exportConferenceRecordData") + @ApiOperation(value = "会议记录表导出") + @ApiOperationSupport(order = 12) + public void exportConferenceRecordData(@RequestParam Long id, HttpServletResponse response) { + conferenceRecordService.exportConferenceRecordData(id, response); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java index 63bdafe..0a271f9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java @@ -131,11 +131,11 @@ public class HygieneController extends BladeController { return R.data(page); } - @GetMapping("/exportHygieneData") - @ApiOperation(value = "卫生自查数据导出") + @GetMapping("/exportHygieneRecordData") + @ApiOperation(value = "卫生自查记录表导出") @ApiOperationSupport(order = 12) - public void exportHygieneData(@RequestParam Long hygieneRecordId, HttpServletResponse response) { - hygieneRecordService.exportHygieneData(hygieneRecordId, response); + public void exportHygieneRecordData(@RequestParam Long id, HttpServletResponse response) { + hygieneRecordService.exportHygieneRecordData(id, response); } @GetMapping("/exportMonthData") diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index 60c96c9..afb6c70 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -7,7 +7,7 @@ import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; import com.hnac.hzims.safeproduct.service.IRehearsalPlanService; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; import io.swagger.annotations.Api; @@ -106,7 +106,7 @@ public class RehearsalController extends BladeController { @GetMapping("/rehearsalRecordDetail") @ApiOperation(value = "演练记录详情") @ApiOperationSupport(order = 9) - public R rehearsalRecordDetail(@RequestParam Long id) { + public R rehearsalRecordDetail(@RequestParam Long id) { return R.data(rehearsalRecordService.getRecordDetailVOById(id)); } @@ -153,7 +153,7 @@ public class RehearsalController extends BladeController { @GetMapping("/exportRecordDetailData") @ApiOperation(value = "演练记录表导出") @ApiOperationSupport(order = 14) - public void exportRecordDetailData(@RequestParam Long id, HttpServletResponse response) { - rehearsalRecordService.exportRecordDetailData(id, response); + public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) { + rehearsalRecordService.exportRehearsalRecordData(id, response); } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java index 8cf7a62..0cd49d3 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java @@ -15,6 +15,7 @@ import com.hnac.hzims.safeproduct.service.ITrainPlanService; import com.hnac.hzims.safeproduct.service.ITrainRecordService; import com.hnac.hzims.safeproduct.vo.TestScoreVO; import com.hnac.hzims.safeproduct.vo.TrainMonthVO; +import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -117,8 +118,8 @@ public class TrainController extends BladeController { @GetMapping("/trainRecordDetail") @ApiOperation(value = "培训记录详情") @ApiOperationSupport(order = 9) - public R trainRecordDetail(@RequestParam Long id) { - return R.data(trainRecordService.getById(id)); + public R trainRecordDetail(@RequestParam Long id) { + return R.data(trainRecordService.getTrainRecordDetailById(id)); } @GetMapping("/trainRecordPage") @@ -234,12 +235,9 @@ public class TrainController extends BladeController { } @GetMapping("/exportTrainRecordData") - @ApiImplicitParams({ - @ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string") - }) - @ApiOperation(value = "培训记录数据导出") + @ApiOperation(value = "培训记录表导出") @ApiOperationSupport(order = 23) - public void exportTrainRecordData(@ApiIgnore @RequestParam Map param, HttpServletResponse response) { - trainRecordService.exportTrainRecordData(param, response); + public void exportTrainRecordData(@RequestParam Long id, HttpServletResponse response) { + trainRecordService.exportTrainRecordData(id, response); } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java index 83ea0fa..26e40c5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/ConferenceJob.java @@ -1,4 +1,43 @@ package com.hnac.hzims.safeproduct.jobs; +import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; +import com.hnac.hzims.safeproduct.enums.ConferenceStatusEnum; +import com.hnac.hzims.safeproduct.service.IConferencePlanService; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; + +/** + * 会议管理模块定时任务 + * + * @author liwen + * @date 2024-01-15 + */ +@Component public class ConferenceJob { + + @Autowired + IConferencePlanService conferencePlanService; + + @XxlJob("autoChangeConferencePlanStatus") + public ReturnT autoChangeConferencePlanStatus(String param) { + // 获取时间范围 + Date current = DateUtil.now(); + Date before = DateUtil.minusDays(current, 1); + String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss"); + String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss"); + // 查询前一天的超时未完成会议计划 + List list = conferencePlanService.getWaitingConferencePlanInTimeRange(yesterday, today); + list.forEach(x -> { + x.setConferenceStatus(ConferenceStatusEnum.UNFINISHED.getValue()); + }); + // 将状态置为未完成 + boolean flag = conferencePlanService.updateBatchById(list); + return flag ? ReturnT.SUCCESS : ReturnT.FAIL; + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java index 745ae01..4a8aabf 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/HygieneJob.java @@ -1,4 +1,43 @@ package com.hnac.hzims.safeproduct.jobs; +import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; +import com.hnac.hzims.safeproduct.enums.TrainStatusEnum; +import com.hnac.hzims.safeproduct.service.IHygienePlanService; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; + +/** + * 卫生自查模块定时任务 + * + * @author liwen + * @date 2024-01-15 + */ +@Component public class HygieneJob { + + @Autowired + IHygienePlanService hygienePlanService; + + @XxlJob("autoChangeHygienePlanStatus") + public ReturnT autoChangeHygienePlanStatus(String param) { + // 获取时间范围 + Date current = DateUtil.now(); + Date before = DateUtil.minusDays(current, 1); + String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss"); + String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss"); + // 查询前一天的超时未完成卫生自查计划 + List list = hygienePlanService.getWaitingHygienePlanInTimeRange(yesterday, today); + list.forEach(x -> { + x.setHygienePlanStatus(TrainStatusEnum.UNFINISHED.getValue()); + }); + // 将状态置为未完成 + boolean flag = hygienePlanService.updateBatchById(list); + return flag ? ReturnT.SUCCESS : ReturnT.FAIL; + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java index 44ff7d8..d6eda46 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/RehearsalJob.java @@ -31,7 +31,7 @@ public class RehearsalJob { Date before = DateUtil.minusDays(current, 1); String today = DateUtil.format(current, "yyyy-mm-dd hh:MM:ss"); String yesterday = DateUtil.format(before, "yyyy-mm-dd hh:MM:ss"); - // 查询前一天的超时未完成演练记录 + // 查询前一天的超时未完成演练计划 List list = rehearsalPlanService.getWaitingRehearsalInTimeRange(yesterday, today); list.forEach(x -> { x.setRehearsalStatus(RehearsalStatusEnum.UNFINISHED.getValue()); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java index eed6c2c..85d3c62 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java @@ -2,6 +2,7 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; +import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; import org.apache.ibatis.annotations.Mapper; /** @@ -13,4 +14,10 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ConferenceRecordMapper extends BaseMapper { + /** + * 查询会议记录表详情 + * @param id 会议记录id + * @return 会议记录表VO类 + */ + ConferenceRecordDetailVO getConferenceRecordDetailById(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml index ccb0eac..1de030a 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml @@ -1,4 +1,16 @@ + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java index 9cbd708..9a55888 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java @@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import org.apache.ibatis.annotations.Mapper; /** @@ -19,5 +19,5 @@ public interface RehearsalRecordMapper extends BaseMapper * @param id 演练记录id * @return 演练记录表VO类 */ - RehearsalDetailVO getRecordDetailVOById(Long id); + RehearsalRecordDetailVO getRecordDetailVOById(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml index 4eb9ff8..eecddec 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml @@ -2,7 +2,7 @@ - SELECT t1.code, t1.actual_start_time, t1.actual_end_time, t2.unit, t2.location, t2.rehearsal_method, t2.commander, t2.subject, t1.people_name, t1.record, t1.img_path, t1.command, t1.file_path diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java index 2e170c9..a268688 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java @@ -3,6 +3,7 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; +import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -22,4 +23,11 @@ public interface TrainRecordMapper extends BaseMapper { * @return 培训记录名称列表 */ List getTrainRecordNameList(String trainPlanId); + + /** + * 查询培训记录表详情 + * @param id 培训记录id + * @return 培训记录表VO类 + */ + TrainRecordDetailVO getTrainRecordDetailById(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml index 01f1e58..e4f15af 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml @@ -15,4 +15,16 @@ ORDER BY create_time DESC + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferencePlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferencePlanService.java index 2c3581d..dc916b6 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferencePlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferencePlanService.java @@ -6,6 +6,7 @@ import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import org.springblade.core.mp.support.Query; import javax.servlet.http.HttpServletResponse; +import java.util.List; import java.util.Map; /** @@ -37,4 +38,12 @@ public interface IConferencePlanService extends IService { * @param response 响应类 */ void exportConferenceData(Map param, HttpServletResponse response); + + /** + * 查询时间范围内未开始的会议计划数据 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return 会议计划数据 + */ + List getWaitingConferencePlanInTimeRange(String startTime, String endTime); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java index b7b867d..a792243 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java @@ -2,6 +2,9 @@ package com.hnac.hzims.safeproduct.service; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; +import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; + +import javax.servlet.http.HttpServletResponse; /** * 会议记录服务类 @@ -24,4 +27,18 @@ public interface IConferenceRecordService extends IService { * 月度数据导出 */ void exportMonthData(Map param, Query query, HttpServletResponse response); + + /** + * 查询时间范围内未开始的卫生自查计划数据 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return 卫生自查计划数据 + */ + List getWaitingHygienePlanInTimeRange(String startTime, String endTime); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java index d717ad5..86d8637 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneRecordService.java @@ -57,9 +57,9 @@ public interface IHygieneRecordService extends IService { IPage recordPage(Map param, Query query); /** - * 卫生自查记录数据导出 - * @param hygieneRecordId 卫生自查记录id + * 卫生自查记录表导出 + * @param id 卫生自查记录id * @param response 响应类 */ - void exportHygieneData(Long hygieneRecordId, HttpServletResponse response); + void exportHygieneRecordData(Long id, HttpServletResponse response); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java index 8f5d5e2..83dec8b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java @@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.service; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import javax.servlet.http.HttpServletResponse; @@ -40,12 +40,12 @@ public interface IRehearsalRecordService extends IService * @param id 演练记录id * @param response 响应类 */ - void exportRecordDetailData(Long id, HttpServletResponse response); + void exportRehearsalRecordData(Long id, HttpServletResponse response); /** * 查询演练记录表详情 * @param id 演练记录id * @return 演练记录表VO类 */ - RehearsalDetailVO getRecordDetailVOById(Long id); + RehearsalRecordDetailVO getRecordDetailVOById(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java index bd89033..13d443a 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java @@ -3,10 +3,10 @@ package com.hnac.hzims.safeproduct.service; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; +import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import javax.servlet.http.HttpServletResponse; import java.util.List; -import java.util.Map; /** * 培训记录服务类 @@ -53,8 +53,15 @@ public interface ITrainRecordService extends IService { /** * 培训记录数据导出 - * @param param 入参 + * @param id 培训记录id * @param response 响应类 */ - void exportTrainRecordData(Map param, HttpServletResponse response); + void exportTrainRecordData(Long id, HttpServletResponse response); + + /** + * 查询培训记录表详情 + * @param id 培训记录id + * @return 培训记录表VO类 + */ + TrainRecordDetailVO getTrainRecordDetailById(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java index 08255fc..6a2dcf8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java @@ -147,6 +147,18 @@ public class ConferencePlanServiceImpl extends ServiceImpl getWaitingConferencePlanInTimeRange(String startTime, String endTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ConferencePlanEntity::getConferenceStatus, ConferenceStatusEnum.WAITING.getValue()) + .ge(ConferencePlanEntity::getScheduledEndTime, startTime) + .le(ConferencePlanEntity::getScheduledEndTime, endTime); + return this.list(queryWrapper); + } + + /** * 根据单位和计划时间查询会议记录 * @param unit 单位 * @param startTime 计划开始时间 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java index 7350c86..72f5f61 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java @@ -7,16 +7,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; +import com.hnac.hzims.safeproduct.enums.ConferenceMethodEnum; import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; import com.hnac.hzims.safeproduct.mapper.ConferencePlanMapper; import com.hnac.hzims.safeproduct.mapper.ConferenceRecordMapper; import com.hnac.hzims.safeproduct.service.IConferenceRecordService; import com.hnac.hzims.safeproduct.utils.BaseUtil; +import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -31,6 +36,9 @@ public class ConferenceRecordServiceImpl extends ServiceImpl params = BaseUtil.obj2Map(conferenceRecordDetailVO); + String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX; + String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX; + String pdfPath = savePath + "/会议记录表" + SafeProductConstant.PDF_SUFFIX; + BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response); + } + + /** + * 查询会议记录表详情 + */ + @Override + public ConferenceRecordDetailVO getConferenceRecordDetailById(Long id) { + return baseMapper.getConferenceRecordDetailById(id); + } + + /** * 查询是否存在同月编号 * @param currentMonth 当月 * @return 存在则返回上一编号,否则返回null diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java index 3292edd..4cf06fd 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java @@ -13,6 +13,7 @@ import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.dto.HygienePlanDTO; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; +import com.hnac.hzims.safeproduct.enums.HygieneStatusEnum; import com.hnac.hzims.safeproduct.mapper.HygienePlanMapper; import com.hnac.hzims.safeproduct.service.IHygienePlanService; import com.hnac.hzims.safeproduct.service.IHygieneRecordService; @@ -284,4 +285,16 @@ public class HygienePlanServiceImpl extends ServiceImpl getWaitingHygienePlanInTimeRange(String startTime, String endTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(HygienePlanEntity::getHygienePlanStatus, HygieneStatusEnum.WAITING.getValue()) + .ge(HygienePlanEntity::getScheduledEndTime, startTime) + .le(HygienePlanEntity::getScheduledEndTime, endTime); + return this.list(queryWrapper); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java index 2baeec5..051e0c7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java @@ -1,13 +1,7 @@ package com.hnac.hzims.safeproduct.service.impl; import cn.hutool.core.date.DatePattern; -import cn.hutool.core.date.DateUtil; -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.converters.longconverter.LongStringConverter; import com.alibaba.excel.util.CollectionUtils; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -17,7 +11,6 @@ import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; -import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; import com.hnac.hzims.safeproduct.mapper.HygienePlanMapper; import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper; @@ -27,18 +20,15 @@ import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; import com.hnac.hzims.safeproduct.vo.HygieneZoneDetailVO; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; -import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URLEncoder; import java.time.LocalDate; import java.time.ZoneId; import java.time.temporal.WeekFields; @@ -60,6 +50,9 @@ public class HygieneRecordServiceImpl extends ServiceImpl records = recordDetailVO.getCheckList(); - // 设置响应头 - // URLEncoder.encode防止中文乱码 - String fileName = URLEncoder.encode("卫生自查记录数据表", "UTF-8"); - response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("UTF-8"); - // ExcelWriter初始化 - ExcelWriter excelWriter = EasyExcel - .write(response.getOutputStream()) - .autoCloseStream(Boolean.TRUE) - .registerConverter(new LongStringConverter()) - .registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) - .build(); - Date endTime = recordDetailVO.getActualEndTime(); - String name = DateUtil.format(endTime, "yyyy年mm月") + "第" + recordDetailVO.getWeekNum() + "周卫生自查表"; - List head = new ArrayList<>(); - head.add(name); - WriteSheet writeSheet = EasyExcel.writerSheet(1, "卫生自查记录数据表") - .head(Collections.singletonList(head)) - .head(HygieneZoneDetailVO.class) - .build(); - excelWriter.write(records, writeSheet); - excelWriter.finish(); - } catch (Exception e) { - // 重置response - response.reset(); - response.setContentType("application/json"); - response.setCharacterEncoding("utf-8"); - throw new ServiceException("卫生自查记录数据导出异常: " + e.getMessage()); - } finally { - if (outputStream != null) { - try { - outputStream.close(); - } catch (IOException e) { - log.error("卫生自查记录数据导出输出流关闭异常: " + e.getMessage()); - } - } - } + public void exportHygieneRecordData(Long id, HttpServletResponse response) { + HygieneRecordDetailVO hygieneRecordDetailVO = this.getRecordDetail(id); + Map params = BaseUtil.obj2Map(hygieneRecordDetailVO); + String templateFile = "template/卫生自查记录表" + SafeProductConstant.DOCX_SUFFIX; + String wordPath = savePath + "/卫生自查记录表" + SafeProductConstant.DOCX_SUFFIX; + String pdfPath = savePath + "/卫生自查记录表" + SafeProductConstant.PDF_SUFFIX; + BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response); } /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java index f6ece0d..68dbb45 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java @@ -8,12 +8,13 @@ import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; +import com.hnac.hzims.safeproduct.enums.RehearsalMethodEnum; import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper; import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.utils.BaseUtil; -import com.hnac.hzims.safeproduct.vo.RehearsalDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -129,9 +130,18 @@ public class RehearsalRecordServiceImpl extends ServiceImpl params = BaseUtil.obj2Map(rehearsalDetailVO); + public void exportRehearsalRecordData(Long id, HttpServletResponse response) { + RehearsalRecordDetailVO rehearsalRecordDetailVO = this.getRecordDetailVOById(id); + // 演练方式字段 + String rehearsalMethod = rehearsalRecordDetailVO.getRehearsalMethod(); + if (rehearsalMethod.equals(RehearsalMethodEnum.MIXED.getValue())) { + rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.MIXED.getDesc()); + } else if (rehearsalMethod.equals(RehearsalMethodEnum.ONLINE.getValue())) { + rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.ONLINE.getDesc()); + } else { + rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.OFFLINE.getDesc()); + } + Map params = BaseUtil.obj2Map(rehearsalRecordDetailVO); String templateFile = "template/演练记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/演练记录表" + SafeProductConstant.DOCX_SUFFIX; String pdfPath = savePath + "/演练记录表" + SafeProductConstant.PDF_SUFFIX; @@ -142,7 +152,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl param, HttpServletResponse response) { - ServletOutputStream outputStream = null; - try { - outputStream = response.getOutputStream(); - String trainPlanId = String.valueOf(param.get("trainPlanId")); - List trainRecordList = getTrainRecordByTrainPlanId(trainPlanId); - // 设置响应头 - // URLEncoder.encode防止中文乱码 - String fileName = URLEncoder.encode("培训记录表", "UTF-8"); - response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("UTF-8"); - // ExcelWriter初始化 - ExcelWriter excelWriter = EasyExcel - .write(response.getOutputStream()) - .autoCloseStream(Boolean.TRUE) - .registerConverter(new LongStringConverter()) - .registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) - .build(); - WriteSheet writeSheet = EasyExcel.writerSheet(1, "培训记录表").head(TrainRecordEntity.class) - .build(); - excelWriter.write(trainRecordList, writeSheet); - excelWriter.finish(); - } catch (Exception e) { - // 重置response - response.reset(); - response.setContentType("application/json"); - response.setCharacterEncoding("utf-8"); - throw new ServiceException("培训记录数据导出异常: " + e.getMessage()); - } finally { - if (outputStream != null) { - try { - outputStream.close(); - } catch (IOException e) { - log.error("培训记录导出响应头输出流关闭异常: " + e.getMessage()); - } - } + public void exportTrainRecordData(Long id, HttpServletResponse response) { + TrainRecordDetailVO trainRecordDetailVO = this.getTrainRecordDetailById(id); + // 培训方式字段 + String trainMethod = trainRecordDetailVO.getTrainMethod(); + if (trainMethod.equals(TrainMethodEnum.MIXED.getValue())) { + trainRecordDetailVO.setTrainMethod(TrainMethodEnum.MIXED.getDesc()); + } else if (trainMethod.equals(TrainMethodEnum.ONLINE.getValue())) { + trainRecordDetailVO.setTrainMethod(TrainMethodEnum.ONLINE.getDesc()); + } else { + trainRecordDetailVO.setTrainMethod(TrainMethodEnum.OFFLINE.getDesc()); } + Map params = BaseUtil.obj2Map(trainRecordDetailVO); + String templateFile = "template/培训记录表" + SafeProductConstant.DOCX_SUFFIX; + String wordPath = savePath + "/培训记录表" + SafeProductConstant.DOCX_SUFFIX; + String pdfPath = savePath + "/培训记录表" + SafeProductConstant.PDF_SUFFIX; + BaseUtil.exportDocument(templateFile, params, wordPath, pdfPath, response); + } + + /** + * 查询培训记录表详情 + */ + @Override + public TrainRecordDetailVO getTrainRecordDetailById(Long id) { + return baseMapper.getTrainRecordDetailById(id); } /** @@ -202,18 +184,4 @@ public class TrainRecordServiceImpl extends ServiceImpl getTrainRecordByTrainPlanId(String trainPlanId) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if (!trainPlanId.equals("null")) { - queryWrapper.ge(TrainRecordEntity::getTrainPlanId, trainPlanId); - } - queryWrapper.orderByDesc(TrainRecordEntity::getCreateTime); - return this.list(queryWrapper); - } } diff --git a/hzims-service/safeproduct/src/main/resources/db/1.0.1.sql b/hzims-service/safeproduct/src/main/resources/db/1.0.1.sql index 404ba74..f63ae4c 100644 --- a/hzims-service/safeproduct/src/main/resources/db/1.0.1.sql +++ b/hzims-service/safeproduct/src/main/resources/db/1.0.1.sql @@ -9,345 +9,4 @@ create table document_management update_time datetime default current_timestamp on update current_timestamp comment '更新时间', is_deleted tinyint default 0 comment '逻辑删除' -) comment '文档管理'; - -CREATE TABLE `hzims_rehearsal_plan` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `unit` varchar(50) NOT NULL COMMENT '单位', - `subject` varchar(50) NOT NULL COMMENT '演练科目', - `scheduled_start_time` date NOT NULL COMMENT '演练计划开始时间', - `scheduled_end_time` date NOT NULL COMMENT '演练计划结束时间', - `location` varchar(255) NOT NULL COMMENT '演练地点', - `commander` varchar(10) NOT NULL COMMENT '总指挥', - `rehearsal_method` varchar(20) DEFAULT '' COMMENT '演练方式', - `rehearsal_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '演练状态', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练计划表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_rehearsal_record` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `rehearsal_plan_id` bigint(20) NOT NULL COMMENT '演练计划id', - `code` varchar(50) NOT NULL COMMENT '编号', - `people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数', - `people_name` varchar(5000) DEFAULT '' COMMENT '参演人员', - `actual_start_time` datetime NOT NULL COMMENT '演练实际开始时间', - `actual_end_time` datetime NOT NULL COMMENT '演练实际结束时间', - `record` varchar(250) NOT NULL DEFAULT '' COMMENT '演练记录', - `comment` varchar(250) NOT NULL DEFAULT '' COMMENT '演练评价', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片', - `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练附件', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_train_plan` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `unit` varchar(50) NOT NULL COMMENT '单位', - `scheduled_start_time` date NOT NULL COMMENT '计划培训开始时间', - `scheduled_end_time` date NOT NULL COMMENT '计划培训结束时间', - `lesson` varchar(255) NOT NULL COMMENT '培训课程', - `location` varchar(255) NOT NULL COMMENT '培训地点', - `train_method` varchar(20) DEFAULT '' COMMENT '培训方式', - `teacher` varchar(20) NOT NULL DEFAULT '' COMMENT '培训讲师', - `train_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '培训状态', - `is_test` int(2) NOT NULL DEFAULT '0' COMMENT '关联考试:0-否,1-是', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训计划表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_train_record` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id', - `train_record_name` varchar(50) NOT NULL DEFAULT '' COMMENT '培训记录名称', - `code` varchar(50) NOT NULL COMMENT '编号', - `people_name` varchar(5000) DEFAULT '' COMMENT '培训学员', - `content` mediumtext DEFAULT '' COMMENT '培训内容', - `actual_start_time` datetime DEFAULT NULL COMMENT '实际培训开始时间', - `actual_end_time` datetime DEFAULT NULL COMMENT '实际培训结束时间', - `command` varchar(250) DEFAULT NULL COMMENT '培训评价', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训图片', - `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训附件', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_test` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id', - `train_record_id` bigint(20) DEFAULT NULL COMMENT '培训记录id', - `test_name` varchar(50) NOT NULL DEFAULT '' COMMENT '考试记录名称', - `code` varchar(50) NOT NULL COMMENT '编号', - `unit` varchar(50) NOT NULL COMMENT '单位', - `test_start_time` datetime NOT NULL COMMENT '考试开始时间', - `test_end_time` datetime NOT NULL COMMENT '考试结束时间', - `location` varchar(255) NOT NULL COMMENT '考试地点', - `subject` varchar(50) NOT NULL COMMENT '考试科目', - `proctor` varchar(20) NOT NULL COMMENT '监考人', - `people_name` varchar(1000) DEFAULT '' COMMENT '参考人员', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试图片', - `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试附件', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_test_score` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `test_id` bigint(20) DEFAULT NULL COMMENT '考试记录id', - `name` varchar(50) NOT NULL COMMENT '姓名', - `score` int(10) DEFAULT NULL COMMENT '成绩', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试成绩表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_conference_plan` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `unit` varchar(50) NOT NULL COMMENT '单位', - `theme` varchar(50) NOT NULL COMMENT '会议主题', - `scheduled_start_time` date NOT NULL COMMENT '会议计划开始时间', - `scheduled_end_time` date NOT NULL COMMENT '会议计划结束时间', - `location` varchar(255) NOT NULL COMMENT '会议地点', - `host` varchar(10) NOT NULL COMMENT '主持人', - `conference_method` varchar(20) DEFAULT '' COMMENT '会议方式', - `conference_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '会议状态', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议计划表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_conference_record` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `conference_plan_id` bigint(20) NOT NULL COMMENT '会议计划id', - `code` varchar(50) NOT NULL COMMENT '编号', - `people_name` varchar(5000) DEFAULT '' COMMENT '参会人员', - `actual_start_time` datetime DEFAULT NULL COMMENT '会议实际开始时间', - `actual_end_time` datetime DEFAULT NULL COMMENT '会议实际结束时间', - `recorder` varchar(20) DEFAULT '' COMMENT '记录人', - `content` mediumtext DEFAULT '' DEFAULT '' COMMENT '会议内容', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议图片', - `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议附件', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_hygiene_plan` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `code` varchar(50) NOT NULL COMMENT '编码', - `standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值', - `scheduled_start_time` date NOT NULL COMMENT '计划开始时间', - `scheduled_end_time` date NOT NULL COMMENT '计划结束时间', - `hygiene_plan_status` varchar(50) NOT NULL DEFAULT 'WAITING' COMMENT '自查计划状态', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查计划表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_hygiene_zone` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id', - `unit` varchar(50) NOT NULL COMMENT '单位', - `zone` varchar(50) NOT NULL COMMENT '责任区', - `principal` varchar(20) NOT NULL COMMENT '责任人', - `check_item` mediumtext NOT NULL COMMENT '检查项', - `check_item_score` varchar(255) NOT NULL COMMENT '检查项分值', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查区域表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_hygiene_record` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id', - `unit` varchar(50) NOT NULL COMMENT '单位', - `code` varchar(50) NOT NULL COMMENT '编号', - `actual_start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间', - `actual_end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间', - `check_user` varchar(20) NOT NULL DEFAULT '' COMMENT '检查人', - `hygiene_zone_ids` varchar(1000) NOT NULL COMMENT '卫生自查区域id', - `check_result` mediumtext NOT NULL COMMENT '检查结果', - `comprehensive_score` int(10) NOT NULL COMMENT '综合评分', - `week_num` int(10) NOT NULL COMMENT '周数', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '检查图片', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_car` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `unit` varchar(50) NOT NULL COMMENT '单位', - `car_brand` varchar(50) NOT NULL COMMENT '品牌', - `car_type` varchar(50) NOT NULL COMMENT '型号', - `plate_number` varchar(50) NOT NULL COMMENT '车牌号', - `registration_time` date NOT NULL COMMENT '上牌时间', - `insurance_pay_last_time` date NOT NULL COMMENT '上期缴车保时间', - `insurance_pay_next_time` date NOT NULL COMMENT '下期缴车保时间', - `annual_inspection_time` date NOT NULL COMMENT '年检时间', - `annual_inspection_status` varchar(50) NOT NULL COMMENT '年检状态', - `insurance_status` varchar(50) NOT NULL COMMENT '保险状态', - `maintenance_last_time` date DEFAULT NULL COMMENT '上期保养时间', - `maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间', - `maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程', - `maintenance_status` varchar(50) DEFAULT NULL COMMENT '保养状态', - `manager` varchar(50) NOT NULL COMMENT '车辆管理人', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片', - `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆附件', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆台账表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_car_maintenance` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `car_id` bigint(20) NOT NULL COMMENT '车辆id', - `code` varchar(50) NOT NULL COMMENT '编号', - `maintenance_type` varchar(50) NOT NULL COMMENT '维保类型', - `content` mediumtext NOT NULL COMMENT '维保内容', - `start_time` date NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '维保开始时间', - `end_time` date NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '维保结束时间', - `location` varchar(255) NOT NULL COMMENT '维保地点', - `cost` bigint(20) NOT NULL COMMENT '维保费用', - `maintainer` varchar(20) NOT NULL COMMENT '维保人', - `manager_advice` varchar(500) DEFAULT NULL COMMENT '车辆管理人意见', - `maintenance_status` varchar(50) DEFAULT NULL COMMENT '维保状态', - `confirmation_time` datetime DEFAULT NULL COMMENT '确认时间', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保图片', - `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保附件', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆维保记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_car_used_record` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `car_id` bigint(20) NOT NULL COMMENT '车辆id', - `code` varchar(50) NOT NULL COMMENT '编号', - `unit` varchar(50) NOT NULL COMMENT '用车单位', - `used_location` varchar(255) NOT NULL COMMENT '使用地点', - `user` varchar(20) NOT NULL COMMENT '使用人', - `remark` mediumtext DEFAULT NULL COMMENT '使用详情', - `start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使用时间', - `end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '收车时间', - `start_miles` decimal(10, 2) NOT NULL COMMENT '出车公里数', - `end_miles` decimal(10, 2) NOT NULL COMMENT '收车公里数', - `miles` decimal(10, 2) NOT NULL COMMENT '行驶公里数', - `used_status` varchar(50) DEFAULT NULL COMMENT '用车状态', - `confirmation_time` datetime DEFAULT NULL COMMENT '确认时间', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '里程图片', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用车记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_car_check_record` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `car_id` bigint(20) NOT NULL COMMENT '车辆id', - `code` varchar(50) NOT NULL COMMENT '编号', - `checker` varchar(50) NOT NULL COMMENT '检查人', - `check_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '检查时间', - `conclusion` mediumtext NOT NULL COMMENT '检查结论', - `remark` varchar(500) NOT NULL DEFAULT '' COMMENT '填报备注', - `confirmation_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '确认时间', - `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '里程图片', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检记录表' ROW_FORMAT=Dynamic; - -CREATE TABLE `hzims_car_check_item` ( - `id` bigint(20) NOT NULL COMMENT '主键id', - `car_check_record_id` bigint(20) NOT NULL COMMENT '车检记录id', - `check_item` varchar(500) NOT NULL COMMENT '检查项目', - `check_content` mediumtext NOT NULL COMMENT '检查内容', - `check_result` mediumtext NOT NULL COMMENT '检查结果', - `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', - `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', - `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检项表' ROW_FORMAT=Dynamic; \ No newline at end of file +) comment '文档管理'; \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql b/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql index daedcb2..9f2813e 100644 --- a/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql +++ b/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql @@ -1 +1,339 @@ -alter table `hzims_safe_safety_tool` add column `advance_notice_days` tinyint(4) default 0 comment '安全工器具提前通知天数'; \ No newline at end of file +alter table `hzims_safe_safety_tool` add column `advance_notice_days` tinyint(4) default 0 comment '安全工器具提前通知天数'; + +CREATE TABLE `hzims_rehearsal_plan` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `unit` varchar(50) NOT NULL COMMENT '单位', + `subject` varchar(50) NOT NULL COMMENT '演练科目', + `scheduled_start_time` date NOT NULL COMMENT '演练计划开始时间', + `scheduled_end_time` date NOT NULL COMMENT '演练计划结束时间', + `location` varchar(255) NOT NULL COMMENT '演练地点', + `commander` varchar(10) NOT NULL COMMENT '总指挥', + `rehearsal_method` varchar(20) DEFAULT '' COMMENT '演练方式', + `rehearsal_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '演练状态', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练计划表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_rehearsal_record` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `rehearsal_plan_id` bigint(20) NOT NULL COMMENT '演练计划id', + `code` varchar(50) NOT NULL COMMENT '编号', + `people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数', + `people_name` varchar(5000) DEFAULT '' COMMENT '参演人员', + `actual_start_time` datetime NOT NULL COMMENT '演练实际开始时间', + `actual_end_time` datetime NOT NULL COMMENT '演练实际结束时间', + `record` varchar(250) NOT NULL DEFAULT '' COMMENT '演练记录', + `comment` varchar(250) NOT NULL DEFAULT '' COMMENT '演练评价', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片', + `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练附件', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='演练记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_train_plan` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `unit` varchar(50) NOT NULL COMMENT '单位', + `scheduled_start_time` date NOT NULL COMMENT '计划培训开始时间', + `scheduled_end_time` date NOT NULL COMMENT '计划培训结束时间', + `lesson` varchar(255) NOT NULL COMMENT '培训课程', + `location` varchar(255) NOT NULL COMMENT '培训地点', + `train_method` varchar(20) DEFAULT '' COMMENT '培训方式', + `teacher` varchar(20) NOT NULL DEFAULT '' COMMENT '培训讲师', + `train_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '培训状态', + `is_test` int(2) NOT NULL DEFAULT '0' COMMENT '关联考试:0-否,1-是', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训计划表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_train_record` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id', + `train_record_name` varchar(50) NOT NULL DEFAULT '' COMMENT '培训记录名称', + `code` varchar(50) NOT NULL COMMENT '编号', + `people_name` varchar(5000) DEFAULT '' COMMENT '培训学员', + `content` mediumtext DEFAULT '' COMMENT '培训内容', + `actual_start_time` datetime DEFAULT NULL COMMENT '实际培训开始时间', + `actual_end_time` datetime DEFAULT NULL COMMENT '实际培训结束时间', + `command` varchar(250) DEFAULT NULL COMMENT '培训评价', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训图片', + `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '培训附件', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='培训记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_test` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `train_plan_id` bigint(20) DEFAULT NULL COMMENT '培训计划id', + `train_record_id` bigint(20) DEFAULT NULL COMMENT '培训记录id', + `test_name` varchar(50) NOT NULL DEFAULT '' COMMENT '考试记录名称', + `code` varchar(50) NOT NULL COMMENT '编号', + `unit` varchar(50) NOT NULL COMMENT '单位', + `test_start_time` datetime NOT NULL COMMENT '考试开始时间', + `test_end_time` datetime NOT NULL COMMENT '考试结束时间', + `location` varchar(255) NOT NULL COMMENT '考试地点', + `subject` varchar(50) NOT NULL COMMENT '考试科目', + `proctor` varchar(20) NOT NULL COMMENT '监考人', + `people_name` varchar(1000) DEFAULT '' COMMENT '参考人员', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试图片', + `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '考试附件', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_test_score` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `test_id` bigint(20) DEFAULT NULL COMMENT '考试记录id', + `name` varchar(50) NOT NULL COMMENT '姓名', + `score` int(10) DEFAULT NULL COMMENT '成绩', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='考试成绩表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_conference_plan` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `unit` varchar(50) NOT NULL COMMENT '单位', + `theme` varchar(50) NOT NULL COMMENT '会议主题', + `scheduled_start_time` date NOT NULL COMMENT '会议计划开始时间', + `scheduled_end_time` date NOT NULL COMMENT '会议计划结束时间', + `location` varchar(255) NOT NULL COMMENT '会议地点', + `host` varchar(10) NOT NULL COMMENT '主持人', + `conference_method` varchar(20) DEFAULT '' COMMENT '会议方式', + `conference_status` varchar(20) NOT NULL DEFAULT 'WAITING' COMMENT '会议状态', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议计划表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_conference_record` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `conference_plan_id` bigint(20) NOT NULL COMMENT '会议计划id', + `code` varchar(50) NOT NULL COMMENT '编号', + `people_name` varchar(5000) DEFAULT '' COMMENT '参会人员', + `actual_start_time` datetime DEFAULT NULL COMMENT '会议实际开始时间', + `actual_end_time` datetime DEFAULT NULL COMMENT '会议实际结束时间', + `recorder` varchar(20) DEFAULT '' COMMENT '记录人', + `content` mediumtext DEFAULT '' DEFAULT '' COMMENT '会议内容', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议图片', + `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '会议附件', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='会议记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_hygiene_plan` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `code` varchar(50) NOT NULL COMMENT '编码', + `standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值', + `scheduled_start_time` date NOT NULL COMMENT '计划开始时间', + `scheduled_end_time` date NOT NULL COMMENT '计划结束时间', + `hygiene_plan_status` varchar(50) NOT NULL DEFAULT 'WAITING' COMMENT '自查计划状态', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查计划表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_hygiene_zone` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id', + `zone` varchar(50) NOT NULL COMMENT '责任区', + `principal` varchar(20) NOT NULL COMMENT '责任人', + `check_item` mediumtext NOT NULL COMMENT '检查项', + `check_item_score` varchar(255) NOT NULL COMMENT '检查项分值', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查区域表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_hygiene_record` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `hygiene_plan_id` bigint(20) NOT NULL COMMENT '卫生自查计划id', + `unit` varchar(50) NOT NULL COMMENT '单位', + `code` varchar(50) NOT NULL COMMENT '编号', + `actual_start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间', + `actual_end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间', + `check_user` varchar(20) NOT NULL DEFAULT '' COMMENT '检查人', + `hygiene_zone_ids` varchar(1000) NOT NULL COMMENT '卫生自查区域id', + `check_result` mediumtext NOT NULL COMMENT '检查结果', + `comprehensive_score` int(10) NOT NULL COMMENT '综合评分', + `week_num` int(10) NOT NULL COMMENT '周数', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '检查图片', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_car` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `unit` varchar(50) NOT NULL COMMENT '单位', + `car_brand` varchar(50) NOT NULL COMMENT '品牌', + `car_type` varchar(50) NOT NULL COMMENT '型号', + `plate_number` varchar(50) NOT NULL COMMENT '车牌号', + `registration_time` date NOT NULL COMMENT '上牌时间', + `insurance_pay_last_time` date NOT NULL COMMENT '上期缴车保时间', + `insurance_pay_next_time` date NOT NULL COMMENT '下期缴车保时间', + `annual_inspection_time` date NOT NULL COMMENT '年检时间', + `annual_inspection_status` varchar(50) NOT NULL COMMENT '年检状态', + `insurance_status` varchar(50) NOT NULL COMMENT '保险状态', + `maintenance_last_time` date DEFAULT NULL COMMENT '上期保养时间', + `maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间', + `maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程', + `maintenance_status` varchar(50) DEFAULT NULL COMMENT '保养状态', + `manager` varchar(50) NOT NULL COMMENT '车辆管理人', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片', + `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆附件', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆台账表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_car_maintenance` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `car_id` bigint(20) NOT NULL COMMENT '车辆id', + `code` varchar(50) NOT NULL COMMENT '编号', + `maintenance_type` varchar(50) NOT NULL COMMENT '维保类型', + `content` mediumtext NOT NULL COMMENT '维保内容', + `start_time` date NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '维保开始时间', + `end_time` date NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '维保结束时间', + `location` varchar(255) NOT NULL COMMENT '维保地点', + `cost` bigint(20) NOT NULL COMMENT '维保费用', + `maintainer` varchar(20) NOT NULL COMMENT '维保人', + `manager_advice` varchar(500) DEFAULT NULL COMMENT '车辆管理人意见', + `maintenance_status` varchar(50) DEFAULT NULL COMMENT '维保状态', + `confirmation_time` datetime DEFAULT NULL COMMENT '确认时间', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保图片', + `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '维保附件', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车辆维保记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_car_used_record` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `car_id` bigint(20) NOT NULL COMMENT '车辆id', + `code` varchar(50) NOT NULL COMMENT '编号', + `unit` varchar(50) NOT NULL COMMENT '用车单位', + `used_location` varchar(255) NOT NULL COMMENT '使用地点', + `user` varchar(20) NOT NULL COMMENT '使用人', + `remark` mediumtext DEFAULT NULL COMMENT '使用详情', + `start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使用时间', + `end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '收车时间', + `start_miles` decimal(10, 2) NOT NULL COMMENT '出车公里数', + `end_miles` decimal(10, 2) NOT NULL COMMENT '收车公里数', + `miles` decimal(10, 2) NOT NULL COMMENT '行驶公里数', + `used_status` varchar(50) DEFAULT NULL COMMENT '用车状态', + `confirmation_time` datetime DEFAULT NULL COMMENT '确认时间', + `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '里程图片', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用车记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_car_check_record` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `car_id` bigint(20) NOT NULL COMMENT '车辆id', + `code` varchar(50) NOT NULL COMMENT '编号', + `checker` varchar(50) NOT NULL COMMENT '检查人', + `check_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '检查时间', + `conclusion` mediumtext NOT NULL COMMENT '检查结论', + `remark` varchar(500) NOT NULL DEFAULT '' COMMENT '填报备注', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检记录表' ROW_FORMAT=Dynamic; + +CREATE TABLE `hzims_car_check_item` ( + `id` bigint(20) NOT NULL COMMENT '主键id', + `car_check_record_id` bigint(20) NOT NULL COMMENT '车检记录id', + `check_item` varchar(500) NOT NULL COMMENT '检查项目', + `check_content` mediumtext NOT NULL COMMENT '检查内容', + `check_result` mediumtext NOT NULL COMMENT '检查结果', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='车检项表' ROW_FORMAT=Dynamic; \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx b/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx new file mode 100644 index 0000000..aea2d33 Binary files /dev/null and b/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx b/hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx new file mode 100644 index 0000000..07d4aa6 Binary files /dev/null and b/hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx b/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx new file mode 100644 index 0000000..de921b1 Binary files /dev/null and b/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx b/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx index 07a0f0e..dc035bd 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx and b/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx b/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx index b1def9c..e56cfba 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx and b/hzims-service/safeproduct/src/main/resources/template/用车记录单.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx b/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx index 683e1ef..d4fb925 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx and b/hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx b/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx index 95d10d3..e85d514 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx and b/hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx differ