Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
ty 3 months ago
parent
commit
1cc4943cb3
  1. 9
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java
  2. 4
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/HandleQueryVo.java
  3. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java
  4. 88
      hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java
  5. 14
      hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java
  6. 7
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml
  7. 40
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java
  8. 9
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/StratStopService.java
  9. 24
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/impl/StartStopServiceImpl.java
  10. 41
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/ZhiPuBigModelServiceImpl.java
  11. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java
  12. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java
  13. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java
  14. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java
  15. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java
  16. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java
  17. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java

9
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java

@ -3,8 +3,6 @@ package com.hnac.hzims.alarm.show.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
* @date 2023/03/17 10:02:33
@ -16,8 +14,11 @@ public class AlarmHistoryParamVo {
@ApiModelProperty(value = "站点编号")
private String stationId;
@ApiModelProperty(value = "告警日期 : yyyy-MM-dd")
private String alarmTime;
@ApiModelProperty(value = "告警开始日期 : yyyy-MM-dd")
private String startTime;
@ApiModelProperty(value = "告警结束日期 : yyyy-MM-dd")
private String endTime;
@ApiModelProperty(value = "告警类型")
private Integer alarmType;

4
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/HandleQueryVo.java

@ -2,6 +2,8 @@ package com.hnac.hzims.alarm.show.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -20,9 +22,11 @@ public class HandleQueryVo {
private Long handleUser;
@ApiModelProperty("开始时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
private Date startTime;
@ApiModelProperty("结束时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
private Date endTime;
@ApiModelProperty("处理类型:1-延后 2-误报 3-缺陷 4-检修")

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java

@ -13,4 +13,6 @@ public interface ScheduledConstant {
String THIS_DAY_POWER_GENERATION = "thisDayPowerGeneration";
String LOAD_THREE_YEAR_POWER_GENERATION = "loadThreeYearPowerGeneration";
String THIS_DAY_START_STOP_RECORD = "thisDayStartStopRecord";
}

88
hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java

@ -279,9 +279,9 @@ public class ElectricReportServiceImpl implements IElectricReportService {
firstHead.setIsChildren(false);
tableHeads.add(firstHead);
TableHeadVo secondHead = new TableHeadVo();
secondHead.setTableName("总计发电量");
secondHead.setTableName("总计发电量");
secondHead.setIsChildren(true);
secondHead.setChildren(Arrays.asList("总有功","总无功"));
secondHead.setChildren(Arrays.asList("总有功","总无功"));
tableHeads.add(secondHead);
// 根据设备分组
@ -290,7 +290,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
TableHeadVo tableHead = new TableHeadVo();
tableHead.setTableName(key + "发电量(kWh)");
tableHead.setIsChildren(true);
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHeads.add(tableHead);
});
@ -321,6 +321,13 @@ public class ElectricReportServiceImpl implements IElectricReportService {
start = calendar.getTime();
tableDate.add(item);
}
List<Object> item = new ArrayList<>();
item.add("合计");
for(int i = 1 ; i < tableDate.get(0).size() ; i++){
int index = i;
item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum());
}
tableDate.add(item);
result.put("tableDate",tableDate);
}
// 年
@ -383,6 +390,13 @@ public class ElectricReportServiceImpl implements IElectricReportService {
start = calendar.getTime();
tableDate.add(item);
}
List<Object> item = new ArrayList<>();
item.add("合计");
for(int i = 1 ; i < tableDate.get(0).size() ; i++){
int index = i;
item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum());
}
tableDate.add(item);
result.put("tableDate",tableDate);
}
return result;
@ -428,9 +442,9 @@ public class ElectricReportServiceImpl implements IElectricReportService {
firstHead.setIsChildren(false);
tableHeads.add(firstHead);
TableHeadVo secondHead = new TableHeadVo();
secondHead.setTableName("总计发电量");
secondHead.setTableName("总计发电量");
secondHead.setIsChildren(true);
secondHead.setChildren(Arrays.asList("总有功","总无功"));
secondHead.setChildren(Arrays.asList("总有功","总无功"));
tableHeads.add(secondHead);
// 根据区域分组
@ -446,7 +460,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
TableHeadVo tableHead = new TableHeadVo();
tableHead.setTableName(area.getDeptName() + "发电量(kWh)");
tableHead.setIsChildren(true);
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHeads.add(tableHead);
});
result.put("tableHead",tableHeads);
@ -484,6 +498,13 @@ public class ElectricReportServiceImpl implements IElectricReportService {
start = calendar.getTime();
tableDate.add(item);
}
List<Object> item = new ArrayList<>();
item.add("合计");
for(int i = 1 ; i < tableDate.get(0).size() ; i++){
int index = i;
item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum());
}
tableDate.add(item);
result.put("tableDate",tableDate);
}else if(type == 2){
@ -503,9 +524,9 @@ public class ElectricReportServiceImpl implements IElectricReportService {
firstHead.setIsChildren(false);
tableHeads.add(firstHead);
TableHeadVo secondHead = new TableHeadVo();
secondHead.setTableName("总计发电量");
secondHead.setTableName("总计发电量");
secondHead.setIsChildren(true);
secondHead.setChildren(Arrays.asList("总有功","总无功"));
secondHead.setChildren(Arrays.asList("总有功","总无功"));
tableHeads.add(secondHead);
// 根据设备分组
@ -521,7 +542,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
TableHeadVo tableHead = new TableHeadVo();
tableHead.setTableName(area.getDeptName() + "发电量(kWh)");
tableHead.setIsChildren(true);
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHeads.add(tableHead);
});
result.put("tableHead",tableHeads);
@ -559,6 +580,13 @@ public class ElectricReportServiceImpl implements IElectricReportService {
start = calendar.getTime();
tableDate.add(item);
}
List<Object> item = new ArrayList<>();
item.add("合计");
for(int i = 1 ; i < tableDate.get(0).size() ; i++){
int index = i;
item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum());
}
tableDate.add(item);
result.put("tableDate",tableDate);
}
return result;
@ -602,9 +630,9 @@ public class ElectricReportServiceImpl implements IElectricReportService {
firstHead.setIsChildren(false);
tableHeads.add(firstHead);
TableHeadVo secondHead = new TableHeadVo();
secondHead.setTableName("总计发电量");
secondHead.setTableName("总计发电量");
secondHead.setIsChildren(true);
secondHead.setChildren(Arrays.asList("总有功","总无功"));
secondHead.setChildren(Arrays.asList("总有功","总无功"));
tableHeads.add(secondHead);
// 根据设备分组
@ -612,7 +640,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
TableHeadVo tableHead = new TableHeadVo();
tableHead.setTableName(device.getName() + "发电量(kWh)");
tableHead.setIsChildren(true);
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHeads.add(tableHead);
});
result.put("tableHead",tableHeads);
@ -641,6 +669,14 @@ public class ElectricReportServiceImpl implements IElectricReportService {
start = calendar.getTime();
tableDate.add(item);
}
// 总计
List<Object> item = new ArrayList<>();
item.add("合计");
for(int i = 1 ; i < tableDate.get(0).size() ; i++){
int index = i;
item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum());
}
tableDate.add(item);
result.put("tableDate",tableDate);
}
// 月
@ -661,9 +697,9 @@ public class ElectricReportServiceImpl implements IElectricReportService {
firstHead.setIsChildren(false);
tableHeads.add(firstHead);
TableHeadVo secondHead = new TableHeadVo();
secondHead.setTableName("总计发电量");
secondHead.setTableName("总计发电量");
secondHead.setIsChildren(true);
secondHead.setChildren(Arrays.asList("总有功","总无功"));
secondHead.setChildren(Arrays.asList("总有功","总无功"));
tableHeads.add(secondHead);
// 根据设备分组
@ -672,7 +708,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
TableHeadVo tableHead = new TableHeadVo();
tableHead.setTableName(key + "发电量(kWh)");
tableHead.setIsChildren(true);
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHeads.add(tableHead);
});
@ -703,6 +739,14 @@ public class ElectricReportServiceImpl implements IElectricReportService {
start = calendar.getTime();
tableDate.add(item);
}
// 总计
List<Object> item = new ArrayList<>();
item.add("合计");
for(int i = 1 ; i < tableDate.get(0).size() ; i++){
int index = i;
item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum());
}
tableDate.add(item);
result.put("tableDate",tableDate);
}
// 年
@ -723,9 +767,9 @@ public class ElectricReportServiceImpl implements IElectricReportService {
firstHead.setIsChildren(false);
tableHeads.add(firstHead);
TableHeadVo secondHead = new TableHeadVo();
secondHead.setTableName("总计发电量");
secondHead.setTableName("总计发电量");
secondHead.setIsChildren(true);
secondHead.setChildren(Arrays.asList("总有功","总无功"));
secondHead.setChildren(Arrays.asList("总有功","总无功"));
tableHeads.add(secondHead);
// 根据设备分组
@ -734,7 +778,7 @@ public class ElectricReportServiceImpl implements IElectricReportService {
TableHeadVo tableHead = new TableHeadVo();
tableHead.setTableName(key + "发电量(kWh)");
tableHead.setIsChildren(true);
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHead.setChildren(Arrays.asList("有功","无功"));
tableHeads.add(tableHead);
});
@ -765,6 +809,14 @@ public class ElectricReportServiceImpl implements IElectricReportService {
start = calendar.getTime();
tableDate.add(item);
}
// 总计
List<Object> item = new ArrayList<>();
item.add("合计");
for(int i = 1 ; i < tableDate.get(0).size() ; i++){
int index = i;
item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum());
}
tableDate.add(item);
result.put("tableDate",tableDate);
}
return result;

