Browse Source

update: 卫生自查、演练模块

zhongwei
liwen 11 months ago
parent
commit
f0310aa742
  1. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java
  2. 11
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java
  3. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java
  4. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java
  5. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  6. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml
  7. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java
  8. 20
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java
  9. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java
  10. 35
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  11. 126
      hzims-service/safeproduct/src/main/resources/db/1.0.1.sql

7
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygienePlanDTO.java

@ -21,8 +21,11 @@ import java.util.List;
@ApiModel(value = "卫生自查计划DTO类") @ApiModel(value = "卫生自查计划DTO类")
public class HygienePlanDTO extends BaseEntity { public class HygienePlanDTO extends BaseEntity {
@ApiModelProperty("编码") @ApiModelProperty("卫生自查计划id")
private String code; private Long id;
@ApiModelProperty("计划名称")
private String name;
@ApiModelProperty("标准总分值") @ApiModelProperty("标准总分值")
private Integer standardScore; private Integer standardScore;

11
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java

@ -9,7 +9,6 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
/** /**
@ -22,8 +21,8 @@ import java.util.Date;
@ApiModel(value = "卫生自查计划实体类") @ApiModel(value = "卫生自查计划实体类")
public class HygienePlanEntity extends BaseEntity { public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("编码") @ApiModelProperty("计划名称")
private String code; private String name;
@ApiModelProperty("标准总分值") @ApiModelProperty("标准总分值")
private Integer standardScore; private Integer standardScore;
@ -38,8 +37,6 @@ public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("计划结束时间") @ApiModelProperty("计划结束时间")
private Date scheduledEndTime; private Date scheduledEndTime;
@NotNull @ApiModelProperty("自查计划状态")
@Size(max = 20, message = "卫生自查状态字段长度不能超过20") private String hygienePlanStatus;
@ApiModelProperty("卫生自查状态")
private String hygieneStatus;
} }

4
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java

@ -45,6 +45,7 @@ public class HygieneRecordEntity extends BaseEntity {
@ApiModelProperty("责任区id") @ApiModelProperty("责任区id")
private String hygieneZoneIds; private String hygieneZoneIds;
@NotNull
@ApiModelProperty("检查结果") @ApiModelProperty("检查结果")
private String checkResult; private String checkResult;
@ -58,4 +59,7 @@ public class HygieneRecordEntity extends BaseEntity {
@Size(max = 1000, message = "检查图片字段长度不能超过1000") @Size(max = 1000, message = "检查图片字段长度不能超过1000")
@ApiModelProperty("检查图片") @ApiModelProperty("检查图片")
private String imgPath; private String imgPath;
@ApiModelProperty("自查记录状态")
private String hygieneRecordStatus;
} }

4
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalRecordEntity.java

@ -9,6 +9,7 @@ import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
@ -38,12 +39,15 @@ public class RehearsalRecordEntity extends BaseEntity {
@ApiModelProperty("参演人员") @ApiModelProperty("参演人员")
private String peopleName; private String peopleName;
@NotNull
@ApiModelProperty("演练实际开始时间") @ApiModelProperty("演练实际开始时间")
private Date actualStartTime; private Date actualStartTime;
@NotNull
@ApiModelProperty("演练实际结束时间") @ApiModelProperty("演练实际结束时间")
private Date actualEndTime; private Date actualEndTime;
@NotNull
@Size(max = 250, message = "演练记录字段长度不能超过250") @Size(max = 250, message = "演练记录字段长度不能超过250")
@ApiModelProperty("演练记录") @ApiModelProperty("演练记录")
private String record; private String record;

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java

@ -148,4 +148,11 @@ public class RehearsalController extends BladeController {
public void exportRehearsalData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) { public void exportRehearsalData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
rehearsalPlanService.exportRehearsalPlanData(param, response); rehearsalPlanService.exportRehearsalPlanData(param, response);
} }
@GetMapping("/exportRecordDetailData")
@ApiOperation(value = "演练记录表导出")
@ApiOperationSupport(order = 14)
public void exportRecordDetailData(@RequestParam Long id) {
rehearsalRecordService.exportRecordDetailData(id);
}
} }

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml

@ -22,11 +22,11 @@
SELECT SELECT
unit, count(1) as finished_task_num unit, count(1) as finished_task_num
FROM FROM
hzims_hygiene_plan hzims_hygiene_record
WHERE WHERE
is_deleted = 0 is_deleted = 0
AND scheduled_end_time like concat('%', #{month}, '%') AND scheduled_end_time like concat('%', #{month}, '%')
AND hygiene_status = 'FINISHED' AND hygiene_plan_status = 'FINISHED'
<if test="unit != null and unit != ''"> <if test="unit != null and unit != ''">
AND unit like concat('%', #{unit}, '%') AND unit like concat('%', #{unit}, '%')
</if> </if>

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java

@ -31,4 +31,10 @@ public interface IRehearsalRecordService extends IService<RehearsalRecordEntity>
* @return true-成功false-失败 * @return true-成功false-失败
*/ */
boolean removeRelativeRehearsalRecord(Long rehearsalPlanId); boolean removeRelativeRehearsalRecord(Long rehearsalPlanId);
/**
* 演练记录表导出
* @param id 演练记录id
*/
void exportRecordDetailData(Long id);
} }

