@@ -24,6 +24,7 @@ public enum IssueOrderStep { | |||
REFUNDING(15, "退款中"), | |||
REFUNDED(16, "退款成功"), | |||
RETURNED(17, "退货成功"), | |||
RETURNFAILED(18,"拒绝换货") | |||
; | |||
@@ -21,8 +21,8 @@ public class ResignRequest extends AbstractSignTypeRequest<SignQueryResponse> { | |||
} | |||
@NotBlank(message = "wxOpenId不能为空") | |||
String wxOpenId; | |||
@NotBlank(message = "agencyId不能为空") | |||
String agencyId; | |||
@NotBlank(message = "productId不能为空") | |||
String productId; | |||
@NotBlank(message = "vehicleId不能为空") | |||
String vehicleId; | |||
@NotBlank(message = "name不能为空") //v3需要 |
@@ -9,7 +9,7 @@ import java.util.List; | |||
public interface IssueCouponDetailRepo extends AbstractJpaRepo<IssueCouponDetail, String>{ | |||
IssueCouponDetail findByCouponId(String couponId); | |||
List<IssueCouponDetail> findByCouponId(String couponId); | |||
@Query(" from IssueCouponDetail where couponId = ?1 and status = ?2 order by insertTime ") | |||
List<IssueCouponDetail> listByCouponIdAndStatus(String couponId, CouponStatus status); |
@@ -104,7 +104,7 @@ public class ResignManagerImpl extends AbstractCommManager implements ResignMana | |||
AccountInfo accountInfo = findAccountInfoByToken(dto.getAccessToken()); | |||
ResignRequest request = new ResignRequest(); | |||
request.setWxOpenId(dto.getSubOpenId()); | |||
request.setAgencyId(cardInfo.getAgencyId()); | |||
request.setProductId(cardInfo.getPackageId()); | |||
request.setVehicleId(dto.getVehicleId()); | |||
request.setName(accountInfo.getUserName()); | |||
request.setIdNum(accountInfo.getIdNum()); |
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
@@ -18,6 +19,7 @@ import javax.validation.constraints.NotNull; | |||
@Data | |||
public class OrderExamineReqDTO extends AbstractStaffBizRequestDTO { | |||
@NotBlank | |||
@ApiModelProperty("订单编号") | |||
private String orderNo; | |||
@ApiModelProperty(value = "审核状态") |
@@ -79,7 +79,7 @@ public class CouponManagerImpl extends RedisCacheManager implements CouponManage | |||
IssueCouponInfo couponInfo = issueCouponInfoRepo.findById(req.getId()).orElse(null); | |||
if (couponInfo == null) return; | |||
//是否有卡券详情 | |||
IssueCouponDetail byCouponId = issueCouponDetailRepo.findByCouponId(req.getId()); | |||
List<IssueCouponDetail> byCouponId = issueCouponDetailRepo.findByCouponId(req.getId()); | |||
if (byCouponId != null) { | |||
throw new ManagerException("该卡券有详情,不可刪除"); | |||
} |
@@ -454,7 +454,8 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements | |||
} else { | |||
msg = "发行换货申请审核失败"; | |||
//订单状态要变更(恢复原状态) | |||
order.setOrderStep(IssueOrderStep.WAITING_ACTIVE); | |||
order.setOrderStep(IssueOrderStep.RETURNFAILED); | |||
order.setOrderStatus(IssueOrderStatus.FAIL); | |||
// order.setShippingStatus(ShippingStatus.RECEIVED); | |||
//变更更换表 | |||
rechange.setRechangeStatus(RechangeStatus.FAIL); | |||
@@ -476,14 +477,14 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements | |||
*/ | |||
private CarObuDetails checkSendCardObu(String card, String obuId) throws ManagerException { | |||
// 查询卡 临时代码 | |||
// InvwCardDetails cardDetails = invwCardDetailsRepo.findByCardIdAndStatus(card, InvDeviceStatus.NEW); | |||
InvwCardDetails cardDetails = invwCardDetailsRepo.findByCardId(card); | |||
InvwCardDetails cardDetails = invwCardDetailsRepo.findByCardIdAndStatus(card, InvDeviceStatus.NEW); | |||
// InvwCardDetails cardDetails = invwCardDetailsRepo.findByCardId(card); | |||
if (cardDetails == null) { | |||
throw new ManagerException("当前ETC卡不在库存中"); | |||
} | |||
// 查询签 临时 | |||
// InvwObuDetails obuDetails = invwObuDetailsRepo.findByObuIdAndStatus(obuId,InvDeviceStatus.NEW); | |||
InvwObuDetails obuDetails = invwObuDetailsRepo.findByObuId(obuId); | |||
InvwObuDetails obuDetails = invwObuDetailsRepo.findByObuIdAndStatus(obuId,InvDeviceStatus.NEW); | |||
// InvwObuDetails obuDetails = invwObuDetailsRepo.findByObuId(obuId); | |||
if (obuDetails == null) { | |||
throw new ManagerException("当前OBU不在库存中"); | |||
} |
@@ -81,7 +81,8 @@ public class IssueOrderExaminePageRequest extends JpaPageableDataRequest<IssueOr | |||
hql.append(" and promotionModes = :promotionModes", promotionModes); | |||
if (pass == 1){//待领取 | |||
hql.append(" and orderStep = :orderStep", IssueOrderStep.WAITING_AUDIT); | |||
hql.append(" and receiveStatus is null "); | |||
hql.append(" and "); | |||
hql.append("(receiveStatus is null or receiveStatus = 0)"); | |||
} | |||
if (pass == 2){//待审核 | |||
hql.append(" and orderStep = :orderStep", IssueOrderStep.WAITING_AUDIT); | |||
@@ -90,7 +91,7 @@ public class IssueOrderExaminePageRequest extends JpaPageableDataRequest<IssueOr | |||
if (pass == 3){//审核不通过 | |||
hql.append(" and orderStep = :orderStep", IssueOrderStep.AUDIT_FAIL); | |||
} | |||
if (!"MANAGER".equals(identityType)){//不是管理员根据自己的机构查询 | |||
if (!agencyId.equals("52010106004") && !"MANAGER".equals(identityType)){//黔通管理员可以查所有 | |||
hql.append(" and agencyId = :agencyId", agencyId); | |||
} | |||
hql.append(" and insertTime >= :startTime", startTime); |
@@ -96,7 +96,7 @@ public class IssueOrderPageRequest extends JpaPageableDataRequest<IssueOrderinfo | |||
hql.append(" and insertTime <= :endTime", endTime); | |||
hql.append(" and orderStep = :orderStep", orderStep); | |||
hql.append(" and orderStatus = :orderStatus", orderStatus); | |||
if (!"MANAGER".equals(identityType)){//不是管理员根据自己的机构查询 | |||
if (!agencyId.equals("52010106004") && !"MANAGER".equals(identityType)){//黔通管理员可以查所有 | |||
hql.append(" and agencyId = :agencyId", agencyId); | |||
} | |||
return hql; |
@@ -88,7 +88,11 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen | |||
if (StringUtils.isEmpty(dto.getPaymentBankCardId())){ | |||
throw new ManagerException("银行卡退费时付费银行卡号必填!"); | |||
} | |||
//todo 银行卡退费处理 | |||
//todo 银行卡退费处理预留 | |||
}else if (RefundOperateType.CASH.equals(orderRefund.getOperateType())){ | |||
//todo 现金方式预留 | |||
}else { | |||
throw new ManagerException(orderRefund.getOperateType()+"退款方式异常!"); | |||
} | |||
}else if("重新审核".equals(dto.getCensorResult())){ | |||
@@ -181,7 +185,18 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen | |||
} | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
throw new ManagerException("退费申请异常!"); | |||
String errorResponse = e.getMessage(); // 获取异常信息 | |||
// 使用正则表达式提取 message 内容 | |||
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("\"message\":\"([^\"]+)\""); | |||
java.util.regex.Matcher matcher = pattern.matcher(errorResponse); | |||
if (matcher.find()) { | |||
String errorMessage = matcher.group(1); // 提取匹配的内容 | |||
throw new ManagerException(errorMessage); // 返回 "申请退款金额超过订单可退金额" | |||
} else { | |||
throw new ManagerException("未知错误:" + errorResponse); // 如果没有匹配到 message,返回原始错误 | |||
} | |||
} | |||
} | |||
@@ -49,10 +49,11 @@ public class WxSignChannelConfigManagerImpl extends AbstractManager implements W | |||
@Override | |||
public void add(WxCarAddReqDTO reqDto) throws ManagerException { | |||
reqDto.validate(); | |||
CommonWxSignConfig byAgencyId = commonWxSignConfigRepo.findByAgencyIdAndVersion(reqDto.getAgencyId(),reqDto.getVersion()); | |||
if(byAgencyId != null){ | |||
throw new ManagerException("该渠道版本已配置"); | |||
} | |||
//20250731一个渠道可以配置多个 | |||
// CommonWxSignConfig byAgencyId = commonWxSignConfigRepo.findByAgencyIdAndVersion(reqDto.getAgencyId(),reqDto.getVersion()); | |||
// if(byAgencyId != null){ | |||
// throw new ManagerException("该渠道版本已配置"); | |||
// } | |||
CommonWxSignConfig config = copyProperties(reqDto, new CommonWxSignConfig()); | |||
commonWxSignConfigRepo.persist(config); | |||
} |
@@ -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(); |
@@ -69,7 +69,7 @@ public class SignQueryManager extends AbstractOrderManager<SignQueryRequest> { | |||
switch (PlateColorType.valueOfCode(vehiclePlateColor)) { | |||
case BLUE: | |||
case GREEN: | |||
res = signCommonManager.carSignV2(request.getSubOpenId(), order.getAgencyId(), order.getVehicleId()); | |||
res = signCommonManager.carSignV2(request.getSubOpenId(), order.getProductId(), order.getVehicleId()); | |||
flag = !"UNAUTHORIZED".equals(res.getUserState()); | |||
break; | |||
case YELLOW: | |||
@@ -83,7 +83,7 @@ public class SignQueryManager extends AbstractOrderManager<SignQueryRequest> { | |||
name = order.getAgentName(); | |||
idNum = order.getAgentIdNum(); | |||
} | |||
res = signCommonManager.carSignV3(request.getSubOpenId(), order.getAgencyId(), order.getVehicleId(), name, idNum); | |||
res = signCommonManager.carSignV3(request.getSubOpenId(), order.getProductId(), order.getVehicleId(), name, idNum); | |||
flag = "OPENED".equals(res.getUserState()); | |||
break; | |||
default: |