| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | 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.setState(1); |
| | | orderCharteredCar.setInsertTime(new Date()); |
| | | orderCharteredCar.setCarTime(charteredCarDto.getCarTime()); |
| | | |
| | | String strDateTime = charteredCarDto.getTraveltime(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d H:m"); |
| | | |
| | | try { |
| | | Date date = sdf.parse(strDateTime); |
| | | System.out.println("Converted Date and Time: " + date); |
| | | orderCharteredCar.setTraveltime(date); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | this.insert(orderCharteredCar); |
| | | return ResultUtil.success(); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public synchronized String getOrderNum() throws Exception{ |