|
|
@@ -12,6 +12,7 @@ import com.ydtech.modules.admin.model.SysUser;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserIsDial;
|
|
|
import com.ydtech.modules.admin.service.SysUserIsDialService;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
+import com.ydtech.modules.fee.service.CostsCalcService;
|
|
|
import com.ydtech.modules.ins.model.InsOrdersExcelVo;
|
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
|
import com.ydtech.modules.order.components.InsOrdersComponents;
|
|
|
@@ -22,11 +23,14 @@ import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
|
|
|
import com.ydtech.modules.order.entity.vo.*;
|
|
|
import com.ydtech.modules.order.service.*;
|
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto;
|
|
|
+import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
|
|
|
+import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
|
|
|
import com.ydtech.modules.scheme.service.PtlSchemeRulesService;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -39,6 +43,7 @@ import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -61,6 +66,10 @@ public class InsOrdersController extends BaseController {
|
|
|
|
|
|
private final InsAreaCompanyPositionService insAreaCompanyPositionService;
|
|
|
|
|
|
+ private final InsFeeOrderNewService insFeeOrderNewService;
|
|
|
+
|
|
|
+ private final CostsCalcService costsCalcService;
|
|
|
+
|
|
|
@Value("${upload.file.path}")
|
|
|
private String uploadPath;
|
|
|
|
|
|
@@ -70,7 +79,7 @@ public class InsOrdersController extends BaseController {
|
|
|
public InsOrdersController(InsAreaCompanyService insAreaCompanyService, InsOrdersService insOrdersService,
|
|
|
InsOrdersComponents insOrdersComponents, InsAccidentalDrivingService insAccidentalDrivingService,
|
|
|
SysUserIsDialService sysUserIsDialService, BatchOrderService batchOrderService,
|
|
|
- InsAreaCompanyPositionService insAreaCompanyPositionService) {
|
|
|
+ InsAreaCompanyPositionService insAreaCompanyPositionService, InsFeeOrderNewService insFeeOrderNewService, CostsCalcService costsCalcService) {
|
|
|
this.insAreaCompanyService = insAreaCompanyService;
|
|
|
this.insOrdersService = insOrdersService;
|
|
|
this.insOrdersComponents = insOrdersComponents;
|
|
|
@@ -78,6 +87,8 @@ public class InsOrdersController extends BaseController {
|
|
|
this.sysUserIsDialService = sysUserIsDialService;
|
|
|
this.batchOrderService = batchOrderService;
|
|
|
this.insAreaCompanyPositionService = insAreaCompanyPositionService;
|
|
|
+ this.insFeeOrderNewService = insFeeOrderNewService;
|
|
|
+ this.costsCalcService = costsCalcService;
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getAgreementInsCompany")
|
|
|
@@ -166,12 +177,30 @@ public class InsOrdersController extends BaseController {
|
|
|
.orderByDesc(InsAreaCompany::getCreatetime)
|
|
|
.list();
|
|
|
|
|
|
+ List<String> insAreaCompanyIdList = insAreaCompanies.stream().map(InsAreaCompany::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<InsFeeOrderNew> list = insFeeOrderNewService.lambdaQuery().in(InsFeeOrderNew::getInsOrderNo, insAreaCompanyIdList).list();
|
|
|
+ Map<String, InsFeeOrderNew> insFeeOrderNewMap = list.stream().collect(Collectors.toMap(InsFeeOrderNew::getInsOrderNo, x -> x));
|
|
|
+
|
|
|
List<InsAreaCompanyHistoryVo> collect = insAreaCompanies.stream().map(a -> {
|
|
|
InsAreaCompanyHistoryVo insAreaCompanyHistoryVo = new InsAreaCompanyHistoryVo();
|
|
|
BeanUtils.copyProperties(a, insAreaCompanyHistoryVo);
|
|
|
insAreaCompanyHistoryVo.setLicenseno(insOrders.getLicenseno());
|
|
|
insAreaCompanyHistoryVo.setUserName(insOrders.getUsername());
|
|
|
insAreaCompanyHistoryVo.setUserId(insOrders.getUserid());
|
|
|
+ InsFeeOrderNew insFeeOrderNew = insFeeOrderNewMap.get(a.getId());
|
|
|
+ SubOrderExportFeeVo subOrderExportFeeVo = costsCalcService.getExportFee(insFeeOrderNew);
|
|
|
+ insAreaCompanyHistoryVo.setJqExportFee(subOrderExportFeeVo.getJqExportCosts());
|
|
|
+ insAreaCompanyHistoryVo.setSyExportFee(subOrderExportFeeVo.getSyExportCosts());
|
|
|
+ insAreaCompanyHistoryVo.setNoExportFee(subOrderExportFeeVo.getNoExportCosts());
|
|
|
+ insAreaCompanyHistoryVo.setJqExportRadio(subOrderExportFeeVo.getJqExportRadio());
|
|
|
+ insAreaCompanyHistoryVo.setSyExportRadio(subOrderExportFeeVo.getSyExportRadio());
|
|
|
+ insAreaCompanyHistoryVo.setNoExportRadio(subOrderExportFeeVo.getNoExportRadio());
|
|
|
+ insAreaCompanyHistoryVo.setSumExportFee(subOrderExportFeeVo.getJqExportCosts()
|
|
|
+ .add(subOrderExportFeeVo.getSyExportCosts())
|
|
|
+ .add(subOrderExportFeeVo.getNoExportCosts()));
|
|
|
+ // 设置评分信息
|
|
|
+ insAreaCompanyHistoryVo.setRatingInformation();
|
|
|
return insAreaCompanyHistoryVo;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
@@ -495,5 +524,11 @@ public class InsOrdersController extends BaseController {
|
|
|
return HttpResult.ok(licenseList);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/queryInsuredInOrder")
|
|
|
+ @ApiOperation(value = "查询订单中的被保人")
|
|
|
+ public HttpResult<List<String>> queryInsuredInOrder(@RequestBody QueryLicenseInOrderVo queryInsuredInOrderVo){
|
|
|
+ List<String> insured = insOrdersService.queryInsuredInOrder(queryInsuredInOrderVo);
|
|
|
+ return HttpResult.ok(insured);
|
|
|
+ }
|
|
|
|
|
|
}
|