111
k94314517
2025-02-28 04dba6a17f836b5fbdf0eedff8a129c6785fd8a2
111
已修改7个文件
已重命名5个文件
76 ■■■■■ 文件已修改
server/jtt808_parent/jtt808-protocol/src/main/java/org/yzh/protocol/commons/transform/attribute/Battery.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/core/utils/PositionUtil.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/service/business/impl/MemberRidesServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/resources/application-dev.yml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/jtt808/web/controller/JT808Controller.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/jtt808/web/service/Jtt808Service.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/jtt808/web/t808/T0200.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/jtt808/web/t808/T0201_0500.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/jtt808/web/t808/T0A00_8A00.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/jtt808/web/t808/T8103.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/jtt808/web/t808/T8900.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;