Browse Source

Merge remote-tracking branch 'remotes/origin/develop' into release_temp

master
jianjun 4 years ago
parent
commit
a8028984a5
  1. 2
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  2. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  3. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  4. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

2
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -106,7 +106,7 @@ public interface OperCustomizeOpenFeignClient {
Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO); Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO);
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist")
Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(); Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId);
@PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid") @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid")
Result<IcResiCategoryWarnConfigDTO> resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto); Result<IcResiCategoryWarnConfigDTO> resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto);

4
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -90,8 +90,8 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
} }
@Override @Override
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList() { public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList"); return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId);
} }
@Override @Override

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -41,10 +41,7 @@ import com.epmet.service.IcResiCategoryStatsConfigService;
import com.epmet.service.ResiCategoryStatsConfigService; import com.epmet.service.ResiCategoryStatsConfigService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -148,11 +145,11 @@ public class ResiCategoryStatsConfigController {
} }
@PostMapping("resicategorywarnlist") @PostMapping("resicategorywarnlist")
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@LoginUser TokenDto tokenDTO){ public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@RequestParam String customerId){
//获取预警配置列表 //获取预警配置列表
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>() List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>()
.lambda() .lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,tokenDTO.getCustomerId()) .eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)
.orderByAsc(IcResiCategoryWarnConfigEntity::getSort)); .orderByAsc(IcResiCategoryWarnConfigEntity::getSort));
return new Result<List<IcResiCategoryWarnConfigDTO>>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class)); return new Result<List<IcResiCategoryWarnConfigDTO>>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class));

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -56,7 +56,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
} }
List<IcResiCategoryStatsConfigDTO> icResiCategoryStatsConfigDTOList = statsResult.getData(); List<IcResiCategoryStatsConfigDTO> icResiCategoryStatsConfigDTOList = statsResult.getData();
//feign获取当前需要预警的配置信息以及阈值 //feign获取当前需要预警的配置信息以及阈值
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId);
if (!warnResult.success() || null == warnResult.getData()) { if (!warnResult.success() || null == warnResult.getData()) {
throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); throw new RenException("预警配置查询失败:"+ warnResult.getMsg());
@ -200,7 +200,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void resiWarn(String customerId) { public void resiWarn(String customerId) {
// 获取预警配置项 // 获取预警配置项
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId);
if (!warnResult.success() || null == warnResult.getData()) { if (!warnResult.success() || null == warnResult.getData()) {
throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); throw new RenException("预警配置查询失败:"+ warnResult.getMsg());
} }
@ -238,7 +238,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
@Override @Override
public void resiWarnByOne(String customerId, String userId) { public void resiWarnByOne(String customerId, String userId) {
// 获取预警配置项 // 获取预警配置项
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId);
if (!warnResult.success() || null == warnResult.getData()) { if (!warnResult.success() || null == warnResult.getData()) {
throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); throw new RenException("预警配置查询失败:"+ warnResult.getMsg());
} }

Loading…
Cancel
Save