Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 10 months ago
parent
commit
0a8c737592
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java
  2. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java
  3. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  4. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java
  5. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java
  6. 6
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java
  7. 2
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java
  8. 11
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java
  9. 20
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  10. 7
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java
  11. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java
  12. 15
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java
  13. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java
  14. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java
  15. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java
  16. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java
  17. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java
  18. 70
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml
  19. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  20. BIN
      hzims-service/operational/src/main/resources/template/word/constructio_template.docx
  21. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarAnnualInspectionService.java
  22. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarInsuranceService.java
  23. 17
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarAnnualInspectionServiceImpl.java
  24. 19
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarInsuranceServiceImpl.java
  25. 32
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java
  26. 44
      hzims-service/safeproduct/src/main/resources/db/1.0.2.sql
  27. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java
  28. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java
  29. 29
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java
  30. 24
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java
  31. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/PdfUtils.java
  32. BIN
      hzims-service/ticket/src/main/resources/template/work/work_task_template.docx

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java

@ -139,4 +139,7 @@ public class OperAccessTaskEntity extends TenantEntity {
@ApiModelProperty(value = "创建用户名称") @ApiModelProperty(value = "创建用户名称")
private String updateUserName; private String updateUserName;
@ApiModelProperty(value = "创建用户名称")
private Long constructionId;
} }

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzims.operational.access.entity; package com.hnac.hzims.operational.access.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@ -80,4 +81,8 @@ public class OperConstructionEntity extends TenantEntity {
@ApiModelProperty(value = "审核人名称") @ApiModelProperty(value = "审核人名称")
private String reviewerName; private String reviewerName;
@ApiModelProperty(value = "检修Id")
@TableField(exist = false)
private Long taskId;
} }

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -73,6 +73,9 @@ public interface MainConstants {
// 开停机告警 // 开停机告警
String START_STOP_ALARM = "startStopAlarm"; String START_STOP_ALARM = "startStopAlarm";
// 数据通讯中断
String INTERRUPT_ALARM = "interruptAlarm";
// realId获取 // realId获取
String REAL_ID_DATA = "realIdData"; String REAL_ID_DATA = "realIdData";

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

@ -64,12 +64,10 @@ public class CarEntity extends BaseEntity {
@ApiModelProperty("下期年检时间") @ApiModelProperty("下期年检时间")
private Date nextAnnualInspectionTime; private Date nextAnnualInspectionTime;
@NotNull
@Size(max = 50, message = "年检状态长度不能超过50") @Size(max = 50, message = "年检状态长度不能超过50")
@ApiModelProperty("年检状态") @ApiModelProperty("年检状态")
private String annualInspectionStatus; private String annualInspectionStatus;
@NotNull
@Size(max = 50, message = "保险状态长度不能超过50") @Size(max = 50, message = "保险状态长度不能超过50")
@ApiModelProperty("保险状态") @ApiModelProperty("保险状态")
private String insuranceStatus; private String insuranceStatus;

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java

@ -33,11 +33,9 @@ public class SpecialDeviceInspectionEntity extends BaseEntity {
@ApiModelProperty("检验照片") @ApiModelProperty("检验照片")
private String imgPath; private String imgPath;
@TableField(exist = false)
@ApiModelProperty("下次检验时间") @ApiModelProperty("下次检验时间")
private Date nextInspectionTime; private Date nextInspectionTime;
@TableField(exist = false)
@ApiModelProperty("上次检验时间") @ApiModelProperty("上次检验时间")
private Date lastInspectionTime; private Date lastInspectionTime;
} }

6
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author ysj * @author ysj
@ -38,10 +39,7 @@ public class WorkTaskPreviewVO extends WorkTaskEntity {
private Integer groupCount; private Integer groupCount;
@ApiModelProperty(value = "工作地点") @ApiModelProperty(value = "工作地点")
private String location; private List<WorkTaskContentVO> contents;
@ApiModelProperty(value = "工作内容")
private String content;
@ApiModelProperty(value = "计划工作时间") @ApiModelProperty(value = "计划工作时间")
private String planTimeInterval; private String planTimeInterval;

2
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java

@ -18,7 +18,7 @@ public class CensParamVo {
@ApiModelProperty("结束时间: yyyy-MM-dd HH:mm:ss") @ApiModelProperty("结束时间: yyyy-MM-dd HH:mm:ss")
private String endTime; private String endTime;
@ApiModelProperty("状态 : 0-全部 1-完成") @ApiModelProperty("状态 : 0-未完成 1-完成")
private Integer state; private Integer state;
@ApiModelProperty("结束") @ApiModelProperty("结束")

11
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java

@ -12,6 +12,7 @@ import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.INTERRUPT_ALARM;
import static com.hnac.hzims.operational.main.constant.MainConstants.START_STOP_ALARM; import static com.hnac.hzims.operational.main.constant.MainConstants.START_STOP_ALARM;
@ -39,4 +40,14 @@ public class AlarmScheduledTask {
service.startStopAlarm(param); service.startStopAlarm(param);
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }
@XxlJob(INTERRUPT_ALARM)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> interruptAlarm(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.interruptAlarm(param);
return new ReturnT<>("SUCCESS");
}
} }

20
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -29,8 +29,10 @@ public class MonitorScheduledTask {
/** /**
* realId刷新 * realId刷新
*/ */
@XxlJob(REAL_ID_DATA) //@XxlJob(REAL_ID_DATA)
public ReturnT<String> loadRealId(String param) { @Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealId() {
String param = "";
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
@ -42,9 +44,10 @@ public class MonitorScheduledTask {
* 实时数据刷新 * 实时数据刷新
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(REAL_TIME_DATA) //@XxlJob(REAL_TIME_DATA)
//@Scheduled(cron = "0/40 * * * * ? ") @Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealData( String param) { public ReturnT<String> loadRealData() {
String param = "";
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
@ -56,9 +59,10 @@ public class MonitorScheduledTask {
* 集中监控数据处理 * 集中监控数据处理
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(CENTRALIZED_MONITORING) //@XxlJob(CENTRALIZED_MONITORING)
//@Scheduled(cron = "0/40 * * * * ? ") @Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadMonitoring(String param) { public ReturnT<String> loadMonitoring() {
String param = "";
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }

7
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java

@ -33,9 +33,10 @@ public class RealTargetScheduledTask {
* @return * @return
* @throws Exception * @throws Exception
*/ */
@XxlJob(LOAD_EM_INFO) //@XxlJob(LOAD_EM_INFO)
//@Scheduled(cron = "0/40 * * * * ? ") @Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadEmInfo(String param) { public ReturnT<String> loadEmInfo() {
String param = "";
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java

@ -16,4 +16,6 @@ public interface AlarmQueryService extends BaseService<AlarmEntity> {
List<String> bells(List<String> codes); List<String> bells(List<String> codes);
List<String> aborts(List<String> codes); List<String> aborts(List<String> codes);
void interruptAlarm(String param);
} }

15
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java

@ -178,14 +178,23 @@ public class AlarmQueryServiceImpl extends BaseServiceImpl<AlarmQueryMapper, Ala
if(CollectionUtil.isEmpty(alarms)){ if(CollectionUtil.isEmpty(alarms)){
return new ArrayList<>(); return new ArrayList<>();
} }
return alarms.stream().collect(Collectors.groupingBy(AlarmEntity::getStationId)).entrySet().stream().map(entry->{ return alarms.stream().collect(Collectors.groupingBy(AlarmEntity::getStationId)).values().stream().map(alarmEntities -> {
// 站点最近的一条数据中断、数据异常告警 // 站点最近的一条数据中断、数据异常告警
AlarmEntity alarm = entry.getValue().stream().sorted(Comparator.comparing(AlarmEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0); AlarmEntity alarm = alarmEntities.stream().sorted(Comparator.comparing(AlarmEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
// 状态为中断 // 状态为中断
if(alarm.getAlarmStatus().equals(0)){ if (alarm.getAlarmStatus().equals(0)) {
return alarm.getStationId(); return alarm.getStationId();
} }
return ""; return "";
}).filter(StringUtil::isBlank).distinct().collect(Collectors.toList()); }).filter(StringUtil::isBlank).distinct().collect(Collectors.toList());
} }
/**
* 数据中断告警
* @param param
*/
@Override
public void interruptAlarm(String param) {
}
} }

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java

@ -862,7 +862,7 @@ public class ReportServiceImpl implements ReportService {
List<RunAlarmVo> alarms = this.hz3000Alarm(code,start,end); List<RunAlarmVo> alarms = this.hz3000Alarm(code,start,end);
// FIXME 设备实例:一级告警 // FIXME 设备实例:一级告警
// FDP智能预警 // FDP智能预警
// alarms.addAll(this.intelligentEarly(code,start,end)); alarms.addAll(this.intelligentEarly(code,start,end));
return JSONObject.toJSONString(alarms); return JSONObject.toJSONString(alarms);
} }
@ -904,7 +904,7 @@ public class ReportServiceImpl implements ReportService {
StbAnalysisDTO param = new StbAnalysisDTO(); StbAnalysisDTO param = new StbAnalysisDTO();
param.setStartTime(LocalDateTime.parse(start,DateUtil.DATETIME_FORMATTER)); param.setStartTime(LocalDateTime.parse(start,DateUtil.DATETIME_FORMATTER));
param.setEndTime(LocalDateTime.parse(end, DateUtil.DATETIME_FORMATTER)); param.setEndTime(LocalDateTime.parse(end, DateUtil.DATETIME_FORMATTER));
param.setStation(code); param.setStations(Collections.singletonList(code));
param.setPage(0); param.setPage(0);
param.setPageSize(100000); param.setPageSize(100000);
Result<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param); Result<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param);

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java

@ -5,31 +5,22 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.access.dto.AccessPlanV4DTO;
import com.hnac.hzims.operational.access.dto.OperAccessPlanDTO;
import com.hnac.hzims.operational.access.dto.OperAccessPlanFlowDTO;
import com.hnac.hzims.operational.access.dto.OperAccessPlanListDTO;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity; import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import com.hnac.hzims.operational.access.service.AccessPlanV4Service;
import com.hnac.hzims.operational.access.service.ConstructionService; import com.hnac.hzims.operational.access.service.ConstructionService;
import com.hnac.hzims.operational.access.vo.ConstructionVo; import com.hnac.hzims.operational.access.vo.ConstructionVo;
import com.hnac.hzims.operational.access.vo.OperAccessPlanVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date;
/** /**
@ -48,9 +39,7 @@ public class ConstructionController extends BladeController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "新增") @ApiOperation(value = "新增")
public R save(@RequestBody OperConstructionEntity entity) { public R save(@RequestBody OperConstructionEntity entity) {
entity.setCode("SGRZ" + DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME_MINI)); return R.status(service.accessSave(entity));
entity.setConstructionTime(entity.getOverhaulTime());
return R.status(service.save(entity));
} }
@PostMapping("/remove") @PostMapping("/remove")
@ -60,15 +49,22 @@ public class ConstructionController extends BladeController {
return R.status(service.deleteLogic(Func.toLongList(ids))); return R.status(service.deleteLogic(Func.toLongList(ids)));
} }
@PostMapping("/update") @GetMapping("/detail")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "详情查询")
public R detail(@ApiParam(value = "主键Id", required = true) @RequestParam Long id) {
return R.data(service.getById(id));
}
@PostMapping("/update")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "修改") @ApiOperation(value = "修改")
public R update(@Valid @RequestBody OperConstructionEntity entity) { public R update(@Valid @RequestBody OperConstructionEntity entity) {
return R.status(service.updateById(entity)); return R.status(service.updateById(entity));
} }
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 5)
@OperationAnnotation(moduleName = "施工日志",title = "施工日志",operatorType = OperatorType.MOBILE,businessType = @OperationAnnotation(moduleName = "施工日志",title = "施工日志",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE, BusinessType.GENCODE,
action = "分页查询施工日志") action = "分页查询施工日志")
@ -78,7 +74,7 @@ public class ConstructionController extends BladeController {
} }
@GetMapping("/preview") @GetMapping("/preview")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 6)
@ApiOperation(value = "检修施工日志预览", notes = "检修施工日志预览") @ApiOperation(value = "检修施工日志预览", notes = "检修施工日志预览")
public void preview(@RequestParam @ApiParam("检修施工记录Id") @NotNull @Valid Long id) { public void preview(@RequestParam @ApiParam("检修施工记录Id") @NotNull @Valid Long id) {
service.preview(id); service.preview(id);

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java

@ -12,6 +12,7 @@ import org.springblade.core.tool.api.R;
*/ */
public interface ConstructionService extends BaseService<OperConstructionEntity> { public interface ConstructionService extends BaseService<OperConstructionEntity> {
boolean accessSave(OperConstructionEntity entity);
IPage<ConstructionVo> pageCondition(IPage<OperConstructionEntity> page, ConstructionVo construction); IPage<ConstructionVo> pageCondition(IPage<OperConstructionEntity> page, ConstructionVo construction);

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java

@ -4,12 +4,14 @@ import cn.afterturn.easypoi.entity.ImageEntity;
import cn.afterturn.easypoi.word.WordExportUtil; import cn.afterturn.easypoi.word.WordExportUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.core.toolkit.Wrappers;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.entity.OperConstructionEntity; import com.hnac.hzims.operational.access.entity.OperConstructionEntity;
import com.hnac.hzims.operational.access.mapper.ConstructionMapper; import com.hnac.hzims.operational.access.mapper.ConstructionMapper;
import com.hnac.hzims.operational.access.service.ConstructionService; import com.hnac.hzims.operational.access.service.ConstructionService;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.access.vo.ConstructionVo; import com.hnac.hzims.operational.access.vo.ConstructionVo;
import com.hnac.hzims.operational.util.PdfUtils; import com.hnac.hzims.operational.util.PdfUtils;
import com.hnac.hzims.operational.util.WordUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
@ -32,6 +34,7 @@ import java.io.*;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -43,6 +46,9 @@ import java.util.Map;
@RequiredArgsConstructor @RequiredArgsConstructor
public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper, OperConstructionEntity> implements ConstructionService { public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper, OperConstructionEntity> implements ConstructionService {
private final IOperAccessTaskService accessTaskService;
@Value("${hzims.operation.construction.save.img}") @Value("${hzims.operation.construction.save.img}")
private String constructionSaveImgPath; private String constructionSaveImgPath;
@ -55,6 +61,7 @@ public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper,
@Override @Override
public IPage<ConstructionVo> pageCondition(IPage<OperConstructionEntity> page, ConstructionVo construction) { public IPage<ConstructionVo> pageCondition(IPage<OperConstructionEntity> page, ConstructionVo construction) {
QueryWrapper wrapper = Condition.getQueryWrapper(construction); QueryWrapper wrapper = Condition.getQueryWrapper(construction);
wrapper.orderByDesc("CREATE_TIME");
if(StringUtil.isNotBlank(construction.getStartTime())){ if(StringUtil.isNotBlank(construction.getStartTime())){
wrapper.ge("CREATE_TIME",construction.getStartTime()); wrapper.ge("CREATE_TIME",construction.getStartTime());
} }
@ -105,6 +112,23 @@ public class ConstructionServiceImpl extends BaseServiceImpl<ConstructionMapper,
} }
} }
@Override
public boolean accessSave(OperConstructionEntity entity) {
entity.setCode("SGRZ" + DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME_MINI));
entity.setConstructionTime(entity.getOverhaulTime());
boolean saveFlag = this.save(entity);
if(!saveFlag){
throw new ServiceException("保存失败!");
}
if(ObjectUtil.isNotEmpty(entity.getTaskId())){
return accessTaskService.update(Wrappers.<OperAccessTaskEntity>lambdaUpdate()
.set(OperAccessTaskEntity::getConstructionId,entity.getId())
.eq(OperAccessTaskEntity::getId,entity.getTaskId())
);
}
return true;
}
/** /**
* 查询施工日志记录 * 查询施工日志记录
* @param id * @param id

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.java

@ -26,6 +26,7 @@ public interface OperDefectMapper extends UserDataScopeBaseMapper<OperDefectEnti
* @param month 格式'2021-01' * @param month 格式'2021-01'
* @return * @return
*/ */
@SqlParser(filter=true)
List<OperDefectStatisticsStatusDTO> getStatisticByMonth(@Param("month") String month, List<OperDefectStatisticsStatusDTO> getStatisticByMonth(@Param("month") String month,
@Param("createDept") List<String> createDept); @Param("createDept") List<String> createDept);

70
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml

@ -7,9 +7,14 @@
SELECT P.DEFECT_GRADING as defectLevel,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM from SELECT P.DEFECT_GRADING as defectLevel,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM from
hzims_oper_phenomenon P hzims_oper_phenomenon P
WHERE DATE_FORMAT(P.CREATE_TIME,'%Y-%m') = #{month} WHERE DATE_FORMAT(P.CREATE_TIME,'%Y-%m') = #{month}
<if test="createDept != null and createDept != ''"> <if test="createDept != null and createDept.size > 0">
AND P.CREATE_DEPT = #{createDept} AND P.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if> </if>
and P.DEFECT_GRADING IS NOT NULL
AND P.IS_DEFECT='1'
AND P.IS_DELETED = '0' AND P.IS_DELETED = '0'
GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS
ORDER BY P.DEFECT_GRADING ORDER BY P.DEFECT_GRADING
@ -20,37 +25,46 @@
SELECT P.DEFECT_GRADING as defectLevel,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM SELECT P.DEFECT_GRADING as defectLevel,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM
from hzims_oper_phenomenon P from hzims_oper_phenomenon P
WHERE P.CREATE_TIME BETWEEN #{firstMonth} AND #{endMonth} WHERE P.CREATE_TIME BETWEEN #{firstMonth} AND #{endMonth}
<if test="createDept != null and createDept != ''"> <if test="createDept != null and createDept.size > 0">
AND P.CREATE_DEPT = #{createDept} AND P.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if> </if>
AND P.IS_DEFECT='1'
AND P.IS_DELETED = 0 AND P.IS_DELETED = 0
and P.DEFECT_GRADING IS NOT NULL
GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS
ORDER BY P.DEFECT_GRADING ORDER BY P.DEFECT_GRADING
</select> </select>
<select id="getRepetStatistics" <select id="getRepetStatistics"
resultType="com.hnac.hzims.operational.defect.dto.OperDefectStatisticsCodeDTO"> resultType="com.hnac.hzims.operational.defect.dto.OperDefectStatisticsCodeDTO">
SELECT P.DEFECT_LEVEL,P.FAULT_CODE,COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D LEFT JOIN SELECT P.DEFECT_GRADING as defectLevel,P.FAULT_CODE,COUNT(P.ID) AS DEFECT_NUM from
hzims_oper_phenomenon P hzims_oper_phenomenon P
ON D.DEFECT_CODE = P.DEFECT_CODE
WHERE 1=1 WHERE 1=1
<if test="createDept != null and createDept.size > 0"> <if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in AND P.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=","> <foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
GROUP BY P.DEFECT_LEVEL,P.FAULT_CODE and P.DEFECT_GRADING IS NOT NULL
AND P.IS_DEFECT='1'
AND P.IS_DELETED = 0
GROUP BY P.DEFECT_GRADING,P.FAULT_CODE
</select> </select>
<select id="getManageIndex" resultType="java.lang.Integer"> <select id="getManageIndex" resultType="java.lang.Integer">
<!-- 本月及时消缺数 --> <!-- 本月及时消缺数 -->
(SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D LEFT JOIN hzims_oper_phenomenon P (SELECT COUNT(P.ID) AS DEFECT_NUM from hzims_oper_phenomenon P
ON D.DEFECT_CODE = P.DEFECT_CODE WHERE DATE_FORMAT(P.CREATE_TIME,'%Y-%m') = #{month}
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month} AND P.HANDLE_STATUS = 1
AND D.HANDLE_STATUS = 1 AND P.IS_DEFECT='1'
AND D.ACT_END_TIME &lt;= P.PLAN_END_TIME AND P.IS_DELETED = 0
and P.DEFECT_GRADING IS NOT NULL
AND P.ACT_END_TIME &lt;= P.PLAN_END_TIME
<if test="createDept != null and createDept.size > 0"> <if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in AND P.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=","> <foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
@ -59,11 +73,14 @@
UNION ALL UNION ALL
<!-- 本月总消缺数 --> <!-- 本月总消缺数 -->
( (
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_phenomenon D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month} WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
AND D.HANDLE_STATUS = 1 AND D.HANDLE_STATUS = 1
AND D.IS_DEFECT='1'
AND D.IS_DELETED = 0
and D.DEFECT_GRADING IS NOT NULL
<if test="createDept != null and createDept.size > 0"> <if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in AND D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=","> <foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
@ -72,11 +89,14 @@
UNION ALL UNION ALL
<!-- 本月遗留缺陷数 --> <!-- 本月遗留缺陷数 -->
( (
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_phenomenon D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month} WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
AND D.HANDLE_STATUS = 0 AND D.HANDLE_STATUS = 0
AND D.IS_DELETED = 0
AND D.IS_DEFECT='1'
and D.DEFECT_GRADING IS NOT NULL
<if test="createDept != null and createDept.size > 0"> <if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in AND D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=","> <foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
@ -85,11 +105,14 @@
UNION ALL UNION ALL
<!-- 历史遗留缺陷数 --> <!-- 历史遗留缺陷数 -->
( (
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_phenomenon D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') &lt; CONCAT(#{month}, '-01') WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') &lt; CONCAT(#{month}, '-01')
AND D.HANDLE_STATUS = 0 AND D.HANDLE_STATUS = 0
AND D.IS_DELETED = 0
AND D.IS_DEFECT='1'
and D.DEFECT_GRADING IS NOT NULL
<if test="createDept != null and createDept.size > 0"> <if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in AND D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=","> <foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
@ -98,10 +121,13 @@
UNION ALL UNION ALL
<!-- 本月总缺陷数 --> <!-- 本月总缺陷数 -->
( (
SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D SELECT COUNT(D.ID) AS DEFECT_NUM from hzims_oper_phenomenon D
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month} WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
AND D.IS_DELETED = 0
AND D.IS_DEFECT='1'
and D.DEFECT_GRADING IS NOT NULL
<if test="createDept != null and createDept.size > 0"> <if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in AND D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=","> <foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

@ -919,12 +919,14 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
List<Integer> list = this.baseMapper.getManageIndex(month, createDeptList); List<Integer> list = this.baseMapper.getManageIndex(month, createDeptList);
manageIndex.setInTimeNum(list.get(0)); manageIndex.setInTimeNum(list.get(0));
if (!list.get(1).equals(0)) { if (!list.get(1).equals(0)) {
manageIndex.setInTimeRatio(list.get(0).equals(0) ? 0.0 : Double.valueOf(list.get(0)) / list.get(1)); double inTimeRatio = new BigDecimal(list.get(0)).divide(new BigDecimal(list.get(1)), 2, BigDecimal.ROUND_UP).doubleValue();
manageIndex.setInTimeRatio(list.get(0).equals(0) ? 0.0 : inTimeRatio);
} }
manageIndex.setHistoryRemindNum(list.get(3)); manageIndex.setHistoryRemindNum(list.get(3));
manageIndex.setMonthRemindNum(list.get(2)); manageIndex.setMonthRemindNum(list.get(2));
if (!list.get(4).equals(0)) { if (!list.get(4).equals(0)) {
manageIndex.setDealRatio(list.get(1).equals(0) ? 0.0 : Double.valueOf(list.get(1)) / list.get(4)); double dealRatio = new BigDecimal(list.get(1)).divide(new BigDecimal(list.get(4)), 2, BigDecimal.ROUND_UP).doubleValue();
manageIndex.setDealRatio(list.get(1).equals(0) ? 0.0 : dealRatio);
} }
return manageIndex; return manageIndex;
} }
@ -1043,10 +1045,12 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
ratio.setSovleNum(dto.getDefectNum()); ratio.setSovleNum(dto.getDefectNum());
ratio.setSovleRatio(Double.valueOf(dto.getDefectNum()) / collectStatus.get(DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus()).getSum()); ratio.setSovleRatio(Double.valueOf(dto.getDefectNum()) / collectStatus.get(DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus()).getSum());
ratio.setHappenNum((int) collectLevel.get(dto.getDefectLevel()).getSum()); ratio.setHappenNum((int) collectLevel.get(dto.getDefectLevel()).getSum());
ratio.setHappenRatio(ratio.getHappenNum() / Double.valueOf(total)); double v = new BigDecimal(ratio.getHappenNum()).divide(new BigDecimal(total), 2, BigDecimal.ROUND_UP).doubleValue();
ratio.setHappenRatio(v);
} else { } else {
ratio.setHappenNum((int) collectLevel.get(dto.getDefectLevel()).getSum()); ratio.setHappenNum((int) collectLevel.get(dto.getDefectLevel()).getSum());
ratio.setHappenRatio(ratio.getHappenNum() / Double.valueOf(total)); double v = new BigDecimal(ratio.getHappenNum()).divide(new BigDecimal(total), 2, BigDecimal.ROUND_UP).doubleValue();
ratio.setHappenRatio(v);
} }
} }

BIN
hzims-service/operational/src/main/resources/template/word/constructio_template.docx

Binary file not shown.

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarAnnualInspectionService.java

@ -37,4 +37,12 @@ public interface ICarAnnualInspectionService extends IService<CarAnnualInspectio
* @return 年检记录数据 * @return 年检记录数据
*/ */
IPage<CarAnnualInspectionPageVO> getCarAnnualInspectionPage(Map<String, Object> param, Query query); IPage<CarAnnualInspectionPageVO> getCarAnnualInspectionPage(Map<String, Object> param, Query query);
/**
* 删除关联年检记录
* @param carId 车辆id
* @return true-成功false-失败
*/
boolean removeRelativeCarAnnualInspection(Long carId);
} }

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

@ -38,4 +38,11 @@ public interface ICarInsuranceService extends IService<CarInsuranceEntity> {
* @return 车保记录数据 * @return 车保记录数据
*/ */
IPage<CarInsurancePageVO> getCarInsurancePage(Map<String, Object> param, Query query); IPage<CarInsurancePageVO> getCarInsurancePage(Map<String, Object> param, Query query);
/**
* 删除关联车保记录
* @param carId 车辆id
* @return true-成功false-失败
*/
boolean removeRelativeCarInsurance(Long carId);
} }

