Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 7 months ago
parent
commit
dd9c56a706
  1. 10
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/video/entity/VideoPlatformEntity.java
  2. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneTemplateDTO.java
  3. 30
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateDetailEntity.java
  4. 21
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateEntity.java
  5. 26
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneTemplateDetailVO.java
  6. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
  7. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java
  8. 49
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java
  9. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  10. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/DataService.java
  11. 46
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java
  12. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  13. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
  14. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/video/controller/VideoPlatformController.java
  15. 57
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  16. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.java
  17. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.xml
  18. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.java
  19. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml
  20. 21
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateDetailService.java
  21. 42
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateService.java
  22. 30
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateDetailServiceImpl.java
  23. 107
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateServiceImpl.java
  24. 30
      hzims-service/safeproduct/src/main/resources/db/2.0.1.sql
  25. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketPrincipalChangeController.java

10
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/video/entity/VideoPlatformEntity.java

@ -1,7 +1,5 @@
package com.hnac.hzims.operational.video.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ -11,7 +9,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.springblade.core.tenant.mp.TenantEntity;
import javax.validation.constraints.NotBlank;
@ -19,7 +16,10 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
@EqualsAndHashCode
/**
* @author ysj
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("HZIMS_VIDEO_PLATFORM")
@ApiModel(value = "视频平台实体类",description = "视频平台实体类")
@ -40,11 +40,13 @@ public class VideoPlatformEntity extends TenantEntity implements Serializable {
@Size(min = 1,max = 50,groups = Create.class)
private String videoHost;
@ApiModelProperty("秘钥appKey")
@NotBlank
@Size(min = 1,max = 50,groups = Create.class)
private String appKey;
@ApiModelProperty("秘钥appSecret")
@NotBlank
@Size(min = 1,max = 100,groups = Create.class)

25
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneTemplateDTO.java

@ -0,0 +1,25 @@
package com.hnac.hzims.safeproduct.dto;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @date 2024-04-28
*/
@Data
@ApiModel(value = "卫生自查模板DTO类")
public class HygieneTemplateDTO {
@ApiModelProperty("模板id")
private Long templateId;
@ApiModelProperty("模板名称")
private String templateName;
@ApiModelProperty("模板详情列表")
private List<HygieneTemplateDetailEntity> templateDetailList;
}

30
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateDetailEntity.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.Size;
/**
* @date 2024-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_hygiene_template_detail")
@ApiModel(value = "卫生自查模板详情表")
public class HygieneTemplateDetailEntity extends BaseEntity {
@ApiModelProperty("模板id")
private Long templateId;
@Size(max = 50, message = "责任区字段长度不能超过50")
@ApiModelProperty("责任区")
private String zone;
@ApiModelProperty("检查项")
private String checkItem;
}

21
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateEntity.java

@ -0,0 +1,21 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
* @date 2024-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_hygiene_template")
@ApiModel(value = "卫生自查模板表")
public class HygieneTemplateEntity extends BaseEntity {
@ApiModelProperty("模板名称")
private String templateName;
}

26
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneTemplateDetailVO.java

@ -0,0 +1,26 @@
package com.hnac.hzims.safeproduct.vo;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author liwen
* @date 2024-04-30
*/
@Data
@ApiModel(value = "卫生自查模板详情VO类")
public class HygieneTemplateDetailVO {
@ApiModelProperty("模板id")
private Long id;
@ApiModelProperty("模板名称")
private String templateName;
@ApiModelProperty("模板详情列表")
private List<HygieneTemplateDetailEntity> templateDetailList;
}

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java

@ -127,7 +127,7 @@ public class MessageServiceImpl implements MessageService {
.createUser(CommonConstant.SYSTEM_USER)
.params(new HashMap<String,String>(){{
put("projectName",entity.getStationName());
put("deviceName", Optional.ofNullable(entity.getDeviceName()).orElse("未知设备"));
put("deviceName", Optional.ofNullable(entity.getDeviceName()).orElse(""));
put("ruleDefName",entity.getAlarmContext());
put("ts", DateUtil.format(entity.getAlarmTime(),DateUtil.PATTERN_DATETIME));
}})

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.scheduled.mapper.inspect.TaskMapper;
import com.hnac.hzims.scheduled.service.inspect.TaskService;
import com.hnac.hzinfo.inspect.task.TaskContants;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import lombok.AllArgsConstructor;
@ -49,7 +50,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
task.setInspectTaskSum(tasks.size());
// 所有处理完成巡检任务
List<TaskEntity> finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(4)).collect(Collectors.toList());
List<TaskEntity> finshList = tasks.stream().filter(o-> null != o.getStatus() && TaskContants.TaskStatusEnum.FINISH_STATUS.getStatus().equals(String.valueOf(o.getStatus()))).collect(Collectors.toList());
if(CollectionUtil.isEmpty(finshList)){
return task;
}

