功能提交
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.njcn.supervision.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.supervision.api.fallback.TempLineRunTestFeignClientFallbackFactory;
|
||||
import com.njcn.supervision.api.fallback.UserLedgerFeignClientFallbackFactory;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 流程实例 Api 接口
|
||||
*
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.SUPERVISION, path = "/userReport", fallbackFactory = UserLedgerFeignClientFallbackFactory.class)
|
||||
public interface UserLedgerFeignClient {
|
||||
|
||||
|
||||
@PostMapping("/selectUserList")
|
||||
List<UserReportPO> selectUserList(@RequestBody UserReportParam userReportParam);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.supervision.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.supervision.api.TempLineRunTestFeignClient;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
import com.njcn.supervision.utils.SupervisionEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class UserLedgerFeignClientFallbackFactory implements FallbackFactory<UserLedgerFeignClient> {
|
||||
@Override
|
||||
public UserLedgerFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new UserLedgerFeignClient() {
|
||||
|
||||
@Override
|
||||
public List<UserReportPO> selectUserList(UserReportParam userReportParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "查询用户台账", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -19,6 +20,7 @@ import java.time.LocalDate;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@@ -124,6 +126,11 @@ public class UserReportPO extends BaseEntity {
|
||||
@TableField(value = "data_type")
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 电站id
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||
import com.njcn.supervision.service.user.IUserReportNormalService;
|
||||
import com.njcn.supervision.service.user.UserReportPOService;
|
||||
@@ -239,4 +240,15 @@ public class UserReportManageController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping(value = "/selectUserList")
|
||||
@ApiOperation("查询用户台账")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
public HttpResult<List<UserReportPO>> selectUserList(@RequestBody UserReportParam userReportParam) {
|
||||
String methodDescribe = getMethodDescribe("selectUserList");
|
||||
List<UserReportPO> b = userReportPOService.selectUserList(userReportParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,4 +58,6 @@ public interface UserReportPOService extends IBpmService<UserReportPO> {
|
||||
void importSensitiveReportData(MultipartFile file, HttpServletResponse response);
|
||||
|
||||
Boolean deleteUserReport(List<String> supervisionId);
|
||||
|
||||
List<UserReportPO> selectUserList(UserReportParam userReportParam);
|
||||
}
|
||||
|
||||
@@ -1154,6 +1154,18 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
.in(UserReportPO::getId, supervisionId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserReportPO> selectUserList(UserReportParam userReportParam) {
|
||||
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if(StrUtil.isNotBlank(userReportParam.getCity())){
|
||||
lambdaQueryWrapper.in(UserReportPO::getCity,Stream.of(userReportParam.getCity()).collect(Collectors.toList()));
|
||||
}
|
||||
this.list(lambdaQueryWrapper);
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public Map<String, String> getTreeString(String name, List<SysDicTreePO> treeVOS) {
|
||||
Map<String, String> info = new LinkedHashMap<>();
|
||||
for (SysDicTreePO sysMenuDtoChild : treeVOS) {
|
||||
|
||||
Reference in New Issue
Block a user