//package com.dsh.guns.modular.system.service.impl;
|
//
|
//import com.dsh.guns.modular.system.model.TLocation;
|
//import com.dsh.guns.modular.system.service.ITLocationService;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.stereotype.Service;
|
//
|
//import java.text.SimpleDateFormat;
|
//import java.util.Calendar;
|
//import java.util.Date;
|
//import java.util.List;
|
//
|
///**
|
// * <p>
|
// * 地点 服务实现类
|
// * </p>
|
// *
|
// * @author 吕雪
|
// * @since 2020-09-04
|
// */
|
//@Service
|
//public class TLocationServiceImpl extends ServiceImpl<TLocationMapper, TLocation> implements ITLocationService {
|
//
|
// @Autowired
|
// private GDMapElectricFenceUtil gdMapElectricFenceUtil;
|
//
|
//
|
// /**
|
// * 定时任务更新线上围栏的有效时间
|
// * @throws Exception
|
// */
|
// @Override
|
// public void updateFence() throws Exception {
|
// Date date = new Date();
|
// Calendar calendar = Calendar.getInstance();
|
// calendar.setTime(new Date());
|
// calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + 35);
|
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
// List<TLocation> type = this.selectList(new EntityWrapper<TLocation>().eq("type", 2));
|
// for(TLocation location : type){
|
// if((date.getTime() - location.getUpdateTime().getTime()) > 30 * 24 * 60 * 60 * 1000){//更新一个月之前的数据
|
// String[] s = location.getGid().split("_");
|
// String[] s1 = location.getCoordinate().split("_");
|
// for(int i = 0; i < s.length; i++){
|
// String[] split = s1[i].split(";");
|
// gdMapElectricFenceUtil.updateElectricFenc(s[i], "location_" + location.getId(),
|
// (split.length > 2 ? "" : split[0]), (split.length > 2 ? "" : split[1]),
|
// (split.length > 2 ? s1[i] : ""), sdf.format(calendar.getTime()));
|
// }
|
//
|
// }
|
// }
|
// }
|
//}
|