|
|
@@ -45,6 +45,7 @@ public class InsAreaCompanyController {
|
|
|
|
|
|
@GetMapping("/close/{subOrderNo}")
|
|
|
@ApiOperation("关闭订单")
|
|
|
+ @Transactional
|
|
|
public HttpResult<String> close(@PathVariable String subOrderNo) {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
if (InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(insAreaCompany.getOrderstatus())) {
|
|
|
@@ -52,6 +53,13 @@ public class InsAreaCompanyController {
|
|
|
}
|
|
|
insAreaCompany.setDelFlag("0");
|
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
|
+
|
|
|
+ // 已核保待缴费
|
|
|
+ if (InsOrderStatusEnum.WAIT_PAY.getCode().equals(insAreaCompany.getOrderstatus())) {
|
|
|
+ // 撤销二维码
|
|
|
+ insOrderQrCodeService.updateQrCode(insAreaCompany.getId(), 0);
|
|
|
+ insuranceCompanyPolymerizationService.cancelOrder(insAreaCompany);
|
|
|
+ }
|
|
|
return HttpResult.ok();
|
|
|
}
|
|
|
|
|
|
@@ -59,14 +67,15 @@ public class InsAreaCompanyController {
|
|
|
@ApiOperation("取消核保")
|
|
|
public HttpResult<String> cancelUnderwriting(@PathVariable String subOrderNo) {
|
|
|
InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
|
|
|
- if (InsOrderStatusEnum.WAIT_PAY.getCode().equals(insAreaCompany.getOrderstatus())) {
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
- insAreaCompanyService.updateById(insAreaCompany);
|
|
|
- // 撤销二维码
|
|
|
- insOrderQrCodeService.updateQrCode(insAreaCompany.getId(), 0);
|
|
|
- return HttpResult.ok();
|
|
|
+ if (!InsOrderStatusEnum.WAIT_PAY.getCode().equals(insAreaCompany.getOrderstatus())) {
|
|
|
+ throw new SystemException("只有[已核保待缴费]状态下允许取消核保");
|
|
|
}
|
|
|
- throw new SystemException("只有[已核保待缴费]状态下允许取消核保");
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
+ insAreaCompanyService.updateById(insAreaCompany);
|
|
|
+ // 撤销二维码
|
|
|
+ insOrderQrCodeService.updateQrCode(insAreaCompany.getId(), 0);
|
|
|
+ insuranceCompanyPolymerizationService.cancelOrder(insAreaCompany);
|
|
|
+ return HttpResult.ok();
|
|
|
}
|
|
|
|
|
|
@GetMapping("/statusRestored/{subOrderNo}")
|
|
|
@@ -82,7 +91,6 @@ public class InsAreaCompanyController {
|
|
|
InsOrdersTrack insOrdersTrack = new InsOrdersTrack(insAreaCompany, user.getId(), user.getName());
|
|
|
insAreaCompanyService.updateById(insAreaCompany);
|
|
|
insOrdersTrackService.save(insOrdersTrack);
|
|
|
- insuranceCompanyPolymerizationService.cancelOrder(insAreaCompany);
|
|
|
return HttpResult.ok();
|
|
|
}
|
|
|
throw new SystemException("此订单未到达已核保待缴费,无法跟新状态");
|