20
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java

@ -95,14 +95,20 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public R savePlan(HygienePlanDTO hygienePlanDTO) { public R savePlan(HygienePlanDTO hygienePlanDTO) {
// 重名校验
HygienePlanEntity hygienePlan = getPlanByName(hygienePlanDTO.getName());
if (hygienePlan != null) {
return R.fail("名称不可重复");
}
// 新增卫生自查计划 // 新增卫生自查计划
HygienePlanEntity hygienePlanEntity = new HygienePlanEntity(); HygienePlanEntity hygienePlanEntity = new HygienePlanEntity();
BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity); BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity);
hygienePlanDTO.setStandardScore(100);
boolean savePlan = this.save(hygienePlanEntity); boolean savePlan = this.save(hygienePlanEntity);
List<HygieneZoneEntity> zoneList = hygienePlanDTO.getZoneList(); List<HygieneZoneEntity> zoneList = hygienePlanDTO.getZoneList();
// 若计划新增成功,新增关联责任区数据 // 若计划新增成功,新增关联责任区数据
if (savePlan) { if (savePlan) {
HygienePlanEntity hygienePlan = getPlanByCode(hygienePlanDTO.getCode()); hygienePlan = getPlanByName(hygienePlanDTO.getName());
for (HygieneZoneEntity zone : zoneList) { for (HygieneZoneEntity zone : zoneList) {
// 传计划id // 传计划id
if (hygienePlan != null) { if (hygienePlan != null) {
@ -126,6 +132,14 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
*/ */
@Override @Override
public R updatePlan(HygienePlanDTO hygienePlanDTO) { public R updatePlan(HygienePlanDTO hygienePlanDTO) {
// 重名校验
QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().ne(HygienePlanEntity::getId, hygienePlanDTO.getId());
queryWrapper.lambda().eq(HygienePlanEntity::getName, hygienePlanDTO.getName());
HygienePlanEntity hygienePlan = this.getOne(queryWrapper);
if (hygienePlan != null) {
return R.fail("名称不可重复");
}
// 修改卫生自查计划 // 修改卫生自查计划
HygienePlanEntity hygienePlanEntity = new HygienePlanEntity(); HygienePlanEntity hygienePlanEntity = new HygienePlanEntity();
BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity); BeanUtils.copyProperties(hygienePlanDTO, hygienePlanEntity);
@ -211,9 +225,9 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
* 根据编码查询卫生自查计划 * 根据编码查询卫生自查计划
*/ */
@Override @Override
public HygienePlanEntity getPlanByCode(String code) { public HygienePlanEntity getPlanByName(String name) {
QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<HygienePlanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(HygienePlanEntity::getCode, code); queryWrapper.lambda().eq(HygienePlanEntity::getName, name);
return this.getOne(queryWrapper); return this.getOne(queryWrapper);
} }

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java

@ -12,10 +12,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; 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.HygienePlanMapper;
import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper; import com.hnac.hzims.safeproduct.mapper.HygieneRecordMapper;
import com.hnac.hzims.safeproduct.service.IHygieneRecordService; import com.hnac.hzims.safeproduct.service.IHygieneRecordService;
@ -101,7 +104,13 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
return R.fail("评分不能大于标准总分值"); return R.fail("评分不能大于标准总分值");
} }
} }
return R.status(this.save(hygieneRecordEntity)); boolean save = this.save(hygieneRecordEntity);
// 若自查记录新增成功,修改自查计划状态为已完成
if (save) {
hygienePlanEntity.setHygienePlanStatus(RehearsalStatusEnum.FINISHED.getValue());
return R.status(hygienePlanMapper.updateById(hygienePlanEntity) == SafeProductConstant.SUCCESS);
}
return R.fail("新增失败");
} }
/** /**

35
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

@ -13,10 +13,17 @@ import com.hnac.hzims.safeproduct.mapper.RehearsalPlanMapper;
import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper; import com.hnac.hzims.safeproduct.mapper.RehearsalRecordMapper;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.ticket.constants.WorkTicketConstants;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -38,12 +45,13 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
*/ */
@Override @Override
public boolean saveRehearsalRecord(RehearsalRecordEntity rehearsalRecord) { public boolean saveRehearsalRecord(RehearsalRecordEntity rehearsalRecord) {
// 获取当月时间(yyyymm) // 获取当月时间
String currentMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()); String currentNormMonth = DatePattern.NORM_MONTH_FORMAT.format(new Date());
String currentSimpleMonth = DatePattern.SIMPLE_MONTH_FORMAT.format(new Date());
// 查询是否存在同月编号 // 查询是否存在同月编号
String lastCode = getLastCode(currentMonth); String lastCode = getLastCode(currentNormMonth);
// 若不存在,新增编号 // 若不存在,新增编号
String code = BaseUtil.getUniqueCode("YLJL", lastCode, currentMonth); String code = BaseUtil.getUniqueCode("YLJL", lastCode, currentSimpleMonth);
rehearsalRecord.setCode(code); rehearsalRecord.setCode(code);
// 参演人数 // 参演人数
String peopleName = rehearsalRecord.getPeopleName(); String peopleName = rehearsalRecord.getPeopleName();
@ -76,13 +84,12 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
} }
/** /**
* 查询是否存在同月编号 * 查询当月的上一编码
* @param currentMonth 当月 * @param currentMonth 当月(yyyy-mm)
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null
*/ */
private String getLastCode(String currentMonth) { private String getLastCode(String currentMonth) {
String month = currentMonth.substring(currentMonth.length() - 2); List<RehearsalRecordEntity> list = getRehearsalByMonth(currentMonth);
List<RehearsalRecordEntity> list = getRehearsalByMonth(month);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return null; return null;
} }
@ -118,4 +125,16 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
List<Long> ids = rehearsalRecordList.stream().map(RehearsalRecordEntity::getId).collect(Collectors.toList()); List<Long> ids = rehearsalRecordList.stream().map(RehearsalRecordEntity::getId).collect(Collectors.toList());
return this.removeByIds(ids); return this.removeByIds(ids);
} }
/**
* 演练记录表导出
*/
@Override
public void exportRecordDetailData(Long id) {
RehearsalRecordEntity rehearsalRecordEntity = this.getById(id);
String tempFileName = "演练记录表.xlsx";
Assert.isTrue(StringUtil.isNotBlank(tempFileName),() -> {
throw new ServiceException("未找到模板文件,预览失败!");
});
}
} }

