|
@@ -7,11 +7,15 @@ import com.ydtech.modules.protocol.entity.constants.PtlApiType;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
public class InsuranceCompanyPolymerizationServiceImpl implements InsuranceCompanyPolymerizationService {
|
|
public class InsuranceCompanyPolymerizationServiceImpl implements InsuranceCompanyPolymerizationService {
|
|
|
|
|
|
|
|
|
|
+ private final InsAreaCompanyService insAreaCompanyService;
|
|
|
|
|
+
|
|
|
private final InsCrawlerOrderService insCrawlerOrderService;
|
|
private final InsCrawlerOrderService insCrawlerOrderService;
|
|
|
|
|
|
|
|
private final ZijinOrderApiService zijinOrderApiService;
|
|
private final ZijinOrderApiService zijinOrderApiService;
|
|
@@ -32,39 +36,113 @@ public class InsuranceCompanyPolymerizationServiceImpl implements InsuranceCompa
|
|
|
public boolean cancelOrder(InsAreaCompany insAreaCompany) {
|
|
public boolean cancelOrder(InsAreaCompany insAreaCompany) {
|
|
|
Integer apiType = insAreaCompany.getApiType();
|
|
Integer apiType = insAreaCompany.getApiType();
|
|
|
|
|
|
|
|
- if(PtlApiType.PTL_API_2.getCode() == apiType){
|
|
|
|
|
|
|
+ if (PtlApiType.PTL_API_2.getCode() == apiType) {
|
|
|
return insCrawlerOrderService.cancelOrder(insAreaCompany);
|
|
return insCrawlerOrderService.cancelOrder(insAreaCompany);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String companyId = insAreaCompany.getCompanyId();
|
|
String companyId = insAreaCompany.getCompanyId();
|
|
|
String code = companyId.substring(0, 4);
|
|
String code = companyId.substring(0, 4);
|
|
|
// 紫金财险
|
|
// 紫金财险
|
|
|
- if (InsuranceEnum.ZKIC.getCode().equals(code)){
|
|
|
|
|
|
|
+ if (InsuranceEnum.ZKIC.getCode().equals(code)) {
|
|
|
return zijinOrderApiService.cancelOrder(insAreaCompany);
|
|
return zijinOrderApiService.cancelOrder(insAreaCompany);
|
|
|
// 渤海财险
|
|
// 渤海财险
|
|
|
- }else if (InsuranceEnum.BPIC.getCode().equals(code)){
|
|
|
|
|
|
|
+ } else if (InsuranceEnum.BPIC.getCode().equals(code)) {
|
|
|
return boHaiOrderApiService.cancelOrder(insAreaCompany);
|
|
return boHaiOrderApiService.cancelOrder(insAreaCompany);
|
|
|
// 大家财险
|
|
// 大家财险
|
|
|
- }else if (InsuranceEnum.DJPC.getCode().equals(code)){
|
|
|
|
|
|
|
+ } else if (InsuranceEnum.DJPC.getCode().equals(code)) {
|
|
|
return daJiaOrderService.cancelOrder(insAreaCompany);
|
|
return daJiaOrderService.cancelOrder(insAreaCompany);
|
|
|
// 国任财险
|
|
// 国任财险
|
|
|
- }else if(InsuranceEnum.XDCX.getCode().equals(code)){
|
|
|
|
|
|
|
+ } else if (InsuranceEnum.XDCX.getCode().equals(code)) {
|
|
|
return guorenOrderApiService.cancelOrder(insAreaCompany);
|
|
return guorenOrderApiService.cancelOrder(insAreaCompany);
|
|
|
// 华泰财险
|
|
// 华泰财险
|
|
|
- }else if(InsuranceEnum.HTIC.getCode().equals(code)){
|
|
|
|
|
|
|
+ } else if (InsuranceEnum.HTIC.getCode().equals(code)) {
|
|
|
return huaTaiOrderApiService.cancelOrder(insAreaCompany);
|
|
return huaTaiOrderApiService.cancelOrder(insAreaCompany);
|
|
|
// 永诚财险
|
|
// 永诚财险
|
|
|
- }else if(InsuranceEnum.AICS.getCode().equals(code)){
|
|
|
|
|
|
|
+ } else if (InsuranceEnum.AICS.getCode().equals(code)) {
|
|
|
return yongchengOrderApiService.cancelOrder(insAreaCompany);
|
|
return yongchengOrderApiService.cancelOrder(insAreaCompany);
|
|
|
// 中煤财险
|
|
// 中煤财险
|
|
|
- }else if(InsuranceEnum.ZMBX.getCode().equals(code)){
|
|
|
|
|
|
|
+ } else if (InsuranceEnum.ZMBX.getCode().equals(code)) {
|
|
|
return zhongMeiOrderApiService.cancelOrder(insAreaCompany);
|
|
return zhongMeiOrderApiService.cancelOrder(insAreaCompany);
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean updateOrder(InsAreaCompany insAreaCompany) {
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ public void updatePendingUnderwritingOrder(List<String> subOrderNo) {
|
|
|
|
|
+ subOrderNo.forEach(x -> {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(x);
|
|
|
|
|
+ Integer apiType = insAreaCompany.getApiType();
|
|
|
|
|
+ if (PtlApiType.PTL_API_2.getCode() == apiType) {
|
|
|
|
|
+ insCrawlerOrderService.auditStatusQuery(insAreaCompany.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ String companyId = insAreaCompany.getCompanyId();
|
|
|
|
|
+ String code = companyId.substring(0, 4);
|
|
|
|
|
+ // 紫金财险
|
|
|
|
|
+ if (InsuranceEnum.ZKIC.getCode().equals(code)) {
|
|
|
|
|
+ zijinOrderApiService.auditStatusQuery(insAreaCompany.getId());
|
|
|
|
|
+ // 渤海财险
|
|
|
|
|
+ } else if (InsuranceEnum.BPIC.getCode().equals(code)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ boHaiOrderApiService.auditStatusQuery(insAreaCompany.getId());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 大家财险
|
|
|
|
|
+ } else if (InsuranceEnum.DJPC.getCode().equals(code)) {
|
|
|
|
|
+ daJiaOrderService.verifyPayment(insAreaCompany.getId());
|
|
|
|
|
+ // 国任财险
|
|
|
|
|
+ } else if (InsuranceEnum.XDCX.getCode().equals(code)) {
|
|
|
|
|
+ guorenOrderApiService.insOrderInfo(insAreaCompany.getId());
|
|
|
|
|
+ // 华泰财险
|
|
|
|
|
+ } else if (InsuranceEnum.HTIC.getCode().equals(code)) {
|
|
|
|
|
+ huaTaiOrderApiService.auditStatusQuery(insAreaCompany.getId());
|
|
|
|
|
+ // 永诚财险
|
|
|
|
|
+ } else if (InsuranceEnum.AICS.getCode().equals(code)) {
|
|
|
|
|
+ yongchengOrderApiService.callbackAnOrder(insAreaCompany.getId());
|
|
|
|
|
+ // 中煤财险
|
|
|
|
|
+ } else if (InsuranceEnum.ZMBX.getCode().equals(code)) {
|
|
|
|
|
+ zhongMeiOrderApiService.auditStatusQuery(insAreaCompany.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void updateUnderwrittenForPaymentOrder(List<String> subOrderNo) {
|
|
|
|
|
+ subOrderNo.forEach(x -> {
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(x);
|
|
|
|
|
+ Integer apiType = insAreaCompany.getApiType();
|
|
|
|
|
+ if (PtlApiType.PTL_API_2.getCode() == apiType) {
|
|
|
|
|
+ insCrawlerOrderService.verifyPayment(insAreaCompany.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ String companyId = insAreaCompany.getCompanyId();
|
|
|
|
|
+ String code = companyId.substring(0, 4);
|
|
|
|
|
+ // 紫金财险
|
|
|
|
|
+ if (InsuranceEnum.ZKIC.getCode().equals(code)) {
|
|
|
|
|
+ zijinOrderApiService.getOrderDetail(insAreaCompany.getId());
|
|
|
|
|
+ // 渤海财险
|
|
|
|
|
+ } else if (InsuranceEnum.BPIC.getCode().equals(code)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ boHaiOrderApiService.getOrderDetail(insAreaCompany.getId());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 大家财险
|
|
|
|
|
+ } else if (InsuranceEnum.DJPC.getCode().equals(code)) {
|
|
|
|
|
+ daJiaOrderService.verifyPayment(insAreaCompany.getId());
|
|
|
|
|
+ // 国任财险
|
|
|
|
|
+ } else if (InsuranceEnum.XDCX.getCode().equals(code)) {
|
|
|
|
|
+ guorenOrderApiService.insOrderInfo(insAreaCompany.getId());
|
|
|
|
|
+ // 华泰财险
|
|
|
|
|
+ } else if (InsuranceEnum.HTIC.getCode().equals(code)) {
|
|
|
|
|
+ huaTaiOrderApiService.paymentEnquiry(insAreaCompany.getId());
|
|
|
|
|
+ // 永诚财险
|
|
|
|
|
+ } else if (InsuranceEnum.AICS.getCode().equals(code)) {
|
|
|
|
|
+ yongchengOrderApiService.callbackAnOrder(insAreaCompany.getId());
|
|
|
|
|
+ // 中煤财险
|
|
|
|
|
+ } else if (InsuranceEnum.ZMBX.getCode().equals(code)) {
|
|
|
|
|
+ zhongMeiOrderApiService.paymentEnquiry(insAreaCompany.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|