|
|
@@ -14,10 +14,7 @@ import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
|
|
|
import com.ydtech.modules.order.entity.po.InsOrdersCarInfo;
|
|
|
import com.ydtech.modules.order.entity.po.InsOrdersCarUserInfo;
|
|
|
import com.ydtech.modules.order.entity.vo.OrderQueryVo;
|
|
|
-import com.ydtech.modules.order.service.InsAreaCompanyCarInfoService;
|
|
|
-import com.ydtech.modules.order.service.InsAreaCompanyService;
|
|
|
-import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
-import com.ydtech.modules.order.service.InsOrdersTrackService;
|
|
|
+import com.ydtech.modules.order.service.*;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
@@ -25,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -43,6 +41,15 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
@Autowired
|
|
|
private InsAreaCompanyCarInfoService insAreaCompanyCarInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private InsAreaCompanyCarUserInfoService insAreaCompanyCarUserInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private InsAreaCompanyRiskService insAreaCompanyRiskService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private InsAreaCompanyKindService insAreaCompanyKindService;
|
|
|
+
|
|
|
public InsAreaCompanyServiceImpl(@Lazy InsOrdersService insOrdersService, InsOrdersTrackService insOrdersTrackService) {
|
|
|
this.insOrdersService = insOrdersService;
|
|
|
this.insOrdersTrackService = insOrdersTrackService;
|
|
|
@@ -93,8 +100,29 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public void insertCompanyAndOrders(InsAreaCompany insAreaCompany) {
|
|
|
+ InsOrdersBo insOrdersBo = insOrdersService.queryInsOrders(insAreaCompany.getOrderno());
|
|
|
+ //插入主表信息
|
|
|
baseMapper.insert(insAreaCompany);
|
|
|
+
|
|
|
+ //车辆信息
|
|
|
+ InsAreaCompanyCarInfo insAreaCompanyCarInfo = insOrdersBo.getCarinfo().toInsAreaCompanyCarInfo();
|
|
|
+ insAreaCompanyCarInfoService.save(insAreaCompanyCarInfo);
|
|
|
+
|
|
|
+ //人员信息
|
|
|
+ List<InsAreaCompanyCarUserInfo> insAreaCompanyCarUserInfos = new ArrayList<>();
|
|
|
+ InsAreaCompanyCarUserInfo ownerInfo = insOrdersBo.getOwnerinfo().toInsAreaCompanyCarUserInfo();
|
|
|
+ InsAreaCompanyCarUserInfo applyInfo = insOrdersBo.getApplyinfo().toInsAreaCompanyCarUserInfo();
|
|
|
+ InsAreaCompanyCarUserInfo insureInfo = insOrdersBo.getInsureinfo().toInsAreaCompanyCarUserInfo();
|
|
|
+ insAreaCompanyCarUserInfos.add(ownerInfo);
|
|
|
+ insAreaCompanyCarUserInfos.add(applyInfo);
|
|
|
+ insAreaCompanyCarUserInfos.add(insureInfo);
|
|
|
+ insAreaCompanyCarUserInfoService.saveBatch(insAreaCompanyCarUserInfos);
|
|
|
+
|
|
|
+ //risk
|
|
|
+ insAreaCompanyRiskService.saveRisks(insAreaCompany.getCompanyId(), insAreaCompany.getRisk());
|
|
|
+
|
|
|
insOrdersTrackService.addingTrajectories(insAreaCompany);
|
|
|
insOrdersService.updateByOrderStatus(insAreaCompany);
|
|
|
}
|