|
|
@@ -517,6 +517,38 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public R appRemove(List<Long> ids) {
|
|
|
+ if (CollectionUtils.isEmpty(ids)) {
|
|
|
+ return R.fail("请选择要删除的轮胎保");
|
|
|
+ }
|
|
|
+ List<ShopAppTireInsuranceRegister> shopAppTireInsuranceRegisterList = baseMapper.selectBatchIds(ids);
|
|
|
+ ShopAppTireInsuranceRegister changeData = shopAppTireInsuranceRegisterList.stream().filter(e -> NumberEnum.ONE.number.equals(e.getStatus())).findFirst().orElse(null);
|
|
|
+ if (changeData != null) {
|
|
|
+ return R.fail("客户:" + changeData.getConsumerName() + "的轮胎保已在保,不可删除");
|
|
|
+ }
|
|
|
+ BladeUser delUser = AuthUtil.getUser();
|
|
|
+ Date delDate = new Date();
|
|
|
+ ShopAppTireInsuranceFiles updateFile = new ShopAppTireInsuranceFiles();
|
|
|
+ updateFile.setIsDeleted(1);
|
|
|
+ updateFile.setUpdateUser(delUser.getUserId());
|
|
|
+ updateFile.setUpdateTime(delDate);
|
|
|
+ boolean delFileStatus = tireInsuranceFilesService.update(updateFile, new LambdaQueryWrapper<ShopAppTireInsuranceFiles>().in(ShopAppTireInsuranceFiles::getRegisterId, ids).eq(ShopAppTireInsuranceFiles::getIsDeleted, 0));
|
|
|
+ if (!delFileStatus) {
|
|
|
+ throw new RuntimeException("删除轮胎保失败,请刷新重试");
|
|
|
+ }
|
|
|
+ ShopAppTireInsuranceRegister updateRegister = new ShopAppTireInsuranceRegister();
|
|
|
+ updateRegister.setIsDeleted(1);
|
|
|
+ updateRegister.setUpdateUser(delUser.getUserId());
|
|
|
+ updateRegister.setUpdateTime(delDate);
|
|
|
+ int delCount = baseMapper.update(updateRegister, new LambdaQueryWrapper<ShopAppTireInsuranceRegister>().in(ShopAppTireInsuranceRegister::getId, ids));
|
|
|
+ if (delCount <= 0) {
|
|
|
+ throw new RuntimeException("删除轮胎保失败,请重试");
|
|
|
+ }
|
|
|
+ return R.success("删除轮胎保成功");
|
|
|
+ }
|
|
|
+
|
|
|
private ShopAppClaimAttachment saveClaimAttachment(String url, Long claimId, int type) {
|
|
|
ShopAppClaimAttachment shopAppClaimAttachment = new ShopAppClaimAttachment();
|
|
|
shopAppClaimAttachment.setClaimId(claimId);
|