2.6
luo
2024-02-06 e02092458a5794ee9d4c76d10de3356a87260c07
2.6
14个文件已修改
161 ■■■■ 已修改文件
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CarBrandMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CarModelMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/DateUtil.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TIntegralOrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserCouponRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TIntegralOrder.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_detail.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/userCouponRecord/userCouponRecord.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/DateUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -1131,7 +1131,7 @@
        if(null == uid){
            return ResultUtil.tokenErr();
        }
        List<Income> objectId = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid));
        List<Income> objectId = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid).eq("type",1));
        double sum =  0;
        for (Income income : objectId) {
            Double money = income.getMoney();
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -3,8 +3,11 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.smallLogistics.server.impl.OrderLogisticsSpreadService;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.model.OrderPosition;
import com.stylefeng.guns.modular.system.model.Reassign;
@@ -230,6 +233,9 @@
        }
    }
    @Autowired
    private OrderLogisticsSpreadService spreadService;
    /**
     * 获取服务中页面订单详情
     * @param orderId
@@ -263,6 +269,21 @@
            }else{
                orderInfoWarpper.setOrderPositionList("");
            }
            List<OrderLogisticsSpread> orderLogisticsId = spreadService.selectList(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderId));
            if (!orderLogisticsId.isEmpty()){
                double sum =  0;
                for (OrderLogisticsSpread orderLogisticsSpread : orderLogisticsId) {
                    if (orderLogisticsSpread.getPayType() == 4) {
                        Double payMoney = orderLogisticsSpread.getPayMoney();
                        sum = sum + payMoney;
                    }
                }
                sum = sum+orderInfoWarpper.getPayMoney();
                orderInfoWarpper.setPayMoney(sum);
            }
            return ResultUtil.success(orderInfoWarpper);
        }catch (Exception e){
            e.printStackTrace();
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -1,5 +1,7 @@
package com.stylefeng.guns.modular.smallLogistics.server.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
@@ -230,7 +232,16 @@
        return map;
    }
    @Autowired
    private ISettlementDetailService settlementDetailService;
    @Autowired
    private ISettlementAllocationService settlementAllocationService;
    @Autowired
    private ISettlementRecordService settlementRecordService;
    @Autowired
    private  OrderLogisticsSpreadService spreadService;
    /**
     * 走订单流程
     * @param orderId
@@ -253,6 +264,9 @@
                return ResultUtil.error(language == 1 ? "验证失败" : language == 2 ? "Verification failed" : "Echec de la validation");
            }
        }
        List<OrderLogisticsSpread> orderLogisticsId = spreadService.selectList(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderLogistics.getId()).eq("payType",4));
        switch (state){
            case 3://出发前往预约点
@@ -307,6 +321,73 @@
                    driverService.updateById(driver);
                }
                if (orderLogistics.getPayType()==4||!orderLogisticsId.isEmpty()){
                    double sum = 0;
                    if (orderLogistics.getPayType()==4){
                        sum= orderLogistics.getOrderMoney();
                    }
                    if (!orderLogisticsId.isEmpty()){
                        for (OrderLogisticsSpread orderLogisticsSpread : orderLogisticsId) {
                            sum = sum +orderLogisticsSpread.getPrice();
                        }
                    }
                    Company company = companyService.selectById(orderLogistics.getCompanyId());
                    Double speMoney = company.getSameLogisticsMoney();
                    BigDecimal d = null;//企业收入
                    BigDecimal c = null;//司机收入
                    if(company.getIsSameLogisticsFixedOrProportional() == 2){//固定
                        d = new BigDecimal(speMoney);
                        c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
                    }
                    if(company.getIsSameLogisticsFixedOrProportional() == 1){//比例
                        Double price = orderLogistics.getOrderMoney();
                        d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
                        c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                    }
                    //记录司机待结算金额
                    if(d.compareTo(new BigDecimal(0)) > 0){
                        SettlementDetail settlementDetail = new SettlementDetail();
                        settlementDetail.setOrderId(orderId);
                        settlementDetail.setOrderType(1);
                        settlementDetail.setDriverId(orderLogistics.getDriverId());
                        settlementDetail.setOrderMoney(sum);
                        settlementDetail.setPrice(d.doubleValue());
                        settlementDetail.setCreateTime(new Date());
                        settlementDetailService.insert(settlementDetail);
                        SettlementAllocation settlementAllocation = settlementAllocationService.selectOne(null);
                        if(null != settlementAllocation){
                            JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent());
                            Double maxPrice = jsonObject.getDouble("maxPrice");
                            List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", orderLogistics.getDriverId()).isNull("settlementRecordId").last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(createTime, '%Y-%m-%d')"));
                            BigDecimal total = new BigDecimal(0);
                            for (SettlementDetail detail : settlementDetailList) {
                                total = total.add(new BigDecimal(detail.getPrice()));
                            }
                            if(maxPrice.compareTo(total.doubleValue()) <= 0){
                                SettlementRecord settlementRecord = new SettlementRecord();
                                settlementRecord.setDay(new Date());
                                settlementRecord.setDriverId(orderLogistics.getDriverId());
                                settlementRecord.setType(1);
                                settlementRecord.setPaymentStatus(1);
                                settlementRecord.setPayMoney(sum);
                                settlementRecord.setInsertTime(new Date());
                                settlementRecordService.insert(settlementRecord);
                                for (SettlementDetail detail : settlementDetailList) {
                                    detail.setSettlementRecordId(settlementRecord.getId());
                                    settlementDetailService.updateById(detail);
                                }
                            }
                        }
                    }
                }
                break;
        }
        this.updateById(orderLogistics);
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CarBrandMapper.xml
@@ -17,6 +17,6 @@
        select
        id as id,
        name as name
        from t_car_brand where state = 1
        from t_car_brand where state = 1 and remark != '1'
    </select>
</mapper>
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CarModelMapper.xml
@@ -18,6 +18,6 @@
        select
        id as id,
        name as name
        from t_car_model where state = 1 and brandId = #{brandId}
        from t_car_model where state = 1 and brandId = #{brandId} and remark != '1'
    </select>
</mapper>
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java
@@ -3,12 +3,14 @@
import com.stylefeng.guns.modular.system.model.OrderPosition;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ApiModel("订单详情22")
@Data
public class OrderInfoWarpper {
    @ApiModelProperty("订单id")
    private Integer orderId;
@@ -53,6 +55,8 @@
    private Integer payManner;
    @ApiModelProperty("支付金额")
    private Double payMoney;
    @ApiModelProperty("是否是改派单(1=否,2=是)")
    private Integer isReassign;
    @ApiModelProperty("高德猎鹰轨迹id(订单开始后需要上传坐标到指定轨迹中)")
DriverIGOTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/DateUtil.java
@@ -28,13 +28,31 @@
import java.util.TimeZone;
public class DateUtil {
    private static TimeZone tz = TimeZone.getTimeZone("GMT+0");
    /**
     * 获取YYYY格式
     */
    public static String getYear() {
        return formatDate(new Date(), "yyyy");
    }
    public static Date getDate() {
        TimeZone.setDefault(tz);
        return new Date();
    }
    public static Date getDate_str3(String dateStr) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        sdf.setTimeZone(tz);
        if ("".equals(dateStr)) {
            dateStr = sdf.format(DateUtil.getDate());
        }
        Date date = null;
        try {
            date = sdf.parse(dateStr);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
    /**
     * 获取YYYY格式
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java
@@ -90,6 +90,9 @@
    @ResponseBody
    public Object immediately(TIntegralOrder tIntegralOrder) {
        tIntegralOrder.setState(2);
        tIntegralOrder.setManageRemark(tIntegralOrder.getRemark());
        tIntegralOrder.setRemark(null);
        tIntegralOrderService.updateById(tIntegralOrder);
        return SUCCESS_TIP;
    }
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TIntegralOrderMapper.xml
@@ -23,7 +23,7 @@
    <!--根据条件查询兑换订单列表-->
    <select id="getIntegralOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
        SELECT * FROM (SELECT ui.nickName as userName,ig.`name` as goodsName,io.* FROM t_integral_order as io
        SELECT * FROM (SELECT ui.nickName as userName,ig.`name` as goodsName,io.id,io.insertTime,io.userId,io.goodsId,io.num,io.consigneeName,io.consigneePhone,io.consigneeAddress,io.state,io.manageRemark as remark FROM t_integral_order as io
        LEFT JOIN t_user as ui on ui.id = io.userId
        LEFT JOIN t_integral_goods as ig on ig.id = io.goodsId) as o
        <where>
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserCouponRecordMapper.xml
@@ -63,7 +63,7 @@
        <if test="userPhone != null and userPhone !=''">
            and u.phone like CONCAT('%',#{userPhone},'%')
        </if>
        <if test="couponActivityId != null and couponActivityId !=''">
        <if test="couponActivityId != null">
            and c.couponActivityId=#{couponActivityId}
        </if>
        <if test="state != null and state !=''">
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TIntegralOrder.java
@@ -5,6 +5,8 @@
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;
import java.io.Serializable;
/**
@@ -16,6 +18,7 @@
 * @since 2020-09-02
 */
@TableName("t_integral_order")
@Data
public class TIntegralOrder extends Model<TIntegralOrder> {
    private static final long serialVersionUID = 1L;
@@ -61,6 +64,7 @@
     * 状态 1=未处理 2=已处理 3=已删除
     */
    private Integer state;
    private String manageRemark;
    public Integer getId() {
ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_detail.html
@@ -80,7 +80,7 @@
                                                                              @if(isNotEmpty(item1Coupon)){
                                                                              value="${item1Coupon.couponUseType==0?'通用券':
                                                                              item1Coupon.couponUseType==1?'专车券':
                                                                              item1Coupon.couponUseType==2?'出租券':'跨城出行券'}"
                                                                              item1Coupon.couponUseType==2?'出租券':'包裹优惠劵'}"
                                                                              @}else{
                                                                              value=""
                                                                              @}
@@ -178,7 +178,7 @@
                                                                              @if(isNotEmpty(item2Coupon)){
                                                                              value="${item2Coupon.couponUseType==0?'通用券':
                                                                              item2Coupon.couponUseType==1?'专车券':
                                                                              item2Coupon.couponUseType==2?'出租券':'跨城出行券'}"
                                                                              item2Coupon.couponUseType==2?'出租券':'包裹优惠券'}"
                                                                              @}else{
                                                                              value=""
                                                                              @}
ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/userCouponRecord/userCouponRecord.js
@@ -22,13 +22,13 @@
            {title: '领取类型', field: 'couponUseType', visible: true, align: 'center', valign: 'middle',
                formatter: function (value, row) {
                    if(value==0){
                        return "通用券";
                        return "通用优惠券";
                    }else if(value==1){
                        return "专车券";
                        return "打车优惠券";
                    }else if(value==2){
                        return "出租券";
                    }else if(value==3){
                        return "跨城出行券";
                    }else if(value==4){
                        return "包裹优惠券";
                    }else{
                        return "";
                    }
ManagementIGOTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/DateUtil.java
@@ -28,11 +28,7 @@
import java.util.TimeZone;
public class DateUtil {
    public static int getNowWeekDay() {
        Calendar canlendar = Calendar.getInstance(); // java.util包
        int week= canlendar.get(Calendar.DAY_OF_WEEK);
        return week == 0 ? 7 : week - 1;
    }
    private static TimeZone tz = TimeZone.getTimeZone("GMT+8");