Commit d77daa33 by lanpingxiong

Merge branch 'dev/lanpingxiong' into 'master'

Dev/lanpingxiong

See merge request hewei/Jumeirah!22
parents cf7e82e7 61296735
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.jumeirah.api.app.entity.vo.StrokeAddBackAndForthVo; import com.jumeirah.api.app.entity.param.StrokeAddBackAndForthParam;
import com.jumeirah.api.app.entity.vo.StrokeAddFreightVo; import com.jumeirah.api.app.entity.param.StrokeAddFreightParam;
import com.jumeirah.api.app.entity.vo.StrokeAddMedicalTreatmentVo; import com.jumeirah.api.app.entity.param.StrokeAddMedicalTreatmentParam;
import com.jumeirah.api.app.entity.vo.StrokeAddOneWayVo; import com.jumeirah.api.app.entity.param.StrokeAddOneWayParam;
import com.jumeirah.api.app.entity.param.StrokeDiscountParam;
import com.jumeirah.common.constant.Constant; import com.jumeirah.common.constant.Constant;
import com.jumeirah.common.entity.Stroke; import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.enums.StatePaymentStatusEnum; import com.jumeirah.common.enums.StatePaymentStatusEnum;
import com.jumeirah.common.param.StrokePageParam; import com.jumeirah.common.param.StrokePageParam;
import com.jumeirah.common.param.app.StrokePaymentInfoParam; import com.jumeirah.common.param.app.StrokePaymentInfoParam;
import com.jumeirah.common.service.StrokeDiscountService;
import com.jumeirah.common.service.StrokeService; import com.jumeirah.common.service.StrokeService;
import com.jumeirah.common.vo.StrokeDetailVo; import com.jumeirah.common.vo.StrokeDetailVo;
import com.jumeirah.common.vo.StrokeDiscountQueryVo;
import com.jumeirah.common.vo.StrokeQueryVo; import com.jumeirah.common.vo.StrokeQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
...@@ -49,7 +52,8 @@ public class StrokeController extends BaseController { ...@@ -49,7 +52,8 @@ public class StrokeController extends BaseController {
@Autowired @Autowired
private StrokeService strokeService; private StrokeService strokeService;
@Autowired
private StrokeDiscountService strokeDiscountService;
/** /**
* 填写付款信息 * 填写付款信息
*/ */
...@@ -75,10 +79,10 @@ public class StrokeController extends BaseController { ...@@ -75,10 +79,10 @@ public class StrokeController extends BaseController {
@PostMapping("/add/oneWay") @PostMapping("/add/oneWay")
@OperationLog(name = "添加单程行程表", type = OperationLogType.ADD) @OperationLog(name = "添加单程行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加单程行程表", response = ApiResult.class) @ApiOperation(value = "添加单程行程表", response = ApiResult.class)
public ApiResult<Boolean> addOneWayStroke(@Validated @RequestBody StrokeAddOneWayVo strokeAddOneWayVo) throws Exception { public ApiResult<Boolean> addOneWayStroke(@Validated @RequestBody StrokeAddOneWayParam strokeAddOneWayParam) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddOneWayVo, stroke); BeanUtils.copyProperties(strokeAddOneWayParam, stroke);
stroke.setType(0) stroke.setType(0)
.setMoney(new BigDecimal("0")) .setMoney(new BigDecimal("0"))
.setMcId(Constant.MC_ID) .setMcId(Constant.MC_ID)
...@@ -93,10 +97,10 @@ public class StrokeController extends BaseController { ...@@ -93,10 +97,10 @@ public class StrokeController extends BaseController {
@PostMapping("/add/backAndForth") @PostMapping("/add/backAndForth")
@OperationLog(name = "添加往返行程表", type = OperationLogType.ADD) @OperationLog(name = "添加往返行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加往返行程表", response = ApiResult.class) @ApiOperation(value = "添加往返行程表", response = ApiResult.class)
public ApiResult<Boolean> addBackAndForthStroke(@Validated @RequestBody StrokeAddBackAndForthVo strokeAddBackAndForthVo) throws Exception { public ApiResult<Boolean> addBackAndForthStroke(@Validated @RequestBody StrokeAddBackAndForthParam strokeAddBackAndForthParam) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddBackAndForthVo, stroke); BeanUtils.copyProperties(strokeAddBackAndForthParam, stroke);
stroke.setType(1) stroke.setType(1)
.setMoney(new BigDecimal("0")) .setMoney(new BigDecimal("0"))
.setMcId(Constant.MC_ID) .setMcId(Constant.MC_ID)
...@@ -111,10 +115,10 @@ public class StrokeController extends BaseController { ...@@ -111,10 +115,10 @@ public class StrokeController extends BaseController {
@PostMapping("/add/freight") @PostMapping("/add/freight")
@OperationLog(name = "添加货运行程表", type = OperationLogType.ADD) @OperationLog(name = "添加货运行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加货运行程表", response = ApiResult.class) @ApiOperation(value = "添加货运行程表", response = ApiResult.class)
public ApiResult<Boolean> addFreightStroke(@Validated @RequestBody StrokeAddFreightVo strokeAddFreightVo) throws Exception { public ApiResult<Boolean> addFreightStroke(@Validated @RequestBody StrokeAddFreightParam strokeAddFreightParam) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddFreightVo, stroke); BeanUtils.copyProperties(strokeAddFreightParam, stroke);
stroke.setType(2) stroke.setType(2)
.setMoney(new BigDecimal("0")) .setMoney(new BigDecimal("0"))
.setMcId(Constant.MC_ID) .setMcId(Constant.MC_ID)
...@@ -130,10 +134,10 @@ public class StrokeController extends BaseController { ...@@ -130,10 +134,10 @@ public class StrokeController extends BaseController {
@OperationLog(name = "添加医疗行程表", type = OperationLogType.ADD) @OperationLog(name = "添加医疗行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加医疗行程表", response = ApiResult.class) @ApiOperation(value = "添加医疗行程表", response = ApiResult.class)
public ApiResult<Boolean> addMedicalTreatmentStroke( public ApiResult<Boolean> addMedicalTreatmentStroke(
@Validated @RequestBody StrokeAddMedicalTreatmentVo strokeAddMedicalTreatmentVo) throws Exception { @Validated @RequestBody StrokeAddMedicalTreatmentParam strokeAddMedicalTreatmentParam) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddMedicalTreatmentVo, stroke); BeanUtils.copyProperties(strokeAddMedicalTreatmentParam, stroke);
stroke.setType(3) stroke.setType(3)
.setMoney(new BigDecimal("0")) .setMoney(new BigDecimal("0"))
.setMcId(Constant.MC_ID) .setMcId(Constant.MC_ID)
...@@ -142,6 +146,29 @@ public class StrokeController extends BaseController { ...@@ -142,6 +146,29 @@ public class StrokeController extends BaseController {
return ApiResult.result(flag); return ApiResult.result(flag);
} }
/**
* 添加优惠调机行程
*/
@PostMapping("/add/discount")
@OperationLog(name = "添加优惠调机行程", type = OperationLogType.ADD)
@ApiOperation(value = "添加优惠调机行程", response = ApiResult.class)
public ApiResult<Boolean> addOneWayStroke(@Validated @RequestBody StrokeDiscountParam strokeDiscountParam) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
StrokeDiscountQueryVo strokeDiscountQueryVo = strokeDiscountService.getStrokeDiscountById(strokeDiscountParam.getSdId());
Stroke stroke = new Stroke();
stroke.setType(4)
.setCityOutsetId(strokeDiscountQueryVo.getCityOutsetId())
.setCityArriveId(strokeDiscountQueryVo.getCityArriveId())
.setPeopleNum(strokeDiscountParam.getPeopleNum())
.setPlainTypeId(strokeDiscountQueryVo.getPlainTypeId())
.setOutsetTime(strokeDiscountParam.getOutsetTime())
.setMoney(strokeDiscountQueryVo.getMoney())
.setMcId(strokeDiscountQueryVo.getMcId())
.setUserId(jwtToken.getUserId());
boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag);
}
// /** // /**
// * 修改行程表 // * 修改行程表
......
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.jumeirah.common.entity.StrokeDiscount;
import com.jumeirah.common.param.StrokeDiscountPageParam; import com.jumeirah.common.param.StrokeDiscountPageParam;
import com.jumeirah.common.service.StrokeDiscountService; import com.jumeirah.common.service.StrokeDiscountService;
import com.jumeirah.common.vo.StrokeDiscountQueryVo; import com.jumeirah.common.vo.StrokeDiscountQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType; import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -36,18 +34,6 @@ public class StrokeDiscountController extends BaseController { ...@@ -36,18 +34,6 @@ public class StrokeDiscountController extends BaseController {
private StrokeDiscountService strokeDiscountService; private StrokeDiscountService strokeDiscountService;
/** /**
* 添加优惠行程表
*/
@PostMapping("/add")
@OperationLog(name = "添加优惠行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加优惠行程表")
public ApiResult<Boolean> addStrokeDiscount(@Validated(Add.class) @RequestBody StrokeDiscount strokeDiscount) throws Exception {
boolean flag = strokeDiscountService.saveStrokeDiscount(strokeDiscount);
return ApiResult.result(flag);
}
/**
* 优惠行程表分页列表 * 优惠行程表分页列表
*/ */
@PostMapping("/getPageList") @PostMapping("/getPageList")
......
package com.jumeirah.api.app.entity.vo; package com.jumeirah.api.app.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity; import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -20,7 +20,7 @@ import java.sql.Timestamp; ...@@ -20,7 +20,7 @@ import java.sql.Timestamp;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加返程行程入参对象") @ApiModel(value = "添加返程行程入参对象")
public class StrokeAddBackAndForthVo extends BaseEntity { public class StrokeAddBackAndForthParam extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空") @NotNull(message = "出发城市id不能为空")
......
package com.jumeirah.api.app.entity.vo; package com.jumeirah.api.app.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity; import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -21,7 +21,7 @@ import java.sql.Timestamp; ...@@ -21,7 +21,7 @@ import java.sql.Timestamp;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加货运行程入参对象") @ApiModel(value = "添加货运行程入参对象")
public class StrokeAddFreightVo extends BaseEntity { public class StrokeAddFreightParam extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空") @NotNull(message = "出发城市id不能为空")
......
package com.jumeirah.api.app.entity.vo; package com.jumeirah.api.app.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity; import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -21,7 +21,7 @@ import java.sql.Timestamp; ...@@ -21,7 +21,7 @@ import java.sql.Timestamp;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加医疗行程入参对象") @ApiModel(value = "添加医疗行程入参对象")
public class StrokeAddMedicalTreatmentVo extends BaseEntity { public class StrokeAddMedicalTreatmentParam extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空") @NotNull(message = "出发城市id不能为空")
......
package com.jumeirah.api.app.entity.vo; package com.jumeirah.api.app.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity; import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -20,7 +20,7 @@ import java.sql.Timestamp; ...@@ -20,7 +20,7 @@ import java.sql.Timestamp;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "添加单程行程入参对象") @ApiModel(value = "添加单程行程入参对象")
public class StrokeAddOneWayVo extends BaseEntity { public class StrokeAddOneWayParam extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空") @NotNull(message = "出发城市id不能为空")
......
package com.jumeirah.api.app.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
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;
import java.sql.Timestamp;
/**
* 优惠行程表
*
* @author xxx
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "StrokeDiscount对象")
public class StrokeDiscountParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "优惠行程id不能为空")
@ApiModelProperty("优惠行程ID")
private Long sdId;
@NotNull(message = "人数不能为空")
@ApiModelProperty("人数")
private Integer peopleNum;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Timestamp outsetTime;
}
...@@ -67,7 +67,7 @@ public class Stroke extends BaseEntity { ...@@ -67,7 +67,7 @@ public class Stroke extends BaseEntity {
private Timestamp returnTime; private Timestamp returnTime;
@NotNull(message = "行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空") @NotNull(message = "行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空")
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗") @ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗,4-优惠调机")
private Integer type; private Integer type;
@NotNull(message = "状态,0-审核中,1-进行中,2-已完成,99-取消不能为空") @NotNull(message = "状态,0-审核中,1-进行中,2-已完成,99-取消不能为空")
......
package com.jumeirah.common.entity; package com.jumeirah.common.entity;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import io.geekidea.springbootplus.framework.core.validator.groups.Update; import java.sql.Timestamp;
/** /**
* 优惠行程表 * 优惠行程表
...@@ -23,10 +23,10 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update; ...@@ -23,10 +23,10 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "StrokeDiscount对象") @ApiModel(value = "StrokeDiscount对象")
public class StrokeDiscount extends BaseEntity { public class StrokeDiscount extends BaseEntity {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class}) @NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID") @ApiModelProperty("主键ID")
...@@ -51,7 +51,7 @@ private static final long serialVersionUID=1L; ...@@ -51,7 +51,7 @@ private static final long serialVersionUID=1L;
@NotNull(message = "座位数不能为空") @NotNull(message = "座位数不能为空")
@ApiModelProperty("座位数") @ApiModelProperty("座位数")
private Integer seatMun; private Integer seatNum;
@NotNull(message = "飞机型号ID不能为空") @NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID") @ApiModelProperty("飞机型号ID")
...@@ -59,10 +59,10 @@ private static final long serialVersionUID=1L; ...@@ -59,10 +59,10 @@ private static final long serialVersionUID=1L;
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Date outsetTime; private Timestamp outsetTime;
@ApiModelProperty("返程时间") @ApiModelProperty("返程时间")
private Date returnTime; private Timestamp returnTime;
@NotNull(message = "状态,0-正常,1-完成,99-删除不能为空") @NotNull(message = "状态,0-正常,1-完成,99-删除不能为空")
@ApiModelProperty("状态,0-正常,1-完成,99-删除") @ApiModelProperty("状态,0-正常,1-完成,99-删除")
...@@ -70,19 +70,19 @@ private static final long serialVersionUID=1L; ...@@ -70,19 +70,19 @@ private static final long serialVersionUID=1L;
@NotNull(message = "创建时间不能为空") @NotNull(message = "创建时间不能为空")
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Long createTime; private Timestamp createTime;
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Long updateTime; private Timestamp updateTime;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remarks; private String remarks;
@ApiModelProperty("价格,单位:分") @ApiModelProperty("价格")
private Long money; private BigDecimal money;
@NotNull(message = "商家ID不能为空") @NotNull(message = "商家ID不能为空")
@ApiModelProperty("商家ID") @ApiModelProperty("商家ID")
private Long mcuId; private Long mcId;
} }
...@@ -39,9 +39,15 @@ public interface StrokeMapper extends BaseMapper<Stroke> { ...@@ -39,9 +39,15 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
* @return * @return
*/ */
IPage<StrokeQueryVo> getStrokePageList(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId); IPage<StrokeQueryVo> getStrokePageList(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId);
IPage<StrokeQueryVo> getStrokePageListWithFinsh(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId);
/**
* 查询已完成行程
* @param page
* @param strokePageParam
* @param userId
* @return
*/
IPage<StrokeQueryVo> getStrokePageListWithFinish(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId);
/** /**
* 商家端 获取行程分页对象 * 商家端 获取行程分页对象
......
...@@ -3,15 +3,15 @@ package com.jumeirah.common.service.impl; ...@@ -3,15 +3,15 @@ package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.StrokeDiscount; import com.jumeirah.common.entity.StrokeDiscount;
import com.jumeirah.common.mapper.StrokeDiscountMapper; import com.jumeirah.common.mapper.StrokeDiscountMapper;
import com.jumeirah.common.service.StrokeDiscountService; import com.jumeirah.common.service.StrokeDiscountService;
import com.jumeirah.common.param.StrokeDiscountPageParam; import com.jumeirah.common.param.StrokeDiscountPageParam;
import com.jumeirah.common.vo.StrokeDiscountQueryVo; import com.jumeirah.common.vo.StrokeDiscountQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl; import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo; import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -26,37 +26,37 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -26,37 +26,37 @@ import org.springframework.beans.factory.annotation.Autowired;
@Service @Service
public class StrokeDiscountServiceImpl extends BaseServiceImpl<StrokeDiscountMapper, StrokeDiscount> implements StrokeDiscountService { public class StrokeDiscountServiceImpl extends BaseServiceImpl<StrokeDiscountMapper, StrokeDiscount> implements StrokeDiscountService {
@Autowired @Autowired
private StrokeDiscountMapper strokeDiscountMapper; private StrokeDiscountMapper strokeDiscountMapper;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean saveStrokeDiscount(StrokeDiscount strokeDiscount)throws Exception{ public boolean saveStrokeDiscount(StrokeDiscount strokeDiscount) throws Exception {
return super.save(strokeDiscount); return super.save(strokeDiscount);
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean updateStrokeDiscount(StrokeDiscount strokeDiscount)throws Exception{ public boolean updateStrokeDiscount(StrokeDiscount strokeDiscount) throws Exception {
return super.updateById(strokeDiscount); return super.updateById(strokeDiscount);
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean deleteStrokeDiscount(Long id)throws Exception{ public boolean deleteStrokeDiscount(Long id) throws Exception {
return super.removeById(id); return super.removeById(id);
} }
@Override @Override
public StrokeDiscountQueryVo getStrokeDiscountById(Long id)throws Exception{ public StrokeDiscountQueryVo getStrokeDiscountById(Long id) throws Exception {
return strokeDiscountMapper.getStrokeDiscountById(id); return strokeDiscountMapper.getStrokeDiscountById(id);
} }
@Override @Override
public Paging<StrokeDiscountQueryVo> getStrokeDiscountPageList(StrokeDiscountPageParam strokeDiscountPageParam)throws Exception{ public Paging<StrokeDiscountQueryVo> getStrokeDiscountPageList(StrokeDiscountPageParam strokeDiscountPageParam) throws Exception {
Page<StrokeDiscountQueryVo> page=new PageInfo<>(strokeDiscountPageParam,OrderItem.desc(getLambdaColumn(StrokeDiscount::getCreateTime))); Page<StrokeDiscountQueryVo> page = new PageInfo<>(strokeDiscountPageParam, OrderItem.desc(getLambdaColumn(StrokeDiscount::getCreateTime)));
IPage<StrokeDiscountQueryVo> iPage= strokeDiscountMapper.getStrokeDiscountPageList(page, strokeDiscountPageParam); IPage<StrokeDiscountQueryVo> iPage = strokeDiscountMapper.getStrokeDiscountPageList(page, strokeDiscountPageParam);
return new Paging<StrokeDiscountQueryVo>(iPage); return new Paging<StrokeDiscountQueryVo>(iPage);
} }
} }
...@@ -88,19 +88,14 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp ...@@ -88,19 +88,14 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
@Override @Override
public Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception { public Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception {
// Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.asc(getLambdaColumn(Stroke::getCreateTime))); // Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.asc(getLambdaColumn(Stroke::getCreateTime)));
Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.asc("s.create_time")); Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.desc("s.create_time"));
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
// 查询已完成 需要额外查询已取消状态 // 查询已完成 需要额外查询已取消状态
if (strokePageParam.getStatus().equals(StrokeStatusEnum.COMPLETED.getCode())){ if (strokePageParam.getStatus().equals(StrokeStatusEnum.COMPLETED.getCode())){
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageListWithFinsh(page, strokePageParam, jwtToken.getUserId()); IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageListWithFinish(page, strokePageParam, jwtToken.getUserId());
return new Paging<StrokeQueryVo>(iPage); return new Paging<StrokeQueryVo>(iPage);
} }
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageList(page, strokePageParam, jwtToken.getUserId()); IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageList(page, strokePageParam, jwtToken.getUserId());
return new Paging<StrokeQueryVo>(iPage); return new Paging<StrokeQueryVo>(iPage);
} }
......
...@@ -6,7 +6,8 @@ import lombok.Data; ...@@ -6,7 +6,8 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.math.BigDecimal;
import java.sql.Timestamp;
/** /**
* <pre> * <pre>
...@@ -44,26 +45,26 @@ public class StrokeDiscountQueryVo implements Serializable { ...@@ -44,26 +45,26 @@ public class StrokeDiscountQueryVo implements Serializable {
private Long plainTypeId; private Long plainTypeId;
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Date outsetTime; private Timestamp outsetTime;
@ApiModelProperty("返程时间") @ApiModelProperty("返程时间")
private Date returnTime; private Timestamp returnTime;
@ApiModelProperty("状态,0-正常,1-完成,99-删除") @ApiModelProperty("状态,0-正常,1-完成,99-删除")
private Integer status; private Integer status;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Long createTime; private Timestamp createTime;
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Long updateTime; private Timestamp updateTime;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remarks; private String remarks;
@ApiModelProperty("价格,单位:分") @ApiModelProperty("价格")
private Long money; private BigDecimal money;
@ApiModelProperty("商家ID") @ApiModelProperty("商家ID")
private Long mcuId; private Long mcId;
} }
...@@ -4,7 +4,21 @@ ...@@ -4,7 +4,21 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, city_outset_id, city_outset_name, city_arrive_id, city_arrive_name, seat_mun, plain_type_id, outset_time, return_time, status, create_time, update_time, remarks, money, mcu_id id,
city_outset_id,
city_outset_name,
city_arrive_id,
city_arrive_name,
seat_mun,
plain_type_id,
outset_time,
return_time,
status,
create_time,
update_time,
remarks,
money,
mc_id
</sql> </sql>
<select id="getStrokeDiscountById" resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo"> <select id="getStrokeDiscountById" resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo">
...@@ -13,10 +27,16 @@ ...@@ -13,10 +27,16 @@
from stroke_discount where id = #{id} from stroke_discount where id = #{id}
</select> </select>
<select id="getStrokeDiscountPageList" parameterType="com.jumeirah.common.param.StrokeDiscountPageParam" resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo"> <select id="getStrokeDiscountPageList" parameterType="com.jumeirah.common.param.StrokeDiscountPageParam"
resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo">
select select
<include refid="Base_Column_List"/> ctco.city_name_cn as city_outset_name,
from stroke_discount ctca.city_name_cn as city_arrive_name,
sd.*
from stroke_discount sd
INNER JOIN city_three_code ctco ON ctco.id = sd.city_outset_id
INNER JOIN city_three_code ctca ON ctca.id = sd.city_arrive_id
</select> </select>
</mapper> </mapper>
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
s.id, s.id,
mu.id as merchantId, mu.id as merchantId,
city_outset_id, city_outset_id,
city_outset_name,
city_arrive_id, city_arrive_id,
city_arrive_name,
people_num, people_num,
plain_type_id, plain_type_id,
outset_time, outset_time,
...@@ -19,16 +17,52 @@ ...@@ -19,16 +17,52 @@
money, money,
user_id, user_id,
mu.username AS merchantName, mu.username AS merchantName,
outset_airport_name,arrive_airport_name,arrive_plain_type_id,back_outset_airport_name,back_arrive_airport_name, arrive_plain_type_id,
payment_status,audit_status,user_recharge_bank,user_recharge_name,user_recharge_bank_number back_outset_airport_name,
back_arrive_airport_name,
payment_status,
audit_status,
user_recharge_bank,
user_recharge_name,
user_recharge_bank_number
</sql> </sql>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, city_outset_id, deleted, city_outset_name, city_arrive_id, city_arrive_name, people_num, plain_type_id, outset_time, return_time, type, status, create_time, update_time, goods_name, goods_size, goods_weight, disease_name, instruments, medical_persons, remarks, money, user_id id,
,outset_airport_name,arrive_airport_name,arrive_plain_type_id,back_outset_airport_name,back_arrive_airport_name,payment_status,audit_status, user_recharge_money,user_recharge_bank,user_recharge_name, city_outset_id,
user_recharge_bank_number,user_recharge_credentials_url deleted,
city_outset_name,
city_arrive_id,
city_arrive_name,
people_num,
plain_type_id,
outset_time,
return_time,
type,
status,
create_time,
update_time,
goods_name,
goods_size,
goods_weight,
disease_name,
instruments,
medical_persons,
remarks, money,
user_id,
outset_airport_name,
arrive_airport_name,
arrive_plain_type_id,
back_outset_airport_name,
back_arrive_airport_name,
payment_status,audit_status,
user_recharge_money,
user_recharge_bank,
user_recharge_name,
user_recharge_bank_number,
user_recharge_credentials_url
</sql> </sql>
<select id="getStrokeById" resultType="com.jumeirah.common.vo.StrokeDetailVo"> <select id="getStrokeById" resultType="com.jumeirah.common.vo.StrokeDetailVo">
...@@ -40,9 +74,15 @@ ...@@ -40,9 +74,15 @@
<select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam" <select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo"> resultType="com.jumeirah.common.vo.StrokeQueryVo">
select select
ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
<include refid="Page_Column_List"/> <include refid="Page_Column_List"/>
from stroke s from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id INNER JOIN merchant_user mu ON mu.id = s.mc_id
INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id
INNER JOIN city_three_code ctca ON ctca.id = s.city_arrive_id
<where> <where>
and s.user_id = #{userId} and s.user_id = #{userId}
and s.deleted = 0 and s.deleted = 0
...@@ -56,12 +96,18 @@ ...@@ -56,12 +96,18 @@
</select> </select>
<!-- 已完成订单--> <!-- 已完成订单-->
<select id="getStrokePageListWithFinsh" parameterType="com.jumeirah.common.param.StrokePageParam" <select id="getStrokePageListWithFinish" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo"> resultType="com.jumeirah.common.vo.StrokeQueryVo">
select select
ctco.city_name_cn as city_outset_name,
ctco.airport_name_cn as outset_airport_name,
ctca.city_name_cn as city_arrive_name,
ctca.airport_name_cn as arrive_airport_name,
<include refid="Page_Column_List"/> <include refid="Page_Column_List"/>
from stroke s from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id INNER JOIN merchant_user mu ON mu.id = s.mc_id
INNER JOIN city_three_code ctco ON ctco.id = s.city_outset_id
INNER JOIN city_three_code ctca ON ctca.id = s.city_arrive_id
<where> <where>
and s.user_id = #{userId} and s.user_id = #{userId}
and s.deleted = 0 and s.deleted = 0
......
...@@ -53,7 +53,7 @@ public interface GeneratorConstant { ...@@ -53,7 +53,7 @@ public interface GeneratorConstant {
/** /**
* VO * VO
*/ */
String VO = "vo"; String VO = "param";
/** /**
* 查询VO * 查询VO
*/ */
......
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