puzhibing
2024-10-17 201ec7bf9f2b7dec65db6ed02ef6f67cb1dd5851
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
10个文件已修改
59 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/vo/SwitchwayGateReq.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/vo/ChargingOrderListVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TVehicleRampController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/controller/CouponController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/controller/ParkingOrderController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/CouponService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/SwitchwayGateService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/vo/SwitchwayGateReq.java
@@ -16,4 +16,12 @@
     * 通道编号
     */
    private String channel;
    /**
     * appkey
     */
    private String appkey;
    /**
     * secretkey
     */
    private String secretkey;
}
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/vo/ChargingOrderListVO.java
@@ -42,6 +42,8 @@
    private String phone;
    @ApiModelProperty(value = "充电到账金额")
    private BigDecimal paymentAmount;
    @ApiModelProperty(value = "充电后剩余金额")
    private BigDecimal residualAmount;
    @ApiModelProperty(value = "累计电费")
    private BigDecimal electrovalence;
    @ApiModelProperty(value = "累计服务费")
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TVehicleRampController.java
@@ -1,7 +1,9 @@
package com.ruoyi.chargingPile.controller;
import com.ruoyi.chargingPile.api.model.TParkingLot;
import com.ruoyi.chargingPile.api.model.TVehicleRamp;
import com.ruoyi.chargingPile.service.TParkingLotService;
import com.ruoyi.chargingPile.service.TVehicleRampService;
import com.ruoyi.common.core.utils.CodeGenerateUtils;
import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -37,6 +39,9 @@
    
    @Resource
    private SwitchwayGateClient switchwayGateClient;
    @Resource
    private TParkingLotService parkingLotService;
    
    
    
@@ -105,9 +110,13 @@
    @ApiOperation(tags = {"后台-车道"},value = "开关闸车道")
    @PostMapping(value = "/openOrDown")
    public AjaxResult<String> openOrDown(@RequestBody TVehicleRamp dto) {
        TVehicleRamp vehicleRamp = vehicleRampService.getById(dto.getId());
        TParkingLot parkingLot = parkingLotService.getById(vehicleRamp.getParkingLotId());
        SwitchwayGateReq req = new SwitchwayGateReq();
        req.setAction(dto.getAction());
        req.setChannel(dto.getCarportNum());
        req.setAction(vehicleRamp.getAction());
        req.setChannel(vehicleRamp.getCarportNum());
        req.setAppkey(parkingLot.getAppKey());
        req.setSecretkey(parkingLot.getSecretKey());
        Boolean data = switchwayGateClient.gateService(req).getData();
        return data ? AjaxResult.success() : AjaxResult.error("操作失败");
    }
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/controller/CouponController.java
@@ -34,7 +34,7 @@
    @ResponseBody
    @PostMapping("/getCoupon")
    public BaseResponse<GetCouponResp> getCoupon(@RequestBody GetCouponReq req){
        log.info("停车获取优惠券请求参数:{}" + JSON.toJSONString(req));
        log.warn("停车获取优惠券请求参数:{}" + JSON.toJSONString(req));
        GetCouponResp coupon = couponService.getCoupon(req);
        return BaseResponse.ok(coupon);
    }
@@ -48,7 +48,7 @@
    @ResponseBody
    @PostMapping("/usedCoupon")
    public BaseResponse usedCoupon(@RequestBody UsedCoupon req){
        log.info("停车使用优惠券请求参数:{}" + JSON.toJSONString(req));
        log.warn("停车使用优惠券请求参数:{}" + JSON.toJSONString(req));
        couponService.usedCoupon(req);
        return BaseResponse.ok();
    }
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/controller/ParkingOrderController.java
@@ -28,7 +28,7 @@
    @ResponseBody
    @PostMapping("/cloudParkingInOrder")
    public BaseResponse cloudParkingInOrder(@RequestBody CloudParkingOrder order){
        log.info("云停车入场请求参数:{}" + JSON.toJSONString(order));
        log.warn("云停车入场请求参数:{}" + JSON.toJSONString(order));
        parkingOrderService.cloudParkingInOrder(order);
        return BaseResponse.ok();
    }
@@ -41,7 +41,7 @@
    @ResponseBody
    @PostMapping("/cloudParkingOutOrder")
    public BaseResponse cloudParkingOutOrder(@RequestBody CloudParkingOrder order){
        log.info("云停车出场请求参数:{}" + JSON.toJSONString(order));
        log.warn("云停车出场请求参数:{}" + JSON.toJSONString(order));
        parkingOrderService.cloudParkingOutOrder(order);
        return BaseResponse.ok();
    }
@@ -54,7 +54,7 @@
    @ResponseBody
    @PostMapping("/cloudParkingSpace")
    public BaseResponse cloudParkingSpace(@RequestBody CloudParkingSpace parkingSpace){
        log.info("云停车实时车位请求参数:{}" + JSON.toJSONString(parkingSpace));
        log.warn("云停车实时车位请求参数:{}" + JSON.toJSONString(parkingSpace));
        parkingOrderService.cloudParkingSpace(parkingSpace);
        return BaseResponse.ok();
    }
