初始提交
This commit is contained in:
@ -0,0 +1,72 @@
|
||||
package com.mosty.yszx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.model.dto.base.GetDeptListDTO;
|
||||
import com.mosty.base.model.dto.base.GetSsbmDto;
|
||||
import com.mosty.base.model.dto.base.SysDeptDTO;
|
||||
import com.mosty.base.feign.service.MostyBaseFeignService;
|
||||
import com.mosty.base.model.vo.base.DeptInfoVo;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调用部门信息远程适配层
|
||||
*
|
||||
* @author kevin
|
||||
* @date 2022/7/6 10:37 上午
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbBaseAdaptRemoteService {
|
||||
|
||||
private final MostyBaseFeignService mostyBaseFeignService;
|
||||
|
||||
|
||||
// 根据部门编码查询部门信息
|
||||
public DeptInfoVo getOrgByDeptId(String deptid) {
|
||||
if (StringUtils.isBlank(deptid)) {
|
||||
return null;
|
||||
}
|
||||
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByDeptId(deptid);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("根据部门ID查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("根据部门ID查询部门信息异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
// 根据部门编码查询部门信息
|
||||
public DeptInfoVo getOrgByOrgcode(String orgcode) {
|
||||
if (StringUtils.isBlank(orgcode)) {
|
||||
return null;
|
||||
}
|
||||
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByOrgcode(orgcode);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("根据部门ID查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("根据部门ID查询部门信息异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
// 获取权限查询条件
|
||||
public String getSsbm(String ssbmdm, String isChild) {
|
||||
GetSsbmDto dto = new GetSsbmDto(ssbmdm, isChild);
|
||||
ResponseResult<String> responseResult = mostyBaseFeignService.getSsbm(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("获取权限查询条件异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("获取权限查询条件异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.mosty.yszx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.feign.service.MostyRwzxFeignService;
|
||||
import com.mosty.base.model.dto.rwzx.TbRwTaskDto;
|
||||
import com.mosty.base.model.entity.rwzx.TbRwTask;
|
||||
import com.mosty.base.model.entity.yjzl.TbZlxx;
|
||||
import com.mosty.base.model.query.rwzx.TbRwTaskByYwidQuery;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/10/05
|
||||
* 外部调用任务中心接口
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TbRwzxAdaptRemoteService {
|
||||
|
||||
@Resource
|
||||
private MostyRwzxFeignService mostyRwzxFeignService;
|
||||
|
||||
// 发送任务给各个用户
|
||||
public Integer addRw(TbRwTaskDto dto) {
|
||||
ResponseResult<Integer> responseResult = mostyRwzxFeignService.addRw(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("任务下发失败 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
return 0;
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
// 获取任务信息
|
||||
public TbRwTask getRwByYwid(TbRwTaskByYwidQuery dto) {
|
||||
ResponseResult<TbRwTask> responseResult = mostyRwzxFeignService.getRwByYwid(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("获取任务信息失败 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("任务查询报错!!");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
// 修改旧的指令任务状态为未读
|
||||
public void changeTaskStateByZlid(TbZlxx zlxx) {
|
||||
ResponseResult<Void> responseResult = mostyRwzxFeignService.changeTaskStateByZlid(zlxx);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("修改任务状态失败 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("修改任务状态失败!!");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.mosty.yszx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.model.dto.sjzx.TbSjSpbfDTO;
|
||||
import com.mosty.base.feign.service.MostySjzxFeignService;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 事件中心远程调用
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbSjzxAdaptRemoteService {
|
||||
|
||||
private final MostySjzxFeignService mostySjzxFeignService;
|
||||
|
||||
// 保存视频播放日志
|
||||
public void tbSjSpbfAdd(TbSjSpbfDTO dto) {
|
||||
ResponseResult<Integer> responseResult = mostySjzxFeignService.tbSjSpbfAdd(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("保存视频播放日志失败 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("保存视频播放日志失败");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user