Commit 34f1f802 by wubh

包活干V1.9.0-修改:调整代码结构,删除冗余类

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@27010 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 3e06c87a
Showing 43 changed files with 499 additions and 717 deletions
package com.glsx.ordercenter.dto.common; package com.glsx.common.pojo;
import java.io.Serializable; import java.io.Serializable;
import com.glsx.common.utils.Page; import com.glsx.common.utils.Page;
...@@ -11,7 +11,7 @@ import com.glsx.common.utils.Page; ...@@ -11,7 +11,7 @@ import com.glsx.common.utils.Page;
* @author wbh * @author wbh
* @date 2020-05-22 * @date 2020-05-22
*/ */
public abstract class PagedOrderRequest implements Serializable { public abstract class PagedReq implements Serializable {
/** /**
* 页码 * 页码
*/ */
...@@ -39,7 +39,7 @@ public abstract class PagedOrderRequest implements Serializable { ...@@ -39,7 +39,7 @@ public abstract class PagedOrderRequest implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "PagedOrderRequest{" + return "PagedReq{" +
"pageIndex=" + this.pageIndex + "pageIndex=" + this.pageIndex +
", pageSize=" + this.pageSize + ", pageSize=" + this.pageSize +
'}'; '}';
......
package com.glsx.ordercenter.dto.common; package com.glsx.common.pojo;
import java.util.List; import java.util.List;
import com.glsx.common.utils.Page; import com.glsx.common.utils.Page;
...@@ -11,27 +11,25 @@ import com.glsx.common.utils.Page; ...@@ -11,27 +11,25 @@ import com.glsx.common.utils.Page;
* @author wbh * @author wbh
* @date 2020-05-22 * @date 2020-05-22
*/ */
public class PagedOrderResponse<E> { public class PagedResp<E> {
private Page page; private Page page;
private List<E> items; private List<E> items;
private PagedOrderResponse(Page page, List<E> items) { private PagedResp(Page page, List<E> items) {
this.page = page; this.page = page;
this.items = items; this.items = items;
} }
public static <E> PagedOrderResponse<E> of(long totalCount, PagedOrderRequest pagedOrderRequest, public static <E> PagedResp<E> of(long totalCount, PagedReq orderReq, List<E> list) {
List<E> list) {
Page page = new Page(pagedOrderRequest.getPageIndex(), Page page = new Page(orderReq.getPageIndex(), orderReq.getPageSize());
pagedOrderRequest.getPageSize());
page.setTotalCount((int) totalCount); page.setTotalCount((int) totalCount);
return of(page, list); return of(page, list);
} }
public static <E> PagedOrderResponse<E> of(Page page, List<E> list) { public static <E> PagedResp<E> of(Page page, List<E> list) {
return new PagedOrderResponse<>(page, list); return new PagedResp<>(page, list);
} }
public Page getPage() { public Page getPage() {
...@@ -52,7 +50,7 @@ public class PagedOrderResponse<E> { ...@@ -52,7 +50,7 @@ public class PagedOrderResponse<E> {
@Override @Override
public String toString() { public String toString() {
return "PagedOrderResponse{" + return "PagedResp{" +
"page=" + this.page + "page=" + this.page +
", items=" + this.items + ", items=" + this.items +
'}'; '}';
......
...@@ -131,14 +131,14 @@ public enum ResultCodeEnum { ...@@ -131,14 +131,14 @@ public enum ResultCodeEnum {
/** /**
* 保单-导出数据过多 * 保单-导出数据过多
*/ */
INSURANCE_EXPORT_TO_MANY(1, "保单导出数据量大于5000条,请条件过滤后重新导出"), INSURANCE_ID_NULL(1, "保单ID不能为空"),
INSURANCE_ID_NULL(2, "保单ID不能为空"), INSURANCE_THIRD_ID_NULL(2, "第三方保单号不能为空"),
INSURANCE_ID_NOT_FOUND(3, "无法根据保单ID获取保单数据"), INSURANCE_ID_NOT_FOUND(3, "无法根据保单ID获取保单数据"),
INSURANCE_EXPORT_NOT_SUPPORTED(4, "非页面请求,无法导出保单"), INSURANCE_PDF_NOT_FOUND(4, "无法获取到保单相关的PDF文件"),
INSURANCE_PDF_NOT_FOUND(5, "无法获取到保单相关的PDF文件"), INSURANCE_EXPORT_TO_MANY(5, "保单导出数据量大于5000条,请条件过滤后重新导出"),
INSURANCE_API_FAIL(6, "TSP保险接口异常"), INSURANCE_EXPORT_NOT_SUPPORTED(6, "无法导出保单数据"),
INSURANCE_UPDATE_ERROR(7, "修改保单状态异常"), INSURANCE_API_FAIL(7, "TSP保险接口错误"),
INSURANCE_THIRD_ID_NULL(8, "第三方保单号不能为空"), INSURANCE_UPDATE_ERROR(8, "修改保单信息异常"),
; ;
......
package com.glsx.ordercenter.controller; package com.glsx.ordercenter.controller;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validation; import javax.validation.Validation;
import javax.validation.Validator; import javax.validation.Validator;
...@@ -11,6 +12,7 @@ import java.util.Map; ...@@ -11,6 +12,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import com.glsx.common.constants.ResultCodeEnum; import com.glsx.common.constants.ResultCodeEnum;
import com.glsx.common.constants.ResultObject; import com.glsx.common.constants.ResultObject;
import com.glsx.common.pojo.PagedReq;
import com.glsx.ordercenter.exception.SysException; import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.utils.LogUtils; import com.glsx.ordercenter.utils.LogUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -18,6 +20,8 @@ import org.slf4j.Logger; ...@@ -18,6 +20,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError; import org.springframework.validation.FieldError;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/** /**
* @author zhanghj * @author zhanghj
...@@ -72,8 +76,31 @@ public class BaseController { ...@@ -72,8 +76,31 @@ public class BaseController {
Collection<String> values = errorMap.values(); Collection<String> values = errorMap.values();
String errorMsg = StringUtils.join(values, ";"); String errorMsg = StringUtils.join(values, ";");
throw SysException.create( throw SysException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getCode(), errorMsg); ResultCodeEnum.PARAM_ERROR.getMsg() + ": " + errorMsg);
}
protected <T extends PagedReq> void setPagedInfo(T requestBody) {
ServletRequestAttributes attributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes != null) {
HttpServletRequest request = attributes.getRequest();
String pageIndexStr = request.getParameter("pageIndex");
String pageSizeStr = request.getParameter("pageSize");
if (StringUtils.isNotBlank(pageIndexStr)) {
try {
requestBody.setPageIndex(Integer.parseInt(pageIndexStr));
} catch (NumberFormatException ignored) {}
}
if (StringUtils.isNotBlank(pageSizeStr)) {
try {
requestBody.setPageSize(Integer.parseInt(pageSizeStr));
} catch (NumberFormatException ignored) {}
}
}
} }
protected ResultObject webOk(Object result) { protected ResultObject webOk(Object result) {
......
package com.glsx.ordercenter.controller.insurance; package com.glsx.ordercenter.controller;
import com.glsx.common.constants.ResultObject; import com.glsx.common.constants.ResultObject;
import com.glsx.ordercenter.controller.BaseController; import com.glsx.common.pojo.PagedResp;
import com.glsx.ordercenter.dto.common.PagedOrderResponse; import com.glsx.ordercenter.dto.req.InsuranceReq;
import com.glsx.ordercenter.dto.insurance.*; import com.glsx.ordercenter.dto.resp.InsuranceResp;
import com.glsx.ordercenter.service.insurance.InsuranceService; import com.glsx.ordercenter.service.InsuranceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -28,18 +28,16 @@ public class InsuranceController extends BaseController { ...@@ -28,18 +28,16 @@ public class InsuranceController extends BaseController {
/** /**
* 获取保单列表 * 获取保单列表
* *
* @param insuranceQueryReq 请求体 * @param insuranceReq 请求体
* @return 查询结果 * @return 查询结果
*/ */
@RequestMapping(value = "/getList", method = RequestMethod.POST) @RequestMapping(value = "/getList", method = RequestMethod.POST)
public ResultObject query(@RequestBody InsuranceQueryReq insuranceQueryReq) { public ResultObject query(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("保单列表查询-参数", insuranceQueryReq); super.logInfo("保单列表查询-参数", insuranceReq);
ResultObject resultObject; super.setPagedInfo(insuranceReq);
PagedOrderResponse<InsuranceQueryResp> pagedOrderResponse; PagedResp<InsuranceResp> result = this.insuranceService.query(insuranceReq);
ResultObject resultObject = super.webOk(result);
pagedOrderResponse = this.insuranceService.query(insuranceQueryReq);
resultObject = super.webOk(pagedOrderResponse);
super.logInfo("保单列表查询-结果", resultObject); super.logInfo("保单列表查询-结果", resultObject);
...@@ -49,19 +47,17 @@ public class InsuranceController extends BaseController { ...@@ -49,19 +47,17 @@ public class InsuranceController extends BaseController {
/** /**
* 获取保单详情 * 获取保单详情
* *
* @param insuranceDetailReq 请求体 * @param insuranceReq 请求体
* @return 保单详情 * @return 保单详情
*/ */
//@AuthCheck //@AuthCheck
@RequestMapping(value = "/detail", method = RequestMethod.POST) @RequestMapping(value = "/detail", method = RequestMethod.POST)
public ResultObject detail(@RequestBody InsuranceDetailReq insuranceDetailReq) { public ResultObject detail(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("保单详情查询-参数", insuranceDetailReq); super.logInfo("保单详情查询-参数", insuranceReq);
ResultObject resultObject;
PagedOrderResponse<InsuranceDetailResp> pagedOrderResponse;
pagedOrderResponse = this.insuranceService.detail(insuranceDetailReq); super.setPagedInfo(insuranceReq);
resultObject = super.webOk(pagedOrderResponse); PagedResp<InsuranceResp> result = this.insuranceService.detail(insuranceReq);
ResultObject resultObject = super.webOk(result);
super.logInfo("保单详情查询-结果", resultObject); super.logInfo("保单详情查询-结果", resultObject);
...@@ -71,18 +67,15 @@ public class InsuranceController extends BaseController { ...@@ -71,18 +67,15 @@ public class InsuranceController extends BaseController {
/** /**
* 下载保单PDF * 下载保单PDF
* *
* @param insuranceDetailReq 请求体 * @param insuranceReq 请求体
*/ */
//@AuthCheck //@AuthCheck
@RequestMapping(value = "/download", method = RequestMethod.POST) @RequestMapping(value = "/download", method = RequestMethod.POST)
public ResultObject download(@RequestBody InsuranceDetailReq insuranceDetailReq) { public ResultObject download(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("下载保单-参数", insuranceDetailReq); super.logInfo("下载保单-参数", insuranceReq);
ResultObject resultObject;
InsuranceDetailResp insuranceDetailResp =
this.insuranceService.download(insuranceDetailReq);
resultObject = super.webOk(insuranceDetailResp); InsuranceResp insuranceResp = this.insuranceService.download(insuranceReq);
ResultObject resultObject = super.webOk(insuranceResp);
super.logInfo("下载保单-结果", resultObject); super.logInfo("下载保单-结果", resultObject);
...@@ -92,17 +85,16 @@ public class InsuranceController extends BaseController { ...@@ -92,17 +85,16 @@ public class InsuranceController extends BaseController {
/** /**
* 退保 * 退保
* *
* @param insuranceRefundReq 请求体 * @param insuranceReq 请求体
* @return 退保结果 * @return 退保结果
*/ */
//@AuthCheck //@AuthCheck
@RequestMapping(value = "/refund", method = RequestMethod.POST) @RequestMapping(value = "/refund", method = RequestMethod.POST)
public ResultObject refund(@RequestBody InsuranceRefundReq insuranceRefundReq) { public ResultObject refund(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("退保-参数", insuranceRefundReq); super.logInfo("退保-参数", insuranceReq);
InsuranceRefundResp insuranceRefundResp = InsuranceResp insuranceResp = this.insuranceService.refund(insuranceReq);
this.insuranceService.refund(insuranceRefundReq); ResultObject resultObject = super.webOk(insuranceResp);
ResultObject resultObject = super.webOk(insuranceRefundResp);
super.logInfo("退保-结果", resultObject); super.logInfo("退保-结果", resultObject);
......
...@@ -14,6 +14,7 @@ import java.util.Map; ...@@ -14,6 +14,7 @@ import java.util.Map;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.glsx.common.feign.client.UserClient; import com.glsx.common.feign.client.UserClient;
import com.glsx.common.pojo.PagedResp;
import com.glsx.common.utils.UserUtils; import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.constants.OrderTypeEnum; import com.glsx.ordercenter.constants.OrderTypeEnum;
import com.glsx.ordercenter.constants.ReconciliationStatusEnum; import com.glsx.ordercenter.constants.ReconciliationStatusEnum;
...@@ -29,11 +30,10 @@ import com.glsx.ordercenter.dto.OrderExceptionVO; ...@@ -29,11 +30,10 @@ import com.glsx.ordercenter.dto.OrderExceptionVO;
import com.glsx.ordercenter.dto.QueryOrderReq; import com.glsx.ordercenter.dto.QueryOrderReq;
import com.glsx.ordercenter.dto.ReconciliationDetailQuery; import com.glsx.ordercenter.dto.ReconciliationDetailQuery;
import com.glsx.ordercenter.dto.ReconciliationDetailVO; import com.glsx.ordercenter.dto.ReconciliationDetailVO;
import com.glsx.ordercenter.dto.common.PagedOrderResponse; import com.glsx.ordercenter.dto.req.InsuranceReq;
import com.glsx.ordercenter.dto.insurance.InsuranceQueryReq;
import com.glsx.ordercenter.dto.insurance.InsuranceQueryResp;
import com.glsx.ordercenter.dto.req.ReconciliationListQuery; import com.glsx.ordercenter.dto.req.ReconciliationListQuery;
import com.glsx.ordercenter.dto.resp.ExportReconciliationVo; import com.glsx.ordercenter.dto.resp.ExportReconciliationVo;
import com.glsx.ordercenter.dto.resp.InsuranceResp;
import com.glsx.ordercenter.exception.SysException; import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.pojo.DictionaryData; import com.glsx.ordercenter.pojo.DictionaryData;
import com.glsx.ordercenter.pojo.ExportOrderExceptionVo; import com.glsx.ordercenter.pojo.ExportOrderExceptionVo;
...@@ -50,10 +50,10 @@ import com.glsx.ordercenter.service.IOrderExceptionService; ...@@ -50,10 +50,10 @@ import com.glsx.ordercenter.service.IOrderExceptionService;
import com.glsx.ordercenter.service.IOrderService; import com.glsx.ordercenter.service.IOrderService;
import com.glsx.ordercenter.service.IUnknownOrderService; import com.glsx.ordercenter.service.IUnknownOrderService;
import com.glsx.ordercenter.service.IndentService; import com.glsx.ordercenter.service.IndentService;
import com.glsx.ordercenter.service.InsuranceService;
import com.glsx.ordercenter.service.OperationAdvanceService; import com.glsx.ordercenter.service.OperationAdvanceService;
import com.glsx.ordercenter.service.ReconciliationDetailService; import com.glsx.ordercenter.service.ReconciliationDetailService;
import com.glsx.ordercenter.service.ReconciliationService; import com.glsx.ordercenter.service.ReconciliationService;
import com.glsx.ordercenter.service.insurance.InsuranceService;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -483,18 +483,17 @@ public class ReportController extends BaseReportController { ...@@ -483,18 +483,17 @@ public class ReportController extends BaseReportController {
} }
@RequestMapping(value = "/exportInsurance", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/exportInsurance", method = {RequestMethod.POST, RequestMethod.GET})
public void exportInsurance( InsuranceQueryReq insuranceQueryReq) { public void exportInsurance(InsuranceReq insuranceReq) {
this.logger.info("保单导出-参数: {}", JSON.toJSONString(insuranceQueryReq)); this.logger.info("保单导出-参数: {}", JSON.toJSONString(insuranceReq));
ServletRequestAttributes attributes = ServletRequestAttributes attributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
insuranceQueryReq.setPageIndex(-1); insuranceReq.setPageIndex(null);
insuranceQueryReq.setPageSize(-1); insuranceReq.setPageSize(null);
PagedOrderResponse<InsuranceQueryResp> pagedOrderResponse = PagedResp<InsuranceResp> pagedResp = this.insuranceService.query(insuranceReq);
this.insuranceService.query(insuranceQueryReq);
if (pagedOrderResponse.getItems().size() > 5000) { if (pagedResp.getItems().size() > 5000) {
throw SysException.create( throw SysException.create(
ResultCodeEnum.INSURANCE_EXPORT_TO_MANY.getCode(), ResultCodeEnum.INSURANCE_EXPORT_TO_MANY.getCode(),
ResultCodeEnum.INSURANCE_EXPORT_TO_MANY.getMsg()); ResultCodeEnum.INSURANCE_EXPORT_TO_MANY.getMsg());
...@@ -503,8 +502,8 @@ public class ReportController extends BaseReportController { ...@@ -503,8 +502,8 @@ public class ReportController extends BaseReportController {
try { try {
if (attributes != null && attributes.getResponse() != null) { if (attributes != null && attributes.getResponse() != null) {
String title = "保单详情-" + String title = "保单详情-" +
DateTimeFormatter.ofPattern("yyyy-MM-dd_HH_mm_ss").format(LocalDateTime.now()); DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss").format(LocalDateTime.now());
this.exportObject(attributes.getResponse(), pagedOrderResponse.getItems(), title); this.exportObject(attributes.getResponse(), pagedResp.getItems(), title);
} else { } else {
throw new IOException(ResultCodeEnum.INSURANCE_EXPORT_NOT_SUPPORTED.getMsg()); throw new IOException(ResultCodeEnum.INSURANCE_EXPORT_NOT_SUPPORTED.getMsg());
} }
......
package com.glsx.ordercenter.controller.api;
import com.glsx.ordercenter.constants.insurance.OraResultCode;
import com.glsx.ordercenter.controller.BaseController;
import com.glsx.ordercenter.dto.api.OraBaseResponse;
import com.glsx.ordercenter.exception.insurance.OraBizException;
import org.springframework.validation.BindingResult;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-27
*/
public abstract class OraBaseController extends BaseController {
@Override
protected void checkRequestParam(BindingResult bindingResult) {
try {
super.checkRequestParam(bindingResult);
} catch (RuntimeException e) {
throw new OraBizException(OraResultCode.PARAM_ERROR, e.getMessage());
}
}
protected <T extends OraBaseResponse> T oraWebOops(Throwable t, T baseResponse) {
super.logError("长城欧拉Controller异常", t);
baseResponse.setCode(OraResultCode.SERVER_ERROR.getCode());
baseResponse.setMessage(OraResultCode.SERVER_ERROR.getMessage());
return baseResponse;
}
protected <T extends OraBaseResponse> T oraWebOops(OraResultCode code, Throwable t,
T baseResponse) {
super.logError("长城欧拉Controller异常", t);
baseResponse.setCode(code.getCode());
baseResponse.setMessage(t.getMessage());
return baseResponse;
}
}
package com.glsx.ordercenter.controller.api; package com.glsx.ordercenter.controller.api;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundReq; import com.glsx.common.constants.ResultObject;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundResp; import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateReq; import com.glsx.ordercenter.controller.BaseController;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateResp; import com.glsx.ordercenter.dto.req.OraInsuranceRefundReq;
import com.glsx.ordercenter.exception.insurance.OraBizException; import com.glsx.ordercenter.dto.req.OraInsuranceUpdateReq;
import com.glsx.ordercenter.dto.resp.OraResultObject;
import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.service.api.OraInsuranceService; import com.glsx.ordercenter.service.api.OraInsuranceService;
import com.glsx.ordercenter.utils.OraSignUtil; import com.glsx.ordercenter.utils.OraSignUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -26,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -26,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("/api/insurance") @RequestMapping("/api/insurance")
public class OraInsuranceController extends OraBaseController { public class OraInsuranceController extends BaseController {
@Value("${ora.api.url}") @Value("${ora.api.url}")
private String serverUrl; private String serverUrl;
...@@ -40,40 +42,48 @@ public class OraInsuranceController extends OraBaseController { ...@@ -40,40 +42,48 @@ public class OraInsuranceController extends OraBaseController {
private OraInsuranceService oraInsuranceService; private OraInsuranceService oraInsuranceService;
@RequestMapping(value = "/update", method = RequestMethod.POST) @RequestMapping(value = "/update", method = RequestMethod.POST)
public OraInsuranceUpdateResp update( public OraResultObject update(@Validated @RequestBody OraInsuranceUpdateReq updateReq,
@Validated @RequestBody OraInsuranceUpdateReq insuranceUpdateReq, BindingResult bindingResult) {
BindingResult bindingResult) {
super.logInfo("长城欧拉修改保单-参数", insuranceUpdateReq); super.logInfo("长城欧拉修改保单-参数", updateReq);
OraInsuranceUpdateResp insuranceUpdateResp; OraResultObject resultObject;
try { try {
OraSignUtil.verifyRequest(this.appKey, this.appSecret, updateReq);
super.checkRequestParam(bindingResult); super.checkRequestParam(bindingResult);
insuranceUpdateResp = this.oraInsuranceService.update(insuranceUpdateReq); resultObject = this.oraInsuranceService.update(updateReq);
} catch (OraBizException e) { } catch (SysException e) {
insuranceUpdateResp = super.oraWebOops(e.getCode(), e, new OraInsuranceUpdateResp()); super.logError("长城欧拉修改保单-异常", e);
ResultObject result = e.getResultEntity();
resultObject = new OraResultObject(result.getCode(), result.getMessage());
} catch (RuntimeException e) { } catch (RuntimeException e) {
insuranceUpdateResp = super.oraWebOops(e, new OraInsuranceUpdateResp()); super.logError("长城欧拉修改保单-异常", e);
resultObject = new OraResultObject(ResultCodeEnum.ERROR);
} }
super.logInfo("长城欧拉修改保单-结果", insuranceUpdateResp);
return insuranceUpdateResp; super.logInfo("长城欧拉修改保单-结果", resultObject);
return resultObject;
} }
@RequestMapping(value = "/refund", method = RequestMethod.POST) @RequestMapping(value = "/refund", method = RequestMethod.POST)
public OraInsuranceRefundResp refund( public OraResultObject refund(@Validated @RequestBody OraInsuranceRefundReq refundReq,
@Validated @RequestBody OraInsuranceRefundReq insuranceRefundReq, BindingResult bindingResult) {
BindingResult bindingResult) { super.logInfo("长城欧拉退保-参数", refundReq);
super.logInfo("长城欧拉退保-参数", insuranceRefundReq); OraResultObject resultObject;
OraInsuranceRefundResp insuranceRefundResp;
try { try {
OraSignUtil.verifyRequest(this.appKey, this.appSecret, OraSignUtil.verifyRequest(this.appKey, this.appSecret, refundReq);
insuranceRefundReq);
super.checkRequestParam(bindingResult); super.checkRequestParam(bindingResult);
insuranceRefundResp = this.oraInsuranceService.refund(insuranceRefundReq); resultObject = this.oraInsuranceService.refund(refundReq);
} catch (OraBizException e) { } catch (SysException e) {
insuranceRefundResp = super.oraWebOops(e.getCode(), e, new OraInsuranceRefundResp()); super.logError("长城欧拉修改保单-异常", e);
ResultObject result = e.getResultEntity();
resultObject = new OraResultObject(result.getCode(), result.getMessage());
} catch (RuntimeException e) { } catch (RuntimeException e) {
insuranceRefundResp = super.oraWebOops(e, new OraInsuranceRefundResp()); super.logError("长城欧拉修改保单-异常", e);
resultObject = new OraResultObject(ResultCodeEnum.ERROR);
} }
super.logInfo("长城欧拉退保-结果", insuranceRefundResp); super.logInfo("长城欧拉退保-结果", resultObject);
return insuranceRefundResp; return resultObject;
} }
} }
package com.glsx.ordercenter.dto.api;
import java.io.Serializable;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
public class OraBaseRequest implements Serializable {
}
package com.glsx.ordercenter.dto.api;
import java.io.Serializable;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
public class OraBaseResponse implements Serializable {
/**
* 状态码
*/
private Integer code;
/**
* 信息
*/
private String message;
public Integer getCode() {
return this.code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "OraBaseResponse{" +
"code=" + this.code +
", message='" + this.message + '\'' +
'}';
}
}
package com.glsx.ordercenter.dto.api;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
public class OraInsuranceRefundResp extends OraBaseResponse {
/**
* 保单ID
*/
private String insuranceId;
public String getInsuranceId() {
return this.insuranceId;
}
public void setInsuranceId(String insuranceId) {
this.insuranceId = insuranceId;
}
@Override
public String toString() {
return "OraInsuranceRefundResp{" +
"insuranceId='" + this.insuranceId + '\'' +
"} " + super.toString();
}
}
package com.glsx.ordercenter.dto.api;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
public class OraInsuranceUpdateResp extends OraBaseResponse {
/**
* 保单ID
*/
private String insuranceId;
public String getInsuranceId() {
return this.insuranceId;
}
public void setInsuranceId(String insuranceId) {
this.insuranceId = insuranceId;
}
@Override
public String toString() {
return "OraInsuranceUpdateResp{" +
"insuranceId='" + this.insuranceId + '\'' +
"} " + super.toString();
}
}
package com.glsx.ordercenter.dto.insurance;
/**
* <p>Description: 保单详情请求体
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-22
*/
public class InsuranceDetailReq extends InsuranceQueryReq {
}
package com.glsx.ordercenter.dto.insurance;
/**
* <p>Description: 保单详情响应体
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-22
*/
public class InsuranceDetailResp extends InsuranceQueryResp {
/**
* 客户类型
*/
private Byte customerType;
/**
* 联系地址
*/
private String vehicleOwnerAddress;
/**
* 车辆颜色
*/
private String vehicleColor;
/**
* PDF地址
*/
private String insurancePdf;
public Byte getCustomerType() {
return this.customerType;
}
public void setCustomerType(Byte customerType) {
this.customerType = customerType;
}
public String getVehicleOwnerAddress() {
return this.vehicleOwnerAddress;
}
public void setVehicleOwnerAddress(String vehicleOwnerAddress) {
this.vehicleOwnerAddress = vehicleOwnerAddress;
}
public String getVehicleColor() {
return this.vehicleColor;
}
public void setVehicleColor(String vehicleColor) {
this.vehicleColor = vehicleColor;
}
public String getInsurancePdf() {
return this.insurancePdf;
}
public void setInsurancePdf(String insurancePdf) {
this.insurancePdf = insurancePdf;
}
@Override
public String toString() {
return "InsuranceDetailResp{" +
"customerType=" + this.customerType +
", vehicleOwnerAddress='" + this.vehicleOwnerAddress + '\'' +
", vehicleColor='" + this.vehicleColor + '\'' +
", insurancePdf='" + this.insurancePdf + '\'' +
"} " + super.toString();
}
}
package com.glsx.ordercenter.dto.insurance;
import com.glsx.ordercenter.dto.common.PagedOrderRequest;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
public class InsuranceRefundReq extends PagedOrderRequest {
/**
* 保单ID
*/
private Integer id;
/**
* 第三方保单ID
*/
private String insuranceId;
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getInsuranceId() {
return this.insuranceId;
}
public void setInsuranceId(String insuranceId) {
this.insuranceId = insuranceId;
}
@Override
public String toString() {
return "InsuranceRefundReq{" +
"id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' +
"} " + super.toString();
}
}
package com.glsx.ordercenter.dto.insurance;
import java.io.Serializable;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
public class InsuranceRefundResp implements Serializable {
}
package com.glsx.ordercenter.dto.insurance; package com.glsx.ordercenter.dto.req;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.glsx.ordercenter.dto.common.PagedOrderRequest; import com.glsx.common.pojo.PagedReq;
/** /**
* <p>Description: 保单列表请求体 * <p>Description: 保单相关请求体
* *
* <p>Project: car-service * <p>Project: car-service
* *
* @author wbh * @author wbh
* @date 2020-05-22 * @date 2020-05-22
*/ */
public class InsuranceQueryReq extends PagedOrderRequest { public class InsuranceReq extends PagedReq {
/** /**
* 保单ID * 保单ID
*/ */
...@@ -144,7 +144,7 @@ public class InsuranceQueryReq extends PagedOrderRequest { ...@@ -144,7 +144,7 @@ public class InsuranceQueryReq extends PagedOrderRequest {
@Override @Override
public String toString() { public String toString() {
return "InsuranceQueryReq{" + return "InsuranceReq{" +
"id=" + this.id + "id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' + ", insuranceId='" + this.insuranceId + '\'' +
", vehicleOwnerName='" + this.vehicleOwnerName + '\'' + ", vehicleOwnerName='" + this.vehicleOwnerName + '\'' +
......
package com.glsx.ordercenter.dto.api; package com.glsx.ordercenter.dto.req;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/** /**
* <p>Description: * <p>Description:
...@@ -10,7 +11,7 @@ import javax.validation.constraints.NotBlank; ...@@ -10,7 +11,7 @@ import javax.validation.constraints.NotBlank;
* @author wbh * @author wbh
* @date 2020-05-25 * @date 2020-05-25
*/ */
public class OraInsuranceRefundReq extends OraBaseRequest { public class OraInsuranceRefundReq implements Serializable {
/** /**
* 聚合保单ID(唯一不变值) * 聚合保单ID(唯一不变值)
*/ */
...@@ -43,6 +44,6 @@ public class OraInsuranceRefundReq extends OraBaseRequest { ...@@ -43,6 +44,6 @@ public class OraInsuranceRefundReq extends OraBaseRequest {
return "OraInsuranceRefundReq{" + return "OraInsuranceRefundReq{" +
"insuranceId='" + this.insuranceId + '\'' + "insuranceId='" + this.insuranceId + '\'' +
", reason='" + this.reason + '\'' + ", reason='" + this.reason + '\'' +
"} " + super.toString(); '}';
} }
} }
package com.glsx.ordercenter.dto.api; package com.glsx.ordercenter.dto.req;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable;
/** /**
* <p>Description: * <p>Description:
...@@ -11,7 +12,7 @@ import javax.validation.constraints.NotNull; ...@@ -11,7 +12,7 @@ import javax.validation.constraints.NotNull;
* @author wbh * @author wbh
* @date 2020-05-25 * @date 2020-05-25
*/ */
public class OraInsuranceUpdateReq extends OraBaseRequest { public class OraInsuranceUpdateReq implements Serializable {
/** /**
* 聚合保单ID(唯一不变值) * 聚合保单ID(唯一不变值)
*/ */
...@@ -303,6 +304,6 @@ public class OraInsuranceUpdateReq extends OraBaseRequest { ...@@ -303,6 +304,6 @@ public class OraInsuranceUpdateReq extends OraBaseRequest {
", tastingUnit='" + this.tastingUnit + '\'' + ", tastingUnit='" + this.tastingUnit + '\'' +
", customerId=" + this.customerId + ", customerId=" + this.customerId +
", registrationDate='" + this.registrationDate + '\'' + ", registrationDate='" + this.registrationDate + '\'' +
"} " + super.toString(); '}';
} }
} }
package com.glsx.ordercenter.dto.insurance; package com.glsx.ordercenter.dto.req;
import java.io.Serializable; import java.io.Serializable;
......
package com.glsx.ordercenter.dto.insurance; package com.glsx.ordercenter.dto.req;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -74,7 +74,7 @@ public class TspSaveReq implements Serializable { ...@@ -74,7 +74,7 @@ public class TspSaveReq implements Serializable {
private Long sumPremium; private Long sumPremium;
public Long getSumPremium() { public Long getSumPremium() {
return sumPremium; return this.sumPremium;
} }
public void setSumPremium(Long sumPremium) { public void setSumPremium(Long sumPremium) {
...@@ -82,7 +82,7 @@ public class TspSaveReq implements Serializable { ...@@ -82,7 +82,7 @@ public class TspSaveReq implements Serializable {
} }
public String getInsuranceCompany() { public String getInsuranceCompany() {
return insuranceCompany; return this.insuranceCompany;
} }
public void setInsuranceCompany(String insuranceCompany) { public void setInsuranceCompany(String insuranceCompany) {
...@@ -90,7 +90,7 @@ public class TspSaveReq implements Serializable { ...@@ -90,7 +90,7 @@ public class TspSaveReq implements Serializable {
} }
public String getSeqNo() { public String getSeqNo() {
return seqNo; return this.seqNo;
} }
public void setSeqNo(String seqNo) { public void setSeqNo(String seqNo) {
...@@ -98,7 +98,7 @@ public class TspSaveReq implements Serializable { ...@@ -98,7 +98,7 @@ public class TspSaveReq implements Serializable {
} }
public String getCompensationName() { public String getCompensationName() {
return compensationName; return this.compensationName;
} }
public void setCompensationName(String compensationName) { public void setCompensationName(String compensationName) {
...@@ -106,7 +106,7 @@ public class TspSaveReq implements Serializable { ...@@ -106,7 +106,7 @@ public class TspSaveReq implements Serializable {
} }
public String getAddress() { public String getAddress() {
return address; return this.address;
} }
public void setAddress(String address) { public void setAddress(String address) {
...@@ -114,7 +114,7 @@ public class TspSaveReq implements Serializable { ...@@ -114,7 +114,7 @@ public class TspSaveReq implements Serializable {
} }
public String getCustomerType() { public String getCustomerType() {
return customerType; return this.customerType;
} }
public void setCustomerType(String customerType) { public void setCustomerType(String customerType) {
...@@ -122,7 +122,7 @@ public class TspSaveReq implements Serializable { ...@@ -122,7 +122,7 @@ public class TspSaveReq implements Serializable {
} }
public String getCardType() { public String getCardType() {
return cardType; return this.cardType;
} }
public void setCardType(String cardType) { public void setCardType(String cardType) {
...@@ -130,7 +130,7 @@ public class TspSaveReq implements Serializable { ...@@ -130,7 +130,7 @@ public class TspSaveReq implements Serializable {
} }
public String getCardNo() { public String getCardNo() {
return cardNo; return this.cardNo;
} }
public void setCardNo(String cardNo) { public void setCardNo(String cardNo) {
...@@ -138,7 +138,7 @@ public class TspSaveReq implements Serializable { ...@@ -138,7 +138,7 @@ public class TspSaveReq implements Serializable {
} }
public String getName() { public String getName() {
return name; return this.name;
} }
public void setName(String name) { public void setName(String name) {
...@@ -146,7 +146,7 @@ public class TspSaveReq implements Serializable { ...@@ -146,7 +146,7 @@ public class TspSaveReq implements Serializable {
} }
public String getPhone() { public String getPhone() {
return phone; return this.phone;
} }
public void setPhone(String phone) { public void setPhone(String phone) {
...@@ -154,7 +154,7 @@ public class TspSaveReq implements Serializable { ...@@ -154,7 +154,7 @@ public class TspSaveReq implements Serializable {
} }
public String getEffectDate() { public String getEffectDate() {
return effectDate; return this.effectDate;
} }
public void setEffectDate(String effectDate) { public void setEffectDate(String effectDate) {
...@@ -162,7 +162,7 @@ public class TspSaveReq implements Serializable { ...@@ -162,7 +162,7 @@ public class TspSaveReq implements Serializable {
} }
public String getInsurePeriod() { public String getInsurePeriod() {
return insurePeriod; return this.insurePeriod;
} }
public void setInsurePeriod(String insurePeriod) { public void setInsurePeriod(String insurePeriod) {
...@@ -170,7 +170,7 @@ public class TspSaveReq implements Serializable { ...@@ -170,7 +170,7 @@ public class TspSaveReq implements Serializable {
} }
public String getSumAmount() { public String getSumAmount() {
return sumAmount; return this.sumAmount;
} }
public void setSumAmount(String sumAmount) { public void setSumAmount(String sumAmount) {
...@@ -178,7 +178,7 @@ public class TspSaveReq implements Serializable { ...@@ -178,7 +178,7 @@ public class TspSaveReq implements Serializable {
} }
public String getStandNo() { public String getStandNo() {
return standNo; return this.standNo;
} }
public void setStandNo(String standNo) { public void setStandNo(String standNo) {
...@@ -186,7 +186,7 @@ public class TspSaveReq implements Serializable { ...@@ -186,7 +186,7 @@ public class TspSaveReq implements Serializable {
} }
public String getEngine() { public String getEngine() {
return engine; return this.engine;
} }
public void setEngine(String engine) { public void setEngine(String engine) {
...@@ -194,7 +194,7 @@ public class TspSaveReq implements Serializable { ...@@ -194,7 +194,7 @@ public class TspSaveReq implements Serializable {
} }
public String getBuyType() { public String getBuyType() {
return buyType; return this.buyType;
} }
public void setBuyType(String buyType) { public void setBuyType(String buyType) {
...@@ -202,7 +202,7 @@ public class TspSaveReq implements Serializable { ...@@ -202,7 +202,7 @@ public class TspSaveReq implements Serializable {
} }
public String getVehicleColor() { public String getVehicleColor() {
return vehicleColor; return this.vehicleColor;
} }
public void setVehicleColor(String vehicleColor) { public void setVehicleColor(String vehicleColor) {
...@@ -210,7 +210,7 @@ public class TspSaveReq implements Serializable { ...@@ -210,7 +210,7 @@ public class TspSaveReq implements Serializable {
} }
public String getVehicleBrand() { public String getVehicleBrand() {
return vehicleBrand; return this.vehicleBrand;
} }
public void setVehicleBrand(String vehicleBrand) { public void setVehicleBrand(String vehicleBrand) {
...@@ -218,7 +218,7 @@ public class TspSaveReq implements Serializable { ...@@ -218,7 +218,7 @@ public class TspSaveReq implements Serializable {
} }
public String getVehicleChildsBrandName() { public String getVehicleChildsBrandName() {
return vehicleChildsBrandName; return this.vehicleChildsBrandName;
} }
public void setVehicleChildsBrandName(String vehicleChildsBrandName) { public void setVehicleChildsBrandName(String vehicleChildsBrandName) {
...@@ -226,7 +226,7 @@ public class TspSaveReq implements Serializable { ...@@ -226,7 +226,7 @@ public class TspSaveReq implements Serializable {
} }
public String getVehicleSeriesName() { public String getVehicleSeriesName() {
return vehicleSeriesName; return this.vehicleSeriesName;
} }
public void setVehicleSeriesName(String vehicleSeriesName) { public void setVehicleSeriesName(String vehicleSeriesName) {
...@@ -234,7 +234,7 @@ public class TspSaveReq implements Serializable { ...@@ -234,7 +234,7 @@ public class TspSaveReq implements Serializable {
} }
public BigDecimal getVehiclePrice() { public BigDecimal getVehiclePrice() {
return vehiclePrice; return this.vehiclePrice;
} }
public void setVehiclePrice(BigDecimal vehiclePrice) { public void setVehiclePrice(BigDecimal vehiclePrice) {
...@@ -242,7 +242,7 @@ public class TspSaveReq implements Serializable { ...@@ -242,7 +242,7 @@ public class TspSaveReq implements Serializable {
} }
public String getVehicleUsage() { public String getVehicleUsage() {
return vehicleUsage; return this.vehicleUsage;
} }
public void setVehicleUsage(String vehicleUsage) { public void setVehicleUsage(String vehicleUsage) {
...@@ -250,7 +250,7 @@ public class TspSaveReq implements Serializable { ...@@ -250,7 +250,7 @@ public class TspSaveReq implements Serializable {
} }
public String getPlanNo() { public String getPlanNo() {
return planNo; return this.planNo;
} }
public void setPlanNo(String planNo) { public void setPlanNo(String planNo) {
...@@ -258,7 +258,7 @@ public class TspSaveReq implements Serializable { ...@@ -258,7 +258,7 @@ public class TspSaveReq implements Serializable {
} }
public String getBirthday() { public String getBirthday() {
return birthday; return this.birthday;
} }
public void setBirthday(String birthday) { public void setBirthday(String birthday) {
...@@ -266,7 +266,7 @@ public class TspSaveReq implements Serializable { ...@@ -266,7 +266,7 @@ public class TspSaveReq implements Serializable {
} }
public String getSex() { public String getSex() {
return sex; return this.sex;
} }
public void setSex(String sex) { public void setSex(String sex) {
...@@ -274,7 +274,7 @@ public class TspSaveReq implements Serializable { ...@@ -274,7 +274,7 @@ public class TspSaveReq implements Serializable {
} }
public String getInstallPoint() { public String getInstallPoint() {
return installPoint; return this.installPoint;
} }
public void setInstallPoint(String installPoint) { public void setInstallPoint(String installPoint) {
...@@ -282,7 +282,7 @@ public class TspSaveReq implements Serializable { ...@@ -282,7 +282,7 @@ public class TspSaveReq implements Serializable {
} }
public String getInstallPerson() { public String getInstallPerson() {
return installPerson; return this.installPerson;
} }
public void setInstallPerson(String installPerson) { public void setInstallPerson(String installPerson) {
...@@ -290,7 +290,7 @@ public class TspSaveReq implements Serializable { ...@@ -290,7 +290,7 @@ public class TspSaveReq implements Serializable {
} }
public String getSpid() { public String getSpid() {
return spid; return this.spid;
} }
public void setSpid(String spid) { public void setSpid(String spid) {
...@@ -298,7 +298,7 @@ public class TspSaveReq implements Serializable { ...@@ -298,7 +298,7 @@ public class TspSaveReq implements Serializable {
} }
public String getSpecialContent() { public String getSpecialContent() {
return specialContent; return this.specialContent;
} }
public void setSpecialContent(String specialContent) { public void setSpecialContent(String specialContent) {
...@@ -306,7 +306,7 @@ public class TspSaveReq implements Serializable { ...@@ -306,7 +306,7 @@ public class TspSaveReq implements Serializable {
} }
public String getDeviceName() { public String getDeviceName() {
return deviceName; return this.deviceName;
} }
public void setDeviceName(String deviceName) { public void setDeviceName(String deviceName) {
...@@ -314,7 +314,7 @@ public class TspSaveReq implements Serializable { ...@@ -314,7 +314,7 @@ public class TspSaveReq implements Serializable {
} }
public String getProductType() { public String getProductType() {
return productType; return this.productType;
} }
public void setProductType(String productType) { public void setProductType(String productType) {
...@@ -322,7 +322,7 @@ public class TspSaveReq implements Serializable { ...@@ -322,7 +322,7 @@ public class TspSaveReq implements Serializable {
} }
public String getDeviceType() { public String getDeviceType() {
return deviceType; return this.deviceType;
} }
public void setDeviceType(String deviceType) { public void setDeviceType(String deviceType) {
...@@ -330,7 +330,7 @@ public class TspSaveReq implements Serializable { ...@@ -330,7 +330,7 @@ public class TspSaveReq implements Serializable {
} }
public String getSn() { public String getSn() {
return sn; return this.sn;
} }
public void setSn(String sn) { public void setSn(String sn) {
...@@ -338,7 +338,7 @@ public class TspSaveReq implements Serializable { ...@@ -338,7 +338,7 @@ public class TspSaveReq implements Serializable {
} }
public String getActiveDate() { public String getActiveDate() {
return activeDate; return this.activeDate;
} }
public void setActiveDate(String activeDate) { public void setActiveDate(String activeDate) {
...@@ -346,7 +346,7 @@ public class TspSaveReq implements Serializable { ...@@ -346,7 +346,7 @@ public class TspSaveReq implements Serializable {
} }
public String getPlateNum() { public String getPlateNum() {
return plateNum; return this.plateNum;
} }
public void setPlateNum(String plateNum) { public void setPlateNum(String plateNum) {
...@@ -354,7 +354,7 @@ public class TspSaveReq implements Serializable { ...@@ -354,7 +354,7 @@ public class TspSaveReq implements Serializable {
} }
public String getVehicleTypeName() { public String getVehicleTypeName() {
return vehicleTypeName; return this.vehicleTypeName;
} }
public void setVehicleTypeName(String vehicleTypeName) { public void setVehicleTypeName(String vehicleTypeName) {
...@@ -362,7 +362,7 @@ public class TspSaveReq implements Serializable { ...@@ -362,7 +362,7 @@ public class TspSaveReq implements Serializable {
} }
public String getShopName() { public String getShopName() {
return shopName; return this.shopName;
} }
public void setShopName(String shopName) { public void setShopName(String shopName) {
...@@ -370,7 +370,7 @@ public class TspSaveReq implements Serializable { ...@@ -370,7 +370,7 @@ public class TspSaveReq implements Serializable {
} }
public String getFixTime() { public String getFixTime() {
return fixTime; return this.fixTime;
} }
public void setFixTime(String fixTime) { public void setFixTime(String fixTime) {
......
package com.glsx.ordercenter.dto.insurance; package com.glsx.ordercenter.dto.req;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -62,7 +62,7 @@ public class TspUpdateReq implements Serializable { ...@@ -62,7 +62,7 @@ public class TspUpdateReq implements Serializable {
private Long sumPremium; private Long sumPremium;
public Long getSumPremium() { public Long getSumPremium() {
return sumPremium; return this.sumPremium;
} }
public void setSumPremium(Long sumPremium) { public void setSumPremium(Long sumPremium) {
...@@ -70,7 +70,7 @@ public class TspUpdateReq implements Serializable { ...@@ -70,7 +70,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getInsuranceCompany() { public String getInsuranceCompany() {
return insuranceCompany; return this.insuranceCompany;
} }
public void setInsuranceCompany(String insuranceCompany) { public void setInsuranceCompany(String insuranceCompany) {
...@@ -78,7 +78,7 @@ public class TspUpdateReq implements Serializable { ...@@ -78,7 +78,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getFullInsuranceNo() { public String getFullInsuranceNo() {
return fullInsuranceNo; return this.fullInsuranceNo;
} }
public void setFullInsuranceNo(String fullInsuranceNo) { public void setFullInsuranceNo(String fullInsuranceNo) {
...@@ -86,7 +86,7 @@ public class TspUpdateReq implements Serializable { ...@@ -86,7 +86,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getSeqNo() { public String getSeqNo() {
return seqNo; return this.seqNo;
} }
public void setSeqNo(String seqNo) { public void setSeqNo(String seqNo) {
...@@ -94,7 +94,7 @@ public class TspUpdateReq implements Serializable { ...@@ -94,7 +94,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getCompensationName() { public String getCompensationName() {
return compensationName; return this.compensationName;
} }
public void setCompensationName(String compensationName) { public void setCompensationName(String compensationName) {
...@@ -102,7 +102,7 @@ public class TspUpdateReq implements Serializable { ...@@ -102,7 +102,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getAddress() { public String getAddress() {
return address; return this.address;
} }
public void setAddress(String address) { public void setAddress(String address) {
...@@ -110,7 +110,7 @@ public class TspUpdateReq implements Serializable { ...@@ -110,7 +110,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getCustomerType() { public String getCustomerType() {
return customerType; return this.customerType;
} }
public void setCustomerType(String customerType) { public void setCustomerType(String customerType) {
...@@ -118,7 +118,7 @@ public class TspUpdateReq implements Serializable { ...@@ -118,7 +118,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getCardType() { public String getCardType() {
return cardType; return this.cardType;
} }
public void setCardType(String cardType) { public void setCardType(String cardType) {
...@@ -126,7 +126,7 @@ public class TspUpdateReq implements Serializable { ...@@ -126,7 +126,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getBirthday() { public String getBirthday() {
return birthday; return this.birthday;
} }
public void setBirthday(String birthday) { public void setBirthday(String birthday) {
...@@ -134,7 +134,7 @@ public class TspUpdateReq implements Serializable { ...@@ -134,7 +134,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getCardNo() { public String getCardNo() {
return cardNo; return this.cardNo;
} }
public void setCardNo(String cardNo) { public void setCardNo(String cardNo) {
...@@ -142,7 +142,7 @@ public class TspUpdateReq implements Serializable { ...@@ -142,7 +142,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getName() { public String getName() {
return name; return this.name;
} }
public void setName(String name) { public void setName(String name) {
...@@ -150,7 +150,7 @@ public class TspUpdateReq implements Serializable { ...@@ -150,7 +150,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getSex() { public String getSex() {
return sex; return this.sex;
} }
public void setSex(String sex) { public void setSex(String sex) {
...@@ -158,7 +158,7 @@ public class TspUpdateReq implements Serializable { ...@@ -158,7 +158,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getPhone() { public String getPhone() {
return phone; return this.phone;
} }
public void setPhone(String phone) { public void setPhone(String phone) {
...@@ -166,7 +166,7 @@ public class TspUpdateReq implements Serializable { ...@@ -166,7 +166,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getEffectDate() { public String getEffectDate() {
return effectDate; return this.effectDate;
} }
public void setEffectDate(String effectDate) { public void setEffectDate(String effectDate) {
...@@ -174,7 +174,7 @@ public class TspUpdateReq implements Serializable { ...@@ -174,7 +174,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getInsurePeriod() { public String getInsurePeriod() {
return insurePeriod; return this.insurePeriod;
} }
public void setInsurePeriod(String insurePeriod) { public void setInsurePeriod(String insurePeriod) {
...@@ -182,7 +182,7 @@ public class TspUpdateReq implements Serializable { ...@@ -182,7 +182,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getInstallPoint() { public String getInstallPoint() {
return installPoint; return this.installPoint;
} }
public void setInstallPoint(String installPoint) { public void setInstallPoint(String installPoint) {
...@@ -190,7 +190,7 @@ public class TspUpdateReq implements Serializable { ...@@ -190,7 +190,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getInstallPerson() { public String getInstallPerson() {
return installPerson; return this.installPerson;
} }
public void setInstallPerson(String installPerson) { public void setInstallPerson(String installPerson) {
...@@ -198,7 +198,7 @@ public class TspUpdateReq implements Serializable { ...@@ -198,7 +198,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getSumAmount() { public String getSumAmount() {
return sumAmount; return this.sumAmount;
} }
public void setSumAmount(String sumAmount) { public void setSumAmount(String sumAmount) {
...@@ -206,7 +206,7 @@ public class TspUpdateReq implements Serializable { ...@@ -206,7 +206,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getSpid() { public String getSpid() {
return spid; return this.spid;
} }
public void setSpid(String spid) { public void setSpid(String spid) {
...@@ -214,7 +214,7 @@ public class TspUpdateReq implements Serializable { ...@@ -214,7 +214,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getSpecialContent() { public String getSpecialContent() {
return specialContent; return this.specialContent;
} }
public void setSpecialContent(String specialContent) { public void setSpecialContent(String specialContent) {
...@@ -222,7 +222,7 @@ public class TspUpdateReq implements Serializable { ...@@ -222,7 +222,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getStandNo() { public String getStandNo() {
return standNo; return this.standNo;
} }
public void setStandNo(String standNo) { public void setStandNo(String standNo) {
...@@ -230,7 +230,7 @@ public class TspUpdateReq implements Serializable { ...@@ -230,7 +230,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getPlateNum() { public String getPlateNum() {
return plateNum; return this.plateNum;
} }
public void setPlateNum(String plateNum) { public void setPlateNum(String plateNum) {
...@@ -238,7 +238,7 @@ public class TspUpdateReq implements Serializable { ...@@ -238,7 +238,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getEngine() { public String getEngine() {
return engine; return this.engine;
} }
public void setEngine(String engine) { public void setEngine(String engine) {
...@@ -246,7 +246,7 @@ public class TspUpdateReq implements Serializable { ...@@ -246,7 +246,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getBuyType() { public String getBuyType() {
return buyType; return this.buyType;
} }
public void setBuyType(String buyType) { public void setBuyType(String buyType) {
...@@ -254,7 +254,7 @@ public class TspUpdateReq implements Serializable { ...@@ -254,7 +254,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getVehicleColor() { public String getVehicleColor() {
return vehicleColor; return this.vehicleColor;
} }
public void setVehicleColor(String vehicleColor) { public void setVehicleColor(String vehicleColor) {
...@@ -262,7 +262,7 @@ public class TspUpdateReq implements Serializable { ...@@ -262,7 +262,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getVehicleBrand() { public String getVehicleBrand() {
return vehicleBrand; return this.vehicleBrand;
} }
public void setVehicleBrand(String vehicleBrand) { public void setVehicleBrand(String vehicleBrand) {
...@@ -270,7 +270,7 @@ public class TspUpdateReq implements Serializable { ...@@ -270,7 +270,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getVehicleChildsBrandName() { public String getVehicleChildsBrandName() {
return vehicleChildsBrandName; return this.vehicleChildsBrandName;
} }
public void setVehicleChildsBrandName(String vehicleChildsBrandName) { public void setVehicleChildsBrandName(String vehicleChildsBrandName) {
...@@ -278,7 +278,7 @@ public class TspUpdateReq implements Serializable { ...@@ -278,7 +278,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getVehicleSeriesName() { public String getVehicleSeriesName() {
return vehicleSeriesName; return this.vehicleSeriesName;
} }
public void setVehicleSeriesName(String vehicleSeriesName) { public void setVehicleSeriesName(String vehicleSeriesName) {
...@@ -286,7 +286,7 @@ public class TspUpdateReq implements Serializable { ...@@ -286,7 +286,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getVehicleTypeName() { public String getVehicleTypeName() {
return vehicleTypeName; return this.vehicleTypeName;
} }
public void setVehicleTypeName(String vehicleTypeName) { public void setVehicleTypeName(String vehicleTypeName) {
...@@ -294,7 +294,7 @@ public class TspUpdateReq implements Serializable { ...@@ -294,7 +294,7 @@ public class TspUpdateReq implements Serializable {
} }
public BigDecimal getVehiclePrice() { public BigDecimal getVehiclePrice() {
return vehiclePrice; return this.vehiclePrice;
} }
public void setVehiclePrice(BigDecimal vehiclePrice) { public void setVehiclePrice(BigDecimal vehiclePrice) {
...@@ -302,7 +302,7 @@ public class TspUpdateReq implements Serializable { ...@@ -302,7 +302,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getVehicleUsage() { public String getVehicleUsage() {
return vehicleUsage; return this.vehicleUsage;
} }
public void setVehicleUsage(String vehicleUsage) { public void setVehicleUsage(String vehicleUsage) {
...@@ -310,7 +310,7 @@ public class TspUpdateReq implements Serializable { ...@@ -310,7 +310,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getShopName() { public String getShopName() {
return shopName; return this.shopName;
} }
public void setShopName(String shopName) { public void setShopName(String shopName) {
...@@ -318,7 +318,7 @@ public class TspUpdateReq implements Serializable { ...@@ -318,7 +318,7 @@ public class TspUpdateReq implements Serializable {
} }
public String getFixTime() { public String getFixTime() {
return fixTime; return this.fixTime;
} }
public void setFixTime(String fixTime) { public void setFixTime(String fixTime) {
......
package com.glsx.ordercenter.dto.insurance; package com.glsx.ordercenter.dto.resp;
import java.io.Serializable; import java.io.Serializable;
import com.glsx.excel.poi.annotation.ExcelColumn; import com.glsx.excel.poi.annotation.ExcelColumn;
import com.glsx.excel.poi.annotation.ExcelExport; import com.glsx.excel.poi.annotation.ExcelExport;
/** /**
* <p>Description: 保单列表响应体 * <p>Description: 保单相关响应体
* *
* <p>Project: car-service * <p>Project: car-service
* *
...@@ -13,7 +13,7 @@ import com.glsx.excel.poi.annotation.ExcelExport; ...@@ -13,7 +13,7 @@ import com.glsx.excel.poi.annotation.ExcelExport;
* @date 2020-05-22 * @date 2020-05-22
*/ */
@ExcelExport @ExcelExport
public class InsuranceQueryResp implements Serializable { public class InsuranceResp implements Serializable {
/** /**
* ID * ID
*/ */
...@@ -112,6 +112,22 @@ public class InsuranceQueryResp implements Serializable { ...@@ -112,6 +112,22 @@ public class InsuranceQueryResp implements Serializable {
*/ */
@ExcelColumn(value = "备注", index = 17) @ExcelColumn(value = "备注", index = 17)
private String responseData; private String responseData;
/**
* 客户类型
*/
private Byte customerType;
/**
* 联系地址
*/
private String vehicleOwnerAddress;
/**
* 车辆颜色
*/
private String vehicleColor;
/**
* PDF地址
*/
private String insurancePdf;
public Integer getId() { public Integer getId() {
return this.id; return this.id;
...@@ -273,9 +289,41 @@ public class InsuranceQueryResp implements Serializable { ...@@ -273,9 +289,41 @@ public class InsuranceQueryResp implements Serializable {
this.responseData = responseData; this.responseData = responseData;
} }
public Byte getCustomerType() {
return this.customerType;
}
public void setCustomerType(Byte customerType) {
this.customerType = customerType;
}
public String getVehicleOwnerAddress() {
return this.vehicleOwnerAddress;
}
public void setVehicleOwnerAddress(String vehicleOwnerAddress) {
this.vehicleOwnerAddress = vehicleOwnerAddress;
}
public String getVehicleColor() {
return this.vehicleColor;
}
public void setVehicleColor(String vehicleColor) {
this.vehicleColor = vehicleColor;
}
public String getInsurancePdf() {
return this.insurancePdf;
}
public void setInsurancePdf(String insurancePdf) {
this.insurancePdf = insurancePdf;
}
@Override @Override
public String toString() { public String toString() {
return "InsuranceQueryResp{" + return "InsuranceResp{" +
"id=" + this.id + "id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' + ", insuranceId='" + this.insuranceId + '\'' +
", vehicleOwnerName='" + this.vehicleOwnerName + '\'' + ", vehicleOwnerName='" + this.vehicleOwnerName + '\'' +
...@@ -296,6 +344,10 @@ public class InsuranceQueryResp implements Serializable { ...@@ -296,6 +344,10 @@ public class InsuranceQueryResp implements Serializable {
", vehicleInvoiceMoney='" + this.vehicleInvoiceMoney + '\'' + ", vehicleInvoiceMoney='" + this.vehicleInvoiceMoney + '\'' +
", tastingUnit='" + this.tastingUnit + '\'' + ", tastingUnit='" + this.tastingUnit + '\'' +
", responseData='" + this.responseData + '\'' + ", responseData='" + this.responseData + '\'' +
", customerType=" + this.customerType +
", vehicleOwnerAddress='" + this.vehicleOwnerAddress + '\'' +
", vehicleColor='" + this.vehicleColor + '\'' +
", insurancePdf='" + this.insurancePdf + '\'' +
'}'; '}';
} }
} }
package com.glsx.ordercenter.dto.resp; package com.glsx.ordercenter.dto.resp;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import java.io.Serializable; import java.io.Serializable;
import com.glsx.ordercenter.constants.ResultCodeEnum;
/** /**
* @author think.wang * @author think.wang
...@@ -26,6 +25,8 @@ public class OraResultObject implements Serializable { ...@@ -26,6 +25,8 @@ public class OraResultObject implements Serializable {
private String insuranceId; //保单id private String insuranceId; //保单id
public OraResultObject() { public OraResultObject() {
this.code = ResultCodeEnum.SUCCESS.getCode();
this.message = ResultCodeEnum.SUCCESS.getMsg();
} }
/** /**
...@@ -85,8 +86,12 @@ public class OraResultObject implements Serializable { ...@@ -85,8 +86,12 @@ public class OraResultObject implements Serializable {
return this; return this;
} }
public static long getSerialVersionUID() {
return serialVersionUID;
}
public int getCode() { public int getCode() {
return code; return this.code;
} }
public void setCode(int code) { public void setCode(int code) {
...@@ -94,7 +99,7 @@ public class OraResultObject implements Serializable { ...@@ -94,7 +99,7 @@ public class OraResultObject implements Serializable {
} }
public String getMessage() { public String getMessage() {
return message; return this.message;
} }
public void setMessage(String message) { public void setMessage(String message) {
...@@ -102,7 +107,7 @@ public class OraResultObject implements Serializable { ...@@ -102,7 +107,7 @@ public class OraResultObject implements Serializable {
} }
public Object getData() { public Object getData() {
return data; return this.data;
} }
public void setData(Object data) { public void setData(Object data) {
...@@ -110,17 +115,29 @@ public class OraResultObject implements Serializable { ...@@ -110,17 +115,29 @@ public class OraResultObject implements Serializable {
} }
public String getOrderId() { public String getOrderId() {
return orderId; return this.orderId;
} }
public void setOrderId(String orderId) { public void setOrderId(String orderId) {
this.orderId = orderId; this.orderId = orderId;
} }
public String getInsuranceId() {
return this.insuranceId;
}
public void setInsuranceId(String insuranceId) {
this.insuranceId = insuranceId;
}
@Override @Override
public String toString() { public String toString() {
return "ResultObject [code=" + code + ", message=" + message return "OraResultObject{" +
+ ", data=" + data + ", orderId=" + orderId + ", insuranceId=" + insuranceId+ "]"; "code=" + this.code +
", message='" + this.message + '\'' +
", data=" + this.data +
", orderId='" + this.orderId + '\'' +
", insuranceId='" + this.insuranceId + '\'' +
'}';
} }
} }
package com.glsx.ordercenter.dto.insurance; package com.glsx.ordercenter.dto.resp;
import java.io.Serializable; import java.io.Serializable;
......
package com.glsx.ordercenter.dto.insurance; package com.glsx.ordercenter.dto.resp;
import java.io.Serializable; import java.io.Serializable;
......
package com.glsx.ordercenter.exception.insurance;
import com.alibaba.fastjson.JSON;
import com.glsx.ordercenter.constants.insurance.OraResultCode;
/**
* <p>Description: 长城欧拉业务异常
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-27
*/
public class OraBizException extends RuntimeException {
private OraResultCode code;
private Object[] params;
public OraBizException(Throwable cause) {
super(cause);
}
public OraBizException(OraResultCode code) {
super(code.getMessage());
this.code = code;
}
public OraBizException(OraResultCode code, Object... params) {
this(code);
this.params = params;
}
@Override
public String getMessage() {
String message;
message = (this.code == null) ? super.getMessage() : this.buildMessage();
return message;
}
public OraResultCode getCode() {
return this.code;
}
public void setCode(OraResultCode code) {
this.code = code;
}
private String buildMessage() {
StringBuilder messageSb = new StringBuilder();
String message;
if (this.code != null) {
messageSb.append(this.code.getMessage());
}
if (this.params != null) {
messageSb.append(":");
for (Object param : this.params) {
String messagePart = (param instanceof String)
? (String) param : JSON.toJSONString(param);
messageSb.append(messagePart).append(";");
}
}
message = messageSb.toString();
return message.replaceAll(";$", "");
}
}
package com.glsx.ordercenter.mapper.insurance; package com.glsx.ordercenter.mapper.insurance;
import java.util.List; import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy; import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
/** * <p>Description:
* <p>Description: *
* * <p>Project: car-service
* <p>Project: car-service *
* * @author wbh
* @author wbh * @date 2020-05-29
* @date 2020-05-25 */
*/
@Repository public interface SysInsurancePolicyMapper {
public interface SysInsurancePolicyMapper { long countByExample(SysInsurancePolicyExample example);
long countByExample(SysInsurancePolicyExample example);
int deleteByExample(SysInsurancePolicyExample example);
int deleteByExample(SysInsurancePolicyExample example);
int deleteByPrimaryKey(Integer id);
int deleteByPrimaryKey(Integer id);
int insert(SysInsurancePolicy record);
int insert(SysInsurancePolicy record);
int insertSelective(SysInsurancePolicy record);
int insertSelective(SysInsurancePolicy record);
List<SysInsurancePolicy> selectByExample(SysInsurancePolicyExample example);
List<SysInsurancePolicy> selectByExample(SysInsurancePolicyExample example);
SysInsurancePolicy selectByPrimaryKey(Integer id);
SysInsurancePolicy selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysInsurancePolicy record,
int updateByExampleSelective(@Param("record") SysInsurancePolicy record, @Param("example") SysInsurancePolicyExample example);
@Param("example") SysInsurancePolicyExample example);
int updateByExample(@Param("record") SysInsurancePolicy record,
int updateByExample(@Param("record") SysInsurancePolicy record, @Param("example") SysInsurancePolicyExample example);
@Param("example") SysInsurancePolicyExample example);
int updateByPrimaryKeySelective(SysInsurancePolicy record);
int updateByPrimaryKeySelective(SysInsurancePolicy record);
int updateByPrimaryKey(SysInsurancePolicy record);
int updateByPrimaryKey(SysInsurancePolicy record);
Long selectCount(SysInsurancePolicyExample example);
Long selectCount(SysInsurancePolicyExample example); }
}
\ No newline at end of file \ No newline at end of file
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
* <p>Project: car-service * <p>Project: car-service
* *
* @author wbh * @author wbh
* @date 2020-05-25 * @date 2020-05-29
*/ */
public class SysInsurancePolicyExample { public class SysInsurancePolicyExample {
...@@ -1825,6 +1825,76 @@ public class SysInsurancePolicyExample { ...@@ -1825,6 +1825,76 @@ public class SysInsurancePolicyExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCancelReasonIsNull() {
this.addCriterion("cancel_reason is null");
return (Criteria) this;
}
public Criteria andCancelReasonIsNotNull() {
this.addCriterion("cancel_reason is not null");
return (Criteria) this;
}
public Criteria andCancelReasonEqualTo(String value) {
this.addCriterion("cancel_reason =", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonNotEqualTo(String value) {
this.addCriterion("cancel_reason <>", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonGreaterThan(String value) {
this.addCriterion("cancel_reason >", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonGreaterThanOrEqualTo(String value) {
this.addCriterion("cancel_reason >=", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonLessThan(String value) {
this.addCriterion("cancel_reason <", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonLessThanOrEqualTo(String value) {
this.addCriterion("cancel_reason <=", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonLike(String value) {
this.addCriterion("cancel_reason like", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonNotLike(String value) {
this.addCriterion("cancel_reason not like", value, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonIn(List<String> values) {
this.addCriterion("cancel_reason in", values, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonNotIn(List<String> values) {
this.addCriterion("cancel_reason not in", values, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonBetween(String value1, String value2) {
this.addCriterion("cancel_reason between", value1, value2, "cancelReason");
return (Criteria) this;
}
public Criteria andCancelReasonNotBetween(String value1, String value2) {
this.addCriterion("cancel_reason not between", value1, value2, "cancelReason");
return (Criteria) this;
}
public Criteria andRemarkIsNull() { public Criteria andRemarkIsNull() {
this.addCriterion("remark is null"); this.addCriterion("remark is null");
return (Criteria) this; return (Criteria) this;
......
package com.glsx.ordercenter.service.common; package com.glsx.ordercenter.service;
import com.glsx.ordercenter.utils.LogUtils; import com.glsx.ordercenter.utils.LogUtils;
......
package com.glsx.ordercenter.service.insurance; package com.glsx.ordercenter.service;
import com.glsx.ordercenter.dto.common.PagedOrderResponse; import com.glsx.common.pojo.PagedResp;
import com.glsx.ordercenter.dto.insurance.InsuranceDetailReq; import com.glsx.ordercenter.dto.req.InsuranceReq;
import com.glsx.ordercenter.dto.insurance.InsuranceDetailResp; import com.glsx.ordercenter.dto.resp.InsuranceResp;
import com.glsx.ordercenter.dto.insurance.InsuranceQueryReq;
import com.glsx.ordercenter.dto.insurance.InsuranceQueryResp;
import com.glsx.ordercenter.dto.insurance.InsuranceRefundReq;
import com.glsx.ordercenter.dto.insurance.InsuranceRefundResp;
/** /**
* <p>Description: 保单列表查询 * <p>Description: 保单列表查询
...@@ -20,32 +16,32 @@ public interface InsuranceService { ...@@ -20,32 +16,32 @@ public interface InsuranceService {
/** /**
* 保单列表查询 * 保单列表查询
* *
* @param insuranceQueryReq 请求体 * @param insuranceReq 请求体
* @return 分页后的列表数据 * @return 分页后的列表数据
*/ */
PagedOrderResponse<InsuranceQueryResp> query(InsuranceQueryReq insuranceQueryReq); PagedResp<InsuranceResp> query(InsuranceReq insuranceReq);
/** /**
* 保单详情查询 * 保单详情查询
* *
* @param insuranceDetailReq 请求体 * @param insuranceReq 请求体
* @return 分页后的详情数据 * @return 分页后的详情数据
*/ */
PagedOrderResponse<InsuranceDetailResp> detail(InsuranceDetailReq insuranceDetailReq); PagedResp<InsuranceResp> detail(InsuranceReq insuranceReq);
/** /**
* 保单下载 * 保单下载
* *
* @param insuranceDetailReq 请求体 * @param insuranceReq 请求体
* @return 保单详情,包含保单PDF地址 * @return 保单详情,包含保单PDF地址
*/ */
InsuranceDetailResp download(InsuranceDetailReq insuranceDetailReq); InsuranceResp download(InsuranceReq insuranceReq);
/** /**
* 退保 * 退保
* *
* @param insuranceRefundReq 请求体 * @param insuranceReq 请求体
* @return 退保结果 * @return 退保结果
*/ */
InsuranceRefundResp refund(InsuranceRefundReq insuranceRefundReq); InsuranceResp refund(InsuranceReq insuranceReq);
} }
package com.glsx.ordercenter.service.api; package com.glsx.ordercenter.service.api;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundReq; import com.glsx.ordercenter.dto.req.OraInsuranceRefundReq;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundResp; import com.glsx.ordercenter.dto.req.OraInsuranceUpdateReq;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateReq; import com.glsx.ordercenter.dto.resp.OraResultObject;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateResp;
/** /**
* <p>Description: * <p>Description:
...@@ -20,7 +19,7 @@ public interface OraInsuranceService { ...@@ -20,7 +19,7 @@ public interface OraInsuranceService {
* @param insuranceUpdateReq 请求体 * @param insuranceUpdateReq 请求体
* @return 更新结果 * @return 更新结果
*/ */
OraInsuranceUpdateResp update(OraInsuranceUpdateReq insuranceUpdateReq); OraResultObject update(OraInsuranceUpdateReq insuranceUpdateReq);
/** /**
* 长城欧拉-退保 * 长城欧拉-退保
...@@ -28,5 +27,5 @@ public interface OraInsuranceService { ...@@ -28,5 +27,5 @@ public interface OraInsuranceService {
* @param insuranceRefundReq 请求体 * @param insuranceRefundReq 请求体
* @return 退保结果 * @return 退保结果
*/ */
OraInsuranceRefundResp refund(OraInsuranceRefundReq insuranceRefundReq); OraResultObject refund(OraInsuranceRefundReq insuranceRefundReq);
} }
package com.glsx.ordercenter.thread; package com.glsx.ordercenter.thread;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Semaphore;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.glsx.common.utils.DateUtil; import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.PropertiesUtil; import com.glsx.common.utils.PropertiesUtil;
import com.glsx.gps.utils.HttpUtil; import com.glsx.gps.utils.HttpUtil;
import com.glsx.ordercenter.dto.insurance.TspResp; import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.dto.insurance.TspRespData; import com.glsx.ordercenter.dto.resp.TspRespData;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper; import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy; import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.utils.TspSignUtil; import com.glsx.ordercenter.utils.TspSignUtil;
...@@ -13,11 +17,6 @@ import org.apache.http.entity.ContentType; ...@@ -13,11 +17,6 @@ import org.apache.http.entity.ContentType;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Semaphore;
/** /**
* @author think.wang * @author think.wang
* @version 1.0.0 * @version 1.0.0
...@@ -46,7 +45,7 @@ public class TspGetInsurancePdfTask implements Runnable{ ...@@ -46,7 +45,7 @@ public class TspGetInsurancePdfTask implements Runnable{
@Override @Override
public void run() { public void run() {
try { try {
semaphore.acquire(); this.semaphore.acquire();
//系统参数获取 //系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url"); String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.pdf"); //调用获取pdf方法 String method = PropertiesUtil.getProperty("insurance.picc.pdf"); //调用获取pdf方法
...@@ -56,9 +55,9 @@ public class TspGetInsurancePdfTask implements Runnable{ ...@@ -56,9 +55,9 @@ public class TspGetInsurancePdfTask implements Runnable{
String format = PropertiesUtil.getProperty("insurance.picc.format"); String format = PropertiesUtil.getProperty("insurance.picc.format");
String source = PropertiesUtil.getProperty("insurance.picc.source"); String source = PropertiesUtil.getProperty("insurance.picc.source");
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id); SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(this.id);
if(insurancePolicy == null){ if(insurancePolicy == null){
logger.error("通过id={}未找到保单数据", id); this.logger.error("通过id={}未找到保单数据", this.id);
return; return;
} }
//业务参数封装 //业务参数封装
...@@ -66,7 +65,7 @@ public class TspGetInsurancePdfTask implements Runnable{ ...@@ -66,7 +65,7 @@ public class TspGetInsurancePdfTask implements Runnable{
map.put("insuranceCompany", insurancePolicy.getInsuranceCompany()); map.put("insuranceCompany", insurancePolicy.getInsuranceCompany());
map.put("fullInsuranceNo", insurancePolicy.getInsuranceNo()); map.put("fullInsuranceNo", insurancePolicy.getInsuranceNo());
map.put("seqNo", insurancePolicy.getInsuranceSeqNo()); map.put("seqNo", insurancePolicy.getInsuranceSeqNo());
logger.info("获取pdf签名参数值为:{}", map); this.logger.info("获取pdf签名参数值为:{}", map);
//系统参数封装 //系统参数封装
map.put("method", method); map.put("method", method);
...@@ -80,31 +79,31 @@ public class TspGetInsurancePdfTask implements Runnable{ ...@@ -80,31 +79,31 @@ public class TspGetInsurancePdfTask implements Runnable{
//发送请求 //发送请求
String result = null; String result = null;
int tryCount = TRY_COUNT; int tryCount = this.TRY_COUNT;
while (tryCount-- > 0) { while (tryCount-- > 0) {
try { try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON); result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break; break;
} catch (Exception e) { } catch (Exception e) {
Thread.sleep(TRY_WAIT_TIME); Thread.sleep(this.TRY_WAIT_TIME);
continue; continue;
} }
} }
logger.info("保单号:{}获取pdf信息响应数据:{}", map.get("fullInsuranceNo"), result); this.logger.info("保单号:{}获取pdf信息响应数据:{}", map.get("fullInsuranceNo"), result);
TspResp tspResp = JSON.parseObject(result, TspResp.class); TspResp tspResp = JSON.parseObject(result, TspResp.class);
if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功 if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功
SysInsurancePolicy policy = new SysInsurancePolicy(); SysInsurancePolicy policy = new SysInsurancePolicy();
policy.setId(id); policy.setId(this.id);
TspRespData respData = tspResp.getData(); TspRespData respData = tspResp.getData();
policy.setInsurancePdf(respData.getObj()); //得到pdf路径 policy.setInsurancePdf(respData.getObj()); //得到pdf路径
policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据 this.policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
}else{ }else{
logger.error("获取保单pdf失败,保单号为:{}", map.get("fullInsuranceNo")); this.logger.error("获取保单pdf失败,保单号为:{}", map.get("fullInsuranceNo"));
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("调用TSP获取pdf接口异常:{}", e); this.logger.error("调用TSP获取pdf接口异常:{}", e);
}finally { }finally {
semaphore.release(); this.semaphore.release();
} }
} }
......
package com.glsx.ordercenter.thread; package com.glsx.ordercenter.thread;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Semaphore;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.glsx.common.utils.DateUtil; import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.PropertiesUtil; import com.glsx.common.utils.PropertiesUtil;
...@@ -9,9 +13,9 @@ import com.glsx.ordercenter.constants.insurance.InsuranceCardType; ...@@ -9,9 +13,9 @@ import com.glsx.ordercenter.constants.insurance.InsuranceCardType;
import com.glsx.ordercenter.constants.insurance.InsuranceCompany; import com.glsx.ordercenter.constants.insurance.InsuranceCompany;
import com.glsx.ordercenter.constants.insurance.InsuranceCustomerType; import com.glsx.ordercenter.constants.insurance.InsuranceCustomerType;
import com.glsx.ordercenter.constants.insurance.InsuranceStatus; import com.glsx.ordercenter.constants.insurance.InsuranceStatus;
import com.glsx.ordercenter.dto.insurance.TspResp; import com.glsx.ordercenter.dto.req.TspSaveReq;
import com.glsx.ordercenter.dto.insurance.TspRespData; import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.dto.insurance.TspSaveReq; import com.glsx.ordercenter.dto.resp.TspRespData;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper; import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy; import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.utils.ObjectUtils; import com.glsx.ordercenter.utils.ObjectUtils;
...@@ -20,11 +24,6 @@ import org.apache.http.entity.ContentType; ...@@ -20,11 +24,6 @@ import org.apache.http.entity.ContentType;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Semaphore;
/** /**
* @author think.wang * @author think.wang
* @version 1.0.0 * @version 1.0.0
...@@ -53,7 +52,7 @@ public class TspSaveInsuranceDataTask implements Runnable{ ...@@ -53,7 +52,7 @@ public class TspSaveInsuranceDataTask implements Runnable{
@Override @Override
public void run() { public void run() {
try { try {
semaphore.acquire(); this.semaphore.acquire();
//系统参数获取 //系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url"); String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.save"); //调用投保方法 String method = PropertiesUtil.getProperty("insurance.picc.save"); //调用投保方法
...@@ -66,7 +65,7 @@ public class TspSaveInsuranceDataTask implements Runnable{ ...@@ -66,7 +65,7 @@ public class TspSaveInsuranceDataTask implements Runnable{
//业务参数封装 //业务参数封装
TspSaveReq saveData = this.setSendData(this.data); TspSaveReq saveData = this.setSendData(this.data);
//对象转map进行签名 //对象转map进行签名
logger.info("投保签名的对象为:{}", JSON.toJSONString(saveData)); this.logger.info("投保签名的对象为:{}", JSON.toJSONString(saveData));
Map<String, String> map = ObjectUtils.objectToMap(saveData); Map<String, String> map = ObjectUtils.objectToMap(saveData);
//系统参数封装 //系统参数封装
...@@ -81,17 +80,17 @@ public class TspSaveInsuranceDataTask implements Runnable{ ...@@ -81,17 +80,17 @@ public class TspSaveInsuranceDataTask implements Runnable{
//发送请求 //发送请求
String result = null; String result = null;
int tryCount = TRY_COUNT; int tryCount = this.TRY_COUNT;
while (tryCount-- > 0) { while (tryCount-- > 0) {
try { try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON); result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break; break;
} catch (Exception e) { } catch (Exception e) {
Thread.sleep(TRY_WAIT_TIME); Thread.sleep(this.TRY_WAIT_TIME);
continue; continue;
} }
} }
logger.info("车架号:{}投保响应数据:{}", map.get("standNo"), result); this.logger.info("车架号:{}投保响应数据:{}", map.get("standNo"), result);
SysInsurancePolicy policy = new SysInsurancePolicy(); SysInsurancePolicy policy = new SysInsurancePolicy();
policy.setId(this.data.getId()); policy.setId(this.data.getId());
TspResp tspResp = JSON.parseObject(result, TspResp.class); TspResp tspResp = JSON.parseObject(result, TspResp.class);
...@@ -103,11 +102,11 @@ public class TspSaveInsuranceDataTask implements Runnable{ ...@@ -103,11 +102,11 @@ public class TspSaveInsuranceDataTask implements Runnable{
}else{ }else{
policy.setStatus(InsuranceStatus.APPLY_FAILED.getStatus().byteValue()); //更新状态投保失败 policy.setStatus(InsuranceStatus.APPLY_FAILED.getStatus().byteValue()); //更新状态投保失败
} }
policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据 this.policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
} catch (Exception e) { } catch (Exception e) {
logger.error("调用TSP投保接口异常:{}", e); this.logger.error("调用TSP投保接口异常:{}", e);
}finally { }finally {
semaphore.release(); this.semaphore.release();
} }
} }
......
package com.glsx.ordercenter.thread; package com.glsx.ordercenter.thread;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.Semaphore;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.glsx.common.utils.DateUtil; import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.PropertiesUtil; import com.glsx.common.utils.PropertiesUtil;
...@@ -7,8 +10,8 @@ import com.glsx.common.utils.StringUtils; ...@@ -7,8 +10,8 @@ import com.glsx.common.utils.StringUtils;
import com.glsx.gps.utils.HttpUtil; import com.glsx.gps.utils.HttpUtil;
import com.glsx.ordercenter.constants.insurance.InsuranceCompany; import com.glsx.ordercenter.constants.insurance.InsuranceCompany;
import com.glsx.ordercenter.constants.insurance.InsuranceCustomerType; import com.glsx.ordercenter.constants.insurance.InsuranceCustomerType;
import com.glsx.ordercenter.dto.insurance.TspResp; import com.glsx.ordercenter.dto.req.TspUpdateReq;
import com.glsx.ordercenter.dto.insurance.TspUpdateReq; import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper; import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy; import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.utils.ObjectUtils; import com.glsx.ordercenter.utils.ObjectUtils;
...@@ -17,10 +20,6 @@ import org.apache.http.entity.ContentType; ...@@ -17,10 +20,6 @@ import org.apache.http.entity.ContentType;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.Semaphore;
/** /**
* @author think.wang * @author think.wang
* @version 1.0.0 * @version 1.0.0
...@@ -49,7 +48,7 @@ public class TspUpdateInsuranceDataTask implements Runnable{ ...@@ -49,7 +48,7 @@ public class TspUpdateInsuranceDataTask implements Runnable{
@Override @Override
public void run() { public void run() {
try { try {
semaphore.acquire(); this.semaphore.acquire();
//系统参数获取 //系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url"); String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.update"); //修改保单方法 String method = PropertiesUtil.getProperty("insurance.picc.update"); //修改保单方法
...@@ -59,15 +58,15 @@ public class TspUpdateInsuranceDataTask implements Runnable{ ...@@ -59,15 +58,15 @@ public class TspUpdateInsuranceDataTask implements Runnable{
String format = PropertiesUtil.getProperty("insurance.picc.format"); String format = PropertiesUtil.getProperty("insurance.picc.format");
String source = PropertiesUtil.getProperty("insurance.picc.source"); String source = PropertiesUtil.getProperty("insurance.picc.source");
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id); SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(this.id);
if(insurancePolicy == null){ if(insurancePolicy == null){
logger.error("通过id={}未找到保单数据", id); this.logger.error("通过id={}未找到保单数据", this.id);
return; return;
} }
//业务参数封装 //业务参数封装
TspUpdateReq updateData = this.setSendData(insurancePolicy); TspUpdateReq updateData = this.setSendData(insurancePolicy);
//对象转map进行签名 //对象转map进行签名
logger.info("修改保单签名的对象为:{}", JSON.toJSONString(updateData)); this.logger.info("修改保单签名的对象为:{}", JSON.toJSONString(updateData));
Map<String, String> map = ObjectUtils.objectToMap(updateData); Map<String, String> map = ObjectUtils.objectToMap(updateData);
//系统参数封装 //系统参数封装
...@@ -82,27 +81,27 @@ public class TspUpdateInsuranceDataTask implements Runnable{ ...@@ -82,27 +81,27 @@ public class TspUpdateInsuranceDataTask implements Runnable{
//发送请求 //发送请求
String result = null; String result = null;
int tryCount = TRY_COUNT; int tryCount = this.TRY_COUNT;
while (tryCount-- > 0) { while (tryCount-- > 0) {
try { try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON); result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break; break;
} catch (Exception e) { } catch (Exception e) {
Thread.sleep(TRY_WAIT_TIME); Thread.sleep(this.TRY_WAIT_TIME);
continue; continue;
} }
} }
logger.info("保单号:{}修改投保响应数据:{}", map.get("fullInsuranceNo"), result); this.logger.info("保单号:{}修改投保响应数据:{}", map.get("fullInsuranceNo"), result);
TspResp tspResp = JSON.parseObject(result, TspResp.class); TspResp tspResp = JSON.parseObject(result, TspResp.class);
if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功 if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功
logger.info("修改保单数据成功,保单号为:{}", map.get("fullInsuranceNo")); this.logger.info("修改保单数据成功,保单号为:{}", map.get("fullInsuranceNo"));
}else{ }else{
logger.error("修改保单数据失败,保单号为:{}", map.get("fullInsuranceNo")); this.logger.error("修改保单数据失败,保单号为:{}", map.get("fullInsuranceNo"));
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("调用TSP投保接口异常:{}", e); this.logger.error("调用TSP投保接口异常:{}", e);
}finally { }finally {
semaphore.release(); this.semaphore.release();
} }
} }
......
package com.glsx.ordercenter.utils; package com.glsx.ordercenter.utils;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.glsx.ordercenter.constants.insurance.OraConstants; import com.glsx.ordercenter.constants.insurance.OraConstants;
import com.glsx.ordercenter.constants.insurance.OraResultCode; import com.glsx.ordercenter.constants.insurance.OraResultCode;
import com.glsx.ordercenter.exception.insurance.OraBizException; import com.glsx.ordercenter.exception.SysException;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.util.*;
/** /**
* @author think.wang * @author think.wang
* @version 1.0.0 * @version 1.0.0
...@@ -60,7 +63,7 @@ public class OraSignUtil { ...@@ -60,7 +63,7 @@ public class OraSignUtil {
/** /**
* <p>获取HTTp请求体和请求参数进行验签</p> * <p>获取HTTp请求体和请求参数进行验签</p>
* <p>验签失败则抛出 {@link OraBizException} 异常</p> * <p>验签失败则抛出 {@link SysException} 异常</p>
* *
* @param secret 密钥 * @param secret 密钥
* @param requestBody 请求体 * @param requestBody 请求体
...@@ -76,7 +79,8 @@ public class OraSignUtil { ...@@ -76,7 +79,8 @@ public class OraSignUtil {
Map<String, String> verifyParamMap = buildVerifyParamMap(paramMap, requestBody); Map<String, String> verifyParamMap = buildVerifyParamMap(paramMap, requestBody);
if (!verifyParamMap.containsKey(OraConstants.APP_KEY)) { if (!verifyParamMap.containsKey(OraConstants.APP_KEY)) {
throw new OraBizException(OraResultCode.AK_NOT_FOUND); throw SysException.create(OraResultCode.AK_NOT_FOUND.getCode(),
OraResultCode.AK_NOT_FOUND.getMessage());
} }
String storedAppKey = verifyParamMap.get(OraConstants.APP_KEY); String storedAppKey = verifyParamMap.get(OraConstants.APP_KEY);
...@@ -85,11 +89,13 @@ public class OraSignUtil { ...@@ -85,11 +89,13 @@ public class OraSignUtil {
String signStr = sign(verifyParamMap, null, secret); String signStr = sign(verifyParamMap, null, secret);
if (!appKey.equals(storedAppKey)) { if (!appKey.equals(storedAppKey)) {
throw new OraBizException(OraResultCode.AK_INVALID); throw SysException.create(OraResultCode.AK_INVALID.getCode(),
OraResultCode.AK_INVALID.getMessage());
} }
if (!signStr.equals(storedSignStr)) { if (!signStr.equals(storedSignStr)) {
throw new OraBizException(OraResultCode.PARAM_ERROR); throw SysException.create(OraResultCode.PARAM_ERROR.getCode(),
OraResultCode.PARAM_ERROR.getMessage());
} }
} }
} }
......
package com.glsx.ordercenter.utils.insurance; package com.glsx.ordercenter.utils;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -7,9 +7,8 @@ import com.alibaba.fastjson.JSON; ...@@ -7,9 +7,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.glsx.common.utils.DateUtil; import com.glsx.common.utils.DateUtil;
import com.glsx.ordercenter.constants.insurance.TspConstants; import com.glsx.ordercenter.constants.insurance.TspConstants;
import com.glsx.ordercenter.dto.insurance.TspRefundReq; import com.glsx.ordercenter.dto.req.TspRefundReq;
import com.glsx.ordercenter.dto.insurance.TspResp; import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.utils.UrlUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
......
package com.glsx.ordercenter.utils.insurance; package com.glsx.ordercenter.utils;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.MessageDigest; import java.security.MessageDigest;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!