@@ -98,6 +98,8 @@ public enum OperateType { | |||
ORDER_UPUSER("发行订单用户信息上传"), | |||
ORDER_UPVEHICLE("发行订单车辆信息上传"), | |||
OPERATE_PAYAPPLY("支付申请"), | |||
ORDER_SIGNAPPLY("签约参数获取"), | |||
ORDER_CHECK("签约检测"), | |||
ORDER_RECEIVE("发行订单领取"), | |||
ORDER_EXAMINE("发行订单审核"), | |||
ORDER_DELIVER("发行订单发货"), |
@@ -9,6 +9,7 @@ public enum AliServiceCmd implements SignServiceCommand { | |||
ORDERAPPLY("支付宝支付订单申请","orderApply", AtsAliOrderApplyRequest.class), | |||
QUERYORDERAPPLY("查询支付宝支付订单申请结果","queryOrderApply", AtsAliQueryOrderApplyRequest.class), | |||
ORDERREFUND("支付宝支付订单退费","orderRefund", AtsAliOrderRefundRequest.class), | |||
QUERYORDERREFUND("支付宝支付订单退费","queryOrderRefund", AtsAliQueryOrderRefundRequest.class), | |||
; | |||
@@ -14,16 +14,24 @@ import lombok.Setter; | |||
@Setter | |||
public class AtsAliOrderApplyResponse extends AbstractAtsResponse { | |||
//商户订单号 | |||
/** | |||
*商户订单号 | |||
* */ | |||
private String outTradeNo; | |||
//支付宝交易号 | |||
private String tradeNo; | |||
// Native参数,支付二维码内容(需转换成二维码展示) | |||
/** | |||
* Native,支付二维码内容(需转换成二维码展示) | |||
* */ | |||
private String qrCode; | |||
//手机网站支付接口2.0 响应表单 | |||
private String form; | |||
/** | |||
* APP获取的 签名字符串 | |||
* */ | |||
private String orderStr; | |||
/** | |||
* H5返回的 跳转页面数据 | |||
* */ | |||
private String pageRedirectionData; | |||
} |
@@ -14,14 +14,15 @@ import lombok.Setter; | |||
@Setter | |||
public class AtsAliOrderRefundResponse extends AbstractAtsResponse { | |||
//商户订单号 | |||
/** | |||
*商户订单号 | |||
* */ | |||
private String outTradeNo; | |||
//交易状态,WAIT_BUYER_PAY(交易创建,等待买家付款)、TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、TRADE_SUCCESS(交易支付成功)、TRADE_FINISHED(交易结束,不可退款) | |||
private String tradeStatus; | |||
//交易的订单金额,单位为元,两位小数 | |||
private String totalAmount; | |||
/** | |||
*交易的订单金额,单位为元,两位小数 | |||
* */ | |||
private String refundFee; | |||
} |
@@ -14,14 +14,21 @@ import lombok.Setter; | |||
@Setter | |||
public class AtsAliQueryOrderApplyResponse extends AbstractAtsResponse { | |||
//商户订单号 | |||
/** | |||
* 商户订单号 | |||
* */ | |||
private String outTradeNo; | |||
//交易状态,WAIT_BUYER_PAY(交易创建,等待买家付款)、TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、TRADE_SUCCESS(交易支付成功)、TRADE_FINISHED(交易结束,不可退款) | |||
/** | |||
*交易状态,WAIT_BUYER_PAY(交易创建,等待买家付款)、TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、TRADE_SUCCESS(交易支付成功)、TRADE_FINISHED(交易结束,不可退款) | |||
* */ | |||
private String tradeStatus; | |||
//交易的订单金额,单位为元,两位小数 | |||
/** | |||
*交易的订单金额,单位为元,两位小数 | |||
* */ | |||
private String totalAmount; | |||
} |
@@ -0,0 +1,46 @@ | |||
package cn.com.taiji.core.model.comm.protocol.ats.ali; | |||
import cn.com.taiji.core.model.comm.protocol.ats.AbstractAtsRequest; | |||
import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/10 14:17 | |||
* @Filename:AtsCreatPayOrder | |||
* @description: | |||
*/ | |||
@Getter | |||
@Setter | |||
public class AtsAliQueryOrderRefundRequest extends AbstractAtsRequest<AtsAliQueryOrderRefundResponse> { | |||
@NotBlank | |||
private String privateKey;// 你的商户私钥 | |||
@NotBlank | |||
private String publicKey;//商户公钥 | |||
@NotBlank | |||
private String appid;//应用ID spAppid;服务商应用ID | |||
@NotBlank | |||
private String outTradeNo;//商户订单号 | |||
@NotBlank | |||
private String outRequestNo;//退款请求号。 请求退款接口时,传入的退款请求号,如果在退款请求时未传入,则该值为创建交易时的商户订单号。 | |||
public AtsAliQueryOrderRefundRequest() { | |||
super(AliServiceCmd.QUERYORDERAPPLY); | |||
} | |||
@Override | |||
protected void validate(ErrorMsgBuilder builder) { | |||
} | |||
} |
@@ -0,0 +1,41 @@ | |||
package cn.com.taiji.core.model.comm.protocol.ats.ali; | |||
import cn.com.taiji.core.model.comm.protocol.ats.AbstractAtsResponse; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/10 14:17 | |||
* @Filename:AtsCreatPayOrder | |||
* @description: | |||
*/ | |||
@Getter | |||
@Setter | |||
public class AtsAliQueryOrderRefundResponse extends AbstractAtsResponse { | |||
/** | |||
* 商户订单号 | |||
* */ | |||
private String outTradeNo; | |||
/** | |||
* 退款状态。枚举值: REFUND_SUCCESS 退款处理成功; 未返回该字段表示退款请求未收到或者退款失败; | |||
* 注:如果退款查询发起时间早于退款时间,或者间隔退款发起时间太短, | |||
* 可能出现退款查询时还没处理成功,后面又处理成功的情况,建议商户在退款发起后间隔10秒以上再发起退款查询请求。 | |||
* */ | |||
private String refundStatus; | |||
/** | |||
* 该笔退款所对应的交易的订单金额。单位:元。 | |||
* */ | |||
private String totalAmount; | |||
/** | |||
* 本次退款请求,对应的退款金额,单位:元。 | |||
* */ | |||
private String refundAmount; | |||
} |
@@ -6,6 +6,7 @@ import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
* @Author:ChenChao | |||
@@ -29,5 +30,7 @@ public class ResignRequest extends AbstractSignTypeRequest<SignQueryResponse> { | |||
String name; | |||
@NotBlank(message = "idNum不能为空") // v3需要 | |||
String idNum; | |||
@NotNull | |||
private Integer flag; // 1:检测,2获取参数 | |||
} |
@@ -14,7 +14,7 @@ import lombok.Setter; | |||
@Setter | |||
public class GetCarSignResponse extends AbstractSignTypeResponse { | |||
private String userState;//用户签约状态 是 | |||
// private String userState;//用户签约状态 是 | |||
private String deductMode;//发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付 否 | |||
@@ -6,7 +6,8 @@ import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.iaw.api.MyValidController; | |||
import cn.com.taiji.iaw.dto.ass.sign.RePageReqDto; | |||
import cn.com.taiji.iaw.dto.ass.sign.ReSignRequestDTO; | |||
import cn.com.taiji.iaw.dto.issue.order.SignQueryResponseDTO; | |||
import cn.com.taiji.iaw.dto.ass.sign.ResignCheckResDTO; | |||
import cn.com.taiji.iaw.dto.ass.sign.ResignResponseDTO; | |||
import cn.com.taiji.iaw.manager.ass.ResignManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
@@ -38,9 +39,15 @@ public class ReSignController extends MyValidController { | |||
return ApiResponse.of(manager.rePage(dto)); | |||
} | |||
@ApiOperation("恢复签约检测") | |||
@ApiOperation("恢复获取参数") | |||
@PostMapping("/reSign") | |||
public ApiResponse<SignQueryResponseDTO> reSign(@Valid @RequestBody ReSignRequestDTO dto) throws ManagerException { | |||
public ApiResponse<ResignResponseDTO> reSign(@Valid @RequestBody ReSignRequestDTO dto) throws ManagerException { | |||
return ApiResponse.of(manager.reSign(dto)); | |||
} | |||
//签约检测同发行的检测 | |||
@ApiOperation("恢复检测") | |||
@PostMapping("/reSignCheck") | |||
public ApiResponse<ResignCheckResDTO> reSignCheck(@Valid @RequestBody ReSignRequestDTO dto) throws ManagerException { | |||
return ApiResponse.of(manager.reSignCheck(dto)); | |||
} | |||
} |
@@ -3,9 +3,7 @@ package cn.com.taiji.iaw.api.issue; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.OrderInitResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.UserUploadResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.*; | |||
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstApplyRequest; | |||
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstApplyResponse; | |||
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstCallBackRequest; | |||
@@ -14,7 +12,6 @@ import cn.com.taiji.iaw.api.MyValidController; | |||
import cn.com.taiji.iaw.dto.CommRequestDTO; | |||
import cn.com.taiji.iaw.dto.issue.order.*; | |||
import cn.com.taiji.iaw.manager.issue.IssueOrderManage; | |||
import cn.hutool.http.server.HttpServerResponse; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -23,9 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import javax.servlet.http.HttpServletResponse; | |||
import javax.validation.Valid; | |||
import java.io.IOException; | |||
/** | |||
* @Author:ChenChao | |||
@@ -107,8 +102,14 @@ public class OrderController extends MyValidController { | |||
return ApiResponse.of(res); | |||
} | |||
@ApiOperation(value = "签约参数获取") | |||
@PostMapping(value = "/getCarsign") | |||
public ApiResponse<GetCarSignResponseDTO> getCarsign(@Valid @RequestBody GetCarSignRequest reqDto) throws ManagerException { | |||
GetCarSignResponseDTO res = issueOrderManage.getCarsign(reqDto); | |||
return ApiResponse.of(res); | |||
} | |||
@ApiOperation(value = "10.签约及签约检测") | |||
@ApiOperation(value = "10.签约检测") | |||
@PostMapping(value = "/signQuery") | |||
public ApiResponse<SignQueryResponseDTO> signQuery(@Valid @RequestBody SignQueryRequest reqDto) throws ManagerException { | |||
SignQueryResponseDTO res = issueOrderManage.signQuery(reqDto); | |||
@@ -157,7 +158,7 @@ public class OrderController extends MyValidController { | |||
@ApiOperation(value = "17.订单收货") | |||
@PostMapping(value = "/orderReceiveGoods") | |||
public ApiResponse<?> processReceiveGoods(@Valid @RequestBody OrderDetailReqDto reqDto) throws ManagerException { | |||
public ApiResponse<?> processReceiveGoods(@Valid @RequestBody OrderCommDTO reqDto) throws ManagerException { | |||
issueOrderManage.orderReceiveGoods(reqDto); | |||
return ApiResponse.success().setMessage("收货成功"); | |||
} | |||
@@ -169,7 +170,7 @@ public class OrderController extends MyValidController { | |||
} | |||
@ApiOperation(value = "19.修改地址前-查询") | |||
@PostMapping(value = "/upAdressQuery") | |||
public ApiResponse<UpAdressQueryResDTO> upAdressQuery(@Valid @RequestBody OrderDetailReqDto reqDto) throws ManagerException { | |||
public ApiResponse<UpAdressQueryResDTO> upAdressQuery(@Valid @RequestBody OrderCommDTO reqDto) throws ManagerException { | |||
UpAdressQueryResDTO resDTO = issueOrderManage.upAdressQuery(reqDto); | |||
return ApiResponse.of(resDTO); | |||
} |
@@ -0,0 +1,16 @@ | |||
package cn.com.taiji.iaw.dto.ass.sign; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/20 14:29 | |||
* @Filename:ResignCheckResponseDTO | |||
* @description: | |||
*/ | |||
@Data | |||
public class ResignCheckResDTO { | |||
@ApiModelProperty(value = "用户签约状态 UNAUTHORIZED 未签约") | |||
private String userState;//用户签约状态 是 | |||
} |
@@ -0,0 +1,67 @@ | |||
package cn.com.taiji.iaw.dto.ass.sign; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/20 11:52 | |||
* @Filename:ResignResponseDTO | |||
* @description: | |||
*/ | |||
@Data | |||
public class ResignResponseDTO { | |||
@ApiModelProperty(value = "用户签约状态 UNAUTHORIZED 未签约") | |||
private String userState;//用户签约状态 是 | |||
@ApiModelProperty(value = "发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付") | |||
private String deductMode;//发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付 否 | |||
@ApiModelProperty(value = "车牌信息") | |||
private String plateNumberInfo;//车牌信息 否 | |||
//=====================前端请求微信签约参数==============参与签名字段 + | |||
@ApiModelProperty(value = "V2 签约参数appid") | |||
private String appId;//请求appid 是 + | |||
@ApiModelProperty(value = "V2 签约参数商户号") | |||
private String mchId;//商户号 是 + | |||
@ApiModelProperty(value = "V2 签约参数子商户号") | |||
private String subMchId;//子商户号 是 + | |||
@ApiModelProperty(value = "V2 签约参数 子商户公众账号id") | |||
private String subAppId;//子商户公众账号id 是 + | |||
@ApiModelProperty(value = "V2 签约参数 随机字符串") | |||
private String nonceStr;//随机字符串 是 + | |||
@ApiModelProperty(value = "V2 签约参数 签名类型") | |||
private String signType;//签名类型 是 + | |||
@ApiModelProperty(value = "V2 签约参数 sign") | |||
private String sign;//签名 是 | |||
@ApiModelProperty(value = "V2 签约参数 交易场景") | |||
private String tradeScene = "HIGHWAY";//交易场景 写死 是 + | |||
@ApiModelProperty(value = "V2 签约参数 openId") | |||
private String openId;//用户标识 否 | |||
@ApiModelProperty(value = "V2 签约参数 subOpenId") | |||
private String subOpenId;//用户子标识 是 + | |||
@ApiModelProperty(value = "V2 签约参数 车牌号") | |||
private String plateNumber;//车牌号 是 + | |||
@ApiModelProperty(value = "V2 签约参数 通道类型") | |||
private String channelType = "ETC";//通道类型 写死 ETC + | |||
@ApiModelProperty(value = "V2 跳转路径") | |||
private String path;//跳转路径 是 | |||
@ApiModelProperty(value = "V3 签约参数 id") | |||
private String preopenId;//V3黄牌 签约参数 + | |||
@ApiModelProperty(value = "跳转渠道AppId") | |||
private String channelSignAppId; | |||
@ApiModelProperty(value = "渠道签约地址") | |||
private String channelSignUrl; | |||
} |
@@ -1,6 +1,5 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||
import io.swagger.annotations.ApiModel; |
@@ -1,6 +1,5 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; |
@@ -0,0 +1,64 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/20 11:33 | |||
* @Filename:GetCarSignResponseDTO | |||
* @description: 签约参数 | |||
*/ | |||
@Data | |||
public class GetCarSignResponseDTO { | |||
// @ApiModelProperty(value = "订单阶段(通知小程序订单阶段)") | |||
// private IssueOrderStep step; | |||
// @ApiModelProperty(value = "用户签约状态 UNAUTHORIZED 未签约") | |||
// private String userState;//用户签约状态 是 | |||
@ApiModelProperty(value = "发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付") | |||
private String deductMode;//发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付 否 | |||
@ApiModelProperty(value = "车牌信息") | |||
private String plateNumberInfo;//车牌信息 否 | |||
//=====================前端请求微信签约参数==============参与签名字段 + | |||
@ApiModelProperty(value = "V2 签约参数appid") | |||
private String appId;//请求appid 是 + | |||
@ApiModelProperty(value = "V2 签约参数商户号") | |||
private String mchId;//商户号 是 + | |||
@ApiModelProperty(value = "V2 签约参数子商户号") | |||
private String subMchId;//子商户号 是 + | |||
@ApiModelProperty(value = "V2 签约参数 子商户公众账号id") | |||
private String subAppId;//子商户公众账号id 是 + | |||
@ApiModelProperty(value = "V2 签约参数 随机字符串") | |||
private String nonceStr;//随机字符串 是 + | |||
@ApiModelProperty(value = "V2 签约参数 签名类型") | |||
private String signType;//签名类型 是 + | |||
@ApiModelProperty(value = "V2 签约参数 sign") | |||
private String sign;//签名 是 | |||
@ApiModelProperty(value = "V2 签约参数 交易场景") | |||
private String tradeScene = "HIGHWAY";//交易场景 写死 是 + | |||
@ApiModelProperty(value = "V2 签约参数 openId") | |||
private String openId;//用户标识 否 | |||
@ApiModelProperty(value = "V2 签约参数 subOpenId") | |||
private String subOpenId;//用户子标识 是 + | |||
@ApiModelProperty(value = "V2 签约参数 车牌号") | |||
private String plateNumber;//车牌号 是 + | |||
@ApiModelProperty(value = "V2 签约参数 通道类型") | |||
private String channelType = "ETC";//通道类型 写死 ETC + | |||
@ApiModelProperty(value = "V2 跳转路径") | |||
private String path;//跳转路径 是 | |||
@ApiModelProperty(value = "V3 签约参数 id") | |||
private String preopenId;//V3黄牌 签约参数 + | |||
} |
@@ -0,0 +1,20 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/7/16 16:24 | |||
* @Filename:orderDetailReqDto | |||
* @description: | |||
*/ | |||
@Data | |||
@ApiModel(description = "订单详情") | |||
public class OrderCommDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "订单编号") | |||
private String orderNo; | |||
} |
@@ -1,20 +1,18 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/7/16 16:24 | |||
* @Filename:orderDetailReqDto | |||
* @Date:2025/8/20 21:16 | |||
* @Filename:OrderXqReqDTO | |||
* @description: | |||
*/ | |||
@Data | |||
@ApiModel(description = "订单详情") | |||
public class OrderDetailReqDto extends AbstractBizRequestDTO { | |||
public class OrderDetailReqDto { | |||
@ApiModelProperty(value = "订单编号") | |||
private String orderNo; | |||
} |
@@ -19,53 +19,53 @@ public class SignQueryResponseDTO { | |||
@ApiModelProperty(value = "用户签约状态 UNAUTHORIZED 未签约") | |||
private String userState;//用户签约状态 是 | |||
@ApiModelProperty(value = "发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付") | |||
private String deductMode;//发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付 否 | |||
@ApiModelProperty(value = "车牌信息") | |||
private String plateNumberInfo;//车牌信息 否 | |||
//=====================前端请求微信签约参数==============参与签名字段 + | |||
@ApiModelProperty(value = "V2 签约参数appid") | |||
private String appId;//请求appid 是 + | |||
@ApiModelProperty(value = "V2 签约参数商户号") | |||
private String mchId;//商户号 是 + | |||
@ApiModelProperty(value = "V2 签约参数子商户号") | |||
private String subMchId;//子商户号 是 + | |||
@ApiModelProperty(value = "V2 签约参数 子商户公众账号id") | |||
private String subAppId;//子商户公众账号id 是 + | |||
@ApiModelProperty(value = "V2 签约参数 随机字符串") | |||
private String nonceStr;//随机字符串 是 + | |||
@ApiModelProperty(value = "V2 签约参数 签名类型") | |||
private String signType;//签名类型 是 + | |||
@ApiModelProperty(value = "V2 签约参数 sign") | |||
private String sign;//签名 是 | |||
@ApiModelProperty(value = "V2 签约参数 交易场景") | |||
private String tradeScene = "HIGHWAY";//交易场景 写死 是 + | |||
@ApiModelProperty(value = "V2 签约参数 openId") | |||
private String openId;//用户标识 否 | |||
@ApiModelProperty(value = "V2 签约参数 subOpenId") | |||
private String subOpenId;//用户子标识 是 + | |||
@ApiModelProperty(value = "V2 签约参数 车牌号") | |||
private String plateNumber;//车牌号 是 + | |||
@ApiModelProperty(value = "V2 签约参数 通道类型") | |||
private String channelType = "ETC";//通道类型 写死 ETC + | |||
@ApiModelProperty(value = "V2 跳转路径") | |||
private String path;//跳转路径 是 | |||
@ApiModelProperty(value = "V3 签约参数 id") | |||
private String preopenId;//V3黄牌 签约参数 + | |||
@ApiModelProperty(value = "跳转渠道AppId") | |||
private String channelSignAppId; | |||
@ApiModelProperty(value = "渠道签约地址") | |||
private String channelSignUrl; | |||
// @ApiModelProperty(value = "发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付") | |||
// private String deductMode;//发起扣费方式PROACTIVE:表示用户主动发起的免密支付 AUTOPAY:表示用户无感的支付 否 | |||
// | |||
// @ApiModelProperty(value = "车牌信息") | |||
// private String plateNumberInfo;//车牌信息 否 | |||
// | |||
// //=====================前端请求微信签约参数==============参与签名字段 + | |||
// @ApiModelProperty(value = "V2 签约参数appid") | |||
// private String appId;//请求appid 是 + | |||
// | |||
// @ApiModelProperty(value = "V2 签约参数商户号") | |||
// private String mchId;//商户号 是 + | |||
// | |||
// @ApiModelProperty(value = "V2 签约参数子商户号") | |||
// private String subMchId;//子商户号 是 + | |||
// | |||
// @ApiModelProperty(value = "V2 签约参数 子商户公众账号id") | |||
// private String subAppId;//子商户公众账号id 是 + | |||
// | |||
// @ApiModelProperty(value = "V2 签约参数 随机字符串") | |||
// private String nonceStr;//随机字符串 是 + | |||
// | |||
// @ApiModelProperty(value = "V2 签约参数 签名类型") | |||
// private String signType;//签名类型 是 + | |||
// | |||
// @ApiModelProperty(value = "V2 签约参数 sign") | |||
// private String sign;//签名 是 | |||
// | |||
// @ApiModelProperty(value = "V2 签约参数 交易场景") | |||
// private String tradeScene = "HIGHWAY";//交易场景 写死 是 + | |||
// @ApiModelProperty(value = "V2 签约参数 openId") | |||
// private String openId;//用户标识 否 | |||
// @ApiModelProperty(value = "V2 签约参数 subOpenId") | |||
// private String subOpenId;//用户子标识 是 + | |||
// @ApiModelProperty(value = "V2 签约参数 车牌号") | |||
// private String plateNumber;//车牌号 是 + | |||
// @ApiModelProperty(value = "V2 签约参数 通道类型") | |||
// private String channelType = "ETC";//通道类型 写死 ETC + | |||
// @ApiModelProperty(value = "V2 跳转路径") | |||
// private String path;//跳转路径 是 | |||
// | |||
// @ApiModelProperty(value = "V3 签约参数 id") | |||
// private String preopenId;//V3黄牌 签约参数 + | |||
// | |||
// | |||
// @ApiModelProperty(value = "跳转渠道AppId") | |||
// private String channelSignAppId; | |||
// @ApiModelProperty(value = "渠道签约地址") | |||
// private String channelSignUrl; | |||
} |
@@ -1,9 +1,12 @@ | |||
package cn.com.taiji.iaw.manager.ass; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.iaw.dto.ass.sign.RePageReqDto; | |||
import cn.com.taiji.iaw.dto.ass.sign.ReSignRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.sign.ResignCheckResDTO; | |||
import cn.com.taiji.iaw.dto.ass.sign.ResignResponseDTO; | |||
import cn.com.taiji.iaw.dto.issue.order.SignQueryResponseDTO; | |||
/** | |||
@@ -15,5 +18,7 @@ import cn.com.taiji.iaw.dto.issue.order.SignQueryResponseDTO; | |||
public interface ResignManager { | |||
Pagination rePage(RePageReqDto dto) throws ManagerException; | |||
SignQueryResponseDTO reSign(ReSignRequestDTO dto) throws ManagerException; | |||
ResignResponseDTO reSign(ReSignRequestDTO dto) throws ManagerException; | |||
ResignCheckResDTO reSignCheck(ReSignRequestDTO dto) throws ManagerException; | |||
} |
@@ -1,6 +1,7 @@ | |||
package cn.com.taiji.iaw.manager.ass; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.ass.AssAgencyConfig; | |||
import cn.com.taiji.core.entity.basic.QtkCardInfo; | |||
@@ -15,9 +16,7 @@ import cn.com.taiji.core.repo.jpa.ass.AssAgencyConfigRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkVehicleInfoRepo; | |||
import cn.com.taiji.iaw.dto.ass.sign.RePageMode; | |||
import cn.com.taiji.iaw.dto.ass.sign.RePageReqDto; | |||
import cn.com.taiji.iaw.dto.ass.sign.ReSignRequestDTO; | |||
import cn.com.taiji.iaw.dto.ass.sign.*; | |||
import cn.com.taiji.iaw.dto.issue.order.SignQueryResponseDTO; | |||
import cn.com.taiji.iaw.manager.AbstractCommManager; | |||
import cn.com.taiji.iaw.repo.jpa.request.comm.VehicleSignPageRequest; | |||
@@ -91,10 +90,10 @@ public class ResignManagerImpl extends AbstractCommManager implements ResignMana | |||
} | |||
@Override | |||
public SignQueryResponseDTO reSign(ReSignRequestDTO dto) throws ManagerException { | |||
public ResignResponseDTO reSign(ReSignRequestDTO dto) throws ManagerException { | |||
QtkCardInfo cardInfo = cardInfoRepo.findByVehicleIdAndCardStatus(dto.getVehicleId()); | |||
if (cardInfo == null) throw new ManagerException("未找到车辆卡信息"); | |||
SignQueryResponseDTO responseDTO = new SignQueryResponseDTO(); | |||
ResignResponseDTO responseDTO = new ResignResponseDTO(); | |||
//渠道订单没有渠道配置或签约地址默认和黔通签约 | |||
AssAgencyConfig agencyConfig = assAgencyConfigRepo.findByAgencyId(cardInfo.getAgencyId()); | |||
if (agencyConfig != null && !agencyConfig.getQtSign()){ | |||
@@ -108,7 +107,25 @@ public class ResignManagerImpl extends AbstractCommManager implements ResignMana | |||
request.setVehicleId(dto.getVehicleId()); | |||
request.setName(accountInfo.getUserName()); | |||
request.setIdNum(accountInfo.getIdNum()); | |||
request.setFlag(2); | |||
SignQueryResponse response = jsonPostRepeat(request); | |||
return copyProperties(response, responseDTO); | |||
} | |||
@Override | |||
public ResignCheckResDTO reSignCheck(ReSignRequestDTO dto) throws ManagerException { | |||
QtkCardInfo cardInfo = cardInfoRepo.findByVehicleIdAndCardStatus(dto.getVehicleId()); | |||
if (cardInfo == null) throw new ManagerException("未找到车辆卡信息"); | |||
AccountInfo accountInfo = findAccountInfoByToken(dto.getAccessToken()); | |||
ResignRequest request = new ResignRequest(); | |||
request.setWxOpenId(dto.getSubOpenId()); | |||
request.setProductId(cardInfo.getPackageId()); | |||
request.setVehicleId(dto.getVehicleId()); | |||
request.setName(accountInfo.getUserName()); | |||
request.setIdNum(accountInfo.getIdNum()); | |||
request.setFlag(1); | |||
SignQueryResponse response = jsonPostRepeat(request); | |||
ResignCheckResDTO resignCheckResDTO = copyProperties(response, new ResignCheckResDTO()); | |||
return resignCheckResDTO; | |||
} | |||
} |
@@ -3,6 +3,7 @@ package cn.com.taiji.iaw.manager.issue; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.GetCarSignRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.OrderInitResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.UserUploadResponse; | |||
@@ -13,9 +14,6 @@ import cn.com.taiji.core.model.comm.protocol.inss.inst.InstCallBackResponse; | |||
import cn.com.taiji.iaw.dto.CommRequestDTO; | |||
import cn.com.taiji.iaw.dto.issue.order.*; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.io.IOException; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/6/12 11:18 | |||
@@ -55,13 +53,13 @@ public interface IssueOrderManage { | |||
OrderDetailResDTO orderDetailQuery(OrderDetailReqDto reqDto) throws ManagerException; | |||
void orderReceiveGoods(OrderDetailReqDto reqDto) throws ManagerException; | |||
void orderReceiveGoods(OrderCommDTO reqDto) throws ManagerException; | |||
void orderCancel(OrderCancelRequestDTO reqDto) throws ManagerException; | |||
void updateAdress(UpdateAdressReqDTO reqDto) throws ManagerException; | |||
UpAdressQueryResDTO upAdressQuery(OrderDetailReqDto reqDto) throws ManagerException; | |||
UpAdressQueryResDTO upAdressQuery(OrderCommDTO reqDto) throws ManagerException; | |||
PayAfterOrderResDTO payAfterOrder(PayAfterOrderReqDTO reqDto) throws ManagerException; | |||
@@ -74,4 +72,6 @@ public interface IssueOrderManage { | |||
ListQrCodeResDTO listQRcode(ListQrCodeReqDTO reqDto) throws ManagerException; | |||
QdOrderResponseDTO qdOrderQuery(QdOrderRequestDTO dto); | |||
GetCarSignResponseDTO getCarsign(GetCarSignRequest reqDto) throws ManagerException; | |||
} |
@@ -34,12 +34,10 @@ import cn.hutool.core.util.StrUtil; | |||
import cn.hutool.extra.qrcode.QrCodeUtil; | |||
import cn.hutool.extra.qrcode.QrConfig; | |||
import org.apache.commons.codec.binary.Base64; | |||
import org.apache.kafka.common.protocol.types.Field; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.awt.*; | |||
import java.io.*; | |||
import java.time.LocalDateTime; | |||
@@ -287,6 +285,17 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
return copyProperties(response, new PayApplyResDTO()); | |||
} | |||
@Override | |||
public GetCarSignResponseDTO getCarsign(GetCarSignRequest request) throws ManagerException { | |||
IssueOrderinfo orderinfo = checkOrder(request.getOrderNo()); | |||
GetCarSignResponse response = jsonPostRepeat(request); | |||
sysPersistOperateLog(OperateType.ORDER_SIGNAPPLY, orderinfo.getId(), SourceType.WECHAT, "-1", "签约参数获取"); | |||
return copyProperties(response, new GetCarSignResponseDTO()); | |||
} | |||
@Override | |||
public SignQueryResponseDTO signQuery(SignQueryRequest request) throws ManagerException { | |||
IssueOrderinfo orderinfo = checkOrder(request.getOrderNo()); | |||
@@ -299,6 +308,7 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
// return resDTO; | |||
// } | |||
SignQueryResponse signQueryResponse = jsonPostRepeat(request); | |||
sysPersistOperateLog(OperateType.ORDER_CHECK, orderinfo.getId(), SourceType.WECHAT, "-1", "签约检测"); | |||
return copyProperties(signQueryResponse, resDTO); | |||
} | |||
@@ -411,7 +421,7 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
@Transactional(rollbackFor = Exception.class) | |||
@Override | |||
public void orderReceiveGoods(OrderDetailReqDto reqDto) throws ManagerException { | |||
public void orderReceiveGoods(OrderCommDTO reqDto) throws ManagerException { | |||
IssueOrderinfo orderinfo = checkOrder(reqDto.getOrderNo()); | |||
if (!IssueOrderStep.WAITING_RECEIVE.equals(orderinfo.getOrderStep()) || | |||
!ShippingStatus.WAIT_RECEIVING.equals(orderinfo.getShippingStatus())) { | |||
@@ -451,7 +461,7 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
} | |||
@Override | |||
public UpAdressQueryResDTO upAdressQuery(OrderDetailReqDto reqDto) throws ManagerException { | |||
public UpAdressQueryResDTO upAdressQuery(OrderCommDTO reqDto) throws ManagerException { | |||
checkOrder(reqDto.getOrderNo()); | |||
UpAdressQueryResDTO resDTO = new UpAdressQueryResDTO(); | |||
//存在换货记录,返回发货记录的 地址 | |||
@@ -606,6 +616,8 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
return responseDTO; | |||
} | |||
//校验发行订单是否存在 | |||
private IssueOrderinfo checkOrder(String orderNo) throws ManagerException { | |||
IssueOrderinfo order = issueOrderinfoRepo.findByOrderNo(orderNo); |
@@ -64,7 +64,7 @@ public class AliCreatePayOrderManager extends AbstractCommManager { | |||
// 设置订单标题 | |||
createModel.setSubject(request.getSubject()); | |||
// 设置产品码 | |||
createModel.setProductCode("FACE_TO_FACE_PAYMENT"); | |||
createModel.setProductCode("QR_CODE_OFFLINE"); | |||
// 附加信息 | |||
createModel.setBody(request.getBody()); | |||
createRequest.setBizModel(createModel); | |||
@@ -113,7 +113,7 @@ public class AliCreatePayOrderManager extends AbstractCommManager { | |||
} | |||
AtsAliOrderApplyResponse response = new AtsAliOrderApplyResponse(); | |||
response.setOutTradeNo(createResponse.getOutTradeNo()); | |||
response.setForm(createResponse.getBody()); | |||
response.setPageRedirectionData(createResponse.getPageRedirectionData()); | |||
return response; | |||
} catch (AlipayApiException e) { | |||
logger.error("调用支付宝手机网站支付接口2.0失败", e); | |||
@@ -160,7 +160,6 @@ public class AliCreatePayOrderManager extends AbstractCommManager { | |||
} | |||
AtsAliOrderApplyResponse response = new AtsAliOrderApplyResponse(); | |||
response.setOutTradeNo(createResponse.getOutTradeNo()); | |||
response.setTradeNo(createResponse.getTradeNo()); | |||
return response; | |||
} catch (AlipayApiException e) { | |||
logger.error("调用支付宝统一收单线下交易预创建接口失败", e); | |||
@@ -196,8 +195,8 @@ public class AliCreatePayOrderManager extends AbstractCommManager { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("下单失败:" + createResponse.getMsg() + "-" + createResponse.getSubMsg()); | |||
} | |||
AtsAliOrderApplyResponse response = new AtsAliOrderApplyResponse(); | |||
response.setOutTradeNo(request.getOutTradeNo()); | |||
response.setForm(createResponse.getBody()); | |||
response.setOutTradeNo(createResponse.getOutTradeNo()); | |||
response.setOrderStr(createResponse.getOrderStr()); | |||
return response; | |||
} catch (AlipayApiException e) { | |||
logger.error("调用支付宝统一收单下单并支付页面接口失败", e); |
@@ -3,18 +3,13 @@ package cn.com.taiji.ats.manager.ali; | |||
import cn.com.taiji.ats.manager.AbstractCommManager; | |||
import cn.com.taiji.ats.manager.tools.ali.AlipayConfigUtils; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliOrderApplyResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliOrderRefundRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliQueryOrderApplyRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliQueryOrderApplyResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.*; | |||
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; | |||
import com.alipay.api.AlipayApiException; | |||
import com.alipay.api.AlipayClient; | |||
import com.alipay.api.domain.AlipayTradeQueryModel; | |||
import com.alipay.api.domain.AlipayTradeRefundModel; | |||
import com.alipay.api.request.AlipayTradeQueryRequest; | |||
import com.alipay.api.request.AlipayTradeRefundRequest; | |||
import com.alipay.api.response.AlipayTradeQueryResponse; | |||
import com.alipay.api.response.AlipayTradeRefundResponse; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.util.StringUtils; | |||
@@ -31,7 +26,7 @@ import java.time.LocalDateTime; | |||
@Service | |||
public class AliOrderRefundManager extends AbstractCommManager { | |||
public AtsAliOrderApplyResponse serviceHandle(AtsAliOrderRefundRequest request) throws ServiceHandleException { | |||
public AtsAliOrderRefundResponse serviceHandle(AtsAliOrderRefundRequest request) throws ServiceHandleException { | |||
logger.info("支付宝退款接口开始{},参数{}", LocalDateTime.now(), request.toJson()); | |||
if (!StringUtils.isEmpty(request.getRefundAmount())){ | |||
if (StringUtils.isEmpty(request.getOutRequestNo())){ | |||
@@ -64,7 +59,20 @@ public class AliOrderRefundManager extends AbstractCommManager { | |||
refundRequest.setBizModel(model); | |||
return null; | |||
try { | |||
AlipayTradeRefundResponse refundResponse = alipayClient.execute(refundRequest); | |||
if (!refundResponse.isSuccess()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("退款失败:" + refundResponse.getMsg() + "-" + refundResponse.getSubMsg()); | |||
} | |||
AtsAliOrderRefundResponse response = new AtsAliOrderRefundResponse(); | |||
response.setOutTradeNo(refundResponse.getOutTradeNo()); | |||
response.setRefundFee(refundResponse.getRefundFee()); | |||
return response; | |||
} catch (AlipayApiException e) { | |||
logger.error("调用支付宝统一收单线下交易退款接口失败", e); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("调用支付宝统一收单线下交易退款接口失败:" + e.getErrMsg()); | |||
} | |||
} | |||
} |
@@ -0,0 +1,62 @@ | |||
package cn.com.taiji.ats.manager.ali; | |||
import cn.com.taiji.ats.manager.AbstractCommManager; | |||
import cn.com.taiji.ats.manager.tools.ali.AlipayConfigUtils; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliQueryOrderRefundRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliQueryOrderRefundResponse; | |||
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; | |||
import com.alipay.api.AlipayApiException; | |||
import com.alipay.api.AlipayClient; | |||
import com.alipay.api.domain.AlipayTradeFastpayRefundQueryModel; | |||
import com.alipay.api.request.AlipayTradeFastpayRefundQueryRequest; | |||
import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/8/20 11:05 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Service | |||
public class AliQueryOrderRefundManager extends AbstractCommManager { | |||
public AtsAliQueryOrderRefundResponse serviceHandle(AtsAliQueryOrderRefundRequest request) throws ServiceHandleException { | |||
AlipayClient alipayClient = null; | |||
try { | |||
alipayClient = AlipayConfigUtils.createAlipayClient(request.getAppid(), request.getPrivateKey(), request.getPublicKey()); | |||
} catch (AlipayApiException e) { | |||
logger.error("支付宝初始化SDK异常:"+e.getMessage()); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("支付宝初始化SDK异常:"+e.getMessage()); | |||
} | |||
// 构造请求参数以调用接口 | |||
AlipayTradeFastpayRefundQueryRequest queryRequest = new AlipayTradeFastpayRefundQueryRequest(); | |||
AlipayTradeFastpayRefundQueryModel model = new AlipayTradeFastpayRefundQueryModel(); | |||
model.setOutRequestNo(request.getOutRequestNo()); | |||
// 设置商户订单号 | |||
model.setOutTradeNo(request.getOutTradeNo()); | |||
queryRequest.setBizModel(model); | |||
try { | |||
AlipayTradeFastpayRefundQueryResponse queryResponse = alipayClient.execute(queryRequest); | |||
if (!queryResponse.isSuccess()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("订单查询失败:" + queryResponse.getMsg() + "-" + queryResponse.getSubMsg()); | |||
} | |||
AtsAliQueryOrderRefundResponse response = new AtsAliQueryOrderRefundResponse(); | |||
response.setOutTradeNo(queryResponse.getOutTradeNo()); | |||
response.setRefundStatus(queryResponse.getRefundStatus()); | |||
response.setTotalAmount(queryResponse.getTotalAmount()); | |||
response.setRefundAmount(queryResponse.getRefundAmount()); | |||
return response; | |||
} catch (AlipayApiException e) { | |||
logger.error("调用支付宝统一收单线下交易查询接口失败", e); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("调用支付宝统一收单线下交易查询接口失败:" + e.getErrMsg()); | |||
} | |||
} | |||
} |
@@ -45,7 +45,7 @@ public class AliQueryPayOrderManager extends AbstractCommManager { | |||
try { | |||
AlipayTradeQueryResponse queryResponse = alipayClient.execute(queryRequest); | |||
if (!queryResponse.isSuccess()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("下单失败:" + queryResponse.getMsg() + "-" + queryResponse.getSubMsg()); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("订单查询失败:" + queryResponse.getMsg() + "-" + queryResponse.getSubMsg()); | |||
} | |||
AtsAliQueryOrderApplyResponse response = new AtsAliQueryOrderApplyResponse(); | |||
response.setOutTradeNo(queryResponse.getOutTradeNo()); | |||
@@ -53,8 +53,8 @@ public class AliQueryPayOrderManager extends AbstractCommManager { | |||
response.setTotalAmount(queryResponse.getTotalAmount()); | |||
return response; | |||
} catch (AlipayApiException e) { | |||
logger.error("调用支付宝统一收单线下交易预创建接口失败", e); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("调用支付宝统一收单线下交易预创建接口失败:" + e.getErrMsg()); | |||
logger.error("调用支付宝统一收单线下交易查询接口失败", e); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("调用支付宝统一收单线下交易查询接口失败:" + e.getErrMsg()); | |||
} | |||
} | |||
@@ -2,6 +2,7 @@ package cn.com.taiji.ats.manager.handler; | |||
import cn.com.taiji.ats.manager.ali.AliCreatePayOrderManager; | |||
import cn.com.taiji.ats.manager.ali.AliOrderRefundManager; | |||
import cn.com.taiji.ats.manager.ali.AliQueryOrderRefundManager; | |||
import cn.com.taiji.ats.manager.ali.AliQueryPayOrderManager; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.file.FileProtocolSystemError; | |||
@@ -9,12 +10,10 @@ import cn.com.taiji.core.model.comm.protocol.AbstractSignTypeRequest; | |||
import cn.com.taiji.core.model.comm.protocol.AbstractSignTypeResponse; | |||
import cn.com.taiji.core.model.comm.protocol.SignJsonRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.AtsServiceType; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AliServiceCmd; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliOrderApplyRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliOrderRefundRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliQueryOrderApplyRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.ali.*; | |||
import cn.com.taiji.core.model.comm.protocol.ats.weiXin.*; | |||
import com.zgglyun.common.model.AbstractHttpRequestInfo; | |||
import org.checkerframework.checker.units.qual.A; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -40,6 +39,8 @@ public class AliServiceHandler extends AbstractAtsServiceHandler<WeiXinServiceCm | |||
private AliQueryPayOrderManager aliQueryPayOrderManager; | |||
@Autowired | |||
private AliOrderRefundManager aliOrderRefundManager; | |||
@Autowired | |||
private AliQueryOrderRefundManager aliQueryOrderRefundManager; | |||
@Override | |||
@@ -53,6 +54,8 @@ public class AliServiceHandler extends AbstractAtsServiceHandler<WeiXinServiceCm | |||
return aliQueryPayOrderManager.serviceHandle((AtsAliQueryOrderApplyRequest) request); | |||
case ORDERREFUND: | |||
return aliOrderRefundManager.serviceHandle((AtsAliOrderRefundRequest) request); | |||
case QUERYORDERREFUND: | |||
return aliQueryOrderRefundManager.serviceHandle((AtsAliQueryOrderRefundRequest) request); | |||
default: | |||
throw FileProtocolSystemError.NOT_SUPPORT.toHandleException(jsonReq.getIfCode()); | |||
} |
@@ -17,6 +17,7 @@ public enum DataType { | |||
PAY_QUERY("payQuery", IasServiceType.ORDER, OrderServiceCmd.PAYQUERY), | |||
STATUS_QUERY("statusQuery", IasServiceType.ORDER, OrderServiceCmd.STATUSQUERY), | |||
PRODUCT_QUERY("productQuery", IasServiceType.ORDER, OrderServiceCmd.PRODUCTQUERY), | |||
GET_CARSIGN("getCarSign", IasServiceType.ORDER, OrderServiceCmd.GETCARSIGN), | |||
SIGN_QUERY("signQuery", IasServiceType.ORDER, OrderServiceCmd.SIGNQUERY), | |||
SIGN_CHECK("signCheck", IasServiceType.ORDER, OrderServiceCmd.SIGNCHECK), | |||
SIGN_CALLBACK("signCallback", IasServiceType.ORDER, OrderServiceCmd.SIGNCALLBACK), |
@@ -32,7 +32,11 @@ public class ResignManager extends AbstractCommManager { | |||
res = signCommonManager.carSignV2(request.getWxOpenId(), request.getProductId(), request.getVehicleId()); | |||
break; | |||
case YELLOW: | |||
res = signCommonManager.carSignV3(request.getWxOpenId(), request.getProductId(), request.getVehicleId(), request.getName(), request.getIdNum()); | |||
if (request.getFlag() == 2) { | |||
res = signCommonManager.carSignV3(request.getWxOpenId(), request.getProductId(), request.getVehicleId(), request.getName(), request.getIdNum()); | |||
}else { | |||
res = signCommonManager.carSignV3Result(request.getWxOpenId(), request.getProductId(), request.getVehicleId()); | |||
} | |||
break; | |||
default: | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("微信签约只支持,蓝、渐变绿、黄,三种车牌签约"); |
@@ -56,6 +56,10 @@ public class OrderServiceHandler extends AbstractIasServiceHandler<OrderServiceC | |||
private OrderSignCheckManager orderSignCheckManager; | |||
@Autowired | |||
private OrderConsigneeManager orderConsigneeManager; | |||
@Autowired | |||
private GetCarSignManager getCarSignManager; | |||
@Autowired | |||
private PushAgreementManager pushAgreementManager; | |||
@Override | |||
protected <T extends AbstractSignTypeRequest<?>> AbstractSignTypeResponse handleInternal(T request, SignJsonRequest jsonReq, AbstractHttpRequestInfo reqInfo) throws ServiceHandleException { | |||
@@ -69,6 +73,8 @@ public class OrderServiceHandler extends AbstractIasServiceHandler<OrderServiceC | |||
return userUploadManager.serviceHandle((UserUploadRequest)request, jsonReq.getIfCode(), jsonReq.getReqId(), reqInfo); | |||
case VEHICLEUPLOAD: | |||
return vehicleUploadManager.serviceHandle((VehicleUploadRequest)request, jsonReq.getIfCode(), jsonReq.getReqId(), reqInfo); | |||
case GETCARSIGN: | |||
return getCarSignManager.serviceHandle((GetCarSignRequest)request, jsonReq.getIfCode(), jsonReq.getReqId(), reqInfo); | |||
case SIGNQUERY: | |||
return signQueryManager.serviceHandle((SignQueryRequest)request, jsonReq.getIfCode(), jsonReq.getReqId(), reqInfo); | |||
case SIGNCALLBACK: | |||
@@ -99,6 +105,8 @@ public class OrderServiceHandler extends AbstractIasServiceHandler<OrderServiceC | |||
return orderAuditManager.serviceHandle((OrderAuditRequest)request, jsonReq.getIfCode(), jsonReq.getReqId(), reqInfo); | |||
case CONSIGNEE: | |||
return orderConsigneeManager.serviceHandle((IssueOrderConsigneeRequest)request, jsonReq.getIfCode(), jsonReq.getReqId(), reqInfo); | |||
case PUSHAGREEMENT: | |||
return pushAgreementManager.serviceHandle((PushAgreementRequest)request, jsonReq.getIfCode(), jsonReq.getReqId(), reqInfo); | |||
default: | |||
throw FileProtocolSystemError.NOT_SUPPORT.toHandleException(jsonReq.getIfCode()); | |||
} |
@@ -0,0 +1,88 @@ | |||
package cn.com.taiji.ias.manager.order; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.core.entity.dict.basic.PlateColorType; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.entity.dict.basic.UserType; | |||
import cn.com.taiji.core.entity.dict.issue.IssueOrderStep; | |||
import cn.com.taiji.core.entity.dict.issue.ShippingStatus; | |||
import cn.com.taiji.core.entity.issue.IssueOrderinfo; | |||
import cn.com.taiji.core.entity.issue.IssueOrderinfoExt; | |||
import cn.com.taiji.core.model.comm.protocol.AbstractSignTypeResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.GetCarSignRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.GetCarSignResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryResponse; | |||
import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | |||
import cn.com.taiji.ias.dict.DataType; | |||
import cn.com.taiji.ias.model.ServiceLogEvent; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.io.IOException; | |||
import java.time.LocalDateTime; | |||
import java.util.Map; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/20 10:53 | |||
* @Filename:GetCarSignManager | |||
* @description: | |||
*/ | |||
@Service | |||
public class GetCarSignManager extends AbstractOrderManager<GetCarSignRequest>{ | |||
public GetCarSignManager() { | |||
super(DataType.GET_CARSIGN); | |||
} | |||
public static final String RES = "res"; | |||
@Autowired | |||
private SignCommonManager signCommonManager; | |||
@Override | |||
protected String getDataId(GetCarSignRequest req) { | |||
return ""; | |||
} | |||
@Override | |||
protected void formatValidateInternal(ErrorMsgBuilder builder, GetCarSignRequest req, ServiceLogEvent event, Map<String, Object> dataStream) throws ServiceHandleException { | |||
} | |||
@Override | |||
protected void businessValidateInternal(ErrorMsgBuilder builder, GetCarSignRequest req, ServiceLogEvent event, Map<String, Object> dataStream) throws ServiceHandleException { | |||
IssueOrderinfo order = checkOrder(req.getOrderNo()); | |||
Integer vehiclePlateColor = order.getVehiclePlateColor(); | |||
IssueOrderinfoExt ext = orderInfoExtRepo.findByOrderNo(order.getOrderNo()); | |||
SignQueryResponse res = null; | |||
switch (PlateColorType.valueOfCode(vehiclePlateColor)) { | |||
case BLUE: | |||
case GREEN: | |||
res = signCommonManager.carSignV2(req.getSubOpenId(), order.getProductId(), order.getVehicleId()); | |||
break; | |||
case YELLOW: | |||
//单位订单使用经办人的身份证信息 | |||
String name= ""; | |||
String idNum = ""; | |||
if (UserType.PERSONAL_USER.equals(order.getUserType())) { | |||
name = order.getCustomerName(); | |||
idNum = order.getCustomerIdNum(); | |||
}else { | |||
name = order.getAgentName(); | |||
idNum = order.getAgentIdNum(); | |||
} | |||
res = signCommonManager.carSignV3(req.getSubOpenId(), order.getProductId(), order.getVehicleId(), name, idNum); | |||
break; | |||
default: | |||
throw newBusinessException("微信签约只支持,蓝、渐变绿、黄,三种车牌签约"); | |||
} | |||
GetCarSignResponse response = copyProperties(res, new GetCarSignResponse()); | |||
dataStream.put(RES, response); | |||
} | |||
@Override | |||
protected GetCarSignResponse getRes(GetCarSignRequest req, ServiceLogEvent event, Map<String, Object> dataStream) throws ServiceHandleException, IOException { | |||
return (GetCarSignResponse)dataStream.get(RES); | |||
} | |||
} |
@@ -97,7 +97,7 @@ public class OrderInitManager extends AbstractOrderManager<OrderInitRequest> { | |||
//校验渠道网点是否禁用 | |||
checkChannelandAgency(request); | |||
// QtkServiceHall qtkServiceHall = checkChannelandAgency(request); | |||
// 渠道订单校验坐标 | |||
// 渠道订单校验坐标 | |||
// if (request.getIssueType() ==2) { | |||
// checkElecFence(request.getLatitude(), request.getLongitude(), qtkServiceHall); | |||
// } |
@@ -13,6 +13,7 @@ import cn.com.taiji.core.repo.jpa.basic.QtkVehicleInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.comm.CommonWxSignConfigRepo; | |||
import cn.com.taiji.core.repo.jpa.issue.IssueProductPayRepo; | |||
import cn.com.taiji.ias.manager.AbstractCommManager; | |||
import org.jetbrains.annotations.NotNull; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -36,21 +37,12 @@ public class SignCommonManager extends AbstractCommManager { | |||
private IssueProductPayRepo issueProductPayRepo; | |||
//暂时适配微信,后面支付宝再适配 | |||
//V2获取签约参数及检测,暂时适配微信,后面支付宝再适配 | |||
public SignQueryResponse carSignV2(String wxOpenId, String productId,String vehicleId) throws ServiceHandleException { | |||
List<IssueProductPay> issueProductPayList = issueProductPayRepo.findByFeeCategoryAndReleaseId(FeeCategory.PASS, productId); | |||
if (isEmpty(issueProductPayList)){ | |||
logger.error("产品编号{}未配置通行费", productId); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("产品未配置通行费"); | |||
} | |||
//获取配置信息 | |||
CommonWxSignConfig signConfig = getCommonWxSignConfig(productId,2); | |||
String[] split = vehicleId.split("_"); | |||
IssueProductPay issueProductPay = issueProductPayList.get(0); | |||
CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByParentIdAndPayChannelTypeAndVersion(issueProductPay.getPayConfigId(), | |||
PayChannelType.valueOf(issueProductPay.getChargeMethod().name()), 2); | |||
if (signConfig == null) { | |||
logger.error("产品编号{}没有签约配置信息", productId); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("产品没有签约配置信息"); | |||
} | |||
AtsVehicleUserStateRequest request = new AtsVehicleUserStateRequest(); | |||
request.setAppId(signConfig.getAppId()); | |||
request.setSubAppId(signConfig.getSubAppId()); | |||
@@ -70,34 +62,81 @@ public class SignCommonManager extends AbstractCommManager { | |||
// } | |||
// 签约过 | |||
if (!"UNAUTHORIZED".equals(response.getUserState())) { | |||
return new SignQueryResponse().setUserState(response.getUserState()); | |||
}else { | |||
// 20250716改 | |||
SignQueryResponse signRes = copyProperties(response, new SignQueryResponse()); | |||
return signRes; | |||
} | |||
// // 签约过 | |||
// if (!"UNAUTHORIZED".equals(response.getUserState())) { | |||
// return new SignQueryResponse().setUserState(response.getUserState()); | |||
// }else { | |||
// // 20250716改 | |||
// SignQueryResponse signRes = copyProperties(response, new SignQueryResponse()); | |||
// return signRes; | |||
// } | |||
//20250819改不管签没签约,都返回签约参数 | |||
SignQueryResponse signRes = copyProperties(response, new SignQueryResponse()); | |||
return signRes; | |||
} | |||
//暂时适配微信,后面支付宝再适配 | |||
//获取微信签约配置参数 | |||
public SignQueryResponse carSignV3(String wxOpenId,String productId,String vehicleId,String name,String idNum) throws ServiceHandleException { | |||
//获取配置信息 | |||
CommonWxSignConfig signConfig = getCommonWxSignConfig(productId,3); | |||
String[] split = vehicleId.split("_"); | |||
//签约参数获取 | |||
AtsVehicleSignV3Request v3Request = new AtsVehicleSignV3Request(); | |||
v3Request.setAppId(signConfig.getAppId()); | |||
v3Request.setMchid(signConfig.getMchId()); | |||
v3Request.setSubMchid(signConfig.getSubMchId()); | |||
v3Request.setSubAppId(signConfig.getSubAppId()); | |||
v3Request.setApiV3Key(signConfig.getSignKey()); | |||
v3Request.setPrivateKey(signConfig.getPrivateKey()); | |||
v3Request.setPublicKeyId(signConfig.getWxPublicKeyId()); | |||
v3Request.setPublicKey(signConfig.getWxPublicKey()); | |||
v3Request.setSerialNo(signConfig.getSerialNo()); | |||
v3Request.setPlanId(signConfig.getPlanId()); | |||
v3Request.setOpenId(wxOpenId); | |||
v3Request.setPlateNumber(split[0]); | |||
v3Request.setUserName(name); | |||
v3Request.setIdNum(idNum); | |||
AtsVehicleSignV3Response response = jsonPostRepeat(v3Request); | |||
SignQueryResponse signRes = copyProperties(response, new SignQueryResponse()); | |||
signRes.setUserState("UNAUTHORIZED"); | |||
// dataStream.put(RES, signRes); | |||
return signRes; | |||
} | |||
private @NotNull CommonWxSignConfig getCommonWxSignConfig(String productId,Integer version) throws ServiceHandleException { | |||
List<IssueProductPay> issueProductPayList = issueProductPayRepo.findByFeeCategoryAndReleaseId(FeeCategory.PASS, productId); | |||
if (isEmpty(issueProductPayList)){ | |||
logger.error("产品编号{}未配置通行费", productId); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("产品未配置通行费"); | |||
} | |||
String[] split = vehicleId.split("_"); | |||
IssueProductPay issueProductPay = issueProductPayList.get(0); | |||
CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByParentIdAndPayChannelTypeAndVersion(issueProductPay.getPayConfigId(), | |||
PayChannelType.valueOf(issueProductPay.getChargeMethod().name()), 3); | |||
PayChannelType.valueOf(issueProductPay.getChargeMethod().name()), version); | |||
if (signConfig == null) { | |||
logger.error("产品编号{}没有签约配置信息", productId); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("产品没有签约配置信息"); | |||
} | |||
return signConfig; | |||
} | |||
//查询状态 | |||
/** | |||
* 微信V3签约状态查询 | |||
* @param wxOpenId 微信openId | |||
* @param productId 产品编号 | |||
* @param vehicleId 车牌号_颜色 | |||
* @return | |||
* @throws ServiceHandleException | |||
*/ | |||
public SignQueryResponse carSignV3Result(String wxOpenId,String productId,String vehicleId) throws ServiceHandleException { | |||
CommonWxSignConfig signConfig = getCommonWxSignConfig(productId, 3); | |||
String[] split = vehicleId.split("_"); | |||
AtsVehicleSignV3ResultRequest resultRequest = new AtsVehicleSignV3ResultRequest(); | |||
resultRequest.setOpenId(wxOpenId); | |||
resultRequest.setPlateNumber(split[0]); | |||
@@ -110,7 +149,6 @@ public class SignCommonManager extends AbstractCommManager { | |||
resultRequest.setSerialNo(signConfig.getSerialNo()); | |||
resultRequest.setPlanId(signConfig.getPlanId()); | |||
AtsVehicleSignV3ResultResponse resultResponse = jsonPostRepeat(resultRequest); | |||
if ("OPENED".equals(resultResponse.getBindState())) { | |||
QtkVehicleInfo vehicleInfo = vehicleInfoRepo.findByVehicleId(vehicleId); | |||
//已签约 | |||
@@ -118,32 +156,9 @@ public class SignCommonManager extends AbstractCommManager { | |||
vehicleInfoRepo.merge(vehicleInfo); | |||
// dataStream.put(RES, new SignQueryResponse().setUserState(resultResponse.getBindState())); | |||
return new SignQueryResponse().setUserState(resultResponse.getBindState()); | |||
} else { | |||
//没有签约 | |||
AtsVehicleSignV3Request v3Request = new AtsVehicleSignV3Request(); | |||
v3Request.setAppId(signConfig.getAppId()); | |||
v3Request.setMchid(signConfig.getMchId()); | |||
v3Request.setSubMchid(signConfig.getSubMchId()); | |||
v3Request.setSubAppId(signConfig.getSubAppId()); | |||
v3Request.setApiV3Key(signConfig.getSignKey()); | |||
v3Request.setPrivateKey(signConfig.getPrivateKey()); | |||
v3Request.setPublicKeyId(signConfig.getWxPublicKeyId()); | |||
v3Request.setPublicKey(signConfig.getWxPublicKey()); | |||
v3Request.setSerialNo(signConfig.getSerialNo()); | |||
v3Request.setPlanId(signConfig.getPlanId()); | |||
v3Request.setOpenId(wxOpenId); | |||
v3Request.setPlateNumber(split[0]); | |||
v3Request.setUserName(name); | |||
v3Request.setIdNum(idNum); | |||
AtsVehicleSignV3Response response = jsonPostRepeat(v3Request); | |||
SignQueryResponse signRes = copyProperties(response, new SignQueryResponse()); | |||
signRes.setUserState("UNAUTHORIZED"); | |||
// dataStream.put(RES, signRes); | |||
return signRes; | |||
}else { | |||
return new SignQueryResponse().setUserState("UNAUTHORIZED"); | |||
} | |||
} | |||
} |
@@ -73,17 +73,7 @@ public class SignQueryManager extends AbstractOrderManager<SignQueryRequest> { | |||
flag = !"UNAUTHORIZED".equals(res.getUserState()); | |||
break; | |||
case YELLOW: | |||
//单位订单使用经办人的身份证信息 | |||
String name= ""; | |||
String idNum = ""; | |||
if (UserType.PERSONAL_USER.equals(order.getUserType())) { | |||
name = order.getCustomerName(); | |||
idNum = order.getCustomerIdNum(); | |||
}else { | |||
name = order.getAgentName(); | |||
idNum = order.getAgentIdNum(); | |||
} | |||
res = signCommonManager.carSignV3(request.getSubOpenId(), order.getProductId(), order.getVehicleId(), name, idNum); | |||
res = signCommonManager.carSignV3Result(request.getSubOpenId(), order.getProductId(), order.getVehicleId()); | |||
flag = "OPENED".equals(res.getUserState()); | |||
break; | |||
default: |