17
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarAnnualInspectionServiceImpl.java

@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 年检记录服务实现类 * 年检记录服务实现类
@ -93,6 +94,22 @@ public class CarAnnualInspectionServiceImpl extends ServiceImpl<CarAnnualInspect
} }
/** /**
* 删除关联年检记录
*/
@Override
public boolean removeRelativeCarAnnualInspection(Long carId) {
QueryWrapper<CarAnnualInspectionEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarAnnualInspectionEntity::getCarId, carId);
List<CarAnnualInspectionEntity> list = this.list(queryWrapper);
// 若无关联年检记录,返回true
if (CollectionUtils.isEmpty(list)) {
return true;
}
List<Long> ids = list.stream().map(CarAnnualInspectionEntity::getId).collect(Collectors.toList());
return this.removeByIds(ids);
}
/**
* 查询是否存在同月编号 * 查询是否存在同月编号
* @param currentMonth 当月 * @param currentMonth 当月
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null

19
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarInsuranceServiceImpl.java

@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 车保记录服务实现类 * 车保记录服务实现类
@ -55,7 +56,7 @@ public class CarInsuranceServiceImpl extends ServiceImpl<CarInsuranceMapper, Car
carEntity.setInsurancePayLastTime(carInsuranceEntity.getInsuranceTime()); carEntity.setInsurancePayLastTime(carInsuranceEntity.getInsuranceTime());
carEntity.setInsurancePayNextTime(carInsuranceEntity.getNextInsuranceTime()); carEntity.setInsurancePayNextTime(carInsuranceEntity.getNextInsuranceTime());
// 更新年检状态 // 更新年检状态
carEntity.setAnnualInspectionStatus(CarInsuranceStatusEnum.INSURED.getValue()); carEntity.setInsuranceStatus(CarInsuranceStatusEnum.INSURED.getValue());
return carService.updateById(carEntity); return carService.updateById(carEntity);
} }
} }
@ -90,6 +91,22 @@ public class CarInsuranceServiceImpl extends ServiceImpl<CarInsuranceMapper, Car
} }
/** /**
* 删除关联车保记录
*/
@Override
public boolean removeRelativeCarInsurance(Long carId) {
QueryWrapper<CarInsuranceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarInsuranceEntity::getCarId, carId);
List<CarInsuranceEntity> list = this.list(queryWrapper);
// 若无关联用车记录,返回true
if (CollectionUtils.isEmpty(list)) {
return true;
}
List<Long> ids = list.stream().map(CarInsuranceEntity::getId).collect(Collectors.toList());
return this.removeByIds(ids);
}
/**
* 查询是否存在同月编号 * 查询是否存在同月编号
* @param currentMonth 当月 * @param currentMonth 当月
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null

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

@ -12,12 +12,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.safeproduct.dto.CarMilesYearDTO; import com.hnac.hzims.safeproduct.dto.CarMilesYearDTO;
import com.hnac.hzims.safeproduct.entity.CarEntity; import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.enums.CarMaintenanceStatusEnum;
import com.hnac.hzims.safeproduct.mapper.CarMapper; import com.hnac.hzims.safeproduct.mapper.CarMapper;
import com.hnac.hzims.safeproduct.service.ICarCheckRecordService; import com.hnac.hzims.safeproduct.service.*;
import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.hnac.hzims.safeproduct.service.ICarUsedRecordService;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO; import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -55,6 +51,12 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements
@Autowired @Autowired
ICarCheckRecordService carCheckRecordService; ICarCheckRecordService carCheckRecordService;
@Autowired
ICarInsuranceService carInsuranceService;
@Autowired
ICarAnnualInspectionService carAnnualInspectionService;
/** /**
* 年度里程数页面 * 年度里程数页面
*/ */
@ -195,15 +197,29 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements
// 删除关联维保记录 // 删除关联维保记录
boolean removeCarMaintenance = carMaintenanceService.removeRelativeCarMaintenance(id); boolean removeCarMaintenance = carMaintenanceService.removeRelativeCarMaintenance(id);
if (!removeCarMaintenance) { if (!removeCarMaintenance) {
return false; throw new ServiceException("关联维保记录删除失败");
} }
// 删除关联用车记录 // 删除关联用车记录
boolean removeCarUsedRecord = carUsedRecordService.removeRelativeCarUsedRecord(id); boolean removeCarUsedRecord = carUsedRecordService.removeRelativeCarUsedRecord(id);
if (!removeCarUsedRecord) { if (!removeCarUsedRecord) {
return false; throw new ServiceException("关联用车记录删除失败");
} }
// 删除关联车检记录 // 删除关联车检记录
return carCheckRecordService.removeRelativeCarCheckRecord(id); boolean removeCarCheckRecord = carCheckRecordService.removeRelativeCarCheckRecord(id);
if (!removeCarCheckRecord) {
throw new ServiceException("关联车检记录删除失败");
}
// 删除关联年检记录
boolean removeCarAnnualInspection = carAnnualInspectionService.removeRelativeCarAnnualInspection(id);
if (!removeCarAnnualInspection) {
throw new ServiceException("关联年检记录删除失败");
}
// 删除关联车保记录
boolean removeCarInsurance = carInsuranceService.removeRelativeCarInsurance(id);
if (!removeCarInsurance) {
throw new ServiceException("关联车保记录删除失败");
}
return true;
} }
return false; return false;
} }

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

