Commit 6b65b870 by lpx

# 商家管理端飞机相关接口

parent 8650490c
package com.jumeirah.api.merchant.controller.order;
import com.jumeirah.common.entity.PlainType;
import com.jumeirah.common.service.PlainTypeService;
import com.jumeirah.common.vo.PlainTypeQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 飞机型号表 控制器
*
* @author wei
* @since 2020-10-09
*/
@Slf4j
@RestController
@RequestMapping("/merchant/plainType")
@Module("${cfg.module}")
@Api(value = "飞机型号表API", tags = {"飞机型号"})
public class McPlainTypeController extends BaseController {
@Autowired
private PlainTypeService plainTypeService;
/**
* 获取飞机型号列表
*/
@GetMapping("/getAllList")
@OperationLog(name = "获取飞机型号列表", type = OperationLogType.PAGE)
@ApiOperation(value = "获取飞机型号列表", response = PlainTypeQueryVo.class)
// @RequiresPermissions("merchant:aircraft:management:view")
public ApiResult<List<PlainType> > getAllList() throws Exception {
List<PlainType> plainTypeList = plainTypeService.getAllMap();
return ApiResult.ok(plainTypeList);
}
}
...@@ -46,6 +46,7 @@ public class McStrokeController extends BaseController { ...@@ -46,6 +46,7 @@ public class McStrokeController extends BaseController {
@PostMapping("/complete") @PostMapping("/complete")
@OperationLog(name = "完成行程接口", type = OperationLogType.UPDATE) @OperationLog(name = "完成行程接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "完成行程接口", response = ApiResult.class) @ApiOperation(value = "完成行程接口", response = ApiResult.class)
// @RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> completeStroke(@Validated @RequestBody StrokeCompleteParam strokeCompleteParam) throws Exception { public ApiResult<Boolean> completeStroke(@Validated @RequestBody StrokeCompleteParam strokeCompleteParam) throws Exception {
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
stroke.setId(strokeCompleteParam.getId()) stroke.setId(strokeCompleteParam.getId())
...@@ -60,6 +61,7 @@ public class McStrokeController extends BaseController { ...@@ -60,6 +61,7 @@ public class McStrokeController extends BaseController {
@PostMapping("/getPageList") @PostMapping("/getPageList")
@OperationLog(name = "行程分页列表", type = OperationLogType.PAGE) @OperationLog(name = "行程分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "行程分页列表") @ApiOperation(value = "行程分页列表")
// @RequiresPermissions("merchant:order:view")
public ApiResult<Paging<McStrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody McStrokePageParam mcStrokePageParam) throws Exception { public ApiResult<Paging<McStrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody McStrokePageParam mcStrokePageParam) throws Exception {
Paging<McStrokeQueryVo> paging = strokeService.getMcStrokePageList(mcStrokePageParam); Paging<McStrokeQueryVo> paging = strokeService.getMcStrokePageList(mcStrokePageParam);
return ApiResult.ok(paging); return ApiResult.ok(paging);
...@@ -71,6 +73,7 @@ public class McStrokeController extends BaseController { ...@@ -71,6 +73,7 @@ public class McStrokeController extends BaseController {
@PostMapping("/update/quotedPrice") @PostMapping("/update/quotedPrice")
@OperationLog(name = "行程报价接口", type = OperationLogType.UPDATE) @OperationLog(name = "行程报价接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "行程报价接口", response = ApiResult.class) @ApiOperation(value = "行程报价接口", response = ApiResult.class)
// @RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> updateStroke(@Validated @RequestBody StrokeQuotedPriceParam strokeQuotedPriceParam) throws Exception { public ApiResult<Boolean> updateStroke(@Validated @RequestBody StrokeQuotedPriceParam strokeQuotedPriceParam) throws Exception {
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeQuotedPriceParam, stroke); BeanUtils.copyProperties(strokeQuotedPriceParam, stroke);
...@@ -84,6 +87,7 @@ public class McStrokeController extends BaseController { ...@@ -84,6 +87,7 @@ public class McStrokeController extends BaseController {
@PostMapping("/discount/check") @PostMapping("/discount/check")
@OperationLog(name = "优惠调机审核接口", type = OperationLogType.UPDATE) @OperationLog(name = "优惠调机审核接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "优惠调机审核接口", response = ApiResult.class) @ApiOperation(value = "优惠调机审核接口", response = ApiResult.class)
// @RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> checkStrokeDiscount(@Validated @RequestBody StrokeDiscountCheckParam strokeDiscountCheckParam) throws Exception { public ApiResult<Boolean> checkStrokeDiscount(@Validated @RequestBody StrokeDiscountCheckParam strokeDiscountCheckParam) throws Exception {
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
stroke.setId(strokeDiscountCheckParam.getId()) stroke.setId(strokeDiscountCheckParam.getId())
...@@ -98,6 +102,7 @@ public class McStrokeController extends BaseController { ...@@ -98,6 +102,7 @@ public class McStrokeController extends BaseController {
@PostMapping("/confirmPayment") @PostMapping("/confirmPayment")
@OperationLog(name = "优惠调机审核接口", type = OperationLogType.UPDATE) @OperationLog(name = "优惠调机审核接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "优惠调机审核接口", response = ApiResult.class) @ApiOperation(value = "优惠调机审核接口", response = ApiResult.class)
// @RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> confirmPaymentStroke(@Validated @RequestBody StrokeConfirmPaymentParam strokeConfirmPaymentParam) throws Exception { public ApiResult<Boolean> confirmPaymentStroke(@Validated @RequestBody StrokeConfirmPaymentParam strokeConfirmPaymentParam) throws Exception {
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
stroke.setId(strokeConfirmPaymentParam.getId()) stroke.setId(strokeConfirmPaymentParam.getId())
......
package com.jumeirah.api.merchant.controller.plain;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.param.McPlainQueryVo;
import com.jumeirah.common.service.McPlainService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 商家飞机表 控制器
*
* @author xxx
* @since 2020-10-19
*/
@Slf4j
@RestController
@RequestMapping("/mcPlain")
@Api(value = "商家飞机表API", tags = {"商家飞机表"})
public class McPlainController extends BaseController {
@Autowired
private McPlainService mcPlainService;
/**
* 添加商家飞机表
*/
@PostMapping("/add")
@OperationLog(name = "添加商家飞机表", type = OperationLogType.ADD)
@ApiOperation(value = "添加商家飞机表")
public ApiResult<Boolean> addMcPlain(@Validated(Add.class) @RequestBody McPlain mcPlain) throws Exception {
boolean flag = mcPlainService.saveMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 修改商家飞机表
*/
@PostMapping("/update")
@OperationLog(name = "修改商家飞机表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改商家飞机表")
public ApiResult<Boolean> updateMcPlain(@Validated(Update.class) @RequestBody McPlain mcPlain) throws Exception {
boolean flag = mcPlainService.updateMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 删除商家飞机表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除商家飞机表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除商家飞机表")
public ApiResult<Boolean> deleteMcPlain(@PathVariable("id") Long id) throws Exception {
boolean flag = mcPlainService.deleteMcPlain(id);
return ApiResult.result(flag);
}
/**
* 获取商家飞机表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "商家飞机表详情", type = OperationLogType.INFO)
@ApiOperation(value = "商家飞机表详情")
public ApiResult<McPlainQueryVo> getMcPlain(@PathVariable("id") Long id) throws Exception {
McPlainQueryVo mcPlainQueryVo = mcPlainService.getMcPlainById(id);
return ApiResult.ok(mcPlainQueryVo);
}
/**
* 商家飞机表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "商家飞机表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "商家飞机表分页列表")
public ApiResult<Paging<McPlainQueryVo>> getMcPlainPageList(@Validated @RequestBody McPlainPageParam mcPlainPageParam) throws Exception {
Paging<McPlainQueryVo> paging = mcPlainService.getMcPlainPageList(mcPlainPageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.common.controller;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.param.McPlainQueryVo;
import com.jumeirah.common.service.McPlainService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* 商家飞机表 控制器
*
* @author xxx
* @since 2020-10-19
*/
/*@Slf4j
@RestController
@RequestMapping("/mcPlain")
@Api(value = "商家飞机表API", tags = {"商家飞机表"})*/
public class McPlainController extends BaseController {
@Autowired
private McPlainService mcPlainService;
/**
* 添加商家飞机表
*/
@PostMapping("/add")
@OperationLog(name = "添加商家飞机表", type = OperationLogType.ADD)
@ApiOperation(value = "添加商家飞机表")
public ApiResult<Boolean> addMcPlain(@Validated(Add.class) @RequestBody McPlain mcPlain) throws Exception {
boolean flag = mcPlainService.saveMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 修改商家飞机表
*/
@PostMapping("/update")
@OperationLog(name = "修改商家飞机表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改商家飞机表")
public ApiResult<Boolean> updateMcPlain(@Validated(Update.class) @RequestBody McPlain mcPlain) throws Exception {
boolean flag = mcPlainService.updateMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 删除商家飞机表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除商家飞机表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除商家飞机表")
public ApiResult<Boolean> deleteMcPlain(@PathVariable("id") Long id) throws Exception {
boolean flag = mcPlainService.deleteMcPlain(id);
return ApiResult.result(flag);
}
/**
* 获取商家飞机表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "商家飞机表详情", type = OperationLogType.INFO)
@ApiOperation(value = "商家飞机表详情")
public ApiResult<McPlainQueryVo> getMcPlain(@PathVariable("id") Long id) throws Exception {
McPlainQueryVo mcPlainQueryVo = mcPlainService.getMcPlainById(id);
return ApiResult.ok(mcPlainQueryVo);
}
/**
* 商家飞机表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "商家飞机表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "商家飞机表分页列表")
public ApiResult<Paging<McPlainQueryVo>> getMcPlainPageList(@Validated @RequestBody McPlainPageParam mcPlainPageParam) throws Exception {
Paging<McPlainQueryVo> paging = mcPlainService.getMcPlainPageList(mcPlainPageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
/**
* 商家飞机表
*
* @author xxx
* @since 2020-10-19
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "McPlain对象")
public class McPlain extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotNull(message = "飞机类型ID不能为空")
@ApiModelProperty("飞机类型ID")
private Long ptId;
@NotNull(message = "状态,0-正常,1-禁用,99-删除不能为空")
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
@NotNull(message = "创建时间(时间戳)不能为空")
@ApiModelProperty("创建时间(时间戳)")
private Long createTime;
@ApiModelProperty("更新时间(时间戳)")
private Long updateTime;
@NotNull(message = "商家ID不能为空")
@ApiModelProperty("商家ID")
private Long mcId;
@NotNull(message = "数量不能为空")
@ApiModelProperty("数量")
private Integer amount;
@NotNull(message = "所在地城市ID不能为空")
@ApiModelProperty("所在地城市ID")
private Long cityId;
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.param.McPlainQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
/**
* 商家飞机表 Mapper 接口
*
* @author xxx
* @since 2020-10-19
*/
@Repository
public interface McPlainMapper extends BaseMapper<McPlain> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
McPlainQueryVo getMcPlainById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param mcPlainPageParam
* @return
*/
IPage<McPlainQueryVo> getMcPlainPageList(@Param("page") Page page, @Param("param") McPlainPageParam mcPlainPageParam);
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* 商家飞机表 分页参数对象
* </pre>
*
* @author xxx
* @date 2020-10-19
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商家飞机表分页参数")
public class McPlainPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <pre>
* 商家飞机表 查询结果对象
* </pre>
*
* @author xxx
* @date 2020-10-19
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "McPlainQueryVo对象")
public class McPlainQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("飞机类型ID")
private Long ptId;
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
@ApiModelProperty("创建时间(时间戳)")
private Long createTime;
@ApiModelProperty("更新时间(时间戳)")
private Long updateTime;
@ApiModelProperty("商家ID")
private Long mcId;
@ApiModelProperty("数量")
private Integer amount;
@ApiModelProperty("所在地城市ID")
private Long cityId;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import com.jumeirah.common.param.McPlainQueryVo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 商家飞机表 服务类
*
* @author xxx
* @since 2020-10-19
*/
public interface McPlainService extends BaseService<McPlain> {
/**
* 保存
*
* @param mcPlain
* @return
* @throws Exception
*/
boolean saveMcPlain(McPlain mcPlain) throws Exception;
/**
* 修改
*
* @param mcPlain
* @return
* @throws Exception
*/
boolean updateMcPlain(McPlain mcPlain) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteMcPlain(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
McPlainQueryVo getMcPlainById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param mcPlainPageParam
* @return
* @throws Exception
*/
Paging<McPlainQueryVo> getMcPlainPageList(McPlainPageParam mcPlainPageParam) throws Exception;
}
package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.mapper.McPlainMapper;
import com.jumeirah.common.service.McPlainService;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.param.McPlainQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 商家飞机表 服务实现类
*
* @author xxx
* @since 2020-10-19
*/
@Slf4j
@Service
public class McPlainServiceImpl extends BaseServiceImpl<McPlainMapper, McPlain> implements McPlainService {
@Autowired
private McPlainMapper mcPlainMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveMcPlain(McPlain mcPlain) throws Exception {
return super.save(mcPlain);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateMcPlain(McPlain mcPlain) throws Exception {
return super.updateById(mcPlain);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteMcPlain(Long id) throws Exception {
return super.removeById(id);
}
@Override
public McPlainQueryVo getMcPlainById(Long id) throws Exception {
return mcPlainMapper.getMcPlainById(id);
}
@Override
public Paging<McPlainQueryVo> getMcPlainPageList(McPlainPageParam mcPlainPageParam) throws Exception {
Page<McPlainQueryVo> page = new PageInfo<>(mcPlainPageParam, OrderItem.desc(getLambdaColumn(McPlain::getCreateTime)));
IPage<McPlainQueryVo> iPage = mcPlainMapper.getMcPlainPageList(page, mcPlainPageParam);
return new Paging<McPlainQueryVo>(iPage);
}
}
<?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">
<mapper namespace="com.jumeirah.common.mapper.McPlainMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, pt_id, status, create_time, update_time, mc_id, amount, city_id
</sql>
<select id="getMcPlainById" resultType="com.jumeirah.common.param.McPlainQueryVo">
select
<include refid="Base_Column_List"/>
from mc_plain where id = #{id}
</select>
<select id="getMcPlainPageList" parameterType="com.jumeirah.common.param.McPlainPageParam"
resultType="com.jumeirah.common.param.McPlainQueryVo">
select
<include refid="Base_Column_List"/>
from mc_plain
</select>
</mapper>
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