فهرست منبع

客户管理修改bug

785834757 2 سال پیش
والد
کامیت
960a314bed

+ 18 - 11
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -1191,18 +1191,18 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         Integer isJq = 1;
         if(orderExpirationQueryVo.getJqEndDate() != null){
             currentTime = LocalDateTime.parse(orderExpirationQueryVo.getJqEndDate(),DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
-            oneMonthAgo = currentTime.minus(1, ChronoUnit.MONTHS);
+            oneMonthAgo = currentTime.plus(1, ChronoUnit.MONTHS);
         }else if(orderExpirationQueryVo.getSyEndDate() != null){
             currentTime = LocalDateTime.parse(orderExpirationQueryVo.getSyEndDate(),DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
-            oneMonthAgo = currentTime.minus(1, ChronoUnit.MONTHS);
+            oneMonthAgo = currentTime.plus(1, ChronoUnit.MONTHS);
             isJq = 2;
         }else {
             currentTime = LocalDateTime.now();
-            oneMonthAgo = currentTime.minus(1, ChronoUnit.MONTHS);
+            oneMonthAgo = currentTime.plus(1, ChronoUnit.MONTHS);
         }
         return baseMapper.getExpirationInsureCount(orderExpirationQueryVo.getUserid(),
-                oneMonthAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
-                currentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),isJq,orderExpirationQueryVo.getParam());
+                currentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
+                oneMonthAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),isJq,orderExpirationQueryVo.getParam());
     }
 
     @Override
@@ -1211,17 +1211,24 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         Integer isJq = 1;
         if(orderExpirationQueryVo.getJqEndDate() != null){
             currentTime = LocalDateTime.parse(orderExpirationQueryVo.getJqEndDate(),DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
-            oneMonthAgo = currentTime.minus(1, ChronoUnit.MONTHS);
+            oneMonthAgo = currentTime.plus(1, ChronoUnit.MONTHS);
         }else if(orderExpirationQueryVo.getSyEndDate() != null){
             currentTime = LocalDateTime.parse(orderExpirationQueryVo.getSyEndDate(),DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
-            oneMonthAgo = currentTime.minus(1, ChronoUnit.MONTHS);
+            oneMonthAgo = currentTime.plus(1, ChronoUnit.MONTHS);
             isJq = 2;
         }else {
             currentTime = LocalDateTime.now();
-            oneMonthAgo = currentTime.minus(1, ChronoUnit.MONTHS);
+            oneMonthAgo = currentTime.plus(1, ChronoUnit.MONTHS);
         }
-        return baseMapper.getExpirationInsure(page,orderExpirationQueryVo.getUserid(),
-                oneMonthAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
-                currentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),isJq,orderExpirationQueryVo.getParam());
+        Page<OrderExpirationVo> expirationInsure = baseMapper.getExpirationInsure(page, orderExpirationQueryVo.getUserid(),
+                currentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
+                oneMonthAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), isJq, orderExpirationQueryVo.getParam());
+        List<OrderExpirationVo> records = expirationInsure.getRecords();
+        for(OrderExpirationVo record : records){
+            Integer difference = Integer.parseInt(record.getDifference());
+            record.setDifference(String.valueOf(-difference));
+        }
+        expirationInsure.setRecords(records);
+        return expirationInsure;
     }
 }

+ 6 - 6
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -1262,11 +1262,11 @@
         SELECT
             a.ins_company,
             b.id as orderno,
-        a.jqenddate,
-        a.syenddate,
-        a.productid,
-        a.product,
-        a.licenseno,
+            a.jqenddate,
+            a.syenddate,
+            a.productid,
+            a.product,
+            a.licenseno,
             <if test="isJq == 1">
                 DATEDIFF( NOW(), jqenddate ) AS difference
             </if>
@@ -1294,6 +1294,6 @@
         </if>
 
         ORDER BY
-            jqenddate DESC
+            difference DESC
     </select>
 </mapper>