126
hzims-service/safeproduct/src/main/resources/db/1.0.1.sql

@ -37,10 +37,10 @@ CREATE TABLE `hzims_rehearsal_record` (
`code` varchar(50) NOT NULL COMMENT '编号', `code` varchar(50) NOT NULL COMMENT '编号',
`people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数', `people_num` int(10) NOT NULL DEFAULT '0' COMMENT '参演人数',
`people_name` varchar(5000) DEFAULT '' COMMENT '参演人员', `people_name` varchar(5000) DEFAULT '' COMMENT '参演人员',
`actual_start_time` datetime DEFAULT NULL COMMENT '演练实际开始时间', `actual_start_time` datetime NOT NULL COMMENT '演练实际开始时间',
`actual_end_time` datetime DEFAULT NULL COMMENT '演练实际结束时间', `actual_end_time` datetime NOT NULL COMMENT '演练实际结束时间',
`record` varchar(250) DEFAULT '' COMMENT '演练记录', `record` varchar(250) NOT NULL DEFAULT '' COMMENT '演练记录',
`comment` varchar(250) DEFAULT '' DEFAULT '' COMMENT '演练评价', `comment` varchar(250) NOT NULL DEFAULT '' COMMENT '演练评价',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片', `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '演练图片',
`file_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_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
@ -183,6 +183,7 @@ CREATE TABLE `hzims_hygiene_plan` (
`standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值', `standard_score` int(10) NOT NULL DEFAULT '100' COMMENT '标准总分值',
`scheduled_start_time` date NOT NULL COMMENT '计划开始时间', `scheduled_start_time` date NOT NULL COMMENT '计划开始时间',
`scheduled_end_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_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` 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 '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
@ -232,3 +233,120 @@ CREATE TABLE `hzims_hygiene_record` (
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='卫生自查记录表' ROW_FORMAT=Dynamic; ) 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` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '维保开始时间',
`end_time` datetime 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;
Loading…
Cancel
Save