49
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java

@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.stereotype.Service;
@ -97,12 +98,16 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
last(" LIMIT 1");
}});
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
if(ObjectUtil.isNotEmpty(imsDutyMainPersonEntity)){
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
}
} else {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId());
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
if(ObjectUtil.isNotEmpty(imsDutyGroupEntity)){
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
}
}
if (ObjectUtil.isEmpty(dutyMainInfoVo)) {
return null;
@ -140,11 +145,13 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
NextDutyInfoVo dutyInfoVo = new NextDutyInfoVo();
dutyInfoVo.setGroupName(dutyMainInfoVo.getGroupName());
dutyInfoVo.setClassName(dutyMainInfoVo.getClassName());
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
if(StringUtil.isNotBlank(dutyMainInfoVo.getManagerId())){
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
}
}
dutyInfoVo.setGeneratingCapacity(0);
return dutyInfoVo;
@ -165,12 +172,16 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
last("limit 1");
}});
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
if(ObjectUtil.isNotEmpty(imsDutyMainPersonEntity)){
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
}
} else {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId());
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
if(ObjectUtil.isNotEmpty(imsDutyGroupEntity)){
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
}
}
if (ObjectUtil.isEmpty(dutyMainInfoVo)) {
return null;
@ -180,11 +191,13 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
dutyMainInfoVo.setDateTime(dutyMainInfoVo.getDateTime());
dutyMainInfoVo.setStartTime(dutyMainInfoVo.getStartTime());
dutyMainInfoVo.setEndTime(dutyMainInfoVo.getEndTime());
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyMainInfoVo.setManagerName(user.getRealName());
dutyMainInfoVo.setManagerPhone(user.getPhone());
if(StringUtil.isNotBlank(dutyMainInfoVo.getManagerId())){
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyMainInfoVo.setManagerName(user.getRealName());
dutyMainInfoVo.setManagerPhone(user.getPhone());
}
}
return dutyMainInfoVo;
}

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -269,7 +269,6 @@ public class RealTargetServiceImpl implements RealTargetService {
// 水电站站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER)
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
);
if(CollectionUtil.isEmpty(stations)){
return;
@ -1227,9 +1226,6 @@ public class RealTargetServiceImpl implements RealTargetService {
public void loadPowerData(String param, List<Integer> types, Integer serveType, int year) {
// 站点查询
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
if (ObjectUtil.isNotEmpty(serveType)) {
eq(StationEntity::getServeType, serveType);
}
if (CollectionUtil.isNotEmpty(types)) {
in(StationEntity::getType, types);
}

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/DataService.java

@ -8,6 +8,7 @@ import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
@ -26,5 +27,7 @@ public interface DataService {
List<AnalyzeDataConditionVO> periodTargetSignages(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, List<String> signages);
List<Map<String, String>> lastFirstBySignage(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages);
Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Double ride ,String signages);
}

46
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java

@ -11,10 +11,14 @@ import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.hnac.hzinfo.sdk.v5.device.dto.HisDataDeviceDTO;
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionAttrDataDTO;
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionDataDTO;
import com.hnac.hzinfo.sdk.v5.device.vo.ReductionDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
@ -27,7 +31,7 @@ import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -151,6 +155,44 @@ public class DataServiceImpl implements DataService {
return result.getData();
}
/**
* 最后值减最初值
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值 7=最后值减最初值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号
* @param signage 属性
* @return
*/
@Override
public List<Map<String, String>> lastFirstBySignage(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signage) {
ReductionDataDTO reduction = new ReductionDataDTO();
reduction.setFull(1);
reduction.setDeviceCode(deviceCode);
reduction.setSaveTimeType(cycleType);
reduction.setTimeInterval(1);
reduction.setNeedPage(false);
reduction.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
reduction.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
// 属性列表
List<ReductionAttrDataDTO> atts = new ArrayList<>();
ReductionAttrDataDTO attr = new ReductionAttrDataDTO();
attr.setAccessRules(accessRules);
attr.setKeepFigures(4);
attr.setSignage(signage);
atts.add(attr);
reduction.setDtos(atts);
Result<ReductionDataVO> result = deviceDataClient.pageDeviceCodeAndSignages(reduction);
if (!result.isSuccess() || ObjectUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
if(MapUtils.isEmpty(result.getData().getFieldMap()) || CollectionUtil.isEmpty(result.getData().getDataList())){
return new ArrayList<>();
}
return result.getData().getDataList();
}
/***
* 指标数据列表查询
* @param startTime 开始时间

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -1217,6 +1217,7 @@ public class TargetServiceImpl implements TargetService {
}
}};
IPage pages = accessTaskService.page(page, queryWrapper);
pages.setRecords(OperAccessTaskWrapper.build().listVOExtras(pages.getRecords()));
return pages;
}
@ -1241,7 +1242,8 @@ public class TargetServiceImpl implements TargetService {
List<PowerMonthVo> powerMonths = generateService.fillPowerMon(station.getCode());
return powerMonths.stream().map(mon->{
HydropowerTargetDetailVo detail = new HydropowerTargetDetailVo();
detail.setTime(mon.getStrMonth());
Date date = DateUtil.parse(mon.getStrMonth() + " 00:00:00",DateUtil.PATTERN_DATETIME);
detail.setTime(DateUtil.format(date,"yyyy-MM"));
if(MapUtils.isEmpty(powerMap)){
detail.setElectric(Double.valueOf(mon.getPower()));
return detail;
@ -1263,26 +1265,16 @@ public class TargetServiceImpl implements TargetService {
return powerDays.stream().map(day->{
HydropowerTargetDetailVo detail = new HydropowerTargetDetailVo();
detail.setTime(day.getDate());
detail.setElectric(Double.valueOf(day.getGenerate()));
if(CollectionUtil.isEmpty(targets)){
detail.setElectric(Double.valueOf(day.getGenerate()));
return detail;
}
List<HydropowerUnitTargetVo> stationTargets = targets.stream().filter(o->o.getDeptId().equals(station.getRefDept())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(stationTargets)){
detail.setElectric(Double.valueOf(day.getGenerate()));
return detail;
}
List<GenerationPowerVo> generations = stationTargets.get(0).getGenerationPowerVoList();
// 设备指标数据
List<GenerationPowerVo> generations = targets.stream().filter(o-> CollectionUtil.isNotEmpty(o.getGenerationPowerVoList()) && o.getDeptId().equals(station.getRefDept())).flatMap(v -> v.getGenerationPowerVoList().stream()).collect(Collectors.toList());
if(CollectionUtil.isEmpty(generations)){
detail.setElectric(Double.valueOf(day.getGenerate()));
return detail;
}
List<GenerationPowerVo> dayGenerations = generations.stream().filter(generation -> generation.getDate().equals(day.getDate())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(dayGenerations)){
detail.setElectric(Double.valueOf(day.getGenerate()));
return detail;
}
detail.setElectric((double) (day.getGenerate() + dayGenerations.get(0).getGenerate()));
detail.setElectric(generations.stream().filter(o->o.getDate().equals(day.getDate())).mapToDouble(GenerationPowerVo::getGenerate).sum());
return detail;
}).collect(Collectors.toList());
}else{

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java

@ -123,6 +123,8 @@ public class StationVideoTypeController extends BladeController {
return list.size() > 0 ? R.fail(400, "该名称已录入数据,请找到相应记录做修改处理") : R.status(stationVideoTypeService.save(req));
}
/**
* 修改 代码自定义代号
*/
@ -328,4 +330,28 @@ public class StationVideoTypeController extends BladeController {
return R.data(stationVideoTypeService.getVideoPointByRegion(refDept,regionCode));
}
@PostMapping("/saveBatch")
@ApiOperationSupport(order = 170)
@ApiOperation(value = "批量保存视频配置记录")
public R saveBatch(@RequestBody List<StationVideoTypeEntity> entitys) {
return R.status(stationVideoTypeService.saveBatch(entitys));
}
@GetMapping ("/checkSaveEntry")
@ApiOperationSupport(order = 180)
@ApiOperation(value = "监查保存记录")
public R checkSaveEntry(@RequestParam(value = "pointCode") String pointCode,
@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "name") String name) {
StationVideoTypeEntity entity = stationVideoTypeService.getOne(Wrappers.<StationVideoTypeEntity>lambdaQuery()
.eq(StationVideoTypeEntity::getPointCode,pointCode)
.eq(StationVideoTypeEntity::getStationId,stationId)
.eq(StationVideoTypeEntity::getName,name)
);
if(ObjectUtil.isEmpty(entity)){
return R.data(true);
}
return R.data(false);
}
}

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/video/controller/VideoPlatformController.java

@ -1,9 +1,9 @@
package com.hnac.hzims.operational.video.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.common.invalid.Create;
import com.hnac.hzims.common.invalid.Update;
import com.hnac.hzims.common.support.constants.Order;
import com.hnac.hzims.common.support.utils.Condition;
import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.video.dto.VideoPlaybackDTO;
@ -19,13 +19,16 @@ import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* @author ysj
*/
@RestController
@Api(value = "视频平台管理",tags = "视频平台管理")
@RequestMapping("/video/platform")
@ -64,12 +67,13 @@ public class VideoPlatformController extends BladeController {
@ApiOperation("查询视频平台列表")
@ApiOperationSupport(order = 4)
@Operate(label = "查询视频平台列表",type = BusinessType.QUERY,ignore = false)
public R<List<VideoPlatformEntity>> list(VideoPlatformEntity req) {
HashMap<String, Order> sort = new HashMap<String, Order>() {{
put("create_time", Order.DESC);
}};
LambdaQueryWrapper<VideoPlatformEntity> queryWrapper = Condition.getQueryWrapper(req, VideoPlatformEntity.class, sort);
return R.data(videoPlatformService.list(queryWrapper));
public R<IPage<VideoPlatformEntity>> list(Query query, VideoPlatformEntity req) {
LambdaQueryWrapper<VideoPlatformEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.orderByDesc(VideoPlatformEntity::getCreateTime);
if(!StringUtil.isEmpty(req.getName())){
queryWrapper.like(VideoPlatformEntity::getName,req.getName());
}
return R.data(videoPlatformService.page(Condition.getPage(query),queryWrapper));
}
@DeleteMapping("/remove")

57
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java

@ -2,16 +2,17 @@ package com.hnac.hzims.safeproduct.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.dto.HygienePlanDTO;
import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO;
import com.hnac.hzims.safeproduct.dto.HygieneTemplateDTO;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity;
import com.hnac.hzims.safeproduct.service.IHygienePlanService;
import com.hnac.hzims.safeproduct.service.IHygieneRecordService;
import com.hnac.hzims.safeproduct.vo.HygienePlanDetailVO;
import com.hnac.hzims.safeproduct.vo.HygieneMonthVO;
import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO;
import com.hnac.hzims.safeproduct.service.IHygieneTemplateService;
import com.hnac.hzims.safeproduct.vo.*;
import com.hnac.hzinfo.log.annotation.Business;
import com.hnac.hzinfo.log.annotation.Operate;
import com.hnac.hzinfo.log.contants.BusinessType;
@ -47,6 +48,8 @@ public class HygieneController extends BladeController {
private final IHygieneRecordService hygieneRecordService;
private final IHygieneTemplateService hygieneTemplateService;
@PostMapping("/savePlan")
@ApiOperation(value = "新增卫生自查计划")
@ApiOperationSupport(order = 1)
@ -183,4 +186,50 @@ public class HygieneController extends BladeController {
public void exportHygienePlanData(@ApiIgnore @RequestParam Map<String, Object> param, HttpServletResponse response) {
hygienePlanService.exportHygienePlanData(param, response);
}
@PostMapping("/saveHygieneTemplate")
@ApiOperation(value = "新增卫生自查模板")
@ApiOperationSupport(order = 15)
@Operate(label = "新增卫生自查模板", type = BusinessType.INSERT, ignore = false)
public R saveHygieneTemplate(@RequestBody HygieneTemplateDTO hygieneTemplateDTO) {
boolean save = hygieneTemplateService.saveHygieneTemplate(hygieneTemplateDTO);
return R.status(save);
}
@PostMapping("/updateHygieneTemplate")
@ApiOperation(value = "修改卫生自查模板")
@ApiOperationSupport(order = 16)
@Operate(label = "修改卫生自查模板", type = BusinessType.UPDATE, ignore = false)
public R updateHygieneTemplate(@RequestBody HygieneTemplateDTO hygieneTemplateDTO) {
boolean update = hygieneTemplateService.updateHygieneTemplate(hygieneTemplateDTO);
return R.status(update);
}
@PostMapping("/removeHygieneTemplate")
@ApiOperation(value = "删除卫生自查模板")
@ApiOperationSupport(order = 17)
@Operate(label = "删除卫生自查模板", type = BusinessType.DELETE, ignore = false)
public R removeHygieneTemplate(@RequestParam Long id) {
boolean remove = hygieneTemplateService.removeHygieneTemplate(id);
return R.status(remove);
}
@GetMapping("/hygieneTemplateDetail")
@ApiOperation(value = "卫生自查模板详情")
@ApiOperationSupport(order = 18)
@Operate(label = "卫生自查模板详情", type = BusinessType.QUERY, ignore = false)
public R hygieneTemplateDetail(@RequestParam Long id) {
HygieneTemplateDetailVO detail = hygieneTemplateService.getHygieneTemplateDetail(id);
return R.data(detail);
}
@GetMapping("/hygieneTemplatePage")
@ApiOperation(value = "卫生自查模板分页")
@ApiOperationSupport(order = 19)
@Operate(label = "卫生自查模板分页", type = BusinessType.QUERY, ignore = false)
public R hygieneTemplatePage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<HygieneTemplateEntity> page = hygieneTemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(
param, HygieneTemplateEntity.class));
return R.data(page);
}
}

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 卫生自查模板详情Mapper类
*
* @date 2024-04-29
*/
@Mapper
public interface HygieneTemplateDetailMapper extends BaseMapper<HygieneTemplateDetailEntity> {
}

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

@ -0,0 +1,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.HygieneTemplateDetailMapper">
</mapper>

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 卫生自查模板Mapper类
*
* @date 2024-04-29
*/
@Mapper
public interface HygieneTemplateMapper extends BaseMapper<HygieneTemplateEntity> {
}

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

@ -0,0 +1,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.HygieneTemplateMapper">
</mapper>

21
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateDetailService.java

@ -0,0 +1,21 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity;
import java.util.List;
/**
* 卫生自查模板详情服务类
*
* @date 2024-04-29
*/
public interface IHygieneTemplateDetailService extends IService<HygieneTemplateDetailEntity> {
/**
* 根据模板id查找模板详情数据
* @param templateId 模板id
* @return 模板详情列表
*/
List<HygieneTemplateDetailEntity> getListByTemplateId(Long templateId);
}

42
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateService.java

@ -0,0 +1,42 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.HygieneTemplateDTO;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity;
import com.hnac.hzims.safeproduct.vo.HygieneTemplateDetailVO;
/**
* 卫生自查模板服务类
*
* @date 2024-04-29
*/
public interface IHygieneTemplateService extends IService<HygieneTemplateEntity> {
/**
* 新增卫生自查模板
* @param hygieneTemplateDTO 卫生自查模板DTO类
* @return true-成功false-失败
*/
boolean saveHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO);
/**
* 修改卫生自查模板
* @param hygieneTemplateDTO 卫生自查模板DTO类
* @return true-成功false-失败
*/
boolean updateHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO);
/**
* 删除卫生自查模板
* @param id 卫生自查模板id
* @return true-成功false-失败
*/
boolean removeHygieneTemplate(Long id);
/**
* 卫生自查模板详情
* @param id 卫生自查模板id
* @return 详情
*/
HygieneTemplateDetailVO getHygieneTemplateDetail(Long id);
}

30
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateDetailServiceImpl.java

@ -0,0 +1,30 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity;
import com.hnac.hzims.safeproduct.mapper.HygieneTemplateDetailMapper;
import com.hnac.hzims.safeproduct.service.IHygieneTemplateDetailService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 卫生自查模板详情服务实现类
*
* @date 2024-04-29
*/
@Service
public class HygieneTemplateDetailServiceImpl extends ServiceImpl<HygieneTemplateDetailMapper, HygieneTemplateDetailEntity>
implements IHygieneTemplateDetailService {
/**
* 根据模板id查找模板详情数据
*/
@Override
public List<HygieneTemplateDetailEntity> getListByTemplateId(Long templateId) {
QueryWrapper<HygieneTemplateDetailEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(HygieneTemplateDetailEntity::getTemplateId, templateId);
return this.list(queryWrapper);
}
}

107
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateServiceImpl.java

@ -0,0 +1,107 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.dto.HygieneTemplateDTO;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity;
import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity;
import com.hnac.hzims.safeproduct.mapper.HygieneTemplateMapper;
import com.hnac.hzims.safeproduct.service.IHygieneTemplateDetailService;
import com.hnac.hzims.safeproduct.service.IHygieneTemplateService;
import com.hnac.hzims.safeproduct.vo.HygieneTemplateDetailVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
/**
* 卫生自查模板服务实现类
*
* @date 2024-04-29
*/
@Service
public class HygieneTemplateServiceImpl extends ServiceImpl<HygieneTemplateMapper, HygieneTemplateEntity> implements IHygieneTemplateService {
@Autowired
IHygieneTemplateDetailService hygieneTemplateDetailService;
/**
* 新增卫生自查模板
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO) {
String templateName = hygieneTemplateDTO.getTemplateName();
QueryWrapper<HygieneTemplateEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(HygieneTemplateEntity::getTemplateName, templateName);
List<HygieneTemplateEntity> list = this.list(queryWrapper);
if (CollectionUtil.isNotEmpty(list)) {
throw new ServiceException("模板名不可重复");
}
HygieneTemplateEntity hygieneTemplate = new HygieneTemplateEntity();
hygieneTemplate.setTemplateName(templateName);
boolean saveTemplate = this.save(hygieneTemplate);
if (!saveTemplate) {
throw new ServiceException("卫生自查模板新增失败");
}
return hygieneTemplateDetailService.saveBatch(hygieneTemplateDTO.getTemplateDetailList());
}
/**
* 修改卫生自查模板
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO) {
String templateName = hygieneTemplateDTO.getTemplateName();
Long templateId = hygieneTemplateDTO.getTemplateId();
QueryWrapper<HygieneTemplateEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(HygieneTemplateEntity::getTemplateName, templateName);
queryWrapper.lambda().ne(HygieneTemplateEntity::getId, templateId);
List<HygieneTemplateEntity> list = this.list(queryWrapper);
if (CollectionUtil.isNotEmpty(list)) {
throw new ServiceException("模板名不可重复");
}
HygieneTemplateEntity hygieneTemplate = new HygieneTemplateEntity();
hygieneTemplate.setId(templateId);
hygieneTemplate.setTemplateName(templateName);
boolean updateTemplate = this.updateById(hygieneTemplate);
if (!updateTemplate) {
throw new ServiceException("卫生自查模板修改失败");
}
return hygieneTemplateDetailService.updateBatchById(hygieneTemplateDTO.getTemplateDetailList());
}
/**
* 删除卫生自查模板
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removeHygieneTemplate(Long id) {
boolean removeTemplate = this.removeById(id);
if (!removeTemplate) {
throw new ServiceException("卫生自查模板删除失败");
}
List<HygieneTemplateDetailEntity> details = hygieneTemplateDetailService.getListByTemplateId(id);
List<Long> ids = details.stream().map(HygieneTemplateDetailEntity::getId).collect(Collectors.toList());
return hygieneTemplateDetailService.removeByIds(ids);
}
/**
* 卫生自查模板详情
*/
@Override
public HygieneTemplateDetailVO getHygieneTemplateDetail(Long id) {
HygieneTemplateDetailVO hygieneTemplateDetailVO = new HygieneTemplateDetailVO();
HygieneTemplateEntity hygieneTemplate = this.getById(id);
BeanUtils.copyProperties(hygieneTemplate, hygieneTemplateDetailVO);
List<HygieneTemplateDetailEntity> details = hygieneTemplateDetailService.getListByTemplateId(id);
hygieneTemplateDetailVO.setTemplateDetailList(details);
return hygieneTemplateDetailVO;
}
}

30
hzims-service/safeproduct/src/main/resources/db/2.0.1.sql

@ -11,3 +11,33 @@ ALTER TABLE hzims_rehearsal_plan
-- 特种设备表:添加单位字段
ALTER TABLE hzims_device
ADD COLUMN unit varchar(50) NOT NULL COMMENT '单位';
-- 新增卫生自查模板表
CREATE TABLE IF NOT EXISTS `hzims_hygiene_template` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`template_name` varchar(50) 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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='卫生自查模板表';
-- 新增卫生自查模板详情表
CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`template_id` bigint(20) NOT NULL COMMENT '模板id',
`zone` varchar(50) NOT NULL COMMENT '责任区',
`check_item` 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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='卫生自查模板详情表';

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketPrincipalChangeController.java

@ -102,7 +102,7 @@ public class WorkTicketPrincipalChangeController {
@ApiOperationSupport(order = 70)
@ApiOperation(value = "变更负责人人员选择列表")
public R userListByDeptId(@RequestParam(value = "deptId") Long deptId){
return userClient.userListByDeptId(deptId);
return userClient.userByDeptId("200000",deptId);
}
}

Loading…
Cancel
Save