Browse Source

# 设备bug修改

# 根据设备获取巡检项目/内容接口开发
zhongwei
haungxing 1 year ago
parent
commit
5f9325edaa
  1. 4
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  2. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java
  3. 8
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java
  4. 15
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java
  5. 11
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java
  6. 6
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

4
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

@ -558,8 +558,8 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
if (Func.isNotEmpty(childrenMap)) { if (Func.isNotEmpty(childrenMap)) {
DeviceChildrenVO deviceChildrenVO = childrenMap.get(vo.getAttrSignage()); DeviceChildrenVO deviceChildrenVO = childrenMap.get(vo.getAttrSignage());
vo.setInstanceFacDeviceId(deviceChildrenVO.getRealId()); vo.setInstanceFacDeviceId(Optional.ofNullable(deviceChildrenVO).map(DeviceChildrenVO::getRealId).orElse(null));//deviceChildrenVO.getRealId()
vo.setInstanceFacDeviceName(deviceChildrenVO.getFacName()); vo.setInstanceFacDeviceName(Optional.ofNullable(deviceChildrenVO).map(DeviceChildrenVO::getFacName).orElse(null));//deviceChildrenVO.getFacName()
} }
emInfoContentList.add(vo); emInfoContentList.add(vo);
} }

3
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java

@ -21,6 +21,7 @@ import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO;
import com.hnac.hzims.util.HttpClientUtils; import com.hnac.hzims.util.HttpClientUtils;
import com.hnac.hzims.util.pojo.HttpResponse; import com.hnac.hzims.util.pojo.HttpResponse;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
@ -45,7 +46,7 @@ import java.util.stream.Collectors;
* @created 2021-05-25 17:32 * @created 2021-05-25 17:32
**/ **/
@Service @Service
@AllArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEntity> implements IFdpTaskService { public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEntity> implements IFdpTaskService {
private final IOperPhenomenonClient operPhenomenonClient; private final IOperPhenomenonClient operPhenomenonClient;

8
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java

@ -2,6 +2,7 @@ package com.hnac.hzinfo.inspect.obj.services;
import java.util.List; import java.util.List;
import java.util.Map;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO;
@ -41,4 +42,11 @@ public interface ProjectService extends BaseService<ProjectEntity>{
* @return * @return
*/ */
ProjectVO getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query); ProjectVO getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query);
/**
* 根据多个设备编号逗号分隔获取项目以及内容列表分页展示
* @param emCodes 设备编号逗号分隔
* @return Map key-emCode value-projectVO
*/
Map<String,ProjectVO> getProjectAndContentByEmCodes(String emCodes);
} }

15
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java

@ -32,7 +32,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -129,4 +131,17 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectMapper, ProjectEn
} }
return null; return null;
} }
@Override
public Map<String, ProjectVO> getProjectAndContentByEmCodes(String emCodes) {
Query query = new Query();
query.setCurrent(1);
query.setSize(-1);
Map<String,ProjectVO> result = new HashMap<>();
Stream.of(emCodes.split(",")).forEach(emCode -> {
ProjectVO project = this.getProjectAndContentByEmCode(emCode,new ContentDTO(),query);
result.put(emCode,project);
});
return result;
}
} }

11
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java

@ -22,6 +22,7 @@ import com.hnac.hzinfo.inspect.utils.Condition;
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 org.apache.ibatis.annotations.Mapper;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -34,8 +35,11 @@ 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.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 巡检项目 * 巡检项目
@ -157,4 +161,11 @@ public class ProjectController {
public R getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query) { public R getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query) {
return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query)); return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query));
} }
@GetMapping("/getProjectAndContentByEmCodes")
@ApiOperation(value = "根据多个设备编号(逗号分隔)获取项目以及内容列表(分页展示)")
@ApiOperationSupport(order = 8)
public R<Map<String,ProjectVO>> getProjectAndContentByEmCodes(@RequestParam String emCodes) {
return R.data(projectService.getProjectAndContentByEmCodes(emCodes));
}
} }

6
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -47,6 +47,7 @@ import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
@ -151,6 +152,8 @@ public class TicketProcessServiceImpl implements TicketProcessService {
private final ISysClient sysClient; private final ISysClient sysClient;
private final BladeLogger logger;
/** /**
* 启动开票流程 * 启动开票流程
@ -161,6 +164,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
@Override @Override
@Transactional @Transactional
public Long startUp(WorkTicketVo workTicketVo) { public Long startUp(WorkTicketVo workTicketVo) {
logger.info("ticket:start:request",JSON.toJSONString(workTicketVo));
log.info("执行 com.hnac.hzims.ticket.twoTicket.service.impl【startUp】 。。。方法"); log.info("执行 com.hnac.hzims.ticket.twoTicket.service.impl【startUp】 。。。方法");
if (workTicketVo.getWorkTicket().getSignage() == null) { if (workTicketVo.getWorkTicket().getSignage() == null) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置"); throw new ServiceException("票据抬头未配置,请您到站点管理配置");
@ -198,6 +202,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
workTicketVo.getWorkTicket().setCode(code); workTicketVo.getWorkTicket().setCode(code);
//3 .保存工作对象 //3 .保存工作对象
logger.info("ticket:start:vo",JSON.toJSONString(workTicketVo.getWorkTicket()));
this.saveWorkTicketInfo(workTicketVo.getWorkTicket()); this.saveWorkTicketInfo(workTicketVo.getWorkTicket());
//4. 保存安全措施 //4. 保存安全措施
this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket()); this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket());
@ -744,6 +749,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicket.setIsRailway(false); workTicket.setIsRailway(false);
workTicket.setIsLimited(false); workTicket.setIsLimited(false);
boolean isSave = firstWorkTicketService.save(workTicket); boolean isSave = firstWorkTicketService.save(workTicket);
logger.info("ticket:start:save",JSON.toJSONString(workTicket));
if (!isSave) { if (!isSave) {
throw new IllegalArgumentException("保存工作对象错误"); throw new IllegalArgumentException("保存工作对象错误");
} }

Loading…
Cancel
Save