Commit 8f280574 by zhangjw

Merge branch 'master' of http://119.28.51.83/hewei/Jumeirah into Jw

parents c4f674bc b7920cd9
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.jumeirah.common.param.MerchantUserPageParam; import com.jumeirah.common.param.MerchantPageParam;
import com.jumeirah.common.service.MerchantUserService; import com.jumeirah.common.service.MerchantService;
import com.jumeirah.common.vo.MerchantUserQueryForAppVo; import com.jumeirah.common.vo.MerchantQueryVo;
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;
...@@ -31,16 +31,16 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -31,16 +31,16 @@ import org.springframework.web.bind.annotation.RestController;
public class AirIntroducedController extends BaseController { public class AirIntroducedController extends BaseController {
@Autowired @Autowired
private MerchantUserService merchantUserService; private MerchantService merchantService;
/** /**
* 商家分页列表 * 商家分页列表
*/ */
@PostMapping("/getPageList") @PostMapping("/getPageList")
@OperationLog(name = "航空公司介绍分页列表", type = OperationLogType.PAGE) @OperationLog(name = "航空公司介绍分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "航空公司介绍分页列表", response = MerchantUserQueryForAppVo.class) @ApiOperation(value = "航空公司介绍分页列表")
public ApiResult<Paging<MerchantUserQueryForAppVo>> getMerchantUserPageList(@Validated @RequestBody MerchantUserPageParam merchantUserPageParam) throws Exception { public ApiResult<Paging<MerchantQueryVo>> getMerchantPageList(@Validated @RequestBody MerchantPageParam merchantPageParam) throws Exception {
Paging<MerchantUserQueryForAppVo> paging = merchantUserService.getMerchantUserPageListForApp(merchantUserPageParam); Paging<MerchantQueryVo> paging = merchantService.getMerchantPageList(merchantPageParam);
return ApiResult.ok(paging); return ApiResult.ok(paging);
} }
} }
......
package com.jumeirah.api.app.controller;
import com.jumeirah.common.param.BusinessPlainPageParam;
import com.jumeirah.common.service.BusinessPlainService;
import com.jumeirah.common.vo.BusinessPlainQueryForAppVo;
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.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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 公务机出售托管表 控制器
*
* @author giao
* @since 2020-10-14
*/
@Slf4j
@RestController
@RequestMapping("/app/businessPlain")
@Api(value = "公务机出售托管表API", tags = {"公务机出售托管表"})
public class BusinessPlainForAppController extends BaseController {
@Autowired
private BusinessPlainService businessPlainService;
// /**
// * 添加公务机出售托管表
// */
// @PostMapping("/add")
// @OperationLog(name = "添加公务机出售托管表", type = OperationLogType.ADD)
// @ApiOperation(value = "添加公务机出售托管表")
// public ApiResult<Boolean> addBusinessPlain(@Validated(Add.class) @RequestBody BusinessPlain businessPlain) throws Exception {
// boolean flag = businessPlainService.saveBusinessPlain(businessPlain);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改公务机出售托管表
// */
// @PostMapping("/update")
// @OperationLog(name = "修改公务机出售托管表", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改公务机出售托管表")
// public ApiResult<Boolean> updateBusinessPlain(@Validated(Update.class) @RequestBody BusinessPlain businessPlain) throws Exception {
// boolean flag = businessPlainService.updateBusinessPlain(businessPlain);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除公务机出售托管表
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除公务机出售托管表", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除公务机出售托管表")
// public ApiResult<Boolean> deleteBusinessPlain(@PathVariable("id") Long id) throws Exception {
// boolean flag = businessPlainService.deleteBusinessPlain(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取公务机出售托管表详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "公务机出售托管表详情", type = OperationLogType.INFO)
// @ApiOperation(value = "公务机出售托管表详情")
// public ApiResult<BusinessPlainQueryVo> getBusinessPlain(@PathVariable("id") Long id) throws Exception {
// BusinessPlainQueryVo businessPlainQueryVo = businessPlainService.getBusinessPlainById(id);
// return ApiResult.ok(businessPlainQueryVo);
// }
/**
* 公务机出售托管表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "公务机出售托管表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "公务机出售托管表分页列表")
public ApiResult<Paging<BusinessPlainQueryForAppVo>> getBusinessPlainPageList(@Validated @RequestBody BusinessPlainPageParam businessPlainPageParam) throws Exception {
Paging<BusinessPlainQueryForAppVo> paging = businessPlainService.getBusinessPlainPageListForApp(businessPlainPageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.api.app.controller;
import com.jumeirah.common.param.CharterIntroductionPageParam;
import com.jumeirah.common.service.CharterIntroductionService;
import com.jumeirah.common.vo.CharterIntroductionQueryForAppVo;
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.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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 包机介绍 控制器
*
* @author giao
* @since 2020-10-14
*/
@Slf4j
@RestController
@RequestMapping("/app/charterIntroduction")
@Api(value = "包机介绍API", tags = {"包机介绍"})
public class CharterIntroductionForAppController extends BaseController {
@Autowired
private CharterIntroductionService charterIntroductionService;
// /**
// * 添加包机介绍
// */
// @PostMapping("/add")
// @OperationLog(name = "添加包机介绍", type = OperationLogType.ADD)
// @ApiOperation(value = "添加包机介绍")
// public ApiResult<Boolean> addCharterIntroduction(@Validated(Add.class) @RequestBody CharterIntroduction charterIntroduction) throws Exception {
// boolean flag = charterIntroductionService.saveCharterIntroduction(charterIntroduction);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改包机介绍
// */
// @PostMapping("/update")
// @OperationLog(name = "修改包机介绍", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改包机介绍")
// public ApiResult<Boolean> updateCharterIntroduction(@Validated(Update.class) @RequestBody CharterIntroduction charterIntroduction) throws Exception {
// boolean flag = charterIntroductionService.updateCharterIntroduction(charterIntroduction);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除包机介绍
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除包机介绍", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除包机介绍")
// public ApiResult<Boolean> deleteCharterIntroduction(@PathVariable("id") Long id) throws Exception {
// boolean flag = charterIntroductionService.deleteCharterIntroduction(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取包机介绍详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "包机介绍详情", type = OperationLogType.INFO)
// @ApiOperation(value = "包机介绍详情")
// public ApiResult<CharterIntroductionQueryVo> getCharterIntroduction(@PathVariable("id") Long id) throws Exception {
// CharterIntroductionQueryVo charterIntroductionQueryVo = charterIntroductionService.getCharterIntroductionById(id);
// return ApiResult.ok(charterIntroductionQueryVo);
// }
// /**
// * 包机介绍分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "包机介绍分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "包机介绍分页列表")
// public ApiResult<Paging<CharterIntroductionQueryVo>> getCharterIntroductionPageList(@Validated @RequestBody CharterIntroductionPageParam charterIntroductionPageParam) throws Exception {
// Paging<CharterIntroductionQueryVo> paging = charterIntroductionService.getCharterIntroductionPageList(charterIntroductionPageParam);
// return ApiResult.ok(paging);
// }
/**
* 包机介绍分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "包机介绍分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "包机介绍分页列表")
public ApiResult<Paging<CharterIntroductionQueryForAppVo>> getCharterIntroductionPageList(@Validated @RequestBody CharterIntroductionPageParam charterIntroductionPageParam) throws Exception {
Paging<CharterIntroductionQueryForAppVo> paging = charterIntroductionService.getCharterIntroductionForAppPageList(charterIntroductionPageParam);
return ApiResult.ok(paging);
}
}
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.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;
...@@ -32,6 +36,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -32,6 +36,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
/** /**
* 行程表 控制器 * 行程表 控制器
* *
...@@ -46,7 +52,8 @@ public class StrokeController extends BaseController { ...@@ -46,7 +52,8 @@ public class StrokeController extends BaseController {
@Autowired @Autowired
private StrokeService strokeService; private StrokeService strokeService;
@Autowired
private StrokeDiscountService strokeDiscountService;
/** /**
* 填写付款信息 * 填写付款信息
*/ */
...@@ -72,11 +79,13 @@ public class StrokeController extends BaseController { ...@@ -72,11 +79,13 @@ 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"))
.setMcId(Constant.MC_ID)
.setUserId(jwtToken.getUserId()); .setUserId(jwtToken.getUserId());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
...@@ -88,11 +97,13 @@ public class StrokeController extends BaseController { ...@@ -88,11 +97,13 @@ 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"))
.setMcId(Constant.MC_ID)
.setUserId(jwtToken.getUserId()); .setUserId(jwtToken.getUserId());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
...@@ -104,11 +115,13 @@ public class StrokeController extends BaseController { ...@@ -104,11 +115,13 @@ 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"))
.setMcId(Constant.MC_ID)
.setUserId(jwtToken.getUserId()); .setUserId(jwtToken.getUserId());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
...@@ -121,11 +134,36 @@ public class StrokeController extends BaseController { ...@@ -121,11 +134,36 @@ 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"))
.setMcId(Constant.MC_ID)
.setUserId(jwtToken.getUserId());
boolean flag = strokeService.saveStroke(stroke);
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()); .setUserId(jwtToken.getUserId());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
......
package com.jumeirah.api.app.controller;
import com.jumeirah.common.param.StrokeDiscountPageParam;
import com.jumeirah.common.service.StrokeDiscountService;
import com.jumeirah.common.vo.StrokeDiscountQueryVo;
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.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.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-14
*/
@Slf4j
@RestController
@RequestMapping("/app/strokeDiscount")
@Api(value = "优惠行程表API", tags = {"优惠行程表"})
public class StrokeDiscountController extends BaseController {
@Autowired
private StrokeDiscountService strokeDiscountService;
/**
* 优惠行程表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "优惠行程表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "优惠行程表分页列表")
public ApiResult<Paging<StrokeDiscountQueryVo>> getStrokeDiscountPageList(@Validated @RequestBody StrokeDiscountPageParam strokeDiscountPageParam) throws Exception {
Paging<StrokeDiscountQueryVo> paging = strokeDiscountService.getStrokeDiscountPageList(strokeDiscountPageParam);
return ApiResult.ok(paging);
}
}
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;
...@@ -7,8 +7,8 @@ import lombok.Data; ...@@ -7,8 +7,8 @@ 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.NotNull; import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
/** /**
* 行程表-返程 * 行程表-返程
...@@ -20,39 +20,30 @@ import javax.validation.constraints.NotNull; ...@@ -20,39 +20,30 @@ import javax.validation.constraints.NotNull;
@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不能为空")
@ApiModelProperty("出发城市id") @ApiModelProperty("出发城市id")
private Long cityOutsetId; private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空") @NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id") @ApiModelProperty("到达城市id")
private Long cityArriveId; private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "人数不能为空") @NotNull(message = "人数不能为空")
@ApiModelProperty("人数") @ApiModelProperty("人数")
private Integer peopleMun; private Integer peopleNum;
@NotNull(message = "飞机型号ID不能为空") @ApiModelProperty("用户选择机型(多个中间逗号隔开)")
@ApiModelProperty("飞机型号ID") private String choosePlainType;
private Long plainTypeId;
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Long outsetTime; private Timestamp outsetTime;
@NotNull(message = "返程时间不能为空") @NotNull(message = "返程时间不能为空")
@ApiModelProperty("返程时间") @ApiModelProperty("返程时间")
private Long returnTime; private Timestamp returnTime;
} }
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;
...@@ -9,6 +9,7 @@ import lombok.experimental.Accessors; ...@@ -9,6 +9,7 @@ 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.sql.Timestamp;
/** /**
* 行程表 * 行程表
...@@ -20,28 +21,20 @@ import javax.validation.constraints.NotNull; ...@@ -20,28 +21,20 @@ import javax.validation.constraints.NotNull;
@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不能为空")
@ApiModelProperty("出发城市id") @ApiModelProperty("出发城市id")
private Long cityOutsetId; private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空") @NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id") @ApiModelProperty("到达城市id")
private Long cityArriveId; private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Long outsetTime; private Timestamp outsetTime;
@NotBlank(message = "货物名称不能为空") @NotBlank(message = "货物名称不能为空")
@ApiModelProperty("货物名称") @ApiModelProperty("货物名称")
...@@ -53,6 +46,6 @@ public class StrokeAddFreightVo extends BaseEntity { ...@@ -53,6 +46,6 @@ public class StrokeAddFreightVo extends BaseEntity {
@NotNull(message = "货物重量不能为空") @NotNull(message = "货物重量不能为空")
@ApiModelProperty("货物重量,单位:吨") @ApiModelProperty("货物重量,单位:吨")
private Double goodsWeight; private String goodsWeight;
} }
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;
...@@ -9,6 +9,7 @@ import lombok.experimental.Accessors; ...@@ -9,6 +9,7 @@ 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.sql.Timestamp;
/** /**
* 行程表 * 行程表
...@@ -20,28 +21,20 @@ import javax.validation.constraints.NotNull; ...@@ -20,28 +21,20 @@ import javax.validation.constraints.NotNull;
@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不能为空")
@ApiModelProperty("出发城市id") @ApiModelProperty("出发城市id")
private Long cityOutsetId; private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空") @NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id") @ApiModelProperty("到达城市id")
private Long cityArriveId; private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Long outsetTime; private Timestamp outsetTime;
@NotBlank(message = "到达城市名称不能为空") @NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("病人疾病名称") @ApiModelProperty("病人疾病名称")
......
package com.jumeirah.api.app.entity.vo; package com.jumeirah.api.app.entity.param;
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.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.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.sql.Timestamp;
/** /**
* 行程表 * 行程表
...@@ -24,35 +20,26 @@ import java.util.Date; ...@@ -24,35 +20,26 @@ import java.util.Date;
@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不能为空")
@ApiModelProperty("出发城市id") @ApiModelProperty("出发城市id")
private Long cityOutsetId; private Long cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空") @NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id") @ApiModelProperty("到达城市id")
private Long cityArriveId; private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "人数不能为空") @NotNull(message = "人数不能为空")
@ApiModelProperty("人数") @ApiModelProperty("人数")
private Integer peopleMun; private Integer peopleNum;
@NotNull(message = "飞机型号ID不能为空") @ApiModelProperty("用户选择机型(多个中间逗号隔开)")
@ApiModelProperty("飞机型号ID") private String choosePlainType;
private Long plainTypeId;
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Long outsetTime; private Timestamp outsetTime;
} }
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;
}
...@@ -109,7 +109,7 @@ public class AppSmsServiceImpl implements AppSmsService { ...@@ -109,7 +109,7 @@ public class AppSmsServiceImpl implements AppSmsService {
*/ */
String getRandomCode() { String getRandomCode() {
// 如果为测试环境则生成默认 // 如果为测试环境则生成默认
if (profiles.equals(DEV_PROFILE)) { if (profiles.equals(DEV_PROFILE) || profiles.equals("test")) {
return DEFAULT_DEV_SMS_CODE; return DEFAULT_DEV_SMS_CODE;
} else { } else {
return Arrays.toString(RandomUtil.randomInts(6)); return Arrays.toString(RandomUtil.randomInts(6));
......
package com.jumeirah.api.merchant.controller;
import com.jumeirah.api.merchant.service.MerchantSmsService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* APP用户 控制器
*
* @author wei
* @since 2020-09-23
*/
@Slf4j
@RestController
//@Module("api-app")
@Api(value = "短信验证码", tags = {"APP短信验证码相关"})
@RequestMapping("/app/sms/")
public class MerchantSmsController extends BaseController {
@Autowired
private MerchantSmsService merchantSmsService;
/**
* 获取注册验证码
*/
@GetMapping("/registerCode")
@OperationLog(name = "获取注册或登陆的验证码", type = OperationLogType.INFO)
@ApiOperation(value = "获取注册或登陆的验证码", response = Object.class, notes = "本地环境默认666666")
public ApiResult<Object> registerOrLoginCode(@RequestParam String phoneArea, @RequestParam String phone) throws Exception {
return merchantSmsService.registerCode(phoneArea, phone);
}
}
...@@ -108,5 +108,12 @@ public class MerchantUserController extends BaseController { ...@@ -108,5 +108,12 @@ public class MerchantUserController extends BaseController {
return merchantUserService.login(loginParam, response, language); return merchantUserService.login(loginParam, response, language);
} }
@PostMapping("/register")
@OperationLogIgnore
@ApiOperation(value = "注册", notes = "商家注册", response = LoginSysUserTokenVo.class)
public ApiResult<LoginSysUserTokenVo> register(@Validated @RequestBody LoginParam loginParam, HttpServletResponse response, @RequestHeader(required = false) String language) throws Exception {
return merchantUserService.login(loginParam, response, language);
}
} }
package com.jumeirah.api.merchant.controller.order; package com.jumeirah.api.merchant.controller.order;
import com.jumeirah.api.merchant.entity.param.StrokeQuotedPriceParam;
import com.jumeirah.common.entity.Stroke; import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.param.McStrokePageParam; import com.jumeirah.common.param.McStrokePageParam;
import com.jumeirah.common.service.StrokeService; import com.jumeirah.common.service.StrokeService;
...@@ -14,6 +15,7 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType; ...@@ -14,6 +15,7 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -39,6 +41,30 @@ public class McStrokeController extends BaseController { ...@@ -39,6 +41,30 @@ public class McStrokeController extends BaseController {
private StrokeService strokeService; private StrokeService strokeService;
/** /**
* 行程表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "行程分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "行程分页列表")
public ApiResult<Paging<McStrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody McStrokePageParam mcStrokePageParam) throws Exception {
Paging<McStrokeQueryVo> paging = strokeService.getMcStrokePageList(mcStrokePageParam);
return ApiResult.ok(paging);
}
/**
* 行程报价接口
*/
@PostMapping("/update/quotedPrice")
@OperationLog(name = "行程报价接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "行程报价接口", response = ApiResult.class)
public ApiResult<Boolean> updateStroke(@Validated @RequestBody StrokeQuotedPriceParam strokeQuotedPriceParam) throws Exception {
Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeQuotedPriceParam, stroke);
boolean flag = strokeService.updateStroke(stroke);
return ApiResult.result(flag);
}
/**
* 修改行程表 * 修改行程表
*/ */
@PostMapping("/update") @PostMapping("/update")
...@@ -71,16 +97,5 @@ public class McStrokeController extends BaseController { ...@@ -71,16 +97,5 @@ public class McStrokeController extends BaseController {
return ApiResult.ok(strokeQueryVo); return ApiResult.ok(strokeQueryVo);
} }
/**
* 行程表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "行程分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "行程分页列表")
public ApiResult<Paging<McStrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody McStrokePageParam mcStrokePageParam) throws Exception {
Paging<McStrokeQueryVo> paging = strokeService.getMcStrokePageList(mcStrokePageParam);
return ApiResult.ok(paging);
}
} }
package com.jumeirah.api.merchant.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.math.BigDecimal;
/**
* 行程表
*
* @author wei
* @since 2020-09-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Stroke报价对象")
public class StrokeQuotedPriceParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空")
@ApiModelProperty("主键ID")
private Long id;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@NotNull(message = "价格不能为空")
@ApiModelProperty("价格")
private BigDecimal money;
@ApiModelProperty("备注")
private String remarks;
}
package com.jumeirah.api.merchant.service;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
public interface MerchantSmsService {
void deleteRegisterCode(String area, String number);
/**
* 获取注册验证码
*/
ApiResult<Object> registerCode(String phoneArea, String phone);
/**
* 获取注册验证码
*/
ApiResult LoginType(String area, String number);
/**
* 校验注册验证码
*
* @param area
* @param number
* @param code
* @return
*/
boolean equalsRegisterCode(String area, String number, String code);
/**
* 校验验登陆证码
*
* @param area
* @param number
* @param code
* @return
*/
boolean equalsLoginCode(String area, String number, String code);
}
package com.jumeirah.api.merchant.service;
import cn.hutool.core.util.RandomUtil;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.util.Arrays;
@Service
@Slf4j
public class MerchantSmsServiceImpl implements MerchantSmsService {
/**
* 获取当前环境
*/
@Value("${spring.profiles.active}")
private String profiles;
@Autowired
private RedisTemplate redisTemplate;
/**
* 测试环境
*/
private static final String DEV_PROFILE = "dev";
/**
* 测试环境默认短信验证码
*/
private static final String DEFAULT_DEV_SMS_CODE = "666666";
/**
* 短信验证码redis的key值
*/
private static final String SMS_REGIEST = "mer:sms:register:%s_%s";
/**
* 短信验证码redis的key值
*/
private static final String SMS_LOGIN = "mer:sms:login:%s_%s";
@Override
public void deleteRegisterCode(String area, String number) {
redisTemplate.delete(String.format(SMS_REGIEST, area, number));
}
@Override
public ApiResult<Object> registerCode(String area, String number) {
return getSmsCodeApiResult(String.format(SMS_REGIEST, area, number), area, number);
}
private ApiResult<Object> getSmsCodeApiResult(String key, String area, String number) {
String randomCode = getRandomCode();
// 过期时间(秒)
long expire = 120L;
Duration expireDuration = Duration.ofSeconds(expire);
redisTemplate.opsForValue().set(key, randomCode, expireDuration);
log.info(area + "," + number + ":" + randomCode);
// TODO 需要补充调用短信平台发送短信代码 2020年09月30日09:48:42
return ApiResult.ok(null);
}
@Override
public ApiResult LoginType(String area, String number) {
return getSmsCodeApiResult(String.format(SMS_LOGIN, area, number), area, number);
}
@Override
public boolean equalsRegisterCode(String area, String number, String code) {
return equalsSms(SMS_REGIEST, area, number, code);
}
private boolean equalsSms(String type, String area, String number, String code) {
String formatKey = String.format(type, area, number);
Object key = redisTemplate.opsForValue().get(formatKey);
if (key == null) {
return false;
}
return String.valueOf(key).equals(code);
}
@Override
public boolean equalsLoginCode(String area, String number, String code) {
return equalsSms(SMS_LOGIN, area, number, code);
}
/**
* 生成验证码code
*
* @return
*/
String getRandomCode() {
// 如果为测试环境则生成默认
if (profiles.equals(DEV_PROFILE) || profiles.equals("test")) {
return DEFAULT_DEV_SMS_CODE;
} else {
return Arrays.toString(RandomUtil.randomInts(6));
}
}
}
package com.jumeirah.api.merchant.service;
import com.jumeirah.common.param.app.AppSmsRegisterParam;
import com.jumeirah.common.param.app.AppUserInfoParam;
import com.jumeirah.common.vo.app.LoginAppUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
public interface MerchantUserApiService {
/**
* 注册
* @param loginParam
* @param language
* @return
* @throws Exception
*/
ApiResult<LoginAppUserTokenVo> register(AppSmsRegisterParam loginParam, String language) throws Exception;
// ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language) throws Exception;
/**
* 修改或补充用户信息
* @param appUserInfoParam
* @return
* @throws Exception
*/
boolean updateAppUser(AppUserInfoParam appUserInfoParam) throws Exception;
}
/* ///*
* Copyright 2019-2029 geekidea(https://github.com/geekidea) // * Copyright 2019-2029 geekidea(https://github.com/geekidea)
* // *
* Licensed under the Apache License, Version 2.0 (the "License"); // * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. // * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at // * You may obtain a copy of the License at
* // *
* http://www.apache.org/licenses/LICENSE-2.0 // * http://www.apache.org/licenses/LICENSE-2.0
* // *
* Unless required by applicable law or agreed to in writing, software // * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, // * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and // * See the License for the specific language governing permissions and
* limitations under the License. // * limitations under the License.
*/ // */
//
package com.jumeirah.api.system.controller; //package com.jumeirah.api.system.controller;
//
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties; //import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
import io.geekidea.springbootplus.framework.common.api.ApiResult; //import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.log.annotation.Module; //import io.geekidea.springbootplus.framework.log.annotation.Module;
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.geekidea.springbootplus.framework.util.DownloadUtil; //import io.geekidea.springbootplus.framework.util.DownloadUtil;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; //import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; //import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; //import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMapping;
//
import javax.servlet.http.HttpServletResponse; //import javax.servlet.http.HttpServletResponse;
import java.util.List; //import java.util.List;
//
/** ///**
* 下载控制器 // * 下载控制器
* // *
* @author geekidea // * @author geekidea
* @date 2019/8/20 // * @date 2019/8/20
* @since 1.2.1-RELEASE // * @since 1.2.1-RELEASE
*/ // */
@Slf4j //@Slf4j
@Controller //@Controller
@RequestMapping("/sys/download") //@RequestMapping("/sys/download")
@Module("system") //@Module("system")
@Api(value = "文件下载", tags = {"文件下载"}) //@Api(value = "文件下载", tags = {"文件下载"})
public class DownloadController { //public class DownloadController {
//
@Autowired // @Autowired
private SpringBootPlusProperties springBootPlusProperties; // private SpringBootPlusProperties springBootPlusProperties;
//
/** // /**
* 下载文件 // * 下载文件
*/ // */
@GetMapping("/{downloadFileName}") // @GetMapping("/{downloadFileName}")
@OperationLog(name = "下载文件", type = OperationLogType.download) // @OperationLog(name = "下载文件", type = OperationLogType.download)
@ApiOperation(value = "下载文件", notes = "下载文件", response = ApiResult.class) // @ApiOperation(value = "下载文件", notes = "下载文件", response = ApiResult.class)
public void download(@PathVariable(required = true) String downloadFileName, HttpServletResponse response) throws Exception { // public void download(@PathVariable(required = true) String downloadFileName, HttpServletResponse response) throws Exception {
// 下载目录,既是上传目录 // // 下载目录,既是上传目录
String downloadDir = springBootPlusProperties.getUploadPath(); // String downloadDir = springBootPlusProperties.getUploadPath();
// 允许下载的文件后缀 // // 允许下载的文件后缀
List<String> allowFileExtensions = springBootPlusProperties.getAllowDownloadFileExtensions(); // List<String> allowFileExtensions = springBootPlusProperties.getAllowDownloadFileExtensions();
// 文件下载,使用默认下载处理器 // // 文件下载,使用默认下载处理器
// 文件下载,使用自定义下载处理器 // // 文件下载,使用自定义下载处理器
DownloadUtil.download(downloadDir, downloadFileName, allowFileExtensions, response, (dir, fileName, file, fileExtension, contentType, length) -> { // DownloadUtil.download(downloadDir, downloadFileName, allowFileExtensions, response, (dir, fileName, file, fileExtension, contentType, length) -> {
// 下载自定义处理,返回true:执行下载,false:取消下载 // // 下载自定义处理,返回true:执行下载,false:取消下载
log.info("dir = " + dir); // log.info("dir = " + dir);
log.info("fileName = " + fileName); // log.info("fileName = " + fileName);
log.info("file = " + file); // log.info("file = " + file);
log.info("fileExtension = " + fileExtension); // log.info("fileExtension = " + fileExtension);
log.info("contentType = " + contentType); // log.info("contentType = " + contentType);
log.info("length = " + length); // log.info("length = " + length);
return true; // return true;
}); // });
} // }
//
} //}
package com.jumeirah.api.system.controller;
import com.jumeirah.common.entity.Merchant;
import com.jumeirah.common.param.MerchantPageParam;
import com.jumeirah.common.service.MerchantService;
import com.jumeirah.common.vo.MerchantQueryVo;
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 giao
* @since 2020-10-13
*/
@Slf4j
@RestController
@RequestMapping("/sys/merchant")
@Api(value = "航空公司商家表API", tags = {"航空公司商家表"})
public class MerchantController extends BaseController {
@Autowired
private MerchantService merchantService;
/**
* 添加航空公司商家表
*/
@PostMapping("/add")
@OperationLog(name = "添加航空公司商家表", type = OperationLogType.ADD)
@ApiOperation(value = "添加航空公司商家表")
public ApiResult<Boolean> addMerchant(@Validated(Add.class) @RequestBody Merchant merchant) throws Exception {
boolean flag = merchantService.saveMerchant(merchant);
return ApiResult.result(flag);
}
/**
* 修改航空公司商家表
*/
@PostMapping("/update")
@OperationLog(name = "修改航空公司商家表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改航空公司商家表")
public ApiResult<Boolean> updateMerchant(@Validated(Update.class) @RequestBody Merchant merchant) throws Exception {
boolean flag = merchantService.updateMerchant(merchant);
return ApiResult.result(flag);
}
/**
* 删除航空公司商家表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除航空公司商家表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除航空公司商家表")
public ApiResult<Boolean> deleteMerchant(@PathVariable("id") Long id) throws Exception {
boolean flag = merchantService.deleteMerchant(id);
return ApiResult.result(flag);
}
/**
* 获取航空公司商家表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "航空公司商家表详情", type = OperationLogType.INFO)
@ApiOperation(value = "航空公司商家表详情")
public ApiResult<MerchantQueryVo> getMerchant(@PathVariable("id") Long id) throws Exception {
MerchantQueryVo merchantQueryVo = merchantService.getMerchantById(id);
return ApiResult.ok(merchantQueryVo);
}
/**
* 航空公司商家表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "航空公司商家表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "航空公司商家表分页列表")
public ApiResult<Paging<MerchantQueryVo>> getMerchantPageList(@Validated @RequestBody MerchantPageParam merchantPageParam) throws Exception {
Paging<MerchantQueryVo> paging = merchantService.getMerchantPageList(merchantPageParam);
return ApiResult.ok(paging);
}
}
/* ///*
* Copyright 2019-2029 geekidea(https://github.com/geekidea) // * Copyright 2019-2029 geekidea(https://github.com/geekidea)
* // *
* Licensed under the Apache License, Version 2.0 (the "License"); // * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. // * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at // * You may obtain a copy of the License at
* // *
* http://www.apache.org/licenses/LICENSE-2.0 // * http://www.apache.org/licenses/LICENSE-2.0
* // *
* Unless required by applicable law or agreed to in writing, software // * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, // * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and // * See the License for the specific language governing permissions and
* limitations under the License. // * limitations under the License.
*/ // */
//
package com.jumeirah.api.system.controller; //package com.jumeirah.api.system.controller;
//
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties; //import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
import io.geekidea.springbootplus.framework.common.api.ApiResult; //import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.log.annotation.Module; //import io.geekidea.springbootplus.framework.log.annotation.Module;
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;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; //import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; //import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; //import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMapping;
//
import javax.servlet.http.HttpServletResponse; //import javax.servlet.http.HttpServletResponse;
//
/** ///**
* 图片等文件资源访问控制器 // * 图片等文件资源访问控制器
* /api/resource 访问路径 用于区分 文件访问虚拟目录映射 /resource // * /api/resource 访问路径 用于区分 文件访问虚拟目录映射 /resource
* // *
* @author geekidea // * @author geekidea
* @date 2019/8/20 // * @date 2019/8/20
* @since 1.2.1-RELEASE // * @since 1.2.1-RELEASE
*/ // */
@Slf4j //@Slf4j
@Controller //@Controller
@RequestMapping("/api/resource") //@RequestMapping("/api/resource")
@Module("system") //@Module("system")
@Api(value = "资源访问", tags = {"资源访问"}) //@Api(value = "资源访问", tags = {"资源访问"})
public class ResourceController { //public class ResourceController {
//
@Autowired // @Autowired
private SpringBootPlusProperties springBootPlusProperties; // private SpringBootPlusProperties springBootPlusProperties;
//
/** // /**
* 访问资源 // * 访问资源
*/ // */
@GetMapping("/image/{imageFileName}") // @GetMapping("/image/{imageFileName}")
@OperationLog(name = "访问资源", type = OperationLogType.ADD) // @OperationLog(name = "访问资源", type = OperationLogType.ADD)
@ApiOperation(value = "访问资源", response = ApiResult.class) // @ApiOperation(value = "访问资源", response = ApiResult.class)
public void getImage(@PathVariable(required = true) String imageFileName, HttpServletResponse response) throws Exception { // public void getImage(@PathVariable(required = true) String imageFileName, HttpServletResponse response) throws Exception {
log.info("imageFileName:{}", imageFileName); // log.info("imageFileName:{}", imageFileName);
// 重定向到图片访问路径 // // 重定向到图片访问路径
response.sendRedirect(springBootPlusProperties.getResourceAccessPath() + imageFileName); // response.sendRedirect(springBootPlusProperties.getResourceAccessPath() + imageFileName);
} // }
//
} //}
package com.jumeirah.api.system.controller;
import com.jumeirah.api.system.service.SysSmsService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* APP用户 控制器
*
* @author wei
* @since 2020-09-23
*/
@Slf4j
@RestController
@Api(value = "短信验证码", tags = {"短信验证码相关"})
@RequestMapping("/sys/sms/")
public class SysSmsController extends BaseController {
@Autowired
private SysSmsService appSmsService;
/**
* 获取注册验证码
*/
@GetMapping("/registerCode")
@OperationLog(name = "获取注册验证码", type = OperationLogType.INFO)
@ApiOperation(value = "获取注册验证码", response = Object.class, notes = "本地环境默认666666")
public ApiResult<Object> registerOrLoginCode(@RequestParam String phoneArea, @RequestParam String phone) throws Exception {
return appSmsService.registerOrLoginCode(phoneArea, phone);
}
}
...@@ -23,7 +23,6 @@ import com.jumeirah.common.param.sysuser.UpdatePasswordParam; ...@@ -23,7 +23,6 @@ import com.jumeirah.common.param.sysuser.UpdatePasswordParam;
import com.jumeirah.common.param.sysuser.UploadHeadParam; import com.jumeirah.common.param.sysuser.UploadHeadParam;
import com.jumeirah.common.service.SysUserService; import com.jumeirah.common.service.SysUserService;
import com.jumeirah.common.vo.SysUserQueryVo; import com.jumeirah.common.vo.SysUserQueryVo;
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
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;
...@@ -63,9 +62,6 @@ public class SysUserController extends BaseController { ...@@ -63,9 +62,6 @@ public class SysUserController extends BaseController {
@Autowired @Autowired
private SysUserService sysUserService; private SysUserService sysUserService;
@Autowired
private SpringBootPlusProperties springBootPlusProperties;
/** /**
* 添加系统用户 * 添加系统用户
*/ */
......
/* ///*
* Copyright 2019-2029 geekidea(https://github.com/geekidea) // * Copyright 2019-2029 geekidea(https://github.com/geekidea)
* // *
* Licensed under the Apache License, Version 2.0 (the "License"); // * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. // * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at // * You may obtain a copy of the License at
* // *
* http://www.apache.org/licenses/LICENSE-2.0 // * http://www.apache.org/licenses/LICENSE-2.0
* // *
* Unless required by applicable law or agreed to in writing, software // * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, // * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and // * See the License for the specific language governing permissions and
* limitations under the License. // * limitations under the License.
*/ // */
//
package com.jumeirah.api.system.controller; //package com.jumeirah.api.system.controller;
//
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties; //import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
import io.geekidea.springbootplus.framework.common.api.ApiResult; //import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.log.annotation.Module; //import io.geekidea.springbootplus.framework.log.annotation.Module;
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.geekidea.springbootplus.framework.util.UploadUtil; //import io.geekidea.springbootplus.framework.util.UploadUtil;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; //import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; //import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils; //import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.RandomStringUtils; //import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; //import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; //import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; //import org.springframework.web.multipart.MultipartFile;
//
import java.time.LocalDateTime; //import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; //import java.time.format.DateTimeFormatter;
//
/** ///**
* 上传控制器 // * 上传控制器
* // *
* @author geekidea // * @author geekidea
* @date 2019/8/20 // * @date 2019/8/20
* @since 1.2.1-RELEASE // * @since 1.2.1-RELEASE
*/ // */
@Slf4j //@Slf4j
@RestController //@RestController
@RequestMapping("/sys/upload") //@RequestMapping("/sys/upload")
@Module("system") //@Module("system")
@Api(value = "文件上传", tags = {"文件上传"}) //@Api(value = "文件上传", tags = {"文件上传"})
public class UploadController { //public class UploadController {
//
@Autowired // @Autowired
private SpringBootPlusProperties springBootPlusProperties; // private SpringBootPlusProperties springBootPlusProperties;
//
/** // /**
* 上传单个文件 // * 上传单个文件
* // *
* @return // * @return
*/ // */
@PostMapping // @PostMapping
@OperationLog(name = "上传单个文件", type = OperationLogType.UPLOAD) // @OperationLog(name = "上传单个文件", type = OperationLogType.UPLOAD)
@ApiOperation(value = "上传单个文件", response = ApiResult.class) // @ApiOperation(value = "上传单个文件", response = ApiResult.class)
@ApiImplicitParams({ // @ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "文件", required = true, dataType = "__file"), // @ApiImplicitParam(name = "file", value = "文件", required = true, dataType = "__file"),
@ApiImplicitParam(name = "type", value = "类型 head:头像", required = true) // @ApiImplicitParam(name = "type", value = "类型 head:头像", required = true)
}) // })
public ApiResult<String> upload(@RequestParam("file") MultipartFile multipartFile, // public ApiResult<String> upload(@RequestParam("file") MultipartFile multipartFile,
@RequestParam("type") String type) throws Exception { // @RequestParam("type") String type) throws Exception {
log.info("multipartFile = " + multipartFile); // log.info("multipartFile = " + multipartFile);
log.info("ContentType = " + multipartFile.getContentType()); // log.info("ContentType = " + multipartFile.getContentType());
log.info("OriginalFilename = " + multipartFile.getOriginalFilename()); // log.info("OriginalFilename = " + multipartFile.getOriginalFilename());
log.info("Name = " + multipartFile.getName()); // log.info("Name = " + multipartFile.getName());
log.info("Size = " + multipartFile.getSize()); // log.info("Size = " + multipartFile.getSize());
log.info("type = " + type); // log.info("type = " + type);
//
// 上传文件,返回保存的文件名称 // // 上传文件,返回保存的文件名称
String saveFileName = UploadUtil.upload(springBootPlusProperties.getUploadPath(), multipartFile, originalFilename -> { // String saveFileName = UploadUtil.upload(springBootPlusProperties.getUploadPath(), multipartFile, originalFilename -> {
// 文件后缀 // // 文件后缀
String fileExtension = FilenameUtils.getExtension(originalFilename); // String fileExtension = FilenameUtils.getExtension(originalFilename);
// 这里可自定义文件名称,比如按照业务类型/文件格式/日期 // // 这里可自定义文件名称,比如按照业务类型/文件格式/日期
String dateString = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssS")) + RandomStringUtils.randomNumeric(6); // String dateString = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssS")) + RandomStringUtils.randomNumeric(6);
String fileName = dateString + "." + fileExtension; // String fileName = dateString + "." + fileExtension;
return fileName; // return fileName;
}); // });
//
// 上传成功之后,返回访问路径,请根据实际情况设置 // // 上传成功之后,返回访问路径,请根据实际情况设置
//
String fileAccessPath = springBootPlusProperties.getResourceAccessUrl() + saveFileName; // String fileAccessPath = springBootPlusProperties.getResourceAccessUrl() + saveFileName;
log.info("fileAccessPath:{}", fileAccessPath); // log.info("fileAccessPath:{}", fileAccessPath);
//
return ApiResult.ok(fileAccessPath); // return ApiResult.ok(fileAccessPath);
} // }
//
} //}
package com.jumeirah.api.system.service;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
public interface SysSmsService {
void deleteRegisterCode(String area, String number);
/**
* 获取注册验证码
*/
ApiResult<Object> registerOrLoginCode(String phoneArea, String phone);
/**
* 获取注册验证码
*/
ApiResult<Object> registerCode(String area, String phone);
/**
* 获取注册验证码
*/
ApiResult LoginType(String area, String number);
/**
* 校验注册验证码
*
* @param area
* @param number
* @param code
* @return
*/
boolean equalsRegisterCode(String area, String number, String code);
/**
* 校验验登陆证码
*
* @param area
* @param number
* @param code
* @return
*/
boolean equalsLoginCode(String area, String number, String code);
}
package com.jumeirah.api.system.service;
import cn.hutool.core.util.RandomUtil;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.util.Arrays;
@Service
@Slf4j
public class SysSmsServiceImpl implements SysSmsService {
/**
* 获取当前环境
*/
@Value("${spring.profiles.active}")
private String profiles;
@Autowired
private RedisTemplate redisTemplate;
/**
* 测试环境
*/
private static final String DEV_PROFILE = "dev";
/**
* 测试环境默认短信验证码
*/
private static final String DEFAULT_DEV_SMS_CODE = "666666";
/**
* 短信验证码redis的key值
*/
private static final String SMS_REGIEST = "sys:sms:register:%s_%s";
/**
* 短信验证码redis的key值
*/
private static final String SMS_LOGIN = "sys:sms:login:%s_%s";
@Override
public void deleteRegisterCode(String area, String number) {
redisTemplate.delete(String.format(SMS_REGIEST, area, number));
}
@Override
public ApiResult<Object> registerOrLoginCode(String area, String phone) {
return getSmsCodeApiResult(String.format(SMS_REGIEST, area, phone), area, phone);
}
@Override
public ApiResult<Object> registerCode(String area, String phone) {
return getSmsCodeApiResult(String.format(SMS_REGIEST, area, phone), area, phone);
}
private ApiResult<Object> getSmsCodeApiResult(String key, String area, String number) {
String randomCode = getRandomCode();
// 过期时间(秒)
long expire = 120L;
Duration expireDuration = Duration.ofSeconds(expire);
redisTemplate.opsForValue().set(key, randomCode, expireDuration);
// SmsCode smsCode = new SmsCode();
// smsCode.setSmsCode(randomCode);
// log.info(area + "," + number + ":" + randomCode);
// TODO 需要补充调用短信平台发送短信代码 2020年09月30日09:48:42
return ApiResult.ok(null);
}
@Override
public ApiResult LoginType(String area, String number) {
return getSmsCodeApiResult(String.format(SMS_LOGIN, area, number), area, number);
}
@Override
public boolean equalsRegisterCode(String area, String number, String code) {
return equalsSms(SMS_REGIEST, area, number, code);
}
private boolean equalsSms(String type, String area, String number, String code) {
String formatKey = String.format(type, area, number);
Object key = redisTemplate.opsForValue().get(formatKey);
if (key == null) {
return false;
}
return String.valueOf(key).equals(code);
}
@Override
public boolean equalsLoginCode(String area, String number, String code) {
return equalsSms(SMS_LOGIN, area, number, code);
}
/**
* 生成验证码code
*
* @return
*/
String getRandomCode() {
// 如果为测试环境则生成默认
if (profiles.equals(DEV_PROFILE) || profiles.equals("test")) {
return DEFAULT_DEV_SMS_CODE;
} else {
return Arrays.toString(RandomUtil.randomInts(6));
}
}
}
...@@ -56,7 +56,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties ...@@ -56,7 +56,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.filter.DelegatingFilterProxy; import org.springframework.web.filter.DelegatingFilterProxy;
import javax.servlet.DispatcherType; import javax.servlet.DispatcherType;
...@@ -204,14 +203,13 @@ public class ShiroConfig { ...@@ -204,14 +203,13 @@ public class ShiroConfig {
ShiroLoginService shiroLoginService, ShiroLoginService shiroLoginService,
SysLoginRedisService sysLoginRedisService, SysLoginRedisService sysLoginRedisService,
ShiroProperties shiroProperties, ShiroProperties shiroProperties,
JwtProperties jwtProperties, JwtProperties jwtProperties) {
RedisTemplate redisTemplate) {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
// 设置安全管理器 // 设置安全管理器
shiroFilterFactoryBean.setSecurityManager(securityManager); shiroFilterFactoryBean.setSecurityManager(securityManager);
// 设置过滤器 // 设置过滤器
Map<String, Filter> filterMap = getFilterMap(shiroLoginService, sysLoginRedisService, jwtProperties, redisTemplate); Map<String, Filter> filterMap = getFilterMap(shiroLoginService, jwtProperties);
shiroFilterFactoryBean.setFilters(filterMap); shiroFilterFactoryBean.setFilters(filterMap);
// 设置过滤器顺序 // 设置过滤器顺序
Map<String, String> filterChainMap = getFilterChainDefinitionMap(shiroProperties); Map<String, String> filterChainMap = getFilterChainDefinitionMap(shiroProperties);
...@@ -226,11 +224,9 @@ public class ShiroConfig { ...@@ -226,11 +224,9 @@ public class ShiroConfig {
* @return * @return
*/ */
private Map<String, Filter> getFilterMap(ShiroLoginService shiroLoginService, private Map<String, Filter> getFilterMap(ShiroLoginService shiroLoginService,
SysLoginRedisService loginRedisService, JwtProperties jwtProperties) {
JwtProperties jwtProperties,
RedisTemplate redisTemplate) {
Map<String, Filter> filterMap = new LinkedHashMap<>(); Map<String, Filter> filterMap = new LinkedHashMap<>();
filterMap.put(JWT_FILTER_NAME, new JwtFilter(shiroLoginService, loginRedisService, jwtProperties, redisTemplate)); filterMap.put(JWT_FILTER_NAME, new JwtFilter(shiroLoginService, jwtProperties));
return filterMap; return filterMap;
} }
......
package com.jumeirah.common.constant;
/**
* @ClassName Constant
* @Descripteion 请写点注释吧!
* @Date 2020/10/13 14:08
* @Version 1.0
**/
public class Constant {
/**
* 卓美亚商家ID
*/
public static final Long MC_ID = 1L;
}
package com.jumeirah.common.controller;
import com.jumeirah.common.entity.StrokeDiscount;
import com.jumeirah.common.param.StrokeDiscountPageParam;
import com.jumeirah.common.service.StrokeDiscountService;
import com.jumeirah.common.vo.StrokeDiscountQueryVo;
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-14
*/
/*@Slf4j
@RestController
@RequestMapping("/strokeDiscount")
@Api(value = "优惠行程表API", tags = {"优惠行程表"})*/
public class StrokeDiscountController extends BaseController {
@Autowired
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("/update")
@OperationLog(name = "修改优惠行程表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改优惠行程表")
public ApiResult<Boolean> updateStrokeDiscount(@Validated(Update.class) @RequestBody StrokeDiscount strokeDiscount) throws Exception {
boolean flag = strokeDiscountService.updateStrokeDiscount(strokeDiscount);
return ApiResult.result(flag);
}
/**
* 删除优惠行程表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除优惠行程表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除优惠行程表")
public ApiResult<Boolean> deleteStrokeDiscount(@PathVariable("id") Long id) throws Exception {
boolean flag = strokeDiscountService.deleteStrokeDiscount(id);
return ApiResult.result(flag);
}
/**
* 获取优惠行程表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "优惠行程表详情", type = OperationLogType.INFO)
@ApiOperation(value = "优惠行程表详情")
public ApiResult<StrokeDiscountQueryVo> getStrokeDiscount(@PathVariable("id") Long id) throws Exception {
StrokeDiscountQueryVo strokeDiscountQueryVo = strokeDiscountService.getStrokeDiscountById(id);
return ApiResult.ok(strokeDiscountQueryVo);
}
/**
* 优惠行程表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "优惠行程表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "优惠行程表分页列表")
public ApiResult<Paging<StrokeDiscountQueryVo>> getStrokeDiscountPageList(@Validated @RequestBody StrokeDiscountPageParam strokeDiscountPageParam) throws Exception {
Paging<StrokeDiscountQueryVo> paging = strokeDiscountService.getStrokeDiscountPageList(strokeDiscountPageParam);
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.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.util.Date;
/**
* 公务机出售/托管表
*
* @author giao
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BusinessPlain对象")
public class BusinessPlain extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "主键ID不能为空")
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotNull(message = "商家ID不能为空")
@ApiModelProperty("商家ID")
private Long mcId;
@NotNull(message = "业务类型,0-出售,1-托管不能为空")
@ApiModelProperty("业务类型,0-出售,1-托管")
private Integer businessType;
@ApiModelProperty("图片url")
private String imgUrl;
@ApiModelProperty("机型介绍")
private String introduction;
@ApiModelProperty("销售员姓名")
private String name;
@ApiModelProperty("销售联系电话")
private String phone;
@ApiModelProperty("微信号")
private String wechat;
@NotNull(message = "状态,0-正常,1-禁用,99-删除不能为空")
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
@ApiModelProperty("创建时间(时间戳)")
private Date createTime;
@ApiModelProperty("更新时间(时间戳)")
private Date updateTime;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
}
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.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 giao
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "CharterIntroduction对象")
public class CharterIntroduction extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "主键ID不能为空")
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotNull(message = "商家ID不能为空")
@ApiModelProperty("商家ID")
private Long mcId;
@NotNull(message = "状态,0-正常,1-取消,99-删除不能为空")
@ApiModelProperty("状态,0-正常,1-取消,99-删除")
private Integer status;
@ApiModelProperty("创建时间")
private Timestamp createTime;
@ApiModelProperty("更新时间")
private Timestamp updateTime;
@ApiModelProperty("包机图片url")
private String imgUrl;
@ApiModelProperty("包机文字")
private String text;
@ApiModelProperty("类型 1私人;2团体;3货运;4医疗")
private Integer type;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
}
package com.jumeirah.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
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;
import java.util.Date;
/**
* 航空公司商家表
*
* @author giao
* @since 2020-10-13
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Merchant对象")
public class Merchant extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("商家名称")
private String name;
@ApiModelProperty("联系人手机号码")
private String phone;
@ApiModelProperty("联系人手机区号")
private String phoneArea;
@ApiModelProperty("公司头像")
private String head;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@ApiModelProperty("商家开户银行")
private String rechargeBank;
@ApiModelProperty("商家开户名称")
private String rechargeName;
@ApiModelProperty("商家银行卡号")
private String rechargeBankNumber;
@ApiModelProperty("在列表展示的图片url")
private String imageListUrl;
@ApiModelProperty("公司介绍图片url")
private String imageCompanyIntroductionUrl;
@ApiModelProperty("团队介绍图片url")
private String imageTeamIntroductionUrl;
@ApiModelProperty("优势图片url")
private String imageAdvantageUrl;
@ApiModelProperty("公司介绍文字")
private String textCompanyIntroduction;
@ApiModelProperty("团队介绍文字")
private String textTeamIntroduction;
@ApiModelProperty("优势介绍文字")
private String textAdvantage;
@ApiModelProperty("航空公司名称")
private String airlineName;
@ApiModelProperty("列表图片高")
private Long imageListHeight;
@ApiModelProperty("列表图片宽")
private Long imageListWidth;
}
...@@ -85,25 +85,4 @@ public class MerchantUser extends BaseEntity { ...@@ -85,25 +85,4 @@ public class MerchantUser extends BaseEntity {
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty("在列表展示的图片url")
private String imageListUrl;
@ApiModelProperty("公司介绍图片url")
private String imageCompanyIntroductionUrl;
@ApiModelProperty("团队介绍图片url")
private String imageTeamIntroductionUrl;
@ApiModelProperty("优势图片url")
private String imageAdvantageUrl;
@ApiModelProperty("公司介绍文字")
private String textCompanyIntroduction;
@ApiModelProperty("团队介绍文字")
private String textTeamIntroduction;
@ApiModelProperty("优势介绍文字")
private String textAdvantage;
} }
...@@ -42,7 +42,6 @@ public class Stroke extends BaseEntity { ...@@ -42,7 +42,6 @@ public class Stroke extends BaseEntity {
@TableLogic @TableLogic
private Integer deleted; private Integer deleted;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称") @ApiModelProperty("出发城市名称")
private String cityOutsetName; private String cityOutsetName;
...@@ -50,15 +49,13 @@ public class Stroke extends BaseEntity { ...@@ -50,15 +49,13 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("到达城市id") @ApiModelProperty("到达城市id")
private Long cityArriveId; private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称") @ApiModelProperty("到达城市名称")
private String cityArriveName; private String cityArriveName;
@NotNull(message = "人数不能为空") @NotNull(message = "人数不能为空")
@ApiModelProperty("人数") @ApiModelProperty("人数")
private Integer peopleMun; private Integer peopleNum;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID") @ApiModelProperty("飞机型号ID")
private Long plainTypeId; private Long plainTypeId;
...@@ -70,7 +67,7 @@ public class Stroke extends BaseEntity { ...@@ -70,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-取消不能为空")
...@@ -91,7 +88,7 @@ public class Stroke extends BaseEntity { ...@@ -91,7 +88,7 @@ public class Stroke extends BaseEntity {
private String goodsSize; private String goodsSize;
@ApiModelProperty("货物重量,单位:吨") @ApiModelProperty("货物重量,单位:吨")
private Double goodsWeight; private String goodsWeight;
@ApiModelProperty("病人疾病名称") @ApiModelProperty("病人疾病名称")
private String diseaseName; private String diseaseName;
...@@ -171,16 +168,8 @@ public class Stroke extends BaseEntity { ...@@ -171,16 +168,8 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("用户充值截图证据, 传入数组") @ApiModelProperty("用户充值截图证据, 传入数组")
private String userRechargeCredentialsUrl; private String userRechargeCredentialsUrl;
// @NotBlank(message = "商家开户银行不能为空")
// @ApiModelProperty("商家开户银行") @ApiModelProperty("备注")
// private String rechargeBank; private String remark;
//
// @NotBlank(message = "商家开户名称不能为空")
// @ApiModelProperty("商家开户名称")
// private String rechargeName;
//
// @NotBlank(message = "商家银行卡号")
// @ApiModelProperty("商家银行卡号")
// private String rechargeBankNumber;
} }
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.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* 优惠行程表
*
* @author xxx
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "StrokeDiscount对象")
public class StrokeDiscount 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 cityOutsetId;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "座位数不能为空")
@ApiModelProperty("座位数")
private Integer seatNum;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@ApiModelProperty("飞机型号名称")
private String plainTypeName;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Timestamp outsetTime;
@ApiModelProperty("返程时间")
private Timestamp returnTime;
@NotNull(message = "状态,0-正常,1-完成,99-删除不能为空")
@ApiModelProperty("状态,0-正常,1-完成,99-删除")
private Integer status;
@NotNull(message = "创建时间不能为空")
@ApiModelProperty("创建时间")
private Timestamp createTime;
@ApiModelProperty("更新时间")
private Timestamp updateTime;
@ApiModelProperty("备注")
private String remarks;
@ApiModelProperty("价格")
private BigDecimal money;
@NotNull(message = "商家ID不能为空")
@ApiModelProperty("商家ID")
private Long mcId;
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.BusinessPlain;
import com.jumeirah.common.param.BusinessPlainPageParam;
import com.jumeirah.common.vo.BusinessPlainQueryForAppVo;
import com.jumeirah.common.vo.BusinessPlainQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
/**
* 公务机出售/托管表 Mapper 接口
*
* @author giao
* @since 2020-10-14
*/
@Repository
public interface BusinessPlainMapper extends BaseMapper<BusinessPlain> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
BusinessPlainQueryVo getBusinessPlainById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param businessPlainPageParam
* @return
*/
IPage<BusinessPlainQueryVo> getBusinessPlainPageList(@Param("page") Page page, @Param("param") BusinessPlainPageParam businessPlainPageParam);
IPage<BusinessPlainQueryForAppVo> getBusinessPlainPageListForApp(@Param("page") Page page, @Param("param") BusinessPlainPageParam businessPlainPageParam);
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.CharterIntroduction;
import com.jumeirah.common.param.CharterIntroductionPageParam;
import com.jumeirah.common.vo.CharterIntroductionQueryForAppVo;
import com.jumeirah.common.vo.CharterIntroductionQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
/**
* 包机介绍 Mapper 接口
*
* @author giao
* @since 2020-10-14
*/
@Repository
public interface CharterIntroductionMapper extends BaseMapper<CharterIntroduction> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
CharterIntroductionQueryVo getCharterIntroductionById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param charterIntroductionPageParam
* @return
*/
IPage<CharterIntroductionQueryVo> getCharterIntroductionPageList(@Param("page") Page page, @Param("param") CharterIntroductionPageParam charterIntroductionPageParam);
IPage<CharterIntroductionQueryForAppVo> getCharterIntroductionForAppPageList(@Param("page") Page page, @Param("param") CharterIntroductionPageParam charterIntroductionPageParam);
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.Merchant;
import com.jumeirah.common.param.MerchantPageParam;
import com.jumeirah.common.vo.MerchantQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
/**
* 航空公司商家表 Mapper 接口
*
* @author giao
* @since 2020-10-13
*/
@Repository
public interface MerchantMapper extends BaseMapper<Merchant> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
MerchantQueryVo getMerchantById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param merchantPageParam
* @return
*/
IPage<MerchantQueryVo> getMerchantPageList(@Param("page") Page page, @Param("param") MerchantPageParam merchantPageParam);
}
...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.MerchantUser; import com.jumeirah.common.entity.MerchantUser;
import com.jumeirah.common.param.MerchantUserPageParam; import com.jumeirah.common.param.MerchantUserPageParam;
import com.jumeirah.common.vo.MerchantUserQueryForAppVo;
import com.jumeirah.common.vo.MerchantUserQueryVo; import com.jumeirah.common.vo.MerchantUserQueryVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -38,8 +37,4 @@ public interface MerchantUserMapper extends BaseMapper<MerchantUser> { ...@@ -38,8 +37,4 @@ public interface MerchantUserMapper extends BaseMapper<MerchantUser> {
*/ */
IPage<MerchantUserQueryVo> getMerchantUserPageList(@Param("page") Page page, @Param("param") MerchantUserPageParam merchantUserPageParam); IPage<MerchantUserQueryVo> getMerchantUserPageList(@Param("page") Page page, @Param("param") MerchantUserPageParam merchantUserPageParam);
IPage<MerchantUserQueryForAppVo> getMerchantUserForAppPageList(@Param("page") Page page, @Param("param") MerchantUserPageParam merchantUserPageParam);
} }
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumeirah.common.entity.StrokeDiscount;
import com.jumeirah.common.param.StrokeDiscountPageParam;
import com.jumeirah.common.vo.StrokeDiscountQueryVo;
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-14
*/
@Repository
public interface StrokeDiscountMapper extends BaseMapper<StrokeDiscount> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
StrokeDiscountQueryVo getStrokeDiscountById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param strokeDiscountPageParam
* @return
*/
IPage<StrokeDiscountQueryVo> getStrokeDiscountPageList(@Param("page") Page page, @Param("param") StrokeDiscountPageParam strokeDiscountPageParam);
}
...@@ -41,6 +41,15 @@ public interface StrokeMapper extends BaseMapper<Stroke> { ...@@ -41,6 +41,15 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
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);
/** /**
* 查询已完成行程
* @param page
* @param strokePageParam
* @param userId
* @return
*/
IPage<StrokeQueryVo> getStrokePageListWithFinish(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId);
/**
* 商家端 获取行程分页对象 * 商家端 获取行程分页对象
* *
* @param page * @param page
......
package com.jumeirah.common.param;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <pre>
* 公务机出售/托管表 分页参数对象
* </pre>
*
* @author giao
* @date 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "公务机出售/托管表分页参数")
public class BusinessPlainPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty("类型,0-出售,1-托管")
private Integer type;
}
package com.jumeirah.common.param;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <pre>
* 包机介绍 分页参数对象
* </pre>
*
* @author giao
* @date 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "包机介绍分页参数")
public class CharterIntroductionPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty("类型 1私人;2团体;3货运;4医疗")
private Integer type = 1;
}
...@@ -22,7 +22,7 @@ import lombok.experimental.Accessors; ...@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
public class McStrokePageParam extends BasePageOrderParam { public class McStrokePageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗") @ApiModelProperty("行程类型,-1-全部,0-单程,1-往返行程,2-货运,3-医疗")
private Integer type; private Integer type;
@ApiModelProperty("主键id") @ApiModelProperty("主键id")
......
package com.jumeirah.common.param;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <pre>
* 航空公司商家表 分页参数对象
* </pre>
*
* @author giao
* @date 2020-10-13
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商家表分页参数")
public class MerchantPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
}
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-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "优惠行程表分页参数")
public class StrokeDiscountPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.BusinessPlain;
import com.jumeirah.common.param.BusinessPlainPageParam;
import com.jumeirah.common.vo.BusinessPlainQueryForAppVo;
import com.jumeirah.common.vo.BusinessPlainQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 公务机出售/托管表 服务类
*
* @author giao
* @since 2020-10-14
*/
public interface BusinessPlainService extends BaseService<BusinessPlain> {
/**
* 保存
*
* @param businessPlain
* @return
* @throws Exception
*/
boolean saveBusinessPlain(BusinessPlain businessPlain) throws Exception;
/**
* 修改
*
* @param businessPlain
* @return
* @throws Exception
*/
boolean updateBusinessPlain(BusinessPlain businessPlain) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteBusinessPlain(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
BusinessPlainQueryVo getBusinessPlainById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param businessPlainPageParam
* @return
* @throws Exception
*/
Paging<BusinessPlainQueryVo> getBusinessPlainPageList(BusinessPlainPageParam businessPlainPageParam) throws Exception;
Paging<BusinessPlainQueryForAppVo> getBusinessPlainPageListForApp(BusinessPlainPageParam businessPlainPageParam) throws Exception;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.CharterIntroduction;
import com.jumeirah.common.param.CharterIntroductionPageParam;
import com.jumeirah.common.vo.CharterIntroductionQueryForAppVo;
import com.jumeirah.common.vo.CharterIntroductionQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 包机介绍 服务类
*
* @author giao
* @since 2020-10-14
*/
public interface CharterIntroductionService extends BaseService<CharterIntroduction> {
/**
* 保存
*
* @param charterIntroduction
* @return
* @throws Exception
*/
boolean saveCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception;
/**
* 修改
*
* @param charterIntroduction
* @return
* @throws Exception
*/
boolean updateCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteCharterIntroduction(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
CharterIntroductionQueryVo getCharterIntroductionById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param charterIntroductionPageParam
* @return
* @throws Exception
*/
Paging<CharterIntroductionQueryVo> getCharterIntroductionPageList(CharterIntroductionPageParam charterIntroductionPageParam) throws Exception;
Paging<CharterIntroductionQueryForAppVo> getCharterIntroductionForAppPageList(CharterIntroductionPageParam charterIntroductionPageParam) throws Exception;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.Merchant;
import com.jumeirah.common.param.MerchantPageParam;
import com.jumeirah.common.vo.MerchantQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 航空公司商家表 服务类
*
* @author giao
* @since 2020-10-13
*/
public interface MerchantService extends BaseService<Merchant> {
/**
* 保存
*
* @param merchant
* @return
* @throws Exception
*/
boolean saveMerchant(Merchant merchant) throws Exception;
/**
* 修改
*
* @param merchant
* @return
* @throws Exception
*/
boolean updateMerchant(Merchant merchant) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteMerchant(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
MerchantQueryVo getMerchantById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param merchantPageParam
* @return
* @throws Exception
*/
Paging<MerchantQueryVo> getMerchantPageList(MerchantPageParam merchantPageParam) throws Exception;
}
...@@ -4,7 +4,6 @@ import com.jumeirah.common.entity.MerchantUser; ...@@ -4,7 +4,6 @@ import com.jumeirah.common.entity.MerchantUser;
import com.jumeirah.common.param.LoginParam; import com.jumeirah.common.param.LoginParam;
import com.jumeirah.common.param.MerchantUserPageParam; import com.jumeirah.common.param.MerchantUserPageParam;
import com.jumeirah.common.vo.LoginSysUserTokenVo; import com.jumeirah.common.vo.LoginSysUserTokenVo;
import com.jumeirah.common.vo.MerchantUserQueryForAppVo;
import com.jumeirah.common.vo.MerchantUserQueryVo; import com.jumeirah.common.vo.MerchantUserQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.service.BaseService; import io.geekidea.springbootplus.framework.common.service.BaseService;
...@@ -78,13 +77,5 @@ public interface MerchantUserService extends BaseService<MerchantUser> { ...@@ -78,13 +77,5 @@ public interface MerchantUserService extends BaseService<MerchantUser> {
/**
* 获取分页对象
*
* @param merchantUserPageParam
* @return
* @throws Exception
*/
Paging<MerchantUserQueryForAppVo> getMerchantUserPageListForApp(MerchantUserPageParam merchantUserPageParam) throws Exception;
} }
package com.jumeirah.common.service;
import com.jumeirah.common.entity.StrokeDiscount;
import com.jumeirah.common.param.StrokeDiscountPageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import com.jumeirah.common.vo.StrokeDiscountQueryVo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 优惠行程表 服务类
*
* @author xxx
* @since 2020-10-14
*/
public interface StrokeDiscountService extends BaseService<StrokeDiscount> {
/**
* 保存
*
* @param strokeDiscount
* @return
* @throws Exception
*/
boolean saveStrokeDiscount(StrokeDiscount strokeDiscount) throws Exception;
/**
* 修改
*
* @param strokeDiscount
* @return
* @throws Exception
*/
boolean updateStrokeDiscount(StrokeDiscount strokeDiscount) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteStrokeDiscount(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
StrokeDiscountQueryVo getStrokeDiscountById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param strokeDiscountPageParam
* @return
* @throws Exception
*/
Paging<StrokeDiscountQueryVo> getStrokeDiscountPageList(StrokeDiscountPageParam strokeDiscountPageParam) throws Exception;
}
package com.jumeirah.common.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.BusinessPlain;
import com.jumeirah.common.mapper.BusinessPlainMapper;
import com.jumeirah.common.param.BusinessPlainPageParam;
import com.jumeirah.common.service.BusinessPlainService;
import com.jumeirah.common.vo.BusinessPlainQueryForAppVo;
import com.jumeirah.common.vo.BusinessPlainQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 公务机出售/托管表 服务实现类
*
* @author giao
* @since 2020-10-14
*/
@Slf4j
@Service
public class BusinessPlainServiceImpl extends BaseServiceImpl<BusinessPlainMapper, BusinessPlain> implements BusinessPlainService {
@Autowired
private BusinessPlainMapper businessPlainMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveBusinessPlain(BusinessPlain businessPlain) throws Exception {
return super.save(businessPlain);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateBusinessPlain(BusinessPlain businessPlain) throws Exception {
return super.updateById(businessPlain);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteBusinessPlain(Long id) throws Exception {
return super.removeById(id);
}
@Override
public BusinessPlainQueryVo getBusinessPlainById(Long id) throws Exception {
return businessPlainMapper.getBusinessPlainById(id);
}
@Override
public Paging<BusinessPlainQueryVo> getBusinessPlainPageList(BusinessPlainPageParam businessPlainPageParam) throws Exception {
Page<BusinessPlainQueryVo> page = new PageInfo<>(businessPlainPageParam, OrderItem.desc(getLambdaColumn(BusinessPlain::getCreateTime)));
IPage<BusinessPlainQueryVo> iPage = businessPlainMapper.getBusinessPlainPageList(page, businessPlainPageParam);
return new Paging<>(iPage);
}
@Override
public Paging<BusinessPlainQueryForAppVo> getBusinessPlainPageListForApp(BusinessPlainPageParam businessPlainPageParam) throws Exception {
Page<BusinessPlainQueryForAppVo> page = new PageInfo<>(businessPlainPageParam, OrderItem.desc("bp.create_time"));
IPage<BusinessPlainQueryForAppVo> iPage = businessPlainMapper.getBusinessPlainPageListForApp(page, businessPlainPageParam);
return new Paging<>(iPage);
}
}
package com.jumeirah.common.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.CharterIntroduction;
import com.jumeirah.common.mapper.CharterIntroductionMapper;
import com.jumeirah.common.param.CharterIntroductionPageParam;
import com.jumeirah.common.service.CharterIntroductionService;
import com.jumeirah.common.vo.CharterIntroductionQueryForAppVo;
import com.jumeirah.common.vo.CharterIntroductionQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 包机介绍 服务实现类
*
* @author giao
* @since 2020-10-14
*/
@Slf4j
@Service
public class CharterIntroductionServiceImpl extends BaseServiceImpl<CharterIntroductionMapper, CharterIntroduction> implements CharterIntroductionService {
@Autowired
private CharterIntroductionMapper charterIntroductionMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception {
return super.save(charterIntroduction);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception {
return super.updateById(charterIntroduction);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteCharterIntroduction(Long id) throws Exception {
return super.removeById(id);
}
@Override
public CharterIntroductionQueryVo getCharterIntroductionById(Long id) throws Exception {
return charterIntroductionMapper.getCharterIntroductionById(id);
}
@Override
public Paging<CharterIntroductionQueryVo> getCharterIntroductionPageList(CharterIntroductionPageParam charterIntroductionPageParam) throws Exception {
Page<CharterIntroductionQueryVo> page = new PageInfo<>(charterIntroductionPageParam, OrderItem.desc(getLambdaColumn(CharterIntroduction::getCreateTime)));
IPage<CharterIntroductionQueryVo> iPage = charterIntroductionMapper.getCharterIntroductionPageList(page, charterIntroductionPageParam);
return new Paging<CharterIntroductionQueryVo>(iPage);
}
@Override
public Paging<CharterIntroductionQueryForAppVo> getCharterIntroductionForAppPageList(CharterIntroductionPageParam charterIntroductionPageParam) throws Exception {
Page<CharterIntroductionQueryForAppVo> page = new PageInfo<>(charterIntroductionPageParam, OrderItem.desc("ci.create_time"));
IPage<CharterIntroductionQueryForAppVo> iPage = charterIntroductionMapper.getCharterIntroductionForAppPageList(page, charterIntroductionPageParam);
return new Paging<>(iPage);
}
}
package com.jumeirah.common.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.Merchant;
import com.jumeirah.common.mapper.MerchantMapper;
import com.jumeirah.common.param.MerchantPageParam;
import com.jumeirah.common.service.MerchantService;
import com.jumeirah.common.vo.MerchantQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 航空公司商家表 服务实现类
*
* @author giao
* @since 2020-10-13
*/
@Slf4j
@Service
public class MerchantServiceImpl extends BaseServiceImpl<MerchantMapper, Merchant> implements MerchantService {
@Autowired
private MerchantMapper merchantMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveMerchant(Merchant merchant) throws Exception {
return super.save(merchant);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateMerchant(Merchant merchant) throws Exception {
return super.updateById(merchant);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteMerchant(Long id) throws Exception {
return super.removeById(id);
}
@Override
public MerchantQueryVo getMerchantById(Long id) throws Exception {
return merchantMapper.getMerchantById(id);
}
@Override
public Paging<MerchantQueryVo> getMerchantPageList(MerchantPageParam merchantPageParam) throws Exception {
Page<MerchantQueryVo> page = new PageInfo<>(merchantPageParam, OrderItem.desc(getLambdaColumn(Merchant::getCreateTime)));
IPage<MerchantQueryVo> iPage = merchantMapper.getMerchantPageList(page, merchantPageParam);
return new Paging<MerchantQueryVo>(iPage);
}
}
...@@ -15,7 +15,6 @@ import com.jumeirah.common.service.MerchantRolePermissionService; ...@@ -15,7 +15,6 @@ import com.jumeirah.common.service.MerchantRolePermissionService;
import com.jumeirah.common.service.MerchantRoleService; import com.jumeirah.common.service.MerchantRoleService;
import com.jumeirah.common.service.MerchantUserService; import com.jumeirah.common.service.MerchantUserService;
import com.jumeirah.common.vo.LoginSysUserTokenVo; import com.jumeirah.common.vo.LoginSysUserTokenVo;
import com.jumeirah.common.vo.MerchantUserQueryForAppVo;
import com.jumeirah.common.vo.MerchantUserQueryVo; import com.jumeirah.common.vo.MerchantUserQueryVo;
import io.geekidea.springbootplus.config.properties.JwtProperties; import io.geekidea.springbootplus.config.properties.JwtProperties;
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties; import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
...@@ -220,11 +219,5 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper, ...@@ -220,11 +219,5 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
return new Paging<MerchantUserQueryVo>(iPage); return new Paging<MerchantUserQueryVo>(iPage);
} }
@Override
public Paging<MerchantUserQueryForAppVo> getMerchantUserPageListForApp(MerchantUserPageParam merchantUserPageParam) throws Exception {
Page<MerchantUserQueryForAppVo> page = new PageInfo<>(merchantUserPageParam, OrderItem.desc(getLambdaColumn(MerchantUser::getCreateTime)));
IPage<MerchantUserQueryForAppVo> iPage = merchantUserMapper.getMerchantUserForAppPageList(page, merchantUserPageParam);
return new Paging<MerchantUserQueryForAppVo>(iPage);
}
} }
package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.StrokeDiscount;
import com.jumeirah.common.mapper.StrokeDiscountMapper;
import com.jumeirah.common.service.StrokeDiscountService;
import com.jumeirah.common.param.StrokeDiscountPageParam;
import com.jumeirah.common.vo.StrokeDiscountQueryVo;
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-14
*/
@Slf4j
@Service
public class StrokeDiscountServiceImpl extends BaseServiceImpl<StrokeDiscountMapper, StrokeDiscount> implements StrokeDiscountService {
@Autowired
private StrokeDiscountMapper strokeDiscountMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveStrokeDiscount(StrokeDiscount strokeDiscount) throws Exception {
return super.save(strokeDiscount);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateStrokeDiscount(StrokeDiscount strokeDiscount) throws Exception {
return super.updateById(strokeDiscount);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteStrokeDiscount(Long id) throws Exception {
return super.removeById(id);
}
@Override
public StrokeDiscountQueryVo getStrokeDiscountById(Long id) throws Exception {
return strokeDiscountMapper.getStrokeDiscountById(id);
}
@Override
public Paging<StrokeDiscountQueryVo> getStrokeDiscountPageList(StrokeDiscountPageParam strokeDiscountPageParam) throws Exception {
Page<StrokeDiscountQueryVo> page = new PageInfo<>(strokeDiscountPageParam, OrderItem.desc(getLambdaColumn(StrokeDiscount::getCreateTime)));
IPage<StrokeDiscountQueryVo> iPage = strokeDiscountMapper.getStrokeDiscountPageList(page, strokeDiscountPageParam);
return new Paging<StrokeDiscountQueryVo>(iPage);
}
}
...@@ -88,12 +88,14 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp ...@@ -88,12 +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())){
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageListWithFinish(page, strokePageParam, jwtToken.getUserId());
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);
} }
......
package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <pre>
* 公务机出售/托管表 查询结果对象
* </pre>
*
* @author giao
* @date 2020-10-14
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "BusinessPlainQueryForAppVo对象")
public class BusinessPlainQueryForAppVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("商家name")
private String mcName;
@ApiModelProperty("图片url")
private String imgUrl;
@ApiModelProperty("机型介绍")
private String introduction;
@ApiModelProperty("销售员姓名")
private String name;
@ApiModelProperty("销售联系电话")
private String phone;
@ApiModelProperty("微信号")
private String wechat;
@ApiModelProperty("商家头像")
private String mcHead;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
}
\ No newline at end of file
package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* 公务机出售/托管表 查询结果对象
* </pre>
*
* @author giao
* @date 2020-10-14
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "BusinessPlainQueryVo对象")
public class BusinessPlainQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("商家ID")
private Long mcId;
@ApiModelProperty("业务类型,0-出售,1-托管")
private Integer businessType;
@ApiModelProperty("图片url")
private String imgUrl;
@ApiModelProperty("机型介绍")
private String introduction;
@ApiModelProperty("销售员姓名")
private String name;
@ApiModelProperty("销售联系电话")
private String phone;
@ApiModelProperty("微信号")
private String wechat;
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
@ApiModelProperty("创建时间(时间戳)")
private Date createTime;
@ApiModelProperty("更新时间(时间戳)")
private Date updateTime;
}
\ No newline at end of file
package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <pre>
* 包机介绍 查询结果对象
* </pre>
*
* @author giao
* @date 2020-10-14
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "CharterIntroductionQueryForAppVo对象")
public class CharterIntroductionQueryForAppVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("商家name")
private String mcName;
@ApiModelProperty("商家头像")
private String mcHead;
@ApiModelProperty("包机图片url")
private String imgUrl;
@ApiModelProperty("包机文字")
private String text;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
}
\ No newline at end of file
package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* 包机介绍 查询结果对象
* </pre>
*
* @author giao
* @date 2020-10-14
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "CharterIntroductionQueryVo对象")
public class CharterIntroductionQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("商家ID")
private Long mcId;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
@ApiModelProperty("状态,0-正常,1-取消,99-删除")
private Integer status;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
}
\ No newline at end of file
...@@ -6,26 +6,60 @@ import lombok.Data; ...@@ -6,26 +6,60 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* <pre> * <pre>
* 商家 查询结果对象 * 航空公司商家表 查询结果对象
* </pre> * </pre>
* *
* @author wei * @author giao
* @date 2020-09-28 * @date 2020-10-13
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "MerchantUserQueryForAppVo对象") @ApiModel(value = "MerchantQueryVo对象")
public class MerchantUserQueryForAppVo implements Serializable { public class MerchantQueryVo implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("主键") @ApiModelProperty("主键")
private Long id; private Long id;
@ApiModelProperty("航空公司名称") @ApiModelProperty("商家名称")
private String airlineName; private String name;
@ApiModelProperty("联系人手机号码")
private String phone;
@ApiModelProperty("联系人手机区号")
private String phoneArea;
@ApiModelProperty("公司头像")
private String head;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除")
private Integer deleted;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@ApiModelProperty("商家开户银行")
private String rechargeBank;
@ApiModelProperty("商家开户名称")
private String rechargeName;
@ApiModelProperty("商家银行卡号")
private String rechargeBankNumber;
@ApiModelProperty("在列表展示的图片url") @ApiModelProperty("在列表展示的图片url")
private String imageListUrl; private String imageListUrl;
...@@ -47,4 +81,13 @@ public class MerchantUserQueryForAppVo implements Serializable { ...@@ -47,4 +81,13 @@ public class MerchantUserQueryForAppVo implements Serializable {
@ApiModelProperty("优势介绍文字") @ApiModelProperty("优势介绍文字")
private String textAdvantage; private String textAdvantage;
@ApiModelProperty("航空公司名称")
private String airlineName;
@ApiModelProperty("列表图片高")
private Long imageListHeight;
@ApiModelProperty("列表图片宽")
private Long imageListWidth;
} }
\ No newline at end of file
...@@ -76,25 +76,4 @@ public class MerchantUserQueryVo implements Serializable { ...@@ -76,25 +76,4 @@ public class MerchantUserQueryVo implements Serializable {
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private Timestamp updateTime; private Timestamp updateTime;
@ApiModelProperty("在列表展示的图片url")
private String imageListUrl;
@ApiModelProperty("公司介绍图片url")
private String imageCompanyIntroductionUrl;
@ApiModelProperty("团队介绍图片url")
private String imageTeamIntroductionUrl;
@ApiModelProperty("优势图片url")
private String imageAdvantageUrl;
@ApiModelProperty("公司介绍文字")
private String textCompanyIntroduction;
@ApiModelProperty("团队介绍文字")
private String textTeamIntroduction;
@ApiModelProperty("优势介绍文字")
private String textAdvantage;
} }
\ No newline at end of file
...@@ -56,7 +56,7 @@ public class StrokeDetailVo implements Serializable { ...@@ -56,7 +56,7 @@ public class StrokeDetailVo implements Serializable {
@NotNull(message = "人数不能为空") @NotNull(message = "人数不能为空")
@ApiModelProperty("人数") @ApiModelProperty("人数")
private Integer peopleMun; private Integer peopleNum;
@NotNull(message = "飞机型号ID不能为空") @NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID") @ApiModelProperty("飞机型号ID")
...@@ -155,4 +155,4 @@ public class StrokeDetailVo implements Serializable { ...@@ -155,4 +155,4 @@ public class StrokeDetailVo implements Serializable {
@ApiModelProperty("审核状态,0审核中,1审核通过,2审核未通过") @ApiModelProperty("审核状态,0审核中,1审核通过,2审核未通过")
private Integer auditStatus; private Integer auditStatus;
} }
\ No newline at end of file
package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* <pre>
* 优惠行程表 查询结果对象
* </pre>
*
* @author xxx
* @date 2020-10-14
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "StrokeDiscountQueryVo对象")
public class StrokeDiscountQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@ApiModelProperty("座位数")
private Integer seatNum;
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@ApiModelProperty("飞机型号名称")
private String plainTypeName;
@ApiModelProperty("出发时间")
private Timestamp outsetTime;
@ApiModelProperty("返程时间")
private Timestamp returnTime;
@ApiModelProperty("状态,0-正常,1-完成,99-删除")
private Integer status;
@ApiModelProperty("创建时间")
private Timestamp createTime;
@ApiModelProperty("更新时间")
private Timestamp updateTime;
@ApiModelProperty("备注")
private String remarks;
@ApiModelProperty("价格")
private BigDecimal money;
@ApiModelProperty("商家ID")
private Long mcId;
}
<?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.BusinessPlainMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, mc_id, business_type, img_url, introduction, name, phone, wechat, status, create_time, update_time,image_list_height,image_list_width
</sql>
<sql id="Base_Column_ListForApp">
bp.business_type, bp.img_url, bp.introduction, bp.name, bp.phone, bp.wechat,m.`name` AS mcName
</sql>
<select id="getBusinessPlainById" resultType="com.jumeirah.common.vo.BusinessPlainQueryVo">
select
<include refid="Base_Column_List"/>
from business_plain where id = #{id}
</select>
<select id="getBusinessPlainPageList" parameterType="com.jumeirah.common.param.BusinessPlainPageParam"
resultType="com.jumeirah.common.vo.BusinessPlainQueryVo">
select
<include refid="Base_Column_List"/>
from business_plain as bp
</select>
<select id="getBusinessPlainPageListForApp" parameterType="com.jumeirah.common.param.BusinessPlainPageParam"
resultType="com.jumeirah.common.vo.BusinessPlainQueryForAppVo">
select
<include refid="Base_Column_ListForApp"/>,bp.image_list_height,bp.image_list_width,m.`head` AS mcHead
from business_plain bp
INNER JOIN merchant m ON bp.mc_id=m.id
where bp.business_type=#{param.type}
</select>
</mapper>
<?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.CharterIntroductionMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, mc_id, status, create_time, update_time,type,text,img_url,image_list_height,image_list_width
</sql>
<sql id="Base_Column_ListForApp">
text,img_url,ci.image_list_height,ci.image_list_width,m.head AS mcHead,m.name AS mcName
</sql>
<select id="getCharterIntroductionById" resultType="com.jumeirah.common.vo.CharterIntroductionQueryVo">
select
<include refid="Base_Column_List"/>
from charter_introduction where id = #{id}
</select>
<select id="getCharterIntroductionPageList" parameterType="com.jumeirah.common.param.CharterIntroductionPageParam"
resultType="com.jumeirah.common.vo.CharterIntroductionQueryVo">
select
<include refid="Base_Column_List"/>
from charter_introduction
</select>
<select id="getCharterIntroductionForAppPageList"
parameterType="com.jumeirah.common.param.CharterIntroductionPageParam"
resultType="com.jumeirah.common.vo.CharterIntroductionQueryForAppVo">
select
<include refid="Base_Column_ListForApp"/>
from charter_introduction ci
INNER JOIN merchant m ON ci.mc_id=m.id
where ci.type = #{param.type}
</select>
</mapper>
<?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.MerchantMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, phone, phone_area, head, remark, state, deleted, create_time, update_time, recharge_bank, recharge_name, recharge_bank_number, image_list_url, image_company_introduction_url, image_team_introduction_url, image_advantage_url, text_company_introduction, text_team_introduction, text_advantage, airline_name,image_list_height,image_list_width
</sql>
<select id="getMerchantById" resultType="com.jumeirah.common.vo.MerchantQueryVo">
select
<include refid="Base_Column_List"/>
from merchant where id = #{id}
</select>
<select id="getMerchantPageList" parameterType="com.jumeirah.common.param.MerchantPageParam"
resultType="com.jumeirah.common.vo.MerchantQueryVo">
select
<include refid="Base_Column_List"/>
from merchant
</select>
</mapper>
<?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.StrokeDiscountMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id,
city_outset_id,
city_outset_name,
city_arrive_id,
city_arrive_name,
seat_num,
plain_type_id,
plain_type_name,
outset_time,
return_time,
status,
create_time,
update_time,
remarks,
money,
mc_id
</sql>
<select id="getStrokeDiscountById" resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo">
select
<include refid="Base_Column_List"/>
from stroke_discount where id = #{id}
</select>
<select id="getStrokeDiscountPageList" parameterType="com.jumeirah.common.param.StrokeDiscountPageParam"
resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo">
select
ctco.city_name_cn as city_outset_name,
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>
</mapper>
...@@ -7,10 +7,8 @@ ...@@ -7,10 +7,8 @@
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_mun,
plain_type_id, plain_type_id,
outset_time, outset_time,
return_time, return_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_mun, 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
<include refid="Page_Column_List"/> 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"/>
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
...@@ -54,6 +94,28 @@ ...@@ -54,6 +94,28 @@
</where> </where>
</select> </select>
<!-- 已完成订单-->
<select id="getStrokePageListWithFinish" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo">
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"/>
from stroke s
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>
and s.user_id = #{userId}
and s.deleted = 0
and s.`status` = #{param.status}
or s.`status` = 99
</where>
</select>
<select id="getMcStrokePageList" parameterType="com.jumeirah.common.param.McStrokePageParam" <select id="getMcStrokePageList" parameterType="com.jumeirah.common.param.McStrokePageParam"
resultType="com.jumeirah.common.vo.McStrokeQueryVo"> resultType="com.jumeirah.common.vo.McStrokeQueryVo">
SELECT SELECT
...@@ -64,27 +126,23 @@ ...@@ -64,27 +126,23 @@
stroke s stroke s
LEFT JOIN app_user au ON au.id = s.user_id LEFT JOIN app_user au ON au.id = s.user_id
<where> <where>
<if test="mcStrokePageParam.type !=null"> <if test="mcStrokePageParam.type != null and mcStrokePageParam.type != -1">
AND s.type = #{mcStrokePageParam.type} AND s.type = #{mcStrokePageParam.type}
</if> </if>
<if test="mcStrokePageParam.id !=null"> <if test="mcStrokePageParam.id != null and mcStrokePageParam.id != 0">
AND s.id = #{mcStrokePageParam.id} AND s.id = #{mcStrokePageParam.id}
</if> </if>
<if test="mcStrokePageParam.startTime !=null and mcStrokePageParam.startTime != ''"> <if test="mcStrokePageParam.startTime != null and mcStrokePageParam.startTime != ''">
AND s.create_time &gt;= #{mcStrokePageParam.startTime} AND s.create_time &gt;= #{mcStrokePageParam.startTime}
</if> </if>
<if test="mcStrokePageParam.endTime !=null and mcStrokePageParam.endTime != ''"> <if test="mcStrokePageParam.endTime != null and mcStrokePageParam.endTime != ''">
AND s.create_time &lt;= #{mcStrokePageParam.endTime} AND s.create_time &lt;= #{mcStrokePageParam.endTime}
</if> </if>
<if test="mcStrokePageParam.applicant !=null and mcStrokePageParam.applicant != ''"> <if test="mcStrokePageParam.applicant != null and mcStrokePageParam.applicant != ''">
AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%') AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
</if> </if>
</where> </where>
WHERE ORDER BY s.create_time DESC
s.type = 2
AND s.id = 1
AND (s.create_time BETWEEN '2020-10-07 15:32:30' AND '2020-10-12 15:32:30')
AND CONCAT( au.surname, au.`name` ) LIKE '%姓名'
</select> </select>
</mapper> </mapper>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, username, nickname, password, salt, phone, phone_area, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time, recharge_bank, recharge_name, recharge_bank_number, image_list_url, image_company_introduction_url, image_team_introduction_url, image_advantage_url, text_company_introduction, text_team_introduction, text_advantage,airline_name id, username, nickname, password, salt, phone, phone_area, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time
</sql> </sql>
<select id="getMerchantUserById" resultType="com.jumeirah.common.vo.MerchantUserQueryVo"> <select id="getMerchantUserById" resultType="com.jumeirah.common.vo.MerchantUserQueryVo">
...@@ -20,12 +20,6 @@ ...@@ -20,12 +20,6 @@
from merchant_user from merchant_user
</select> </select>
<select id="getMerchantUserForAppPageList" parameterType="com.jumeirah.common.param.MerchantUserPageParam"
resultType="com.jumeirah.common.vo.MerchantUserQueryForAppVo">
select
<include refid="Base_Column_List"/>
from merchant_user
</select>
......
...@@ -192,10 +192,18 @@ spring-boot-plus: ...@@ -192,10 +192,18 @@ spring-boot-plus:
# 排除Swagger # 排除Swagger
- ${spring-boot-plus.swagger-paths} - ${spring-boot-plus.swagger-paths}
# 排除actuator # 排除actuator
# - /actuator/** # - /actuator/**
- # 排除首页 - # 排除首页
- /,/index.html - /,/index.html
- /app/noRole - /app/noRole
# 航空公司介绍分页列表
- /app/airline/getPageList
# 公务机出售托管表分页列表
- /app/businessPlain/getPageList
# 包机介绍分页列表
- /app/charterIntroduction/getPageList
# 优惠调机列表分页查询
- /app/strokeDiscount/getPageList
# 多行字符串权限配置 # 多行字符串权限配置
filter-chain-definitions: | filter-chain-definitions: |
......
...@@ -19,7 +19,6 @@ package io.geekidea.springbootplus.framework.shiro.jwt; ...@@ -19,7 +19,6 @@ package io.geekidea.springbootplus.framework.shiro.jwt;
import io.geekidea.springbootplus.config.properties.JwtProperties; import io.geekidea.springbootplus.config.properties.JwtProperties;
import io.geekidea.springbootplus.framework.common.api.ApiCode; import io.geekidea.springbootplus.framework.common.api.ApiCode;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.shiro.cache.SysLoginRedisService;
import io.geekidea.springbootplus.framework.shiro.service.ShiroLoginService; import io.geekidea.springbootplus.framework.shiro.service.ShiroLoginService;
import io.geekidea.springbootplus.framework.shiro.util.JwtTokenUtil; import io.geekidea.springbootplus.framework.shiro.util.JwtTokenUtil;
import io.geekidea.springbootplus.framework.shiro.util.JwtUtil; import io.geekidea.springbootplus.framework.shiro.util.JwtUtil;
...@@ -32,7 +31,6 @@ import org.apache.shiro.authc.AuthenticationToken; ...@@ -32,7 +31,6 @@ import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.AuthenticatingFilter; import org.apache.shiro.web.filter.authc.AuthenticatingFilter;
import org.apache.shiro.web.util.WebUtils; import org.apache.shiro.web.util.WebUtils;
import org.springframework.data.redis.core.RedisTemplate;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse; import javax.servlet.ServletResponse;
...@@ -50,13 +48,11 @@ import javax.servlet.http.HttpServletResponse; ...@@ -50,13 +48,11 @@ import javax.servlet.http.HttpServletResponse;
public class JwtFilter extends AuthenticatingFilter { public class JwtFilter extends AuthenticatingFilter {
private final ShiroLoginService shiroLoginService; private final ShiroLoginService shiroLoginService;
private final SysLoginRedisService sysLoginRedisService;
private final JwtProperties jwtProperties; private final JwtProperties jwtProperties;
public JwtFilter(ShiroLoginService shiroLoginService, SysLoginRedisService loginRedisService, JwtProperties jwtProperties, RedisTemplate redisTemplate) { public JwtFilter(ShiroLoginService shiroLoginService, JwtProperties jwtProperties) {
this.shiroLoginService = shiroLoginService; this.shiroLoginService = shiroLoginService;
this.sysLoginRedisService = loginRedisService;
this.jwtProperties = jwtProperties; this.jwtProperties = jwtProperties;
} }
......
...@@ -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