14
hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java

@ -1,25 +1,19 @@
package com.hnac.hzims.history.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.history.entity.HistoryPointRecordEntity;
import com.hnac.hzims.history.entity.HistoryTemplateEntity;
import com.hnac.hzims.history.service.IHistoryDeviceService;
import com.hnac.hzims.history.service.IHistoryPointRecordService;
import com.hnac.hzims.history.vo.*;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO;
import com.hnac.hzinfo.sdk.v5.hzfac.vo.FacDeviceVO;
import com.hnac.hzims.history.vo.HistoryPointRecordParamVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @author ysj

7
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml

@ -14,8 +14,11 @@
<if test="param.stationId != null and param.stationId != ''">
AND ALARM.STATION_ID = #{param.stationId}
</if>
<if test="param.alarmTime != null and param.alarmTime != ''">
AND ALARM.ALARM_TIME like CONCAT('%',#{param.alarmTime}, '%')
<if test="param.startTime != null and param.startTime != ''">
AND ALARM.ALARM_TIME &gt;= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND ALARM.ALARM_TIME &lt;= #{param.endTime}
</if>
<if test="param.alarmType != null and param.alarmType != ''">
AND ALARM.ALARM_TYPE = #{param.alarmType}

40
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java

@ -0,0 +1,40 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.startstop.StratStopService;
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.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.ScheduledConstant.THIS_DAY_START_STOP_RECORD;
/**
* 开停机定时任务
* @author ysj
*/
@Slf4j
@Component
public class StartStopScheduledTask {
@Autowired
private StratStopService service;
/**
* 单日开停机记录
*/
@XxlJob(THIS_DAY_START_STOP_RECORD)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> thisDayStartStopRecord(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.thisDayStartStopRecord(param);
return new ReturnT<>("SUCCESS");
}
}

9
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/StratStopService.java

@ -0,0 +1,9 @@
package com.hnac.hzims.scheduled.service.startstop;
/**
* @author ysj
*/
public interface StratStopService {
void thisDayStartStopRecord(String param);
}

24
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/impl/StartStopServiceImpl.java

@ -0,0 +1,24 @@
package com.hnac.hzims.scheduled.service.startstop.impl;
import com.hnac.hzims.scheduled.service.startstop.StratStopService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author ysj
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class StartStopServiceImpl implements StratStopService {
/**
* 单日开停机记录
* @param param
*/
@Override
public void thisDayStartStopRecord(String param) {
}
}

41
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/ZhiPuBigModelServiceImpl.java

@ -12,6 +12,7 @@ import com.hnac.hzinfo.inspect.ai.service.IZhiPuBigModelService;
import com.hnac.hzinfo.inspect.ai.vo.ZhiPuImageAnalysisDTO;
import com.hnac.hzinfo.inspect.utils.HiKUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.StringUtil;
@ -21,6 +22,8 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
@ -29,6 +32,7 @@ import java.util.stream.Collectors;
*/
@Service
@AllArgsConstructor
@Slf4j
public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService {
private final IStationVideoTypeClient stationVideoTypeClient;
@ -59,7 +63,6 @@ public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService {
if (StringUtil.isBlank(url)) {
continue;
}
BigModelAnalysisRequestDTO zhiPuRequest = new BigModelAnalysisRequestDTO();
zhiPuRequest.setUrl(url);
zhiPuRequest.setCheckTypeSonList(analysisTypeList);
@ -85,23 +88,35 @@ public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService {
@Override
public List<String> getZhiPuAnalysisType(String[] originalCode) {
List<String> result = new ArrayList<>();
Map<String, String> typeMap = mappingTypes();
for (String code : originalCode) {
String zhiPuType = typeMap.get(code);
if (StringUtil.isNotBlank(zhiPuType)) {
result.add(zhiPuType);
}
}
return result;
}
public Map<String, String> mappingTypes() {
Map<String, String> typeMap = new ConcurrentHashMap<>();
R<List<Dict>> zhiPuResponse = dictClient.getList(ZHI_PU_TYPE_KEY);
if (!zhiPuResponse.isSuccess()) {
return result;
if (!zhiPuResponse.isSuccess() || CollectionUtil.isEmpty(zhiPuResponse.getData())) {
return typeMap;
}
R<List<Dict>> cameraResponse = dictClient.getList(CAMERA_TYPE_KEY);
if (!cameraResponse.isSuccess() || CollectionUtil.isEmpty(cameraResponse.getData())) {
return typeMap;
}
List<Dict> zhiPuList = zhiPuResponse.getData();
for (String code : originalCode) {
R<String> valueResponse = dictClient.getValue(CAMERA_TYPE_KEY, code);
if (!valueResponse.isSuccess()|| StringUtil.isBlank(valueResponse.getData())) {
continue;
}
String value = valueResponse.getData();
for (Dict dict : zhiPuList) {
if (value.indexOf(dict.getDictValue()) >= 0 || dict.getDictValue().indexOf(value) >= 0) {
result.add(dict.getDictKey());
List<Dict> cameraList = cameraResponse.getData();
for (Dict camera : cameraList) {
for (Dict zhiPu : zhiPuList) {
if (camera.getDictValue().indexOf(zhiPu.getDictValue()) >= 0 || zhiPu.getDictValue().indexOf(camera.getDictValue()) >= 0) {
typeMap.put(camera.getDictKey(), zhiPu.getDictKey());
}
}
}
return result;
return typeMap;
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java

@ -31,7 +31,7 @@ public class StationFrameRecordController extends BladeController {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity")
public R submit(@Valid @RequestBody FrameRecordEntity entity) {
return R.status(frameRecordService.saveOrUpdate(entity));
return R.status(frameRecordService.submit(entity));
}
@GetMapping("/query")

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java

@ -29,7 +29,7 @@ public class StationVideoRecordController extends BladeController {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity")
public R submit(@Valid @RequestBody VideoRecordEntity entity) {
return R.status(videoRecordService.saveOrUpdate(entity));
return R.status(videoRecordService.submit(entity));
}
@GetMapping("/query")

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java

@ -7,4 +7,5 @@ import com.hnac.hzims.operational.station.entity.FrameRecordEntity;
* @author ysj
*/
public interface FrameRecordService extends IService<FrameRecordEntity> {
boolean submit(FrameRecordEntity entity);
}

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java

@ -7,4 +7,5 @@ import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
* @author ysj
*/
public interface VideoRecordService extends IService<VideoRecordEntity> {
boolean submit(VideoRecordEntity entity);
}

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java

@ -1,5 +1,7 @@
package com.hnac.hzims.operational.station.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.operational.station.entity.FrameRecordEntity;
import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
@ -19,4 +21,17 @@ import org.springframework.stereotype.Service;
@Slf4j
public class FrameRecordServiceImpl extends ServiceImpl<FrameRecordMapper, FrameRecordEntity> implements FrameRecordService {
@Override
public boolean submit(FrameRecordEntity entity) {
// 根据用户,站点查询历史配置记录
FrameRecordEntity frameRecord = this.getOne(Wrappers.<FrameRecordEntity>lambdaQuery()
.eq(FrameRecordEntity::getStationId,entity.getStationId())
.eq(FrameRecordEntity::getCreateUser,entity.getCreateUser())
);
if(ObjectUtils.isEmpty(frameRecord)){
return this.save(entity);
}
entity.setId(frameRecord.getId());
return this.updateById(entity);
}
}

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java

@ -1,9 +1,11 @@
package com.hnac.hzims.operational.station.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.entity.UserDeptConfigEntity;
import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
import com.hnac.hzims.operational.station.mapper.UserDeptConfigMapper;
import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.station.service.UserDeptConfigService;
@ -65,7 +67,16 @@ public class UserDeptConfigServiceImpl extends ServiceImpl<UserDeptConfigMapper,
entity.setStationName(null);
}
return super.saveOrUpdate(entity);
// 检查记录是否保存
UserDeptConfigEntity userDeptConfig = this.getOne(Wrappers.<UserDeptConfigEntity>lambdaQuery()
.eq(UserDeptConfigEntity::getStationId,entity.getStationId())
.eq(UserDeptConfigEntity::getCreateUser,entity.getCreateUser())
);
if(ObjectUtils.isEmpty(userDeptConfig)){
return this.save(entity);
}
entity.setId(userDeptConfig.getId());
return this.updateById(entity);
}
@Override

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java

@ -1,5 +1,7 @@
package com.hnac.hzims.operational.station.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
import com.hnac.hzims.operational.station.mapper.VideoRecordMapper;
@ -16,4 +18,22 @@ import org.springframework.stereotype.Service;
@Slf4j
public class VideoRecordServiceImpl extends ServiceImpl<VideoRecordMapper, VideoRecordEntity> implements VideoRecordService {
/**
* 视频配置记录提交
* @param entity
* @return
*/
@Override
public boolean submit(VideoRecordEntity entity) {
// 根据用户,站点查询历史配置记录
VideoRecordEntity videoRecord = this.getOne(Wrappers.<VideoRecordEntity>lambdaQuery()
.eq(VideoRecordEntity::getStationId,entity.getStationId())
.eq(VideoRecordEntity::getCreateUser,entity.getCreateUser())
);
if(ObjectUtils.isEmpty(videoRecord)){
return this.save(entity);
}
entity.setId(videoRecord.getId());
return this.updateById(entity);
}
}
Loading…
Cancel
Save