|
|
@@ -22,12 +22,14 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.gubersail.shop.app.api.claim.entity.ShopAppClaim;
|
|
|
import com.gubersail.shop.app.api.claim.entity.ShopAppClaimAttachment;
|
|
|
+import com.gubersail.shop.app.api.corps.entity.ShopAppPjCorpsDesc;
|
|
|
import com.gubersail.shop.app.api.insurance.entity.ShopAppTireInsuranceFiles;
|
|
|
import com.gubersail.shop.app.api.insurance.entity.ShopAppTireInsuranceRecord;
|
|
|
import com.gubersail.shop.app.api.insurance.entity.ShopAppTireInsuranceRegister;
|
|
|
import com.gubersail.shop.app.api.insurance.vo.ShopAppTireInsuranceRegisterVO;
|
|
|
import com.gubersail.shop.app.claim.service.IShopAppClaimAttachmentService;
|
|
|
import com.gubersail.shop.app.claim.service.IShopAppClaimService;
|
|
|
+import com.gubersail.shop.app.corp.mapper.ShopAppCorpsDescMapper;
|
|
|
import com.gubersail.shop.app.insurance.mapper.ShopAppTireInsuranceRegisterMapper;
|
|
|
import com.gubersail.shop.app.insurance.service.IShopAppTireInsuranceFilesService;
|
|
|
import com.gubersail.shop.app.insurance.service.IShopAppTireInsuranceRecordService;
|
|
|
@@ -74,8 +76,6 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
|
|
|
|
|
|
private final IUserClient userClient;
|
|
|
|
|
|
- private final ISysClient sysClient;
|
|
|
-
|
|
|
private final IShopAppClaimService bladeClaimService;
|
|
|
|
|
|
private final IShopAppClaimAttachmentService bladeClaimAttachmentService;
|
|
|
@@ -84,6 +84,9 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
|
|
|
|
|
|
private final IOssClient ossClient;
|
|
|
|
|
|
+ private final ShopAppCorpsDescMapper corpDescMapper;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<ShopAppTireInsuranceRegisterVO> selectTireInsuranceRegisterPage(IPage<ShopAppTireInsuranceRegisterVO> page, ShopAppTireInsuranceRegisterVO tireInsuranceRegister) {
|
|
|
return page.setRecords(baseMapper.selectTireInsuranceRegisterPage(page, tireInsuranceRegister));
|
|
|
@@ -156,7 +159,7 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
|
|
|
if (carOwner == null) {
|
|
|
throw new RuntimeException("未查手机号:" + tireInsuranceRegister.getConsumerPhone() + "对应车主用户信息");
|
|
|
}
|
|
|
- tireInsuranceRegister.setVersion(tireInsuranceRegister.getVersion() + 1);
|
|
|
+ tireInsuranceRegister.setVersion(Objects.isNull(tireInsuranceRegister.getVersion()) ? 1: tireInsuranceRegister.getVersion() + 1);
|
|
|
//判断是否是第一次保存
|
|
|
if (tireInsuranceRegister.getId() == null) {
|
|
|
// 获取 流水号
|
|
|
@@ -164,6 +167,8 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
|
|
|
if (!StringUtils.hasText(billNo) || billNo.length() < NumberEnum.FIFTEEN.number) {
|
|
|
return R.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), "生成系统编号失败");
|
|
|
}
|
|
|
+ // carOwner.getStoreId() 这是个用户id
|
|
|
+ ShopAppPjCorpsDesc appPjCorpsDesc = corpDescMapper.selectCorpsByAttnUserId(carOwner.getStoreId());
|
|
|
tireInsuranceRegister.setInsuranceTime(Date.from(currentDate.plusYears(1).atZone(ZoneId.systemDefault()).toInstant()));
|
|
|
tireInsuranceRegister.setInsuranceNo(billNo);
|
|
|
tireInsuranceRegister.setCreateTime(new Date());
|
|
|
@@ -171,8 +176,8 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
|
|
|
tireInsuranceRegister.setCreateDept(Long.parseLong(AuthUtil.getDeptId()));
|
|
|
tireInsuranceRegister.setCreateUser(carOwner.getUserId());
|
|
|
tireInsuranceRegister.setStoreId(carOwner.getStoreId());
|
|
|
- tireInsuranceRegister.setStoreName(carOwner.getStoreName());
|
|
|
- tireInsuranceRegister.setStorePhone(carOwner.getStorePhone());
|
|
|
+ tireInsuranceRegister.setStoreName(Objects.isNull(appPjCorpsDesc) ? carOwner.getStoreName() : appPjCorpsDesc.getCname());
|
|
|
+ tireInsuranceRegister.setStorePhone(Objects.isNull(appPjCorpsDesc) ? carOwner.getStorePhone() : appPjCorpsDesc.getTel());
|
|
|
tireInsuranceRegister.setStoreAddress(carOwner.getStoreAddress());
|
|
|
tireInsuranceRegister.setStoreContact(carOwner.getStoreContact());
|
|
|
tireInsuranceRegister.setDealerId(carOwner.getDealerId());
|