浏览代码

同比环比添加状态

yq 3 年之前
父节点
当前提交
71c0e204ee

+ 2 - 2
mhfire-controller/src/main/resources/smart-doc.json

@@ -1,10 +1,10 @@
 {
   "outPath":"./src/main/resources/static/doc",
-  "serverUrl": "http://172.16.120.155:8083",
+  "serverUrl": "http://120.55.70.156",
   "isStrict": false,
   "coverOld": true,
   "allInOne": true,
-  "packageFilters": "com.bizmatics.mhfire.controller.web.bulehelp",
+  "packageFilters": "com.bizmatics.mhfire.controller.web",
   "requestExample":"false",
   "responseExample":"true",
   "projectName": "mhfire"

+ 18 - 2
mhfire-service/src/main/java/com/bizmatics/mhfire/service/impl/SiAeAllServiceImpl.java

@@ -44,15 +44,31 @@ public class SiAeAllServiceImpl implements SiAeAllService {
                 siAeAllVO.setCheckType(type);
                 Double radio = aeAll.get(type);
                 siAeAllVO.setNumber(radio);
+                Double upRadio = 0.00;
+                Double linkRadio = 0.00;
                 if (0 != radio){
-                    double upRadio = Optional.ofNullable(upAllCollect).map(up -> up.get(type)).orElse(0.0);
+                    upRadio = Optional.ofNullable(upAllCollect).map(up -> up.get(type)).orElse(0.0);
                     siAeAllVO.setSameRatio(Arith.div(upRadio,radio));
-                    double linkRadio = Optional.ofNullable(linkAllCollect).map(link -> link.get(type)).orElse(0.0);
+                    linkRadio = Optional.ofNullable(linkAllCollect).map(link -> link.get(type)).orElse(0.0);
                     siAeAllVO.setLinkRelativeRatio(Arith.div(linkRadio,radio));
                 }else {
                     siAeAllVO.setSameRatio(0.00);
                     siAeAllVO.setLinkRelativeRatio(0.00);
                 }
+                if (radio.equals(upRadio)){
+                    siAeAllVO.setSameStatus(0);
+                }else if (radio > upRadio){
+                    siAeAllVO.setSameStatus(1);
+                }else {
+                    siAeAllVO.setSameStatus(2);
+                }
+                if (radio.equals(linkRadio)){
+                    siAeAllVO.setLinkRelativeStatus(0);
+                }else if (radio > linkRadio){
+                    siAeAllVO.setLinkRelativeStatus(1);
+                }else {
+                    siAeAllVO.setLinkRelativeStatus(2);
+                }
                 allVoS.add(siAeAllVO);
             }
         });

+ 10 - 0
mhfire-service/src/main/java/com/bizmatics/mhfire/service/vo/SiAeAllVO.java

@@ -31,4 +31,14 @@ public class SiAeAllVO {
      * 同比
      */
     private Double sameRatio;
+
+    /**
+     * 环比上升還是下降
+     */
+    private Integer linkRelativeStatus;
+
+    /**
+     * 同比上升還是下降
+     */
+    private Integer sameStatus;
 }