Pu Zhibing
2024-12-12 f4c42ef27bf35c59dc7f23e49e8f7671b4baa378
修改bug
6个文件已修改
87 ■■■■■ 已修改文件
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/GunsApplication.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CompanyMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/resources/application-produce.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/GunsApplication.java
@@ -9,6 +9,7 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@@ -20,6 +21,7 @@
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import javax.servlet.MultipartConfigElement;
import java.nio.charset.StandardCharsets;
import java.util.TimeZone;
@@ -91,4 +93,5 @@
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
//        return builder.sources(GunsApplication.class);
//    }
}
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -663,31 +663,7 @@
    })
    public ResultUtil queryTrack_(Integer orderId, Integer orderType){
        try {
            List<Map<String, Object>> list = new ArrayList<>();
                    switch (orderType){
                case 1:
                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                    Map<String, Object> map = new HashMap<>();
                    map.put("lon", orderPrivateCar.getStartLon());
                    map.put("lat", orderPrivateCar.getStartLat());
                    list.add(map);
                    map = new HashMap<>();
                    map.put("lon", orderPrivateCar.getEndLon());
                    map.put("lat", orderPrivateCar.getEndLat());
                    list.add(map);
                    break;
                case 4:
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                    Map<String, Object> map1 = new HashMap<>();
                    map1.put("lon", orderLogistics.getStartLon());
                    map1.put("lat", orderLogistics.getStartLat());
                    list.add(map1);
                    map1 = new HashMap<>();
                    map1.put("lon", orderLogistics.getEndLon());
                    map1.put("lat", orderLogistics.getEndLat());
                    list.add(map1);
                    break;
            }
            List<Map<String, Object>> list = orderPositionService.queryTrack(orderId, orderType);
            return ResultUtil.success(list);
        }catch (Exception e){
            e.printStackTrace();
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -1155,8 +1155,7 @@
                        userRedPacketRecordService.updateBatchById(userRedPacketRecords);
                    }
                    orderLogistics.setRedPacketId(jsonArray.toJSONString());
                }
                if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
                }else if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
                    orderLogistics.setRedPacketMoney(total);
                    orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN);
                    //获取红包id
@@ -1264,21 +1263,21 @@
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            if(null != orderLogistics.getRedPacketId()){
                JSONArray jsonArray = JSON.parseArray(orderLogistics.getRedPacketId());
                for (int i = 0; i < jsonArray.size(); i++) {
                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                    Integer id1 = jsonObject.getInteger("id");
                    Double money = jsonObject.getDouble("money");
                    UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(id1);
                    userRedPacketRecord.setRemainingAmount(userRedPacketRecord.getRemainingAmount() - money);
                    if(0 == userRedPacketRecord.getRemainingAmount()){
                        userRedPacketRecord.setState(2);
                        userRedPacketRecord.setEndTime(new Date());
                    }
                    userRedPacketRecordService.updateById(userRedPacketRecord);
                }
            }
//            if(null != orderLogistics.getRedPacketId()){
//                JSONArray jsonArray = JSON.parseArray(orderLogistics.getRedPacketId());
//                for (int i = 0; i < jsonArray.size(); i++) {
//                    JSONObject jsonObject = jsonArray.getJSONObject(i);
//                    Integer id1 = jsonObject.getInteger("id");
//                    Double money = jsonObject.getDouble("money");
//                    UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(id1);
//                    userRedPacketRecord.setRemainingAmount(userRedPacketRecord.getRemainingAmount() - money);
//                    if(0 == userRedPacketRecord.getRemainingAmount()){
//                        userRedPacketRecord.setState(2);
//                        userRedPacketRecord.setEndTime(new Date());
//                    }
//                    userRedPacketRecordService.updateById(userRedPacketRecord);
//                }
//            }
    
            //添加已收入明细
            Company company = companyService.selectById(orderLogistics.getCompanyId());
