luodangjia
2024-05-24 503bc89c55d675a27b689419aa906a070ca5cb03
UserNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/server/impl/OrderCharteredCarServiceImpl.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.CharteredCar.dao.OrderCharteredCarMapper;
import com.stylefeng.guns.modular.CharteredCar.dto.CharteredCarDto;
import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar;
import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService;
import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper;
@@ -15,6 +16,7 @@
import com.stylefeng.guns.modular.system.service.ISystemNoticeService;
import com.stylefeng.guns.modular.system.util.DateUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -140,8 +142,24 @@
        return ResultUtil.success(map);
    }
    @Override
    public ResultUtil createOrder(CharteredCarDto charteredCarDto) {
        OrderCharteredCar orderCharteredCar = new OrderCharteredCar();
        BeanUtils.copyProperties(charteredCarDto,orderCharteredCar);
        try {
            orderCharteredCar.setOrderNumber(this.getOrderNum());
            orderCharteredCar.setCompanyId(1);
            orderCharteredCar.setIsDelete(1);
            orderCharteredCar.setInsertTime(new Date());
        }catch (Exception e){
            e.printStackTrace();
        }
        this.insert(orderCharteredCar);
        return ResultUtil.success();
    }
    public synchronized String getOrderNum() throws Exception{
        int size = this.selectCount(null);