Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -108,14 +108,14 @@ public class SupvPlanParam extends BaseParam {
|
||||
* 计划执行开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "计划执行开始时间",required = true)
|
||||
@DateTimeStrValid(message = "计划执行开始时间格式有误")
|
||||
@DateTimeStrValid(format = "yyyy-MM-dd HH:mm:ss",message = "计划执行开始时间格式有误")
|
||||
private String effectStartTime;
|
||||
|
||||
/**
|
||||
* 计划执行结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "计划执行结束时间",required = true)
|
||||
@DateTimeStrValid(message = "计划执行结束时间格式有误")
|
||||
@DateTimeStrValid(format = "yyyy-MM-dd HH:mm:ss",message = "计划执行结束时间格式有误")
|
||||
private String effectEndTime;
|
||||
|
||||
/**
|
||||
|
||||
@@ -104,16 +104,16 @@ public class SupvPlan extends BaseEntity {
|
||||
/**
|
||||
* 计划执行开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDate effectStartTime;
|
||||
private LocalDateTime effectStartTime;
|
||||
|
||||
/**
|
||||
* 计划执行结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDate effectEndTime;
|
||||
private LocalDateTime effectEndTime;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,13 +112,15 @@ public class SupvPlanVO {
|
||||
* 计划执行开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "计划执行开始时间",required = true)
|
||||
private String effectStartTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime effectStartTime;
|
||||
|
||||
/**
|
||||
* 计划执行结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "计划执行结束时间",required = true)
|
||||
private String effectEndTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime effectEndTime;
|
||||
|
||||
/**
|
||||
* 报告出具时间
|
||||
|
||||
@@ -82,10 +82,10 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
supvPlan.setPlanSupvDate(PubUtils.localDateFormat(supvPlanParam.getPlanSupvDate()));
|
||||
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectEndTime())) {
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateFormat(supvPlanParam.getEffectEndTime()));
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateTimeFormat(supvPlanParam.getEffectEndTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectStartTime())) {
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateFormat(supvPlanParam.getEffectStartTime()));
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateTimeFormat(supvPlanParam.getEffectStartTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getProblemOcTime())) {
|
||||
supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime()));
|
||||
@@ -113,10 +113,10 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
BeanUtil.copyProperties(supvPlanParam, supvPlan);
|
||||
supvPlan.setPlanSupvDate(PubUtils.localDateFormat(supvPlanParam.getPlanSupvDate()));
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectEndTime())) {
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateFormat(supvPlanParam.getEffectEndTime()));
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateTimeFormat(supvPlanParam.getEffectEndTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectStartTime())) {
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateFormat(supvPlanParam.getEffectStartTime()));
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateTimeFormat(supvPlanParam.getEffectStartTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getProblemOcTime())) {
|
||||
supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime()));
|
||||
|
||||
@@ -167,7 +167,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
|
||||
//监督对象类型
|
||||
if (mapSubvObjType.containsKey(supvPlan.getSupvObjType())) {
|
||||
supvPlan.setSupvType(String.format("%02d", mapSubvObjType.get(supvPlan.getSupvObjType()).getAlgoDescribe()));
|
||||
supvPlan.setSupvObjType(String.format("%02d", mapSubvObjType.get(supvPlan.getSupvObjType()).getAlgoDescribe()));
|
||||
}
|
||||
|
||||
//电站等级
|
||||
@@ -461,8 +461,8 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
if (ObjectUtil.isNull(param)) {
|
||||
cb = new ContentBody("");
|
||||
} else {
|
||||
String s = JSON.toJSONString(param);
|
||||
log.info(Thread.currentThread().getName() + "1.信息:" + JSON.toJSONString(param));
|
||||
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
|
||||
log.info(Thread.currentThread().getName() + "1.信息:" + s);
|
||||
cb = new ContentBody(s);
|
||||
}
|
||||
//ContentBody传递,要求使用post方式进行调用
|
||||
@@ -511,6 +511,8 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
//获取返回体
|
||||
Map body = userEntity.getBody();
|
||||
token = body.get("access_token").toString();
|
||||
}else{
|
||||
throw new BusinessException("获取数据token出现未知异常!请检查ip端口是否正确!");
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
package com.njcn.system.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.api.fallback.EpdFeignClientFallbackFactory;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -42,4 +50,7 @@ public interface EpdFeignClient {
|
||||
|
||||
@PostMapping("/judgeExist")
|
||||
HttpResult<List<EleEpdPqd>> judgeExist(@RequestParam("name") String name,@RequestParam("dataType") String dataType);
|
||||
|
||||
@PostMapping("/findByParam")
|
||||
HttpResult<EleEpdPqd> findByParam(@RequestParam("name") String name, @RequestParam("dataType") String dataType, @RequestParam("phase") String phase);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,12 @@ public class EpdFeignClientFallbackFactory implements FallbackFactory<EpdFeignCl
|
||||
log.error("{}异常,降级处理,异常为:{}","校验字典是否存在",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<EleEpdPqd> findByParam(String name, String dataType, String phase) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据条件查询字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,5 +177,20 @@ public class EleEpdPqdController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/findByParam")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据条件查询字典数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", value = "指标名称", required = true),
|
||||
@ApiImplicitParam(name = "dataType", value = "数据模型", required = true),
|
||||
@ApiImplicitParam(name = "phase", value = "相别", required = true)
|
||||
})
|
||||
public HttpResult<EleEpdPqd> findByParam(@RequestParam("name") @Validated String name, @RequestParam("dataType") @Validated String dataType, @RequestParam("phase") @Validated String phase){
|
||||
String methodDescribe = getMethodDescribe("judgeExist");
|
||||
LogUtil.njcnDebug(log, "{},根据条件查询字典数据:", methodDescribe);
|
||||
EleEpdPqd eleEpdPqd = eleEpdPqdService.findByParam(name,dataType,phase);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -94,4 +94,13 @@ public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
||||
*/
|
||||
List<EleEpdPqd> judgeExist(String name, String dataType);
|
||||
|
||||
/**
|
||||
* 根据条件查询字典数据
|
||||
* @param name
|
||||
* @param dataType
|
||||
* @param phase
|
||||
* @return
|
||||
*/
|
||||
EleEpdPqd findByParam(String name, String dataType, String phase);
|
||||
|
||||
}
|
||||
|
||||
@@ -199,6 +199,13 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EleEpdPqd findByParam(String name, String dataType, String phase) {
|
||||
LambdaQueryWrapper<EleEpdPqd> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(EleEpdPqd::getDataType,dataType).eq(EleEpdPqd::getName,name).eq(EleEpdPqd::getPhase,phase).eq(EleEpdPqd::getStatus,1);
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,
|
||||
* 1.检查是否存在相同名称的菜单
|
||||
|
||||
Reference in New Issue
Block a user