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 {
@ApiModelProperty(value = "开发方code")
private String developerCode;
@ApiModelProperty(value = "开发方平台id")
private Long developerId;
@ApiModelProperty(value = "定金")
private Float deposit;
......
......@@ -76,13 +76,13 @@ public class PreparationMoneyDto extends BaseDto {
private String receipt;
@ApiModelProperty(value = "订单状态0未完成1已完成2作废")
private Integer documentState;
private String documentState;
@ApiModelProperty(value = "发货状态 0 未发货1已发货")
private Integer shipmentStatus;
private String shipmentStatus;
@ApiModelProperty(value = "到货状态0未到货1已到货")
private Integer receivingStatus;
private String receivingStatus;
@ApiModelProperty(value = "清单价格")
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 {
@ApiModelProperty(value = "开发方code")
private String developerCode;
@ApiModelProperty(value = "开发方平台id")
private Long developerId;
@ApiModelProperty(value = " 业务员id")
private String salesmanId;
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -60,6 +61,8 @@ public class PeasantHousehold extends BaseEntity {
@TableField("developer_code")
private String developerCode;
@TableField("developer_id")
private Long developerId;
/**
* 定金
*/
......
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.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 发货单
......@@ -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;
/**
* 订单状态0未完成1已完成2作废
* 订单状态0未完成1已完成2作废
*/
@TableField("document_state")
private Integer documentState;
private String documentState;
/**
* 发货状态 0 未发货1已发货
*/
@TableField("shipment_status")
private Integer shipmentStatus;
private String shipmentStatus;
/**
* 到货状态0未到货1已到货
*/
@TableField("receiving_status")
private Integer receivingStatus;
private String receivingStatus;
/**
* 清单价格
......
......@@ -9,4 +9,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
*/
public interface IPeasantHouseholdService {
}
......@@ -100,8 +100,8 @@ public class PeasantHouseholdController extends BaseController {
model.setSurveyInformationId(surveyInformationDto.getSequenceNbr());
model.setSurveyOrNot(0);
model.setReview(0);
model.setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode());
model.setDeveloperId(userInfo.getCompanys().get(0).getSequenceNbr());
model.setDeveloperName(userInfo.getOrgNamesWithoutRole());
if(StringUtils.isEmpty(model.getDeveloper())){
model.setDeveloper(userInfo.getRealName());
......@@ -252,4 +252,6 @@ public class PeasantHouseholdController extends BaseController {
}
return jsonArray;
}
}
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 io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Date;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PreparationMoneyServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -94,12 +100,13 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "发货单分页查询", notes = "发货单分页查询")
public ResponseModel<Page<PreparationMoneyDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<PreparationMoneyDto> page = new Page<PreparationMoneyDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(preparationMoneyServiceImpl.queryForPreparationMoneyPage(page));
public ResponseModel<IPage<PreparationMoney>> queryForPage(PreparationPageDto preparationPageDto
) {
return ResponseHelper.buildResponse(preparationMoneyServiceImpl.queryForPreparationMoneyPage(preparationPageDto));
}
/**
......
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.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -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.hwsms.SendSmsCode;
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.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
......@@ -78,8 +80,8 @@ public class UnitInfoController extends BaseController {
DealerReviewServiceImpl dealerReviewServiceImpl;
@Autowired
CommerceInfoMapper commerceInfoMapper;
@Autowired
UnitInfoMapper unitInfoMapper;
/**
* 验证码过期时间
*/
......@@ -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;
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.mapper.PreparationMoneyMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPreparationMoneyService;
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 com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -18,11 +23,37 @@ import java.util.List;
*/
@Service
public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto,PreparationMoney,PreparationMoneyMapper> implements IPreparationMoneyService {
@Autowired
private PreparationMoneyMapper preparationMoneyMapper;
/**
* 分页查询
*/
public Page<PreparationMoneyDto> queryForPreparationMoneyPage(Page<PreparationMoneyDto> page) {
return this.queryForPage(page, null, false);
public IPage<PreparationMoney> queryForPreparationMoneyPage(PreparationPageDto dto) {
//列表数据组装
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
BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation());
surveyInfoAllDto.getSurveyInformation().setDeveloperName(userInfo.getCompanys().get(0).getCompanyName());
surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode());
surveyInfoAllDto.getSurveyInformation().setDeveloperId(userInfo.getCompanys().get(0).getSequenceNbr());
surveyInfoAllDto.getSurveyInformation().setSalesmanId(userInfo.getUserId());
surveyInfoAllDto.getSurveyInformation().setSalesman(userInfo.getRealName());
surveyInfoAllDto.getSurveyInformation().setCreator(userInfo.getRealName());
......
......@@ -66,7 +66,7 @@ public class AnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "获取influxdb数据", notes = "获取influxdb数据")
@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)) ;
}
}
......@@ -15,7 +15,6 @@ import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
......@@ -26,6 +25,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
......@@ -35,25 +35,34 @@ import java.util.stream.Collectors;
public class CommonServiceImpl {
//utc时间格式
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);
//-----------------调用算法时间间隔----------------
@Value("${sleep.time:10}")
Integer sleepTime;
@Value("${sleep.time:30}")
Integer zxzsleepTime;
@Value("${base.url:http://36.40.66.175:30009/maas/maas/processes/api/}")
String baseUrl;
//----------------工况变量工况变量划分请求属性配置------------------------
@Value("${gkblhf.url:e884fccf-b7ac-4fa4-bdb7-a5b6ff7319ec}")
String gkqjhfurl;
@Value("${gkblhffan.url:3d0acca8-a6aa-4791-8dc3-9f8d3137556a}")
String gkqjhfurlfan;
@Value("${gkblhfpv.url:e884fccf-b7ac-4fa4-bdb7-a5b6ff7319ec}")
String gkqjhfurlpv;
@Value("${gkblhf.key:input 1}")
String gkqjhfkey;
//----------------工况变量相关性计算请求属性配置------------------------
@Value("${gkxgxfx.url:f5457bfe-0780-418d-9287-c4f31d3fb4c7}")
String gkxgxfxurl;
@Value("${gkxgxfxfan.url:b5797e0a-d456-44d3-9f21-9528e5321b74}")
String gkxgxfxurlfan;
@Value("${gkxgxfxpv.url:f5457bfe-0780-418d-9287-c4f31d3fb4c7}")
String gkxgxfxurlpv;
@Value("${gkxgxfx.key:input 1}")
String gkxgxfxkey;
//----------------工况变量中心值计算相关请求属性配置------------------------
@Value("${gkzxzjs.url:ee855fc0-cb37-4b11-96c6-e61e195436bc}")
String gkzxzjsurl;
@Value("${gkzxzjsfan.url:2ad85cd3-aede-4936-b3bb-029bf2598c49}")
String gkzxzjsurlfan;
@Value("${gkzxzjspv.url:5c9fc897-a9f2-4563-8d7b-8cf60c6a663f}")
String gkzxzjsurlpv;
@Value("${gkzxzjs.key:input 1}")
String gkzxzjskey1;
......@@ -160,7 +169,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------风机::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
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 {
logger.info(reponse);
TimeUnit.SECONDS.sleep(sleepTime);
......@@ -191,7 +200,7 @@ public class CommonServiceImpl {
logger.info("------------------------------------------光伏::开始调用工况变量区间划分算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
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 {
logger.info(reponse);
TimeUnit.SECONDS.sleep(sleepTime);
......@@ -294,7 +303,7 @@ public class CommonServiceImpl {
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkxgxfxkey, requestParams);
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 {
logger.info("response-------------" + repsonse);
TimeUnit.SECONDS.sleep(sleepTime);
......@@ -339,7 +348,7 @@ public class CommonServiceImpl {
logger.info("---------------------------------光伏相关性---------分析变量与工况变量相关性分析算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
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 {
logger.info("response----光伏相关性---------" + repsonse);
TimeUnit.SECONDS.sleep(sleepTime);
......@@ -412,7 +421,7 @@ public class CommonServiceImpl {
returnList.forEach((k) -> {
Map<String, Object> map = new HashMap<>();
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);
});
logger.info("--------------------------------------风机中心值------开始查询influxdb--------------------------------");
......@@ -423,37 +432,37 @@ public class CommonServiceImpl {
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());
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));
//区间值1
HashMap<String, Object> value1 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue1())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue1()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue1());
values.add(value1);
//区间值2
HashMap<String, Object> value2 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue2())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue2()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue2());
values.add(value2);
//区间值3
HashMap<String, Object> value3 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue3())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue3()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue3());
values.add(value3);
//区间值4
HashMap<String, Object> value4 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue4())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue4()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue4());
values.add(value4);
//区间值5
HashMap<String, Object> value5 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue5())?0.0:idxBizFanPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue5()) ? 0.0 : idxBizFanPointProcessVariableClassificationList.get(0).getIntervalValue5());
values.add(value5);
List<Map<String, Object>> returnList0 = influxdbUtil.query(sql);
List<Map<String, Object>> maxList = returnList0;
......@@ -482,12 +491,13 @@ public class CommonServiceImpl {
map3 = returnList2.get(returnList2.size() - 1);
}
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("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("processVariable3Id", Long.parseLong(list.get(2).getProcessPointId().toString()));
map.put("processVariable3Id", list.get(2).getProcessPointId().toString());
params1.add(map);
}
if (params.size() >= params1.size()) {
requestParams = megreMapList1(params, params1);
} else {
......@@ -496,13 +506,13 @@ public class CommonServiceImpl {
if (!requestParams.isEmpty()) {
logger.info("---------------------------------风机中心值---------开始调用中心值计算算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey1, requestParams);
realParams.put(gkzxzjskey2, values);
realParams.put(gkzxzjskey1, values);
realParams.put(gkzxzjskey2, requestParams);
logger.info("------------------------------风机中心值------请求参数---------------------------------------" + JSON.toJSONString(realParams));
String response = HttpUtil.createPost(baseUrl + gkzxzjsurl).body(JSON.toJSONString(realParams)).execute().body();
String response = HttpUtil.createPost(baseUrl + gkzxzjsurlfan).body(JSON.toJSONString(realParams)).execute().body();
try {
logger.info("------------------风机中心值--repsonse: " + response);
TimeUnit.SECONDS.sleep(sleepTime);
TimeUnit.SECONDS.sleep(zxzsleepTime);
logger.info("-----------------------------------风机中心值-------调用中心值计算算法结束----------------------------------------");
} catch (InterruptedException e) {
throw new RuntimeException(e);
......@@ -510,8 +520,6 @@ public class CommonServiceImpl {
}
}
}
//中心值参数组装-光伏
public void foreachHandlerConditionVariabAnalyse1Pv(String tableName, List<IdxBizPvPointVarCorrelation> list, String startTime, String endTime, IdxBizPvPointProcessVariableClassification idxBizPvPointProcessVariableClassification) {
String sql0 = String.format("select value from %s where address='%s' ", tableName, idxBizPvPointProcessVariableClassification.getIndexAddress());
......@@ -535,33 +543,33 @@ public class CommonServiceImpl {
List<IdxBizPvPointProcessVariableClassification> idxBizPvPointProcessVariableClassificationList = idxBizPvPointProcessVariableClassificationMapper.selectList(new QueryWrapper<IdxBizPvPointProcessVariableClassification>().in("SEQUENCE_NBR", processPointIds));
//区间值1
HashMap<String, Object> value1 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue1())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue1()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue1());
values.add(value1);
//区间值2
HashMap<String, Object> value2 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue2())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue2()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue2());
values.add(value2);
//区间值3
HashMap<String, Object> value3 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue3())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue3()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue3());
values.add(value3);
//区间值4
HashMap<String, Object> value4 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue4())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue4()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue4());
values.add(value4);
//区间值5
HashMap<String, Object> value5 = new HashMap<>();
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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue5())?0.0:idxBizPvPointProcessVariableClassificationList.get(0).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("processVariable3", ObjectUtils.isEmpty(idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue5()) ? 0.0 : idxBizPvPointProcessVariableClassificationList.get(0).getIntervalValue5());
values.add(value5);
List<Map<String, Object>> returnList0 = influxdbUtil.query(sql);
List<Map<String, Object>> maxList = returnList0;
......@@ -596,6 +604,7 @@ public class CommonServiceImpl {
map.put("processVariable3", Double.parseDouble(map3.get("value").toString()));
map.put("processVariable3Id", Long.parseLong(list.get(2).getProcessPointId().toString()));
params1.add(map);
}
if (params.size() >= params1.size()) {
requestParams = megreMapList1(params, params1);
} else {
......@@ -604,9 +613,9 @@ public class CommonServiceImpl {
if (!requestParams.isEmpty()) {
logger.info("-------------------------------------光伏中心值-----开始调用中心值计算算法----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey1, requestParams);
realParams.put(gkzxzjskey2, values);
String response = HttpUtil.createPost(baseUrl + gkzxzjsurl).body(JSON.toJSONString(realParams)).execute().body();
realParams.put(gkzxzjskey1, values);
realParams.put(gkzxzjskey2, requestParams);
String response = HttpUtil.createPost(baseUrl + gkzxzjsurlpv).body(JSON.toJSONString(realParams)).execute().body();
try {
logger.info("-------------光伏中心值-------repsonse: " + response);
TimeUnit.SECONDS.sleep(sleepTime);
......@@ -615,7 +624,7 @@ public class CommonServiceImpl {
throw new RuntimeException(e);
}
}
}
}
......@@ -646,21 +655,39 @@ public class CommonServiceImpl {
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 = "";
if ("FD".equals(stationType)) {
IdxBizFanPointProcessVariableClassification idxBizFanPointProcessVariableClassification = idxBizFanPointProcessVariableClassificationMapper.selectById(pointId);
sql = String.format("select * from iot_data_%s where address ='%s' and time > '%s' and time < '%s' ;", idxBizFanPointProcessVariableClassification.getGatewayId(), idxBizFanPointProcessVariableClassification.getIndexAddress(), startTime, endTime);
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(), getUtcTimeString(startTime), getUtcTimeString(endTime));
} else {
IdxBizPvPointProcessVariableClassification idxBizPvPointProcessVariableClassification = idxBizPvPointProcessVariableClassificationMapper.selectById(pointId);
sql = String.format("select * from iot_data_%s where address ='%s' and time > '%s' and time < '%s' ;", idxBizPvPointProcessVariableClassification.getGatewayId(), idxBizPvPointProcessVariableClassification.getIndexAddress(), startTime, endTime);
}
return influxdbUtil.query(sql);
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(), getUtcTimeString(startTime), getUtcTimeString(endTime));
}
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) {
SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT_UTC);
return dateFormat.format(timeStr);
SimpleDateFormat dateFormatUTC = new SimpleDateFormat(FORMAT_UTC);
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 * * * * ?")
......
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