Commit 7c6ccd01 authored by hanfeng's avatar hanfeng

修改车型列表接口,提供app和小程序接口

parent 7f8e774a
......@@ -32,7 +32,7 @@
where d.userid = #{userId} limit 1
</select>
<select id="selectAppUserManage" parameterType="com.github.wxiaoqi.security.admin.dto.AppUserDTO"
<select id="selectAppUserManage" parameterType="com.github.wxiaoqi.security.admin.dto.AppUserManageDTO"
resultType="com.github.wxiaoqi.security.admin.vo.AppUserManageVo">
select
d.userid,
......
......@@ -13,8 +13,10 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Delete;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
......@@ -49,8 +51,7 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@Override
@ApiOperation("添加")
@RequestMapping(value = "",method = RequestMethod.POST)
@ResponseBody
@RequestMapping(value = "/add",method = RequestMethod.POST)
public ObjectRestResponse<AppVersion> add(@RequestBody AppVersion appVersion){
baseBiz.insertAppVersion(appVersion);
return new ObjectRestResponse<AppVersion>();
......@@ -59,23 +60,20 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@ApiOperation("查询")
@RequestMapping(value = "/{id}",method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse<AppVersion> get(@PathVariable Integer id){
return ObjectRestResponse.succ(baseBiz.get(id));
}
@Override
@ApiOperation("修改")
@RequestMapping(value = "/{id}",method = RequestMethod.PUT)
@ResponseBody
@RequestMapping(value = "/update/{id}",method = RequestMethod.PUT)
public ObjectRestResponse<AppVersion> update(@RequestBody AppVersion appVersion){
baseBiz.updateAppVersionById(appVersion);
return new ObjectRestResponse<AppVersion>();
}
@ApiOperation("删除")
@RequestMapping(value = "/{id}",method = RequestMethod.DELETE)
@ResponseBody
@DeleteMapping(value = "/remove/{id}")
public ObjectRestResponse<AppVersion> remove(@PathVariable Integer id){
baseBiz.remove(id);
return new ObjectRestResponse<AppVersion>();
......
......@@ -57,6 +57,24 @@ public interface ThirdFeign {
@GetMapping("/LicensePlateType")
ObjectRestResponse getLicensePlateType();
/***************************************** 数据字典 ********************************************/
// @GetMapping(value = "/dictionary/getParents")
@RequestMapping(value = "/dictionary/getParents", method = RequestMethod.GET)
public ObjectRestResponse<List<Dictionary>> dictionaryGetParent(@RequestParam(value = "type") String type);
// @GetMapping(value = "/dictionary/get")
@RequestMapping(value = "/dictionary/get", method = RequestMethod.GET)
public ObjectRestResponse<List<Dictionary>> dictionaryGet(@RequestParam(value = "dictionary") Map<String, Object> dictionary);
@RequestMapping(value = "/dictionary/getAll4Map", method = RequestMethod.GET)
public ObjectRestResponse<Map<String, Dictionary>> dictionaryGetAll4Map();
/***************************************** 违章 ********************************************/
@GetMapping("/3p/tv/getRentViolation")
public ObjectRestResponse<List<ViolationVO>> getRentViolation(@RequestParam(value = "rentViolationDTO") Map<String, Object> rentViolationDTO);
}
......@@ -65,6 +65,12 @@ public interface VehicleFeign {
public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception ;
@GetMapping(value = "/goodList")
List<GoodDataVO> goodList(Integer page, Integer limit);
/**
* 获取优质车型接口
* @param page
* @param limit
* @return 返回
*/
@GetMapping(value = "/vehicleModel/goodList")
List<GoodDataVO> goodList(@RequestParam(value = "page") Integer page, @RequestParam("limit") Integer limit);
}
......@@ -96,28 +96,22 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
* @return
*/
@ApiOperation("车型列表")
@PostMapping(value = "/app/findVehicleModelPage")
public ObjectRestResponse<VehicleModelVo> findVehicleModelPage(
@PostMapping(value = "/app/unauthfind/VehicleModelPage")
public ObjectRestResponse<VehicleModelVo> findVehicleModelPageUnauthfind(
@RequestBody @ApiParam("查询条件") VehicleModelQueryCondition vmqc ,HttpServletRequest request) {
// UserDTO user = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
//
// if (user!=null) {
// if (user.getDataAll()==2) {
//
// }
// }
if (vmqc.getIsDel()==null) {
vmqc.setIsDel(0);
}
if (vmqc == null || vmqc.getPage() == null || vmqc.getLimit() == null || vmqc.getPage() < 0 || vmqc.getLimit() <= 0) {
return ObjectRestResponse.createDefaultFail();
}
return vehicleModelBiz.findVehicleModelPage(vmqc);
}
/**
* 添加车型
*
......@@ -257,22 +251,6 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
@Transactional
public ObjectRestResponse<VehicleModel> remove(@PathVariable int id) {
//1.先判断是否有属于该车型可用的车辆,有不能删除,无可以进行删除
//根据车型查询对应的车辆
// Example exa = Example.builder(Vehicle.class).where(
// WeekendSqls.<Vehicle>custom()
// .andEqualTo(Vehicle::getModelId, id)
// .andEqualTo(Vehicle::getStatus, 1)
// .orEqualTo(Vehicle::getStatus,"2")
// ).build();
//
// List<Vehicle> vehicles = vehicleBiz.selectByExample(exa);
//
// //判断是查询到对应的车辆
// if (vehicles != null) {
// ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "该车型,无法删除");
// }
if (id==1||id==14) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,"The label cannot be deleted");
}
......@@ -306,9 +284,31 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
@ApiOperation("查询所有")
@GetMapping(value = "/goodList")
public List<GoodDataVO> goodList(Integer page, Integer limit){
public List<GoodDataVO> goodList(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit){
return baseBiz.goodList(page,limit);
}
/**
* 车型列表查
*
* @param vmqc 条件
* @return
*/
@ApiOperation("车型列表")
@PostMapping(value = "/app/VehicleModelPage")
public ObjectRestResponse<VehicleModelVo> findVehicleModelPage(
@RequestBody @ApiParam("查询条件") VehicleModelQueryCondition vmqc ,HttpServletRequest request) {
if (vmqc.getIsDel()==null) {
vmqc.setIsDel(0);
}
if (vmqc == null || vmqc.getPage() == null || vmqc.getLimit() == null || vmqc.getPage() < 0 || vmqc.getLimit() <= 0) {
return ObjectRestResponse.createDefaultFail();
}
return vehicleModelBiz.findVehicleModelPage(vmqc);
}
}
\ No newline at end of file
......@@ -13,8 +13,6 @@ public class TimedTaskTest {
public static void main(String[] args) {
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
executorService.scheduleWithFixedDelay(new MyRunnable(),0,4000,TimeUnit.MILLISECONDS);
executorService.
}
// @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment