diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPileRegularInspectServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPileRegularInspectServiceImpl.java index 11a0087e..32431832 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPileRegularInspectServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcPileRegularInspectServiceImpl.java @@ -12,6 +12,7 @@ import com.xhpc.order.domain.XhpcPileRegularInspect; import com.xhpc.order.mapper.XhpcPileRegularInspectMapper; import com.xhpc.order.service.IXhpcPileRegularInspectService; import com.xhpc.system.api.model.LoginUser; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -149,7 +150,6 @@ public class XhpcPileRegularInspectServiceImpl extends BaseService implements IX int number = xhpcPileRegularInspectMapper.getPileRegularInspect(time[0],1); if(number>0){ //获取所有桩需要核对的版本号 - System.out.println("============定时任务版本检查========111111============"); List> list = xhpcPileRegularInspectMapper.verificationPileRepeat(); for (int i = 0; i map1=list.get(i); @@ -162,14 +162,25 @@ public class XhpcPileRegularInspectServiceImpl extends BaseService implements IX if(cachePile==null || cachePile.get("firmwareVersion")==null){ R r = workOrderService.addNewOrder("12","版本号不一致","该桩版本号和系统设置的版本号不一致","",chargingStationId,"PILE",serialNumber); }else{ - String firmwareVersion = cachePile.get("firmwareVersion").toString(); + String firmwareVersion = String.valueOf(cachePile.get("firmwareVersion")); + String replace1 = firmwareVersion.replace("\\u0000", "").trim(); + String replace = directNumber.replace("\\u0000", "").trim(); + String replace2 = communicationNumber.replace("\\u0000", "").trim(); if(type==1){ - if(!directNumber.equals(firmwareVersion)){ + boolean inspect =false; + if(replace.length() ==replace1.length()){ + if(!replace1.equals(replace)){ + inspect =true; + } + }else{ + inspect =true; + } + if(inspect){ //添加一条工单 R r = workOrderService.addNewOrder("12","版本号不一致","该桩版本号和系统设置的版本号不一致","",chargingStationId,"PILE",serialNumber); } }else{ - if(!communicationNumber.equals(firmwareVersion)){ + if(!replace2.equals(replace1)){ //添加一条工单 R r = workOrderService.addNewOrder("12","版本号不一致","该桩版本号和系统设置的版本号不一致","",chargingStationId,"PILE",serialNumber); } @@ -240,4 +251,18 @@ public class XhpcPileRegularInspectServiceImpl extends BaseService implements IX e.printStackTrace(); } } + + public static void main(String[] args) { + String str="3.9-08\\u0000\\u0000"; + for (int i = 0; i