已添加2个文件
已删除1个文件
已修改14个文件
已重命名1个文件
| | |
| | | @RequiresPermissions("system:user:update") |
| | | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody CreateSystemUserDTO systemUser) { |
| | | systemUser.setUpdateUser(this.getLoginUser().getId()); |
| | | systemUser.setUsername(systemUser.getMobile()); |
| | | // systemUser.setUsername(systemUser.getMobile()); |
| | | systemUserBiz.updateById(systemUser); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.mqtt.config.MqttClientInit; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.core.wx.WxPayProperties; |
| | | import com.doumee.dao.business.model.Goodsorder; |
| | | import com.doumee.dao.business.model.Sites; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.service.business.*; |
| | | import com.doumee.service.system.SystemDictDataService; |
| | |
| | | /** |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(cron = "0 0 10 * * ? ") |
| | | public void getWxBill() throws Exception { |
| | | //åä¸å¤©çæ¸æ |
| | | Date ydate = DateUtil.addDaysToDate(new Date(), -1); |
| | |
| | | @Scheduled(cron = "0/15 * * * * ? ") |
| | | public void autoRefreshLockStatus() throws Exception { |
| | | log.info("=====================å¼å§å®æ¶å·æ°éªè¡ä¸çæ°å
弿ªå¼é失败======================="); |
| | | memberRidesService.autoRefreshLockStatus(); |
| | | //memberRidesService.autoRefreshLockStatus(); |
| | | log.info("=====================ç»æå®æ¶å·æ°éªè¡ä¸çæ°å
弿ªå¼é失败======================="); |
| | | } |
| | | |
| | |
| | | sitesService.siteReservesNotice();; |
| | | log.info("=====================ç»æ ç«ç¹è½¦è¾æ»¡æ¶çé¢è¦======================="); |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥éä¿¡å¼å¸¸çç«ç¹åéç¥ |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(fixedDelay = 1000L * 60L * 5) |
| | | public void noticeNoLinkList() throws Exception { |
| | | log.info("=====================å¼å§ æ£æ¥éä¿¡å¼å¸¸çç«ç¹åéç¥======================="); |
| | | sitesService.noticeNoLinkList(new Sites());; |
| | | log.info("=====================ç»æ æ£æ¥éä¿¡å¼å¸¸çç«ç¹åéç¥======================="); |
| | | } |
| | | |
| | | @Autowired |
| | | private WxPayProperties wxPayProperties; |
| | |
| | | @Transactional |
| | | public void create(CreateSystemUserDTO systemUser) { |
| | | |
| | | if (StringUtils.isBlank(systemUser.getMobile()) || systemUser.getMobile().length() < 6){ |
| | | if (StringUtils.isBlank(systemUser.getUsername()) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"åå»ºç¨æ·åæ°é误"); |
| | | } |
| | | // éªè¯ç¨æ·å |
| | | SystemUser queryUserDto = new SystemUser(); |
| | | queryUserDto.setUsername(systemUser.getUsername()); |
| | | queryUserDto.setDeleted(Constants.ZERO); |
| | | queryUserDto.setUsername(systemUser.getMobile()); |
| | | // queryUserDto.setUsername(systemUser.getUsername()); |
| | | SystemUser user = systemUserService.findOne(queryUserDto); |
| | | if (user != null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "ææºå·ç å·²åå¨"); |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "ç¨æ·åå·²åå¨"); |
| | | } |
| | | // éªè¯å·¥å· |
| | | if (StringUtils.isNotBlank(systemUser.getEmpNo())) { |
| | |
| | | // çæå¯ç ç |
| | | String salt = RandomStringUtils.randomAlphabetic(6); |
| | | // çæå¯ç |
| | | systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getMobile().substring(systemUser.getMobile().length() - 6), salt)); |
| | | // systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getMobile().substring(systemUser.getMobile().length() - 6), salt)); |
| | | systemUser.setPassword(Utils.Secure.encryptPassword(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.DEFAULT_PWD).getCode(), salt)); |
| | | systemUser.setSalt(salt); |
| | | systemUser.setId(UUID.randomUUID().toString()); |
| | | systemUser.setUsername(systemUser.getMobile()); |
| | | |
| | | // åå»ºç¨æ·è®°å½ |
| | | systemUserService.create(systemUser); |
| | | // 设置é¨é¨ |
| | |
| | | @Override |
| | | public void updateById(CreateSystemUserDTO systemUser) { |
| | | // éªè¯ç¨æ·å |
| | | if (StringUtils.isBlank(systemUser.getUsername()) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"ç¨æ·åä¸è½ä¸ºç©º"); |
| | | } |
| | | SystemUser queryUserDto = new SystemUser(); |
| | | // queryUserDto.setId(systemUser.getId()); |
| | | queryUserDto.setUsername(systemUser.getUsername()); |
| | | queryUserDto.setDeleted(Constants.ZERO); |
| | | SystemUser user = systemUserService.findOne(queryUserDto); |
| | | if (user != null && !user.getId().equals(systemUser.getId())) { |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "ææºå·å·²åå¨"); |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "ç¨æ·åå·²åå¨"); |
| | | } |
| | | |
| | | // éªè¯å·¥å· |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config; |
| | | |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class SpringContextUtil implements ApplicationContextAware { |
| | | |
| | | private static ApplicationContext applicationContext; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| | | this.applicationContext = applicationContext; |
| | | } |
| | | |
| | | public static ApplicationContext getApplicationContext() { |
| | | return applicationContext; |
| | | } |
| | | |
| | | public static Object getBean(String name) { |
| | | return getApplicationContext().getBean(name); |
| | | } |
| | | |
| | | public static <T> T getBean(Class<T> clazz) { |
| | | return getApplicationContext().getBean(clazz); |
| | | } |
| | | |
| | | public static <T> T getBean(String name, Class<T> clazz) { |
| | | return getApplicationContext().getBean(name, clazz); |
| | | } |
| | | } |
| | |
| | | public static String REDIS_DEBUG_STR="test_"; |
| | | public static final String AD = "AD"; |
| | | public static String REPAIR = "REPAIR"; |
| | | public static final String NOTICE_SITE_LINK_LIMIT="NOTICE_SITE_LINK_LIMIT"; |
| | | |
| | | public interface MqttTopic{ |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.business.model.BikeRepair; |
| | | import com.doumee.dao.business.model.Sites; |
| | | import com.doumee.dao.business.web.request.RepairRequest; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | content.put("text",text); |
| | | HttpsUtil.post(ddUrl+"×tamp="+timestamp+"&sign="+getSign(timestamp,secret), JSONObject.toJSONString(content),"application/json",false); |
| | | } |
| | | /** |
| | | * éééç¥ - ç«ç¹éä¿¡å¼å¸¸ä¸æ¥ |
| | | * @param ddUrl |
| | | * @throws Exception |
| | | */ |
| | | public static void siteNoLink(List<Sites> siteList, String ddUrl , String secret) throws Exception{ |
| | | Long timestamp = System.currentTimeMillis(); |
| | | Map<String,Object> content = new HashMap<>(); |
| | | content.put("msgtype","text"); |
| | | Map<String,String> text = new HashMap<>(); |
| | | String desc = ""; |
| | | if(siteList.size() == 1){ |
| | | desc = "ãç«ç¹å¼å¸¸ä¸æ¥ãç«ç¹ã"+siteList.get(0).getId()+"ãï¼èªã"+ DateUtil.getPlusTime2(siteList.get(0).getLastLinkDate())+"ãåæªæ¶å°é讯请æ±,è¯·åæ¶æ¥çå¤ç\n"; |
| | | }else{ |
| | | desc = "ãç«ç¹å¼å¸¸ä¸æ¥ã 以ä¸ç«ç¹é讯åçå¼å¸¸ï¼è¯·åæ¶æ¥çå¤çï¼\n"; |
| | | for (Sites site : siteList){ |
| | | desc += "ç«ç¹ã"+site.getId()+"ãï¼èªã"+ DateUtil.getPlusTime2(site.getLastLinkDate())+"ãåæªæ¶å°é讯请æ±\n"; |
| | | } |
| | | } |
| | | |
| | | text.put("content",desc); |
| | | content.put("text",text); |
| | | HttpsUtil.post(ddUrl+"×tamp="+timestamp+"&sign="+getSign(timestamp,secret), JSONObject.toJSONString(content),"application/json",false); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | package com.doumee.core.mqtt.config; |
| | | |
| | | import com.doumee.config.SpringContextUtil; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.mqtt.service.MqttPushCallback; |
| | | import com.doumee.core.mqtt.service.MqttSubService; |
| | | import com.doumee.core.mqtt.service.MqttToolService; |
| | | import org.eclipse.paho.client.mqttv3.MqttClient; |
| | | import org.eclipse.paho.client.mqttv3.MqttConnectOptions; |
| | | import org.eclipse.paho.client.mqttv3.MqttException; |
| | | import org.eclipse.paho.client.mqttv3.MqttTopic; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | public class MqttClientInit { |
| | | static MqttClient client; |
| | | static MqttClient subClient; |
| | | |
| | | public static boolean isNeedReSub =false ; |
| | | public static synchronized MqttClient getInstance(MqttConfig config ){ |
| | | if(client !=null){ |
| | | if(!client.isConnected()){ |
| | | try { |
| | | client.reconnect(); |
| | | } catch (MqttException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | return client; |
| | | } |
| | | |
| | | try { |
| | | // host为主æºåï¼clientidå³è¿æ¥MQTTç客æ·ç«¯IDï¼ä¸è¬ä»¥å¯ä¸æ è¯ç¬¦è¡¨ç¤ºï¼MemoryPersistence设置clientidçä¿åå½¢å¼ï¼é»è®¤ä¸ºä»¥å
åä¿å |
| | | String clientId =config.getClientid() +config.getVersion(); |
| | |
| | | } |
| | | public static synchronized MqttClient getSubInstance(MqttConfig config,MqttPushCallback callBack){ |
| | | if(subClient !=null){ |
| | | refreshClient(); |
| | | return subClient; |
| | | } |
| | | try { |
| | |
| | | } |
| | | |
| | | |
| | | public static synchronized void isSubClientValid() { |
| | | if(isNeedReSub){ |
| | | MqttSubService service = SpringContextUtil.getBean(MqttSubService.class); |
| | | if(service!=null){ |
| | | service.startSubcribe(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static synchronized void refreshClient() throws MqttException { |
| | | if(client !=null){ |
| | | boolean result = client.isConnected(); |
| | | client.reconnect(); |
| | | public static synchronized void refreshClient() { |
| | | try { |
| | | if(subClient !=null && !subClient.isConnected()){ |
| | | subClient.reconnect(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.doumee.core.mqtt.service; |
| | | |
| | | import com.doumee.config.SpringContextUtil; |
| | | import com.doumee.core.mqtt.config.MqttClientInit; |
| | | import com.doumee.core.mqtt.config.MqttConfig; |
| | | import com.doumee.service.business.DeviceService; |
| | |
| | | @Autowired |
| | | private MqttConfig mqttConfig; |
| | | //æ¥æ¶æ¶æ¯åè° |
| | | @Override |
| | | |
| | | @Override |
| | | public void connectionLost(Throwable cause) { |
| | | // è¿æ¥ä¸¢å¤±åï¼ä¸è¬å¨è¿éé¢è¿è¡éè¿ |
| | | System.out.println("è¿æ¥æå¼ï¼éè¿ä¸"); |
| | | try { |
| | | MqttClientInit.refreshClient(); |
| | | } catch (MqttException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | MqttClientInit.isNeedReSub =true; |
| | | MqttClientInit.refreshClient(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | }*/ |
| | | } |
| | | MqttClientInit.getSubInstance(config,callBack).subscribe(topics, Qos); |
| | | MqttClientInit.isNeedReSub = false; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç¶æ 0å¨çº¿ 1离线 ", example = "1") |
| | | @ExcelColumn(name="ç¶æ 0å¨çº¿ 1离线") |
| | | private Integer online; |
| | | @ApiModelProperty(value = "æ¯å¦å¼å¸¸ä¸æ¥ 0æ¯ 1å¦ ", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å¼å¸¸ä¸æ¥ 0æ¯ 1å¦") |
| | | private Integer needNotice; |
| | | |
| | | @ApiModelProperty(value = "é头æ°é", example = "1") |
| | | @ExcelColumn(name="é头æ°é") |
| | |
| | | * @return List<Sites> |
| | | */ |
| | | List<Sites> findList(Sites sites); |
| | | |
| | | void noticeNoLinkList(Sites sites); |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<Sites> |
| | | */ |
| | | |
| | | PageData<Sites> findPage(PageWrap<Sites> pageWrap); |
| | | |
| | | /** |
| | |
| | | //车è¾è®°å½ |
| | | Bikes bikes = dealBikesByParam(model); |
| | | //ç¶æï¼0éå, 1æå¼ï¼2è¿è¡ä¸, 3å¼å¸¸ |
| | | if(locks.getStatus() == Constants.LockStatus.open){ |
| | | if(Constants.formatIntegerNum(locks.getStatus()) == Constants.LockStatus.open){ |
| | | //妿æ¯å¼éä¸å¡ï¼å¤ææ¯å¦æå¼éä¸çä¿¡æ¯ |
| | | MemberRides memberRides = new MemberRides(); |
| | | memberRides.setStatus(Constants.MEMBER_RIDES_STATUS.LOCKING.getKey()); |
| | |
| | | update.setId(memberRides.getId()); |
| | | //ï¼æ´æ°è¯·æ±å¼éä¸çé头å
³èçéªè¡è®°å½ï¼ |
| | | memberRidesMapper.updateById( update); |
| | | }else if(locks.getStatus() == Constants.LockStatus.closed ){ |
| | | }else if(Constants.formatIntegerNum(locks.getStatus()) == Constants.LockStatus.closed ){ |
| | | //妿æ¯å
³éä¸å¡ï¼å¤æè§¦åè¿è½¦ |
| | | if(StringUtils.isNotBlank(locks.getBikeCode())){ |
| | | MemberRides mbikes = new MemberRides(); |
| | |
| | | update.setName(sites.getName()); |
| | | update.setLockNum(sites.getLockNum()); |
| | | update.setIp(sites.getIp()); |
| | | update.setNeedNotice(sites.getNeedNotice()); |
| | | sitesMapper.updateById(update); |
| | | } |
| | | |
| | |
| | | public List<Sites> findList(Sites sites) { |
| | | QueryWrapper<Sites> wrapper = new QueryWrapper<>(sites); |
| | | return sitesMapper.selectList(wrapper); |
| | | } |
| | | @Override |
| | | public void noticeNoLinkList(Sites sites) { |
| | | //åééééç¥ |
| | | int second =0; |
| | | try { |
| | | second = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.NOTICE_SITE_LINK_LIMIT).getCode()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | if(second <=0){ |
| | | return ; |
| | | } |
| | | sites.setIsdeleted(Constants.ZERO); |
| | | sites.setStatus(Constants.ZERO); |
| | | QueryWrapper<Sites> wrapper = new QueryWrapper<>(sites); |
| | | wrapper.lambda().orderByDesc(Sites::getLastLinkDate); |
| | | List<Sites> siteList =sitesMapper.selectList(wrapper); |
| | | List<Sites> errorList = new ArrayList<>(); |
| | | for(Sites site : siteList){ |
| | | //æ¶é´æ¥è¿éä¿¡å¼å¸¸éå¼ |
| | | if(Constants.formatIntegerNum(site.getNeedNotice()) == Constants.ZERO |
| | | && System.currentTimeMillis()-site.getLastLinkDate().getTime() > second*1000){ |
| | | errorList.add(site); |
| | | } |
| | | } |
| | | if(errorList.size()>0){ |
| | | try { |
| | | DingDingNotice.siteNoLink(errorList, |
| | | systemDictDataBiz.queryByCode(Constants.DINGDING,Constants.DINGDING_URL).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.DINGDING,Constants.DINGDING_SECRET).getCode()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (pageWrap.getModel().getClientVersion() != null) { |
| | | queryWrapper.lambda().eq(Sites::getClientVersion, pageWrap.getModel().getClientVersion()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | /*for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | }*/ |
| | | queryWrapper.lambda().orderByAsc(Sites::getCode); |
| | | return PageData.from(sitesMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | |
| | | detail.setRefundSuccessDate(DateUtil.getDateFromString2(info.getRefundSuccessTime()));//æå鿬¾æ¶é´ |
| | | detail.setRefundApplyDate(DateUtil.getDateFromString2(info.getRefundTime())); //ç³è¯·é款æ¶é´ |
| | | //计ç®èªè¡è½¦æ¶å
¥ï¼å¹é
æ¥èªèªè¡è½¦å°ç¨åºçæææ¯ä»æåå鿬¾æåçéé¢ï¼ä½ä¸ºèªè¡è½¦æ¶å
¥ï¼ç´¯è®¡æ¶æ¬¾éé¢-ç´¯è®¡éæ¬¾æåéé¢ï¼ |
| | | if(StringUtils.equals(detail.getAppid(), WxMiniConfig.wxPayV2Service.getConfig().getAppId())){ |
| | | if(StringUtils.equals(detail.getAppid(), WxMiniConfig.wxPayV2Service.getConfig().getSubAppId())){ |
| | | //èªè¡è½¦æ¶å
¥ç´¯è®¡æ¶æ¬¾éé¢(æ¯ä»æåæ»éé¢-鿬¾æ»éé¢ï¼ |
| | | if(StringUtils.equals(info.getTradeState(),"SUCCESS")){ |
| | | //妿æ¯äº¤æ |
| | |
| | | bill.setBikeFee(bill.getBikeFee().subtract(detail.getCmmsAmt()) ); |
| | | } |
| | | } |
| | | |
| | | detailList.add(detail); |
| | | } |
| | | } |
| | |
| | | password: doumee@168 |
| | | version: 003 |
| | | |
| | | ########################mqttç¸å
³é
ç½®######################## |
| | | #mqtt: |
| | | # host: tcp://39.100.125.239:1883 |
| | | # username: parkbike |
| | | # password: parkbike@168 |
| | | # version: 003 |
| | | |
| | | tencent: |
| | | map: |
| | | remoteHost: https://apis.map.qq.com |
ÎļþÃû´Ó server/platform/src/main/java/com/doumee/service/impl/MqttSubServiceImpl.java ÐÞ¸Ä |
| | |
| | | package com.doumee.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.mqtt.config.MqttConfig; |
| | | import com.doumee.core.mqtt.service.MqttSubService; |
| | | import com.doumee.core.mqtt.service.MqttToolService; |
| | | import com.doumee.dao.business.MqttLogMapper; |
| | | import com.doumee.dao.business.model.Locks; |
| | | import com.doumee.dao.business.model.MqttLog; |
| | | import com.doumee.service.MqttSubService; |
| | | import com.doumee.service.business.DeviceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ä¸ç¡¬ä»¶å¯¹æ¥æå¡ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.task; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.mqtt.config.MqttClientInit; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.core.wx.WxPayProperties; |
| | | import com.doumee.dao.business.model.Sites; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.service.business.*; |
| | | import com.doumee.service.system.SystemDictDataService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.util.ThreadContext; |
| | | import org.apache.shiro.web.mgt.DefaultWebSecurityManager; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 宿¶ä»»å¡ |
| | | * @author jiangping |
| | | * @date 2021-10-10 14:40:35 |
| | | * https://www.bejson.com/othertools/cron/ cron 表达å¼çæå°å |
| | | */ |
| | | @Component |
| | | @EnableScheduling |
| | | @Slf4j |
| | | public class ScheduleTool { |
| | | |
| | | /** |
| | | * ç«ç¹è½¦è¾æ»¡æ¶çé¢è¦ |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(fixedDelay = 1000L *20L ) |
| | | public void reSubMqtt() throws Exception { |
| | | log.info("=====================æ£æ¥æ¯å¦éè¦éæ°è®¢é
===========start============"); |
| | | MqttClientInit.isSubClientValid(); |
| | | log.info("=====================æ£æ¥æ¯å¦éè¦éæ°è®¢é
===========end============"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |