|
@@ -421,4 +421,42 @@ public class InsuranceApplicationController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value="删除投保单")
|
|
|
+ @PostMapping("delete")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id",value = "编号", required = true, paramType = "form",dataType = "String")
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> delete(@RequestParam(value="id",defaultValue="") String id,
|
|
|
+ HttpServletRequest request){
|
|
|
+ AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
|
+
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ InsuranceApplication insuranceApplication = insuranceApplicationService.get(id);
|
|
|
+ insuranceApplication.setDelFlag(true);
|
|
|
+ insuranceApplication.setUpdateBy(principal.getName());
|
|
|
+ insuranceApplication.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ int affectCount = insuranceApplicationService.update(insuranceApplication);
|
|
|
+
|
|
|
+ if (affectCount > 0) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("删除失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|