| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.dingding.DingDingNotice; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.PositionUtil; |
| | | import com.doumee.core.utils.StringTools; |
| | | import com.doumee.core.wx.WxMiniUtilService; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.join.BikesJoinMapper; |
| | | import com.doumee.dao.business.join.GoodsorderJoinMapper; |
| | | import com.doumee.dao.business.join.MemberRidesJoinMapper; |
| | | import com.doumee.dao.business.join.RefundJoinMapper; |
| | |
| | | |
| | | @Service |
| | | public class Jtt808Service { |
| | | @Value("${tencent.map.remoteHost:}") |
| | | @Value("${tencent.map.remoteHost}") |
| | | private String mapHost; |
| | | @Value("${tencent.map.appKey:}") |
| | | @Value("${tencent.map.appKey}") |
| | | private String mapKey; |
| | | @Autowired |
| | | private MessageManager messageManager; |
| | |
| | | private GoodsorderService goodsorderService; |
| | | @Autowired |
| | | private BikesMapper bikesMapper; |
| | | @Autowired |
| | | private BikesJoinMapper bikesJoinMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | |
| | | } |
| | | } |
| | | |
| | | public void updateBikesInfo(List<T0200> list) { |
| | | public void updateBikesInfo(List<T0200> list) throws Exception{ |
| | | Date date = new Date(); |
| | | BigDecimal lowVoltage = new BigDecimal(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.LOW_VOLTAGE).getCode()); |
| | | String ddToken = systemDictDataBiz.queryByCode(Constants.DINGDING,Constants.DINGDING_TOKEN).getCode(); |
| | | String ddRobotCode = systemDictDataBiz.queryByCode(Constants.DINGDING,Constants.DINGDING_ROBOTCODE).getCode(); |
| | | String ddChatToken = systemDictDataBiz.queryByCode(Constants.DINGDING,Constants.DINGDING_CHATTOKEN).getCode(); |
| | | for(T0200 m : list){ |
| | | Bikes bike = new Bikes(); |
| | | bike.setDeviceSn(m.getClientId()); |
| | |
| | | .set(Bikes::getSiteId,site ==null?null:site.getId()) |
| | | .set( Bikes::getHeartDate,date) |
| | | .eq(Bikes::getId,bikes.getId())); |
| | | |
| | | if(bikes.getVoltage().compareTo(lowVoltage)>=Constants.ZERO |
| | | && bike.getVoltage().compareTo(lowVoltage)<Constants.ZERO){ |
| | | //发送钉钉通知 |
| | | DingDingNotice.lowVoltageNotice(bikes.getCode(), |
| | | PositionUtil.getTxMapAddrByLatAndLng(Double.valueOf(bike.getLatitude().toString()),Double.valueOf(bike.getLongitude().toString()),mapHost,mapKey) |
| | | ,Objects.nonNull(site)?site.getName():null, |
| | | ddToken, |
| | | ddRobotCode, |
| | | ddChatToken); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | .eq(Goodsorder::getStatus,Constants.ONE) |
| | | .eq(MemberRides::getIsdeleted,Constants.ZERO) |
| | | .eq(MemberRides::getType,Constants.ONE) |
| | | .eq(MemberRides::getStatus,Constants.MEMBER_RIDES_STATUS.RIDES_PAUSING) |
| | | .eq(MemberRides::getStatus,Constants.MEMBER_RIDES_STATUS.RIDES_PAUSING.getKey()) |
| | | .apply(" NOW() >= t.create_date + INTERVAL '2 hours' ") |
| | | ); |
| | | |
| | |
| | | goodsorder.setEditor(null); |
| | | goodsorderService.dealCloseGoodsorderBiz( goodsorder,Constants.REFUND_TYPE.NORMAL.getKey(),memberRides); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |