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 1708 additions and 1898 deletions
package com.glsx.ordercenter.dto.common;
package com.glsx.common.pojo;
import java.io.Serializable;
import com.glsx.common.utils.Page;
......@@ -11,7 +11,7 @@ import com.glsx.common.utils.Page;
* @author wbh
* @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 {
@Override
public String toString() {
return "PagedOrderRequest{" +
return "PagedReq{" +
"pageIndex=" + this.pageIndex +
", pageSize=" + this.pageSize +
'}';
......
package com.glsx.ordercenter.dto.common;
package com.glsx.common.pojo;
import java.util.List;
import com.glsx.common.utils.Page;
......@@ -11,27 +11,25 @@ import com.glsx.common.utils.Page;
* @author wbh
* @date 2020-05-22
*/
public class PagedOrderResponse<E> {
public class PagedResp<E> {
private Page page;
private List<E> items;
private PagedOrderResponse(Page page, List<E> items) {
private PagedResp(Page page, List<E> items) {
this.page = page;
this.items = items;
}
public static <E> PagedOrderResponse<E> of(long totalCount, PagedOrderRequest pagedOrderRequest,
List<E> list) {
public static <E> PagedResp<E> of(long totalCount, PagedReq orderReq, List<E> list) {
Page page = new Page(pagedOrderRequest.getPageIndex(),
pagedOrderRequest.getPageSize());
Page page = new Page(orderReq.getPageIndex(), orderReq.getPageSize());
page.setTotalCount((int) totalCount);
return of(page, list);
}
public static <E> PagedOrderResponse<E> of(Page page, List<E> list) {
return new PagedOrderResponse<>(page, list);
public static <E> PagedResp<E> of(Page page, List<E> list) {
return new PagedResp<>(page, list);
}
public Page getPage() {
......@@ -52,7 +50,7 @@ public class PagedOrderResponse<E> {
@Override
public String toString() {
return "PagedOrderResponse{" +
return "PagedResp{" +
"page=" + this.page +
", items=" + this.items +
'}';
......
......@@ -131,14 +131,14 @@ public enum ResultCodeEnum {
/**
* 保单-导出数据过多
*/
INSURANCE_EXPORT_TO_MANY(1, "保单导出数据量大于5000条,请条件过滤后重新导出"),
INSURANCE_ID_NULL(2, "保单ID不能为空"),
INSURANCE_ID_NULL(1, "保单ID不能为空"),
INSURANCE_THIRD_ID_NULL(2, "第三方保单号不能为空"),
INSURANCE_ID_NOT_FOUND(3, "无法根据保单ID获取保单数据"),
INSURANCE_EXPORT_NOT_SUPPORTED(4, "非页面请求,无法导出保单"),
INSURANCE_PDF_NOT_FOUND(5, "无法获取到保单相关的PDF文件"),
INSURANCE_API_FAIL(6, "TSP保险接口异常"),
INSURANCE_UPDATE_ERROR(7, "修改保单状态异常"),
INSURANCE_THIRD_ID_NULL(8, "第三方保单号不能为空"),
INSURANCE_PDF_NOT_FOUND(4, "无法获取到保单相关的PDF文件"),
INSURANCE_EXPORT_TO_MANY(5, "保单导出数据量大于5000条,请条件过滤后重新导出"),
INSURANCE_EXPORT_NOT_SUPPORTED(6, "无法导出保单数据"),
INSURANCE_API_FAIL(7, "TSP保险接口错误"),
INSURANCE_UPDATE_ERROR(8, "修改保单信息异常"),
;
......
package com.glsx.ordercenter.controller;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
......@@ -11,6 +12,7 @@ import java.util.Map;
import java.util.Set;
import com.glsx.common.constants.ResultCodeEnum;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.pojo.PagedReq;
import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.utils.LogUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -18,6 +20,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/**
* @author zhanghj
......@@ -72,8 +76,31 @@ public class BaseController {
Collection<String> values = errorMap.values();
String errorMsg = StringUtils.join(values, ";");
throw SysException.create(
ResultCodeEnum.PARAM_ERROR.getCode(), errorMsg);
throw SysException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
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) {
......
package com.glsx.ordercenter.controller.insurance;
package com.glsx.ordercenter.controller;
import com.glsx.common.constants.ResultObject;
import com.glsx.ordercenter.controller.BaseController;
import com.glsx.ordercenter.dto.common.PagedOrderResponse;
import com.glsx.ordercenter.dto.insurance.*;
import com.glsx.ordercenter.service.insurance.InsuranceService;
import com.glsx.common.pojo.PagedResp;
import com.glsx.ordercenter.dto.req.InsuranceReq;
import com.glsx.ordercenter.dto.resp.InsuranceResp;
import com.glsx.ordercenter.service.InsuranceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -28,18 +28,16 @@ public class InsuranceController extends BaseController {
/**
* 获取保单列表
*
* @param insuranceQueryReq 请求体
* @param insuranceReq 请求体
* @return 查询结果
*/
@RequestMapping(value = "/getList", method = RequestMethod.POST)
public ResultObject query(@RequestBody InsuranceQueryReq insuranceQueryReq) {
super.logInfo("保单列表查询-参数", insuranceQueryReq);
public ResultObject query(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("保单列表查询-参数", insuranceReq);
ResultObject resultObject;
PagedOrderResponse<InsuranceQueryResp> pagedOrderResponse;
pagedOrderResponse = this.insuranceService.query(insuranceQueryReq);
resultObject = super.webOk(pagedOrderResponse);
super.setPagedInfo(insuranceReq);
PagedResp<InsuranceResp> result = this.insuranceService.query(insuranceReq);
ResultObject resultObject = super.webOk(result);
super.logInfo("保单列表查询-结果", resultObject);
......@@ -49,19 +47,17 @@ public class InsuranceController extends BaseController {
/**
* 获取保单详情
*
* @param insuranceDetailReq 请求体
* @param insuranceReq 请求体
* @return 保单详情
*/
//@AuthCheck
@RequestMapping(value = "/detail", method = RequestMethod.POST)
public ResultObject detail(@RequestBody InsuranceDetailReq insuranceDetailReq) {
super.logInfo("保单详情查询-参数", insuranceDetailReq);
ResultObject resultObject;
PagedOrderResponse<InsuranceDetailResp> pagedOrderResponse;
public ResultObject detail(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("保单详情查询-参数", insuranceReq);
pagedOrderResponse = this.insuranceService.detail(insuranceDetailReq);
resultObject = super.webOk(pagedOrderResponse);
super.setPagedInfo(insuranceReq);
PagedResp<InsuranceResp> result = this.insuranceService.detail(insuranceReq);
ResultObject resultObject = super.webOk(result);
super.logInfo("保单详情查询-结果", resultObject);
......@@ -71,18 +67,15 @@ public class InsuranceController extends BaseController {
/**
* 下载保单PDF
*
* @param insuranceDetailReq 请求体
* @param insuranceReq 请求体
*/
//@AuthCheck
@RequestMapping(value = "/download", method = RequestMethod.POST)
public ResultObject download(@RequestBody InsuranceDetailReq insuranceDetailReq) {
super.logInfo("下载保单-参数", insuranceDetailReq);
ResultObject resultObject;
InsuranceDetailResp insuranceDetailResp =
this.insuranceService.download(insuranceDetailReq);
public ResultObject download(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("下载保单-参数", insuranceReq);
resultObject = super.webOk(insuranceDetailResp);
InsuranceResp insuranceResp = this.insuranceService.download(insuranceReq);
ResultObject resultObject = super.webOk(insuranceResp);
super.logInfo("下载保单-结果", resultObject);
......@@ -92,17 +85,16 @@ public class InsuranceController extends BaseController {
/**
* 退保
*
* @param insuranceRefundReq 请求体
* @param insuranceReq 请求体
* @return 退保结果
*/
//@AuthCheck
@RequestMapping(value = "/refund", method = RequestMethod.POST)
public ResultObject refund(@RequestBody InsuranceRefundReq insuranceRefundReq) {
super.logInfo("退保-参数", insuranceRefundReq);
public ResultObject refund(@RequestBody InsuranceReq insuranceReq) {
super.logInfo("退保-参数", insuranceReq);
InsuranceRefundResp insuranceRefundResp =
this.insuranceService.refund(insuranceRefundReq);
ResultObject resultObject = super.webOk(insuranceRefundResp);
InsuranceResp insuranceResp = this.insuranceService.refund(insuranceReq);
ResultObject resultObject = super.webOk(insuranceResp);
super.logInfo("退保-结果", resultObject);
......
......@@ -14,6 +14,7 @@ import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.glsx.common.feign.client.UserClient;
import com.glsx.common.pojo.PagedResp;
import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.constants.OrderTypeEnum;
import com.glsx.ordercenter.constants.ReconciliationStatusEnum;
......@@ -29,11 +30,10 @@ import com.glsx.ordercenter.dto.OrderExceptionVO;
import com.glsx.ordercenter.dto.QueryOrderReq;
import com.glsx.ordercenter.dto.ReconciliationDetailQuery;
import com.glsx.ordercenter.dto.ReconciliationDetailVO;
import com.glsx.ordercenter.dto.common.PagedOrderResponse;
import com.glsx.ordercenter.dto.insurance.InsuranceQueryReq;
import com.glsx.ordercenter.dto.insurance.InsuranceQueryResp;
import com.glsx.ordercenter.dto.req.InsuranceReq;
import com.glsx.ordercenter.dto.req.ReconciliationListQuery;
import com.glsx.ordercenter.dto.resp.ExportReconciliationVo;
import com.glsx.ordercenter.dto.resp.InsuranceResp;
import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.pojo.DictionaryData;
import com.glsx.ordercenter.pojo.ExportOrderExceptionVo;
......@@ -50,10 +50,10 @@ import com.glsx.ordercenter.service.IOrderExceptionService;
import com.glsx.ordercenter.service.IOrderService;
import com.glsx.ordercenter.service.IUnknownOrderService;
import com.glsx.ordercenter.service.IndentService;
import com.glsx.ordercenter.service.InsuranceService;
import com.glsx.ordercenter.service.OperationAdvanceService;
import com.glsx.ordercenter.service.ReconciliationDetailService;
import com.glsx.ordercenter.service.ReconciliationService;
import com.glsx.ordercenter.service.insurance.InsuranceService;
import com.google.common.collect.Lists;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -483,18 +483,17 @@ public class ReportController extends BaseReportController {
}
@RequestMapping(value = "/exportInsurance", method = {RequestMethod.POST, RequestMethod.GET})
public void exportInsurance( InsuranceQueryReq insuranceQueryReq) {
this.logger.info("保单导出-参数: {}", JSON.toJSONString(insuranceQueryReq));
public void exportInsurance(InsuranceReq insuranceReq) {
this.logger.info("保单导出-参数: {}", JSON.toJSONString(insuranceReq));
ServletRequestAttributes attributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
insuranceQueryReq.setPageIndex(-1);
insuranceQueryReq.setPageSize(-1);
PagedOrderResponse<InsuranceQueryResp> pagedOrderResponse =
this.insuranceService.query(insuranceQueryReq);
insuranceReq.setPageIndex(null);
insuranceReq.setPageSize(null);
PagedResp<InsuranceResp> pagedResp = this.insuranceService.query(insuranceReq);
if (pagedOrderResponse.getItems().size() > 5000) {
if (pagedResp.getItems().size() > 5000) {
throw SysException.create(
ResultCodeEnum.INSURANCE_EXPORT_TO_MANY.getCode(),
ResultCodeEnum.INSURANCE_EXPORT_TO_MANY.getMsg());
......@@ -503,8 +502,8 @@ public class ReportController extends BaseReportController {
try {
if (attributes != null && attributes.getResponse() != null) {
String title = "保单详情-" +
DateTimeFormatter.ofPattern("yyyy-MM-dd_HH_mm_ss").format(LocalDateTime.now());
this.exportObject(attributes.getResponse(), pagedOrderResponse.getItems(), title);
DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss").format(LocalDateTime.now());
this.exportObject(attributes.getResponse(), pagedResp.getItems(), title);
} else {
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;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundReq;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundResp;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateReq;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateResp;
import com.glsx.ordercenter.exception.insurance.OraBizException;
import com.glsx.common.constants.ResultObject;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.controller.BaseController;
import com.glsx.ordercenter.dto.req.OraInsuranceRefundReq;
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.utils.OraSignUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -26,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("/api/insurance")
public class OraInsuranceController extends OraBaseController {
public class OraInsuranceController extends BaseController {
@Value("${ora.api.url}")
private String serverUrl;
......@@ -40,40 +42,48 @@ public class OraInsuranceController extends OraBaseController {
private OraInsuranceService oraInsuranceService;
@RequestMapping(value = "/update", method = RequestMethod.POST)
public OraInsuranceUpdateResp update(
@Validated @RequestBody OraInsuranceUpdateReq insuranceUpdateReq,
BindingResult bindingResult) {
super.logInfo("长城欧拉修改保单-参数", insuranceUpdateReq);
OraInsuranceUpdateResp insuranceUpdateResp;
public OraResultObject update(@Validated @RequestBody OraInsuranceUpdateReq updateReq,
BindingResult bindingResult) {
super.logInfo("长城欧拉修改保单-参数", updateReq);
OraResultObject resultObject;
try {
OraSignUtil.verifyRequest(this.appKey, this.appSecret, updateReq);
super.checkRequestParam(bindingResult);
insuranceUpdateResp = this.oraInsuranceService.update(insuranceUpdateReq);
} catch (OraBizException e) {
insuranceUpdateResp = super.oraWebOops(e.getCode(), e, new OraInsuranceUpdateResp());
resultObject = this.oraInsuranceService.update(updateReq);
} catch (SysException e) {
super.logError("长城欧拉修改保单-异常", e);
ResultObject result = e.getResultEntity();
resultObject = new OraResultObject(result.getCode(), result.getMessage());
} 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)
public OraInsuranceRefundResp refund(
@Validated @RequestBody OraInsuranceRefundReq insuranceRefundReq,
BindingResult bindingResult) {
super.logInfo("长城欧拉退保-参数", insuranceRefundReq);
OraInsuranceRefundResp insuranceRefundResp;
public OraResultObject refund(@Validated @RequestBody OraInsuranceRefundReq refundReq,
BindingResult bindingResult) {
super.logInfo("长城欧拉退保-参数", refundReq);
OraResultObject resultObject;
try {
OraSignUtil.verifyRequest(this.appKey, this.appSecret,
insuranceRefundReq);
OraSignUtil.verifyRequest(this.appKey, this.appSecret, refundReq);
super.checkRequestParam(bindingResult);
insuranceRefundResp = this.oraInsuranceService.refund(insuranceRefundReq);
} catch (OraBizException e) {
insuranceRefundResp = super.oraWebOops(e.getCode(), e, new OraInsuranceRefundResp());
resultObject = this.oraInsuranceService.refund(refundReq);
} catch (SysException e) {
super.logError("长城欧拉修改保单-异常", e);
ResultObject result = e.getResultEntity();
resultObject = new OraResultObject(result.getCode(), result.getMessage());
} catch (RuntimeException e) {
insuranceRefundResp = super.oraWebOops(e, new OraInsuranceRefundResp());
super.logError("长城欧拉修改保单-异常", e);
resultObject = new OraResultObject(ResultCodeEnum.ERROR);
}
super.logInfo("长城欧拉退保-结果", insuranceRefundResp);
return insuranceRefundResp;
super.logInfo("长城欧拉退保-结果", resultObject);
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 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
*
* @author wbh
* @date 2020-05-22
*/
public class InsuranceQueryReq extends PagedOrderRequest {
public class InsuranceReq extends PagedReq {
/**
* 保单ID
*/
......@@ -144,7 +144,7 @@ public class InsuranceQueryReq extends PagedOrderRequest {
@Override
public String toString() {
return "InsuranceQueryReq{" +
return "InsuranceReq{" +
"id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' +
", vehicleOwnerName='" + this.vehicleOwnerName + '\'' +
......
package com.glsx.ordercenter.dto.api;
package com.glsx.ordercenter.dto.req;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* <p>Description:
......@@ -10,7 +11,7 @@ import javax.validation.constraints.NotBlank;
* @author wbh
* @date 2020-05-25
*/
public class OraInsuranceRefundReq extends OraBaseRequest {
public class OraInsuranceRefundReq implements Serializable {
/**
* 聚合保单ID(唯一不变值)
*/
......@@ -43,6 +44,6 @@ public class OraInsuranceRefundReq extends OraBaseRequest {
return "OraInsuranceRefundReq{" +
"insuranceId='" + this.insuranceId + '\'' +
", 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.NotNull;
import java.io.Serializable;
/**
* <p>Description:
......@@ -11,7 +12,7 @@ import javax.validation.constraints.NotNull;
* @author wbh
* @date 2020-05-25
*/
public class OraInsuranceUpdateReq extends OraBaseRequest {
public class OraInsuranceUpdateReq implements Serializable {
/**
* 聚合保单ID(唯一不变值)
*/
......@@ -303,6 +304,6 @@ public class OraInsuranceUpdateReq extends OraBaseRequest {
", tastingUnit='" + this.tastingUnit + '\'' +
", customerId=" + this.customerId +
", registrationDate='" + this.registrationDate + '\'' +
"} " + super.toString();
'}';
}
}
package com.glsx.ordercenter.dto.insurance;
package com.glsx.ordercenter.dto.req;
import java.io.Serializable;
import java.math.BigDecimal;
......@@ -74,7 +74,7 @@ public class TspSaveReq implements Serializable {
private Long sumPremium;
public Long getSumPremium() {
return sumPremium;
return this.sumPremium;
}
public void setSumPremium(Long sumPremium) {
......@@ -82,7 +82,7 @@ public class TspSaveReq implements Serializable {
}
public String getInsuranceCompany() {
return insuranceCompany;
return this.insuranceCompany;
}
public void setInsuranceCompany(String insuranceCompany) {
......@@ -90,7 +90,7 @@ public class TspSaveReq implements Serializable {
}
public String getSeqNo() {
return seqNo;
return this.seqNo;
}
public void setSeqNo(String seqNo) {
......@@ -98,7 +98,7 @@ public class TspSaveReq implements Serializable {
}
public String getCompensationName() {
return compensationName;
return this.compensationName;
}
public void setCompensationName(String compensationName) {
......@@ -106,7 +106,7 @@ public class TspSaveReq implements Serializable {
}
public String getAddress() {
return address;
return this.address;
}
public void setAddress(String address) {
......@@ -114,7 +114,7 @@ public class TspSaveReq implements Serializable {
}
public String getCustomerType() {
return customerType;
return this.customerType;
}
public void setCustomerType(String customerType) {
......@@ -122,7 +122,7 @@ public class TspSaveReq implements Serializable {
}
public String getCardType() {
return cardType;
return this.cardType;
}
public void setCardType(String cardType) {
......@@ -130,7 +130,7 @@ public class TspSaveReq implements Serializable {
}
public String getCardNo() {
return cardNo;
return this.cardNo;
}
public void setCardNo(String cardNo) {
......@@ -138,7 +138,7 @@ public class TspSaveReq implements Serializable {
}
public String getName() {
return name;
return this.name;
}
public void setName(String name) {
......@@ -146,7 +146,7 @@ public class TspSaveReq implements Serializable {
}
public String getPhone() {
return phone;
return this.phone;
}
public void setPhone(String phone) {
......@@ -154,7 +154,7 @@ public class TspSaveReq implements Serializable {
}
public String getEffectDate() {
return effectDate;
return this.effectDate;
}
public void setEffectDate(String effectDate) {
......@@ -162,7 +162,7 @@ public class TspSaveReq implements Serializable {
}
public String getInsurePeriod() {
return insurePeriod;
return this.insurePeriod;
}
public void setInsurePeriod(String insurePeriod) {
......@@ -170,7 +170,7 @@ public class TspSaveReq implements Serializable {
}
public String getSumAmount() {
return sumAmount;
return this.sumAmount;
}
public void setSumAmount(String sumAmount) {
......@@ -178,7 +178,7 @@ public class TspSaveReq implements Serializable {
}
public String getStandNo() {
return standNo;
return this.standNo;
}
public void setStandNo(String standNo) {
......@@ -186,7 +186,7 @@ public class TspSaveReq implements Serializable {
}
public String getEngine() {
return engine;
return this.engine;
}
public void setEngine(String engine) {
......@@ -194,7 +194,7 @@ public class TspSaveReq implements Serializable {
}
public String getBuyType() {
return buyType;
return this.buyType;
}
public void setBuyType(String buyType) {
......@@ -202,7 +202,7 @@ public class TspSaveReq implements Serializable {
}
public String getVehicleColor() {
return vehicleColor;
return this.vehicleColor;
}
public void setVehicleColor(String vehicleColor) {
......@@ -210,7 +210,7 @@ public class TspSaveReq implements Serializable {
}
public String getVehicleBrand() {
return vehicleBrand;
return this.vehicleBrand;
}
public void setVehicleBrand(String vehicleBrand) {
......@@ -218,7 +218,7 @@ public class TspSaveReq implements Serializable {
}
public String getVehicleChildsBrandName() {
return vehicleChildsBrandName;
return this.vehicleChildsBrandName;
}
public void setVehicleChildsBrandName(String vehicleChildsBrandName) {
......@@ -226,7 +226,7 @@ public class TspSaveReq implements Serializable {
}
public String getVehicleSeriesName() {
return vehicleSeriesName;
return this.vehicleSeriesName;
}
public void setVehicleSeriesName(String vehicleSeriesName) {
......@@ -234,7 +234,7 @@ public class TspSaveReq implements Serializable {
}
public BigDecimal getVehiclePrice() {
return vehiclePrice;
return this.vehiclePrice;
}
public void setVehiclePrice(BigDecimal vehiclePrice) {
......@@ -242,7 +242,7 @@ public class TspSaveReq implements Serializable {
}
public String getVehicleUsage() {
return vehicleUsage;
return this.vehicleUsage;
}
public void setVehicleUsage(String vehicleUsage) {
......@@ -250,7 +250,7 @@ public class TspSaveReq implements Serializable {
}
public String getPlanNo() {
return planNo;
return this.planNo;
}
public void setPlanNo(String planNo) {
......@@ -258,7 +258,7 @@ public class TspSaveReq implements Serializable {
}
public String getBirthday() {
return birthday;
return this.birthday;
}
public void setBirthday(String birthday) {
......@@ -266,7 +266,7 @@ public class TspSaveReq implements Serializable {
}
public String getSex() {
return sex;
return this.sex;
}
public void setSex(String sex) {
......@@ -274,7 +274,7 @@ public class TspSaveReq implements Serializable {
}
public String getInstallPoint() {
return installPoint;
return this.installPoint;
}
public void setInstallPoint(String installPoint) {
......@@ -282,7 +282,7 @@ public class TspSaveReq implements Serializable {
}
public String getInstallPerson() {
return installPerson;
return this.installPerson;
}
public void setInstallPerson(String installPerson) {
......@@ -290,7 +290,7 @@ public class TspSaveReq implements Serializable {
}
public String getSpid() {
return spid;
return this.spid;
}
public void setSpid(String spid) {
......@@ -298,7 +298,7 @@ public class TspSaveReq implements Serializable {
}
public String getSpecialContent() {
return specialContent;
return this.specialContent;
}
public void setSpecialContent(String specialContent) {
......@@ -306,7 +306,7 @@ public class TspSaveReq implements Serializable {
}
public String getDeviceName() {
return deviceName;
return this.deviceName;
}
public void setDeviceName(String deviceName) {
......@@ -314,7 +314,7 @@ public class TspSaveReq implements Serializable {
}
public String getProductType() {
return productType;
return this.productType;
}
public void setProductType(String productType) {
......@@ -322,7 +322,7 @@ public class TspSaveReq implements Serializable {
}
public String getDeviceType() {
return deviceType;
return this.deviceType;
}
public void setDeviceType(String deviceType) {
......@@ -330,7 +330,7 @@ public class TspSaveReq implements Serializable {
}
public String getSn() {
return sn;
return this.sn;
}
public void setSn(String sn) {
......@@ -338,7 +338,7 @@ public class TspSaveReq implements Serializable {
}
public String getActiveDate() {
return activeDate;
return this.activeDate;
}
public void setActiveDate(String activeDate) {
......@@ -346,7 +346,7 @@ public class TspSaveReq implements Serializable {
}
public String getPlateNum() {
return plateNum;
return this.plateNum;
}
public void setPlateNum(String plateNum) {
......@@ -354,7 +354,7 @@ public class TspSaveReq implements Serializable {
}
public String getVehicleTypeName() {
return vehicleTypeName;
return this.vehicleTypeName;
}
public void setVehicleTypeName(String vehicleTypeName) {
......@@ -362,7 +362,7 @@ public class TspSaveReq implements Serializable {
}
public String getShopName() {
return shopName;
return this.shopName;
}
public void setShopName(String shopName) {
......@@ -370,7 +370,7 @@ public class TspSaveReq implements Serializable {
}
public String getFixTime() {
return fixTime;
return this.fixTime;
}
public void setFixTime(String fixTime) {
......
package com.glsx.ordercenter.dto.insurance;
package com.glsx.ordercenter.dto.req;
import java.io.Serializable;
import java.math.BigDecimal;
......@@ -62,7 +62,7 @@ public class TspUpdateReq implements Serializable {
private Long sumPremium;
public Long getSumPremium() {
return sumPremium;
return this.sumPremium;
}
public void setSumPremium(Long sumPremium) {
......@@ -70,7 +70,7 @@ public class TspUpdateReq implements Serializable {
}
public String getInsuranceCompany() {
return insuranceCompany;
return this.insuranceCompany;
}
public void setInsuranceCompany(String insuranceCompany) {
......@@ -78,7 +78,7 @@ public class TspUpdateReq implements Serializable {
}
public String getFullInsuranceNo() {
return fullInsuranceNo;
return this.fullInsuranceNo;
}
public void setFullInsuranceNo(String fullInsuranceNo) {
......@@ -86,7 +86,7 @@ public class TspUpdateReq implements Serializable {
}
public String getSeqNo() {
return seqNo;
return this.seqNo;
}
public void setSeqNo(String seqNo) {
......@@ -94,7 +94,7 @@ public class TspUpdateReq implements Serializable {
}
public String getCompensationName() {
return compensationName;
return this.compensationName;
}
public void setCompensationName(String compensationName) {
......@@ -102,7 +102,7 @@ public class TspUpdateReq implements Serializable {
}
public String getAddress() {
return address;
return this.address;
}
public void setAddress(String address) {
......@@ -110,7 +110,7 @@ public class TspUpdateReq implements Serializable {
}
public String getCustomerType() {
return customerType;
return this.customerType;
}
public void setCustomerType(String customerType) {
......@@ -118,7 +118,7 @@ public class TspUpdateReq implements Serializable {
}
public String getCardType() {
return cardType;
return this.cardType;
}
public void setCardType(String cardType) {
......@@ -126,7 +126,7 @@ public class TspUpdateReq implements Serializable {
}
public String getBirthday() {
return birthday;
return this.birthday;
}
public void setBirthday(String birthday) {
......@@ -134,7 +134,7 @@ public class TspUpdateReq implements Serializable {
}
public String getCardNo() {
return cardNo;
return this.cardNo;
}
public void setCardNo(String cardNo) {
......@@ -142,7 +142,7 @@ public class TspUpdateReq implements Serializable {
}
public String getName() {
return name;
return this.name;
}
public void setName(String name) {
......@@ -150,7 +150,7 @@ public class TspUpdateReq implements Serializable {
}
public String getSex() {
return sex;
return this.sex;
}
public void setSex(String sex) {
......@@ -158,7 +158,7 @@ public class TspUpdateReq implements Serializable {
}
public String getPhone() {
return phone;
return this.phone;
}
public void setPhone(String phone) {
......@@ -166,7 +166,7 @@ public class TspUpdateReq implements Serializable {
}
public String getEffectDate() {
return effectDate;
return this.effectDate;
}
public void setEffectDate(String effectDate) {
......@@ -174,7 +174,7 @@ public class TspUpdateReq implements Serializable {
}
public String getInsurePeriod() {
return insurePeriod;
return this.insurePeriod;
}
public void setInsurePeriod(String insurePeriod) {
......@@ -182,7 +182,7 @@ public class TspUpdateReq implements Serializable {
}
public String getInstallPoint() {
return installPoint;
return this.installPoint;
}
public void setInstallPoint(String installPoint) {
......@@ -190,7 +190,7 @@ public class TspUpdateReq implements Serializable {
}
public String getInstallPerson() {
return installPerson;
return this.installPerson;
}
public void setInstallPerson(String installPerson) {
......@@ -198,7 +198,7 @@ public class TspUpdateReq implements Serializable {
}
public String getSumAmount() {
return sumAmount;
return this.sumAmount;
}
public void setSumAmount(String sumAmount) {
......@@ -206,7 +206,7 @@ public class TspUpdateReq implements Serializable {
}
public String getSpid() {
return spid;
return this.spid;
}
public void setSpid(String spid) {
......@@ -214,7 +214,7 @@ public class TspUpdateReq implements Serializable {
}
public String getSpecialContent() {
return specialContent;
return this.specialContent;
}
public void setSpecialContent(String specialContent) {
......@@ -222,7 +222,7 @@ public class TspUpdateReq implements Serializable {
}
public String getStandNo() {
return standNo;
return this.standNo;
}
public void setStandNo(String standNo) {
......@@ -230,7 +230,7 @@ public class TspUpdateReq implements Serializable {
}
public String getPlateNum() {
return plateNum;
return this.plateNum;
}
public void setPlateNum(String plateNum) {
......@@ -238,7 +238,7 @@ public class TspUpdateReq implements Serializable {
}
public String getEngine() {
return engine;
return this.engine;
}
public void setEngine(String engine) {
......@@ -246,7 +246,7 @@ public class TspUpdateReq implements Serializable {
}
public String getBuyType() {
return buyType;
return this.buyType;
}
public void setBuyType(String buyType) {
......@@ -254,7 +254,7 @@ public class TspUpdateReq implements Serializable {
}
public String getVehicleColor() {
return vehicleColor;
return this.vehicleColor;
}
public void setVehicleColor(String vehicleColor) {
......@@ -262,7 +262,7 @@ public class TspUpdateReq implements Serializable {
}
public String getVehicleBrand() {
return vehicleBrand;
return this.vehicleBrand;
}
public void setVehicleBrand(String vehicleBrand) {
......@@ -270,7 +270,7 @@ public class TspUpdateReq implements Serializable {
}
public String getVehicleChildsBrandName() {
return vehicleChildsBrandName;
return this.vehicleChildsBrandName;
}
public void setVehicleChildsBrandName(String vehicleChildsBrandName) {
......@@ -278,7 +278,7 @@ public class TspUpdateReq implements Serializable {
}
public String getVehicleSeriesName() {
return vehicleSeriesName;
return this.vehicleSeriesName;
}
public void setVehicleSeriesName(String vehicleSeriesName) {
......@@ -286,7 +286,7 @@ public class TspUpdateReq implements Serializable {
}
public String getVehicleTypeName() {
return vehicleTypeName;
return this.vehicleTypeName;
}
public void setVehicleTypeName(String vehicleTypeName) {
......@@ -294,7 +294,7 @@ public class TspUpdateReq implements Serializable {
}
public BigDecimal getVehiclePrice() {
return vehiclePrice;
return this.vehiclePrice;
}
public void setVehiclePrice(BigDecimal vehiclePrice) {
......@@ -302,7 +302,7 @@ public class TspUpdateReq implements Serializable {
}
public String getVehicleUsage() {
return vehicleUsage;
return this.vehicleUsage;
}
public void setVehicleUsage(String vehicleUsage) {
......@@ -310,7 +310,7 @@ public class TspUpdateReq implements Serializable {
}
public String getShopName() {
return shopName;
return this.shopName;
}
public void setShopName(String shopName) {
......@@ -318,7 +318,7 @@ public class TspUpdateReq implements Serializable {
}
public String getFixTime() {
return fixTime;
return this.fixTime;
}
public void setFixTime(String fixTime) {
......
package com.glsx.ordercenter.dto.insurance;
package com.glsx.ordercenter.dto.resp;
import java.io.Serializable;
import com.glsx.excel.poi.annotation.ExcelColumn;
import com.glsx.excel.poi.annotation.ExcelExport;
/**
* <p>Description: 保单列表响应体
* <p>Description: 保单相关响应体
*
* <p>Project: car-service
*
......@@ -13,7 +13,7 @@ import com.glsx.excel.poi.annotation.ExcelExport;
* @date 2020-05-22
*/
@ExcelExport
public class InsuranceQueryResp implements Serializable {
public class InsuranceResp implements Serializable {
/**
* ID
*/
......@@ -112,6 +112,22 @@ public class InsuranceQueryResp implements Serializable {
*/
@ExcelColumn(value = "备注", index = 17)
private String responseData;
/**
* 客户类型
*/
private Byte customerType;
/**
* 联系地址
*/
private String vehicleOwnerAddress;
/**
* 车辆颜色
*/
private String vehicleColor;
/**
* PDF地址
*/
private String insurancePdf;
public Integer getId() {
return this.id;
......@@ -273,9 +289,41 @@ public class InsuranceQueryResp implements Serializable {
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
public String toString() {
return "InsuranceQueryResp{" +
return "InsuranceResp{" +
"id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' +
", vehicleOwnerName='" + this.vehicleOwnerName + '\'' +
......@@ -296,6 +344,10 @@ public class InsuranceQueryResp implements Serializable {
", vehicleInvoiceMoney='" + this.vehicleInvoiceMoney + '\'' +
", tastingUnit='" + this.tastingUnit + '\'' +
", responseData='" + this.responseData + '\'' +
", customerType=" + this.customerType +
", vehicleOwnerAddress='" + this.vehicleOwnerAddress + '\'' +
", vehicleColor='" + this.vehicleColor + '\'' +
", insurancePdf='" + this.insurancePdf + '\'' +
'}';
}
}
package com.glsx.ordercenter.dto.resp;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import java.io.Serializable;
import com.glsx.ordercenter.constants.ResultCodeEnum;
/**
* @author think.wang
......@@ -26,6 +25,8 @@ public class OraResultObject implements Serializable {
private String insuranceId; //保单id
public OraResultObject() {
this.code = ResultCodeEnum.SUCCESS.getCode();
this.message = ResultCodeEnum.SUCCESS.getMsg();
}
/**
......@@ -85,8 +86,12 @@ public class OraResultObject implements Serializable {
return this;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public int getCode() {
return code;
return this.code;
}
public void setCode(int code) {
......@@ -94,7 +99,7 @@ public class OraResultObject implements Serializable {
}
public String getMessage() {
return message;
return this.message;
}
public void setMessage(String message) {
......@@ -102,7 +107,7 @@ public class OraResultObject implements Serializable {
}
public Object getData() {
return data;
return this.data;
}
public void setData(Object data) {
......@@ -110,17 +115,29 @@ public class OraResultObject implements Serializable {
}
public String getOrderId() {
return orderId;
return this.orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getInsuranceId() {
return this.insuranceId;
}
public void setInsuranceId(String insuranceId) {
this.insuranceId = insuranceId;
}
@Override
public String toString() {
return "ResultObject [code=" + code + ", message=" + message
+ ", data=" + data + ", orderId=" + orderId + ", insuranceId=" + insuranceId+ "]";
return "OraResultObject{" +
"code=" + this.code +
", message='" + this.message + '\'' +
", data=" + this.data +
", orderId='" + this.orderId + '\'' +
", insuranceId='" + this.insuranceId + '\'' +
'}';
}
}
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;
import java.util.List;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
@Repository
public interface SysInsurancePolicyMapper {
long countByExample(SysInsurancePolicyExample example);
int deleteByExample(SysInsurancePolicyExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysInsurancePolicy record);
int insertSelective(SysInsurancePolicy record);
List<SysInsurancePolicy> selectByExample(SysInsurancePolicyExample example);
SysInsurancePolicy selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysInsurancePolicy record,
@Param("example") SysInsurancePolicyExample example);
int updateByExample(@Param("record") SysInsurancePolicy record,
@Param("example") SysInsurancePolicyExample example);
int updateByPrimaryKeySelective(SysInsurancePolicy record);
int updateByPrimaryKey(SysInsurancePolicy record);
Long selectCount(SysInsurancePolicyExample example);
}
package com.glsx.ordercenter.mapper.insurance;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-29
*/
public interface SysInsurancePolicyMapper {
long countByExample(SysInsurancePolicyExample example);
int deleteByExample(SysInsurancePolicyExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysInsurancePolicy record);
int insertSelective(SysInsurancePolicy record);
List<SysInsurancePolicy> selectByExample(SysInsurancePolicyExample example);
SysInsurancePolicy selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysInsurancePolicy record,
@Param("example") SysInsurancePolicyExample example);
int updateByExample(@Param("record") SysInsurancePolicy record,
@Param("example") SysInsurancePolicyExample example);
int updateByPrimaryKeySelective(SysInsurancePolicy record);
int updateByPrimaryKey(SysInsurancePolicy record);
Long selectCount(SysInsurancePolicyExample example);
}
\ No newline at end of file
package com.glsx.ordercenter.pojo.insurance;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
*/
/**
* 保单信息表
*/
public class SysInsurancePolicy {
/**
* ID
*/
private Integer id;
/**
* 第三方公司保单id
*/
private String insuranceId;
/**
* 保单来源:1长城欧拉
*/
private Byte source;
/**
* 保险状态(1待投保 2已投保 9已退保)
*/
private Byte status;
/**
* 保险公司保单号
*/
private String insuranceNo;
/**
* 保单序列号
*/
private String insuranceSeqNo;
/**
* 保险公司名称(华安:sinosafe,富德:sinofd,阳光:sinosig,人保:picc)
*/
private String insuranceCompany;
/**
* 设备sn
*/
private String gpsNo;
/**
* 设备安装时间
*/
private Date installationTime;
/**
* 车架号
*/
private String vin;
/**
* 车牌号
*/
private String vehicleNo;
/**
* 发动机号
*/
private String engineNumber;
/**
* 品牌车型
*/
private String carBrand;
/**
* 车辆类型(1:新车 2:二手车 3:进口车)
*/
private Byte vehicleType;
/**
* 车主姓名
*/
private String vehicleOwnerName;
/**
* 车主电话
*/
private String phone;
/**
* 车主地址
*/
private String vehicleOwnerAddress;
/**
* 客户类型(1:个人 2:企业)
*/
private Byte customerType;
/**
* 证件类型(1.身份证 2.统一社会信用代码 3.其他)
*/
private Byte idCardType;
/**
* 证件号码
*/
private String idCardNum;
/**
* 保险商品(1:盗抢监控服务)
*/
private Boolean insuranceCommodity;
/**
* 险额
*/
private BigDecimal pilferInsuranceMoney;
/**
* 保险期限(默认单位:年)
*/
private Integer insurancePeriod;
/**
* 车辆颜色
*/
private String vehicleColor;
/**
* 车辆价格
*/
private BigDecimal vehicleInvoiceMoney;
/**
* 受偿单位(第一受益人)
*/
private String tastingUnit;
/**
* 备注
*/
private String remark;
/**
* 预计生效时间
*/
private Date expectedEffectiveTime;
/**
* 实际生效时间
*/
private Date realEffectiveTime;
/**
* 保单信息地址
*/
private String insurancePdf;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
/**
* 第三方公司接口传入数据
*/
private String responseData;
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;
}
public Byte getSource() {
return this.source;
}
public void setSource(Byte source) {
this.source = source;
}
public Byte getStatus() {
return this.status;
}
public void setStatus(Byte status) {
this.status = status;
}
public String getInsuranceNo() {
return this.insuranceNo;
}
public void setInsuranceNo(String insuranceNo) {
this.insuranceNo = insuranceNo;
}
public String getInsuranceSeqNo() {
return this.insuranceSeqNo;
}
public void setInsuranceSeqNo(String insuranceSeqNo) {
this.insuranceSeqNo = insuranceSeqNo;
}
public String getInsuranceCompany() {
return this.insuranceCompany;
}
public void setInsuranceCompany(String insuranceCompany) {
this.insuranceCompany = insuranceCompany;
}
public String getGpsNo() {
return this.gpsNo;
}
public void setGpsNo(String gpsNo) {
this.gpsNo = gpsNo;
}
public Date getInstallationTime() {
return this.installationTime;
}
public void setInstallationTime(Date installationTime) {
this.installationTime = installationTime;
}
public String getVin() {
return this.vin;
}
public void setVin(String vin) {
this.vin = vin;
}
public String getVehicleNo() {
return this.vehicleNo;
}
public void setVehicleNo(String vehicleNo) {
this.vehicleNo = vehicleNo;
}
public String getEngineNumber() {
return this.engineNumber;
}
public void setEngineNumber(String engineNumber) {
this.engineNumber = engineNumber;
}
public String getCarBrand() {
return this.carBrand;
}
public void setCarBrand(String carBrand) {
this.carBrand = carBrand;
}
public Byte getVehicleType() {
return this.vehicleType;
}
public void setVehicleType(Byte vehicleType) {
this.vehicleType = vehicleType;
}
public String getVehicleOwnerName() {
return this.vehicleOwnerName;
}
public void setVehicleOwnerName(String vehicleOwnerName) {
this.vehicleOwnerName = vehicleOwnerName;
}
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getVehicleOwnerAddress() {
return this.vehicleOwnerAddress;
}
public void setVehicleOwnerAddress(String vehicleOwnerAddress) {
this.vehicleOwnerAddress = vehicleOwnerAddress;
}
public Byte getCustomerType() {
return this.customerType;
}
public void setCustomerType(Byte customerType) {
this.customerType = customerType;
}
public Byte getIdCardType() {
return this.idCardType;
}
public void setIdCardType(Byte idCardType) {
this.idCardType = idCardType;
}
public String getIdCardNum() {
return this.idCardNum;
}
public void setIdCardNum(String idCardNum) {
this.idCardNum = idCardNum;
}
public Boolean getInsuranceCommodity() {
return this.insuranceCommodity;
}
public void setInsuranceCommodity(Boolean insuranceCommodity) {
this.insuranceCommodity = insuranceCommodity;
}
public BigDecimal getPilferInsuranceMoney() {
return this.pilferInsuranceMoney;
}
public void setPilferInsuranceMoney(BigDecimal pilferInsuranceMoney) {
this.pilferInsuranceMoney = pilferInsuranceMoney;
}
public Integer getInsurancePeriod() {
return this.insurancePeriod;
}
public void setInsurancePeriod(Integer insurancePeriod) {
this.insurancePeriod = insurancePeriod;
}
public String getVehicleColor() {
return this.vehicleColor;
}
public void setVehicleColor(String vehicleColor) {
this.vehicleColor = vehicleColor;
}
public BigDecimal getVehicleInvoiceMoney() {
return this.vehicleInvoiceMoney;
}
public void setVehicleInvoiceMoney(BigDecimal vehicleInvoiceMoney) {
this.vehicleInvoiceMoney = vehicleInvoiceMoney;
}
public String getTastingUnit() {
return this.tastingUnit;
}
public void setTastingUnit(String tastingUnit) {
this.tastingUnit = tastingUnit;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getExpectedEffectiveTime() {
return this.expectedEffectiveTime;
}
public void setExpectedEffectiveTime(Date expectedEffectiveTime) {
this.expectedEffectiveTime = expectedEffectiveTime;
}
public Date getRealEffectiveTime() {
return this.realEffectiveTime;
}
public void setRealEffectiveTime(Date realEffectiveTime) {
this.realEffectiveTime = realEffectiveTime;
}
public String getInsurancePdf() {
return this.insurancePdf;
}
public void setInsurancePdf(String insurancePdf) {
this.insurancePdf = insurancePdf;
}
public Date getCreateTime() {
return this.createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return this.createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return this.updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getResponseData() {
return this.responseData;
}
public void setResponseData(String responseData) {
this.responseData = responseData;
}
@Override
public String toString() {
return "SysInsurancePolicy{" +
"id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' +
", source=" + this.source +
", status=" + this.status +
", insuranceNo='" + this.insuranceNo + '\'' +
", insuranceSeqNo='" + this.insuranceSeqNo + '\'' +
", insuranceCompany='" + this.insuranceCompany + '\'' +
", gpsNo='" + this.gpsNo + '\'' +
", installationTime=" + this.installationTime +
", vin='" + this.vin + '\'' +
", vehicleNo='" + this.vehicleNo + '\'' +
", engineNumber='" + this.engineNumber + '\'' +
", carBrand='" + this.carBrand + '\'' +
", vehicleType=" + this.vehicleType +
", vehicleOwnerName='" + this.vehicleOwnerName + '\'' +
", phone='" + this.phone + '\'' +
", vehicleOwnerAddress='" + this.vehicleOwnerAddress + '\'' +
", customerType=" + this.customerType +
", idCardType=" + this.idCardType +
", idCardNum='" + this.idCardNum + '\'' +
", insuranceCommodity=" + this.insuranceCommodity +
", pilferInsuranceMoney=" + this.pilferInsuranceMoney +
", insurancePeriod=" + this.insurancePeriod +
", vehicleColor='" + this.vehicleColor + '\'' +
", vehicleInvoiceMoney=" + this.vehicleInvoiceMoney +
", tastingUnit='" + this.tastingUnit + '\'' +
", remark='" + this.remark + '\'' +
", expectedEffectiveTime=" + this.expectedEffectiveTime +
", realEffectiveTime=" + this.realEffectiveTime +
", insurancePdf='" + this.insurancePdf + '\'' +
", createTime=" + this.createTime +
", updateTime=" + this.updateTime +
", createBy=" + this.createBy +
", updateBy=" + this.updateBy +
", responseData='" + this.responseData + '\'' +
'}';
}
}
package com.glsx.ordercenter.pojo.insurance;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>Description:
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-29
*/
/**
* 保单信息表
*/
public class SysInsurancePolicy {
/**
* ID
*/
private Integer id;
/**
* 第三方公司保单id
*/
private String insuranceId;
/**
* 保单来源:1长城欧拉
*/
private Byte source;
/**
* 保险状态(1待投保 2已投保 3投保失败 9已退保)
*/
private Byte status;
/**
* 保险公司保单号
*/
private String insuranceNo;
/**
* 保单序列号
*/
private String insuranceSeqNo;
/**
* 保险公司名称(华安:sinosafe,富德:sinofd,阳光:sinosig,人保:picc)
*/
private String insuranceCompany;
/**
* 设备sn
*/
private String gpsNo;
/**
* 设备安装时间
*/
private Date installationTime;
/**
* 车架号
*/
private String vin;
/**
* 车牌号
*/
private String vehicleNo;
/**
* 发动机号
*/
private String engineNumber;
/**
* 品牌车型
*/
private String carBrand;
/**
* 车辆类型(1:新车 2:二手车 3:进口车)
*/
private Byte vehicleType;
/**
* 车主姓名
*/
private String vehicleOwnerName;
/**
* 车主电话
*/
private String phone;
/**
* 车主地址
*/
private String vehicleOwnerAddress;
/**
* 客户类型(1:个人 2:企业)
*/
private Byte customerType;
/**
* 证件类型(1.身份证 2.统一社会信用代码 3.其他)
*/
private Byte idCardType;
/**
* 证件号码
*/
private String idCardNum;
/**
* 保险商品(1:盗抢监控服务)
*/
private Boolean insuranceCommodity;
/**
* 险额
*/
private BigDecimal pilferInsuranceMoney;
/**
* 保险期限(默认单位:年)
*/
private Integer insurancePeriod;
/**
* 车辆颜色
*/
private String vehicleColor;
/**
* 车辆价格
*/
private BigDecimal vehicleInvoiceMoney;
/**
* 受偿单位(第一受益人)
*/
private String tastingUnit;
/**
* 退保原因
*/
private String cancelReason;
/**
* 备注
*/
private String remark;
/**
* 预计生效时间
*/
private Date expectedEffectiveTime;
/**
* 实际生效时间
*/
private Date realEffectiveTime;
/**
* 保单信息地址
*/
private String insurancePdf;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
/**
* 第三方公司接口传入数据
*/
private String responseData;
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;
}
public Byte getSource() {
return this.source;
}
public void setSource(Byte source) {
this.source = source;
}
public Byte getStatus() {
return this.status;
}
public void setStatus(Byte status) {
this.status = status;
}
public String getInsuranceNo() {
return this.insuranceNo;
}
public void setInsuranceNo(String insuranceNo) {
this.insuranceNo = insuranceNo;
}
public String getInsuranceSeqNo() {
return this.insuranceSeqNo;
}
public void setInsuranceSeqNo(String insuranceSeqNo) {
this.insuranceSeqNo = insuranceSeqNo;
}
public String getInsuranceCompany() {
return this.insuranceCompany;
}
public void setInsuranceCompany(String insuranceCompany) {
this.insuranceCompany = insuranceCompany;
}
public String getGpsNo() {
return this.gpsNo;
}
public void setGpsNo(String gpsNo) {
this.gpsNo = gpsNo;
}
public Date getInstallationTime() {
return this.installationTime;
}
public void setInstallationTime(Date installationTime) {
this.installationTime = installationTime;
}
public String getVin() {
return this.vin;
}
public void setVin(String vin) {
this.vin = vin;
}
public String getVehicleNo() {
return this.vehicleNo;
}
public void setVehicleNo(String vehicleNo) {
this.vehicleNo = vehicleNo;
}
public String getEngineNumber() {
return this.engineNumber;
}
public void setEngineNumber(String engineNumber) {
this.engineNumber = engineNumber;
}
public String getCarBrand() {
return this.carBrand;
}
public void setCarBrand(String carBrand) {
this.carBrand = carBrand;
}
public Byte getVehicleType() {
return this.vehicleType;
}
public void setVehicleType(Byte vehicleType) {
this.vehicleType = vehicleType;
}
public String getVehicleOwnerName() {
return this.vehicleOwnerName;
}
public void setVehicleOwnerName(String vehicleOwnerName) {
this.vehicleOwnerName = vehicleOwnerName;
}
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getVehicleOwnerAddress() {
return this.vehicleOwnerAddress;
}
public void setVehicleOwnerAddress(String vehicleOwnerAddress) {
this.vehicleOwnerAddress = vehicleOwnerAddress;
}
public Byte getCustomerType() {
return this.customerType;
}
public void setCustomerType(Byte customerType) {
this.customerType = customerType;
}
public Byte getIdCardType() {
return this.idCardType;
}
public void setIdCardType(Byte idCardType) {
this.idCardType = idCardType;
}
public String getIdCardNum() {
return this.idCardNum;
}
public void setIdCardNum(String idCardNum) {
this.idCardNum = idCardNum;
}
public Boolean getInsuranceCommodity() {
return this.insuranceCommodity;
}
public void setInsuranceCommodity(Boolean insuranceCommodity) {
this.insuranceCommodity = insuranceCommodity;
}
public BigDecimal getPilferInsuranceMoney() {
return this.pilferInsuranceMoney;
}
public void setPilferInsuranceMoney(BigDecimal pilferInsuranceMoney) {
this.pilferInsuranceMoney = pilferInsuranceMoney;
}
public Integer getInsurancePeriod() {
return this.insurancePeriod;
}
public void setInsurancePeriod(Integer insurancePeriod) {
this.insurancePeriod = insurancePeriod;
}
public String getVehicleColor() {
return this.vehicleColor;
}
public void setVehicleColor(String vehicleColor) {
this.vehicleColor = vehicleColor;
}
public BigDecimal getVehicleInvoiceMoney() {
return this.vehicleInvoiceMoney;
}
public void setVehicleInvoiceMoney(BigDecimal vehicleInvoiceMoney) {
this.vehicleInvoiceMoney = vehicleInvoiceMoney;
}
public String getTastingUnit() {
return this.tastingUnit;
}
public void setTastingUnit(String tastingUnit) {
this.tastingUnit = tastingUnit;
}
public String getCancelReason() {
return this.cancelReason;
}
public void setCancelReason(String cancelReason) {
this.cancelReason = cancelReason;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getExpectedEffectiveTime() {
return this.expectedEffectiveTime;
}
public void setExpectedEffectiveTime(Date expectedEffectiveTime) {
this.expectedEffectiveTime = expectedEffectiveTime;
}
public Date getRealEffectiveTime() {
return this.realEffectiveTime;
}
public void setRealEffectiveTime(Date realEffectiveTime) {
this.realEffectiveTime = realEffectiveTime;
}
public String getInsurancePdf() {
return this.insurancePdf;
}
public void setInsurancePdf(String insurancePdf) {
this.insurancePdf = insurancePdf;
}
public Date getCreateTime() {
return this.createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return this.createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return this.updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getResponseData() {
return this.responseData;
}
public void setResponseData(String responseData) {
this.responseData = responseData;
}
@Override
public String toString() {
return "SysInsurancePolicy{" +
"id=" + this.id +
", insuranceId='" + this.insuranceId + '\'' +
", source=" + this.source +
", status=" + this.status +
", insuranceNo='" + this.insuranceNo + '\'' +
", insuranceSeqNo='" + this.insuranceSeqNo + '\'' +
", insuranceCompany='" + this.insuranceCompany + '\'' +
", gpsNo='" + this.gpsNo + '\'' +
", installationTime=" + this.installationTime +
", vin='" + this.vin + '\'' +
", vehicleNo='" + this.vehicleNo + '\'' +
", engineNumber='" + this.engineNumber + '\'' +
", carBrand='" + this.carBrand + '\'' +
", vehicleType=" + this.vehicleType +
", vehicleOwnerName='" + this.vehicleOwnerName + '\'' +
", phone='" + this.phone + '\'' +
", vehicleOwnerAddress='" + this.vehicleOwnerAddress + '\'' +
", customerType=" + this.customerType +
", idCardType=" + this.idCardType +
", idCardNum='" + this.idCardNum + '\'' +
", insuranceCommodity=" + this.insuranceCommodity +
", pilferInsuranceMoney=" + this.pilferInsuranceMoney +
", insurancePeriod=" + this.insurancePeriod +
", vehicleColor='" + this.vehicleColor + '\'' +
", vehicleInvoiceMoney=" + this.vehicleInvoiceMoney +
", tastingUnit='" + this.tastingUnit + '\'' +
", cancelReason='" + this.cancelReason + '\'' +
", remark='" + this.remark + '\'' +
", expectedEffectiveTime=" + this.expectedEffectiveTime +
", realEffectiveTime=" + this.realEffectiveTime +
", insurancePdf='" + this.insurancePdf + '\'' +
", createTime=" + this.createTime +
", updateTime=" + this.updateTime +
", createBy=" + this.createBy +
", updateBy=" + this.updateBy +
", responseData='" + this.responseData + '\'' +
'}';
}
}
......@@ -11,7 +11,7 @@ import java.util.List;
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-25
* @date 2020-05-29
*/
public class SysInsurancePolicyExample {
......@@ -1825,6 +1825,76 @@ public class SysInsurancePolicyExample {
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() {
this.addCriterion("remark is null");
return (Criteria) this;
......
package com.glsx.ordercenter.service.insurance;
package com.glsx.ordercenter.service;
import com.glsx.ordercenter.dto.common.PagedOrderResponse;
import com.glsx.ordercenter.dto.insurance.InsuranceDetailReq;
import com.glsx.ordercenter.dto.insurance.InsuranceDetailResp;
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;
import com.glsx.common.pojo.PagedResp;
import com.glsx.ordercenter.dto.req.InsuranceReq;
import com.glsx.ordercenter.dto.resp.InsuranceResp;
/**
* <p>Description: 保单列表查询
......@@ -20,32 +16,32 @@ public interface InsuranceService {
/**
* 保单列表查询
*
* @param insuranceQueryReq 请求体
* @param insuranceReq 请求体
* @return 分页后的列表数据
*/
PagedOrderResponse<InsuranceQueryResp> query(InsuranceQueryReq insuranceQueryReq);
PagedResp<InsuranceResp> query(InsuranceReq insuranceReq);
/**
* 保单详情查询
*
* @param insuranceDetailReq 请求体
* @param insuranceReq 请求体
* @return 分页后的详情数据
*/
PagedOrderResponse<InsuranceDetailResp> detail(InsuranceDetailReq insuranceDetailReq);
PagedResp<InsuranceResp> detail(InsuranceReq insuranceReq);
/**
* 保单下载
*
* @param insuranceDetailReq 请求体
* @param insuranceReq 请求体
* @return 保单详情,包含保单PDF地址
*/
InsuranceDetailResp download(InsuranceDetailReq insuranceDetailReq);
InsuranceResp download(InsuranceReq insuranceReq);
/**
* 退保
*
* @param insuranceRefundReq 请求体
* @param insuranceReq 请求体
* @return 退保结果
*/
InsuranceRefundResp refund(InsuranceRefundReq insuranceRefundReq);
InsuranceResp refund(InsuranceReq insuranceReq);
}
package com.glsx.ordercenter.service.api;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundReq;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundResp;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateReq;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateResp;
import com.glsx.ordercenter.dto.req.OraInsuranceRefundReq;
import com.glsx.ordercenter.dto.req.OraInsuranceUpdateReq;
import com.glsx.ordercenter.dto.resp.OraResultObject;
/**
* <p>Description:
......@@ -20,7 +19,7 @@ public interface OraInsuranceService {
* @param insuranceUpdateReq 请求体
* @return 更新结果
*/
OraInsuranceUpdateResp update(OraInsuranceUpdateReq insuranceUpdateReq);
OraResultObject update(OraInsuranceUpdateReq insuranceUpdateReq);
/**
* 长城欧拉-退保
......@@ -28,5 +27,5 @@ public interface OraInsuranceService {
* @param insuranceRefundReq 请求体
* @return 退保结果
*/
OraInsuranceRefundResp refund(OraInsuranceRefundReq insuranceRefundReq);
OraResultObject refund(OraInsuranceRefundReq insuranceRefundReq);
}
package com.glsx.ordercenter.service.api.impl;
import java.util.Date;
import java.util.List;
import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.config.ThreadPoolConfig;
import com.glsx.ordercenter.constants.insurance.InsuranceCardType;
import com.glsx.ordercenter.constants.insurance.InsuranceCustomerType;
import com.glsx.ordercenter.constants.insurance.InsuranceStatus;
import com.glsx.ordercenter.constants.insurance.OraResultCode;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundReq;
import com.glsx.ordercenter.dto.api.OraInsuranceRefundResp;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateReq;
import com.glsx.ordercenter.dto.api.OraInsuranceUpdateResp;
import com.glsx.ordercenter.exception.insurance.OraBizException;
import com.glsx.ordercenter.dto.req.OraInsuranceRefundReq;
import com.glsx.ordercenter.dto.req.OraInsuranceUpdateReq;
import com.glsx.ordercenter.dto.resp.OraResultObject;
import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample;
import com.glsx.ordercenter.service.BaseOrderService;
import com.glsx.ordercenter.service.api.OraInsuranceService;
import com.glsx.ordercenter.service.common.BaseOrderService;
import com.glsx.ordercenter.utils.EmilUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -24,9 +25,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.util.Date;
import java.util.List;
/**
* <p>Description:
*
......@@ -36,8 +34,7 @@ import java.util.List;
* @date 2020-05-25
*/
@Service
public class OraInsuranceServiceImpl extends BaseOrderService
implements OraInsuranceService {
public class OraInsuranceServiceImpl extends BaseOrderService implements OraInsuranceService {
@Autowired
private ThreadPoolConfig taskExecutor;
......@@ -48,40 +45,38 @@ public class OraInsuranceServiceImpl extends BaseOrderService
private SysInsurancePolicyMapper insurancePolicyMapper;
@Override
public OraInsuranceUpdateResp update(OraInsuranceUpdateReq insuranceUpdateReq) {
super.logInfo("长城欧拉修改保单-参数", insuranceUpdateReq);
public OraResultObject update(OraInsuranceUpdateReq updateReq) {
super.logInfo("长城欧拉修改保单-参数", updateReq);
OraInsuranceUpdateResp insuranceUpdateResp;
OraResultObject result;
SysInsurancePolicy insurancePolicy = this.getInsurancePolicy(
insuranceUpdateReq.getInsuranceId());
String title = this.buildUpdateMailTitle(insuranceUpdateReq);
String content = this.buildUpdateMailContent(insuranceUpdateReq, insurancePolicy);
SysInsurancePolicy insurancePolicy = this.getInsurancePolicy(updateReq.getInsuranceId());
String title = this.buildUpdateMailTitle(updateReq);
String content = this.buildUpdateMailContent(updateReq, insurancePolicy);
this.sendMail(title, content);
insuranceUpdateResp = this.getUpdateResult(insurancePolicy);
result = this.getUpdateResult(insurancePolicy);
super.logInfo("长城欧拉修改保单-结果", insuranceUpdateResp);
super.logInfo("长城欧拉修改保单-结果", result);
return insuranceUpdateResp;
return result;
}
@Override
public OraInsuranceRefundResp refund(OraInsuranceRefundReq insuranceRefundReq) {
super.logInfo("长城欧拉退保-参数", insuranceRefundReq);
public OraResultObject refund(OraInsuranceRefundReq refundReq) {
super.logInfo("长城欧拉退保-参数", refundReq);
OraInsuranceRefundResp insuranceRefundResp;
OraResultObject result;
SysInsurancePolicy insurancePolicy = this.getInsurancePolicy(
insuranceRefundReq.getInsuranceId());
String title = this.buildRefundMailTitle(insuranceRefundReq);
String content = this.buildRefundMailContent(insuranceRefundReq, insurancePolicy);
SysInsurancePolicy insurancePolicy = this.getInsurancePolicy(refundReq.getInsuranceId());
String title = this.buildRefundMailTitle(refundReq);
String content = this.buildRefundMailContent(refundReq, insurancePolicy);
this.sendMail(title, content);
this.updateInsurancePolicy(insurancePolicy);
insuranceRefundResp = this.getRefundResult(insurancePolicy);
result = this.getRefundResult(insurancePolicy);
this.logInfo("长城欧拉退保-结果", insuranceRefundResp);
this.logInfo("长城欧拉退保-结果", result);
return insuranceRefundResp;
return result;
}
private SysInsurancePolicy getInsurancePolicy(String insuranceId) {
......@@ -90,10 +85,10 @@ public class OraInsuranceServiceImpl extends BaseOrderService
byInsuranceId.andInsuranceIdEqualTo(insuranceId);
List<SysInsurancePolicy> insurancePolicyList =
this.insurancePolicyMapper.selectByExample(example);
this.insurancePolicyMapper.selectByExample(example);
if (insurancePolicyList.isEmpty()) {
throw new OraBizException(OraResultCode.PARAM_ERROR, "保单不存在");
throw SysException.create(OraResultCode.PARAM_ERROR.getCode(), "保单不存在");
}
return insurancePolicyList.get(0);
......@@ -108,129 +103,129 @@ public class OraInsuranceServiceImpl extends BaseOrderService
}
private String buildUpdateMailContent(OraInsuranceUpdateReq insuranceUpdateReq,
SysInsurancePolicy insurancePolicy) {
SysInsurancePolicy insurancePolicy) {
String content = "<table>" +
"<tr>" +
" <td>" + "客户类型" + "</td>" +
" <td>" + InsuranceCustomerType.INDIVIDUAL.getTypeText() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "客户姓名" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleOwnerName() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "证件类型" + "</td>" +
" <td>" + InsuranceCardType.ID_CARD.getTypeText() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "证件号码" + "</td>" +
" <td>" + insuranceUpdateReq.getIdCardNum() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "联系方式" + "</td>" +
" <td>" + insuranceUpdateReq.getPhone() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "联系地址" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleOwnerAddress() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "设备信息" + "</td>" +
" <td>" + insuranceUpdateReq.getGpsNo() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车辆价格" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleInvoiceMoney() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车架号" + "</td>" +
" <td>" + insuranceUpdateReq.getVin() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "品牌车型" + "</td>" +
" <td>" + insuranceUpdateReq.getCarBrand() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "发动机号" + "</td>" +
" <td>" + insuranceUpdateReq.getEngineNumber() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "安装日期" + "</td>" +
" <td>" + insuranceUpdateReq.getInstallationTime() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "生效日期" + "</td>" +
" <td>" + insurancePolicy.getExpectedEffectiveTime() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车身颜色" + "</td>" +
" <td>" + "其他" + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车牌号码" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleNo() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "保单年限" + "</td>" +
" <td>" + insuranceUpdateReq.getInsurancePeriod() + " 年</td>" +
"</tr>" +
"<tr>" +
" <td>" + "第一受益人" + "</td>" +
" <td>" + insuranceUpdateReq.getTastingUnit() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "保单PDF地址" + "</td>" +
" <td>" + insurancePolicy.getInsurancePdf() + "</td>" +
"</tr>" +
"</table>";
"<tr>" +
" <td>" + "客户类型" + "</td>" +
" <td>" + InsuranceCustomerType.INDIVIDUAL.getTypeText() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "客户姓名" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleOwnerName() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "证件类型" + "</td>" +
" <td>" + InsuranceCardType.ID_CARD.getTypeText() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "证件号码" + "</td>" +
" <td>" + insuranceUpdateReq.getIdCardNum() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "联系方式" + "</td>" +
" <td>" + insuranceUpdateReq.getPhone() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "联系地址" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleOwnerAddress() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "设备信息" + "</td>" +
" <td>" + insuranceUpdateReq.getGpsNo() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车辆价格" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleInvoiceMoney() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车架号" + "</td>" +
" <td>" + insuranceUpdateReq.getVin() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "品牌车型" + "</td>" +
" <td>" + insuranceUpdateReq.getCarBrand() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "发动机号" + "</td>" +
" <td>" + insuranceUpdateReq.getEngineNumber() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "安装日期" + "</td>" +
" <td>" + insuranceUpdateReq.getInstallationTime() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "生效日期" + "</td>" +
" <td>" + insurancePolicy.getExpectedEffectiveTime() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车身颜色" + "</td>" +
" <td>" + "其他" + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车牌号码" + "</td>" +
" <td>" + insuranceUpdateReq.getVehicleNo() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "保单年限" + "</td>" +
" <td>" + insuranceUpdateReq.getInsurancePeriod() + " 年</td>" +
"</tr>" +
"<tr>" +
" <td>" + "第一受益人" + "</td>" +
" <td>" + insuranceUpdateReq.getTastingUnit() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "保单PDF地址" + "</td>" +
" <td>" + insurancePolicy.getInsurancePdf() + "</td>" +
"</tr>" +
"</table>";
super.logInfo("长城欧拉修改保单-邮件内容", content);
return content;
}
private String buildRefundMailTitle(OraInsuranceRefundReq insuranceRefundReq) {
private String buildRefundMailTitle(OraInsuranceRefundReq refundReq) {
String title;
title = "包活干保单退保申请:" + insuranceRefundReq.getInsuranceId();
title = "包活干保单退保申请:" + refundReq.getInsuranceId();
return title;
}
private String buildRefundMailContent(OraInsuranceRefundReq insuranceRefundReq,
SysInsurancePolicy insurancePolicy) {
private String buildRefundMailContent(OraInsuranceRefundReq refundReq,
SysInsurancePolicy insurancePolicy) {
String content = "<table>" +
"<tr>" +
" <td>" + "第三方ID" + "</td>" +
" <td>" + insurancePolicy.getInsuranceId() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "客户姓名" + "</td>" +
" <td>" + insurancePolicy.getVehicleOwnerName() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车架号" + "</td>" +
" <td>" + insurancePolicy.getVin() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "设备号" + "</td>" +
" <td>" + insurancePolicy.getGpsNo() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "状态" + "</td>" +
" <td>" + InsuranceStatus.getStatusText(insurancePolicy.getStatus()) + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "提交日期" + "</td>" +
" <td>" + insurancePolicy.getCreateTime() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "生效日期" + "</td>" +
" <td>" + insurancePolicy.getExpectedEffectiveTime() + "</td>" +
"</tr>" +
"</table>";
"<tr>" +
" <td>" + "第三方ID" + "</td>" +
" <td>" + insurancePolicy.getInsuranceId() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "客户姓名" + "</td>" +
" <td>" + insurancePolicy.getVehicleOwnerName() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "车架号" + "</td>" +
" <td>" + insurancePolicy.getVin() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "设备号" + "</td>" +
" <td>" + insurancePolicy.getGpsNo() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "状态" + "</td>" +
" <td>" + InsuranceStatus.getStatusText(insurancePolicy.getStatus()) + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "提交日期" + "</td>" +
" <td>" + insurancePolicy.getCreateTime() + "</td>" +
"</tr>" +
"<tr>" +
" <td>" + "生效日期" + "</td>" +
" <td>" + insurancePolicy.getExpectedEffectiveTime() + "</td>" +
"</tr>" +
"</table>";
super.logInfo("长城欧拉退保-邮件内容", content);
......@@ -238,7 +233,7 @@ public class OraInsuranceServiceImpl extends BaseOrderService
}
private void sendMail(String title, String content) {
taskExecutor.defaultThreadPool().execute(() -> {
this.taskExecutor.defaultThreadPool().execute(() -> {
try {
EmilUtils.sendEmail(this.mailUserName, title, content);
} catch (Exception e) {
......@@ -247,18 +242,18 @@ public class OraInsuranceServiceImpl extends BaseOrderService
});
}
private OraInsuranceUpdateResp getUpdateResult(SysInsurancePolicy insurancePolicy) {
OraInsuranceUpdateResp insuranceUpdateResp = new OraInsuranceUpdateResp();
private OraResultObject getUpdateResult(SysInsurancePolicy insurancePolicy) {
OraResultObject result = new OraResultObject();
insuranceUpdateResp.setInsuranceId(insurancePolicy.getInsuranceId());
result.setInsuranceId(insurancePolicy.getInsuranceId());
return insuranceUpdateResp;
return result;
}
@Transactional(rollbackFor = Exception.class)
public int updateInsurancePolicy(SysInsurancePolicy insurancePolicy) {
ServletRequestAttributes attributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
insurancePolicy.setStatus(InsuranceStatus.REFUNDED.getStatus().byteValue());
insurancePolicy.setUpdateTime(new Date());
......@@ -270,9 +265,11 @@ public class OraInsuranceServiceImpl extends BaseOrderService
return this.insurancePolicyMapper.updateByPrimaryKeySelective(insurancePolicy);
}
public OraInsuranceRefundResp getRefundResult(SysInsurancePolicy insurancePolicy) {
OraInsuranceRefundResp insuranceRefundResp = new OraInsuranceRefundResp();
insuranceRefundResp.setInsuranceId(insurancePolicy.getInsuranceId());
return insuranceRefundResp;
public OraResultObject getRefundResult(SysInsurancePolicy insurancePolicy) {
OraResultObject result = new OraResultObject();
result.setInsuranceId(insurancePolicy.getInsuranceId());
return result;
}
}
package com.glsx.ordercenter.service.impl;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glsx.common.pojo.PagedReq;
import com.glsx.common.pojo.PagedResp;
import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.constants.insurance.InsuranceCardType;
import com.glsx.ordercenter.constants.insurance.InsuranceStatus;
import com.glsx.ordercenter.constants.insurance.TspResultCode;
import com.glsx.ordercenter.dto.req.InsuranceReq;
import com.glsx.ordercenter.dto.req.TspRefundReq;
import com.glsx.ordercenter.dto.resp.InsuranceResp;
import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample;
import com.glsx.ordercenter.service.BaseOrderService;
import com.glsx.ordercenter.service.InsuranceService;
import com.glsx.ordercenter.utils.TspApiInvoker;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/**
* <p>Description: 保险Service
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-22
*/
@Service
public class InsuranceServiceImpl extends BaseOrderService implements InsuranceService {
/**
* 排序
*/
private static final String ORDER_CLAUSE = "create_time DESC";
/**
* 一星期的毫秒数
*/
private static final Long MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000L;
@Autowired
private SysInsurancePolicyMapper insurancePolicyMapper;
@Autowired
private TspApiInvoker tspApiInvoker;
@Value("${ora.appKey}")
private String appKey;
@Value("${ora.appSecret}")
private String secret;
@Override
public PagedResp<InsuranceResp> query(InsuranceReq insuranceReq) {
super.logInfo("保单列表查询-参数", insuranceReq);
PagedResp<InsuranceResp> result;
SysInsurancePolicyExample example = this.buildQueryExample(insuranceReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceReq);
result = this.getQueryResult(insuranceReq, insurancePolicyList);
super.logInfo("保单列表查询-结果", result);
return result;
}
@Override
public PagedResp<InsuranceResp> detail(InsuranceReq insuranceReq) {
super.logInfo("保单详情查询-参数", insuranceReq);
PagedResp<InsuranceResp> result;
SysInsurancePolicyExample example = this.buildDetailExample(insuranceReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceReq);
result = this.getDetailResult(insuranceReq, insurancePolicyList);
super.logInfo("保单详情查询-结果", result);
return result;
}
@Override
public InsuranceResp download(InsuranceReq insuranceReq) {
super.logInfo("保单下载-参数", insuranceReq);
InsuranceResp result;
SysInsurancePolicyExample example = this.buildDetailExample(insuranceReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceReq);
result = this.getDownloadResult(insurancePolicyList);
super.logInfo("保单下载-结果", result);
return result;
}
@Override
public InsuranceResp refund(InsuranceReq insuranceReq) {
super.logInfo("退保-参数", insuranceReq);
InsuranceResp result;
SysInsurancePolicyExample example = this.buildRefundExample(insuranceReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceReq);
result = this.getRefundResult(insurancePolicyList);
super.logInfo("退保-结果", result);
return result;
}
private SysInsurancePolicyExample buildQueryExample(InsuranceReq insuranceReq) {
SysInsurancePolicyExample example = new SysInsurancePolicyExample();
SysInsurancePolicyExample.Criteria byExample = example.createCriteria();
if (StringUtils.isNotBlank(insuranceReq.getVehicleOwnerName())) {
byExample.andVehicleOwnerNameLike(
"%" + insuranceReq.getVehicleOwnerName() + "%");
}
if (StringUtils.isNotBlank(insuranceReq.getVin())) {
byExample.andVinLike("%" + insuranceReq.getVin() + "%");
}
if (StringUtils.isNotBlank(insuranceReq.getGpsNo())) {
byExample.andGpsNoLike("%" + insuranceReq.getGpsNo() + "%");
}
if (insuranceReq.getStatus() != null) {
byExample.andStatusEqualTo(insuranceReq.getStatus());
}
if (insuranceReq.getApplyTimeStart() != null) {
byExample.andInstallationTimeGreaterThanOrEqualTo(
insuranceReq.getApplyTimeStart());
}
if (insuranceReq.getApplyTimeEnd() != null) {
byExample.andInstallationTimeLessThan(insuranceReq.getApplyTimeEnd());
}
if (insuranceReq.getStartTimeStart() != null) {
byExample.andExpectedEffectiveTimeGreaterThanOrEqualTo(
insuranceReq.getStartTimeStart());
}
if (insuranceReq.getStartTimeEnd() != null) {
byExample.andExpectedEffectiveTimeLessThan(insuranceReq.getStartTimeEnd());
}
example.setOrderByClause(ORDER_CLAUSE);
return example;
}
private SysInsurancePolicyExample buildDetailExample(InsuranceReq insuranceReq) {
SysInsurancePolicyExample example = new SysInsurancePolicyExample();
SysInsurancePolicyExample.Criteria byExample = example.createCriteria();
if (insuranceReq.getId() == null) {
throw SysException.create(
ResultCodeEnum.INSURANCE_ID_NULL.getCode(),
ResultCodeEnum.INSURANCE_ID_NULL.getMsg());
}
byExample.andIdEqualTo(insuranceReq.getId());
example.setOrderByClause(ORDER_CLAUSE);
return example;
}
private SysInsurancePolicyExample buildRefundExample(InsuranceReq insuranceReq) {
SysInsurancePolicyExample example = new SysInsurancePolicyExample();
SysInsurancePolicyExample.Criteria byExample = example.createCriteria();
if (StringUtils.isBlank(insuranceReq.getInsuranceId())) {
throw SysException.create(
ResultCodeEnum.INSURANCE_THIRD_ID_NULL.getCode(),
ResultCodeEnum.INSURANCE_THIRD_ID_NULL.getMsg());
}
byExample.andInsuranceIdEqualTo(insuranceReq.getInsuranceId());
example.setOrderByClause(ORDER_CLAUSE);
return example;
}
private <T extends PagedReq> List<SysInsurancePolicy> getInsurancePolicyList(
SysInsurancePolicyExample example, T baseRequest) {
List<SysInsurancePolicy> insurancePolicyList;
if (baseRequest.getPageIndex() != null && baseRequest.getPageSize() != null) {
PageHelper.startPage(baseRequest.getPageIndex(),
baseRequest.getPageSize(), true);
}
insurancePolicyList = this.insurancePolicyMapper.selectByExample(example);
return insurancePolicyList;
}
private PagedResp<InsuranceResp> getQueryResult(InsuranceReq insuranceReq,
List<SysInsurancePolicy> insurancePolicyList) {
PagedResp<InsuranceResp> result;
PageInfo<SysInsurancePolicy> pageInfo = new PageInfo<>(insurancePolicyList);
List<InsuranceResp> insuranceRespList = this.entityToResp(
insurancePolicyList);
result = PagedResp.of(pageInfo.getTotal(), insuranceReq,
insuranceRespList);
return result;
}
private PagedResp<InsuranceResp> getDetailResult(InsuranceReq insuranceReq,
List<SysInsurancePolicy> insurancePolicyList) {
PagedResp<InsuranceResp> result;
PageInfo<SysInsurancePolicy> pageInfo = new PageInfo<>(insurancePolicyList);
List<InsuranceResp> insuranceRespList = this.entityToResp(insurancePolicyList);
result = PagedResp.of(pageInfo.getTotal(), insuranceReq, insuranceRespList);
return result;
}
private InsuranceResp getDownloadResult(List<SysInsurancePolicy> insurancePolicyList) {
InsuranceResp insuranceResp;
if (insurancePolicyList.isEmpty()) {
throw SysException.create(
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getCode(),
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getMsg());
}
SysInsurancePolicy insurancePolicy = insurancePolicyList.get(0);
if (StringUtils.isBlank(insurancePolicy.getInsurancePdf())) {
throw SysException.create(
ResultCodeEnum.INSURANCE_PDF_NOT_FOUND.getCode(),
ResultCodeEnum.INSURANCE_PDF_NOT_FOUND.getMsg());
}
insuranceResp = this.entityToResp(insurancePolicy);
return insuranceResp;
}
private InsuranceResp getRefundResult(List<SysInsurancePolicy> insurancePolicyList) {
InsuranceResp result;
if (insurancePolicyList.isEmpty()) {
throw SysException.create(
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getCode(),
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getMsg());
}
SysInsurancePolicy insurancePolicy = insurancePolicyList.get(0);
if (!this.hasOutdated(insurancePolicy)) {
this.refundByApi(insurancePolicy);
}
result = this.refundByManually(insurancePolicy);
return result;
}
private List<InsuranceResp> entityToResp(List<SysInsurancePolicy> insurancePolicyList) {
List<InsuranceResp> insuranceRespList = new ArrayList<>();
insurancePolicyList.forEach(insurancePolicy ->
insuranceRespList.add(this.entityToResp(insurancePolicy)));
return insuranceRespList;
}
private InsuranceResp entityToResp(SysInsurancePolicy insurancePolicy) {
InsuranceResp insuranceResp = new InsuranceResp();
String moneyStr = insurancePolicy.getVehicleInvoiceMoney()
.setScale(2, RoundingMode.HALF_UP)
.toPlainString();
BeanUtils.copyProperties(insurancePolicy, insuranceResp);
insuranceResp.setApplyTime(
DateUtil.formatDate(insurancePolicy.getCreateTime()));
insuranceResp.setExpectedEffectiveTime(
DateUtil.formatDate(insurancePolicy.getExpectedEffectiveTime()));
insuranceResp.setStatusText(
InsuranceStatus.getStatusText(insurancePolicy.getStatus()));
insuranceResp.setIdCardTypeText(
InsuranceCardType.getTypeText(insurancePolicy.getIdCardType()));
insuranceResp.setVehicleInvoiceMoney(moneyStr);
return insuranceResp;
}
//private List<InsuranceDetailResp> entityToDetailResp(
// List<SysInsurancePolicy> insurancePolicyList) {
//
// List<InsuranceDetailResp> insuranceDetailRespList = new ArrayList<>();
//
// insurancePolicyList.forEach(insurancePolicy ->
// insuranceDetailRespList.add(this.entityToDetailResp(insurancePolicy)));
//
// return insuranceDetailRespList;
//}
//
//private InsuranceDetailResp entityToDetailResp(SysInsurancePolicy insurancePolicy) {
// InsuranceDetailResp insuranceDetailResp = new InsuranceDetailResp();
// String moneyStr = insurancePolicy.getVehicleInvoiceMoney()
// .setScale(2, RoundingMode.HALF_UP)
// .toPlainString();
//
// BeanUtils.copyProperties(insurancePolicy, insuranceDetailResp);
// insuranceDetailResp.setApplyTime(
// DateUtil.formatDate(insurancePolicy.getCreateTime()));
// insuranceDetailResp.setExpectedEffectiveTime(
// DateUtil.formatDate(insurancePolicy.getExpectedEffectiveTime()));
// insuranceDetailResp.setStatusText(
// InsuranceStatus.getStatusText(insurancePolicy.getStatus()));
// insuranceDetailResp.setIdCardTypeText(
// InsuranceCardType.getTypeText(insurancePolicy.getIdCardType()));
// insuranceDetailResp.setVehicleInvoiceMoney(moneyStr);
//
// return insuranceDetailResp;
//}
private boolean hasOutdated(SysInsurancePolicy insurancePolicy) {
Date createTime = insurancePolicy.getCreateTime();
Date currentDate = new Date();
return ((currentDate.getTime() - createTime.getTime()) > MILLISECONDS_PER_WEEK);
}
private InsuranceResp refundByApi(SysInsurancePolicy insurancePolicy) {
InsuranceResp insuranceResp = new InsuranceResp();
TspRefundReq tspRefundReq = new TspRefundReq();
tspRefundReq.setInsuranceCompany(insurancePolicy.getInsuranceCompany());
tspRefundReq.setFullInsuranceNo(insurancePolicy.getInsuranceNo());
tspRefundReq.setSeqNo(insurancePolicy.getInsuranceSeqNo());
TspResp tspResp = this.tspApiInvoker.with(this.appKey, this.secret)
.refund(tspRefundReq);
super.logInfo("TSP接口调用结果", tspResp);
boolean invokeSuccess = TspResultCode.SUCCESS.getCode().equals(tspResp.getCode())
&& (tspResp.getData() != null)
&& tspResp.getData().getCallResult();
if (!invokeSuccess) {
throw SysException.create(
ResultCodeEnum.INSURANCE_API_FAIL.getCode(),
ResultCodeEnum.INSURANCE_API_FAIL.getMsg());
}
return insuranceResp;
}
@Transactional(rollbackFor = Exception.class)
public InsuranceResp refundByManually(SysInsurancePolicy insurancePolicy) {
InsuranceResp insuranceResp = new InsuranceResp();
ServletRequestAttributes attributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
try {
insurancePolicy.setStatus(InsuranceStatus.REFUNDED.getStatus().byteValue());
insurancePolicy.setUpdateTime(new Date());
if (attributes != null) {
insurancePolicy.setUpdateBy(UserUtils.getUserId(attributes.getRequest()));
}
this.insurancePolicyMapper.updateByPrimaryKeySelective(insurancePolicy);
} catch (RuntimeException e) {
super.logError("更新保险表时出错", e);
throw SysException.create(
ResultCodeEnum.INSURANCE_UPDATE_ERROR.getCode(),
ResultCodeEnum.INSURANCE_UPDATE_ERROR.getMsg());
}
return insuranceResp;
}
}
package com.glsx.ordercenter.service.insurance.impl;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.constants.insurance.InsuranceCardType;
import com.glsx.ordercenter.constants.insurance.InsuranceStatus;
import com.glsx.ordercenter.constants.insurance.TspResultCode;
import com.glsx.ordercenter.dto.common.PagedOrderRequest;
import com.glsx.ordercenter.dto.common.PagedOrderResponse;
import com.glsx.ordercenter.dto.insurance.InsuranceDetailReq;
import com.glsx.ordercenter.dto.insurance.InsuranceDetailResp;
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;
import com.glsx.ordercenter.dto.insurance.TspRefundReq;
import com.glsx.ordercenter.dto.insurance.TspResp;
import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample;
import com.glsx.ordercenter.service.common.BaseOrderService;
import com.glsx.ordercenter.service.insurance.InsuranceService;
import com.glsx.ordercenter.utils.insurance.TspApiInvoker;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/**
* <p>Description: 保险Service
*
* <p>Project: car-service
*
* @author wbh
* @date 2020-05-22
*/
@Service
public class InsuranceServiceImpl extends BaseOrderService implements InsuranceService {
/**
* 一星期的毫秒数
*/
private static final Long MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000L;
@Autowired
private SysInsurancePolicyMapper insurancePolicyMapper;
@Autowired
private TspApiInvoker tspApiInvoker;
@Value("${ora.appKey}")
private String appKey;
@Value("${ora.appSecret}")
private String secret;
@Override
public PagedOrderResponse<InsuranceQueryResp> query(InsuranceQueryReq insuranceQueryReq) {
super.logInfo("保单列表查询-参数", insuranceQueryReq);
PagedOrderResponse<InsuranceQueryResp> result;
SysInsurancePolicyExample example = this.buildQueryExample(insuranceQueryReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceQueryReq);
result = this.getQueryResult(insuranceQueryReq, insurancePolicyList);
super.logInfo("保单列表查询-结果", result);
return result;
}
@Override
public PagedOrderResponse<InsuranceDetailResp> detail(InsuranceDetailReq insuranceDetailReq) {
super.logInfo("保单详情查询-参数", insuranceDetailReq);
PagedOrderResponse<InsuranceDetailResp> result;
SysInsurancePolicyExample example = this.buildDetailExample(insuranceDetailReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceDetailReq);
result = this.getDetailResult(insuranceDetailReq, insurancePolicyList);
super.logInfo("保单详情查询-结果", result);
return result;
}
@Override
public InsuranceDetailResp download(InsuranceDetailReq insuranceDetailReq) {
super.logInfo("保单下载-参数", insuranceDetailReq);
InsuranceDetailResp result;
SysInsurancePolicyExample example = this.buildDetailExample(insuranceDetailReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceDetailReq);
result = this.getDownloadResult(insurancePolicyList);
super.logInfo("保单下载-结果", result);
return result;
}
@Override
public InsuranceRefundResp refund(InsuranceRefundReq insuranceRefundReq) {
super.logInfo("退保-参数", insuranceRefundReq);
InsuranceRefundResp result;
SysInsurancePolicyExample example = this.buildRefundExample(insuranceRefundReq);
List<SysInsurancePolicy> insurancePolicyList = this.getInsurancePolicyList(example,
insuranceRefundReq);
result = this.getRefundResult(insurancePolicyList);
super.logInfo("退保-结果", result);
return result;
}
private SysInsurancePolicyExample buildQueryExample(InsuranceQueryReq insuranceQueryReq) {
SysInsurancePolicyExample example = new SysInsurancePolicyExample();
SysInsurancePolicyExample.Criteria byExample = example.createCriteria();
if (StringUtils.isNotBlank(insuranceQueryReq.getVehicleOwnerName())) {
byExample.andVehicleOwnerNameLike(
"%" + insuranceQueryReq.getVehicleOwnerName() + "%");
}
if (StringUtils.isNotBlank(insuranceQueryReq.getVin())) {
byExample.andVinLike("%" + insuranceQueryReq.getVin() + "%");
}
if (StringUtils.isNotBlank(insuranceQueryReq.getGpsNo())) {
byExample.andGpsNoLike("%" + insuranceQueryReq.getGpsNo() + "%");
}
if (insuranceQueryReq.getStatus() != null) {
byExample.andStatusEqualTo(insuranceQueryReq.getStatus());
}
if (insuranceQueryReq.getApplyTimeStart() != null) {
byExample.andInstallationTimeGreaterThanOrEqualTo(
insuranceQueryReq.getApplyTimeStart());
}
if (insuranceQueryReq.getApplyTimeEnd() != null) {
byExample.andInstallationTimeLessThan(insuranceQueryReq.getApplyTimeEnd());
}
if (insuranceQueryReq.getStartTimeStart() != null) {
byExample.andExpectedEffectiveTimeGreaterThanOrEqualTo(
insuranceQueryReq.getStartTimeStart());
}
if (insuranceQueryReq.getStartTimeEnd() != null) {
byExample.andExpectedEffectiveTimeLessThan(insuranceQueryReq.getStartTimeEnd());
}
example.setOrderByClause("installation_time DESC");
return example;
}
private SysInsurancePolicyExample buildDetailExample(InsuranceDetailReq insuranceDetailReq) {
SysInsurancePolicyExample example = new SysInsurancePolicyExample();
SysInsurancePolicyExample.Criteria byExample = example.createCriteria();
if (insuranceDetailReq.getId() == null) {
throw SysException.create(
ResultCodeEnum.INSURANCE_ID_NULL.getCode(),
ResultCodeEnum.INSURANCE_ID_NULL.getMsg());
}
byExample.andIdEqualTo(insuranceDetailReq.getId());
example.setOrderByClause("installation_time DESC");
return example;
}
private SysInsurancePolicyExample buildRefundExample(InsuranceRefundReq insuranceRefundReq) {
SysInsurancePolicyExample example = new SysInsurancePolicyExample();
SysInsurancePolicyExample.Criteria byExample = example.createCriteria();
if (StringUtils.isBlank(insuranceRefundReq.getInsuranceId())) {
throw SysException.create(
ResultCodeEnum.INSURANCE_THIRD_ID_NULL.getCode(),
ResultCodeEnum.INSURANCE_THIRD_ID_NULL.getMsg());
}
byExample.andInsuranceIdEqualTo(insuranceRefundReq.getInsuranceId());
example.setOrderByClause("installation_time DESC");
return example;
}
private <T extends PagedOrderRequest> List<SysInsurancePolicy> getInsurancePolicyList(
SysInsurancePolicyExample example, T baseRequest) {
List<SysInsurancePolicy> insurancePolicyList;
if (baseRequest.getPageIndex() > 0 && baseRequest.getPageSize() > 0) {
PageHelper.startPage(baseRequest.getPageIndex(),
baseRequest.getPageSize(), true);
}
insurancePolicyList = this.insurancePolicyMapper.selectByExample(example);
return insurancePolicyList;
}
private PagedOrderResponse<InsuranceQueryResp> getQueryResult(
InsuranceQueryReq insuranceQueryReq, List<SysInsurancePolicy> insurancePolicyList) {
PagedOrderResponse<InsuranceQueryResp> result;
PageInfo<SysInsurancePolicy> pageInfo = new PageInfo<>(insurancePolicyList);
List<InsuranceQueryResp> insuranceQueryRespList = this.entityToQueryResp(
insurancePolicyList);
result = PagedOrderResponse.of(pageInfo.getTotal(), insuranceQueryReq,
insuranceQueryRespList);
return result;
}
private PagedOrderResponse<InsuranceDetailResp> getDetailResult(
InsuranceDetailReq insuranceDetailReq, List<SysInsurancePolicy> insurancePolicyList) {
PagedOrderResponse<InsuranceDetailResp> result;
PageInfo<SysInsurancePolicy> pageInfo = new PageInfo<>(insurancePolicyList);
List<InsuranceDetailResp> insuranceDetailRespList = this.entityToDetailResp(
insurancePolicyList);
result = PagedOrderResponse.of(pageInfo.getTotal(), insuranceDetailReq,
insuranceDetailRespList);
return result;
}
private InsuranceDetailResp getDownloadResult(List<SysInsurancePolicy> insurancePolicyList) {
InsuranceDetailResp insuranceDetailResp;
if (insurancePolicyList.isEmpty()) {
throw SysException.create(
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getCode(),
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getMsg());
}
SysInsurancePolicy insurancePolicy = insurancePolicyList.get(0);
if (StringUtils.isBlank(insurancePolicy.getInsurancePdf())) {
throw SysException.create(
ResultCodeEnum.INSURANCE_PDF_NOT_FOUND.getCode(),
ResultCodeEnum.INSURANCE_PDF_NOT_FOUND.getMsg());
}
insuranceDetailResp = this.entityToDetailResp(insurancePolicy);
return insuranceDetailResp;
}
private InsuranceRefundResp getRefundResult(List<SysInsurancePolicy> insurancePolicyList) {
InsuranceRefundResp result;
if (insurancePolicyList.isEmpty()) {
throw SysException.create(
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getCode(),
ResultCodeEnum.INSURANCE_ID_NOT_FOUND.getMsg());
}
SysInsurancePolicy insurancePolicy = insurancePolicyList.get(0);
if (!this.hasOutdated(insurancePolicy)) {
this.refundByApi(insurancePolicy);
}
result = this.refundByManually(insurancePolicy);
return result;
}
private List<InsuranceQueryResp> entityToQueryResp(
List<SysInsurancePolicy> insurancePolicyList) {
List<InsuranceQueryResp> insuranceQueryRespList = new ArrayList<>();
insurancePolicyList.forEach(insurancePolicy ->
insuranceQueryRespList.add(this.entityToQueryResp(insurancePolicy)));
return insuranceQueryRespList;
}
private InsuranceQueryResp entityToQueryResp(SysInsurancePolicy insurancePolicy) {
InsuranceQueryResp insuranceQueryResp = new InsuranceQueryResp();
String moneyStr = insurancePolicy.getVehicleInvoiceMoney()
.setScale(2, RoundingMode.HALF_UP)
.toPlainString();
BeanUtils.copyProperties(insurancePolicy, insuranceQueryResp);
insuranceQueryResp.setApplyTime(
DateUtil.formatDate(insurancePolicy.getCreateTime()));
insuranceQueryResp.setExpectedEffectiveTime(
DateUtil.formatDate(insurancePolicy.getExpectedEffectiveTime()));
insuranceQueryResp.setStatusText(
InsuranceStatus.getStatusText(insurancePolicy.getStatus()));
insuranceQueryResp.setIdCardTypeText(
InsuranceCardType.getTypeText(insurancePolicy.getIdCardType()));
insuranceQueryResp.setVehicleInvoiceMoney(moneyStr);
return insuranceQueryResp;
}
private List<InsuranceDetailResp> entityToDetailResp(
List<SysInsurancePolicy> insurancePolicyList) {
List<InsuranceDetailResp> insuranceDetailRespList = new ArrayList<>();
insurancePolicyList.forEach(insurancePolicy ->
insuranceDetailRespList.add(this.entityToDetailResp(insurancePolicy)));
return insuranceDetailRespList;
}
private InsuranceDetailResp entityToDetailResp(SysInsurancePolicy insurancePolicy) {
InsuranceDetailResp insuranceDetailResp = new InsuranceDetailResp();
String moneyStr = insurancePolicy.getVehicleInvoiceMoney()
.setScale(2, RoundingMode.HALF_UP)
.toPlainString();
BeanUtils.copyProperties(insurancePolicy, insuranceDetailResp);
insuranceDetailResp.setApplyTime(
DateUtil.formatDate(insurancePolicy.getCreateTime()));
insuranceDetailResp.setExpectedEffectiveTime(
DateUtil.formatDate(insurancePolicy.getExpectedEffectiveTime()));
insuranceDetailResp.setStatusText(
InsuranceStatus.getStatusText(insurancePolicy.getStatus()));
insuranceDetailResp.setIdCardTypeText(
InsuranceCardType.getTypeText(insurancePolicy.getIdCardType()));
insuranceDetailResp.setVehicleInvoiceMoney(moneyStr);
return insuranceDetailResp;
}
private boolean hasOutdated(SysInsurancePolicy insurancePolicy) {
Date createTime = insurancePolicy.getCreateTime();
Date currentDate = new Date();
return ((currentDate.getTime() - createTime.getTime()) > MILLISECONDS_PER_WEEK);
}
private InsuranceRefundResp refundByApi(SysInsurancePolicy insurancePolicy) {
InsuranceRefundResp insuranceRefundResp = new InsuranceRefundResp();
TspRefundReq tspRefundReq = new TspRefundReq();
tspRefundReq.setInsuranceCompany(insurancePolicy.getInsuranceCompany());
tspRefundReq.setFullInsuranceNo(insurancePolicy.getInsuranceNo());
tspRefundReq.setSeqNo(insurancePolicy.getInsuranceSeqNo());
TspResp tspResp = this.tspApiInvoker.with(this.appKey, this.secret)
.refund(tspRefundReq);
super.logInfo("TSP接口调用结果", tspResp);
boolean invokeSuccess = TspResultCode.SUCCESS.getCode().equals(tspResp.getCode())
&& (tspResp.getData() != null)
&& tspResp.getData().getCallResult();
if (!invokeSuccess) {
throw SysException.create(
ResultCodeEnum.INSURANCE_API_FAIL.getCode(),
ResultCodeEnum.INSURANCE_API_FAIL.getMsg());
}
return insuranceRefundResp;
}
@Transactional(rollbackFor = Exception.class)
public InsuranceRefundResp refundByManually(SysInsurancePolicy insurancePolicy) {
InsuranceRefundResp insuranceRefundResp = new InsuranceRefundResp();
ServletRequestAttributes attributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
try {
insurancePolicy.setStatus(InsuranceStatus.REFUNDED.getStatus().byteValue());
insurancePolicy.setUpdateTime(new Date());
if (attributes != null) {
insurancePolicy.setUpdateBy(UserUtils.getUserId(attributes.getRequest()));
}
this.insurancePolicyMapper.updateByPrimaryKeySelective(insurancePolicy);
} catch (RuntimeException e) {
super.logError("更新保险表时出错", e);
throw SysException.create(
ResultCodeEnum.INSURANCE_UPDATE_ERROR.getCode(),
ResultCodeEnum.INSURANCE_UPDATE_ERROR.getMsg());
}
return insuranceRefundResp;
}
}
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.glsx.common.utils.DateUtil;
import com.glsx.common.utils.PropertiesUtil;
import com.glsx.gps.utils.HttpUtil;
import com.glsx.ordercenter.dto.insurance.TspResp;
import com.glsx.ordercenter.dto.insurance.TspRespData;
import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.dto.resp.TspRespData;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.utils.TspSignUtil;
......@@ -13,11 +17,6 @@ import org.apache.http.entity.ContentType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Semaphore;
/**
* @author think.wang
* @version 1.0.0
......@@ -46,7 +45,7 @@ public class TspGetInsurancePdfTask implements Runnable{
@Override
public void run() {
try {
semaphore.acquire();
this.semaphore.acquire();
//系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.pdf"); //调用获取pdf方法
......@@ -56,9 +55,9 @@ public class TspGetInsurancePdfTask implements Runnable{
String format = PropertiesUtil.getProperty("insurance.picc.format");
String source = PropertiesUtil.getProperty("insurance.picc.source");
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id);
SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(this.id);
if(insurancePolicy == null){
logger.error("通过id={}未找到保单数据", id);
this.logger.error("通过id={}未找到保单数据", this.id);
return;
}
//业务参数封装
......@@ -66,7 +65,7 @@ public class TspGetInsurancePdfTask implements Runnable{
map.put("insuranceCompany", insurancePolicy.getInsuranceCompany());
map.put("fullInsuranceNo", insurancePolicy.getInsuranceNo());
map.put("seqNo", insurancePolicy.getInsuranceSeqNo());
logger.info("获取pdf签名参数值为:{}", map);
this.logger.info("获取pdf签名参数值为:{}", map);
//系统参数封装
map.put("method", method);
......@@ -80,31 +79,31 @@ public class TspGetInsurancePdfTask implements Runnable{
//发送请求
String result = null;
int tryCount = TRY_COUNT;
int tryCount = this.TRY_COUNT;
while (tryCount-- > 0) {
try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break;
} catch (Exception e) {
Thread.sleep(TRY_WAIT_TIME);
Thread.sleep(this.TRY_WAIT_TIME);
continue;
}
}
logger.info("保单号:{}获取pdf信息响应数据:{}", map.get("fullInsuranceNo"), result);
this.logger.info("保单号:{}获取pdf信息响应数据:{}", map.get("fullInsuranceNo"), result);
TspResp tspResp = JSON.parseObject(result, TspResp.class);
if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功
SysInsurancePolicy policy = new SysInsurancePolicy();
policy.setId(id);
policy.setId(this.id);
TspRespData respData = tspResp.getData();
policy.setInsurancePdf(respData.getObj()); //得到pdf路径
policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
this.policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
}else{
logger.error("获取保单pdf失败,保单号为:{}", map.get("fullInsuranceNo"));
this.logger.error("获取保单pdf失败,保单号为:{}", map.get("fullInsuranceNo"));
}
} catch (Exception e) {
logger.error("调用TSP获取pdf接口异常:{}", e);
this.logger.error("调用TSP获取pdf接口异常:{}", e);
}finally {
semaphore.release();
this.semaphore.release();
}
}
......
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.glsx.common.utils.DateUtil;
import com.glsx.common.utils.PropertiesUtil;
......@@ -9,9 +13,9 @@ import com.glsx.ordercenter.constants.insurance.InsuranceCardType;
import com.glsx.ordercenter.constants.insurance.InsuranceCompany;
import com.glsx.ordercenter.constants.insurance.InsuranceCustomerType;
import com.glsx.ordercenter.constants.insurance.InsuranceStatus;
import com.glsx.ordercenter.dto.insurance.TspResp;
import com.glsx.ordercenter.dto.insurance.TspRespData;
import com.glsx.ordercenter.dto.insurance.TspSaveReq;
import com.glsx.ordercenter.dto.req.TspSaveReq;
import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.dto.resp.TspRespData;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.utils.ObjectUtils;
......@@ -20,11 +24,6 @@ import org.apache.http.entity.ContentType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Semaphore;
/**
* @author think.wang
* @version 1.0.0
......@@ -53,7 +52,7 @@ public class TspSaveInsuranceDataTask implements Runnable{
@Override
public void run() {
try {
semaphore.acquire();
this.semaphore.acquire();
//系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.save"); //调用投保方法
......@@ -66,7 +65,7 @@ public class TspSaveInsuranceDataTask implements Runnable{
//业务参数封装
TspSaveReq saveData = this.setSendData(this.data);
//对象转map进行签名
logger.info("投保签名的对象为:{}", JSON.toJSONString(saveData));
this.logger.info("投保签名的对象为:{}", JSON.toJSONString(saveData));
Map<String, String> map = ObjectUtils.objectToMap(saveData);
//系统参数封装
......@@ -81,17 +80,17 @@ public class TspSaveInsuranceDataTask implements Runnable{
//发送请求
String result = null;
int tryCount = TRY_COUNT;
int tryCount = this.TRY_COUNT;
while (tryCount-- > 0) {
try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break;
} catch (Exception e) {
Thread.sleep(TRY_WAIT_TIME);
Thread.sleep(this.TRY_WAIT_TIME);
continue;
}
}
logger.info("车架号:{}投保响应数据:{}", map.get("standNo"), result);
this.logger.info("车架号:{}投保响应数据:{}", map.get("standNo"), result);
SysInsurancePolicy policy = new SysInsurancePolicy();
policy.setId(this.data.getId());
TspResp tspResp = JSON.parseObject(result, TspResp.class);
......@@ -103,11 +102,11 @@ public class TspSaveInsuranceDataTask implements Runnable{
}else{
policy.setStatus(InsuranceStatus.APPLY_FAILED.getStatus().byteValue()); //更新状态投保失败
}
policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
this.policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
} catch (Exception e) {
logger.error("调用TSP投保接口异常:{}", e);
this.logger.error("调用TSP投保接口异常:{}", e);
}finally {
semaphore.release();
this.semaphore.release();
}
}
......
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.glsx.common.utils.DateUtil;
import com.glsx.common.utils.PropertiesUtil;
......@@ -7,8 +10,8 @@ import com.glsx.common.utils.StringUtils;
import com.glsx.gps.utils.HttpUtil;
import com.glsx.ordercenter.constants.insurance.InsuranceCompany;
import com.glsx.ordercenter.constants.insurance.InsuranceCustomerType;
import com.glsx.ordercenter.dto.insurance.TspResp;
import com.glsx.ordercenter.dto.insurance.TspUpdateReq;
import com.glsx.ordercenter.dto.req.TspUpdateReq;
import com.glsx.ordercenter.dto.resp.TspResp;
import com.glsx.ordercenter.mapper.insurance.SysInsurancePolicyMapper;
import com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy;
import com.glsx.ordercenter.utils.ObjectUtils;
......@@ -17,10 +20,6 @@ import org.apache.http.entity.ContentType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.Semaphore;
/**
* @author think.wang
* @version 1.0.0
......@@ -49,7 +48,7 @@ public class TspUpdateInsuranceDataTask implements Runnable{
@Override
public void run() {
try {
semaphore.acquire();
this.semaphore.acquire();
//系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.update"); //修改保单方法
......@@ -59,15 +58,15 @@ public class TspUpdateInsuranceDataTask implements Runnable{
String format = PropertiesUtil.getProperty("insurance.picc.format");
String source = PropertiesUtil.getProperty("insurance.picc.source");
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id);
SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(this.id);
if(insurancePolicy == null){
logger.error("通过id={}未找到保单数据", id);
this.logger.error("通过id={}未找到保单数据", this.id);
return;
}
//业务参数封装
TspUpdateReq updateData = this.setSendData(insurancePolicy);
//对象转map进行签名
logger.info("修改保单签名的对象为:{}", JSON.toJSONString(updateData));
this.logger.info("修改保单签名的对象为:{}", JSON.toJSONString(updateData));
Map<String, String> map = ObjectUtils.objectToMap(updateData);
//系统参数封装
......@@ -82,27 +81,27 @@ public class TspUpdateInsuranceDataTask implements Runnable{
//发送请求
String result = null;
int tryCount = TRY_COUNT;
int tryCount = this.TRY_COUNT;
while (tryCount-- > 0) {
try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break;
} catch (Exception e) {
Thread.sleep(TRY_WAIT_TIME);
Thread.sleep(this.TRY_WAIT_TIME);
continue;
}
}
logger.info("保单号:{}修改投保响应数据:{}", map.get("fullInsuranceNo"), result);
this.logger.info("保单号:{}修改投保响应数据:{}", map.get("fullInsuranceNo"), result);
TspResp tspResp = JSON.parseObject(result, TspResp.class);
if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功
logger.info("修改保单数据成功,保单号为:{}", map.get("fullInsuranceNo"));
this.logger.info("修改保单数据成功,保单号为:{}", map.get("fullInsuranceNo"));
}else{
logger.error("修改保单数据失败,保单号为:{}", map.get("fullInsuranceNo"));
this.logger.error("修改保单数据失败,保单号为:{}", map.get("fullInsuranceNo"));
}
} catch (Exception e) {
logger.error("调用TSP投保接口异常:{}", e);
this.logger.error("调用TSP投保接口异常:{}", e);
}finally {
semaphore.release();
this.semaphore.release();
}
}
......
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.glsx.ordercenter.constants.insurance.OraConstants;
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.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.util.*;
/**
* @author think.wang
* @version 1.0.0
......@@ -60,7 +63,7 @@ public class OraSignUtil {
/**
* <p>获取HTTp请求体和请求参数进行验签</p>
* <p>验签失败则抛出 {@link OraBizException} 异常</p>
* <p>验签失败则抛出 {@link SysException} 异常</p>
*
* @param secret 密钥
* @param requestBody 请求体
......@@ -76,7 +79,8 @@ public class OraSignUtil {
Map<String, String> verifyParamMap = buildVerifyParamMap(paramMap, requestBody);
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);
......@@ -85,11 +89,13 @@ public class OraSignUtil {
String signStr = sign(verifyParamMap, null, secret);
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)) {
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.HashMap;
......@@ -7,9 +7,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.glsx.common.utils.DateUtil;
import com.glsx.ordercenter.constants.insurance.TspConstants;
import com.glsx.ordercenter.dto.insurance.TspRefundReq;
import com.glsx.ordercenter.dto.insurance.TspResp;
import com.glsx.ordercenter.utils.UrlUtils;
import com.glsx.ordercenter.dto.req.TspRefundReq;
import com.glsx.ordercenter.dto.resp.TspResp;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
......
package com.glsx.ordercenter.utils.insurance;
package com.glsx.ordercenter.utils;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
......
......@@ -31,6 +31,7 @@
<result column="vehicle_color" jdbcType="VARCHAR" property="vehicleColor"/>
<result column="vehicle_invoice_money" jdbcType="DECIMAL" property="vehicleInvoiceMoney"/>
<result column="tasting_unit" jdbcType="VARCHAR" property="tastingUnit"/>
<result column="cancel_reason" jdbcType="VARCHAR" property="cancelReason"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="expected_effective_time" jdbcType="TIMESTAMP"
property="expectedEffectiveTime"/>
......@@ -109,19 +110,19 @@
<sql id="Base_Column_List">
<!--@mbg.generated-->
sys_insurance_policy.id id, insurance_id, `source`, `status`, insurance_no,
insurance_seq_no,
insurance_company,
insurance_seq_no, insurance_company,
gps_no, installation_time, vin, vehicle_no, engine_number, car_brand, vehicle_type,
vehicle_owner_name, phone, vehicle_owner_address, customer_type, id_card_type, id_card_num,
insurance_commodity, pilfer_insurance_money, insurance_period, vehicle_color,
vehicle_invoice_money,
tasting_unit, remark, expected_effective_time, real_effective_time, insurance_pdf,
create_time, update_time, create_by, update_by,
tasting_unit, cancel_reason, remark, expected_effective_time, real_effective_time,
insurance_pdf, create_time, update_time, create_by, update_by,
sys_insurance_data.response_data response_data
</sql>
<sql id="joinClause">
JOIN sys_insurance_data ON sys_insurance_policy.id = sys_insurance_data.policy_id
JOIN sys_insurance_data
ON sys_insurance_policy.id = sys_insurance_data.policy_id
</sql>
<select id="selectCount"
......@@ -132,7 +133,7 @@
distinct
</if>
count(0)
FROM sys_insurance_policy
FROM sys_insurance_policy
<include refid="joinClause"/>
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
......@@ -167,13 +168,15 @@
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from sys_insurance_policy
delete
from sys_insurance_policy
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample"
parameterType="com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample">
<!--@mbg.generated-->
delete from sys_insurance_policy
delete
from sys_insurance_policy
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
......@@ -183,38 +186,40 @@
useGeneratedKeys="true">
<!--@mbg.generated-->
insert into sys_insurance_policy (insurance_id, `source`, `status`,
insurance_no, insurance_seq_no, insurance_company,
gps_no, installation_time, vin,
vehicle_no, engine_number, car_brand,
vehicle_type, vehicle_owner_name, phone,
vehicle_owner_address, customer_type, id_card_type,
id_card_num, insurance_commodity, pilfer_insurance_money,
insurance_period, vehicle_color, vehicle_invoice_money,
tasting_unit, remark, expected_effective_time,
real_effective_time, insurance_pdf, create_time,
update_time, create_by, update_by
)
insurance_no, insurance_seq_no, insurance_company,
gps_no, installation_time, vin,
vehicle_no, engine_number, car_brand,
vehicle_type, vehicle_owner_name, phone,
vehicle_owner_address, customer_type, id_card_type,
id_card_num, insurance_commodity, pilfer_insurance_money,
insurance_period, vehicle_color, vehicle_invoice_money,
tasting_unit, cancel_reason, remark,
expected_effective_time, real_effective_time,
insurance_pdf, create_time, update_time,
create_by, update_by)
values (#{insuranceId,jdbcType=VARCHAR}, #{source,jdbcType=TINYINT},
#{status,jdbcType=TINYINT},
#{insuranceNo,jdbcType=VARCHAR}, #{insuranceSeqNo,jdbcType=VARCHAR},
#{insuranceCompany,jdbcType=VARCHAR},
#{gpsNo,jdbcType=VARCHAR}, #{installationTime,jdbcType=TIMESTAMP}, #{vin,jdbcType=VARCHAR},
#{vehicleNo,jdbcType=VARCHAR}, #{engineNumber,jdbcType=VARCHAR},
#{carBrand,jdbcType=VARCHAR},
#{vehicleType,jdbcType=TINYINT}, #{vehicleOwnerName,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR},
#{vehicleOwnerAddress,jdbcType=VARCHAR}, #{customerType,jdbcType=TINYINT},
#{idCardType,jdbcType=TINYINT},
#{idCardNum,jdbcType=VARCHAR}, #{insuranceCommodity,jdbcType=BOOLEAN},
#{pilferInsuranceMoney,jdbcType=DECIMAL},
#{insurancePeriod,jdbcType=INTEGER}, #{vehicleColor,jdbcType=VARCHAR},
#{vehicleInvoiceMoney,jdbcType=DECIMAL},
#{tastingUnit,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{expectedEffectiveTime,jdbcType=TIMESTAMP},
#{realEffectiveTime,jdbcType=TIMESTAMP}, #{insurancePdf,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{updateBy,jdbcType=INTEGER}
)
#{status,jdbcType=TINYINT},
#{insuranceNo,jdbcType=VARCHAR}, #{insuranceSeqNo,jdbcType=VARCHAR},
#{insuranceCompany,jdbcType=VARCHAR},
#{gpsNo,jdbcType=VARCHAR}, #{installationTime,jdbcType=TIMESTAMP},
#{vin,jdbcType=VARCHAR},
#{vehicleNo,jdbcType=VARCHAR}, #{engineNumber,jdbcType=VARCHAR},
#{carBrand,jdbcType=VARCHAR},
#{vehicleType,jdbcType=TINYINT}, #{vehicleOwnerName,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR},
#{vehicleOwnerAddress,jdbcType=VARCHAR}, #{customerType,jdbcType=TINYINT},
#{idCardType,jdbcType=TINYINT},
#{idCardNum,jdbcType=VARCHAR}, #{insuranceCommodity,jdbcType=BOOLEAN},
#{pilferInsuranceMoney,jdbcType=DECIMAL},
#{insurancePeriod,jdbcType=INTEGER}, #{vehicleColor,jdbcType=VARCHAR},
#{vehicleInvoiceMoney,jdbcType=DECIMAL},
#{tastingUnit,jdbcType=VARCHAR}, #{cancelReason,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
#{expectedEffectiveTime,jdbcType=TIMESTAMP},
#{realEffectiveTime,jdbcType=TIMESTAMP},
#{insurancePdf,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER}, #{updateBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id"
parameterType="com.glsx.ordercenter.pojo.insurance.SysInsurancePolicy"
......@@ -297,6 +302,9 @@
<if test="tastingUnit != null">
tasting_unit,
</if>
<if test="cancelReason != null">
cancel_reason,
</if>
<if test="remark != null">
remark,
</if>
......@@ -398,6 +406,9 @@
<if test="tastingUnit != null">
#{tastingUnit,jdbcType=VARCHAR},
</if>
<if test="cancelReason != null">
#{cancelReason,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
......@@ -428,7 +439,8 @@
parameterType="com.glsx.ordercenter.pojo.insurance.SysInsurancePolicyExample"
resultType="java.lang.Long">
<!--@mbg.generated-->
select count(*) from sys_insurance_policy
select count(*)
from sys_insurance_policy
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
......@@ -515,6 +527,9 @@
<if test="record.tastingUnit != null">
tasting_unit = #{record.tastingUnit,jdbcType=VARCHAR},
</if>
<if test="record.cancelReason != null">
cancel_reason = #{record.cancelReason,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
......@@ -548,39 +563,40 @@
<!--@mbg.generated-->
update sys_insurance_policy
set id = #{record.id,jdbcType=INTEGER},
insurance_id = #{record.insuranceId,jdbcType=VARCHAR},
`source` = #{record.source,jdbcType=TINYINT},
`status` = #{record.status,jdbcType=TINYINT},
insurance_no = #{record.insuranceNo,jdbcType=VARCHAR},
insurance_seq_no = #{record.insuranceSeqNo,jdbcType=VARCHAR},
insurance_company = #{record.insuranceCompany,jdbcType=VARCHAR},
gps_no = #{record.gpsNo,jdbcType=VARCHAR},
installation_time = #{record.installationTime,jdbcType=TIMESTAMP},
vin = #{record.vin,jdbcType=VARCHAR},
vehicle_no = #{record.vehicleNo,jdbcType=VARCHAR},
engine_number = #{record.engineNumber,jdbcType=VARCHAR},
car_brand = #{record.carBrand,jdbcType=VARCHAR},
vehicle_type = #{record.vehicleType,jdbcType=TINYINT},
vehicle_owner_name = #{record.vehicleOwnerName,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
vehicle_owner_address = #{record.vehicleOwnerAddress,jdbcType=VARCHAR},
customer_type = #{record.customerType,jdbcType=TINYINT},
id_card_type = #{record.idCardType,jdbcType=TINYINT},
id_card_num = #{record.idCardNum,jdbcType=VARCHAR},
insurance_commodity = #{record.insuranceCommodity,jdbcType=BOOLEAN},
pilfer_insurance_money = #{record.pilferInsuranceMoney,jdbcType=DECIMAL},
insurance_period = #{record.insurancePeriod,jdbcType=INTEGER},
vehicle_color = #{record.vehicleColor,jdbcType=VARCHAR},
vehicle_invoice_money = #{record.vehicleInvoiceMoney,jdbcType=DECIMAL},
tasting_unit = #{record.tastingUnit,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
expected_effective_time = #{record.expectedEffectiveTime,jdbcType=TIMESTAMP},
real_effective_time = #{record.realEffectiveTime,jdbcType=TIMESTAMP},
insurance_pdf = #{record.insurancePdf,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
create_by = #{record.createBy,jdbcType=INTEGER},
update_by = #{record.updateBy,jdbcType=INTEGER}
insurance_id = #{record.insuranceId,jdbcType=VARCHAR},
`source` = #{record.source,jdbcType=TINYINT},
`status` = #{record.status,jdbcType=TINYINT},
insurance_no = #{record.insuranceNo,jdbcType=VARCHAR},
insurance_seq_no = #{record.insuranceSeqNo,jdbcType=VARCHAR},
insurance_company = #{record.insuranceCompany,jdbcType=VARCHAR},
gps_no = #{record.gpsNo,jdbcType=VARCHAR},
installation_time = #{record.installationTime,jdbcType=TIMESTAMP},
vin = #{record.vin,jdbcType=VARCHAR},
vehicle_no = #{record.vehicleNo,jdbcType=VARCHAR},
engine_number = #{record.engineNumber,jdbcType=VARCHAR},
car_brand = #{record.carBrand,jdbcType=VARCHAR},
vehicle_type = #{record.vehicleType,jdbcType=TINYINT},
vehicle_owner_name = #{record.vehicleOwnerName,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
vehicle_owner_address = #{record.vehicleOwnerAddress,jdbcType=VARCHAR},
customer_type = #{record.customerType,jdbcType=TINYINT},
id_card_type = #{record.idCardType,jdbcType=TINYINT},
id_card_num = #{record.idCardNum,jdbcType=VARCHAR},
insurance_commodity = #{record.insuranceCommodity,jdbcType=BOOLEAN},
pilfer_insurance_money = #{record.pilferInsuranceMoney,jdbcType=DECIMAL},
insurance_period = #{record.insurancePeriod,jdbcType=INTEGER},
vehicle_color = #{record.vehicleColor,jdbcType=VARCHAR},
vehicle_invoice_money = #{record.vehicleInvoiceMoney,jdbcType=DECIMAL},
tasting_unit = #{record.tastingUnit,jdbcType=VARCHAR},
cancel_reason = #{record.cancelReason,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
expected_effective_time = #{record.expectedEffectiveTime,jdbcType=TIMESTAMP},
real_effective_time = #{record.realEffectiveTime,jdbcType=TIMESTAMP},
insurance_pdf = #{record.insurancePdf,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
create_by = #{record.createBy,jdbcType=INTEGER},
update_by = #{record.updateBy,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
......@@ -665,6 +681,9 @@
<if test="tastingUnit != null">
tasting_unit = #{tastingUnit,jdbcType=VARCHAR},
</if>
<if test="cancelReason != null">
cancel_reason = #{cancelReason,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
......@@ -697,38 +716,39 @@
<!--@mbg.generated-->
update sys_insurance_policy
set insurance_id = #{insuranceId,jdbcType=VARCHAR},
`source` = #{source,jdbcType=TINYINT},
`status` = #{status,jdbcType=TINYINT},
insurance_no = #{insuranceNo,jdbcType=VARCHAR},
insurance_seq_no = #{insuranceSeqNo,jdbcType=VARCHAR},
insurance_company = #{insuranceCompany,jdbcType=VARCHAR},
gps_no = #{gpsNo,jdbcType=VARCHAR},
installation_time = #{installationTime,jdbcType=TIMESTAMP},
vin = #{vin,jdbcType=VARCHAR},
vehicle_no = #{vehicleNo,jdbcType=VARCHAR},
engine_number = #{engineNumber,jdbcType=VARCHAR},
car_brand = #{carBrand,jdbcType=VARCHAR},
vehicle_type = #{vehicleType,jdbcType=TINYINT},
vehicle_owner_name = #{vehicleOwnerName,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
vehicle_owner_address = #{vehicleOwnerAddress,jdbcType=VARCHAR},
customer_type = #{customerType,jdbcType=TINYINT},
id_card_type = #{idCardType,jdbcType=TINYINT},
id_card_num = #{idCardNum,jdbcType=VARCHAR},
insurance_commodity = #{insuranceCommodity,jdbcType=BOOLEAN},
pilfer_insurance_money = #{pilferInsuranceMoney,jdbcType=DECIMAL},
insurance_period = #{insurancePeriod,jdbcType=INTEGER},
vehicle_color = #{vehicleColor,jdbcType=VARCHAR},
vehicle_invoice_money = #{vehicleInvoiceMoney,jdbcType=DECIMAL},
tasting_unit = #{tastingUnit,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
expected_effective_time = #{expectedEffectiveTime,jdbcType=TIMESTAMP},
real_effective_time = #{realEffectiveTime,jdbcType=TIMESTAMP},
insurance_pdf = #{insurancePdf,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER}
`source` = #{source,jdbcType=TINYINT},
`status` = #{status,jdbcType=TINYINT},
insurance_no = #{insuranceNo,jdbcType=VARCHAR},
insurance_seq_no = #{insuranceSeqNo,jdbcType=VARCHAR},
insurance_company = #{insuranceCompany,jdbcType=VARCHAR},
gps_no = #{gpsNo,jdbcType=VARCHAR},
installation_time = #{installationTime,jdbcType=TIMESTAMP},
vin = #{vin,jdbcType=VARCHAR},
vehicle_no = #{vehicleNo,jdbcType=VARCHAR},
engine_number = #{engineNumber,jdbcType=VARCHAR},
car_brand = #{carBrand,jdbcType=VARCHAR},
vehicle_type = #{vehicleType,jdbcType=TINYINT},
vehicle_owner_name = #{vehicleOwnerName,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
vehicle_owner_address = #{vehicleOwnerAddress,jdbcType=VARCHAR},
customer_type = #{customerType,jdbcType=TINYINT},
id_card_type = #{idCardType,jdbcType=TINYINT},
id_card_num = #{idCardNum,jdbcType=VARCHAR},
insurance_commodity = #{insuranceCommodity,jdbcType=BOOLEAN},
pilfer_insurance_money = #{pilferInsuranceMoney,jdbcType=DECIMAL},
insurance_period = #{insurancePeriod,jdbcType=INTEGER},
vehicle_color = #{vehicleColor,jdbcType=VARCHAR},
vehicle_invoice_money = #{vehicleInvoiceMoney,jdbcType=DECIMAL},
tasting_unit = #{tastingUnit,jdbcType=VARCHAR},
cancel_reason = #{cancelReason,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
expected_effective_time = #{expectedEffectiveTime,jdbcType=TIMESTAMP},
real_effective_time = #{realEffectiveTime,jdbcType=TIMESTAMP},
insurance_pdf = #{insurancePdf,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!