@@ -68,7 +68,7 @@
    @ResponseBody
    @PostMapping("/offlineParkingInOrder")
    public BaseResponse offlineParkingInOrder(@RequestBody OfflineParkingOrder order){
        log.info("线下停车场入场请求参数:{}" + JSON.toJSONString(order));
        log.warn("线下停车场入场请求参数:{}" + JSON.toJSONString(order));
        parkingOrderService.offlineParkingInOrder(order);
        OfflineParkingResponse offlineParkingResponse = new OfflineParkingResponse();
        offlineParkingResponse.setCode(0);
@@ -85,7 +85,7 @@
    @ResponseBody
    @PostMapping("/offlineParkingOutOrder")
    public BaseResponse offlineParkingOutOrder(@RequestBody OfflineParkingOrder order){
        log.info("线下停车场出场请求参数:{}" + JSON.toJSONString(order));
        log.warn("线下停车场出场请求参数:{}" + JSON.toJSONString(order));
        parkingOrderService.offlineParkingOutOrder(order);
        OfflineParkingResponse offlineParkingResponse = new OfflineParkingResponse();
        offlineParkingResponse.setCode(0);
@@ -102,7 +102,7 @@
    @ResponseBody
    @PostMapping("/offlineParkingSpace")
    public BaseResponse offlineParkingSpace(@RequestBody OfflineParkingSpace parkingSpace){
        log.info("线下停车场实时车位请求参数:{}" + JSON.toJSONString(parkingSpace));
        log.warn("线下停车场实时车位请求参数:{}" + JSON.toJSONString(parkingSpace));
        parkingOrderService.offlineParkingSpace(parkingSpace);
        return BaseResponse.ok();
    }
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/CouponService.java
@@ -70,9 +70,8 @@
        GetCouponResp resp = new GetCouponResp();
        resp.setRecordId(data.getId());
        resp.setCarNumber(carNumber);
        // todo 需要第三方提供数据
        resp.setSysOrgId("");
        resp.setPosName("");
        resp.setSysOrgId("MXCD7QjHapTJGZ8TZZz3");
        resp.setPosName("明星电力");
        resp.setLssuer("admin");
        resp.setType(4);
        Parameter parameter = new Parameter();
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/SwitchwayGateService.java
@@ -18,10 +18,6 @@
    private final String url = "http://8.137.103.127/universal";
    
    private final String appkey = "886621e841fc44c1ad63a823d";
    private final String secretkey = "7d87c2c36bea4749b30f38f4d";
    
    /**
     * 开关道闸
@@ -30,17 +26,17 @@
     */
    public Boolean gateService(SwitchwayGateReq req){
        SwitchwayGate switchwayGate = new SwitchwayGate()
                .setAppkey(appkey)
                .setAppkey(req.getAppkey())
                .setAction(req.getAction())
                .setChannel(req.getChannel())
                .setTimestamp(System.currentTimeMillis() + "")
                .build(secretkey);
                .build(req.getSecretkey());
        String body = JSON.toJSONString(switchwayGate);
        String result = HttpUtil.post(url + "/gateService", body);
        JSONObject jsonObject = JSON.parseObject(result);
        Boolean success = jsonObject.getBoolean("success");
        if(!success){
            log.error("调用开关道闸失败:\n请求参数:{}\n返回结果:{}", body, result);
            log.warn("调用开关道闸失败:\n请求参数:{}\n返回结果:{}", body, result);
        }
        return success;
    }
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -1409,6 +1409,7 @@
        PageInfo<ChargingOrderListVO> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize());
        List<ChargingOrderListVO> list = this.baseMapper.chargingList(pageInfo,dto,startTime1,startTime2,endTime1,endTime2);
        for (ChargingOrderListVO chargingOrderListVO : list) {
            chargingOrderListVO.setPaymentAmount(chargingOrderListVO.getResidualAmount()==null?chargingOrderListVO.getPaymentAmount():chargingOrderListVO.getPaymentAmount().subtract(chargingOrderListVO.getResidualAmount()));
            chargingOrderListVO.setUid(chargingOrderListVO.getId()+"");
            List<Integer> integers = new ArrayList<>();
            integers.add(chargingOrderListVO.getSiteId());
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
@@ -60,7 +60,7 @@
            String randomDigits = random.ints(10, 0, 10) // 生成10个随机数字,范围在0-9
                    .mapToObj(String::valueOf)
                    .collect(Collectors.joining()); // 将其连接成一个字符串
            tChargingBill.setCode("JSD"+string+randomDigits+"001" );
            tChargingBill.setCode("JSD"+string+randomDigits );
            tChargingBill.setType(1);
            tChargingBill.setBillTime(LocalDateTime.now());
            tChargingBill.setStatus(1);
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -797,7 +797,7 @@
    </select>
    <select id="chargingList" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO">
        select t1.* from t_charging_order t1
        select t1.* ,t1.current as chargingCapacity,t1.recharge_amount as paymentAmount,t1.electricity as chargingCapacity from t_charging_order t1
        where 1=1
        <if test="null != req.code and req.code!=''">
            and t1.code  LIKE CONCAT('%',#{req.code},'%')