skyline 2 anni fa
parent
commit
92861114eb

+ 1 - 1
admin-web/src/views/admin/index.vue

@@ -611,7 +611,7 @@ $homeNavLengh: 8;
   justify-content: space-between;
 
   .trend-summary {
-    flex: 1;
+    flex: -1;
   }
 }
 </style>

+ 12 - 12
mapper/src/main/resources/mappers/miniapp/ChargeOrderMapper.xml

@@ -75,25 +75,25 @@
                 and t2.user_id = #{params.userId}
             </if>
             <if test="params.mobilePhone != null and params.mobilePhone != ''">
-                and t2.mobile_phone = "#{params.mobilePhone}"
+                and t2.mobile_phone = #{params.mobilePhone}
             </if>
             <if test="params.connectorId != null and params.connectorId != ''">
-                and t1.connector_id = "#{params.connectorId}"
+                and t1.connector_id = #{params.connectorId}
             </if>
             <if test="params.startChargeSeq != null and params.startChargeSeq != ''">
-                and t1.start_charge_seq = "#{params.startChargeSeq}"
+                and t1.start_charge_seq = #{params.startChargeSeq}
             </if>
             <if test="params.stationId != null and params.stationId != ''">
-                and t1.station_id = "#{params.stationId}"
+                and t1.station_id = #{params.stationId}
             </if>
             <if test="params.orderStatus != null">
                 and t1.order_status = #{params.orderStatus}
             </if>
             <if test="params.startDate != null and params.startDate != ''">
-                and t1.start_time &gt;= "#{params.startDate}"
+                and t1.start_time &gt;= #{params.startDate}
             </if>
             <if test="params.endDate != null and params.endDate != ''">
-                and t1.end_time &lt;= "#{params.endDate}"
+                and t1.end_time &lt;= #{params.endDate}
             </if>
         </where>
     </select>
@@ -123,25 +123,25 @@
                 and t2.user_id = #{params.userId}
             </if>
             <if test="params.mobilePhone != null and params.mobilePhone != ''">
-                and t2.mobile_phone = "#{params.mobilePhone}"
+                and t2.mobile_phone = #{params.mobilePhone}
             </if>
             <if test="params.connectorId != null and params.connectorId != ''">
-                and t1.connector_id = "#{params.connectorId}"
+                and t1.connector_id = #{params.connectorId}
             </if>
             <if test="params.stationId != null and params.stationId != ''">
-                and t1.station_id = "#{params.stationId}"
+                and t1.station_id = #{params.stationId}
             </if>
             <if test="params.startChargeSeq != null and params.startChargeSeq != ''">
-                and t1.start_charge_seq = "#{params.startChargeSeq}"
+                and t1.start_charge_seq = #{params.startChargeSeq}
             </if>
             <if test="params.orderStatus != null">
                 and t1.order_status = #{params.orderStatus}
             </if>
             <if test="params.startDate != null and params.startDate != ''">
-                and t1.start_time &gt;= "#{params.startDate}"
+                and t1.start_time &gt;= #{params.startDate}
             </if>
             <if test="params.endDate != null and params.endDate != ''">
-                and t1.end_time &lt;= "#{params.endDate}"
+                and t1.end_time &lt;= #{params.endDate}
             </if>
         </where>
         order by t1.start_time desc

+ 2 - 0
service/src/main/java/com/kym/service/miniapp/impl/ChargeOrderServiceImpl.java

@@ -55,6 +55,8 @@ public class ChargeOrderServiceImpl extends ServiceImpl<ChargeOrderMapper, Charg
 
     @Override
     public PageBean<CustomOrderVo> customChargeOrders(CustomChargeOrdersQueryParam params) {
+        var connectorId = kymCache.getConnectorId(params.getConnectorId());
+        params.setConnectorId(connectorId);
         // 判断数据权限
         params.setStationId(kymCache.getAdminUserStationId(StpUtil.getLoginIdAsLong()));
         PageHelper.startPage(params.getPageNum(), params.getPageSize());

+ 10 - 0
service/src/main/java/com/kym/service/utils/KymCache.java

@@ -40,6 +40,16 @@ public class KymCache {
         return SHORT_ID_MAPPING.get(equipmentId);
     }
 
+    public String getConnectorId(String equipmentId) {
+        return switch (equipmentId.length()) {
+            case 17 -> equipmentId;
+            case 16 -> equipmentId.concat("1");
+            case 6 ->  SHORT_ID_MAPPING.entrySet().stream().filter(entry -> equipmentId.equals(entry.getValue())).map(Map.Entry::getKey).findFirst().get();
+            default -> null;
+        };
+    }
+
+
     public String getStationId(String connectorId) {
         return CONNECTOR_STATION_MAPPING.get(connectorId);
     }