Browse Source

上线yaml文件整理

zhongwei
ty 3 months ago
parent
commit
a171e5b069
  1. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyRecQRRecordMapper.java
  2. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
  3. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java
  4. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java
  5. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/controller/DistributeWorkOrderController.java
  6. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/IDistributeWorkOrderService.java
  7. 151
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyRecQRRecordMapper.java

@ -25,7 +25,6 @@ public interface ImsDutyRecQRRecordMapper extends UserDataScopeBaseMapper<ImsDut
* @return
*/
@UserDataAuth
List<ImsDutyRecQRRecordVo> selectPageList(IPage page,@Param(value = "vo") ImsDutyRecQRRecordVo vo);
List<ImsDutyRecQRRecordVo> selectPageList(@Param(value = "page")IPage page,@Param(value = "vo") ImsDutyRecQRRecordVo vo);
}

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

@ -225,10 +225,7 @@ public class StationVideoTypeController extends BladeController {
}
@RequestMapping(value = "/getVideoReviewerToken", method = {RequestMethod.GET, RequestMethod.POST})
public R<String> getVideoReviewerToken() {
return R.data(stationVideoTypeService.getVideoReviewerToken());
}
@GetMapping("/getVideoMonitorByAgency")

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationVideoTypeService.java

@ -48,11 +48,7 @@ public interface IStationVideoTypeService extends IService<StationVideoTypeEntit
*/
List<StationVideoTypeEntity> getVideoByIds(String ids,String randomCode);
/**
* 获取视频查看人员Token
* @return 视频查看人员Token
*/
String getVideoReviewerToken();
/**
* 获取海康威视各站点列表

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java

@ -58,8 +58,6 @@ public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMap
private final IHikVideoService hikVideoService;
@Value("${url.video.login}")
private String videoLoginUrl;
@Value("${hzims.video.random-code}")
private String definitionCode;
/** 秘钥appKey **/
@ -157,15 +155,7 @@ public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMap
return result;
}
@Override
public String getVideoReviewerToken() {
String result = HttpUtil.post(videoLoginUrl, "");
JSONObject resultObject = JSONObject.parseObject(result);
String data = resultObject.getString("data");
String access_token = JSONObject.parseObject(data).getString("access_token");
log.info("视频查看人员登陆token为:{}",access_token);
return access_token;
}
@Override
public List<JSONObject> getHikVisionStations() {

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/controller/DistributeWorkOrderController.java

@ -32,21 +32,8 @@ public class DistributeWorkOrderController {
private final IOperAccessTaskService operAccessTaskService;
private final IOperDefectService operDefectService;
@GetMapping("/testDistributeWorkOrder")
@ApiOperation(value = "检修工单派发",notes = "检修工单派发")
@ApiImplicitParam(name = "operAccessTaskEntity", value = "检修任务", paramType = "body", dataType = "OperAccessTaskEntity")
@ApiOperationSupport(order = 1)
public R distributeWorkOrder(@RequestBody OperAccessTaskEntity operAccessTaskEntity){
return distributeWorkOrderService.distributeAccessTask(operAccessTaskEntity);
}
@GetMapping("/testDistributeDefect")
@ApiOperation(value = "消缺工单派发",notes = "消缺工单派发")
@ApiImplicitParam(name = "operAccessTaskEntity", value = "消缺对象", paramType = "query", dataType = "operDefectEntity")
@ApiOperationSupport(order = 2)
public R testDistributeDefect(@RequestBody OperDefectEntity operDefectEntity){
return distributeWorkOrderService.distributeDefectTask(operDefectEntity);
}
@GetMapping("/getAccessWorkOrderList")
@ApiOperation(value = "获取检修工单列表",notes = "获取检修工单列表")

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/IDistributeWorkOrderService.java

@ -5,19 +5,8 @@ import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import org.springblade.core.tool.api.R;
@Deprecated
public interface IDistributeWorkOrderService {
/**
* 派发检修任务
* @param operAccessTaskEntity
* @return
*/
R distributeAccessTask(OperAccessTaskEntity operAccessTaskEntity);
/**
* 派发消缺任务
* @param operDefectEntity
* @return
*/
R distributeDefectTask(OperDefectEntity operDefectEntity);
/**
* 获取检修工单列表

151
hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java

@ -51,11 +51,6 @@ public class DistributeWorkOrderServiceImpl implements IDistributeWorkOrderServi
private final IOperPhenomenonService operPhenomenonService;
private final RedisTemplate redisTemplate;
@Value("${url.water-out.orderCrtPackage}")
private String orderCrtPackageUrl;
@Value("${url.water-out.orderCrtGrabPackage}")
private String orderCrtGrabPackageUrl;
@Value("${hzims.operation.workOrder.access}")
private String accessWorkOrderKey;
@ -63,152 +58,6 @@ public class DistributeWorkOrderServiceImpl implements IDistributeWorkOrderServi
@Value("${hzims.operation.workOrder.defect}")
private String defectWorkOrderKey;
@Override
public R distributeAccessTask(OperAccessTaskEntity operAccessTaskEntity){
if(ObjectUtil.isEmpty(operAccessTaskEntity)){
return R.fail("暂无检修记录!");
}
OrderPackageDto orderPackageDto = new OrderPackageDto();
orderPackageDto.setCreater(AuthUtil.getUser().getUserName());
orderPackageDto.setFloatRange("1");
orderPackageDto.setProjectCost(0);
/*结束时间需大于当前时间*/
orderPackageDto.setFinishTime(DateUtil.format(LocalDateTime.now().plusHours(5),DateUtil.PATTERN_DATETIME));
orderPackageDto.setProjectCode(operAccessTaskEntity.getId().toString());
orderPackageDto.setProjectName(operAccessTaskEntity.getName());
Publisher publisher = new Publisher();
publisher.setId(operAccessTaskEntity.getCreateUser().toString());
User user = UserCache.getUser(operAccessTaskEntity.getCreateUser());
publisher.setContactAddress("123123");
publisher.setContactName("123123");
publisher.setContactPhone(user.getPhone());
publisher.setPublisher(user.getRealName());
publisher.setPublisherScale("123123");
orderPackageDto.setPublisher(publisher);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
orderPackageDto.setStartTime(fmt.format(operAccessTaskEntity.getPlanStartTime()));
orderPackageDto.setWaterId(operAccessTaskEntity.getCreateDept().toString());
//完善招标信息
List<TenderDto> tenderList = new ArrayList<>();
TenderDto tenderDto = new TenderDto();
//采用大修工单
tenderDto.setOrderType("6");
ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime planStartTime = LocalDateTime.ofInstant(operAccessTaskEntity.getPlanStartTime().toInstant(),zoneId);
LocalDateTime planEndTime = LocalDateTime.ofInstant(operAccessTaskEntity.getPlanEndTime().toInstant(),zoneId);
Long workHours = Duration.between(planStartTime,planEndTime).toHours();
tenderDto.setWorkHours(workHours.intValue());
tenderDto.setWorkPrice("0");
//大修工单内容
List<OtherOrderDTO> overhaulOrderList = new ArrayList<>();
OtherOrderDTO overHaulOrder = new OtherOrderDTO();
overHaulOrder.setOrderType("6");
overHaulOrder.setWorkCode(operAccessTaskEntity.getCode());
overHaulOrder.setTenantId(operAccessTaskEntity.getTenantId());
overHaulOrder.setWorkHour(workHours.intValue());
overHaulOrder.setWorkName(operAccessTaskEntity.getName());
EmInfoEntity emInfoEntity = emInfoClient.getByCode(operAccessTaskEntity.getEmCode());
overHaulOrder.setWorkPos(Optional.ofNullable(emInfoEntity).map(EmInfoEntity::getName).orElse(null));
overHaulOrder.setWorkTime(DateUtil.format(operAccessTaskEntity.getPlanStartTime(),DateUtil.PATTERN_DATETIME));
overhaulOrderList.add(overHaulOrder);
tenderDto.setOverhaulOrderList(overhaulOrderList);
tenderList.add(tenderDto);
orderPackageDto.setTenderList(tenderList);
log.info("-------------------------------------派发工单对象为-------------------------------------");
log.info(JSON.toJSONString(orderPackageDto));
HttpResponse httpResponse = HttpClientUtils.post(orderCrtPackageUrl, JSONObject.toJSONString(orderPackageDto));
if(httpResponse.getCode() == 200){
JSONObject jsonObject = JSONObject.parseObject(httpResponse.getData());
try{
String id = JSONObject.parseObject(jsonObject.getString("data")).getString("id");
//将工单处理结果暂存入redis中
// long maxSize = redisTemplate.opsForZSet().zCard(accessWorkOrderKey);
// redisTemplate.opsForZSet().add(accessWorkOrderKey,id, maxSize > 0 ? (maxSize - 1) : 0L);
}
catch (Exception e){
e.printStackTrace();
}
}
return R.data("调用成功!");
}
@Override
public R distributeDefectTask(OperDefectEntity operDefectEntity){
if(ObjectUtil.isEmpty(operDefectEntity)){
return R.fail("暂无消缺单记录!");
}
GrabPackageDTO grabPackageDTO = new GrabPackageDTO();
grabPackageDTO.setCreateUser(AuthUtil.getUser().getUserName());
grabPackageDTO.setFinishTime(DateUtil.format(LocalDateTime.now().plusHours(8),DateUtil.PATTERN_DATETIME));
List<RepairOrderAcptDto> repairOrderAcptDtos = new ArrayList<>();
RepairOrderAcptDto repairOrderAcptDto = new RepairOrderAcptDto();
//完善工单内容
if(StringUtil.isNotBlank(operDefectEntity.getDefectCode())){
//根据现象、缺陷编码获取现象
OperPhenomenonEntity operPhenomenonEntity = operPhenomenonService.getOne(new LambdaQueryWrapper<OperPhenomenonEntity>(){{
eq(OperPhenomenonEntity::getDefectCode,operDefectEntity.getDefectCode());
}}.last("limit 1"));
if(ObjectUtil.isNotEmpty(operPhenomenonEntity)){
if(StringUtil.isNotBlank(operPhenomenonEntity.getEmCode())){
repairOrderAcptDto.setEquCode(operPhenomenonEntity.getEmCode());
EmInfoEntity emInfoEntity = emInfoClient.getByCode(operPhenomenonEntity.getEmCode());
repairOrderAcptDto.setEquName(Optional.ofNullable(emInfoEntity).map(EmInfoEntity::getName).orElse(null));
}
if(StringUtil.isNotBlank(operPhenomenonEntity.getFaultCode())){
List<RepairOrderContentDTO> contentDTOList = new ArrayList<>();
RepairOrderContentDTO repairOrderContentDTO = new RepairOrderContentDTO();
repairOrderContentDTO.setFaultCode(operPhenomenonEntity.getFaultCode());
repairOrderContentDTO.setFaultName(operPhenomenonEntity.getFaultName());
contentDTOList.add(repairOrderContentDTO);
repairOrderAcptDto.setContentList(contentDTOList);
}
}
}
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startTime = Optional.ofNullable(operDefectEntity.getActStartTime()).map(time->fmt.format(time)).orElse(null);
repairOrderAcptDto.setStartTime(startTime);
R<Dept> deptR = sysClient.getDept(operDefectEntity.getCreateDept());
repairOrderAcptDto.setEquType("010101");
repairOrderAcptDto.setOrgName("长沙敢胜院");
repairOrderAcptDto.setCreateUser(operDefectEntity.getCreateUser().toString());
repairOrderAcptDto.setTenantId(operDefectEntity.getTenantId());
repairOrderAcptDto.setWorkTime(DateUtil.format(operDefectEntity.getActStartTime(),DateUtil.PATTERN_DATETIME));
repairOrderAcptDto.setFaultDisp("捞渣、清渣装置故障");
repairOrderAcptDto.setInstallPos("粗格栅间");
repairOrderAcptDto.setIsBallot(0);
repairOrderAcptDto.setUserName(UserCache.getUser(operDefectEntity.getCreateUser()).getName());
repairOrderAcptDto.setIsMajorRepairs("一般维修");
repairOrderAcptDto.setRepairType("general_repair");
repairOrderAcptDto.setSeverity("严重");
repairOrderAcptDto.setSpecModel("GL1400");
repairOrderAcptDto.setTimeLimit("6.00");
repairOrderAcptDto.setWorkCode(operDefectEntity.getId().toString());
repairOrderAcptDto.setWorkPrice(0);
repairOrderAcptDto.setWorkRatio(1);
repairOrderAcptDto.setWorkHour(4);
List<RepairOrderPrognosisDTO> repairOrderPrognosisDTOS = new ArrayList<>();
RepairOrderPrognosisDTO repairOrderPrognosisDTO = new RepairOrderPrognosisDTO();
repairOrderPrognosisDTO.setCause("测试...");
repairOrderPrognosisDTO.setDescribeContent("测试...");
repairOrderPrognosisDTO.setProjectCode("test0000001");
repairOrderPrognosisDTO.setProjectContent("测试....");
repairOrderPrognosisDTO.setProjectName("测试...");
repairOrderPrognosisDTO.setWorkHour("4.00");
repairOrderPrognosisDTOS.add(repairOrderPrognosisDTO);
repairOrderAcptDto.setPrognosisList(repairOrderPrognosisDTOS);
repairOrderAcptDtos.add(repairOrderAcptDto);
grabPackageDTO.setRepairOrderAcptDtos(repairOrderAcptDtos);
log.info("-------------------------------------派发消缺单对象为-------------------------------------");
log.info(JSON.toJSONString(grabPackageDTO));
HttpResponse httpResponse = HttpClientUtils.post(orderCrtGrabPackageUrl, JSONObject.toJSONString(grabPackageDTO));
//将工单处理结果暂存入redis中
long maxSize = redisTemplate.opsForZSet().zCard(defectWorkOrderKey);
//redisTemplate.opsForZSet().add(defectWorkOrderKey,"", maxSize > 0 ? (maxSize - 1) : 0L);
return R.data("调用成功!");
}
@Override
public R getAccessWorkOrderList(){

Loading…
Cancel
Save