yang_shj
9 months ago
35 changed files with 454 additions and 144 deletions
@ -0,0 +1,31 @@ |
|||||||
|
package com.hnac.hzims.safeproduct.feign; |
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import com.hnac.hzims.safeproduct.Constants; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author xiashandong |
||||||
|
* @created 2021/6/10 15:21 |
||||||
|
**/ |
||||||
|
@FeignClient( |
||||||
|
value = Constants.APP_NAME, |
||||||
|
fallback = ISafeInnerDangerClientFallback.class |
||||||
|
) |
||||||
|
public interface ISafeInnerDangerClient { |
||||||
|
|
||||||
|
String API_PREFIX = "/feign/hiddenDangerStart"; |
||||||
|
|
||||||
|
String SAVE_HIDDENDANGER = API_PREFIX + "/saveHiddenDanger"; |
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(SAVE_HIDDENDANGER) |
||||||
|
R saveDefect(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package com.hnac.hzims.safeproduct.feign; |
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author ysj |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@Component |
||||||
|
public class ISafeInnerDangerClientFallback implements ISafeInnerDangerClient { |
||||||
|
|
||||||
|
@Override |
||||||
|
public R saveDefect(ProcessWorkFlowResponse processWorkFlowResponse) { |
||||||
|
log.error("远程调用失败,接口:" + SAVE_HIDDENDANGER); |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
package com.hnac.hzims.middle.processflow.strategy.serviceimpl; |
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import com.hnac.hzims.middle.processflow.service.ProcessDictService; |
||||||
|
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; |
||||||
|
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; |
||||||
|
import com.hnac.hzims.safeproduct.risk.feign.IHazardRiskClient; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.log.exception.ServiceException; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.HAZARD_RISK; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author ysj |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@Service |
||||||
|
@RequiredArgsConstructor |
||||||
|
public class HazardRiskServiceImpl extends ProcessAbstractService { |
||||||
|
|
||||||
|
private final IHazardRiskClient hazardRiskClient; |
||||||
|
|
||||||
|
private final ProcessDictService processDictService; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 消息确认 |
||||||
|
* @param flowQueue |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { |
||||||
|
String dictValue = processDictService.selectDictValueByKey(HAZARD_RISK); |
||||||
|
return dictValue.equals(flowQueue.getProcessDefinitionKey()); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 调用检修业务处理 |
||||||
|
* @param response |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public void calculate(ProcessWorkFlowResponse response) { |
||||||
|
R defect = hazardRiskClient.listener(response); |
||||||
|
if (!defect.isSuccess()) { |
||||||
|
throw new ServiceException("检修任务业务执行异常!"); |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,65 @@ |
|||||||
|
package com.hnac.hzims.middle.processflow.strategy.serviceimpl; |
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import com.hnac.hzims.middle.processflow.service.ProcessDictService; |
||||||
|
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; |
||||||
|
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; |
||||||
|
import com.hnac.hzims.safeproduct.feign.ISafeInnerDangerClient; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.log.exception.ServiceException; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.HIDDEN_DANGER_CHECK; |
||||||
|
|
||||||
|
/** |
||||||
|
* 隐患排查 |
||||||
|
* |
||||||
|
* @Author ty |
||||||
|
* @Version v1.0 |
||||||
|
* @Serial 1.0 |
||||||
|
* @Date 2023/9/18 9:04 |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@Service |
||||||
|
@RequiredArgsConstructor |
||||||
|
public class HiddenDangerFlowServiceImpl extends ProcessAbstractService { |
||||||
|
|
||||||
|
|
||||||
|
private final ProcessDictService processDictService; |
||||||
|
|
||||||
|
|
||||||
|
private final ISafeInnerDangerClient iSafeInnerDangerClient; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设置执行那种实现类 |
||||||
|
* |
||||||
|
* @param flowQueue |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { |
||||||
|
String dictValue = processDictService.selectDictValueByKey(HIDDEN_DANGER_CHECK); |
||||||
|
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) { |
||||||
|
log.info("已执行隐患排查工作流程环节操作~~~~"); |
||||||
|
return true; |
||||||
|
} |
||||||
|
log.error("未执行隐患排查流程环节操作,请联系管理员~~~~"); |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 隐患排查业务方法 |
||||||
|
* |
||||||
|
* @param response |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public void calculate(ProcessWorkFlowResponse response) { |
||||||
|
R dealtDutyRecFlow = iSafeInnerDangerClient.saveDefect(response); |
||||||
|
if (!dealtDutyRecFlow.isSuccess()){ |
||||||
|
throw new ServiceException("隐患排查流程失败"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.ai.dto.robot; |
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank; |
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
@ApiModel(value = "机器人设备实例DTO对象",description = "机器人设备实例DTO对象") |
||||||
|
public class RobotInstanceDTO implements Serializable { |
||||||
|
|
||||||
|
@ApiModelProperty("设备编号") |
||||||
|
@NotBlank(message = "机器人编号不能为空") |
||||||
|
private String deviceCode; |
||||||
|
|
||||||
|
@ApiModelProperty("机器人名称") |
||||||
|
@NotBlank(message = "机器人名称不能为空") |
||||||
|
private String deviceName; |
||||||
|
|
||||||
|
@ApiModelProperty("模型标识") |
||||||
|
private String modelSignage; |
||||||
|
|
||||||
|
@ApiModelProperty("站点编号") |
||||||
|
@NotBlank(message = "站点编号不能为空") |
||||||
|
private String projectId; |
||||||
|
|
||||||
|
@ApiModelProperty("标准设备需要传入密钥") |
||||||
|
private String secretKey; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.ai.vo.robot; |
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||||
|
import com.hnac.hzinfo.sdk.v5.device.vo.RealDataRedisVO; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
public class RobotRealDataVO extends RealDataRedisVO implements Serializable { |
||||||
|
@ApiModelProperty("数据上送时间") |
||||||
|
private String ts; |
||||||
|
|
||||||
|
@ApiModelProperty("实时数据") |
||||||
|
private String v; |
||||||
|
|
||||||
|
@ApiModelProperty("上送数据质量,0为有效") |
||||||
|
private String q; |
||||||
|
|
||||||
|
@JsonIgnore |
||||||
|
private String n; |
||||||
|
|
||||||
|
@ApiModelProperty("物模型属性ID") |
||||||
|
private String attrId; |
||||||
|
|
||||||
|
@JsonIgnore |
||||||
|
private String realId; |
||||||
|
|
||||||
|
@JsonIgnore |
||||||
|
private Long attrType; |
||||||
|
|
||||||
|
@ApiModelProperty("物模型属性标识") |
||||||
|
@JsonIgnore |
||||||
|
private String signage; |
||||||
|
|
||||||
|
@ApiModelProperty("物模型属性名称") |
||||||
|
private String attrName; |
||||||
|
|
||||||
|
@ApiModelProperty("启停状态") |
||||||
|
private Integer state; |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.constants; |
||||||
|
|
||||||
|
public interface ParamConstants { |
||||||
|
|
||||||
|
/**机器人模型编号**/ |
||||||
|
String ROBOT_MODEL_CODE = "robot.model.code"; |
||||||
|
|
||||||
|
/**机器人状态属性**/ |
||||||
|
String ROBOT_DEVICE_ATTR_ENABLE = "robot.device.attr.enable"; |
||||||
|
|
||||||
|
} |
@ -1,4 +1,4 @@ |
|||||||
package com.hnac.hzims.operational.workOrder.dto; |
package com.hnac.hzims.operational.workOrder.dto; |
||||||
|
@Deprecated |
||||||
public class InspectionOrderContentDTO { |
public class InspectionOrderContentDTO { |
||||||
} |
} |
||||||
|
@ -0,0 +1,25 @@ |
|||||||
|
package com.hnac.hzims.safeproduct.feign; |
||||||
|
|
||||||
|
|
||||||
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||||
|
import com.hnac.hzims.safeproduct.flow.service.IInnerDangerFlowService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
public class SafeInnerDangerClient implements ISafeInnerDangerClient { |
||||||
|
|
||||||
|
private IInnerDangerFlowService service; |
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(SAVE_HIDDENDANGER) |
||||||
|
@Override |
||||||
|
public R saveDefect(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse) { |
||||||
|
return service.listenAndUpdateDefect(processWorkFlowResponse); |
||||||
|
} |
||||||
|
} |
Binary file not shown.
Loading…
Reference in new issue