Commit c6b43741 authored by kongfm's avatar kongfm

更新气瓶接口

parent 87591a15
package com.yeejoin.amos.api.openapi.face.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.api.openapi.constant.Constant;
import com.yeejoin.amos.api.openapi.face.model.BizTokenModel;
......@@ -19,10 +17,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.CylinderInspection;
import com.yeejoin.amos.api.openapi.face.orm.entity.CylinderTags;
import com.yeejoin.amos.api.openapi.face.orm.entity.CylinderUnit;
import com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
......@@ -37,7 +32,6 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
......@@ -88,7 +82,8 @@ public class CylinderDateInfoService extends BaseService<CylinderDateInfoModel,
for(OpenapiBizToken token : tokenList) {
try {
Date today = new Date();
String todayStr = DateUtils.dateFormat(today,"yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String todayStr = sdf.format(today);
List<CylinderDateInfo> list = this.list(new LambdaQueryWrapper<CylinderDateInfo>().eq(CylinderDateInfo::getSyncDate, todayStr + " 00:00:00"));
if(list.size() == 0) {
CylinderDateInfoModel temp = new CylinderDateInfoModel();
......@@ -138,7 +133,7 @@ public class CylinderDateInfoService extends BaseService<CylinderDateInfoModel,
this.updateById(info);
});
}
} catch (ParseException e) {
} catch (Exception e) {
e.printStackTrace();
}
}
......@@ -337,7 +332,8 @@ public class CylinderDateInfoService extends BaseService<CylinderDateInfoModel,
for(String d : dateList) {
CylinderDateInfoModel temp = new CylinderDateInfoModel();
try {
temp.setSyncDate(DateUtils.dateParse(d,"yyyy-MM-dd"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
temp.setSyncDate(sdf.parse(d));
} catch (ParseException e) {
e.printStackTrace();
}
......@@ -388,7 +384,8 @@ public class CylinderDateInfoService extends BaseService<CylinderDateInfoModel,
List<OpenapiBizToken> tokenList = openapiBizTokenService.list(new LambdaQueryWrapper<OpenapiBizToken>().eq(OpenapiBizToken::getDeveloperAgency,s).eq(OpenapiBizToken::getDataType,"cyl"));
for(OpenapiBizToken token : tokenList) {
try {
String todayStr = DateUtils.dateFormat(date,"yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String todayStr = sdf.format(date);
List<CylinderDateInfo> list = this.list(new LambdaQueryWrapper<CylinderDateInfo>().eq(CylinderDateInfo::getSyncDate, todayStr + " 00:00:00"));
if(list.size() == 0) {
CylinderDateInfoModel temp = new CylinderDateInfoModel();
......@@ -438,7 +435,7 @@ public class CylinderDateInfoService extends BaseService<CylinderDateInfoModel,
this.updateById(info);
});
}
} catch (ParseException e) {
} catch (Exception e) {
e.printStackTrace();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment