|
@@ -3,6 +3,7 @@ package com.ydtech.modules.largescreen.controller;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.beust.ah.A;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.modules.largescreen.model.*;
|
|
import com.ydtech.modules.largescreen.model.*;
|
|
|
import com.ydtech.modules.largescreen.model.query.CompanyQuery;
|
|
import com.ydtech.modules.largescreen.model.query.CompanyQuery;
|
|
@@ -16,7 +17,9 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
|
|
@Api(tags = "数据大屏")
|
|
@Api(tags = "数据大屏")
|
|
|
@RestController
|
|
@RestController
|
|
@@ -55,16 +58,7 @@ public class DataController {
|
|
|
public HttpResult companySumData(@RequestBody(required=false) DataQuery dataQuery) {
|
|
public HttpResult companySumData(@RequestBody(required=false) DataQuery dataQuery) {
|
|
|
List<AgreementData> sumData = dataService.getCompanySumData(dataQuery);
|
|
List<AgreementData> sumData = dataService.getCompanySumData(dataQuery);
|
|
|
String[][] result = new String[sumData.size()][7];
|
|
String[][] result = new String[sumData.size()][7];
|
|
|
-// int index = (int)Math.ceil(sumData.size()/6);
|
|
|
|
|
-// int rows = 6;
|
|
|
|
|
-// AgreementData[][] result = new AgreementData[index][rows];
|
|
|
|
|
-// for(int i=0;i<index;i++){
|
|
|
|
|
-//
|
|
|
|
|
-// int len = i==0 ? 6 : sumData.size() - ((i) * 6);
|
|
|
|
|
-// for(int k=0;k<len;k++){
|
|
|
|
|
-// result[i][k] = sumData.get(i*6+k);
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+
|
|
|
sumData.forEach(item->{
|
|
sumData.forEach(item->{
|
|
|
int i = sumData.indexOf(item);
|
|
int i = sumData.indexOf(item);
|
|
|
result[i][0] = item.getInsuranceCompanyId();
|
|
result[i][0] = item.getInsuranceCompanyId();
|
|
@@ -298,4 +292,65 @@ public class DataController {
|
|
|
return HttpResult.ok(companySumData);
|
|
return HttpResult.ok(companySumData);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("listData")
|
|
|
|
|
+ public HttpResult listData(@RequestBody DataQuery dataQuery){
|
|
|
|
|
+ List<CompanyData> sumData = dataService.getCompanyOrderStatusData(dataQuery);
|
|
|
|
|
+ List<ListData> listDatas = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ sumData.forEach(item->{
|
|
|
|
|
+ ListData listData = new ListData();
|
|
|
|
|
+ listData.setInsuranceCompany(item.getCompanyName());
|
|
|
|
|
+ listData.setInsuranceCompanyId(item.getCompanyId());
|
|
|
|
|
+ Optional<OrderStatusData> first = item.getOrderStatusData().stream().filter(x -> x.getOrderStatusCode().equals("3")).findFirst();
|
|
|
|
|
+ if(first.isEmpty()) {
|
|
|
|
|
+ listData.setJqPremium("0");
|
|
|
|
|
+ listData.setSyPremium("0");
|
|
|
|
|
+ listData.setTaxPremium("0");
|
|
|
|
|
+ listData.setSumPremium("0");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ listData.setJqPremium(first.get().getJqPremium());
|
|
|
|
|
+ listData.setSyPremium(first.get().getSyPremium());
|
|
|
|
|
+ listData.setTaxPremium(first.get().getTaxPremium());
|
|
|
|
|
+ listData.setSumPremium(first.get().getSumPremium());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Optional<OrderStatusData> first1 = item.getOrderStatusData().stream().filter(x -> x.getOrderStatusCode().equals("0")).findFirst();
|
|
|
|
|
+ if(first1.isEmpty()){
|
|
|
|
|
+ listData.setQuoting("0");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ listData.setQuoting(first1.get().getSumOrderNum().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ Optional<OrderStatusData> first2 = item.getOrderStatusData().stream().filter(x -> x.getOrderStatusCode().equals("1")).findFirst();
|
|
|
|
|
+ if(first2.isEmpty()){
|
|
|
|
|
+ listData.setUninsured("0");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ listData.setUninsured(first2.get().getSumOrderNum().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ Optional<OrderStatusData> first3 = item.getOrderStatusData().stream().filter(x -> x.getOrderStatusCode().equals("2")).findFirst();
|
|
|
|
|
+ if(first3.isEmpty()){
|
|
|
|
|
+ listData.setUnderwrited("0");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ listData.setUnderwrited(first3.get().getSumOrderNum().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ Optional<OrderStatusData> first4 = item.getOrderStatusData().stream().filter(x -> x.getOrderStatusCode().equals("3")).findFirst();
|
|
|
|
|
+ if(first4.isEmpty()){
|
|
|
|
|
+ listData.setInsured("0");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ listData.setInsured(first4.get().getSumOrderNum().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ Optional<OrderStatusData> first5 = item.getOrderStatusData().stream().filter(x -> x.getOrderStatusCode().equals("4")).findFirst();
|
|
|
|
|
+ if(first5.isEmpty()){
|
|
|
|
|
+ listData.setUnderwriteReturn("0");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ listData.setUnderwriteReturn(first5.get().getSumOrderNum().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ listDatas.add(listData);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return HttpResult.ok(listDatas);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|