老设备入库删除重复数据
This commit is contained in:
parent
9edb776849
commit
c21fc355a6
|
@ -36,7 +36,7 @@ public class EquTask {
|
||||||
/**
|
/**
|
||||||
* 港口原有设备对接
|
* 港口原有设备对接
|
||||||
*/
|
*/
|
||||||
@Scheduled(fixedRate = 3600)
|
@Scheduled(fixedRate = 3600000)
|
||||||
public void equ(){
|
public void equ(){
|
||||||
String hash = "16EA8A305FB58BE0730DD67F04F022F4";
|
String hash = "16EA8A305FB58BE0730DD67F04F022F4";
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class EquTask {
|
||||||
map.put("sensorUId",e.getSn());
|
map.put("sensorUId",e.getSn());
|
||||||
map.put("label",e.getName());
|
map.put("label",e.getName());
|
||||||
HttpResult result = OkHttps.sync("http://10.201.35.30:8090/enviSensor/select?" +
|
HttpResult result = OkHttps.sync("http://10.201.35.30:8090/enviSensor/select?" +
|
||||||
"page=1&pageSize=20&valid=0&type=5&sensorUId={sensorUId}&label={label}")
|
"page=1&pageSize=40&valid=0&type=5&sensorUId={sensorUId}&label={label}")
|
||||||
.addPathPara(map)
|
.addPathPara(map)
|
||||||
.addHeader("token", token)
|
.addHeader("token", token)
|
||||||
.get();
|
.get();
|
||||||
|
|
|
@ -26,4 +26,11 @@ public interface OutSideMapper {
|
||||||
* @param list
|
* @param list
|
||||||
*/
|
*/
|
||||||
void insertMonth(@Param("sensorMonthList") List<SensorMonth> list);
|
void insertMonth(@Param("sensorMonthList") List<SensorMonth> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除相同数据
|
||||||
|
* @param sn
|
||||||
|
* @param reportTime
|
||||||
|
*/
|
||||||
|
void deleteSampleDevice(@Param("sn")String sn,@Param("reportTime") String reportTime);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,7 @@ public class OutSideServiceImpl implements OutSideService {
|
||||||
for (JsonNode node : rootNode) {
|
for (JsonNode node : rootNode) {
|
||||||
if (node.get("type").asInt()==5) {
|
if (node.get("type").asInt()==5) {
|
||||||
SensorData sd = insertOldData(node);
|
SensorData sd = insertOldData(node);
|
||||||
|
outSideMapper.deleteSampleDevice(sd.getSn(),sd.getReportTime());
|
||||||
outSideMapper.insertDevice(sd);
|
outSideMapper.insertDevice(sd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,4 +64,8 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
SELECT * FROM dual
|
SELECT * FROM dual
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<delete id="deleteSampleDevice">
|
||||||
|
delete from th_device_report where sn=#{sn} and report_time= TO_DATE(#{reportTime}, 'yyyy-mm-dd hh24:mi:ss')
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue