Browse Source

#bug修改

zhongwei
yang_shj 2 years ago
parent
commit
436cad9d93
  1. 42
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DutyGroupVo.java
  2. 25
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/TicketGroupVo.java
  3. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java
  4. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java
  5. 38
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

42
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DutyGroupVo.java

@ -0,0 +1,42 @@
package com.hnac.hzims.operational.census.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/14 15:01:17
* @version 4.0.0
*/
@Data
public class DutyGroupVo {
@ApiModelProperty("区域Id")
private Long deptId;
@ApiModelProperty("区域名称")
private String areaName;
@ApiModelProperty("工作票数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer work;
@ApiModelProperty("操作票数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer operateoperate;
@ApiModelProperty("巡检任务数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer inspect;
@ApiModelProperty("消缺数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer defect;
@ApiModelProperty("定期工作数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer regularly;
}

25
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/TicketGroupVo.java

@ -1,25 +0,0 @@
package com.hnac.hzims.operational.census.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/14 15:01:17
* @version 4.0.0
*/
@Data
public class TicketGroupVo {
@ApiModelProperty("区域Id")
private Long deptId;
@ApiModelProperty("区域名称")
private String areaName;
@ApiModelProperty("票据数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer count;
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java

@ -140,9 +140,9 @@ public class TargetController {
@ApiLog @ApiLog
@ApiOperation("集团操作票/工作票") @ApiOperation("集团操作票/工作票")
@GetMapping("/ticket-group") @GetMapping("/duty-group")
@ApiOperationSupport(order = 14) @ApiOperationSupport(order = 14)
public R ticketGroup(@RequestParam(value = "areaName",required = false) String areaName,@RequestParam(value = "type") Long type) { public R dutygroup(@RequestParam(value = "areaName",required = false) String areaName,@RequestParam(value = "type") Long type) {
return R.data(service.ticketGroup(areaName,type)); return R.data(service.dutyGroup(areaName,type));
} }
} }

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO;
import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; import com.hnac.hzims.operational.access.vo.OperAccessTaskVO;
import com.hnac.hzims.operational.census.vo.*; import com.hnac.hzims.operational.census.vo.*;
import com.hnac.hzims.operational.main.vo.PhotovoltaicTargetVo;
import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -62,6 +61,5 @@ public interface TargetService {
List<DeviceGroupVo> deviceGroup(String areaName); List<DeviceGroupVo> deviceGroup(String areaName);
// 集团工作牌/操作票 // 集团工作牌/操作票
List<TicketGroupVo> ticketGroup(String areaName,Long type); List<DutyGroupVo> dutyGroup(String areaName, Long type);
} }

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

@ -1009,7 +1009,7 @@ public class TargetServiceImpl implements TargetService {
* @return * @return
*/ */
@Override @Override
public List<TicketGroupVo> ticketGroup(String areaName,Long type) { public List<DutyGroupVo> dutyGroup(String areaName, Long type) {
// 获取区域机构 // 获取区域机构
Map<Dept, List<StationEntity>> areas = areaService.getAuthArea(null,null,Collections.singletonList(HomePageConstant.HYDROPOWER),HomePageConstant.HYDROPOWER_SERVETYPE); Map<Dept, List<StationEntity>> areas = areaService.getAuthArea(null,null,Collections.singletonList(HomePageConstant.HYDROPOWER),HomePageConstant.HYDROPOWER_SERVETYPE);
if(MapUtils.isEmpty(areas)){ if(MapUtils.isEmpty(areas)){
@ -1017,21 +1017,31 @@ public class TargetServiceImpl implements TargetService {
} }
// redis中取区域数据 // redis中取区域数据
List<AreaDutyVo> areaDutyVoList = (List<AreaDutyVo>) redisTemplate.opsForValue().get(areaDutyInfoKey); List<AreaDutyVo> areaDutyVoList = (List<AreaDutyVo>) redisTemplate.opsForValue().get(areaDutyInfoKey);
return areas.entrySet().stream().filter(o-> StringUtil.isEmpty(areaName) || o.getKey().getDeptName().contains(areaName)).map(area->{ return areas.keySet().stream().filter(stationEntities -> StringUtil.isEmpty(areaName) || stationEntities.getDeptName().contains(areaName)).map(stationEntities -> {
TicketGroupVo ticket = new TicketGroupVo(); DutyGroupVo duty = new DutyGroupVo();
ticket.setDeptId(area.getKey().getId()); duty.setDeptId(stationEntities.getId());
ticket.setAreaName(area.getKey().getDeptName()); duty.setAreaName(stationEntities.getDeptName());
List<AreaDutyVo> dutys = areaDutyVoList.stream().filter(duty-> duty.getDepartId().equals(area.getKey().getId())).collect(Collectors.toList()); List<AreaDutyVo> dutys = areaDutyVoList.stream().filter(area -> area.getDepartId().equals(stationEntities.getId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(dutys)){ if (CollectionUtil.isEmpty(dutys)) {
ticket.setCount(0); return duty;
return ticket;
} }
if(type == 0){ // 操作票
ticket.setCount(dutys.get(0).getOperationTicketCount()); if (type == 0) {
}else{ duty.setOperateoperate(dutys.get(0).getOperationTicketCount());
ticket.setCount(dutys.get(0).getWorkTicketCount()); // 工作票
} else if (type == 1) {
duty.setWork(dutys.get(0).getWorkTicketCount());
// 巡检
} else if (type == 2) {
duty.setInspect(dutys.get(0).getInspectionSum());
// 缺陷
} else if (type == 3) {
duty.setDefect(dutys.get(0).getShortagesSum());
// 定期工作
} else if (type == 4) {
duty.setRegularly(dutys.get(0).getWorkRegularlySum());
} }
return ticket; return duty;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }

Loading…
Cancel
Save