Browse Source

fix: 解决卫生自查、车辆管理、特种设备模块问题

zhongwei
liwen 1 year ago
parent
commit
7596ef709f
  1. 1
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java
  2. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java
  3. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java
  4. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java
  5. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java
  6. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
  7. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml
  8. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java
  9. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java
  10. 5
      hzims-service/safeproduct/src/main/resources/db/1.0.2.sql
  11. BIN
      hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx
  12. BIN
      hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx

1
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java

@ -88,7 +88,6 @@ public class CarEntity extends BaseEntity {
@ApiModelProperty("保养状态")
private String maintenanceStatus;
@NotNull
@ApiModelProperty("车辆管理人id")
private Long managerId;

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java

@ -58,6 +58,9 @@ public class DeviceEntity extends BaseEntity {
@ApiModelProperty("上次检验日期")
private Date inspectionLastTime;
@ApiModelProperty("设备管理人id")
private Long managerId;
@Size(max = 50, message = "设备管理人长度不能超过50")
@ApiModelProperty("设备管理人")
private String manager;

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java

@ -24,6 +24,9 @@ public class HygieneRecordDetailVO {
@ApiModelProperty("检查人")
private String checkUser;
@ApiModelProperty("检查时间")
private Date checkTime;
@ApiModelProperty("责任区id")
private String hygieneZoneIds;

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

@ -43,7 +43,7 @@ public class DeviceController extends BladeController {
@PostMapping("/update")
@ApiOperation(value = "修改")
@ApiOperationSupport(order = 2)
public R update(DeviceEntity deviceEntity) {
public R update(@Valid @RequestBody DeviceEntity deviceEntity) {
return R.status(deviceService.updateById(deviceEntity));
}
@ -63,8 +63,8 @@ public class DeviceController extends BladeController {
@GetMapping("/page")
@ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string")
@ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string")
})
@ApiOperation(value = "分页")
@ApiOperationSupport(order = 5)

10
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java

@ -12,6 +12,7 @@ import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.system.feign.ISysClient;
@ -29,6 +30,7 @@ import java.util.List;
* @author liwen
* @date 2024-01-11
*/
@Slf4j
@Component
public class CarJob {
@ -92,6 +94,10 @@ public class CarJob {
* @param carEntity 车辆实体类
*/
private void sendUninsuredMessage(CarEntity carEntity) {
if (carEntity.getManagerId() == null) {
log.error("系统无该用户信息,推送车保过期消息失败");
return;
}
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
String deptId = AuthUtil.getDeptId();
if (StringUtils.isNotEmpty(deptId)) {
@ -115,6 +121,10 @@ public class CarJob {
* @param carEntity 车辆实体类
*/
private void sendUnMaintainedMessage(CarEntity carEntity) {
if (carEntity.getManagerId() == null) {
log.error("系统无该用户信息,推送维保过期消息失败");
return;
}
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
String deptId = AuthUtil.getDeptId();
if (StringUtils.isNotEmpty(deptId)) {

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml

@ -5,7 +5,7 @@
<select id="getCarMaintenance" resultType="com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO">
SELECT
t1.code, t1.start_time, t1.end_time, t1.location, t1.cost, t1.maintainer, t1.content, t1.img_path, t1.file_path,
t1.manager_advice, t1.confirmation_time, t2.plate_number, t2.unit, t2.car_brand, t2.car_type, t1.maintanence_type
t1.manager_advice, t1.confirmation_time, t2.plate_number, t2.unit, t2.car_brand, t2.car_type, t1.maintenance_type
FROM
hzims_car_maintenance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml

@ -4,7 +4,7 @@
<select id="getRecordDetail" resultType="com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO">
SELECT
code, actual_end_time, check_user, hygiene_zone_ids, check_result,comprehensive_score, week_num,
img_path, hygiene_plan_id
img_path, hygiene_plan_id, check_time
FROM
hzims_hygiene_record
WHERE

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java

@ -99,7 +99,7 @@ public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper,
// 若确认成功,更新台账相关信息
if (update) {
CarEntity carEntity = carService.getById(carMaintenanceEntity.getCarId());
carEntity.setMaintenanceLastTime(carMaintenanceEntity.getConfirmationTime());
carEntity.setMaintenanceLastTime(carMaintenanceEntity.getEndTime());
carEntity.setMaintenanceNextTime(confirmationDTO.getMaintenanceNextTime());
carEntity.setMaintenanceMileage(confirmationDTO.getMaintenanceMileage());
carEntity.setMaintenanceStatus(CarMaintenanceStatusEnum.MAINTAINED.getValue());

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java

@ -10,9 +10,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.CarMilesYearDTO;
import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
import com.hnac.hzims.safeproduct.enums.CarMaintenanceStatusEnum;
import com.hnac.hzims.safeproduct.mapper.CarMapper;
import com.hnac.hzims.safeproduct.service.ICarCheckRecordService;
import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
@ -164,6 +163,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements
queryWrapper.lambda().eq(CarEntity::getPlateNumber, carEntity.getPlateNumber());
CarEntity car = this.getOne(queryWrapper);
if (car == null) {
carEntity.setMaintenanceStatus(CarMaintenanceStatusEnum.UNMAINTAINED.getValue());
return R.status(this.save(carEntity));
}
return R.fail("车牌号已存在");

5
hzims-service/safeproduct/src/main/resources/db/1.0.2.sql

@ -240,7 +240,7 @@ CREATE TABLE `hzims_car` (
`maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间',
`maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程',
`maintenance_status` varchar(50) DEFAULT NULL COMMENT '保养状态',
`manager_id` bigint(20) NOT NULL COMMENT '车辆管理人id',
`manager_id` bigint(20) DEFAULT NULL COMMENT '车辆管理人id',
`manager` varchar(50) NOT NULL COMMENT '车辆管理人',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片',
`file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆附件',
@ -345,7 +345,7 @@ CREATE TABLE `hzims_device` (
`name` varchar(50) NOT NULL COMMENT '设备名称',
`type` varchar(50) NOT NULL DEFAULT '' COMMENT '规格型号',
`code` varchar(50) NOT NULL COMMENT '编码',
`quality_cerfiticate_no` varchar(255) NOT NULL DEFAULT '' COMMENT '产品合格证号',
`quality_certificate_no` varchar(255) NOT NULL DEFAULT '' COMMENT '产品合格证号',
`production_time` date DEFAULT NULL COMMENT '生产日期',
`used_time` date DEFAULT NULL COMMENT '使用日期',
`used_location` varchar(255) NOT NULL DEFAULT '' COMMENT '使用地点',
@ -353,6 +353,7 @@ CREATE TABLE `hzims_device` (
`inspection_current_time` date DEFAULT NULL COMMENT '本次检验日期',
`inspection_next_time` date DEFAULT NULL COMMENT '下次检验日期',
`inspection_last_time` date DEFAULT NULL COMMENT '上次检验日期',
`manager_id` bigint(20) DEFAULT NULL COMMENT '设备管理人id',
`manager` varchar(50) NOT NULL DEFAULT '' COMMENT '设备管理人',
`device_status` varchar(20) NOT NULL DEFAULT 'NORMAL' COMMENT '设备状态',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',

BIN
hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx

Binary file not shown.
Loading…
Cancel
Save