定时任务检查版本
This commit is contained in:
parent
9609bc794a
commit
9987dd587c
@ -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<Map<String, Object>> list = xhpcPileRegularInspectMapper.verificationPileRepeat();
|
||||
for (int i = 0; i <list.size() ; i++) {
|
||||
Map<String, Object> 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 <str.length() ; i++) {
|
||||
if(i==0){
|
||||
System.out.println("============123456789===================="+str.substring(i,i+1));
|
||||
}else{
|
||||
System.out.println("============123456789===================="+str.substring(i-1,i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user