修改
This commit is contained in:
@ -2,7 +2,7 @@ package com.xjrsoft.module.externalApi.client;
|
||||
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.module.externalApi.callback.FsspCallback;
|
||||
import com.xjrsoft.module.externalApi.callback.ApiCallback;
|
||||
import com.xjrsoft.module.externalApi.response.BaseResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.*;
|
||||
@ -22,7 +22,7 @@ public class FsspHttpClient {
|
||||
public static <Req, Resp extends BaseResponse> void post(Req req,
|
||||
String url,
|
||||
Class<Resp> clz,
|
||||
FsspCallback<Resp> callback) {
|
||||
ApiCallback<Resp> callback) {
|
||||
post(req, url, clz, null, callback);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public class FsspHttpClient {
|
||||
String url,
|
||||
Class<Resp> clz,
|
||||
Map<String, String> headerMap,
|
||||
FsspCallback<Resp> callback) {
|
||||
ApiCallback<Resp> callback) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
if (headerMap != null) {
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.xjrsoft.module.externalApi.client;
|
||||
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.module.externalApi.callback.ApiCallback;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PipeHttpClient {
|
||||
|
||||
private static RestTemplate rest = new RestTemplate();
|
||||
|
||||
public static <Resp> Resp get(String url,
|
||||
Map<String, String> param,
|
||||
Class<Resp> clz,
|
||||
ApiCallback<Resp> callback) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(url);
|
||||
for (String key : param.keySet()) {
|
||||
builder.append("&");
|
||||
builder.append(key);
|
||||
builder.append("=");
|
||||
builder.append(param.get(key));
|
||||
}
|
||||
url = url.replaceFirst("&", "?");
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
HttpEntity<String> entity = new HttpEntity<>(headers);
|
||||
ResponseEntity<Resp> response = rest.exchange(
|
||||
url,
|
||||
HttpMethod.GET,
|
||||
entity,
|
||||
clz
|
||||
);
|
||||
if (response.getStatusCode() == HttpStatus.OK) {
|
||||
callback.execute(response.getBody());;
|
||||
} else {
|
||||
throw new BusinessException(BusinessCode.of(10902,"请求失败,HTTP状态码: " + response.getStatusCode()));
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] downloadFile(String url, Map<String, String> param) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(url);
|
||||
for (String key : param.keySet()) {
|
||||
builder.append("&");
|
||||
builder.append(key);
|
||||
builder.append("=");
|
||||
builder.append(param.get(key));
|
||||
}
|
||||
url = url.replaceFirst("&", "?");
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
HttpEntity<String> entity = new HttpEntity<>(headers);
|
||||
ResponseEntity<byte[]> response = rest.exchange(
|
||||
url,
|
||||
HttpMethod.GET,
|
||||
entity,
|
||||
byte[].class
|
||||
);
|
||||
if (response.getStatusCode() == HttpStatus.OK) {
|
||||
return response.getBody();
|
||||
} else {
|
||||
throw new BusinessException(BusinessCode.of(10902,"请求失败,HTTP状态码: " + response.getStatusCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -15,7 +15,7 @@ public class FsspConfig {
|
||||
|
||||
private String appId;
|
||||
|
||||
private String appSecuret;
|
||||
private String appSecret;
|
||||
|
||||
private String tenantid;
|
||||
|
||||
@ -23,6 +23,8 @@ public class FsspConfig {
|
||||
|
||||
private String language;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
private String loginUrl;
|
||||
|
||||
private String user;
|
||||
@ -31,14 +33,9 @@ public class FsspConfig {
|
||||
|
||||
private String yhjymxUrl;
|
||||
|
||||
private String orgNumber;
|
||||
|
||||
private String accountbank;
|
||||
|
||||
private String dzhdxxUrl;
|
||||
|
||||
private String dzhdfjUrl;
|
||||
|
||||
private String pzUrl;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
package com.xjrsoft.module.externalApi.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Data
|
||||
@Component
|
||||
@RefreshScope
|
||||
@ConfigurationProperties("xjrsoft.pipe")
|
||||
public class PipeConfig {
|
||||
|
||||
private String baseUrl;
|
||||
|
||||
private String yhjlUrl;
|
||||
|
||||
private String qyjlUrl;
|
||||
|
||||
private String yhjljjpzUrl;
|
||||
|
||||
private String gcqUrl;
|
||||
|
||||
private String qzzfUrl;
|
||||
|
||||
public String getFullYhjlUrl() {
|
||||
return baseUrl + yhjlUrl;
|
||||
}
|
||||
|
||||
public String getFullQyjlUrl() {
|
||||
return baseUrl + qyjlUrl;
|
||||
}
|
||||
|
||||
public String getFullYhjljjpzUrl() {
|
||||
return baseUrl + yhjljjpzUrl;
|
||||
}
|
||||
|
||||
public String getFullGcqUrl() {
|
||||
return baseUrl + gcqUrl;
|
||||
}
|
||||
|
||||
public String getFullQzzfUrl() {
|
||||
return baseUrl + qzzfUrl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
package com.xjrsoft.module.externalApi.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 接口主数据-银行账号(用于共享收付款)
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_b_jk_bankaccount")
|
||||
@ApiModel(value = "接口主数据-银行账号(用于共享收付款)对象", description = "接口主数据-银行账号(用于共享收付款)")
|
||||
public class LngBJkBankaccount implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 交易明细id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 组织机构id(xjr_department.id)
|
||||
*/
|
||||
@ApiModelProperty("组织机构id(xjr_department.id)")
|
||||
private Long comId;
|
||||
|
||||
/**
|
||||
* 资金组织编码(公司三字码)
|
||||
*/
|
||||
@ApiModelProperty("资金组织编码(公司三字码)")
|
||||
private String orgNumber;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
@ApiModelProperty("银行账号")
|
||||
private String accountbankNumber;
|
||||
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
@ApiModelProperty("开户行")
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty("币种")
|
||||
private String currencyName;
|
||||
|
||||
/**
|
||||
* 账户类型
|
||||
*/
|
||||
@ApiModelProperty("账户类型")
|
||||
private String accountTypeName;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long ruleUserId;
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class LngJkRp implements Serializable {
|
||||
private String billno;
|
||||
|
||||
/**
|
||||
* 资金组织编码, 公司三字码
|
||||
* 资金组织编码(公司三字码)
|
||||
*/
|
||||
@ApiModelProperty("资金组织编码(公司三字码)")
|
||||
private String orgNumber;
|
||||
@ -100,7 +100,7 @@ public class LngJkRp implements Serializable {
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 业务类型, 1:普通 2:上划 3:下拨
|
||||
* 业务类型(1:普通,2:上划,3:下拨)
|
||||
*/
|
||||
@ApiModelProperty("业务类型(1:普通,2:上划,3:下拨)")
|
||||
private String biztype;
|
||||
|
||||
@ -27,7 +27,7 @@ public class LngJkRpBill {
|
||||
*/
|
||||
@ApiModelProperty("电子回单id")
|
||||
@TableId
|
||||
private String id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
|
||||
@ -12,10 +12,12 @@ import com.xjrsoft.module.externalApi.client.FsspHttpClient;
|
||||
import com.xjrsoft.module.externalApi.config.FsspConfig;
|
||||
import com.xjrsoft.module.externalApi.dto.LngJkRpBillDto;
|
||||
import com.xjrsoft.module.externalApi.dto.LngJkRpDto;
|
||||
import com.xjrsoft.module.externalApi.entity.LngBJkBankaccount;
|
||||
import com.xjrsoft.module.externalApi.entity.LngJkRp;
|
||||
import com.xjrsoft.module.externalApi.entity.LngJkRpBill;
|
||||
import com.xjrsoft.module.externalApi.request.*;
|
||||
import com.xjrsoft.module.externalApi.response.*;
|
||||
import com.xjrsoft.module.externalApi.service.LngBJkBankaccountService;
|
||||
import com.xjrsoft.module.externalApi.service.LngJkRpBillService;
|
||||
import com.xjrsoft.module.externalApi.service.LngJkRpService;
|
||||
import com.xjrsoft.module.system.client.IFileClient;
|
||||
@ -30,6 +32,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@ -39,6 +42,8 @@ public class FsspJobHandler {
|
||||
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
private LngBJkBankaccountService lngBJkBankaccountService;
|
||||
|
||||
private LngJkRpService lngJkRpService;
|
||||
|
||||
private LngJkRpBillService lngJkRpBillService;
|
||||
@ -53,11 +58,13 @@ public class FsspJobHandler {
|
||||
|
||||
public FsspJobHandler(FsspConfig config,
|
||||
RedisUtil redisUtil,
|
||||
LngBJkBankaccountService lngBJkBankaccountService,
|
||||
LngJkRpService lngJkRpService,
|
||||
LngJkRpBillService lngJkRpBillService,
|
||||
IFileClient iFileClient) {
|
||||
this.config = config;
|
||||
this.redisUtil = redisUtil;
|
||||
this.lngBJkBankaccountService = lngBJkBankaccountService;
|
||||
this.lngJkRpService = lngJkRpService;
|
||||
this.lngJkRpBillService = lngJkRpBillService;
|
||||
this.iFileClient = iFileClient;
|
||||
@ -66,7 +73,7 @@ public class FsspJobHandler {
|
||||
private String getAppToken() {
|
||||
AppTokenReq appTokenReq = new AppTokenReq();
|
||||
appTokenReq.setAppId(config.getAppId());
|
||||
appTokenReq.setAppSecuret(config.getAppSecuret());
|
||||
appTokenReq.setAppSecuret(config.getAppSecret());
|
||||
appTokenReq.setTenantid(config.getTenantid());
|
||||
appTokenReq.setAccountId(config.getAccountId());
|
||||
appTokenReq.setLanguage(config.getLanguage());
|
||||
@ -106,17 +113,34 @@ public class FsspJobHandler {
|
||||
}
|
||||
|
||||
@XxlJob("yhjymxJobHandler")
|
||||
public void yhjymxJobHandler(Integer pageNo) {
|
||||
public void yhjymxJobHandler() {
|
||||
log.info("定时任务---银行交易明细查询---开始");
|
||||
FsspYhjymxReq fsspYhjymxReq = new FsspYhjymxReq();
|
||||
fsspYhjymxReq.setOrgNumber(config.getOrgNumber());
|
||||
fsspYhjymxReq.setAccountbank(config.getAccountbank());
|
||||
fsspYhjymxReq.setBankcheckflag(null);
|
||||
// 开始时间必须小于等于结束时间,且开始时间和结束时间不可相差60天以上
|
||||
fsspYhjymxReq.setBeginDate(LocalDateTime.now());
|
||||
fsspYhjymxReq.setEndDate(LocalDateTime.now());
|
||||
fsspYhjymxReq.setPageSize(100);
|
||||
fsspYhjymxReq.setPageNo(pageNo == null ? 1 : pageNo);
|
||||
LocalDateTime endDate = LocalDateTime.now();
|
||||
LocalDateTime beginDate = endDate.minusDays(2);
|
||||
Integer pageSize = config.getPageSize() == null ? 100 : config.getPageSize();
|
||||
FsspYhjymxReq fsspYhjymxReq;
|
||||
Map<String, List<LngBJkBankaccount>> orgAccountMap = this.queryOrgAccountMap();
|
||||
for (String orgNumber : orgAccountMap.keySet()) {
|
||||
List<LngBJkBankaccount> list = orgAccountMap.get(orgNumber);
|
||||
for (LngBJkBankaccount lngBJkBankaccount : list) {
|
||||
fsspYhjymxReq = new FsspYhjymxReq();
|
||||
fsspYhjymxReq.setOrgNumber(orgNumber);
|
||||
fsspYhjymxReq.setAccountbank(lngBJkBankaccount.getAccountbankNumber());
|
||||
// 非必填项
|
||||
// fsspYhjymxReq.setBankcheckflag(null);
|
||||
fsspYhjymxReq.setBeginDate(beginDate);
|
||||
fsspYhjymxReq.setEndDate(endDate);
|
||||
fsspYhjymxReq.setPageSize(pageSize);
|
||||
this.queryYhjymx(fsspYhjymxReq);
|
||||
}
|
||||
}
|
||||
log.info("定时任务---电子回单信息查询---结束");
|
||||
}
|
||||
|
||||
private void queryYhjymx(FsspYhjymxReq fsspYhjymxReq) {
|
||||
Integer pageNo = fsspYhjymxReq.getPageNo() == null ? 1 : fsspYhjymxReq.getPageNo();
|
||||
fsspYhjymxReq.setPageNo(pageNo);
|
||||
List<LngJkRpDto> dtoList = Lists.newArrayList();
|
||||
Map<String, String> headers = Maps.newHashMap();
|
||||
String accesstoken = redisUtil.get(FSSP_ACCESS_TOKEN);
|
||||
@ -134,25 +158,52 @@ public class FsspJobHandler {
|
||||
List<LngJkRp> list = BeanUtil.copyToList(dtoList, LngJkRp.class);
|
||||
lngJkRpService.saveOrUpdateBatch(list);
|
||||
if (!data.getLastPage()) {
|
||||
yhjymxJobHandler(fsspYhjymxReq.getPageNo() + 1);
|
||||
fsspYhjymxReq.setPageNo(pageNo + 1);
|
||||
queryYhjymx(fsspYhjymxReq);
|
||||
}
|
||||
}
|
||||
});
|
||||
log.info("定时任务---电子回单信息查询---结束");
|
||||
}
|
||||
|
||||
private Map<String, List<LngBJkBankaccount>> queryOrgAccountMap() {
|
||||
List<LngBJkBankaccount> list = lngBJkBankaccountService.list();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
throw new BusinessException(BusinessCode.of(10903,"银行账户信息为空"));
|
||||
}
|
||||
Map<String, List<LngBJkBankaccount>> map = list.stream().collect(
|
||||
Collectors.groupingBy(LngBJkBankaccount::getOrgNumber));
|
||||
return map;
|
||||
}
|
||||
|
||||
@XxlJob("dzhdxxJobHandler")
|
||||
public void dzhdxxJobHandler(Integer pageNo) {
|
||||
public void dzhdxxJobHandler() {
|
||||
log.info("定时任务---电子回单信息查询---开始");
|
||||
FsspDzhdxxReq fsspDzhdxxReq = new FsspDzhdxxReq();
|
||||
fsspDzhdxxReq.setOrgNumber(config.getOrgNumber());
|
||||
fsspDzhdxxReq.setAccountbank(config.getAccountbank());
|
||||
fsspDzhdxxReq.setReceiptno(null);
|
||||
// 开始时间必须小于等于结束时间,且开始时间和结束时间不可相差60天以上
|
||||
fsspDzhdxxReq.setBeginDate(LocalDateTime.now());
|
||||
fsspDzhdxxReq.setEndDate(LocalDateTime.now());
|
||||
fsspDzhdxxReq.setPageSize(100);
|
||||
fsspDzhdxxReq.setPageNo(pageNo == null ? 1 : pageNo);
|
||||
LocalDateTime endDate = LocalDateTime.now();
|
||||
LocalDateTime beginDate = endDate.minusDays(2);
|
||||
Integer pageSize = config.getPageSize() == null ? 100 : config.getPageSize();
|
||||
FsspDzhdxxReq fsspDzhdxxReq;
|
||||
Map<String, List<LngBJkBankaccount>> orgAccountMap = this.queryOrgAccountMap();
|
||||
for (String orgNumber : orgAccountMap.keySet()) {
|
||||
List<LngBJkBankaccount> list = orgAccountMap.get(orgNumber);
|
||||
for (LngBJkBankaccount lngBJkBankaccount : list) {
|
||||
fsspDzhdxxReq = new FsspDzhdxxReq();
|
||||
fsspDzhdxxReq.setOrgNumber(orgNumber);
|
||||
fsspDzhdxxReq.setAccountbank(lngBJkBankaccount.getAccountbankNumber());
|
||||
// 非必填项
|
||||
// fsspDzhdxxReq.setReceiptno(null);
|
||||
fsspDzhdxxReq.setBeginDate(beginDate);
|
||||
fsspDzhdxxReq.setEndDate(endDate);
|
||||
fsspDzhdxxReq.setPageSize(pageSize);
|
||||
this.queryDzhdxx(fsspDzhdxxReq);
|
||||
}
|
||||
}
|
||||
log.info("定时任务---电子回单信息查询---结束");
|
||||
}
|
||||
|
||||
private void queryDzhdxx(FsspDzhdxxReq fsspDzhdxxReq) {
|
||||
Integer pageNo = fsspDzhdxxReq.getPageNo() == null ? 1 : fsspDzhdxxReq.getPageNo();
|
||||
fsspDzhdxxReq.setPageNo(pageNo);
|
||||
List<LngJkRpBillDto> dtoList = Lists.newArrayList();
|
||||
Map<String, String> headers = Maps.newHashMap();
|
||||
String accesstoken = redisUtil.get(FSSP_ACCESS_TOKEN);
|
||||
@ -171,11 +222,11 @@ public class FsspJobHandler {
|
||||
List<LngJkRpBill> list = BeanUtil.copyToList(dtoList, LngJkRpBill.class);
|
||||
lngJkRpBillService.saveOrUpdateBatch(list);
|
||||
if (!data.getLastPage()) {
|
||||
dzhdxxJobHandler(fsspDzhdxxReq.getPageNo() + 1);
|
||||
fsspDzhdxxReq.setPageNo(pageNo + 1);
|
||||
queryDzhdxx(fsspDzhdxxReq);
|
||||
}
|
||||
}
|
||||
});
|
||||
log.info("定时任务---电子回单信息查询---结束");
|
||||
}
|
||||
|
||||
@XxlJob("dzhdfjJobHandler")
|
||||
@ -188,7 +239,8 @@ public class FsspJobHandler {
|
||||
.in(LngJkRpBill::getStatusProc, statusList));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list.forEach(x -> {
|
||||
downloadFile(x);
|
||||
this.downloadFile(x);
|
||||
lngJkRpBillService.updateById(x);
|
||||
});
|
||||
}
|
||||
log.info("定时任务---批量下载电子回单附件---结束");
|
||||
@ -199,11 +251,12 @@ public class FsspJobHandler {
|
||||
if (StringUtils.isBlank(accesstoken)) {
|
||||
accesstoken = this.getAccessToken();
|
||||
}
|
||||
byte[] fileByte = FsspHttpClient.downloadFile(lngJkRpBill.getFilepath(), accesstoken, config.getDzhdfjUrl());
|
||||
FileUploadDto uploadDto = new FileUploadDto();
|
||||
uploadDto.setBuffer(fileByte);
|
||||
uploadDto.setTableName("lng_jk_rp_bill");
|
||||
try {
|
||||
byte[] fileByte = FsspHttpClient.downloadFile(lngJkRpBill.getFilepath(), accesstoken, config.getDzhdfjUrl());
|
||||
FileUploadDto uploadDto = new FileUploadDto();
|
||||
uploadDto.setTableId(lngJkRpBill.getId());
|
||||
uploadDto.setTableName("lng_jk_rp_bill");
|
||||
uploadDto.setBuffer(fileByte);
|
||||
LngFileUploadVo vo = iFileClient.upload(uploadDto);
|
||||
lngJkRpBill.setFilepathAttr(vo.getFilePath());
|
||||
lngJkRpBill.setStatusProcAttr("S");
|
||||
@ -218,11 +271,13 @@ public class FsspJobHandler {
|
||||
@XxlJob("pzJobHandler")
|
||||
public void pzJobHandler(Integer pageNo) {
|
||||
FsspPzReq fsspPzReq = new FsspPzReq();
|
||||
fsspPzReq.setOrgNumber(config.getOrgNumber());
|
||||
fsspPzReq.setOrgNumber(null);
|
||||
fsspPzReq.setBillno(null);
|
||||
// 开始时间必须小于等于结束时间,且开始时间和结束时间不可相差60天以上
|
||||
fsspPzReq.setBeginDate(LocalDateTime.now());
|
||||
fsspPzReq.setEndDate(LocalDateTime.now());
|
||||
LocalDateTime endDate = LocalDateTime.now();
|
||||
LocalDateTime beginDate = endDate.minusDays(2);
|
||||
fsspPzReq.setBeginDate(beginDate);
|
||||
fsspPzReq.setEndDate(endDate);
|
||||
fsspPzReq.setSourcebill(null);
|
||||
fsspPzReq.setPageSize(100);
|
||||
fsspPzReq.setPageNo(pageNo == null ? 1 : pageNo);
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
package com.xjrsoft.module.externalApi.handler;
|
||||
|
||||
import com.google.api.client.util.Maps;
|
||||
import com.xjrsoft.module.externalApi.client.PipeHttpClient;
|
||||
import com.xjrsoft.module.externalApi.config.PipeConfig;
|
||||
import com.xjrsoft.module.externalApi.response.GcqResponse;
|
||||
import com.xjrsoft.module.externalApi.response.QyjlResponse;
|
||||
import com.xjrsoft.module.externalApi.response.YhjlResponse;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PipeJobHandler {
|
||||
|
||||
private PipeConfig config;
|
||||
|
||||
public PipeJobHandler(PipeConfig config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@XxlJob("yhjlJobHandler")
|
||||
public void yhjlJobHandler() {
|
||||
log.info("定时任务---用户计量接口---开始");
|
||||
Map<String, String> param = Maps.newHashMap();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
param.put("prodDate", LocalDateTime.now().format(formatter));
|
||||
param.put("clientCode", null);
|
||||
PipeHttpClient.get(config.getFullYhjlUrl(), param, List.class, resp -> {
|
||||
List<YhjlResponse> list = resp;
|
||||
for (YhjlResponse yhjlResponse : list) {
|
||||
|
||||
}
|
||||
});
|
||||
log.info("定时任务---用户计量接口---结束");
|
||||
}
|
||||
|
||||
@XxlJob("qyjlJobHandler")
|
||||
public void qyjlJobHandler() {
|
||||
log.info("定时任务---气源计量接口---开始");
|
||||
Map<String, String> param = Maps.newHashMap();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
param.put("prodDate", LocalDateTime.now().format(formatter));
|
||||
param.put("sourceCode", null);
|
||||
PipeHttpClient.get(config.getFullQyjlUrl(), param, List.class, resp -> {
|
||||
List<QyjlResponse> list = resp;
|
||||
for (QyjlResponse qyjlResponse : list) {
|
||||
|
||||
}
|
||||
});
|
||||
log.info("定时任务---气源计量接口---结束");
|
||||
}
|
||||
|
||||
@XxlJob("yhjljjpzJobHandler")
|
||||
public void yhjljjpzJobHandler() {
|
||||
log.info("定时任务---用户计量交接凭证---开始");
|
||||
Map<String, String> param = Maps.newHashMap();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
param.put("prodDate", LocalDateTime.now().format(formatter));
|
||||
param.put("clientCode", null);
|
||||
byte[] fileByte = PipeHttpClient.downloadFile(config.getFullYhjljjpzUrl(), param);
|
||||
log.info("定时任务---用户计量交接凭证---结束");
|
||||
}
|
||||
|
||||
@XxlJob("gcqJobHandler")
|
||||
public void gcqJobHandler() {
|
||||
log.info("定时任务---管存气接口---开始");
|
||||
Map<String, String> param = Maps.newHashMap();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
param.put("prodDate", LocalDateTime.now().format(formatter));
|
||||
param.put("gcqJobHandler", null);
|
||||
PipeHttpClient.get(config.getFullGcqUrl(), param, GcqResponse.class, resp -> {
|
||||
GcqResponse gcqResponse = resp;
|
||||
});
|
||||
log.info("定时任务---管存气接口---结束");
|
||||
}
|
||||
|
||||
@XxlJob("qzzfJobHandler")
|
||||
public void qzzfJobHandler() {
|
||||
log.info("定时任务---气质组分---开始");
|
||||
Map<String, String> param = Maps.newHashMap();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
param.put("prodDate", LocalDateTime.now().format(formatter));
|
||||
param.put("qzzfJobHandler", null);
|
||||
byte[] fileByte = PipeHttpClient.downloadFile(config.getFullQzzfUrl(), param);
|
||||
log.info("定时任务---气质组分---结束");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xjrsoft.module.externalApi.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.externalApi.entity.LngBJkBankaccount;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngBJkBankaccountMapper extends MPJBaseMapper<LngBJkBankaccount>, BaseMapper<LngBJkBankaccount> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xjrsoft.module.externalApi.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJDeepService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJRelationService;
|
||||
import com.xjrsoft.module.externalApi.entity.LngBJkBankaccount;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-24
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface LngBJkBankaccountService extends MPJBaseService<LngBJkBankaccount>, MPJDeepService<LngBJkBankaccount>, MPJRelationService<LngBJkBankaccount> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.xjrsoft.module.externalApi.service.impl;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.xjrsoft.module.externalApi.entity.LngBJkBankaccount;
|
||||
import com.xjrsoft.module.externalApi.mapper.LngBJkBankaccountMapper;
|
||||
import com.xjrsoft.module.externalApi.service.LngBJkBankaccountService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class LngBJkBankaccountServiceImpl extends MPJBaseServiceImpl<LngBJkBankaccountMapper, LngBJkBankaccount> implements LngBJkBankaccountService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user