puzhibing
2023-05-30 6d05cda0141cbd42a9b8810e539f5dcd8df506f0
修改bug
6个文件已修改
65 ■■■■ 已修改文件
driver/guns-admin/src/main/java/com/agentdriving/driver/modular/system/service/impl/OrderServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GaoDe/MapUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
driver/guns-admin/src/main/java/com/agentdriving/driver/modular/system/service/impl/OrderServiceImpl.java
@@ -1219,6 +1219,8 @@
                order.setCouponId(coupon.getId());
                order.setDiscountAmount(coupon.getCouponPreferentialAmount());
                order.setPayMoney(order.getOrderMoney() - coupon.getCouponPreferentialAmount());
            }else{
                order.setPayMoney(order.getOrderMoney());
            }
        }
@@ -1230,9 +1232,6 @@
                    userToCoupon.setValidCount(userToCoupon.getValidCount() - 1);
                    userToCouponService.updateById(userToCoupon);
                    Coupon coupon = couponService.selectById(userToCoupon.getCouponId());
                    order.setPayMoney(order.getPayMoney() - coupon.getCouponPreferentialAmount());
                    order.setCouponId(coupon.getId());
                    order.setDiscountedPrice(coupon.getCouponPreferentialAmount());
                    Driver driver = driverService.selectById(order.getDriverId());
                    AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
@@ -1689,6 +1688,41 @@
     */
    @Override
    public void completeCollection() {
        this.baseMapper.completeCollection();
        List<Order> orders = this.selectList(new EntityWrapper<Order>().eq("state", 107).eq("status", 1).eq("payType", 3));
        for (Order order : orders) {
            order.setState(108);
            order.setPayTime(new Date());
            if(null != order.getCouponId()){
                UserToCoupon userToCoupon = userToCouponService.selectById(order.getCouponId());
                if(userToCoupon.getValidCount() > 0){
                    userToCoupon.setValidCount(userToCoupon.getValidCount() - 1);
                    userToCouponService.updateById(userToCoupon);
                    Coupon coupon = couponService.selectById(userToCoupon.getCouponId());
                    Driver driver = driverService.selectById(order.getDriverId());
                    AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
                    accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
                    accountChangeDetail.setUserType(2);
                    accountChangeDetail.setUserId(order.getDriverId());
                    accountChangeDetail.setCreateTime(new Date());
                    accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
                    accountChangeDetail.setType(1);
                    accountChangeDetail.setChangeType(7);
                    accountChangeDetail.setOrderId(order.getId());
                    accountChangeDetail.setExplain("优惠券收入");
                    driver.setCouponBalance(driver.getCouponBalance() + coupon.getCouponPreferentialAmount());
                    accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
                    driverService.updateById(driver);
                    accountChangeDetailService.insert(accountChangeDetail);
                }
            }
            this.updateById(order);
            try {
                saveRevenue(order);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -497,7 +497,7 @@
        tDriverService.updateById(tDriver);
        //增加积分奖励
        if(approvalStatus == 2){
        if(approvalStatus == 2 && null != tDriver.getInviterId()){
            TSystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 4));
            Integer num7 = JSON.parseObject(systemConfig.getContent()).getInteger("num7");
            TDriver tDriver1 = tDriverService.selectById(tDriver.getInviterId());
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderServiceImpl.java
@@ -428,9 +428,16 @@
            tOrder.setEndLat(jsonObject.getString("lat"));
            tOrder.setEndLng(jsonObject.getString("lon"));
        }
        if(ToolUtil.isEmpty(tOrder.getStartLng()) || ToolUtil.isEmpty(tOrder.getStartLat())){
            return ResultUtil.error("请输入有效的起点");
        }
        tOrder.setCode(UUIDUtil.getTimeStr() + UUIDUtil.getNumberRandom(3));
        Double d = 0D;
        if(ToolUtil.isNotEmpty(endAddress)){
            if(ToolUtil.isEmpty(tOrder.getEndLng()) || ToolUtil.isEmpty(tOrder.getEndLat())){
                return ResultUtil.error("请输入有效的终点");
            }
            Map<String, String> distance = MapUtil.getDistance(tOrder.getStartLng() + "," + tOrder.getStartLat(), tOrder.getEndLng() + "," + tOrder.getEndLat(), 1);
            if(null == distance){
                return ResultUtil.error("获取预估距离出错", "");
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GaoDe/MapUtil.java
@@ -39,7 +39,7 @@
                    "&type=" + type;
            HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json");
            if(httpResult.getCode() != 200){
                logger.debug(httpResult.getData());
                logger.warn(httpResult.getData());
                return null;
            }
            String data = httpResult.getData();
@@ -53,7 +53,7 @@
                map.put("duration", jsonObject1.getString("duration"));//预计时间(秒)
                return map;
            }else{
                logger.debug(data);
                logger.warn(data);
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -127,7 +127,7 @@
                district1.setDistrictCode(code);
                return district1;
            }
            logger.debug(httpResult.getData());
            logger.warn(httpResult.getData());
            return null;
        }catch (Exception e){
            e.printStackTrace();
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java
@@ -1,8 +1,8 @@
package com.stylefeng.guns.modular.system.util;
public class PushURL {
//    public static String zull_user_url = "http://127.0.0.1:81";
    public static String zull_user_url = "https://okyueche.com:443";
    public static String zull_user_url = "http://139.9.238.199:80";
//    public static String zull_user_url = "https://okyueche.com:443";
    public static String order_push_url =  zull_user_url + "/driver/base/order/pushOrderState";
    public static String driver_auth_url =  zull_user_url + "/driver/base/driver/sendsms";
    public static String withdraw_auth_url =  zull_user_url + "/driver/base/withdrawal/withdrawalAudit";
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
@@ -25,7 +25,7 @@
    Logger logger = LoggerFactory.getLogger("ServiceLog");
    @Autowired
    private RestTemplate internalRestTemplate;
    private RestTemplate restTemplate;
@@ -61,7 +61,7 @@
        params.add("id", id.toString());
        params.add("type", type.toString());
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
        String s = restTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class);
        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
        if(jsonObject1.getIntValue("code") != 200){
            logger.debug(jsonObject1.getString("msg"));