|
|
@@ -3,15 +3,20 @@ package cn.com.taiji.ias.manager.order; |
|
|
|
import cn.com.taiji.common.manager.net.http.ServiceHandleException; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkVehicleInfo; |
|
|
|
import cn.com.taiji.core.entity.comm.CommonWxSignConfig; |
|
|
|
import cn.com.taiji.core.entity.dict.issue.FeeCategory; |
|
|
|
import cn.com.taiji.core.entity.issue.IssueProductPay; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ats.weiXin.*; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryRequest; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryResponse; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; |
|
|
|
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.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @Author:ChenChao |
|
|
@@ -26,11 +31,23 @@ public class SignCommonManager extends AbstractCommManager { |
|
|
|
private CommonWxSignConfigRepo commonWxSignConfigRepo; |
|
|
|
@Autowired |
|
|
|
protected QtkVehicleInfoRepo vehicleInfoRepo; |
|
|
|
@Autowired |
|
|
|
private IssueProductPayRepo issueProductPayRepo; |
|
|
|
|
|
|
|
|
|
|
|
public SignQueryResponse carSignV2(String wxOpenId, String agencyId,String vehicleId) throws ServiceHandleException { |
|
|
|
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("产品未配置通行费"); |
|
|
|
} |
|
|
|
String[] split = vehicleId.split("_"); |
|
|
|
CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByAgencyIdAndVersion(agencyId, 2); |
|
|
|
// CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByAgencyIdAndVersion(productId, 2); |
|
|
|
CommonWxSignConfig signConfig = commonWxSignConfigRepo.findById(issueProductPayList.get(0).getPayConfigId()).orElse(null); |
|
|
|
if (signConfig == null) { |
|
|
|
logger.error("产品编号{}没有签约配置信息", productId); |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("产品没有签约配置信息"); |
|
|
|
} |
|
|
|
AtsVehicleUserStateRequest request = new AtsVehicleUserStateRequest(); |
|
|
|
request.setAppId(signConfig.getAppId()); |
|
|
|
request.setSubAppId(signConfig.getSubAppId()); |
|
|
@@ -60,10 +77,20 @@ public class SignCommonManager extends AbstractCommManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public SignQueryResponse carSignV3(String wxOpenId,String agencyId,String vehicleId,String name,String idNum) throws ServiceHandleException { |
|
|
|
public SignQueryResponse carSignV3(String wxOpenId,String productId,String vehicleId,String name,String idNum) 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("_"); |
|
|
|
CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByAgencyIdAndVersion(agencyId, 3); |
|
|
|
// CommonWxSignConfig signConfig = commonWxSignConfigRepo.findByAgencyIdAndVersion(agencyId, 3); |
|
|
|
CommonWxSignConfig signConfig = commonWxSignConfigRepo.findById(issueProductPayList.get(0).getPayConfigId()).orElse(null); |
|
|
|
if (signConfig == null) { |
|
|
|
logger.error("产品编号{}没有签约配置信息", productId); |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("产品没有签约配置信息"); |
|
|
|
} |
|
|
|
|
|
|
|
//查询状态 |
|
|
|
AtsVehicleSignV3ResultRequest resultRequest = new AtsVehicleSignV3ResultRequest(); |