@ -98,6 +98,7 @@ CREATE TABLE `hzims_test` (
`subject` varchar(50) NOT NULL COMMENT '考试科目', `subject` varchar(50) NOT NULL COMMENT '考试科目',
`proctor` varchar(20) NOT NULL COMMENT '监考人', `proctor` varchar(20) NOT NULL COMMENT '监考人',
`people_name` varchar(1000) DEFAULT '' COMMENT '参考人员', `people_name` varchar(1000) DEFAULT '' COMMENT '参考人员',
`test_method` varchar(50) NOT NULL 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 '创建人',
@ -208,6 +209,7 @@ CREATE TABLE `hzims_hygiene_record` (
`code` varchar(50) NOT NULL COMMENT '编号', `code` varchar(50) NOT NULL COMMENT '编号',
`actual_start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间', `actual_start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间',
`actual_end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间', `actual_end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间',
`check_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '检查时间',
`check_user` varchar(20) NOT NULL DEFAULT '' COMMENT '检查人', `check_user` varchar(20) NOT NULL DEFAULT '' COMMENT '检查人',
`hygiene_zone_ids` varchar(1000) NOT NULL COMMENT '卫生自查区域id', `hygiene_zone_ids` varchar(1000) NOT NULL COMMENT '卫生自查区域id',
`check_result` mediumtext NOT NULL COMMENT '检查结果', `check_result` mediumtext NOT NULL COMMENT '检查结果',
@ -231,16 +233,16 @@ CREATE TABLE `hzims_car` (
`car_type` varchar(50) NOT NULL COMMENT '型号', `car_type` varchar(50) NOT NULL COMMENT '型号',
`plate_number` varchar(50) NOT NULL COMMENT '车牌号', `plate_number` varchar(50) NOT NULL COMMENT '车牌号',
`registration_time` date NOT NULL COMMENT '上牌时间', `registration_time` date NOT NULL COMMENT '上牌时间',
`insurance_pay_last_time` date NOT NULL COMMENT '上期缴车保时间', `insurance_pay_last_time` date DEFAULT NULL COMMENT '上期缴车保时间',
`insurance_pay_next_time` date NOT NULL COMMENT '下期缴车保时间', `insurance_pay_next_time` date DEFAULT NULL COMMENT '下期缴车保时间',
`insurance_status` varchar(50) NOT NULL COMMENT '保险状态', `insurance_status` varchar(50) NOT NULL DEFAULT 'UNINSURED' COMMENT '保险状态',
`last_annual_inspection_time` date NOT NULL COMMENT '上期年检时间', `last_annual_inspection_time` date DEFAULT NULL COMMENT '上期年检时间',
`next_annual_inspection_time` date NOT NULL COMMENT '下期年检时间', `next_annual_inspection_time` date DEFAULT NULL COMMENT '下期年检时间',
`annual_inspection_status` varchar(50) NOT NULL COMMENT '年检状态', `annual_inspection_status` varchar(50) NOT NULL DEFAULT 'UNFINISHED' COMMENT '年检状态',
`maintenance_last_time` date DEFAULT NULL COMMENT '上期保养时间', `maintenance_last_time` date DEFAULT NULL COMMENT '上期保养时间',
`maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间', `maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间',
`maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程', `maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程',
`maintenance_status` varchar(50) DEFAULT NULL COMMENT '保养状态', `maintenance_status` varchar(50) NOT NULL DEFAULT 'UNMAINTAINED' COMMENT '保养状态',
`manager_id` bigint(20) DEFAULT NULL COMMENT '车辆管理人id', `manager_id` bigint(20) DEFAULT NULL COMMENT '车辆管理人id',
`manager` varchar(50) NOT NULL COMMENT '车辆管理人', `manager` varchar(50) NOT NULL COMMENT '车辆管理人',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片', `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片',
@ -288,7 +290,7 @@ CREATE TABLE `hzims_car_used_record` (
`unit` varchar(50) NOT NULL COMMENT '用车单位', `unit` varchar(50) NOT NULL COMMENT '用车单位',
`used_location` varchar(255) NOT NULL COMMENT '使用地点', `used_location` varchar(255) NOT NULL COMMENT '使用地点',
`user` varchar(20) NOT NULL COMMENT '使用人', `user` varchar(20) NOT NULL COMMENT '使用人',
`remark` mediumtext DEFAULT NULL COMMENT '使用详情', `remark` mediumtext COMMENT '使用详情',
`start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使用时间', `start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使用时间',
`end_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 '出车公里数', `start_miles` decimal(10, 2) NOT NULL COMMENT '出车公里数',
@ -346,9 +348,8 @@ CREATE TABLE `hzims_car_annual_inspection` (
`car_id` bigint(20) NOT NULL COMMENT '车辆id', `car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号', `code` varchar(50) NOT NULL COMMENT '编号',
`annual_inspection_time` date NOT NULL COMMENT '年检时间', `annual_inspection_time` date NOT NULL COMMENT '年检时间',
`next_annual_inspection_time` date NOT NULL COMMENT '下次年检时间',
`location` varchar(255) NOT NULL DEFAULT '' COMMENT '年检地点', `location` varchar(255) NOT NULL DEFAULT '' COMMENT '年检地点',
`cost` bigint(20) NOT NULL COMMENT '年检费用',
`inspection_manager` varchar(50) NOT NULL DEFAULT '' COMMENT '年检负责人',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '年检图片', `img_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 '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
@ -365,9 +366,8 @@ CREATE TABLE `hzims_car_insurance` (
`car_id` bigint(20) NOT NULL COMMENT '车辆id', `car_id` bigint(20) NOT NULL COMMENT '车辆id',
`code` varchar(50) NOT NULL COMMENT '编号', `code` varchar(50) NOT NULL COMMENT '编号',
`insurance_time` date NOT NULL COMMENT '车保时间', `insurance_time` date NOT NULL COMMENT '车保时间',
`next_insurance_time` date NOT NULL COMMENT '下次车保时间',
`location` varchar(255) NOT NULL DEFAULT '' COMMENT '车保地点', `location` varchar(255) NOT NULL DEFAULT '' COMMENT '车保地点',
`cost` bigint(20) NOT NULL COMMENT '车保费用',
`insurance_manager` varchar(50) NOT NULL DEFAULT '' COMMENT '车保负责人',
`img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车保图片', `img_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 '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
@ -394,7 +394,25 @@ CREATE TABLE `hzims_device` (
`inspection_last_time` date DEFAULT NULL COMMENT '上次检验日期', `inspection_last_time` date DEFAULT NULL COMMENT '上次检验日期',
`manager_id` bigint(20) DEFAULT NULL COMMENT '设备管理人id', `manager_id` bigint(20) DEFAULT NULL COMMENT '设备管理人id',
`manager` varchar(50) NOT NULL DEFAULT '' COMMENT '设备管理人', `manager` varchar(50) NOT NULL DEFAULT '' COMMENT '设备管理人',
`device_status` varchar(20) NOT NULL DEFAULT 'NORMAL' COMMENT '设备状态', `device_status` varchar(20) NOT NULL DEFAULT 'EXPIRED' 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_device_inspection` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`device_id` bigint(20) NOT NULL COMMENT '设备id',
`inspection_time` date NOT NULL COMMENT '设备检验时间',
`last_inspection_time` date NOT NULL COMMENT '上次检验时间',
`next_inspection_time` date NOT NULL COMMENT '下次检验时间',
`location` varchar(255) NOT NULL DEFAULT '' COMMENT '设备检验地点',
`img_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 '创建人',
`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 '创建时间',

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java

@ -36,8 +36,8 @@ public class WorkTaskController extends BladeController {
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "分页") @ApiOperation(value = "分页")
public R<IPage<WorkTaskEntity>> list(WorkTaskVO workTask, Query query) { public R<IPage<WorkTaskEntity>> pageCondition(WorkTaskVO workTask, Query query) {
return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask)); return R.data(workTaskService.pageCondition(Condition.getPage(query), workTask));
} }
@GetMapping("/detail") @GetMapping("/detail")

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java

@ -19,7 +19,7 @@ public interface IWorkTaskService extends BaseService<WorkTaskEntity> {
boolean listener(ProcessWorkFlowResponse processWorkFlowResponse); boolean listener(ProcessWorkFlowResponse processWorkFlowResponse);
IPage<WorkTaskEntity> workTaskService(IPage<WorkTaskEntity> page, WorkTaskVO workTask); IPage<WorkTaskEntity> pageCondition(IPage<WorkTaskEntity> page, WorkTaskVO workTask);
void preview(Long id); void preview(Long id);

29
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

@ -48,6 +48,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @author ysj * @author ysj
@ -165,22 +166,26 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
* @return * @return
*/ */
@Override @Override
public IPage<WorkTaskEntity> workTaskService(IPage<WorkTaskEntity> page, WorkTaskVO workTask) { public IPage<WorkTaskEntity> pageCondition(IPage<WorkTaskEntity> page, WorkTaskVO workTask) {
QueryWrapper wrapper = Condition.getQueryWrapper(workTask); QueryWrapper<WorkTaskEntity> wrapper = new QueryWrapper();
wrapper.lambda().orderByDesc(WorkTaskEntity::getCreateTime);
if(StringUtil.isNotBlank(workTask.getStartTime())){ if(StringUtil.isNotBlank(workTask.getStartTime())){
wrapper.ge("CREATE_TIME",workTask.getStartTime()); wrapper.lambda().ge(WorkTaskEntity::getCreateTime,workTask.getStartTime());
} }
if(StringUtil.isNotBlank(workTask.getEndTime())){ if(StringUtil.isNotBlank(workTask.getEndTime())){
wrapper.le("CREATE_TIME",workTask.getEndTime()); wrapper.lambda().le(WorkTaskEntity::getCreateTime,workTask.getEndTime());
} }
if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ if(ObjectUtil.isNotEmpty(workTask.getGroupId())){
wrapper.eq("GROUP_ID",workTask.getGroupId()); wrapper.lambda().eq(WorkTaskEntity::getGroupId,workTask.getGroupId());
} }
if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ if(ObjectUtil.isNotEmpty(workTask.getGroupName())){
wrapper.eq("CREATE_DEPT",workTask.getDeptId()); wrapper.lambda().like(WorkTaskEntity::getGroupName,workTask.getGroupName());
}
if(ObjectUtil.isNotEmpty(workTask.getDeptId())){
wrapper.lambda().eq(WorkTaskEntity::getCreateDept,workTask.getDeptId());
} }
if(ObjectUtil.isNotEmpty(workTask.getTaskName())){ if(ObjectUtil.isNotEmpty(workTask.getTaskName())){
wrapper.eq("TASK_NAME",workTask.getTaskName()); wrapper.lambda().eq(WorkTaskEntity::getTaskName,workTask.getTaskName());
} }
return super.page(page, wrapper); return super.page(page, wrapper);
} }
@ -246,13 +251,7 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
if(StringUtil.isNotBlank(preview.getWorkTask())){ if(StringUtil.isNotBlank(preview.getWorkTask())){
List<WorkTaskContentVO> contents = JSONObject.parseObject(preview.getWorkTask(), new TypeReference<List<WorkTaskContentVO>>() {}); List<WorkTaskContentVO> contents = JSONObject.parseObject(preview.getWorkTask(), new TypeReference<List<WorkTaskContentVO>>() {});
if(CollectionUtil.isNotEmpty(contents)){ if(CollectionUtil.isNotEmpty(contents)){
StringBuilder location = new StringBuilder(),content = new StringBuilder(); preview.setContents(contents);
for(WorkTaskContentVO item : contents){
location.append(item.getLocation()).append("\n");
content.append(item.getContent()).append("\n");
}
preview.setLocation(location.substring(0,location.toString().length() - 1));
preview.setContent(content.substring(0,location.toString().length() - 1));
} }
} }
// 计划工作时间 // 计划工作时间

24
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

@ -65,9 +65,6 @@ public class CensServiceImpl implements CensService {
if(StringUtil.isEmpty(param.getEndTime())){ if(StringUtil.isEmpty(param.getEndTime())){
param.setStartTime(DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); param.setStartTime(DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME));
} }
if(!StringUtil.isEmpty(param.getState()) && param.getState().equals(1)){
param.setFlowTaskName("结束");
}
// 获取权限区域机构 // 获取权限区域机构
List<Dept> depts; List<Dept> depts;
@ -87,8 +84,12 @@ public class CensServiceImpl implements CensService {
// 操作票查询 // 操作票查询
QueryWrapper wrapper = new QueryWrapper(); QueryWrapper wrapper = new QueryWrapper();
if(!StringUtil.isEmpty(param.getFlowTaskName())){ if(!StringUtil.isEmpty(param.getState())){
wrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); if(param.getState().equals(1)){
wrapper.eq("FLOW_TASK_NAME","结束");
}else{
wrapper.ne("FLOW_TASK_NAME","结束");
}
} }
if(!StringUtil.isEmpty(param.getStartTime())){ if(!StringUtil.isEmpty(param.getStartTime())){
wrapper.ge("CREATE_TIME",param.getStartTime()); wrapper.ge("CREATE_TIME",param.getStartTime());
@ -104,7 +105,6 @@ public class CensServiceImpl implements CensService {
List<StandardTicketInfoEntity> operates = operateTicketService.list(wrapper); List<StandardTicketInfoEntity> operates = operateTicketService.list(wrapper);
// 工作票查询 // 工作票查询
List<WorkTicketInfoEntity> works = workTicketInfoService.list(wrapper); List<WorkTicketInfoEntity> works = workTicketInfoService.list(wrapper);
// 工作任务单
return depts.stream().map(dept->{ return depts.stream().map(dept->{
CensVo cens = new CensVo(); CensVo cens = new CensVo();
cens.setDeptId(dept.getId()); cens.setDeptId(dept.getId());
@ -119,7 +119,6 @@ public class CensServiceImpl implements CensService {
}else{ }else{
cens.setWorkCount(works.stream().filter(work->work.getCreateDept().equals(dept.getId())).count()); cens.setWorkCount(works.stream().filter(work->work.getCreateDept().equals(dept.getId())).count());
} }
cens.setWorkTaskCount((long)new Random().nextInt(10));
return cens; return cens;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@ -153,9 +152,6 @@ public class CensServiceImpl implements CensService {
param.setEndTime(param.getYear() + "-12-31 23:59:59"); param.setEndTime(param.getYear() + "-12-31 23:59:59");
} }
if(!StringUtil.isEmpty(param.getState()) && param.getState().equals(1)){
param.setFlowTaskName("结束");
}
List<Dept> depts; List<Dept> depts;
if(ObjectUtil.isEmpty(param.getDeptId())){ if(ObjectUtil.isEmpty(param.getDeptId())){
// 获取权限区域机构 // 获取权限区域机构
@ -173,8 +169,12 @@ public class CensServiceImpl implements CensService {
// 操作票查询 // 操作票查询
QueryWrapper wrapper = new QueryWrapper(); QueryWrapper wrapper = new QueryWrapper();
if(!StringUtil.isEmpty(param.getFlowTaskName())){ if(!StringUtil.isEmpty(param.getState())){
wrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); if(param.getState().equals(1)){
wrapper.eq("FLOW_TASK_NAME","结束");
}else{
wrapper.ne("FLOW_TASK_NAME","结束");
}
} }
if(!StringUtil.isEmpty(param.getStartTime())){ if(!StringUtil.isEmpty(param.getStartTime())){
wrapper.ge("CREATE_TIME",param.getStartTime()); wrapper.ge("CREATE_TIME",param.getStartTime());

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/PdfUtils.java

@ -122,7 +122,7 @@ public class PdfUtils {
} }
//若为list则不处理 //若为list则不处理
if (value instanceof List) { if (value instanceof List) {
return; value = ((List<?>) value).stream().map(PdfUtils::objectToMap).collect(Collectors.toList());
} }
//若为时间格式则进行格式化 //若为时间格式则进行格式化
if (value instanceof LocalDateTime) { if (value instanceof LocalDateTime) {

BIN
hzims-service/ticket/src/main/resources/template/work/work_task_template.docx

Binary file not shown.
Loading…
Cancel
Save