|
@@ -506,7 +506,7 @@ public class InsurancePolicyController {
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,
|
|
|
HttpServletRequest request){
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
- Map<String, Object> status = new HashMap<>();
|
|
|
+ Map<String, Object> dataMap = new HashMap<>();
|
|
|
|
|
|
try {
|
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
@@ -533,49 +533,14 @@ public class InsurancePolicyController {
|
|
|
searchParams.put("endTime", endTime);
|
|
|
}
|
|
|
|
|
|
- Integer Draft = 0;Integer Back = 0;Integer PendingTrial = 0;Integer PendingRetrial = 0;Integer PendingPay = 0;
|
|
|
- Integer PendingMakePolicy = 0;Integer PendingOutPolicy = 0;Integer SendOutPolicy = 0;Integer Expired = 0;
|
|
|
- Page<InsurancePolicy> page = insurancePolicyService.nextMonthPageList(searchParams, 1, 1000,sortList);
|
|
|
- for(InsurancePolicy insurancePolicy : page.getResult()){
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.Draft.getValue())){
|
|
|
- Draft++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.Back.getValue())){
|
|
|
- Back++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.PendingTrial.getValue())){
|
|
|
- PendingTrial++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.PendingRetrial.getValue())){
|
|
|
- PendingRetrial++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.PendingPay.getValue())){
|
|
|
- PendingPay++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.PendingMakePolicy.getValue())){
|
|
|
- PendingMakePolicy++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.PendingOutPolicy.getValue())){
|
|
|
- PendingOutPolicy++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.SendOutPolicy.getValue())){
|
|
|
- SendOutPolicy++;
|
|
|
- }
|
|
|
- if(insurancePolicy.getStatus().equals(PolicyStatus.Expired.getValue())){
|
|
|
- Expired++;
|
|
|
- }
|
|
|
+ for(PolicyStatus policyStatus : PolicyStatus.values()) {
|
|
|
+ searchParams.put("status", policyStatus.getValue() + "");
|
|
|
+ Page<InsurancePolicy> page = insurancePolicyService.nextMonthPageList(searchParams, 1, 1000, sortList);
|
|
|
+
|
|
|
+ dataMap.put(policyStatus.getValue() + "", page.getTotal());
|
|
|
}
|
|
|
- status.put(PolicyStatus.Draft.getText(),Draft);
|
|
|
- status.put(PolicyStatus.Back.getText(),Back);
|
|
|
- status.put(PolicyStatus.PendingTrial.getText(),PendingTrial);
|
|
|
- status.put(PolicyStatus.PendingRetrial.getText(),PendingRetrial);
|
|
|
- status.put(PolicyStatus.PendingPay.getText(),PendingPay);
|
|
|
- status.put(PolicyStatus.PendingMakePolicy.getText(),PendingMakePolicy);
|
|
|
- status.put(PolicyStatus.PendingOutPolicy.getText(),PendingOutPolicy);
|
|
|
- status.put(PolicyStatus.SendOutPolicy.getText(),SendOutPolicy);
|
|
|
- status.put(PolicyStatus.Expired.getText(),Expired);
|
|
|
-
|
|
|
- msgResult.setData(status);
|
|
|
+
|
|
|
+ msgResult.setData(dataMap);
|
|
|
msgResult.setResult(true);
|
|
|
}
|
|
|
catch(Exception ex){
|