| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保险购买申请 |
| | | */ |
| | | @PostMapping("/updatePolicy") |
| | | public AjaxResult updatePolicy(UserPolicyDto dto) { |
| | | |
| | | UserPolicy userPolicy = userPolicyService.getById(dto.getId()); |
| | | if(ObjectUtil.isNotEmpty(userPolicy)){ |
| | | userPolicy.setPhone(dto.getPhone()); |
| | | userPolicy.setBirthDate(LocalDate.parse(dto.getBirthDate())); |
| | | userPolicyService.updateById(userPolicy); |
| | | return AjaxResult.success("更新成功"); |
| | | }else{ |
| | | return AjaxResult.error("保单不存在"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | List<InsurancePosition> positions = insurancePositionService.list(); |
| | | positions.forEach(f->{ |
| | | if(activePolicies >= f.getNumberPeople()){ |
| | | superiorUser.setPosition(f.getPosition()); |
| | | superiorUser.setAgreedTime(LocalDate.now()); |
| | | if(!superiorUser.getPosition().equals(f.getPosition())){ |
| | | superiorUser.setPosition(f.getPosition()); |
| | | superiorUser.setAgreedTime(LocalDate.now()); |
| | | } |
| | | } |
| | | }); |
| | | userAccountService.updateById(superiorUser); |
| | |
| | | } |
| | | |
| | | userPolicy.setPayStatus(2); // 2-支付成功 |
| | | userPolicy.setPolicyStatus(UserPolicy.PolicyStatus.ACTIVE); |
| | | // userPolicy.setPolicyStatus(UserPolicy.PolicyStatus.ACTIVE); |
| | | userPolicy.setUpdatedAt(new Date()); |
| | | |
| | | boolean updateResult = userPolicyService.updateById(userPolicy); |