@ -1,5 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
<mapper namespace="org.jeecg.modules.carrrentOrder.mapper.CarrrentOrderMapper"> | |||||
<mapper namespace="org.jeecg.modules.carrentOrder.mapper.CarrentOrderMapper"> | |||||
</mapper> | </mapper> |
@ -0,0 +1,14 @@ | |||||
package org.jeecg.modules.carrentOrder.service; | |||||
import org.jeecg.modules.carrentOrder.entity.CarrentOrder; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* @Description: 预约信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-11-12 | |||||
* @Version: V1.0 | |||||
*/ | |||||
public interface ICarrentOrderService extends IService<CarrentOrder> { | |||||
} |
@ -0,0 +1,19 @@ | |||||
package org.jeecg.modules.carrentOrder.service.impl; | |||||
import org.jeecg.modules.carrentOrder.entity.CarrentOrder; | |||||
import org.jeecg.modules.carrentOrder.mapper.CarrentOrderMapper; | |||||
import org.jeecg.modules.carrentOrder.service.ICarrentOrderService; | |||||
import org.springframework.stereotype.Service; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
/** | |||||
* @Description: 预约信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-11-12 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Service | |||||
public class CarrentOrderServiceImpl extends ServiceImpl<CarrentOrderMapper, CarrentOrder> implements ICarrentOrderService { | |||||
} |
@ -1,14 +0,0 @@ | |||||
package org.jeecg.modules.carrrentOrder.service; | |||||
import org.jeecg.modules.carrrentOrder.entity.CarrrentOrder; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* @Description: 预约信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-11-12 | |||||
* @Version: V1.0 | |||||
*/ | |||||
public interface ICarrrentOrderService extends IService<CarrrentOrder> { | |||||
} |
@ -1,19 +0,0 @@ | |||||
package org.jeecg.modules.carrrentOrder.service.impl; | |||||
import org.jeecg.modules.carrrentOrder.entity.CarrrentOrder; | |||||
import org.jeecg.modules.carrrentOrder.mapper.CarrrentOrderMapper; | |||||
import org.jeecg.modules.carrrentOrder.service.ICarrrentOrderService; | |||||
import org.springframework.stereotype.Service; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
/** | |||||
* @Description: 预约信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-11-12 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Service | |||||
public class CarrrentOrderServiceImpl extends ServiceImpl<CarrrentOrderMapper, CarrrentOrder> implements ICarrrentOrderService { | |||||
} |
@ -0,0 +1,38 @@ | |||||
package org.jeecg.modules.api.carrentController; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.CarBean; | |||||
import org.jeecg.modules.apiBean.PageBean; | |||||
import org.jeecg.modules.apiService.CarService; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestMethod; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.annotation.Resource; | |||||
@Api(tags="商品信息相关接口") | |||||
@RestController | |||||
@RequestMapping("/api/car") | |||||
@Slf4j | |||||
public class CarController { | |||||
//车辆信息 | |||||
@Resource | |||||
private CarService carService; | |||||
/****************************************************************************************************/ | |||||
@ApiOperation(value="首页-获取商品列表", notes="首页-获取商品列表") | |||||
@RequestMapping(value = "/queryCarList", method = {RequestMethod.GET}) | |||||
public Result<?> queryCarList(CarBean carBean, PageBean pageBean){ | |||||
return carService.queryCarList(carBean, pageBean); | |||||
} | |||||
@ApiOperation(value="首页-根据id获取商品详情", notes="首页-根据id获取商品详情") | |||||
@RequestMapping(value = "/queryCarById", method = {RequestMethod.GET}) | |||||
public Result<?> queryCarById(String carId){ | |||||
return carService.queryCarById(carId); | |||||
} | |||||
} |
@ -0,0 +1,63 @@ | |||||
package org.jeecg.modules.api.carrentController; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang.StringUtils; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.CompanyBean; | |||||
import org.jeecg.modules.apiService.CompanyService; | |||||
import org.jeecg.modules.carrentCompany.entity.CarrentCompany; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestMethod; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.annotation.Resource; | |||||
@Api(tags="企业信息相关接口") | |||||
@RestController | |||||
@RequestMapping("/api/company") | |||||
@Slf4j | |||||
public class CompanyController { | |||||
//企业信息 | |||||
@Resource | |||||
private CompanyService companyService; | |||||
/****************************************************************************************************/ | |||||
@ApiOperation(value="企业信息-企业注册", notes="企业信息-企业注册") | |||||
@RequestMapping(value = "/addCompany", method = {RequestMethod.POST}) | |||||
public Result<?> addCompany(CompanyBean companyBean){ | |||||
//将注册信息注入实体bean中 | |||||
CarrentCompany carrentCompany = new CarrentCompany(); | |||||
carrentCompany.setUserName(companyBean.getUserName()); | |||||
carrentCompany.setCompanyName(companyBean.getCompanyName()); | |||||
carrentCompany.setTaxCode(companyBean.getTaxCode()); | |||||
carrentCompany.setAddress(companyBean.getAddress()); | |||||
carrentCompany.setPhone(companyBean.getPhone()); | |||||
carrentCompany.setBusinessLicense(companyBean.getBusinessLicense()); | |||||
String message = ""; | |||||
//注册信息验证 | |||||
if(StringUtils.isEmpty(carrentCompany.getUserName())){ | |||||
message = "用户名未填写,请填写用户名!"; | |||||
}else if(StringUtils.isEmpty(carrentCompany.getCompanyName())){ | |||||
message = "公司名称未填写,请填写公司名称!"; | |||||
}else if(StringUtils.isEmpty(carrentCompany.getTaxCode())){ | |||||
message = "税收编码未填写,请填写税收编码!"; | |||||
}else if(StringUtils.isEmpty(carrentCompany.getAddress())){ | |||||
message = "公司地址未填写,请填写公司地址!"; | |||||
}else if(StringUtils.isEmpty(carrentCompany.getPhone())){ | |||||
message = "联系电话未填写,请填写联系电话!"; | |||||
}else if(StringUtils.isEmpty(carrentCompany.getBusinessLicense())){ | |||||
message = "营业执照未填写,请上传营业执照!"; | |||||
}else { | |||||
//注册信息无误,进入业务流程处理 | |||||
return companyService.addCompany(carrentCompany); | |||||
} | |||||
//注册信息有误,返回错误信息 | |||||
return Result.error(message); | |||||
} | |||||
} |
@ -0,0 +1,39 @@ | |||||
package org.jeecg.modules.api.carrentController; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.PageBean; | |||||
import org.jeecg.modules.apiService.CompanyService; | |||||
import org.jeecg.modules.apiService.NewsService; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestMethod; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.annotation.Resource; | |||||
@Api(tags="新闻资讯相关接口") | |||||
@RestController | |||||
@RequestMapping("/api/news") | |||||
@Slf4j | |||||
public class NewsController { | |||||
//新闻信息 | |||||
@Resource | |||||
private NewsService newsService; | |||||
/****************************************************************************************************/ | |||||
@ApiOperation(value="新闻资讯-获取新闻列表", notes="新闻资讯-获取新闻列表") | |||||
@RequestMapping(value = "/queryNewsList", method = {RequestMethod.GET}) | |||||
public Result<?> queryNewsList(PageBean pageBean){ | |||||
return newsService.queryNewsList(pageBean); | |||||
} | |||||
@ApiOperation(value="新闻资讯-根据id获取新闻详情", notes="新闻资讯-根据id获取新闻详情") | |||||
@RequestMapping(value = "/queryNewsById", method = {RequestMethod.GET}) | |||||
public Result<?> queryNewsById(String newsId){ | |||||
return newsService.queryNewsById(newsId); | |||||
} | |||||
} |
@ -0,0 +1,64 @@ | |||||
package org.jeecg.modules.api.carrentController; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang.StringUtils; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.OrderBean; | |||||
import org.jeecg.modules.apiBean.PageBean; | |||||
import org.jeecg.modules.apiService.NewsService; | |||||
import org.jeecg.modules.apiService.OrderService; | |||||
import org.jeecg.modules.carrentOrder.entity.CarrentOrder; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestMethod; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.annotation.Resource; | |||||
@Api(tags="预约信息相关接口") | |||||
@RestController | |||||
@RequestMapping("/api/order") | |||||
@Slf4j | |||||
public class OrderController { | |||||
//预约信息 | |||||
@Resource | |||||
private OrderService orderService; | |||||
/****************************************************************************************************/ | |||||
@ApiOperation(value="商品预约-提交预约信息", notes="商品预约-提交预约信息") | |||||
@RequestMapping(value = "/addOrder", method = {RequestMethod.POST}) | |||||
public Result<?> addOrder(OrderBean orderBean){ | |||||
//将预约信息注入到实体bean中 | |||||
CarrentOrder carrentOrder = new CarrentOrder(); | |||||
carrentOrder.setName(orderBean.getName()); | |||||
carrentOrder.setPhone(orderBean.getPhone()); | |||||
carrentOrder.setCarId(orderBean.getCarId()); | |||||
String message = ""; | |||||
//预约信息验证 | |||||
if(StringUtils.isEmpty(carrentOrder.getName())){ | |||||
message = "联系人姓名未填写,请填写联系人姓名"; | |||||
}else if(StringUtils.isEmpty(carrentOrder.getPhone())){ | |||||
message = "联系人手机号未填写,请填写联系人手机号"; | |||||
}else if(StringUtils.isEmpty(carrentOrder.getCarId())){ | |||||
message = "预约商品id未填写,请填写预约商品id"; | |||||
}else { | |||||
//预约信息无误,进入业务流程处理 | |||||
return orderService.addOrder(carrentOrder); | |||||
} | |||||
//预约信息有误,返回错误信息 | |||||
return Result.error(message); | |||||
} | |||||
@ApiOperation(value="商品预约-联系电话", notes="商品预约-联系电话") | |||||
@RequestMapping(value = "/queryPhone", method = {RequestMethod.GET}) | |||||
public Result<?> queryPhone(){ | |||||
return orderService.queryPhone(); | |||||
} | |||||
} |
@ -0,0 +1,87 @@ | |||||
package org.jeecg.modules.api.carrentController; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang.StringUtils; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.UserBean; | |||||
import org.jeecg.modules.apiService.UserService; | |||||
import org.jeecg.modules.carrentUser.entity.CarrentUser; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RequestMethod; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.annotation.Resource; | |||||
@Api(tags="用户信息相关接口") | |||||
@RestController | |||||
@RequestMapping("/api/user") | |||||
@Slf4j | |||||
public class UserController { | |||||
//预约信息 | |||||
@Resource | |||||
private UserService userService; | |||||
/****************************************************************************************************/ | |||||
@ApiOperation(value="用户信息-个人注册", notes="用户信息-个人注册") | |||||
@RequestMapping(value = "/addUser", method = {RequestMethod.POST}) | |||||
public Result<?> addUser(UserBean userBean){ | |||||
//将注册信息注入到实体bean中 | |||||
CarrentUser carrentUser = new CarrentUser(); | |||||
carrentUser.setName(userBean.getName()); | |||||
carrentUser.setCerNo(userBean.getCerNo()); | |||||
carrentUser.setPhone(userBean.getPhone()); | |||||
carrentUser.setCerImage(userBean.getCerImage()); | |||||
String message = ""; | |||||
//注册信息验证 | |||||
if(StringUtils.isEmpty(carrentUser.getName())){ | |||||
message = "用户姓名未填写,请填写用户姓名!"; | |||||
}else if(StringUtils.isEmpty(carrentUser.getCerNo())){ | |||||
message = "身份证号码未填写,请填写身份证号码!"; | |||||
}else if(StringUtils.isEmpty(carrentUser.getPhone())){ | |||||
message = "联系方式未填写,请填写联系方式!"; | |||||
}else if(StringUtils.isEmpty(carrentUser.getCerImage())){ | |||||
message = "身份证正面照片未填写,请上传身份证正面照片!"; | |||||
}else { | |||||
//注册信息无误,进入业务流程处理 | |||||
return userService.addUser(carrentUser); | |||||
} | |||||
//注册信息有误,返回错误信息 | |||||
return Result.error(message); | |||||
} | |||||
@ApiOperation(value="用户信息-资料修改", notes="用户信息-资料修改") | |||||
@RequestMapping(value = "/updateUser", method = {RequestMethod.POST}) | |||||
public Result<?> updateUser(UserBean userBean){ | |||||
//将注册信息注入到实体bean中 | |||||
CarrentUser carrentUser = new CarrentUser(); | |||||
carrentUser.setName(userBean.getName()); | |||||
carrentUser.setCerNo(userBean.getCerNo()); | |||||
carrentUser.setPhone(userBean.getPhone()); | |||||
carrentUser.setCerImage(userBean.getCerImage()); | |||||
String message = ""; | |||||
//注册信息验证 | |||||
if(StringUtils.isEmpty(carrentUser.getName())){ | |||||
message = "用户姓名未填写,请填写用户姓名!"; | |||||
}else if(StringUtils.isEmpty(carrentUser.getCerNo())){ | |||||
message = "身份证号码未填写,请填写身份证号码!"; | |||||
}else if(StringUtils.isEmpty(carrentUser.getPhone())){ | |||||
message = "联系方式未填写,请填写联系方式!"; | |||||
}else if(StringUtils.isEmpty(carrentUser.getCerImage())){ | |||||
message = "身份证正面照片未填写,请上传身份证正面照片!"; | |||||
}else { | |||||
//注册信息无误,进入业务流程处理 | |||||
return userService.updateUser(carrentUser); | |||||
} | |||||
//注册信息有误,返回错误信息 | |||||
return Result.error(message); | |||||
} | |||||
} |
@ -0,0 +1,19 @@ | |||||
package org.jeecg.modules.apiBean; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
@Data | |||||
public class CarBean { | |||||
/**车辆公里数*/ | |||||
@Excel(name = "车辆公里数", width = 15) | |||||
@ApiModelProperty(value = "车辆公里数") | |||||
private java.lang.Integer mileage; | |||||
/**车辆类型*/ | |||||
@Excel(name = "车辆类型", width = 15) | |||||
@ApiModelProperty(value = "车辆类型") | |||||
private java.lang.String type; | |||||
} |
@ -0,0 +1,33 @@ | |||||
package org.jeecg.modules.apiBean; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
@Data | |||||
public class CompanyBean { | |||||
/**用户名*/ | |||||
@Excel(name = "用户名", width = 15) | |||||
@ApiModelProperty(value = "用户名") | |||||
private java.lang.String userName; | |||||
/**公司名称*/ | |||||
@Excel(name = "公司名称", width = 15) | |||||
@ApiModelProperty(value = "公司名称") | |||||
private java.lang.String companyName; | |||||
/**税收编码*/ | |||||
@Excel(name = "税收编码", width = 15) | |||||
@ApiModelProperty(value = "税收编码") | |||||
private java.lang.String taxCode; | |||||
/**公司地址*/ | |||||
@Excel(name = "公司地址", width = 15) | |||||
@ApiModelProperty(value = "公司地址") | |||||
private java.lang.String address; | |||||
/**联系电话*/ | |||||
@Excel(name = "联系电话", width = 15) | |||||
@ApiModelProperty(value = "联系电话") | |||||
private java.lang.String phone; | |||||
/**营业执照*/ | |||||
@Excel(name = "营业执照", width = 15) | |||||
@ApiModelProperty(value = "营业执照") | |||||
private java.lang.String businessLicense; | |||||
} |
@ -0,0 +1,33 @@ | |||||
package org.jeecg.modules.apiBean; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.jeecg.common.aspect.annotation.Dict; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
@Data | |||||
public class OrderBean { | |||||
/**姓名*/ | |||||
@Excel(name = "姓名", width = 15) | |||||
@ApiModelProperty(value = "姓名") | |||||
private java.lang.String name; | |||||
/**联系方式*/ | |||||
@Excel(name = "联系方式", width = 15) | |||||
@ApiModelProperty(value = "联系方式") | |||||
private java.lang.String phone; | |||||
/**所属区域*/ | |||||
@Excel(name = "所属区域", width = 15) | |||||
@ApiModelProperty(value = "所属区域") | |||||
private java.lang.String area; | |||||
/**详细地址*/ | |||||
@Excel(name = "详细地址", width = 15) | |||||
@ApiModelProperty(value = "详细地址") | |||||
private java.lang.String address; | |||||
/**关联商品*/ | |||||
@Excel(name = "关联商品", width = 15, dictTable = "carrent_car", dicText = "name", dicCode = "id") | |||||
@Dict(dictTable = "carrent_car", dicText = "name", dicCode = "id") | |||||
@ApiModelProperty(value = "关联商品") | |||||
private java.lang.String carId; | |||||
} |
@ -0,0 +1,19 @@ | |||||
package org.jeecg.modules.apiBean; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
@Data | |||||
public class PageBean { | |||||
/**显示条数*/ | |||||
@ApiModelProperty(value = "显示条数" ) | |||||
private Integer pageSize; | |||||
/**当前页*/ | |||||
@ApiModelProperty(value = "当前页" ) | |||||
private Integer pageNo; | |||||
public PageBean() { | |||||
this.pageNo = 1; | |||||
this.pageSize = 1000; | |||||
} | |||||
} |
@ -0,0 +1,25 @@ | |||||
package org.jeecg.modules.apiBean; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
@Data | |||||
public class UserBean { | |||||
/**姓名*/ | |||||
@Excel(name = "姓名", width = 15) | |||||
@ApiModelProperty(value = "姓名") | |||||
private java.lang.String name; | |||||
/**联系方式*/ | |||||
@Excel(name = "联系方式", width = 15) | |||||
@ApiModelProperty(value = "联系方式") | |||||
private java.lang.String phone; | |||||
/**身份证号码*/ | |||||
@Excel(name = "身份证号码", width = 15) | |||||
@ApiModelProperty(value = "身份证号码") | |||||
private java.lang.String cerNo; | |||||
/**身份证正面照*/ | |||||
@Excel(name = "身份证正面照", width = 15) | |||||
@ApiModelProperty(value = "身份证正面照") | |||||
private java.lang.String cerImage; | |||||
} |
@ -0,0 +1,24 @@ | |||||
package org.jeecg.modules.apiService; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.CarBean; | |||||
import org.jeecg.modules.apiBean.PageBean; | |||||
public interface CarService { | |||||
/** | |||||
* 首页-获取商品列表 | |||||
* @param carBean 车辆筛选信息 | |||||
* @param pageBean 分页信息 | |||||
* @return | |||||
*/ | |||||
public Result<?> queryCarList(CarBean carBean, PageBean pageBean); | |||||
/** | |||||
* 首页-根据id获取商品详情 | |||||
* @param carId 车辆编号 | |||||
* @return | |||||
*/ | |||||
public Result<?> queryCarById(String carId); | |||||
} |
@ -0,0 +1,17 @@ | |||||
package org.jeecg.modules.apiService; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.CompanyBean; | |||||
import org.jeecg.modules.apiBean.UserBean; | |||||
import org.jeecg.modules.carrentCompany.entity.CarrentCompany; | |||||
public interface CompanyService { | |||||
/** | |||||
* 企业信息-企业注册 | |||||
* @param carrentCompany 企业信息 | |||||
* @return | |||||
*/ | |||||
public Result<?> addCompany(CarrentCompany carrentCompany); | |||||
} |
@ -0,0 +1,22 @@ | |||||
package org.jeecg.modules.apiService; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.PageBean; | |||||
public interface NewsService { | |||||
/** | |||||
* 新闻资讯-获取新闻列表 | |||||
* @param pageBean 分页信息 | |||||
* @return | |||||
*/ | |||||
public Result<?> queryNewsList(PageBean pageBean); | |||||
/** | |||||
* 新闻资讯-根据id获取新闻详情 | |||||
* @param newsId 新闻id | |||||
* @return | |||||
*/ | |||||
public Result<?> queryNewsById(String newsId); | |||||
} |
@ -0,0 +1,22 @@ | |||||
package org.jeecg.modules.apiService; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.OrderBean; | |||||
import org.jeecg.modules.carrentOrder.entity.CarrentOrder; | |||||
public interface OrderService { | |||||
/** | |||||
* 商品预约-提交预约信息 | |||||
* @param carrentOrder 预约信息 | |||||
* @return | |||||
*/ | |||||
public Result<?> addOrder(CarrentOrder carrentOrder); | |||||
/** | |||||
* 商品预约-联系电话 | |||||
* @return | |||||
*/ | |||||
public Result<?> queryPhone(); | |||||
} |
@ -0,0 +1,24 @@ | |||||
package org.jeecg.modules.apiService; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.UserBean; | |||||
import org.jeecg.modules.carrentUser.entity.CarrentUser; | |||||
public interface UserService { | |||||
/** | |||||
* 用户信息-个人注册 | |||||
* @param carrentUser 用户信息 | |||||
* @return | |||||
*/ | |||||
public Result<?> addUser(CarrentUser carrentUser); | |||||
/** | |||||
* 用户信息-资料修改 | |||||
* @param carrentUser 用户信息 | |||||
* @return | |||||
*/ | |||||
public Result<?> updateUser(CarrentUser carrentUser); | |||||
} |
@ -0,0 +1,97 @@ | |||||
package org.jeecg.modules.apiService.impl; | |||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.CarBean; | |||||
import org.jeecg.modules.apiBean.PageBean; | |||||
import org.jeecg.modules.apiService.CarService; | |||||
import org.jeecg.modules.carrentCar.entity.CarrentCar; | |||||
import org.jeecg.modules.carrentCar.service.ICarrentCarService; | |||||
import org.springframework.stereotype.Service; | |||||
import javax.annotation.Resource; | |||||
@Service | |||||
public class CarServiceImpl implements CarService { | |||||
/*************************************************************************************/ | |||||
//车辆信息 | |||||
@Resource | |||||
private ICarrentCarService carrentCarService; | |||||
/*************************************************************************************/ | |||||
//首页-获取商品列表 | |||||
@Override | |||||
public Result<?> queryCarList(CarBean carBean, PageBean pageBean) { | |||||
//返回信息 | |||||
String message = "获取商品列表失败!"; | |||||
//商品列表 | |||||
Page<CarrentCar> pageList = null; | |||||
//分页信息 | |||||
Page<CarrentCar> page = null; | |||||
try{ | |||||
//分页 | |||||
page = new Page<CarrentCar>(pageBean.getPageNo(), pageBean.getPageSize()); | |||||
LambdaQueryChainWrapper<CarrentCar> query = carrentCarService.lambdaQuery(); | |||||
//组装查询条件 | |||||
if(null != carBean.getType()){ | |||||
query.eq(CarrentCar::getType, carBean.getType()); | |||||
} | |||||
if(null != carBean.getMileage()){ | |||||
query.eq(CarrentCar::getMileage, carBean.getMileage()); | |||||
} | |||||
//获取商品列表 | |||||
pageList = query.page(page); | |||||
//判断执行结果 | |||||
if(null != pageList){ | |||||
message = "商品列表信息"; | |||||
}else { | |||||
message = "商品列表信息为空"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message, pageList); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.error(message, pageList); | |||||
} | |||||
} | |||||
//首页-根据id获取商品详情 | |||||
@Override | |||||
public Result<?> queryCarById(String carId) { | |||||
//返回信息 | |||||
String message = "获取商品详情失败!"; | |||||
//商品详情 | |||||
CarrentCar one = null; | |||||
try{ | |||||
//获取商品信息详情 | |||||
one = carrentCarService.getById(carId); | |||||
//判断执行结果 | |||||
if(null != one){ | |||||
message = "商品详情信息"; | |||||
}else { | |||||
message = "商品详情信息为空"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message, one); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.error(message, one); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,49 @@ | |||||
package org.jeecg.modules.apiService.impl; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiService.CompanyService; | |||||
import org.jeecg.modules.carrentCompany.entity.CarrentCompany; | |||||
import org.jeecg.modules.carrentCompany.service.ICarrentCompanyService; | |||||
import org.springframework.stereotype.Service; | |||||
import javax.annotation.Resource; | |||||
@Service | |||||
public class CompanyServiceImpl implements CompanyService { | |||||
/*************************************************************************************/ | |||||
//企业信息 | |||||
@Resource | |||||
private ICarrentCompanyService carrentCompanyService; | |||||
/*************************************************************************************/ | |||||
//企业信息-企业注册 | |||||
@Override | |||||
public Result<?> addCompany(CarrentCompany carrentCompany) { | |||||
//返回信息 | |||||
String message = "企业注册失败"; | |||||
//执行结果 | |||||
boolean result = false; | |||||
try{ | |||||
//执行企业注册 | |||||
result = carrentCompanyService.save(carrentCompany); | |||||
//判断执行结果 | |||||
if(result){ | |||||
message = "企业注册成功!"; | |||||
}else { | |||||
message = "企业注册失败!"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.error(message); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,87 @@ | |||||
package org.jeecg.modules.apiService.impl; | |||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.PageBean; | |||||
import org.jeecg.modules.apiService.NewsService; | |||||
import org.jeecg.modules.carrentCar.entity.CarrentCar; | |||||
import org.jeecg.modules.carrentCompany.service.ICarrentCompanyService; | |||||
import org.jeecg.modules.carrentNews.entity.CarrentNews; | |||||
import org.jeecg.modules.carrentNews.service.ICarrentNewsService; | |||||
import org.springframework.stereotype.Service; | |||||
import javax.annotation.Resource; | |||||
@Service | |||||
public class NewsServiceImpl implements NewsService { | |||||
/*************************************************************************************/ | |||||
//新闻信息 | |||||
@Resource | |||||
private ICarrentNewsService carrentNewsService; | |||||
/*************************************************************************************/ | |||||
//新闻资讯-获取新闻列表 | |||||
@Override | |||||
public Result<?> queryNewsList(PageBean pageBean) { | |||||
//返回信息 | |||||
String message = "新闻列表查询失败!"; | |||||
//新闻列表 | |||||
Page<CarrentNews> pageList = null; | |||||
try{ | |||||
//分页 | |||||
Page<CarrentNews> page = new Page<CarrentNews>(pageBean.getPageNo(), pageBean.getPageSize()); | |||||
//获取新闻列表 | |||||
pageList = carrentNewsService | |||||
.lambdaQuery() | |||||
.page(page); | |||||
//判断执行结果 | |||||
if(null != pageList){ | |||||
message = "新闻列表信息"; | |||||
}else { | |||||
message = "新闻列表为空"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message, pageList); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.error(message, pageList); | |||||
} | |||||
} | |||||
//新闻资讯-根据id获取新闻详情 | |||||
@Override | |||||
public Result<?> queryNewsById(String newsId) { | |||||
//返回信息 | |||||
String message = "新闻详情查询失败!"; | |||||
//新闻详情 | |||||
CarrentNews one = null; | |||||
try{ | |||||
//获取新闻详情 | |||||
one = carrentNewsService.getById(newsId); | |||||
//判断执行结果 | |||||
if(null != one){ | |||||
message = "新闻详情信息"; | |||||
}else { | |||||
message = "新闻详情为空"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message, one); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.error(message, one); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,56 @@ | |||||
package org.jeecg.modules.apiService.impl; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiBean.OrderBean; | |||||
import org.jeecg.modules.apiService.OrderService; | |||||
import org.jeecg.modules.carrentOrder.entity.CarrentOrder; | |||||
import org.jeecg.modules.carrentOrder.service.ICarrentOrderService; | |||||
import org.springframework.stereotype.Service; | |||||
import javax.annotation.Resource; | |||||
@Service | |||||
public class OrderServiceImpl implements OrderService { | |||||
/*************************************************************************************/ | |||||
//预约信息 | |||||
@Resource | |||||
private ICarrentOrderService carrentOrderService; | |||||
/*************************************************************************************/ | |||||
//商品预约-提交预约信息 | |||||
@Override | |||||
public Result<?> addOrder(CarrentOrder carrentOrder) { | |||||
//返回信息 | |||||
String message = "预约信息提交失败"; | |||||
//执行结果 | |||||
boolean result = false; | |||||
try{ | |||||
//执行预约信息提交 | |||||
result = carrentOrderService.save(carrentOrder); | |||||
//判断执行结果 | |||||
if(result){ | |||||
message = "预约信息提交成功!"; | |||||
}else { | |||||
message = "预约信息提交失败!"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.error(message); | |||||
} | |||||
} | |||||
//商品预约-联系电话 | |||||
@Override | |||||
public Result<?> queryPhone() { | |||||
return Result.OK("联系电话", "17676767676"); | |||||
} | |||||
} |
@ -0,0 +1,79 @@ | |||||
package org.jeecg.modules.apiService.impl; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.apiService.UserService; | |||||
import org.jeecg.modules.carrentUser.entity.CarrentUser; | |||||
import org.jeecg.modules.carrentUser.service.ICarrentUserService; | |||||
import org.springframework.stereotype.Service; | |||||
import javax.annotation.Resource; | |||||
@Service | |||||
public class UserServiceImpl implements UserService { | |||||
/*************************************************************************************/ | |||||
//个人信息 | |||||
@Resource | |||||
private ICarrentUserService carrentUserService; | |||||
/*************************************************************************************/ | |||||
//用户信息-个人注册 | |||||
@Override | |||||
public Result<?> addUser(CarrentUser carrentUser) { | |||||
//返回信息 | |||||
String message = "个人注册失败"; | |||||
//执行结果 | |||||
boolean result = false; | |||||
try{ | |||||
//执行个人注册 | |||||
result = carrentUserService.save(carrentUser); | |||||
//判断执行结果 | |||||
if(result){ | |||||
message = "个人注册成功!"; | |||||
}else { | |||||
message = "个人注册失败!"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.OK(message); | |||||
} | |||||
} | |||||
//用户信息-资料修改 | |||||
@Override | |||||
public Result<?> updateUser(CarrentUser carrentUser) { | |||||
//返回信息 | |||||
String message = ""; | |||||
//执行结果 | |||||
boolean result = false; | |||||
try{ | |||||
//执行资料修改 | |||||
result = carrentUserService.updateById(carrentUser); | |||||
//判断执行结果 | |||||
if(result){ | |||||
message = "个人资料修改成功!"; | |||||
}else { | |||||
message = "个人资料修改失败!"; | |||||
} | |||||
//返回执行结果 | |||||
return Result.OK(message); | |||||
}catch (Exception e){ | |||||
//错误信息打印 | |||||
e.printStackTrace(); | |||||
return Result.error(message); | |||||
} | |||||
} | |||||
} |