Commit 8c5779b1 authored by wujiang's avatar wujiang

提交代码

parent 75689568
......@@ -182,7 +182,9 @@ public class HygfIcbcRecordDTO {
@ApiModelProperty (value = "代扣金额")
private Double paymentAmount;
@ApiModelProperty (value = "代扣时间")
private String paymentTime;
@ApiModelProperty (value = "银行卡类型")
private String type;
}
\ No newline at end of file
......@@ -48,4 +48,6 @@ public class HygfIcbcRecordQueryDTO {
private Integer offset;
private List<String> ids;
private String type;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* <p>
* ProjectName: amos-boot-zx-biz
* PackageName: com.yeejoin.amos.boot.module.hygf.api.dto
*
* @author yangyang
* @version v1.0
* @date 2024/7/18 14:36
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class HygfIcbcSignProtocolDTO {
String phone;
String mediumId;
String verifyCode;
String sendNo;
String srVid;
boolean cancel=false;
}
......@@ -117,4 +117,7 @@ public class HygfIcbcRecord extends BaseEntity {
*/
@TableField("amos_user_id")
private String amosUserId;
@TableField("type")
private String type;
}
\ No newline at end of file
......@@ -103,6 +103,7 @@
icbc.out_user_id as outUserId,
icbc.protocol_status,
icbc.medium_id,
icbc.type,
ph.rec_date,
ph.regional_companies_name as regionalCompaniesName,
ph.regional_companies_code as regionalCompaniesCode,
......@@ -142,6 +143,9 @@
<if test="param.addressName != null and param.addressName != ''">
AND ph.project_address LIKE CONCAT('%', #{param.addressName}, '%')
</if>
<if test="param.type != null and param.type != ''">
AND icbc.type LIKE CONCAT('%', #{param.type}, '%')
</if>
<if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''">
<if test="param.openAccountStatus != '00'">
......
......@@ -4,10 +4,7 @@ import com.icbc.api.response.JftApiUserEntrustopenacctQueryResponseV1;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRectificationOrderDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HouseholdContractDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.HygfIcbcServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
......@@ -157,7 +154,34 @@ public class HygfIcbcController extends BaseController {
@GetMapping(value = "/exportExcel")
@UserLimits
public void exportData( HttpServletResponse response,HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
hygfIcbcService.exportExcel(response,hygfIcbcRecordQueryDTO);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "签约代扣验证码", notes = "签约代扣验证码")
@GetMapping(value = "/signVerifyCode")
public ResponseModel<Object> signVerifyCode(@RequestParam(required = true) String phone,@RequestParam(required = true) String mediumId ) {
return ResponseHelper.buildResponse( hygfIcbcService.signVerifyCode(phone,mediumId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "POST",value = "签约代扣协议", notes = "签约代扣协议")
@PostMapping(value = "/signProtocol")
public ResponseModel<Object> signProtocol(@RequestBody HygfIcbcSignProtocolDTO hygfIcbcSignProtocolDTO){
return ResponseHelper.buildResponse(hygfIcbcService.signProtocol(hygfIcbcSignProtocolDTO));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "查询代扣协议", notes = "查询代扣协议")
@GetMapping(value = "/signQuery")
public ResponseModel<Object> signQuery(String busiCode){
return ResponseHelper.buildResponse(hygfIcbcService.signQuery(busiCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "余额查询", notes = "余额查询")
@GetMapping(value = "/balanceQuery")
public ResponseModel<Object> balanceQuery(String mediumId){
return ResponseHelper.buildResponse(hygfIcbcService.balanceQuery(mediumId));
}
}
......@@ -4,6 +4,9 @@ import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Base64;
import java.util.Calendar;
......@@ -24,11 +27,13 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.icbc.api.request.*;
import com.icbc.api.response.*;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.hygf.api.dto.HistoryPeasantHouseholdDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordExportDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStationEngineeringInfo;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HouseholdContractMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationEngineeringInfoMapper;
......@@ -47,14 +52,9 @@ import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.icbc.api.IcbcConstants;
import com.icbc.api.UiIcbcClient;
import com.icbc.api.request.JftApiUserEntrustopenacctQueryRequestV1;
import com.icbc.api.request.JftUiUserEntrustopenacctSubmitRequestV1;
import com.icbc.api.response.JftApiUserEntrustopenacctQueryResponseV1;
import com.icbc.api.utils.IcbcSignature;
import com.icbc.api.utils.WebUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.IcbcEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordQueryDTO;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfIcbcRecord;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfIcbcRequest;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
......@@ -354,6 +354,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
// hygfIcbcRecord.setDiscardStatus();
hygfIcbcRecord.setAmosUserId(outUserId);
hygfIcbcRecord.setRecDate(new Date());
hygfIcbcRecord.setType("二类卡");
hygfIcbcRequest.setPhase("入库");
hygfIcbcRequestMapper.updateById(hygfIcbcRequest);
......@@ -460,7 +461,6 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO);
PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list);
Page<HygfIcbcRecordDTO> pagenew = new Page<>();
pagenew.setCurrent(current);
......@@ -469,9 +469,9 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
pagenew.setRecords(toModels(page.getList()));
Map<String, Object> resultMap = BeanUtil.beanToMap(pagenew);
List<HygfIcbcRecordDTO> list1 = hygfIcbcRecordMapper.pageListSum(hygfIcbcRecordQueryDTO);
double sum = list1.stream().filter(e->null != e.getPaymentAmount()).mapToDouble(HygfIcbcRecordDTO::getPaymentAmount).sum();
double sum = list1.stream().filter(e -> null != e.getPaymentAmount()).mapToDouble(HygfIcbcRecordDTO::getPaymentAmount).sum();
resultMap.put("paymentAmountAll",sum);
resultMap.put("paymentAmountAll", sum);
return resultMap;
// ======================================================統計錯誤=================================================================
......@@ -658,17 +658,17 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
}
public Map<String,Long> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district){
public Map<String, Long> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district) {
List<HygfIcbcRecordExportDTO> dtos = hygfIcbcRecordMapper.exportTotal(developerCode, regionalCompaniesCode, province, city, district);
Map<String, Long> collect = dtos.stream()
.collect(Collectors.groupingBy(HygfIcbcRecordExportDTO::getOpenAccountStatus, Collectors.counting()));
String[] strings = {"开户失败","开户成功","未开户"};
String[] strings = {"开户失败", "开户成功", "未开户"};
List<String> names = Arrays.asList(strings);
for (String name : names) {
if (!collect.keySet().contains(name)) {
collect.put(name,0L);
collect.put(name, 0L);
}
}
......@@ -678,21 +678,268 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
}
public void exportData(HttpServletResponse response,String developerCode, String regionalCompaniesCode, String province, String city, String district){
public void exportData(HttpServletResponse response, String developerCode, String regionalCompaniesCode, String province, String city, String district) {
List<HygfIcbcRecordExportDTO> dtos = hygfIcbcRecordMapper.exportTotal(developerCode, regionalCompaniesCode, province, city, district);
if (CollectionUtil.isNotEmpty(dtos)){
ExcelUtil.createTemplate(response,"开卡统计","开卡统计",dtos, HygfIcbcRecordExportDTO.class,null,false);
if (CollectionUtil.isNotEmpty(dtos)) {
ExcelUtil.createTemplate(response, "开卡统计", "开卡统计", dtos, HygfIcbcRecordExportDTO.class, null, false);
}
}
public void exportExcel(HttpServletResponse response, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO){
public void exportExcel(HttpServletResponse response, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
List<HygfIcbcRecordExportDTO> hygfIcbcRecordExportDTOS = hygfIcbcRecordMapper.paymentAmountExport(hygfIcbcRecordQueryDTO);
if (CollectionUtil.isNotEmpty(hygfIcbcRecordExportDTOS)){
ExcelUtil.createTemplate(response,"账号信息","账号信息",hygfIcbcRecordExportDTOS, HygfIcbcRecordExportDTO.class,null,false);
if (CollectionUtil.isNotEmpty(hygfIcbcRecordExportDTOS)) {
ExcelUtil.createTemplate(response, "账号信息", "账号信息", hygfIcbcRecordExportDTOS, HygfIcbcRecordExportDTO.class, null, false);
}
}
public Object signVerifyCode(String phone, String mediumId) {
// PeasantHousehold peasantHousehold=peasantHouseholdService
// .getOne(new LambdaQueryWrapper<PeasantHousehold>().eq(PeasantHousehold::getTelephone,phone).last("LIMIT 1"));
// if(peasantHousehold==null)
// {
// return "农户不存在";
// }
PeasantHousehold peasantHousehold = new PeasantHousehold();
peasantHousehold.setAmosUserId("890728");
peasantHousehold.setOwnersName("吴江");
peasantHousehold.setIdCard("61010319890728203X");
String apiUrl = serviceUrl + "/api/jft/api/user/entrust/send/verify/code/V1";
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2, MY_PRIVATE_KEY,
IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, APIGW_PUBLIC_KEY, IcbcConstants.ENCRYPT_TYPE_AES,
AES_Key, "", "");
JftUserEntrustprtlMobileVerifyRequestV1 request = new
JftUserEntrustprtlMobileVerifyRequestV1();
//4、根据测试环境和生产环境替换相应ip和端口
request.setServiceUrl(apiUrl);
//5、请对照接口文档用bizContent.setxxx()方法对业务上送数据进行赋值
JftUserEntrustprtlMobileVerifyRequestV1.JftUserEntrustprtlMobileVerifyRequestV1Biz bizContent = new
JftUserEntrustprtlMobileVerifyRequestV1.JftUserEntrustprtlMobileVerifyRequestV1Biz();
bizContent.setAppId(APP_ID);
bizContent.setOutVendorId(OUT_VENDOR_ID);
bizContent.setMobile(phone);
bizContent.setAccountName(peasantHousehold.getOwnersName());
bizContent.setAccountNo(mediumId);
bizContent.setIdType("0");
bizContent.setIdNo(peasantHousehold.getIdCard());
bizContent.setTrxType("01");
bizContent.setProjectId(PROJECT_ID);
bizContent.setTextSerno("09");
bizContent.setProtocolLimitAmount("20000000");//单位分,不要带小数,非必输
//bizContent.setSmsNote("自定义备注内容");//短信会显示:XXXXXXXX,备注:自定义备注内容
request.setBizContent(bizContent);
JftUserEntrustprtlMobileVerifyResponseV1 response = null;
try {
log.info("聚富通委托代扣签约验证码, 入参 => {}", JSON.toJSONString(request));
response = (JftUserEntrustprtlMobileVerifyResponseV1)
client.execute(request, System.currentTimeMillis() + "");
log.info("聚富通委托代扣签约验证码, 出参 => {}", JSON.toJSONString(response));
//msgId消息通讯唯一编号,要求每次调用独立生成,APP级唯一
if (response.isSuccess()) {
//6、业务成功处理,请根据接口文档用response.getxxx()获取同步返回的业务数据
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("response:" + response);
} else {
//失败
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("ReturnMsg:" + response.getReturnMsg());
}
} catch (IcbcApiException e) {
e.printStackTrace();
}
return response;
}
public Object signProtocol(HygfIcbcSignProtocolDTO hygfIcbcSignProtocolDTO) {
// PeasantHousehold peasantHousehold=peasantHouseholdService
// .getOne(new LambdaQueryWrapper<PeasantHousehold>().eq(PeasantHousehold::getTelephone,hygfIcbcSignProtocolDTO.getPhone()).last("LIMIT 1"));
// if(peasantHousehold==null)
// {
// return "农户不存在";
// }
PeasantHousehold peasantHousehold = new PeasantHousehold();
peasantHousehold.setAmosUserId("890728");
peasantHousehold.setOwnersName("吴江");
peasantHousehold.setIdCard("61010319890728203X");
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2, MY_PRIVATE_KEY,
IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, APIGW_PUBLIC_KEY, IcbcConstants.ENCRYPT_TYPE_AES,
AES_Key, "", "");
JftUserEntrustprtlMngRequestV1 request = new JftUserEntrustprtlMngRequestV1();
//4、根据测试环境和生产环境替换相应ip和端口######8
// 请求示例委托代扣协议签约示例
//String apiUrl=serviceUrl+"/api/jft/api/vendor/rescind/user/protocol/V1";
String apiUrl = serviceUrl + "/api/jft/api/user/entrust/protocol/mng/V1";
request.setServiceUrl(apiUrl);
//5、请对照接口文档用bizContent.setxxx()方法对业务上送数据进行赋值
JftUserEntrustprtlMngRequestV1.JftUserEntrustprtlMngRequestV1Biz bizContent = new JftUserEntrustprtlMngRequestV1.JftUserEntrustprtlMngRequestV1Biz();
bizContent.setAppId(APP_ID);
bizContent.setOutVendorId(OUT_VENDOR_ID);
bizContent.setSrVid(hygfIcbcSignProtocolDTO.getSrVid());
if (hygfIcbcSignProtocolDTO.isCancel())//0签约 2解约
{
bizContent.setDealFlag("2");
} else {
bizContent.setDealFlag("0");
}
bizContent.setProjectId(PROJECT_ID);
bizContent.setBusiCode(peasantHousehold.getAmosUserId());
bizContent.setBankNo("102");//102默认工行
bizContent.setAccountNo(hygfIcbcSignProtocolDTO.getMediumId());
bizContent.setAccountName(peasantHousehold.getOwnersName());
bizContent.setMobile(hygfIcbcSignProtocolDTO.getPhone());
bizContent.setVerifyCode(hygfIcbcSignProtocolDTO.getVerifyCode());
bizContent.setSendNo(hygfIcbcSignProtocolDTO.getSendNo());
bizContent.setIdType("0");
bizContent.setIdNo(peasantHousehold.getIdCard());
LocalDate today = LocalDate.now();
LocalDate nextYearToday = today.plusYears(1);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = nextYearToday.format(formatter);
bizContent.setProtocolEndDate(formattedDate);
bizContent.setProtocolLimitAmount("20000000");
//bizContent.setCvn2("463");
//bizContent.setExpired("2002");
bizContent.setBankFlag("0");//0工行卡 1其他行卡
//bizContent.setQueryItem1("");
//bizContent.setQueryItem15("");
request.setBizContent(bizContent);
JftUserEntrustprtlMngResponseV1 response = null;
try {
response = (JftUserEntrustprtlMngResponseV1) client.execute(request,
System.currentTimeMillis() + "");
//msgId消息通讯唯一编号,要求每次调用独立生成,APP级唯一
if (response.isSuccess()) {
//6、业务成功处理,请根据接口文档用response.getxxx()获取同步返回的业务数据
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("response:" + response);
if (hygfIcbcSignProtocolDTO.isCancel())//0签约 2解约
{
this.remove(new LambdaQueryWrapper<HygfIcbcRecord>().eq(HygfIcbcRecord::getAmosUserId,peasantHousehold.getAmosUserId()));
} else {
HygfIcbcRecord hygfIcbcRecord = new HygfIcbcRecord();
hygfIcbcRecord.setPhone(hygfIcbcSignProtocolDTO.getPhone());
hygfIcbcRecord.setMediumId(hygfIcbcSignProtocolDTO.getMediumId());
hygfIcbcRecord.setProjectId(PROJECT_ID);
hygfIcbcRecord.setOpenAccountStatus("02");
hygfIcbcRecord.setSignEntrsutPrtlStatus("1");
hygfIcbcRecord.setCustName(peasantHousehold.getOwnersName());
hygfIcbcRecord.setIdCard(peasantHousehold.getIdCard());
hygfIcbcRecord.setType("一类卡");
hygfIcbcRecord.setAppId(APP_ID);
hygfIcbcRecord.setOutVendorId(OUT_VENDOR_ID);
hygfIcbcRecord.setOutUserId(peasantHousehold.getAmosUserId());
hygfIcbcRecord.setAmosUserId(peasantHousehold.getAmosUserId());
this.saveOrUpdate(hygfIcbcRecord);
JftUserEntrustprtlQueryResponseV1 prt = (JftUserEntrustprtlQueryResponseV1) signQuery(peasantHousehold.getAmosUserId());
if(prt.isSuccess()&&prt.getReturnCode()==0)
{
hygfIcbcRecord.setProtocolStatus(prt.getPrtlStatus());
hygfIcbcRecord.setProtocolStartTime(prt.getPrtlStartDate());
hygfIcbcRecord.setProtocolEndTime(prt.getPrtlEndDate());
hygfIcbcRecord.setTrxLimitAmount(String.valueOf(prt.getTrxLmtAmt()));
hygfIcbcRecord.setDayLimitAmount(String.valueOf(prt.getDayLmtAmt()));
hygfIcbcRecord.setProtocolLimitAmount(String.valueOf(prt.getPrtlLmtAmt()));
}
this.saveOrUpdate(hygfIcbcRecord);
}
} else {
//失败
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("ReturnMsg:" + response.getReturnMsg());
}
} catch (IcbcApiException e) {
e.printStackTrace();
}
return response;
}
public Object signQuery(String busiCode) {
String apiUrl = serviceUrl + "/api/jft/api/user/entrust/protocol/query/V1";
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2, MY_PRIVATE_KEY,
IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, APIGW_PUBLIC_KEY, IcbcConstants.ENCRYPT_TYPE_AES,
AES_Key, "", "");
JftUserEntrustprtlQueryRequestV1 request = new JftUserEntrustprtlQueryRequestV1();
//4、根据测试环境和生产环境替换相应ip和端口
request.setServiceUrl(apiUrl);
//5、请对照接口文档用bizContent.setxxx()方法对业务上送数据进行赋值
JftUserEntrustprtlQueryRequestV1.JftUserEntrustprtlQueryRequestV1Biz bizContent = new JftUserEntrustprtlQueryRequestV1.JftUserEntrustprtlQueryRequestV1Biz();
bizContent.setAppId(APP_ID);
bizContent.setOutVendorId(OUT_VENDOR_ID);
bizContent.setChannelType("303");//303-手机,302-pc
bizContent.setBizZone("00200");//00200(需要和分行人员确定)
LocalDateTime today = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = today.format(formatter);
bizContent.setTrxDate(formattedDate);
DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("HH:mm:ss");
String formattedTime = today.format(formatter2);
bizContent.setTrxTime(formattedTime);
bizContent.setProjectId(PROJECT_ID);
bizContent.setBusiCode(busiCode);
//bizContent.setNewPayAcc("9558870200001260273");
//bizContent.setQueryItem1("");
//bizContent.setQueryItem15("");
request.setBizContent(bizContent);
JftUserEntrustprtlQueryResponseV1 response = null;
try {
response = (JftUserEntrustprtlQueryResponseV1)
client.execute(request, System.currentTimeMillis() + "");
//msgId消息通讯唯一编号,要求每次调用独立生成,APP级唯一
if (response.isSuccess()) {
//6、业务成功处理,请根据接口文档用response.getxxx()获取同步返回的业务数据
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("response:" + response);
} else {//失败
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("ReturnMsg:" + response.getReturnMsg());
}
} catch (IcbcApiException e) {
e.printStackTrace();
}
return response;
}
public Object balanceQuery(String mediumId) {
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2, MY_PRIVATE_KEY,
IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, APIGW_PUBLIC_KEY, IcbcConstants.ENCRYPT_TYPE_AES,
AES_Key, "", "");
SettlementAccountBalanceQueryRequestV1 request = new SettlementAccountBalanceQueryRequestV1();
String apiUrl = serviceUrl + "/api/settlement/account/balance/V1/query";
request.setServiceUrl(apiUrl);
SettlementAccountBalanceQueryRequestV1.SettlementAccountBalanceQueryRequestV1Biz bizContent = new SettlementAccountBalanceQueryRequestV1.SettlementAccountBalanceQueryRequestV1Biz();
bizContent.setCorpNo("88888888");//合作方机构编号
LocalDateTime today = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = today.format(formatter);
bizContent.setTrxAccDate(formattedDate);
DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("HH:mm:ss");
String formattedTime = today.format(formatter2);
bizContent.setTrxAccTime(formattedTime);
bizContent.setCorpSerno(String.valueOf(System.currentTimeMillis()));//合作方交易单号
bizContent.setCorpDate(formattedDate);//合作方工作日期
bizContent.setOutServiceCode("querybalance");//外部服务代码
bizContent.setMediumId(mediumId);//工行联名卡号
bizContent.setCcy(1);//市种
//bizContent.setSecretKey("h8zujhDntpKRohwFmGXcnXygNjJHRObyUVG3183u0dXI2fRgCXeDED9z0w5d02JucVy7vZ190d7CSUxI2/sVon6dPklVoaquVElgKRUPlr6D/cqLu25K7h]3Pt/u0nx4gF/ykm0/IB2gs0rs/sp0Zw==");
request.setBizContent(bizContent);
SettlementAccountBalanceQueryResponseV1 response = null;
try {
response = client.execute(request, "msgId");
if (response.isSuccess() && response.getReturnCode() == 0) {
//业务成功处理
System.out.println(response.getAccountBalance());//
System.out.println(response.getHoldBalance());//
} else {
// 失败
System.err.println(response.getReturnCode());//
System.err.println(response.getReturnMsg());//
}
} catch (IcbcApiException e) {
throw new RuntimeException(e);
}
return response;
}
}
\ No newline at end of file
......@@ -1048,6 +1048,7 @@ public class LargeScreenImpl {
// 全国场站功率和曲线
@Scheduled(cron = "0/10 * * * * ?")
@PostConstruct
public void getDetailsWindSpeedAlldataqgsh() {
getDetailsWindSpeedAlldataqg();
}
......@@ -1099,16 +1100,28 @@ public class LargeScreenImpl {
activePowerListGF = indicatorDataMapper
.selectDataByequipmentIndexNameAndtimeqgNew(CommonConstans.taiheActivePowerPoint, gfGatewayIds);
}
System.out.println(JSON.toJSONString(activePowerListFD));
for (int i = 0; i < activePowerListFD.size(); i++) {
IndicatorData indicatorData = activePowerListFD.get(i);
IndicatorData indicatorData2 = activePowerListGF.get(i);
time.add(cn.hutool.core.date.DateUtil.format(indicatorData.getCreatedTime(), "HH:mm"));
System.out.println(JSON.toJSONString(activePowerListGF));
for (int i = 0; i < activePowerListGF.size(); i++) {
IndicatorData indicatorData =new IndicatorData();
indicatorData.setValueF(0.0f);
if(activePowerListFD.size()>i)
{
indicatorData = activePowerListFD.get(i);
}else
{
//indicatorData.setValueF((float) (Math.random() * 5));
}
IndicatorData indicatorData2 =new IndicatorData();
indicatorData2.setValueF(0.0f);
if(activePowerListGF.size()>i)
{
indicatorData2 = activePowerListGF.get(i);
}
time.add(cn.hutool.core.date.DateUtil.format(indicatorData2.getCreatedTime(), "HH:mm"));
// Double vl= indicatorData.getValueF()+indicatorData2.getValueF() *
// CommonConstans.kwToMv;
Double vl = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData.getValueF()))
+ Double.valueOf(String.format(CommonConstans.Twodecimalplaces,
indicatorData2.getValueF() * CommonConstans.kwToMv));
+ Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData2.getValueF() * CommonConstans.kwToMv));
values.add(String.format(CommonConstans.Twodecimalplaces, vl));
}
......
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