@@ -3261,10 +3260,10 @@
        if(orderLogistics.getState() == 10 || orderLogistics.getState() == 12){
            Car car = carService.selectById(orderLogistics.getCarId());
            //修改行程信息
            boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
            boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderLogistics.getTripId(), null, null, null, null);
            if(!updateTrip){
                for (int i = 0; i < 5; i++) {
                    updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
                    updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderLogistics.getTripId(), null, null, null, null);
                    if(updateTrip){
                        break;
                    }
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -902,10 +902,10 @@
        //修改行程信息
        if(orderPrivateCar.getState() == 10 || orderPrivateCar.getState() == 12){
            Car car = carService.selectById(orderPrivateCar.getCarId());
            boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null);
            boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderPrivateCar.getTripId(), null, null, null, null);
            if(!updateTrip){
                for (int i = 0; i < 5; i++) {
                    updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null);
                    updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderPrivateCar.getTripId(), null, null, null, null);
                    if(updateTrip){
                        break;
                    }
@@ -1258,7 +1258,7 @@
    @Override
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    public ResultUtil payPrivateCarOrder(Integer payType, Integer bankCardId, Integer orderId, Integer couponId, Integer redDeduction, Integer type, Integer language) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){
@@ -1323,10 +1323,9 @@
        if(null != redDeduction && 1 == redDeduction && null == orderPrivateCar.getRedPacketId()){
            RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings();
            if(null != redEnvelopePaymentSettings){
                Double total = userRedPacketRecordService.queryRemainingAmount(uid);
                List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>().eq("userId", uid)
                        .eq("state", 1).eq("companyId", orderPrivateCar.getCompanyId()).gt("remainingAmount", 0).orderBy("insertTime", false));
                Double total = userRedPacketRecords.stream().mapToDouble(UserRedPacketRecord::getRemainingAmount).sum();
                BigDecimal deductionRatio = redEnvelopePaymentSettings.getDeductionRatio();
                BigDecimal multiply1 = orderMoney.multiply(deductionRatio.divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN);
                if(total > 0 && multiply1.doubleValue() > 0 && total.compareTo(multiply1.doubleValue()) >= 0){
@@ -1336,12 +1335,10 @@
                    //获取红包id
                    JSONArray jsonArray = new JSONArray();
                    for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) {
                        if(multiply1.compareTo(BigDecimal.ZERO) == 0){
                            break;
                        }
                        JSONObject jsonObject = new JSONObject();
                        jsonObject.put("id", userRedPacketRecord.getId());
                        BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount());
                        if(multiply1.compareTo(remainingAmount) >= 0){
                            userRedPacketRecord.setRemainingAmount(0D);
                            userRedPacketRecord.setEndTime(new Date());
@@ -1354,14 +1351,14 @@
                            jsonObject.put("money", multiply1.setScale(2, RoundingMode.HALF_EVEN));
                            jsonArray.add(jsonObject);
                            multiply1 = BigDecimal.ZERO;
                            break;
                        }
                    }
                    if(userRedPacketRecords.size() > 0){
                        userRedPacketRecordService.updateBatchById(userRedPacketRecords);
                    }
                    orderPrivateCar.setRedPacketId(jsonArray.toJSONString());
                }
                if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
                }else if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
                    orderPrivateCar.setRedPacketMoney(total);
                    orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN);
                    //获取红包id
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CompanyMapper.xml
@@ -236,7 +236,7 @@
        insertTime as insertTime
        from t_company where flag != 3 and state = 0 and id in (
        select companyId from t_company_city where state = 1
        <if test="null != city">
        <if test="null != collect">
            and cityId in
            <foreach collection="collect" item="item" index="index" open="(" separator="," close=")">
                #{item}
UserIGOTravel/guns-admin/src/main/resources/application-produce.yml
@@ -1,7 +1,5 @@
server:
  port: 8006
  tomcat:
    basedir: /home/igotechgh/app/tomcat_basedir
guns:
  swagger-open: false              #是否开启swagger (true/false)