server/jtt808_parent/jtt808-protocol/src/main/java/org/yzh/protocol/commons/transform/attribute/Battery.java
@@ -66,14 +66,14 @@ } if(value!=null && value.length>4){ try { this.setVoltage((float) (Byte2NumberUtils.bytesToInteger(new byte[]{value[2],value[3]}) * 0.001)); this.setVoltage((float) (Byte2NumberUtils.bytesToInteger(new byte[]{value[2],value[3]}) * 0.01)); }catch (Exception e){ } } if(value!=null && value.length>6){ try { this.setChargeVoltage((float) (Byte2NumberUtils.bytesToInteger(new byte[]{value[4],value[4]}) * 0.001)); this.setChargeVoltage((float) (Byte2NumberUtils.bytesToInteger(new byte[]{value[4],value[4]}) * 0.01)); }catch (Exception e){ } server/services/src/main/java/com/doumee/core/utils/PositionUtil.java
@@ -150,19 +150,16 @@ } } public static void main(String[] args) { String str ="[{\"lat\": 31.71383446224521, \"lng\": 117.39342857107226, \"height\": 0}, " + "{\"lat\": 31.71393087373135, \"lng\": 117.39402357524818, \"height\": 0}, " + "{\"lat\": 31.713593433089077, \"lng\": 117.39433170240886, \"height\": 0}," + " {\"lat\": 31.713280450806966, \"lng\": 117.39358710879355, \"height\": 0}]"; String str ="[{\"lat\":31.732726766273103,\"lng\":117.37721605116087,\"height\":0},{\"lat\":31.72079687406289,\"lng\":117.39831914258241,\"height\":0},{\"lat\":31.714484720597493,\"lng\":117.39831914258241,\"height\":0},{\"lat\":31.71233192243245,\"lng\":117.39583137996954,\"height\":0},{\"lat\":31.71401037878662,\"lng\":117.3785457182995,\"height\":0}]"; TypeReference typeReference = new TypeReference<List<LocaltionDTO>>(){}; List<LocaltionDTO> array = JSONObject.parseObject(str, typeReference.getType()); if(array == null || array.size() ==0){ System.out.println("================="); } System.out.println(isInPolygon( 117.393962,31.713690,array)); AMap aMap = transform( 117.38823300, 31.71550000); System.out.println(aMap.getLatitude()+""+aMap.getLongitude()); System.out.println(isInPolygon( aMap.getLongitude(),aMap.getLatitude(),array)); System.out.println(isInPolygon( 117.39387876,31.71365546,array)); // AMap aMap = transform( 117.38823300, 31.71550000); // System.out.println(aMap.getLatitude()+""+aMap.getLongitude()); // System.out.println(isInPolygon( aMap.getLongitude(),aMap.getLatitude(),array)); } /* "latitude": 31.71553300, "longitude": 117.39, server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
@@ -468,11 +468,11 @@ @Override public Integer getVoltageStatus(Bikes bikes){ //ä½çµéçµå BigDecimal lowVoltage = new BigDecimal(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME, Constants.LOW_VOLTAGE).getCode()); BigDecimal lowVoltage = new BigDecimal(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME, Constants.LOW_BIKE_VOLTAGE).getCode()); if(Objects.isNull(bikes)||Objects.isNull(bikes.getVoltage())||Objects.isNull(lowVoltage)){ return 0; } return bikes.getVoltage().compareTo(lowVoltage)>0?0:1; return bikes.getVoltage().compareTo(lowVoltage)>=0?0:1; } server/services/src/main/java/com/doumee/service/business/impl/MemberRidesServiceImpl.java
@@ -793,6 +793,9 @@ if(Objects.isNull(bike)){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"è¯·æ«ææ£ç¡®ç车è¾ç ï¼ãæªæ¥è¯¢å°è½¦è¾ä¿¡æ¯ã"); } if(!Constants.equalsInteger(bike.getStatus(),Constants.ZERO)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼è¯¥è½¦è¾å·²è¢«éå®åç¨ï¼è¯·å°è¯æ´æ¢å ¶ä»è½¦è¾ï¼"); } if(StringUtils.isBlank(bike.getParamId())){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"车è¾ç±»åå¼å¸¸ï¼è¯·è系管çåï¼"); } server/services/src/main/resources/application-dev.yml
@@ -57,6 +57,9 @@ keyPath: /usr/local/aliConfig/bike/apiclient_cert.p12 privateCertPath: /usr/local/aliConfig/bike/apiclient_cert.pem privateKeyPath: /usr/local/aliConfig/bike/apiclient_key.pem # keyPath: d://apiclient_cert.p12 # privateCertPath: d://apiclient_cert.pem # privateKeyPath: d://apiclient_key.pem #æå¡å-------------end--- existsSub: 1 appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24 server/web/src/main/java/com/doumee/jtt808/web/controller/JT808Controller.java
@@ -24,7 +24,7 @@ @Operation(summary = "8103 设置ç»ç«¯åæ°") @PostMapping("8103") public Mono<APIResult<T0001>> T8103(@RequestBody com.doumee.jtt808.t808.T8103 request) { public Mono<APIResult<T0001>> T8103(@RequestBody com.doumee.jtt808.web.t808.T8103 request) { return messageManager.requestR(request.build(), T0001.class); } @@ -234,13 +234,13 @@ @Operation(summary = "8900 æ°æ®ä¸è¡éä¼ ") @PostMapping("8900") public Mono<APIResult<T0001>> T8900(@RequestBody com.doumee.jtt808.t808.T8900 request) { public Mono<APIResult<T0001>> T8900(@RequestBody com.doumee.jtt808.web.t808.T8900 request) { return messageManager.requestR(request.build(), T0001.class); } @Operation(summary = "8A00 å¹³å°RSAå ¬é¥") @PostMapping("8A00") public Mono<APIResult<T0A00_8A00>> T8A00(@RequestBody com.doumee.jtt808.t808.T0A00_8A00 request) { public Mono<APIResult<T0A00_8A00>> T8A00(@RequestBody com.doumee.jtt808.web.t808.T0A00_8A00 request) { return messageManager.requestR(request.build(), T0A00_8A00.class); } } server/web/src/main/java/com/doumee/jtt808/web/service/Jtt808Service.java
@@ -151,7 +151,7 @@ if(bike.getSiteId() ==null){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对ä¸èµ·ï¼è¯·æè¦æ±åå¾å车ç¹å车ï¼"); } lockBikes(bike.getDeviceSn(),Constants.ZERO);//åèµ·å ³éæä»¤è¯·æ± lockBikes(bike.getDeviceSn(),Constants.ONE);//åèµ·å ³éæä»¤è¯·æ± backIds.add(rides.getId()); rides.setStatus(Constants.MEMBER_RIDES_STATUS.BACK_CYCLING.getKey());//å·²è¿è½¦ rides.setBackSiteId(bike.getSiteId());//è¿è½¦ç«ç¹ @@ -171,6 +171,10 @@ goodsorder.setEditDate(date); goodsorder.setEditor(null); goodsorderService.dealCloseGoodsorderBiz( goodsorder,Constants.REFUND_TYPE.NORMAL.getKey(),memberRides); //æ´æ°çµå¨è½¦è½¦è¾ç¶æ bikesMapper.update(null,new UpdateWrapper<Bikes>().lambda().set(Bikes::getStatus,Constants.ZERO).eq(Bikes::getType,Constants.ONE) .apply(" code in ( select m.bike_code from member_rides m where m.ordre_id = '"+goodsorder.getId()+"' ) ") ); } private Bikes getElecBikeByCode(String bikeCode) { @@ -216,6 +220,9 @@ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼"+(type ==0?"车è¾å ³é":"车è¾å¼é")+"失败ï¼è¯·ç¨åéè¯ï¼æè èç³»ååºç®¡ç人åï¼"); } } /** * æ¥è¯¢å车ç«ç¹ä¿¡æ¯ @@ -279,6 +286,7 @@ Bikes bike = getElecBikeByCode(memberRides.getBikeCode()); //æ¥è¯¢å车ä½ç½®æ¯å¦ç¬¦åå车ä½ç½®è§è checkPausePostionBiz(bike); lockBikes(bike.getDeviceSn(),Constants.ONE);//åèµ·å ³éæä»¤è¯·æ± memberRides.setPauseDate(new Date()); memberRides.setEditDate(memberRides.getBackDate()); memberRides.setStatus(Constants.MEMBER_RIDES_STATUS.RIDES_PAUSING.getKey()); @@ -292,7 +300,7 @@ ruleType =Integer.parseInt( systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.PAUSE_BIKE_TYPE).getCode()); }catch (Exception e){ } if(ruleType == 0){ if(ruleType == 1){ //å¦æä» éäºååºä¸´æ¶å车 List<LocaltionDTO> array = new ArrayList<>(); try { @@ -303,7 +311,7 @@ if(array == null || array.size() ==0){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对ä¸èµ·ï¼ååºè¿è¥åºåé ç½®æè¯¯ï¼è¯·èç³»ååºç®¡çåå¤çï¼"); } if( !PositionUtil.isInPolygon(bike.getLatitude().doubleValue(),bike.getLongitude().doubleValue(),array)){ if( !PositionUtil.isInPolygon(bike.getLongitude().doubleValue(),bike.getLatitude().doubleValue(),array)){ //妿å¨å车ç¹èå´å ï¼ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对ä¸èµ·ï¼è¯·æè¦æ±å¨ååºè¿è¥åºåèå´å å车ï¼"); } @@ -403,6 +411,9 @@ //å¦æè½¦è¾ç±»åæ¯ç©º throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), " è¯¥è½¦åææ¶ä¸è½å车æä½å¦ï¼è¯·æ´æ¢å ¶ä»è½¦åéè¯ï¼"); } if(!Constants.equalsInteger(bike.getStatus(),Constants.ZERO)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼è¯¥è½¦è¾å·²è¢«éå®åç¨ï¼è¯·å°è¯æ´æ¢å ¶ä»è½¦è¾ï¼"); } cacheOpenLock.put(openElecBikeRequest.getCode(), 1); try { //夿å½åæ¯å¦å·²æ¯ä»æ¼é @@ -434,7 +445,7 @@ //æ ¹æ®è½¦åæ¥è¯¢è®¡ä»·æ¹æ¡ isValidePricingType(bike,memberRides) ; MemberRidesDetailResponse memberRidesDetailResponse = new MemberRidesDetailResponse(); this.lockBikes(bike.getDeviceSn(),1); this.lockBikes(bike.getDeviceSn(),0); //åå¨éªè¡è®°å½ memberRides.setId(Constants.getUUID()); memberRides.setIsdeleted(Constants.ZERO); @@ -492,7 +503,7 @@ //å¦æè½¦è¾ç±»åæ¯ç©º throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "车åä¿¡æ¯å¼å¸¸ï¼è¯·è系管çå"); } this.lockBikes(bike.getDeviceSn(),1); this.lockBikes(bike.getDeviceSn(),0); //æ´æ°éªè¡ç¶æä¸ºéªè¡ä¸ memberRides.setEditDate(memberRides.getBackDate()); memberRides.setStatus(Constants.MEMBER_RIDES_STATUS.RIDES_RUNNING.getKey()); @@ -587,7 +598,7 @@ .eq(Bikes::getIsdeleted,Constants.ZERO) .eq(Bikes::getCode,rides.getBikeCode()) ); lockBikes(bike.getDeviceSn(),Constants.ZERO);//åèµ·å ³éæä»¤è¯·æ± lockBikes(bike.getDeviceSn(),Constants.ONE);//åèµ·å ³éæä»¤è¯·æ± rides.setStatus(Constants.MEMBER_RIDES_STATUS.BACK_CYCLING.getKey());//å·²è¿è½¦ rides.setBackSiteId(bike.getSiteId());//è¿è½¦ç«ç¹ rides.setBackDate(new Date()); @@ -605,6 +616,12 @@ goodsorder.setEditDate(date); goodsorder.setEditor(null); goodsorderService.dealCloseGoodsorderBiz( goodsorder,Constants.REFUND_TYPE.NORMAL.getKey(),memberRides); //æ´æ°çµå¨è½¦è½¦è¾ç¶æ bikesMapper.update(null,new UpdateWrapper<Bikes>().lambda().set(Bikes::getStatus,Constants.ZERO).eq(Bikes::getType,Constants.ONE) .apply(" code in ( select m.bike_code from member_rides m where m.ordre_id = '"+goodsorder.getId()+"' ) ") ); //åéå°ç¨åºéç¥ Member member = memberMapper.selectById(goodsorder.getMemberId()); if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getOpenid())){ @@ -617,5 +634,9 @@ // public void test(double lat,double lng){ // this.getBackSiteByPostion(lat,lng); // } } server/web/src/main/java/com/doumee/jtt808/web/t808/T0200.java
ÎļþÃû´Ó server/web/src/main/java/com/doumee/jtt808/t808/T0200.java ÐÞ¸Ä @@ -1,4 +1,4 @@ package com.doumee.jtt808.t808; package com.doumee.jtt808.web.t808; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.github.yezhihao.protostar.annotation.Field; server/web/src/main/java/com/doumee/jtt808/web/t808/T0201_0500.java
ÎļþÃû´Ó server/web/src/main/java/com/doumee/jtt808/t808/T0201_0500.java ÐÞ¸Ä @@ -1,4 +1,4 @@ package com.doumee.jtt808.t808; package com.doumee.jtt808.web.t808; import io.github.yezhihao.netmc.core.model.Response; import io.github.yezhihao.protostar.annotation.Field; server/web/src/main/java/com/doumee/jtt808/web/t808/T0A00_8A00.java
ÎļþÃû´Ó server/web/src/main/java/com/doumee/jtt808/t808/T0A00_8A00.java ÐÞ¸Ä @@ -1,4 +1,4 @@ package com.doumee.jtt808.t808; package com.doumee.jtt808.web.t808; import io.github.yezhihao.protostar.annotation.Field; import io.github.yezhihao.protostar.annotation.Message; server/web/src/main/java/com/doumee/jtt808/web/t808/T8103.java
ÎļþÃû´Ó server/web/src/main/java/com/doumee/jtt808/t808/T8103.java ÐÞ¸Ä @@ -1,4 +1,4 @@ package com.doumee.jtt808.t808; package com.doumee.jtt808.web.t808; import io.github.yezhihao.netmc.util.AdapterMap; import io.github.yezhihao.protostar.annotation.Field; server/web/src/main/java/com/doumee/jtt808/web/t808/T8900.java
ÎļþÃû´Ó server/web/src/main/java/com/doumee/jtt808/t808/T8900.java ÐÞ¸Ä @@ -1,4 +1,4 @@ package com.doumee.jtt808.t808; package com.doumee.jtt808.web.t808; import io.github.yezhihao.protostar.annotation.Field; import io.github.yezhihao.protostar.annotation.Message;