Commit af1e185b authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 512778b1 8b7397f2
...@@ -44,6 +44,10 @@ public class PeasantHouseholdDto extends BaseDto { ...@@ -44,6 +44,10 @@ public class PeasantHouseholdDto extends BaseDto {
@ApiModelProperty(value = "开发方code") @ApiModelProperty(value = "开发方code")
private String developerCode; private String developerCode;
@ApiModelProperty(value = "开发方平台id")
private Long developerId;
@ApiModelProperty(value = "定金") @ApiModelProperty(value = "定金")
private Float deposit; private Float deposit;
......
...@@ -76,13 +76,13 @@ public class PreparationMoneyDto extends BaseDto { ...@@ -76,13 +76,13 @@ public class PreparationMoneyDto extends BaseDto {
private String receipt; private String receipt;
@ApiModelProperty(value = "订单状态0未完成1已完成2作废") @ApiModelProperty(value = "订单状态0未完成1已完成2作废")
private Integer documentState; private String documentState;
@ApiModelProperty(value = "发货状态 0 未发货1已发货") @ApiModelProperty(value = "发货状态 0 未发货1已发货")
private Integer shipmentStatus; private String shipmentStatus;
@ApiModelProperty(value = "到货状态0未到货1已到货") @ApiModelProperty(value = "到货状态0未到货1已到货")
private Integer receivingStatus; private String receivingStatus;
@ApiModelProperty(value = "清单价格") @ApiModelProperty(value = "清单价格")
private Double inventoryPrice; private Double inventoryPrice;
......
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney;
import lombok.Data;
/**
* @description:
* @author: tw
* @createDate: 2023/8/17
*/
@Data
public class PreparationPageDto extends Page<PreparationMoney> {
String orderBy;
Boolean isASC;
//时间开始
String startDate;
//时间结束
String endDate;
String consigneeAddress;//订单区域
String dealerId;//经销商
String oddNumbers;//发货单号
String salesman;//业主类型
String documentState;//订单状态未完成已完成作废
String shipmentStatus;//发货状态 未发货已发货
String receivingStatus;//到货状态未到货已到货
}
...@@ -36,7 +36,8 @@ public class SurveyInformationDto extends BaseDto { ...@@ -36,7 +36,8 @@ public class SurveyInformationDto extends BaseDto {
@ApiModelProperty(value = "开发方code") @ApiModelProperty(value = "开发方code")
private String developerCode; private String developerCode;
@ApiModelProperty(value = "开发方平台id")
private Long developerId;
@ApiModelProperty(value = " 业务员id") @ApiModelProperty(value = " 业务员id")
private String salesmanId; private String salesmanId;
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -60,6 +61,8 @@ public class PeasantHousehold extends BaseEntity { ...@@ -60,6 +61,8 @@ public class PeasantHousehold extends BaseEntity {
@TableField("developer_code") @TableField("developer_code")
private String developerCode; private String developerCode;
@TableField("developer_id")
private Long developerId;
/** /**
* 定金 * 定金
*/ */
......
package com.yeejoin.amos.boot.module.hygf.api.entity; package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 发货单 * 发货单
...@@ -121,32 +124,33 @@ public class PreparationMoney extends BaseEntity { ...@@ -121,32 +124,33 @@ public class PreparationMoney extends BaseEntity {
/** /**
* 发货单 * 发货单
*/ */
@TableField("invoice")
private String invoice; @TableField(value = "invoice",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private List<Object> invoice;
/** /**
* 收货单 * 收货单
*/ */
@TableField("receipt") @TableField(value = "receipt",typeHandler = FastjsonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private String receipt; private String receipt;
/** /**
* 订单状态0未完成1已完成2作废 * 订单状态0未完成1已完成2作废
*/ */
@TableField("document_state") @TableField("document_state")
private Integer documentState; private String documentState;
/** /**
* 发货状态 0 未发货1已发货 * 发货状态 0 未发货1已发货
*/ */
@TableField("shipment_status") @TableField("shipment_status")
private Integer shipmentStatus; private String shipmentStatus;
/** /**
* 到货状态0未到货1已到货 * 到货状态0未到货1已到货
*/ */
@TableField("receiving_status") @TableField("receiving_status")
private Integer receivingStatus; private String receivingStatus;
/** /**
* 清单价格 * 清单价格
......
...@@ -9,4 +9,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service; ...@@ -9,4 +9,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
*/ */
public interface IPeasantHouseholdService { public interface IPeasantHouseholdService {
} }
...@@ -100,8 +100,8 @@ public class PeasantHouseholdController extends BaseController { ...@@ -100,8 +100,8 @@ public class PeasantHouseholdController extends BaseController {
model.setSurveyInformationId(surveyInformationDto.getSequenceNbr()); model.setSurveyInformationId(surveyInformationDto.getSequenceNbr());
model.setSurveyOrNot(0); model.setSurveyOrNot(0);
model.setReview(0); model.setReview(0);
model.setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode()); model.setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode());
model.setDeveloperId(userInfo.getCompanys().get(0).getSequenceNbr());
model.setDeveloperName(userInfo.getOrgNamesWithoutRole()); model.setDeveloperName(userInfo.getOrgNamesWithoutRole());
if(StringUtils.isEmpty(model.getDeveloper())){ if(StringUtils.isEmpty(model.getDeveloper())){
model.setDeveloper(userInfo.getRealName()); model.setDeveloper(userInfo.getRealName());
...@@ -252,4 +252,6 @@ public class PeasantHouseholdController extends BaseController { ...@@ -252,4 +252,6 @@ public class PeasantHouseholdController extends BaseController {
} }
return jsonArray; return jsonArray;
} }
} }
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.hygf.api.dto.PreparationPageDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Date;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PreparationMoneyServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PreparationMoneyServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -94,12 +100,13 @@ public class PreparationMoneyController extends BaseController { ...@@ -94,12 +100,13 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "发货单分页查询", notes = "发货单分页查询") @ApiOperation(httpMethod = "GET",value = "发货单分页查询", notes = "发货单分页查询")
public ResponseModel<Page<PreparationMoneyDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<IPage<PreparationMoney>> queryForPage(PreparationPageDto preparationPageDto
(value = "size") int size) {
Page<PreparationMoneyDto> page = new Page<PreparationMoneyDto>();
page.setCurrent(current);
page.setSize(size); ) {
return ResponseHelper.buildResponse(preparationMoneyServiceImpl.queryForPreparationMoneyPage(page));
return ResponseHelper.buildResponse(preparationMoneyServiceImpl.queryForPreparationMoneyPage(preparationPageDto));
} }
/** /**
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...@@ -10,6 +11,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.DealerReview; ...@@ -10,6 +11,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.DealerReview;
import com.yeejoin.amos.boot.module.hygf.api.entity.UnitInfo; import com.yeejoin.amos.boot.module.hygf.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.hygf.api.hwsms.SendSmsCode; import com.yeejoin.amos.boot.module.hygf.api.hwsms.SendSmsCode;
import com.yeejoin.amos.boot.module.hygf.api.mapper.CommerceInfoMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.CommerceInfoMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.UnitInfoMapper;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.DealerReviewServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.DealerReviewServiceImpl;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -78,8 +80,8 @@ public class UnitInfoController extends BaseController { ...@@ -78,8 +80,8 @@ public class UnitInfoController extends BaseController {
DealerReviewServiceImpl dealerReviewServiceImpl; DealerReviewServiceImpl dealerReviewServiceImpl;
@Autowired @Autowired
CommerceInfoMapper commerceInfoMapper; CommerceInfoMapper commerceInfoMapper;
@Autowired
UnitInfoMapper unitInfoMapper;
/** /**
* 验证码过期时间 * 验证码过期时间
*/ */
...@@ -396,6 +398,21 @@ public class UnitInfoController extends BaseController { ...@@ -396,6 +398,21 @@ public class UnitInfoController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "获取经销商单位", notes = "获取经销商单位")
@GetMapping(value = "/getUnit")
public ResponseModel< List<UnitInfo>> getUnit( @RequestParam(required = false)String amosCompanySeq) {
LambdaQueryWrapper<UnitInfo> unitInfoque=new LambdaQueryWrapper<>();
unitInfoque.eq(!ValidationUtil.isEmpty(amosCompanySeq),UnitInfo::getAmosCompanySeq,amosCompanySeq);
unitInfoque.eq(UnitInfo::getAuditStatus,2);
List<UnitInfo> list=unitInfoMapper.selectList(unitInfoque);
return ResponseHelper.buildResponse(list);
}
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.hygf.api.dto.PreparationPageDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney; import com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PreparationMoneyMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.PreparationMoneyMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPreparationMoneyService; import com.yeejoin.amos.boot.module.hygf.api.service.IPreparationMoneyService;
import com.yeejoin.amos.boot.module.hygf.api.dto.PreparationMoneyDto; import com.yeejoin.amos.boot.module.hygf.api.dto.PreparationMoneyDto;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -18,11 +23,37 @@ import java.util.List; ...@@ -18,11 +23,37 @@ import java.util.List;
*/ */
@Service @Service
public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto,PreparationMoney,PreparationMoneyMapper> implements IPreparationMoneyService { public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto,PreparationMoney,PreparationMoneyMapper> implements IPreparationMoneyService {
@Autowired
private PreparationMoneyMapper preparationMoneyMapper;
/** /**
* 分页查询 * 分页查询
*/ */
public Page<PreparationMoneyDto> queryForPreparationMoneyPage(Page<PreparationMoneyDto> page) { public IPage<PreparationMoney> queryForPreparationMoneyPage(PreparationPageDto dto) {
return this.queryForPage(page, null, false);
//列表数据组装
QueryWrapper<PreparationMoney> qw = new QueryWrapper<>();
qw.ge(StringUtils.isNotEmpty(dto.getStartDate()), "order_time", dto.getStartDate());
qw.le(StringUtils.isNotEmpty(dto.getEndDate()), "order_time", dto.getEndDate());
qw.eq(StringUtils.isNotEmpty(dto.getConsigneeAddress()), "consignee_address", dto.getConsigneeAddress());
qw.eq(StringUtils.isNotEmpty(dto.getDealerId()), "dealer_id", dto.getDealerId());
qw.like(StringUtils.isNotEmpty(dto.getOddNumbers()), "odd_numbers", dto.getOddNumbers());
qw.like(StringUtils.isNotEmpty(dto.getSalesman()), "salesman", dto.getSalesman());
qw.eq(StringUtils.isNotEmpty(dto.getDocumentState()), "document_state", dto.getDocumentState());
qw.eq(StringUtils.isNotEmpty(dto.getShipmentStatus()), "shipment_status", dto.getShipmentStatus());
qw.eq(StringUtils.isNotEmpty(dto.getReceivingStatus()), "receiving_status", dto.getReceivingStatus());
if (StringUtils.isNotEmpty(dto.getOrderBy())) {
qw.orderBy(Boolean.TRUE, dto.getIsASC(), dto.getOrderBy());
}else{
qw.orderBy(Boolean.TRUE, Boolean.FALSE, "order_time");
}
IPage<PreparationMoney> warningQuestionInfoIPage = preparationMoneyMapper.selectPage(dto, qw);
return warningQuestionInfoIPage;
} }
/** /**
......
...@@ -262,6 +262,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -262,6 +262,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation()); BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation());
surveyInfoAllDto.getSurveyInformation().setDeveloperName(userInfo.getCompanys().get(0).getCompanyName()); surveyInfoAllDto.getSurveyInformation().setDeveloperName(userInfo.getCompanys().get(0).getCompanyName());
surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode()); surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode());
surveyInfoAllDto.getSurveyInformation().setDeveloperId(userInfo.getCompanys().get(0).getSequenceNbr());
surveyInfoAllDto.getSurveyInformation().setSalesmanId(userInfo.getUserId()); surveyInfoAllDto.getSurveyInformation().setSalesmanId(userInfo.getUserId());
surveyInfoAllDto.getSurveyInformation().setSalesman(userInfo.getRealName()); surveyInfoAllDto.getSurveyInformation().setSalesman(userInfo.getRealName());
surveyInfoAllDto.getSurveyInformation().setCreator(userInfo.getRealName()); surveyInfoAllDto.getSurveyInformation().setCreator(userInfo.getRealName());
......
...@@ -66,7 +66,7 @@ public class AnalyseController extends BaseController { ...@@ -66,7 +66,7 @@ public class AnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "获取influxdb数据", notes = "获取influxdb数据") @ApiOperation(httpMethod = "GET", value = "获取influxdb数据", notes = "获取influxdb数据")
@GetMapping(value = "/getInfluxdbDataByConditon") @GetMapping(value = "/getInfluxdbDataByConditon")
public ResponseModel<List<Map<String, Object>>> getInfluxdbDataByConditon(@RequestParam String stationType, @RequestParam String pointId, @RequestParam String startTime, @RequestParam String endTime) { public ResponseModel<Map<String, Object>> getInfluxdbDataByConditon(@RequestParam String stationType, @RequestParam String pointId, @RequestParam String startTime, @RequestParam String endTime) {
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType,pointId,startTime, endTime)) ; return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType,pointId,startTime, endTime)) ;
} }
} }
...@@ -15,7 +15,6 @@ import org.elasticsearch.index.query.QueryBuilder; ...@@ -15,7 +15,6 @@ import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
...@@ -26,6 +25,7 @@ import org.springframework.scheduling.annotation.Scheduled; ...@@ -26,6 +25,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -35,25 +35,34 @@ import java.util.stream.Collectors; ...@@ -35,25 +35,34 @@ import java.util.stream.Collectors;
public class CommonServiceImpl { public class CommonServiceImpl {
//utc时间格式 //utc时间格式
public static final String FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'"; public static final String FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
public static final String FORMAT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
private static final Logger logger = LoggerFactory.getLogger(CommonServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(CommonServiceImpl.class);
//-----------------调用算法时间间隔---------------- //-----------------调用算法时间间隔----------------
@Value("${sleep.time:10}") @Value("${sleep.time:10}")
Integer sleepTime; Integer sleepTime;
@Value("${sleep.time:30}")
Integer zxzsleepTime;
@Value("${base.url:http://36.40.66.175:30009/maas/maas/processes/api/}") @Value("${base.url:http://36.40.66.175:30009/maas/maas/processes/api/}")
String baseUrl; String baseUrl;
//----------------工况变量工况变量划分请求属性配置------------------------ //----------------工况变量工况变量划分请求属性配置------------------------
@Value("${gkblhf.url:e884fccf-b7ac-4fa4-bdb7-a5b6ff7319ec}") @Value("${gkblhffan.url:3d0acca8-a6aa-4791-8dc3-9f8d3137556a}")
String gkqjhfurl; String gkqjhfurlfan;
@Value("${gkblhfpv.url:e884fccf-b7ac-4fa4-bdb7-a5b6ff7319ec}")
String gkqjhfurlpv;
@Value("${gkblhf.key:input 1}") @Value("${gkblhf.key:input 1}")
String gkqjhfkey; String gkqjhfkey;
//----------------工况变量相关性计算请求属性配置------------------------ //----------------工况变量相关性计算请求属性配置------------------------
@Value("${gkxgxfx.url:f5457bfe-0780-418d-9287-c4f31d3fb4c7}") @Value("${gkxgxfxfan.url:b5797e0a-d456-44d3-9f21-9528e5321b74}")
String gkxgxfxurl; String gkxgxfxurlfan;
@Value("${gkxgxfxpv.url:f5457bfe-0780-418d-9287-c4f31d3fb4c7}")
String gkxgxfxurlpv;
@Value("${gkxgxfx.key:input 1}") @Value("${gkxgxfx.key:input 1}")
String gkxgxfxkey; String gkxgxfxkey;
//----------------工况变量中心值计算相关请求属性配置------------------------ //----------------工况变量中心值计算相关请求属性配置------------------------
@Value("${gkzxzjs.url:ee855fc0-cb37-4b11-96c6-e61e195436bc}") @Value("${gkzxzjsfan.url:2ad85cd3-aede-4936-b3bb-029bf2598c49}")
String gkzxzjsurl; String gkzxzjsurlfan;
@Value("${gkzxzjspv.url:5c9fc897-a9f2-4563-8d7b-8cf60c6a663f}")
String gkzxzjsurlpv;
@Value("${gkzxzjs.key:input 1}") @Value("${gkzxzjs.key:input 1}")
String gkzxzjskey1; String gkzxzjskey1;
...@@ -160,7 +169,7 @@ public class CommonServiceImpl { ...@@ -160,7 +169,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::开始调用工况变量区间划分算法----------------------------------------"); logger.info("------------------------------------------风机::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkqjhfkey, params); realParams.put(gkqjhfkey, params);
String reponse = HttpUtil.createPost(baseUrl + gkqjhfurl).body(JSON.toJSONString(realParams)).execute().body(); String reponse = HttpUtil.createPost(baseUrl + gkqjhfurlfan).body(JSON.toJSONString(realParams)).execute().body();
try { try {
logger.info(reponse); logger.info(reponse);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
...@@ -191,7 +200,7 @@ public class CommonServiceImpl { ...@@ -191,7 +200,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------光伏::开始调用工况变量区间划分算法----------------------------------------"); logger.info("------------------------------------------光伏::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkqjhfkey, params); realParams.put(gkqjhfkey, params);
String reponse = HttpUtil.createPost(baseUrl + gkqjhfurl).body(JSON.toJSONString(realParams)).execute().body(); String reponse = HttpUtil.createPost(baseUrl + gkqjhfurlpv).body(JSON.toJSONString(realParams)).execute().body();
try { try {
logger.info(reponse); logger.info(reponse);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
...@@ -294,7 +303,7 @@ public class CommonServiceImpl { ...@@ -294,7 +303,7 @@ public class CommonServiceImpl {
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkxgxfxkey, requestParams); realParams.put(gkxgxfxkey, requestParams);
logger.info("------------------------------风机相关性------------分析变量与工况变量相关性分析算参数---------------------------------------" + JSON.toJSONString(realParams)); logger.info("------------------------------风机相关性------------分析变量与工况变量相关性分析算参数---------------------------------------" + JSON.toJSONString(realParams));
String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurl).body(JSON.toJSONString(realParams)).execute().body(); String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurlfan).body(JSON.toJSONString(realParams)).execute().body();
try { try {
logger.info("response-------------" + repsonse); logger.info("response-------------" + repsonse);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
...@@ -339,7 +348,7 @@ public class CommonServiceImpl { ...@@ -339,7 +348,7 @@ public class CommonServiceImpl {
logger.info("---------------------------------光伏相关性---------分析变量与工况变量相关性分析算法开始----------------------------------------"); logger.info("---------------------------------光伏相关性---------分析变量与工况变量相关性分析算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>(); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkxgxfxkey, requestParams); realParams.put(gkxgxfxkey, requestParams);
String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurl).body(JSON.toJSONString(realParams)).execute().body(); String repsonse = HttpUtil.createPost(baseUrl + gkxgxfxurlpv).body(JSON.toJSONString(realParams)).execute().body();
try { try {
logger.info("response----光伏相关性---------" + repsonse); logger.info("response----光伏相关性---------" + repsonse);
TimeUnit.SECONDS.sleep(sleepTime); TimeUnit.SECONDS.sleep(sleepTime);
...@@ -412,7 +421,7 @@ public class CommonServiceImpl { ...@@ -412,7 +421,7 @@ public class CommonServiceImpl {
returnList.forEach((k) -> { returnList.forEach((k) -> {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("analysisVariable", Double.parseDouble(k.get("value").toString())); map.put("analysisVariable", Double.parseDouble(k.get("value").toString()));
map.put("analysisVariableId", Long.parseLong(IdxBizFanPointProcessVariableClassification.getSequenceNbr())); map.put("analysisVariableId", (IdxBizFanPointProcessVariableClassification.getSequenceNbr().toString()));
params.add(map); params.add(map);
}); });
logger.info("--------------------------------------风机中心值------开始查询influxdb--------------------------------"); logger.info("--------------------------------------风机中心值------开始查询influxdb--------------------------------");
...@@ -423,37 +432,37 @@ public class CommonServiceImpl { ...@@ -423,37 +432,37 @@ public class CommonServiceImpl {
String sql1 = String.format("select value from %s where address='%s' ", tableName, list.get(1).getProcessIndexAddress()); String sql1 = String.format("select value from %s where address='%s' ", tableName, list.get(1).getProcessIndexAddress());
String sql2 = String.format("select value from %s where address='%s' ", tableName, list.get(2).getProcessIndexAddress()); String sql2 = String.format("select value from %s where address='%s' ", tableName, list.get(2).getProcessIndexAddress());
List<HashMap<String, Object>> values = new ArrayList<>(); List<HashMap<String, Object>> values = new ArrayList<>();
List<String> processPointIds = list.stream().map(IdxBizFanPointVarCorrelation -> IdxBizFanPointVarCorrelation.getProcessPointId().toString()).collect(Collectors.toList()); List<String> processPointIds = list.stream().map(idxBizFanPointVarCorrelation -> idxBizFanPointVarCorrelation.getProcessPointId().toString()).collect(Collectors.toList());
List<IdxBizFanPointProcessVariableClassification> idxBizFanPointProcessVariableClassificationList = idxBizFanPointProcessVariableClassificationMapper.selectList(new QueryWrapper<IdxBizFanPointProcessVariableClassification>().in("SEQUENCE_NBR", processPointIds)); List<IdxBizFanPointProcessVariableClassification> idxBizFanPointProcessVariableClassificationList = idxBizFanPointProcessVariableClassificationMapper.selectList(new QueryWrapper<IdxBizFanPointProcessVariableClassification>().in("SEQUENCE_NBR", processPointIds));
//区间值1 //区间值1
HashMap<String, Object> value1 = new HashMap<>(); HashMap<String, Object> value1 = new HashMap<>();
value1.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue1())?0.0:idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue1()); value1.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue1()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue1());
value1.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue1())?0.0:idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue1()); value1.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue1()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue1());
value1.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue1())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue1()); value1.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue1()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue1());
values.add(value1); values.add(value1);
//区间值2 //区间值2
HashMap<String, Object> value2 = new HashMap<>(); HashMap<String, Object> value2 = new HashMap<>();
value2.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue2())?0.0:idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue2()); value2.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue2()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue2());
value2.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue2())?0.0:idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue2()); value2.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue2()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue2());
value2.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue2())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue2()); value2.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue2()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue2());
values.add(value2); values.add(value2);
//区间值3 //区间值3
HashMap<String, Object> value3 = new HashMap<>(); HashMap<String, Object> value3 = new HashMap<>();
value3.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue3())?0.0:idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue3()); value3.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue3()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue3());
value3.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue3())?0.0:idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue3()); value3.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue3()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue3());
value3.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue3())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue3()); value3.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue3()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue3());
values.add(value3); values.add(value3);
//区间值4 //区间值4
HashMap<String, Object> value4 = new HashMap<>(); HashMap<String, Object> value4 = new HashMap<>();
value4.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue4())?0.0:idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue4()); value4.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue4()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue4());
value4.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue4())?0.0:idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue4()); value4.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue4()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue4());
value4.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue4())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue4()); value4.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue4()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue4());
values.add(value4); values.add(value4);
//区间值5 //区间值5
HashMap<String, Object> value5 = new HashMap<>(); HashMap<String, Object> value5 = new HashMap<>();
value5.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue5())?0.0:idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue5()); value5.put("processVariable1", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue5()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(2).getIntervalValue5());
value5.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue5())?0.0:idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue5()); value5.put("processVariable2", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue5()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(1).getIntervalValue5());
value5.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue5())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue5()); value5.put("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue5()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue5());
values.add(value5); values.add(value5);
List<Map<String, Object>> returnList0 = influxdbUtil.query(sql); List<Map<String, Object>> returnList0 = influxdbUtil.query(sql);
List<Map<String, Object>> maxList = returnList0; List<Map<String, Object>> maxList = returnList0;
...@@ -482,34 +491,33 @@ public class CommonServiceImpl { ...@@ -482,34 +491,33 @@ public class CommonServiceImpl {
map3 = returnList2.get(returnList2.size() - 1); map3 = returnList2.get(returnList2.size() - 1);
} }
map.put("processVariable1", Double.parseDouble(map1.get("value").toString())); map.put("processVariable1", Double.parseDouble(map1.get("value").toString()));
map.put("processVariable1Id", Long.parseLong(list.get(0).getProcessPointId().toString())); map.put("processVariable1Id", list.get(0).getProcessPointId().toString());
map.put("processVariable2", Double.parseDouble(map2.get("value").toString())); map.put("processVariable2", Double.parseDouble(map2.get("value").toString()));
map.put("processVariable2Id", Long.parseLong(list.get(1).getProcessPointId().toString())); map.put("processVariable2Id", list.get(1).getProcessPointId().toString());
map.put("processVariable3", Double.parseDouble(map3.get("value").toString())); map.put("processVariable3", Double.parseDouble(map3.get("value").toString()));
map.put("processVariable3Id", Long.parseLong(list.get(2).getProcessPointId().toString())); map.put("processVariable3Id", list.get(2).getProcessPointId().toString());
params1.add(map); params1.add(map);
if (params.size() >= params1.size()) { }
requestParams = megreMapList1(params, params1); if (params.size() >= params1.size()) {
} else { requestParams = megreMapList1(params, params1);
requestParams = megreMapList1(params1, params); } else {
} requestParams = megreMapList1(params1, params);
if (!requestParams.isEmpty()) { }
logger.info("---------------------------------风机中心值---------开始调用中心值计算算法开始----------------------------------------"); if (!requestParams.isEmpty()) {
HashMap<String, Object> realParams = new HashMap<>(); logger.info("---------------------------------风机中心值---------开始调用中心值计算算法开始----------------------------------------");
realParams.put(gkzxzjskey1, requestParams); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey2, values); realParams.put(gkzxzjskey1, values);
logger.info("------------------------------风机中心值------请求参数---------------------------------------" + JSON.toJSONString(realParams)); realParams.put(gkzxzjskey2, requestParams);
String response = HttpUtil.createPost(baseUrl + gkzxzjsurl).body(JSON.toJSONString(realParams)).execute().body(); logger.info("------------------------------风机中心值------请求参数---------------------------------------" + JSON.toJSONString(realParams));
try { String response = HttpUtil.createPost(baseUrl + gkzxzjsurlfan).body(JSON.toJSONString(realParams)).execute().body();
logger.info("------------------风机中心值--repsonse: " + response); try {
TimeUnit.SECONDS.sleep(sleepTime); logger.info("------------------风机中心值--repsonse: " + response);
logger.info("-----------------------------------风机中心值-------调用中心值计算算法结束----------------------------------------"); TimeUnit.SECONDS.sleep(zxzsleepTime);
} catch (InterruptedException e) { logger.info("-----------------------------------风机中心值-------调用中心值计算算法结束----------------------------------------");
throw new RuntimeException(e); } catch (InterruptedException e) {
} throw new RuntimeException(e);
} }
} }
} }
//中心值参数组装-光伏 //中心值参数组装-光伏
...@@ -535,33 +543,33 @@ public class CommonServiceImpl { ...@@ -535,33 +543,33 @@ public class CommonServiceImpl {
List<IdxBizPvPointProcessVariableClassification> idxBizPvPointProcessVariableClassificationList = idxBizPvPointProcessVariableClassificationMapper.selectList(new QueryWrapper<IdxBizPvPointProcessVariableClassification>().in("SEQUENCE_NBR", processPointIds)); List<IdxBizPvPointProcessVariableClassification> idxBizPvPointProcessVariableClassificationList = idxBizPvPointProcessVariableClassificationMapper.selectList(new QueryWrapper<IdxBizPvPointProcessVariableClassification>().in("SEQUENCE_NBR", processPointIds));
//区间值1 //区间值1
HashMap<String, Object> value1 = new HashMap<>(); HashMap<String, Object> value1 = new HashMap<>();
value1.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue1())?0.0:idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue1()); value1.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue1()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue1());
value1.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue1())?0.0:idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue1()); value1.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue1()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue1());
value1.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue1())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue1()); value1.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue1()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue1());
values.add(value1); values.add(value1);
//区间值2 //区间值2
HashMap<String, Object> value2 = new HashMap<>(); HashMap<String, Object> value2 = new HashMap<>();
value2.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue2())?0.0:idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue2()); value2.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue2()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue2());
value2.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue2())?0.0:idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue2()); value2.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue2()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue2());
value2.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue2())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue2()); value2.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue2()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue2());
values.add(value2); values.add(value2);
//区间值3 //区间值3
HashMap<String, Object> value3 = new HashMap<>(); HashMap<String, Object> value3 = new HashMap<>();
value3.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue3())?0.0:idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue3()); value3.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue3()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue3());
value3.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue3())?0.0:idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue3()); value3.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue3()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue3());
value3.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue3())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue3()); value3.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue3()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue3());
values.add(value3); values.add(value3);
//区间值4 //区间值4
HashMap<String, Object> value4 = new HashMap<>(); HashMap<String, Object> value4 = new HashMap<>();
value4.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue4())?0.0:idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue4()); value4.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue4()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue4());
value4.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue4())?0.0:idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue4()); value4.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue4()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue4());
value4.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue4())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue4()); value4.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue4()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue4());
values.add(value4); values.add(value4);
//区间值5 //区间值5
HashMap<String, Object> value5 = new HashMap<>(); HashMap<String, Object> value5 = new HashMap<>();
value5.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue5())?0.0:idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue5()); value5.put("processVariable1", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue5()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(2).getIntervalValue5());
value5.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue5())?0.0:idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue5()); value5.put("processVariable2", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue5()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(1).getIntervalValue5());
value5.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue5())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue5()); value5.put("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue5()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue5());
values.add(value5); values.add(value5);
List<Map<String, Object>> returnList0 = influxdbUtil.query(sql); List<Map<String, Object>> returnList0 = influxdbUtil.query(sql);
List<Map<String, Object>> maxList = returnList0; List<Map<String, Object>> maxList = returnList0;
...@@ -596,27 +604,28 @@ public class CommonServiceImpl { ...@@ -596,27 +604,28 @@ public class CommonServiceImpl {
map.put("processVariable3", Double.parseDouble(map3.get("value").toString())); map.put("processVariable3", Double.parseDouble(map3.get("value").toString()));
map.put("processVariable3Id", Long.parseLong(list.get(2).getProcessPointId().toString())); map.put("processVariable3Id", Long.parseLong(list.get(2).getProcessPointId().toString()));
params1.add(map); params1.add(map);
if (params.size() >= params1.size()) { }
requestParams = megreMapList1(params, params1); if (params.size() >= params1.size()) {
} else { requestParams = megreMapList1(params, params1);
requestParams = megreMapList1(params1, params); } else {
} requestParams = megreMapList1(params1, params);
if (!requestParams.isEmpty()) { }
logger.info("-------------------------------------光伏中心值-----开始调用中心值计算算法----------------------------------------"); if (!requestParams.isEmpty()) {
HashMap<String, Object> realParams = new HashMap<>(); logger.info("-------------------------------------光伏中心值-----开始调用中心值计算算法----------------------------------------");
realParams.put(gkzxzjskey1, requestParams); HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey2, values); realParams.put(gkzxzjskey1, values);
String response = HttpUtil.createPost(baseUrl + gkzxzjsurl).body(JSON.toJSONString(realParams)).execute().body(); realParams.put(gkzxzjskey2, requestParams);
try { String response = HttpUtil.createPost(baseUrl + gkzxzjsurlpv).body(JSON.toJSONString(realParams)).execute().body();
logger.info("-------------光伏中心值-------repsonse: " + response); try {
TimeUnit.SECONDS.sleep(sleepTime); logger.info("-------------光伏中心值-------repsonse: " + response);
logger.info("-----------------------------------光伏中心值-------调用中心值计算算法结束----------------------------------------"); TimeUnit.SECONDS.sleep(sleepTime);
} catch (InterruptedException e) { logger.info("-----------------------------------光伏中心值-------调用中心值计算算法结束----------------------------------------");
throw new RuntimeException(e); } catch (InterruptedException e) {
} throw new RuntimeException(e);
} }
} }
} }
public List<Map<String, Object>> megreMapList1(List<Map<String, Object>> longList, List<Map<String, Object>> shortList) { public List<Map<String, Object>> megreMapList1(List<Map<String, Object>> longList, List<Map<String, Object>> shortList) {
...@@ -646,21 +655,39 @@ public class CommonServiceImpl { ...@@ -646,21 +655,39 @@ public class CommonServiceImpl {
return resultList; return resultList;
} }
public List<Map<String, Object>> getInfluxdbDataByConditon(String stationType, String pointId, String startTime, String endTime) { public Map<String, Object> getInfluxdbDataByConditon(String stationType, String pointId, String startTime, String endTime) {
HashMap<String,Object> resultLast =new HashMap();
String sql = ""; String sql = "";
if ("FD".equals(stationType)) { if ("FD".equals(stationType)) {
IdxBizFanPointProcessVariableClassification idxBizFanPointProcessVariableClassification = idxBizFanPointProcessVariableClassificationMapper.selectById(pointId); IdxBizFanPointProcessVariableClassification idxBizFanPointProcessVariableClassification = idxBizFanPointProcessVariableClassificationMapper.selectOne(new QueryWrapper<IdxBizFanPointProcessVariableClassification>().eq("SEQUENCE_NBR",pointId));
sql = String.format("select * from iot_data_%s where address ='%s' and time > '%s' and time < '%s' ;", idxBizFanPointProcessVariableClassification.getGatewayId(), idxBizFanPointProcessVariableClassification.getIndexAddress(), startTime, endTime); sql = String.format("select * from iot_data_%s where address ='%s' and time > '%s' and time < '%s' ;", idxBizFanPointProcessVariableClassification.getGatewayId(), idxBizFanPointProcessVariableClassification.getIndexAddress(), getUtcTimeString(startTime), getUtcTimeString(endTime));
} else { } else {
IdxBizPvPointProcessVariableClassification idxBizPvPointProcessVariableClassification = idxBizPvPointProcessVariableClassificationMapper.selectById(pointId); IdxBizPvPointProcessVariableClassification idxBizPvPointProcessVariableClassification = idxBizPvPointProcessVariableClassificationMapper.selectOne(new QueryWrapper<IdxBizPvPointProcessVariableClassification>().eq("SEQUENCE_NBR",pointId));
sql = String.format("select * from iot_data_%s where address ='%s' and time > '%s' and time < '%s' ;", idxBizPvPointProcessVariableClassification.getGatewayId(), idxBizPvPointProcessVariableClassification.getIndexAddress(), startTime, endTime); sql = String.format("select * from iot_data_%s where address ='%s' and time > '%s' and time < '%s' ;", idxBizPvPointProcessVariableClassification.getGatewayId(), idxBizPvPointProcessVariableClassification.getIndexAddress(), getUtcTimeString(startTime), getUtcTimeString(endTime));
} }
return influxdbUtil.query(sql); List<Map<String,Object>> reuslt = influxdbUtil.query(sql);
List<String> seriesData_valuse=new ArrayList<>();
List<String> axisData_valuse=new ArrayList<>();
reuslt.forEach(item->{
seriesData_valuse.add(item.get("value").toString());
axisData_valuse.add(item.get("time").toString());
});
resultLast.put("seriesData",seriesData_valuse);
resultLast.put("axisData",axisData_valuse);
return resultLast;
} }
public String getUtcTimeString(String timeStr) { public String getUtcTimeString(String timeStr) {
SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT_UTC); SimpleDateFormat dateFormatUTC = new SimpleDateFormat(FORMAT_UTC);
return dateFormat.format(timeStr); SimpleDateFormat dateFormatDefault = new SimpleDateFormat(FORMAT_DEFAULT);
Date time1 = null;
try {
time1 = dateFormatDefault.parse(timeStr);
} catch (ParseException e) {
logger.info("输入的时间格式错误");
}
String s = dateFormatUTC.format(time1);
return s;
} }
@Scheduled(cron = "0/10 * * * * ?") @Scheduled(cron = "0/10 * * * * ?")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment