This commit is contained in:
liuchengqian 2023-03-06 15:02:14 +08:00
parent b2cb99885d
commit d171bff036
3 changed files with 30 additions and 25 deletions

View File

@ -24,7 +24,6 @@ public class DispatchFirePointController {
@GetMapping("/debug") @GetMapping("/debug")
public String debug() { public String debug() {
// List<SysUserEntity> sysUserEntityList = sysUserDao.findAll(); // List<SysUserEntity> sysUserEntityList = sysUserDao.findAll();
// for (SysUserEntity sysUserEntity : sysUserEntityList) { // for (SysUserEntity sysUserEntity : sysUserEntityList) {
// String addTime = sysUserEntity.getAddTime(); // String addTime = sysUserEntity.getAddTime();
@ -50,7 +49,6 @@ public class DispatchFirePointController {
return "OKkkkkkkk"; return "OKkkkkkkk";
} }
/** /**
* 普通渠道推送火点到秸秆系统 * 普通渠道推送火点到秸秆系统
*/ */

View File

@ -16,8 +16,6 @@ public class FirePointConvertUtils {
AllFirePointVo allFirePointVo = new AllFirePointVo(); AllFirePointVo allFirePointVo = new AllFirePointVo();
allFirePointVo.setId(entity.getId()); allFirePointVo.setId(entity.getId());
allFirePointVo.setFireCode(entity.getFireCode()); allFirePointVo.setFireCode(entity.getFireCode());
allFirePointVo.setCountyCode(entity.getCountyCode());
allFirePointVo.setCountyName(entity.getCountyName());
allFirePointVo.setSatelliteTime(entity.getSatelliteTime()); allFirePointVo.setSatelliteTime(entity.getSatelliteTime());
allFirePointVo.setLongitude(entity.getLongitude()); allFirePointVo.setLongitude(entity.getLongitude());
allFirePointVo.setLatitude(entity.getLatitude()); allFirePointVo.setLatitude(entity.getLatitude());
@ -26,11 +24,18 @@ public class FirePointConvertUtils {
allFirePointVo.setConfidence(entity.getConfidence()); allFirePointVo.setConfidence(entity.getConfidence());
allFirePointVo.setFireImage(entity.getFireImage()); allFirePointVo.setFireImage(entity.getFireImage());
allFirePointVo.setSatelliteImage(entity.getSatelliteImage()); allFirePointVo.setSatelliteImage(entity.getSatelliteImage());
allFirePointVo.setTownCode(entity.getTownCode());
allFirePointVo.setTownName(entity.getTownName());
allFirePointVo.setAddTime(entity.getAddTime()); allFirePointVo.setAddTime(entity.getAddTime());
allFirePointVo.setFirePointAddress(entity.getFirePointAddress()); allFirePointVo.setFirePointAddress(entity.getFirePointAddress());
allFirePointVo.setRemark(entity.getRemark()); allFirePointVo.setRemark(entity.getRemark());
allFirePointVo.setPlaceHolder(entity.getPlaceHolder());
allFirePointVo.setProCode(entity.getProCode());
allFirePointVo.setProName(entity.getProName());
allFirePointVo.setCityCode(entity.getCityCode());
allFirePointVo.setCityName(entity.getCityName());
allFirePointVo.setCountyCode(entity.getCountyCode());
allFirePointVo.setCountyName(entity.getCountyName());
allFirePointVo.setTownCode(entity.getTownCode());
allFirePointVo.setTownName(entity.getTownName());
return allFirePointVo; return allFirePointVo;
} }
@ -38,8 +43,6 @@ public class FirePointConvertUtils {
AllFirePointVo allFirePointVo = new AllFirePointVo(); AllFirePointVo allFirePointVo = new AllFirePointVo();
allFirePointVo.setId(entity.getId()); allFirePointVo.setId(entity.getId());
allFirePointVo.setFireCode(entity.getFireCode()); allFirePointVo.setFireCode(entity.getFireCode());
allFirePointVo.setCountyCode(entity.getCountyCode());
allFirePointVo.setCountyName(entity.getCountyName());
allFirePointVo.setSatelliteTime(entity.getSatelliteTime()); allFirePointVo.setSatelliteTime(entity.getSatelliteTime());
allFirePointVo.setLongitude(entity.getLongitude()); allFirePointVo.setLongitude(entity.getLongitude());
allFirePointVo.setLatitude(entity.getLatitude()); allFirePointVo.setLatitude(entity.getLatitude());
@ -48,11 +51,18 @@ public class FirePointConvertUtils {
allFirePointVo.setConfidence(entity.getConfidence()); allFirePointVo.setConfidence(entity.getConfidence());
allFirePointVo.setFireImage(entity.getFireImage()); allFirePointVo.setFireImage(entity.getFireImage());
allFirePointVo.setSatelliteImage(entity.getSatelliteImage()); allFirePointVo.setSatelliteImage(entity.getSatelliteImage());
allFirePointVo.setTownCode(entity.getTownCode());
allFirePointVo.setTownName(entity.getTownName());
allFirePointVo.setAddTime(entity.getAddTime()); allFirePointVo.setAddTime(entity.getAddTime());
allFirePointVo.setFirePointAddress(entity.getFirePointAddress()); allFirePointVo.setFirePointAddress(entity.getFirePointAddress());
allFirePointVo.setRemark(entity.getRemark()); allFirePointVo.setRemark(entity.getRemark());
allFirePointVo.setPlaceHolder(entity.getPlaceHolder());
allFirePointVo.setProCode(entity.getProCode());
allFirePointVo.setProName(entity.getProName());
allFirePointVo.setCityCode(entity.getCityCode());
allFirePointVo.setCityName(entity.getCityName());
allFirePointVo.setCountyCode(entity.getCountyCode());
allFirePointVo.setCountyName(entity.getCountyName());
allFirePointVo.setTownCode(entity.getTownCode());
allFirePointVo.setTownName(entity.getTownName());
return allFirePointVo; return allFirePointVo;
} }

View File

@ -24,8 +24,10 @@ import java.util.List;
public class FirePointPushManager { public class FirePointPushManager {
public static Logger log = LoggerFactory.getLogger(FirePointPushManager.class); public static Logger log = LoggerFactory.getLogger(FirePointPushManager.class);
@Resource @Resource
private SysUserDao sysUserDao; private SysUserDao sysUserDao;
@Resource @Resource
private CountyCodeWeiXinDao countyCodeWeiXinDao; private CountyCodeWeiXinDao countyCodeWeiXinDao;
@ -79,14 +81,13 @@ public class FirePointPushManager {
log.info(stringBuilder.toString()); log.info(stringBuilder.toString());
} }
} }
} }
/** /**
* 发送微信消息 * 发送微信消息
*/ */
private void sendWeChatGroupMessage(AllFirePointVo firePointEntity) { private void sendWeChatGroupMessage(AllFirePointVo firePoint) {
List<CountyCodeWeiXinEntity> countyCodeWeiXinList = countyCodeWeiXinDao.findAll(); List<CountyCodeWeiXinEntity> countyCodeWeiXinList = countyCodeWeiXinDao.findAll();
if (countyCodeWeiXinList.isEmpty()) { if (countyCodeWeiXinList.isEmpty()) {
return; return;
@ -96,7 +97,7 @@ public class FirePointPushManager {
try { try {
if ((countyCodeWeiXin.getSendState() != null) && (countyCodeWeiXin.getSendState() != 0)) { if ((countyCodeWeiXin.getSendState() != null) && (countyCodeWeiXin.getSendState() != 0)) {
String formatCutCode = FirePointCodeUtils.getFormatCutCode(countyCodeWeiXin.getCountyCode()); String formatCutCode = FirePointCodeUtils.getFormatCutCode(countyCodeWeiXin.getCountyCode());
if (firePointEntity.getTownCode().startsWith(formatCutCode)) { if (firePoint.getTownCode().startsWith(formatCutCode)) {
weixinIdList.add(countyCodeWeiXin.getWeixinId()); weixinIdList.add(countyCodeWeiXin.getWeixinId());
} }
} }
@ -106,7 +107,14 @@ public class FirePointPushManager {
} }
if (weixinIdList.size() > 0) { if (weixinIdList.size() > 0) {
StringBuilder stringBuilder = new StringBuilder("发送微信消息通知:\n"); StringBuilder stringBuilder = new StringBuilder("发送微信消息通知:\n");
String messageContent = getMessageContent(firePointEntity); java.text.DecimalFormat decimalFormat = new DecimalFormat("#.000000");
String satelliteTime = firePoint.getSatelliteTime();
String formatLongitude = decimalFormat.format(firePoint.getLongitude());
String formatLatitude = decimalFormat.format(firePoint.getLatitude());
String countyName = firePoint.getCountyName();
String streetName = firePoint.getTownName();
String landType = firePoint.getLandType();
String messageContent = firePoint.getSatelliteType() + "发现1个火点。\n卫星时间" + satelliteTime + "\nlongitude" + formatLongitude + "\nlatitude" + formatLatitude + "\ncountyName" + countyName + "\nstreetName" + streetName + "\nlandType" + landType;
for (String weixinId : weixinIdList) { for (String weixinId : weixinIdList) {
stringBuilder.append(weixinId).append("\n"); stringBuilder.append(weixinId).append("\n");
try { try {
@ -120,15 +128,4 @@ public class FirePointPushManager {
} }
} }
private String getMessageContent(AllFirePointVo firePoint) {
java.text.DecimalFormat decimalFormat = new DecimalFormat("#.000000");
String satelliteTime = firePoint.getSatelliteTime();
String formatLongitude = decimalFormat.format(firePoint.getLongitude());
String formatLatitude = decimalFormat.format(firePoint.getLatitude());
String countyName = firePoint.getCountyName();
String streetName = firePoint.getTownName();
String landType = firePoint.getLandType();
return firePoint.getSatelliteType() + "发现1个火点。\n卫星时间" + satelliteTime + "\nlongitude" + formatLongitude + "\nlatitude" + formatLatitude + "\ncountyName" + countyName + "\nstreetName" + streetName + "\nlandType" + landType;
}
} }