@@ -26,7 +26,7 @@ public class AflServerFeeRefund extends AbstractInsertTimeEntity { | |||
/*** 商户订单号 */ | |||
private String outTradeNo; | |||
/*** 支付时间 */ | |||
private String payDate; | |||
private Integer payDate; | |||
/*** 商户退款单号 */ | |||
private String outRefundNo; | |||
/*** 微信退款单号 */ | |||
@@ -55,7 +55,7 @@ public class AflServerFeeRefund extends AbstractInsertTimeEntity { | |||
public AflServerFeeRefund() { | |||
} | |||
public AflServerFeeRefund(String refundDate, String transactionId, String outTradeNo, String payDate, | |||
public AflServerFeeRefund(String refundDate, String transactionId, String outTradeNo, Integer payDate, | |||
String outRefundNo, String refundId, String subMchId, Date refundTime, | |||
String plateNum, BigDecimal refundFee, String payeeName, String payeeOpeningBank, | |||
String paymentAccount, String paymentBank, String etcCardNo, String remarks) { | |||
@@ -112,12 +112,12 @@ public class AflServerFeeRefund extends AbstractInsertTimeEntity { | |||
/*** 支付时间 */ | |||
@Column(name = "PAY_DATE") | |||
public String getPayDate() { | |||
public Integer getPayDate() { | |||
return this.payDate; | |||
} | |||
/*** 支付时间 */ | |||
public void setPayDate(String payDate) { | |||
public void setPayDate(Integer payDate) { | |||
this.payDate = payDate; | |||
} | |||
@@ -26,7 +26,7 @@ public class AflApplyInfoFindByIdHandler extends AbstractAfterSalesManager<AflAp | |||
private AflApplyInfoService aflApplyInfoService; | |||
public AflApplyInfoFindByIdHandler() { | |||
super(AfterSalesCmd.SERVERFEEREFUNDPAGE, AflApplyInfoFindByIdRequest.class); | |||
super(AfterSalesCmd.AFLAPPLYINFOFINDBYID, AflApplyInfoFindByIdRequest.class); | |||
} | |||
@Override |
@@ -1,7 +1,6 @@ | |||
package com.qtzl.alterSales.manager.handler; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import com.google.common.collect.Lists; | |||
import com.qtzl.alterSales.dao.entity.second.AflApplyInfo; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.AflApplyInfoRepo; | |||
@@ -9,9 +8,8 @@ import com.qtzl.alterSales.manager.abstracts.AbstractAfterSalesManager; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflApplyInfoPageRequest; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflApplyInfoPageResponse; | |||
import com.qtzl.alterSales.manager.service.AflApplyInfoService; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.qtzl.alterSales.manager.vo.AflApplyInfoVo; | |||
import com.qtzl.alterSales.manager.tools.FileSystemUrlUtil; | |||
import com.txffp.api.core.manager.comm.annotation.ApiHandler; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.data.domain.Page; | |||
@@ -38,8 +36,6 @@ public class AflApplyInfoPageHandler extends AbstractAfterSalesManager<AflApplyI | |||
@Resource | |||
private AflApplyInfoRepo aflApplyInfoRepo; | |||
@Resource | |||
private AflApplyInfoService aflApplyInfoService; | |||
public AflApplyInfoPageHandler() { | |||
@@ -93,10 +89,10 @@ public class AflApplyInfoPageHandler extends AbstractAfterSalesManager<AflApplyI | |||
} | |||
private AflApplyInfo toVo(AflApplyInfo aflApplyInfo) { | |||
aflApplyInfo.setIdentPoimageUrl(aflApplyInfoService.joinEssentialParams(aflApplyInfo.getIdentPoimageUrl())); | |||
aflApplyInfo.setIdentNeimageUrl(aflApplyInfoService.joinEssentialParams(aflApplyInfo.getIdentNeimageUrl())); | |||
aflApplyInfo.setLicensePoimageUrl(aflApplyInfoService.joinEssentialParams(aflApplyInfo.getLicensePoimageUrl())); | |||
aflApplyInfo.setLicenseNeimageUrl(aflApplyInfoService.joinEssentialParams(aflApplyInfo.getLicenseNeimageUrl())); | |||
aflApplyInfo.setIdentPoimageUrl(FileSystemUrlUtil.joinEssentialParams(aflApplyInfo.getIdentPoimageUrl())); | |||
aflApplyInfo.setIdentNeimageUrl(FileSystemUrlUtil.joinEssentialParams(aflApplyInfo.getIdentNeimageUrl())); | |||
aflApplyInfo.setLicensePoimageUrl(FileSystemUrlUtil.joinEssentialParams(aflApplyInfo.getLicensePoimageUrl())); | |||
aflApplyInfo.setLicenseNeimageUrl(FileSystemUrlUtil.joinEssentialParams(aflApplyInfo.getLicenseNeimageUrl())); | |||
return aflApplyInfo; | |||
} | |||
@@ -2,9 +2,7 @@ package com.qtzl.alterSales.manager.handler; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.pub.BeanTools; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import cn.hutool.core.date.DateUtil; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.google.common.collect.Lists; | |||
import com.qtzl.alterSales.dao.entity.second.AflServerFeeRefund; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.AflServerFeeRefundRepo; | |||
@@ -23,9 +21,8 @@ import org.springframework.util.CollectionUtils; | |||
import javax.annotation.Resource; | |||
import javax.persistence.criteria.Predicate; | |||
import java.time.format.DateTimeFormatter; | |||
import java.time.temporal.TemporalAccessor; | |||
import java.util.ArrayList; | |||
import java.util.Date; | |||
import java.util.List; | |||
/*** | |||
@@ -73,11 +70,17 @@ public class AflServerFeeRefundExportHandler extends AbstractAfterSalesManager<A | |||
if (!StringUtils.isEmpty(request.getOutTradeNo())) { | |||
list.add(cb.equal(root.<String>get("outTradeNo"), request.getOutTradeNo())); | |||
} | |||
if (!CollectionUtil.isEmpty(request.getPayDates()) || ObjectUtil.isNotNull(request.getPayDates())) { | |||
list.add(root.<String>get("payDate").in(request.getPayDates())); | |||
if (null != request.getPayDateStart()){ | |||
list.add(cb.greaterThanOrEqualTo(root.<Integer>get("payDate"), request.getPayDateStart())); | |||
} | |||
if (!CollectionUtil.isEmpty(request.getRefundDate()) || ObjectUtil.isNotNull(request.getRefundDate())) { | |||
list.add(root.<String>get("refundDate").in(request.getRefundDate())); | |||
if (null != request.getPayDateEnd()){ | |||
list.add(cb.lessThanOrEqualTo(root.<Integer>get("payDate"), request.getPayDateEnd())); | |||
} | |||
if (null != request.getRefundDateStart()){ | |||
list.add(cb.greaterThanOrEqualTo(root.<Date>get("refundTime"), request.getRefundDateStart())); | |||
} | |||
if (null != request.getRefundDateEnd()){ | |||
list.add(cb.lessThanOrEqualTo(root.<Date>get("refundTime"), request.getRefundDateEnd())); | |||
} | |||
Predicate[] p = new Predicate[list.size()]; | |||
return cb.and(list.toArray(p)); |
@@ -1,7 +1,6 @@ | |||
package com.qtzl.alterSales.manager.handler; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import com.google.common.collect.Lists; | |||
import com.qtzl.alterSales.dao.entity.second.AflServerFeeRefund; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.AflServerFeeRefundRepo; | |||
@@ -20,6 +19,7 @@ import org.springframework.stereotype.Service; | |||
import javax.annotation.Resource; | |||
import javax.persistence.criteria.Predicate; | |||
import java.io.IOException; | |||
import java.util.Date; | |||
import java.util.List; | |||
/*** | |||
@@ -80,11 +80,17 @@ public class AflServerFeeRefundPageHandler extends AbstractAfterSalesManager<Afl | |||
if (!StringUtils.isEmpty(request.getOutTradeNo())) { | |||
list.add(cb.equal(root.<String>get("outTradeNo"), request.getOutTradeNo())); | |||
} | |||
if (!CollectionUtil.isEmpty(request.getPayDates())) { | |||
list.add(root.<String>get("payDate").in(request.getPayDates())); | |||
if (null != request.getPayDateStart()){ | |||
list.add(cb.greaterThanOrEqualTo(root.<Integer>get("payDate"), request.getPayDateStart())); | |||
} | |||
if (!CollectionUtil.isEmpty(request.getRefundDate())) { | |||
list.add(root.<String>get("refundDate").in(request.getRefundDate())); | |||
if (null != request.getPayDateEnd()){ | |||
list.add(cb.lessThanOrEqualTo(root.<Integer>get("payDate"), request.getPayDateEnd())); | |||
} | |||
if (null != request.getRefundDateStart()){ | |||
list.add(cb.greaterThanOrEqualTo(root.<Date>get("refundTime"), request.getRefundDateStart())); | |||
} | |||
if (null != request.getRefundDateEnd()){ | |||
list.add(cb.lessThanOrEqualTo(root.<Date>get("refundTime"), request.getRefundDateEnd())); | |||
} | |||
Predicate[] p = new Predicate[list.size()]; | |||
return cb.and(list.toArray(p)); |
@@ -4,7 +4,7 @@ import com.qtzl.alterSales.manager.model.protocol.AbstractAfterSalesPageRequest; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.txffp.api.core.manager.comm.annotation.Api; | |||
import java.util.List; | |||
import java.util.Date; | |||
/*** | |||
* <p> | |||
@@ -20,9 +20,13 @@ public class AflServerFeeRefundPageRequest extends AbstractAfterSalesPageRequest | |||
private String outTradeNo; | |||
private List<String> payDates; | |||
private Integer payDateStart; | |||
private List<String> refundDate; | |||
private Integer payDateEnd; | |||
private Date refundDateStart; | |||
private Date refundDateEnd; | |||
public String getPlateNum() { | |||
@@ -41,19 +45,35 @@ public class AflServerFeeRefundPageRequest extends AbstractAfterSalesPageRequest | |||
this.outTradeNo = outTradeNo; | |||
} | |||
public List<String> getPayDates() { | |||
return payDates; | |||
public Integer getPayDateStart() { | |||
return payDateStart; | |||
} | |||
public void setPayDateStart(Integer payDateStart) { | |||
this.payDateStart = payDateStart; | |||
} | |||
public Integer getPayDateEnd() { | |||
return payDateEnd; | |||
} | |||
public void setPayDateEnd(Integer payDateEnd) { | |||
this.payDateEnd = payDateEnd; | |||
} | |||
public Date getRefundDateStart() { | |||
return refundDateStart; | |||
} | |||
public void setPayDates(List<String> payDates) { | |||
this.payDates = payDates; | |||
public void setRefundDateStart(Date refundDateStart) { | |||
this.refundDateStart = refundDateStart; | |||
} | |||
public List<String> getRefundDate() { | |||
return refundDate; | |||
public Date getRefundDateEnd() { | |||
return refundDateEnd; | |||
} | |||
public void setRefundDate(List<String> refundDate) { | |||
this.refundDate = refundDate; | |||
public void setRefundDateEnd(Date refundDateEnd) { | |||
this.refundDateEnd = refundDateEnd; | |||
} | |||
} |
@@ -19,11 +19,4 @@ public interface AflApplyInfoService { | |||
* @throws ServiceHandleException 、 | |||
*/ | |||
AflApplyInfo findById(String id) throws ServiceHandleException; | |||
/*** | |||
* 文件服务器图片处理 | |||
* @param fileUrl 、 | |||
* @return 、 | |||
*/ | |||
String joinEssentialParams(String fileUrl); | |||
} |
@@ -4,7 +4,7 @@ import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import com.qtzl.alterSales.dao.entity.second.AflApplyInfo; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.AflApplyInfoRepo; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.utils.MD5FileAccessVerifyUtil; | |||
import com.qtzl.alterSales.manager.tools.FileSystemUrlUtil; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.stereotype.Service; | |||
@@ -32,26 +32,11 @@ public class AflApplyInfoServiceImpl implements AflApplyInfoService { | |||
if (null == applyInfo) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("查询的记录不存在"); | |||
} | |||
applyInfo.setIdentPoimageUrl(joinEssentialParams(applyInfo.getIdentPoimageUrl())); | |||
applyInfo.setIdentNeimageUrl(joinEssentialParams(applyInfo.getIdentNeimageUrl())); | |||
applyInfo.setLicensePoimageUrl(joinEssentialParams(applyInfo.getLicensePoimageUrl())); | |||
applyInfo.setLicenseNeimageUrl(joinEssentialParams(applyInfo.getLicenseNeimageUrl())); | |||
applyInfo.setIdentPoimageUrl(FileSystemUrlUtil.joinEssentialParams(applyInfo.getIdentPoimageUrl())); | |||
applyInfo.setIdentNeimageUrl(FileSystemUrlUtil.joinEssentialParams(applyInfo.getIdentNeimageUrl())); | |||
applyInfo.setLicensePoimageUrl(FileSystemUrlUtil.joinEssentialParams(applyInfo.getLicensePoimageUrl())); | |||
applyInfo.setLicenseNeimageUrl(FileSystemUrlUtil.joinEssentialParams(applyInfo.getLicenseNeimageUrl())); | |||
return applyInfo; | |||
} | |||
@Override | |||
public String joinEssentialParams(String fileUrl) { | |||
if (StringUtils.isEmpty(fileUrl)) { | |||
return fileUrl; | |||
} | |||
String fileUrlStr = fileUrl.replace("http://192.168.101.25:8035", "https://etcfile.etcjz.cn"); | |||
long tp = System.currentTimeMillis(); | |||
String am = "xzxt"; | |||
String key = "15d217c-9c03-12ec-ca76-0242ac110321"; | |||
// 拼接参数 | |||
StringBuilder sb = new StringBuilder(fileUrlStr); | |||
return sb.append("&tp=").append(tp) | |||
.append("&am=").append(am) | |||
.append("&sg=").append(MD5FileAccessVerifyUtil.getHmacMD5(tp + MD5FileAccessVerifyUtil.getFileIdFromUrl(fileUrlStr), key)).toString(); | |||
} | |||
} |
@@ -51,7 +51,7 @@ public class AflServerFeeRefundServiceImpl implements AflServerFeeRefundService | |||
final String payDate = outTradeNo.startsWith("AFLBYD") ? outTradeNo.substring(6, 14) : | |||
outTradeNo.startsWith("520101") ? outTradeNo.substring(13, 21) : outTradeNo.substring(5, 13); | |||
try { | |||
aflServerFeeRefundRepo.save(new AflServerFeeRefund(changeTime.substring(0, 10), tradeDetailArray[5], outTradeNo, payDate, tradeDetailArray[15], refundId, | |||
aflServerFeeRefundRepo.save(new AflServerFeeRefund(changeTime.substring(0, 10), tradeDetailArray[5], outTradeNo, Integer.valueOf(payDate), tradeDetailArray[15], refundId, | |||
tradeDetailArray[3], format.parse(changeTime), applyLog.getPlateNumber(), new BigDecimal(tradeDetailArray[16]), | |||
"财付通支付科技有限公司", "--", "--", "--", "--", applyLog.getPlateNumber() + "申请原路退回")); | |||
} catch (Exception e) { |
@@ -3,7 +3,9 @@ package com.qtzl.alterSales.manager.service.third; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import com.alibaba.druid.util.StringUtils; | |||
import com.alibaba.fastjson.JSON; | |||
import com.alibaba.fastjson2.JSONObject; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.tools.FileSystemUrlUtil; | |||
import com.qtzl.alterSales.manager.utils.HttpRequest; | |||
import com.qtzl.alterSales.manager.utils.UrlUtil; | |||
import com.qtzl.alterSales.manager.vo.FileBeanVo; | |||
@@ -68,7 +70,6 @@ public abstract class FmsAbstract { | |||
resp = HttpRequest.httpPostFile(url, filePath, timeout, paramMap); | |||
System.out.println(JSON.toJSONString(resp)); | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("请求文件服务接口异常"); | |||
@@ -76,26 +77,19 @@ public abstract class FmsAbstract { | |||
if (StringUtils.isEmpty(resp)) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("文件服务服务未返回数据"); | |||
} | |||
FileBeanVo fileBeanVo = null; | |||
try { | |||
fileBeanVo = JSON.toJavaObject(JSON.parseObject(resp), FileBeanVo.class); | |||
} catch (Exception e) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析文件服务服务返回数据出现异常"); | |||
} | |||
if (!fileBeanVo.getSuccess()){ | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException(fileBeanVo.getRmsg()); | |||
} | |||
FilePathBeanVo filePathBeanVo = null; | |||
if (!StringUtils.isEmpty(fileBeanVo.getData())) { | |||
try { | |||
filePathBeanVo = JSON.toJavaObject(JSON.parseObject(fileBeanVo.getData()), FilePathBeanVo.class); | |||
return resp; | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析文件服务服务返回数据出现异常"); | |||
FileBeanVo fileBeanVo = JSON.toJavaObject(JSON.parseObject(resp), FileBeanVo.class); | |||
if (!fileBeanVo.getSuccess()){ | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException(fileBeanVo.getRmsg()); | |||
} | |||
fileBeanVo.getData().setFileUrl(FileSystemUrlUtil.joinEssentialParams(fileBeanVo.getData().getFileUrl())); | |||
return JSON.toJSONString(fileBeanVo); | |||
}catch (ServiceHandleException e){ | |||
throw e; | |||
}catch (Exception e) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("解析文件服务服务返回数据出现异常"); | |||
} | |||
return resp; | |||
} | |||
@@ -0,0 +1,31 @@ | |||
package com.qtzl.alterSales.manager.tools; | |||
import com.qtzl.alterSales.manager.utils.MD5FileAccessVerifyUtil; | |||
import org.apache.commons.lang3.StringUtils; | |||
/*** | |||
* <p> | |||
* QT 文件服务器URL处理 | |||
* </p> | |||
* @author hou yi | |||
* {@code @date} 2024/12/3 18:29 | |||
**/ | |||
public class FileSystemUrlUtil { | |||
public static String joinEssentialParams(String fileUrl) { | |||
// 文件服务器URL处理 | |||
if (StringUtils.isEmpty(fileUrl)) { | |||
return fileUrl; | |||
} | |||
String fileUrlStr = fileUrl.replace("http://192.168.101.25:8035", "https://etcfile.etcjz.cn"); | |||
long tp = System.currentTimeMillis(); | |||
String am = "xzxt"; | |||
String key = "15d217c-9c03-12ec-ca76-0242ac110321"; | |||
// 拼接参数 | |||
StringBuilder sb = new StringBuilder(fileUrlStr); | |||
return sb.append("&tp=").append(tp) | |||
.append("&am=").append(am) | |||
.append("&sg=").append(MD5FileAccessVerifyUtil.getHmacMD5(tp + MD5FileAccessVerifyUtil.getFileIdFromUrl(fileUrlStr), key)).toString(); | |||
} | |||
} |
@@ -17,7 +17,7 @@ public class AflServerFeeRefundExportVo { | |||
private String outTradeNo; | |||
/*** 支付时间 */ | |||
@ExcelExport(value = "充值时间", sort = 7) | |||
private String payDate; | |||
private Integer payDate; | |||
@ExcelExport(value = "收款方账号", sort = 2) | |||
private String subMchId; | |||
/*** 退款时间 */ | |||
@@ -75,11 +75,11 @@ public class AflServerFeeRefundExportVo { | |||
this.outTradeNo = outTradeNo; | |||
} | |||
public String getPayDate() { | |||
public Integer getPayDate() { | |||
return payDate; | |||
} | |||
public void setPayDate(String payDate) { | |||
public void setPayDate(Integer payDate) { | |||
this.payDate = payDate; | |||
} | |||
@@ -2,7 +2,7 @@ package com.qtzl.alterSales.manager.vo; | |||
public class FileBeanVo { | |||
private String rc; | |||
private String data; | |||
private FilePathBeanVo data; | |||
private Boolean success; | |||
private String rmsg; | |||
@@ -14,11 +14,11 @@ public class FileBeanVo { | |||
this.rc = rc; | |||
} | |||
public String getData() { | |||
public FilePathBeanVo getData() { | |||
return data; | |||
} | |||
public void setData(String data) { | |||
public void setData(FilePathBeanVo data) { | |||
this.data = data; | |||
} | |||
@@ -1,6 +1,6 @@ | |||
spring: | |||
profiles: | |||
active: dev | |||
active: prod | |||
# Redis数据源 | |||
# redis: | |||
# # Redis数据库索引(默认为0) |
@@ -226,7 +226,7 @@ public class SaleTest { | |||
ArrayList<String> strings1 = new ArrayList<>(); | |||
strings1.add("2024-11-25"); | |||
strings1.add("2024-11-26"); | |||
aflServerFeeRefundPageRequest.setRefundDate(strings1); | |||
// aflServerFeeRefundPageRequest.setRefundDate(strings1); | |||
String export = serverFeeRefundExportHandler.export(aflServerFeeRefundPageRequest); | |||
System.out.println("=====" + export); | |||
} |