Commit 58238158 by zhangjw

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

parents 19327a2f bf110aa3
......@@ -3,6 +3,7 @@ package com.jumeirah.api.app.controller;
import com.jumeirah.api.app.service.AppUserApiService;
import com.jumeirah.common.param.app.AppSmsRegisterParam;
import com.jumeirah.common.param.app.AppUserInfoParam;
import com.jumeirah.common.param.app.AppUserPhoneUpdateParam;
import com.jumeirah.common.service.AppUserService;
import com.jumeirah.common.vo.app.LoginAppUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
......@@ -19,7 +20,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
......@@ -58,9 +58,9 @@ public class AppUserController extends BaseController {
@PostMapping("/updatePhone")
@OperationLog(name = "修改手机号", type = OperationLogType.ADD)
@ApiOperation(value = "修改手机号", response = ApiResult.class)
public ApiResult<Boolean> updatePhone(@RequestParam String phoneArea, @RequestParam String phone, @RequestParam String code) throws Exception {
public ApiResult<Boolean> updatePhone(@RequestBody AppUserPhoneUpdateParam userPhoneUpdateParam) throws Exception {
return appUserApiService.updatePhone(phoneArea, phone, code);
return appUserApiService.updatePhone(userPhoneUpdateParam.getPhoneArea(), userPhoneUpdateParam.getPhone(), userPhoneUpdateParam.getCode());
}
/* *//**
......
......@@ -38,6 +38,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.Instant;
/**
* 行程表 控制器
......@@ -66,6 +68,7 @@ public class StrokeController extends BaseController {
Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokePaymentInfoParam, stroke);
stroke.setPaymentStatus(StatePaymentStatusEnum.PAYING.getCode());
stroke.setUserRechargeTime(Timestamp.from(Instant.now()));
boolean flag = strokeService.update(stroke, new UpdateWrapper<Stroke>().lambda()
.eq(Stroke::getUserId, jwtToken.getUserId())
.eq(Stroke::getId, strokePaymentInfoParam.getId())
......
package com.jumeirah.api.merchant.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jumeirah.common.entity.CharterIntroduction;
import com.jumeirah.common.param.CharterIntroductionAddParam;
import com.jumeirah.common.param.CharterIntroductionUpdateParam;
import com.jumeirah.common.service.CharterIntroductionService;
import com.jumeirah.common.vo.CharterIntroductionQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
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.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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;
import java.util.List;
/**
* 包机介绍 控制器
*
* @author giao
* @since 2020-10-14
*/
@Slf4j
@RestController
@RequestMapping("/merchant/charterIntroduction")
@Api(value = "包机介绍API", tags = {"包机介绍"})
public class CharterIntroductionForMerController extends BaseController {
@Autowired
private CharterIntroductionService charterIntroductionService;
/**
* 添加包机介绍
*/
@PostMapping("/add")
@OperationLog(name = "添加包机介绍", type = OperationLogType.ADD)
@ApiOperation(value = "添加包机介绍")
@RequiresPermissions("merchant:aircraft:management:edit")
public ApiResult<Boolean> addCharterIntroduction(@Validated(Add.class) @RequestBody CharterIntroductionAddParam charterIntroductionAddParam) throws Exception {
boolean flag = charterIntroductionService.saveCharterIntroduction(charterIntroductionAddParam);
return ApiResult.result(flag);
}
/**
* 修改包机介绍
*/
@PostMapping("/update")
@OperationLog(name = "修改包机介绍", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改包机介绍")
@RequiresPermissions("merchant:aircraft:management:edit")
public ApiResult<Boolean> updateCharterIntroduction(@Validated(Update.class) @RequestBody CharterIntroductionUpdateParam charterIntroductionUpdateParam) throws Exception {
boolean flag = charterIntroductionService.updateCharterIntroduction(charterIntroductionUpdateParam);
return ApiResult.result(flag);
}
/**
* 删除包机介绍
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除包机介绍", type = OperationLogType.DELETE)
@ApiOperation(value = "删除包机介绍")
@RequiresPermissions("merchant:aircraft:management:edit")
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 = "包机介绍详情")
@RequiresPermissions("merchant:aircraft:management:view")
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 = "包机介绍分页列表")
@RequiresPermissions("merchant:aircraft:management:view")
public ApiResult<List<CharterIntroduction>> getCharterIntroductionPageList() throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
List<CharterIntroduction> list = charterIntroductionService.list(
new QueryWrapper<CharterIntroduction>().lambda().eq(CharterIntroduction::getMcId, jwtToken.getMcId()));
return ApiResult.ok(list);
}
}
package com.jumeirah.api.merchant.controller;
import com.jumeirah.common.param.MerchantLoginParam;
import com.jumeirah.common.param.MerchantUpdatePwdParam;
import com.jumeirah.common.service.MerchantService;
import com.jumeirah.common.service.MerchantUserService;
import com.jumeirah.common.vo.LoginMerUserTokenVo;
......@@ -100,6 +101,14 @@ public class MerchantUserController extends BaseController {
return merchantUserService.login(merchantLoginParam);
}
@PostMapping("/updatePwd")
@OperationLogIgnore
@ApiOperation(value = "商家用户修改密码", notes = "商家用户修改密码, 修改完后需要跳到登陆界面,并重新登陆")
public ApiResult<Boolean> updatePwd(@Validated @RequestBody MerchantUpdatePwdParam merchantUpdatePwdParam) throws Exception {
return merchantUserService.updatePwd(merchantUpdatePwdParam);
}
// @PostMapping("/register")
// @OperationLogIgnore
// @ApiOperation(value = "注册", notes = "商家注册")
......
package com.jumeirah.api.merchant.controller.order;
import com.jumeirah.common.entity.PlainType;
import com.jumeirah.common.service.PlainTypeService;
import com.jumeirah.common.vo.PlainTypeQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 飞机型号表 控制器
*
* @author wei
* @since 2020-10-09
*/
@Slf4j
@RestController
@RequestMapping("/merchant/plainType")
@Module("${cfg.module}")
@Api(value = "飞机型号表API", tags = {"飞机型号"})
public class McPlainTypeController extends BaseController {
@Autowired
private PlainTypeService plainTypeService;
/**
* 获取飞机型号列表
*/
@GetMapping("/getAllList")
@OperationLog(name = "获取飞机型号列表", type = OperationLogType.PAGE)
@ApiOperation(value = "获取飞机型号列表", response = PlainTypeQueryVo.class)
@RequiresPermissions("merchant:aircraft:management:view")
public ApiResult<List<PlainType> > getAllList() throws Exception {
List<PlainType> plainTypeList = plainTypeService.getAllMap();
return ApiResult.ok(plainTypeList);
}
}
......@@ -17,6 +17,7 @@ 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.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
......@@ -25,6 +26,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.sql.Timestamp;
/**
* 行程表 控制器
*
......@@ -46,9 +49,11 @@ public class McStrokeController extends BaseController {
@PostMapping("/complete")
@OperationLog(name = "完成行程接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "完成行程接口", response = ApiResult.class)
@RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> completeStroke(@Validated @RequestBody StrokeCompleteParam strokeCompleteParam) throws Exception {
Stroke stroke = new Stroke();
stroke.setId(strokeCompleteParam.getId())
.setUpdateTime(new Timestamp(System.currentTimeMillis()))
.setStatus(StrokeStatusEnum.COMPLETED.getCode());
boolean flag = strokeService.updateStroke(stroke);
return ApiResult.result(flag);
......@@ -60,6 +65,7 @@ public class McStrokeController extends BaseController {
@PostMapping("/getPageList")
@OperationLog(name = "行程分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "行程分页列表")
@RequiresPermissions("merchant:order:view")
public ApiResult<Paging<McStrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody McStrokePageParam mcStrokePageParam) throws Exception {
Paging<McStrokeQueryVo> paging = strokeService.getMcStrokePageList(mcStrokePageParam);
return ApiResult.ok(paging);
......@@ -71,9 +77,11 @@ public class McStrokeController extends BaseController {
@PostMapping("/update/quotedPrice")
@OperationLog(name = "行程报价接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "行程报价接口", response = ApiResult.class)
@RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> updateStroke(@Validated @RequestBody StrokeQuotedPriceParam strokeQuotedPriceParam) throws Exception {
Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeQuotedPriceParam, stroke);
stroke.setUpdateTime(new Timestamp(System.currentTimeMillis()));
boolean flag = strokeService.updateStroke(stroke);
return ApiResult.result(flag);
}
......@@ -84,9 +92,11 @@ public class McStrokeController extends BaseController {
@PostMapping("/discount/check")
@OperationLog(name = "优惠调机审核接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "优惠调机审核接口", response = ApiResult.class)
@RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> checkStrokeDiscount(@Validated @RequestBody StrokeDiscountCheckParam strokeDiscountCheckParam) throws Exception {
Stroke stroke = new Stroke();
stroke.setId(strokeDiscountCheckParam.getId())
.setUpdateTime(new Timestamp(System.currentTimeMillis()))
.setAuditStatus(strokeDiscountCheckParam.getAuditStatus());
boolean flag = strokeService.updateStroke(stroke);
return ApiResult.result(flag);
......@@ -98,15 +108,18 @@ public class McStrokeController extends BaseController {
@PostMapping("/confirmPayment")
@OperationLog(name = "优惠调机审核接口", type = OperationLogType.UPDATE)
@ApiOperation(value = "优惠调机审核接口", response = ApiResult.class)
@RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> confirmPaymentStroke(@Validated @RequestBody StrokeConfirmPaymentParam strokeConfirmPaymentParam) throws Exception {
Stroke stroke = new Stroke();
stroke.setId(strokeConfirmPaymentParam.getId())
.setStatus(StrokeStatusEnum.PROCESSING.getCode())
.setUpdateTime(new Timestamp(System.currentTimeMillis()))
.setPaymentStatus(strokeConfirmPaymentParam.getPaymentStatus());
boolean flag = strokeService.updateStroke(stroke);
return ApiResult.result(flag);
}
/* *//**
/* *//**
* 修改行程表
*//*
@PostMapping("/update")
......
package com.jumeirah.api.merchant.controller.plain;
import com.jumeirah.api.merchant.entity.param.McBusinessPlainAddParam;
import com.jumeirah.common.entity.BusinessPlain;
import com.jumeirah.common.param.BusinessPlainPageParam;
import com.jumeirah.common.service.BusinessPlainService;
import com.jumeirah.common.vo.BusinessPlainQueryVo;
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.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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-14
*/
@Slf4j
@RestController
@RequestMapping("/merchant/businessPlain")
@Api(value = "公务机出售托管表API", tags = {"公务机出售托管表"})
public class McBusinessPlainController extends BaseController {
@Autowired
private BusinessPlainService businessPlainService;
/**
* 添加公务机出售托管表
*/
@PostMapping("/add")
@OperationLog(name = "添加公务机出售托管表", type = OperationLogType.ADD)
@ApiOperation(value = "添加公务机出售托管表")
public ApiResult<Boolean> addBusinessPlain(@Validated(Add.class) @RequestBody McBusinessPlainAddParam mcBusinessPlainAddParam) throws Exception {
BusinessPlain businessPlain = new BusinessPlain();
BeanUtils.copyProperties(mcBusinessPlainAddParam, businessPlain);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
businessPlain.setMcId(jwtToken.getMcId());
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 McBusinessPlainAddParam mcBusinessPlainAddParam) throws Exception {
BusinessPlain businessPlain = new BusinessPlain();
BeanUtils.copyProperties(mcBusinessPlainAddParam, businessPlain);
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);
}
/**
* 公务机出售托管表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "公务机出售托管表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "公务机出售托管表分页列表")
public ApiResult<Paging<BusinessPlainQueryVo>> getBusinessPlainPageList(@Validated @RequestBody BusinessPlainPageParam businessPlainPageParam) throws Exception {
Paging<BusinessPlainQueryVo> paging = businessPlainService.getBusinessPlainPageList(businessPlainPageParam);
return ApiResult.ok(paging);
}
// /**
// * 获取公务机出售托管表详情
// */
// @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);
// }
}
package com.jumeirah.api.merchant.controller.plain;
import com.jumeirah.api.merchant.entity.param.McPlainAddParam;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.service.McPlainService;
import com.jumeirah.common.vo.McPlainQueryVo;
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.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 商家飞机表 控制器
*
* @author xxx
* @since 2020-10-19
*/
@Slf4j
@RestController
@RequestMapping("/merchant/mcPlain")
@Api(value = "商家飞机表API", tags = {"商家飞机表"})
public class McPlainController extends BaseController {
@Autowired
private McPlainService mcPlainService;
/**
* 添加商家飞机表
*/
@PostMapping("/add")
@OperationLog(name = "添加商家飞机表", type = OperationLogType.ADD)
@ApiOperation(value = "添加商家飞机表")
@RequiresPermissions("merchant:aircraft:management:edit")
public ApiResult<Boolean> addMcPlain(@Validated(Add.class) @RequestBody McPlainAddParam mcPlainAddParam) throws Exception {
McPlain mcPlain = new McPlain();
BeanUtils.copyProperties(mcPlainAddParam, mcPlain);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
mcPlain.setMcId(jwtToken.getMcId());
boolean flag = mcPlainService.saveMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 修改商家飞机表
*/
@PostMapping("/update")
@OperationLog(name = "修改商家飞机表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改商家飞机表")
@RequiresPermissions("merchant:aircraft:management:edit")
public ApiResult<Boolean> updateMcPlain(@Validated(Update.class) @RequestBody McPlainAddParam mcPlainAddParam) throws Exception {
McPlain mcPlain = new McPlain();
BeanUtils.copyProperties(mcPlainAddParam, mcPlain);
boolean flag = mcPlainService.updateMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 删除商家飞机表
*/
@PostMapping("/delete/{id}")
@RequiresPermissions("merchant:aircraft:management:edit")
@OperationLog(name = "删除商家飞机表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除商家飞机表")
public ApiResult<Boolean> deleteMcPlain(@PathVariable("id") Long id) throws Exception {
boolean flag = mcPlainService.deleteMcPlain(id);
return ApiResult.result(flag);
}
/**
* 获取商家飞机表详情
*/
/* @GetMapping("/info/{id}")
@OperationLog(name = "商家飞机表详情", type = OperationLogType.INFO)
@ApiOperation(value = "商家飞机表详情")
public ApiResult<McPlainQueryVo> getMcPlain(@PathVariable("id") Long id) throws Exception {
McPlainQueryVo mcPlainQueryVo = mcPlainService.getMcPlainById(id);
return ApiResult.ok(mcPlainQueryVo);
}*/
/**
* 商家飞机表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "商家飞机表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "商家飞机表分页列表")
@RequiresPermissions("merchant:aircraft:management:view")
public ApiResult<Paging<McPlainQueryVo>> getMcPlainPageList(@Validated @RequestBody McPlainPageParam mcPlainPageParam) throws Exception {
Paging<McPlainQueryVo> paging = mcPlainService.getMcPlainPageList(mcPlainPageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.api.merchant.controller.plain;
import com.jumeirah.api.merchant.entity.param.McStrokeDiscountAddParam;
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.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 优惠行程表 控制器
*
* @author xxx
* @since 2020-10-14
*/
@Slf4j
@RestController
@RequestMapping("/merchant/strokeDiscount")
@Api(value = "优惠行程表API", tags = {"优惠行程表"})
public class McStrokeDiscountController extends BaseController {
@Autowired
private StrokeDiscountService strokeDiscountService;
/**
* 添加优惠行程表
*/
@PostMapping("/add")
@OperationLog(name = "添加优惠行程表", type = OperationLogType.ADD)
@ApiOperation(value = "添加优惠行程表")
@RequiresPermissions("merchant:aircraft:management:edit")
public ApiResult<Boolean> addStrokeDiscount(@Validated(Add.class) @RequestBody McStrokeDiscountAddParam mcStrokeDiscountAddParam) throws Exception {
StrokeDiscount strokeDiscount = new StrokeDiscount();
BeanUtils.copyProperties(mcStrokeDiscountAddParam,strokeDiscount);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
strokeDiscount.setMcId(jwtToken.getMcId());
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 = "删除优惠行程表")
@RequiresPermissions("merchant:aircraft:management:edit")
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 = "优惠行程表分页列表")
@RequiresPermissions("merchant:aircraft:management:view")
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.merchant.entity.param;
import com.jumeirah.common.entity.base.ImgJson;
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.List;
/**
* 公务机出售/托管表
*
* @author giao
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BusinessPlain对象")
public class McBusinessPlainAddParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
private Long id;
@NotNull(message = "业务类型,0-出售,1-托管不能为空")
@ApiModelProperty("业务类型,0-出售,1-托管")
private Integer businessType;
@ApiModelProperty("机型介绍")
private String introduction;
@ApiModelProperty("销售员姓名")
private String name;
@ApiModelProperty("销售联系电话")
private String phone;
@ApiModelProperty("微信号")
private String wechat;
@ApiModelProperty("图片相关数据json")
private List<ImgJson> imgUrl;
}
package com.jumeirah.api.merchant.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
/**
* 商家飞机表
*
* @author xxx
* @since 2020-10-19
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "McPlain对象")
public class McPlainAddParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
private Long id;
@NotNull(message = "飞机类型ID不能为空")
@ApiModelProperty("飞机类型ID")
private Long ptId;
@NotNull(message = "数量不能为空")
@ApiModelProperty("数量")
private Integer amount;
@NotNull(message = "所在地城市ID不能为空")
@ApiModelProperty("所在地城市ID")
private Long cityId;
}
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 xxx
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "StrokeDiscount对象")
public class McStrokeDiscountAddParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotNull(message = "座位数不能为空")
@ApiModelProperty("座位数")
private Integer seatNum;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@ApiModelProperty("飞机型号名称")
private String plainTypeName;
@ApiModelProperty("价格")
private BigDecimal money;
}
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.geekidea.springbootplus.test;
import java.sql.Timestamp;
import java.time.Instant;
/**
* @author geekidea
* @date 2020/3/16
**/
public class TimestampTest {
public static void main(String[] args) {
// 获取当前时间戳
Timestamp from = Timestamp.from(Instant.now());
System.out.println(from);
}
}
package com.jumeirah.common.campusstore;
import com.alibaba.fastjson.JSONArray;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
*
* @description 用以mysql中json格式的字段,进行转换的自定义转换器,转换为实体类的JSONArray属性
* MappedTypes注解中的类代表此转换器可以自动转换为的java对象
* MappedJdbcTypes注解中设置的是对应的jdbctype
*/
@MappedTypes(JSONArray.class)
@MappedJdbcTypes(JdbcType.VARCHAR)
public class ArrayJsonHandler extends BaseTypeHandler<JSONArray> {
//设置非空参数
@Override
public void setNonNullParameter(PreparedStatement ps, int i, JSONArray parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, String.valueOf(parameter.toJSONString()));
}
//根据列名,获取可以为空的结果
@Override
public JSONArray getNullableResult(ResultSet rs, String columnName) throws SQLException {
String sqlJson = rs.getString(columnName);
if (null != sqlJson){
return JSONArray.parseArray(sqlJson);
}
return null;
}
//根据列索引,获取可以为空的结果
@Override
public JSONArray getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String sqlJson = rs.getString(columnIndex);
if (null != sqlJson){
return JSONArray.parseArray(sqlJson);
}
return null;
}
@Override
public JSONArray getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String sqlJson = cs.getString(columnIndex);
if (null != sqlJson){
return JSONArray.parseArray(sqlJson);
}
return null;
}
}
package com.jumeirah.common.campusstore;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
*
* @description 用以mysql中json格式的字段,进行转换的自定义转换器,转换为实体类的JSONObject属性
* MappedTypes注解中的类代表此转换器可以自动转换为的java对象
* MappedJdbcTypes注解中设置的是对应的jdbctype
*/
@MappedTypes(JSONObject.class)
@MappedJdbcTypes(JdbcType.VARCHAR)
public class ObjectJsonHandler extends BaseTypeHandler<JSONObject>{
//设置非空参数
@Override
public void setNonNullParameter(PreparedStatement ps, int i, JSONObject parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, String.valueOf(parameter.toJSONString()));
}
//根据列名,获取可以为空的结果
@Override
public JSONObject getNullableResult(ResultSet rs, String columnName) throws SQLException {
String sqlJson = rs.getString(columnName);
if (null != sqlJson){
return JSONObject.parseObject(sqlJson);
}
return null;
}
//根据列索引,获取可以为空的结果
@Override
public JSONObject getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String sqlJson = rs.getString(columnIndex);
if (null != sqlJson){
return JSONObject.parseObject(sqlJson);
}
return null;
}
@Override
public JSONObject getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String sqlJson = cs.getString(columnIndex);
if (null != sqlJson){
return JSONObject.parseObject(sqlJson);
}
return null;
}
}
package com.jumeirah.common.controller;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.vo.McPlainQueryVo;
import com.jumeirah.common.service.McPlainService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* 商家飞机表 控制器
*
* @author xxx
* @since 2020-10-19
*/
/*@Slf4j
@RestController
@RequestMapping("/mcPlain")
@Api(value = "商家飞机表API", tags = {"商家飞机表"})*/
public class McPlainController extends BaseController {
@Autowired
private McPlainService mcPlainService;
/**
* 添加商家飞机表
*/
@PostMapping("/add")
@OperationLog(name = "添加商家飞机表", type = OperationLogType.ADD)
@ApiOperation(value = "添加商家飞机表")
public ApiResult<Boolean> addMcPlain(@Validated(Add.class) @RequestBody McPlain mcPlain) throws Exception {
boolean flag = mcPlainService.saveMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 修改商家飞机表
*/
@PostMapping("/update")
@OperationLog(name = "修改商家飞机表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改商家飞机表")
public ApiResult<Boolean> updateMcPlain(@Validated(Update.class) @RequestBody McPlain mcPlain) throws Exception {
boolean flag = mcPlainService.updateMcPlain(mcPlain);
return ApiResult.result(flag);
}
/**
* 删除商家飞机表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除商家飞机表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除商家飞机表")
public ApiResult<Boolean> deleteMcPlain(@PathVariable("id") Long id) throws Exception {
boolean flag = mcPlainService.deleteMcPlain(id);
return ApiResult.result(flag);
}
/**
* 获取商家飞机表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "商家飞机表详情", type = OperationLogType.INFO)
@ApiOperation(value = "商家飞机表详情")
public ApiResult<McPlainQueryVo> getMcPlain(@PathVariable("id") Long id) throws Exception {
McPlainQueryVo mcPlainQueryVo = mcPlainService.getMcPlainById(id);
return ApiResult.ok(mcPlainQueryVo);
}
/**
* 商家飞机表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "商家飞机表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "商家飞机表分页列表")
public ApiResult<Paging<McPlainQueryVo>> getMcPlainPageList(@Validated @RequestBody McPlainPageParam mcPlainPageParam) throws Exception {
Paging<McPlainQueryVo> paging = mcPlainService.getMcPlainPageList(mcPlainPageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.jumeirah.common.entity.base.ImgJson;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -10,7 +14,8 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.sql.Timestamp;
import java.util.List;
/**
* 公务机出售/托管表
......@@ -22,6 +27,7 @@ import java.util.Date;
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BusinessPlain对象")
@TableName(autoResultMap = true)
public class BusinessPlain extends BaseEntity {
private static final long serialVersionUID = 1L;
......@@ -38,9 +44,6 @@ public class BusinessPlain extends BaseEntity {
@ApiModelProperty("业务类型,0-出售,1-托管")
private Integer businessType;
@ApiModelProperty("图片url")
private String imgUrl;
@ApiModelProperty("机型介绍")
private String introduction;
......@@ -58,14 +61,13 @@ public class BusinessPlain extends BaseEntity {
private Integer status;
@ApiModelProperty("创建时间(时间戳)")
private Date createTime;
private Timestamp createTime;
@ApiModelProperty("更新时间(时间戳)")
private Date updateTime;
private Timestamp updateTime;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
@TableField(typeHandler = FastjsonTypeHandler.class)
@ApiModelProperty("图片相关数据json (包括:路径,宽和高)")
private List<ImgJson> imgUrl;
}
......@@ -56,9 +56,4 @@ public class CharterIntroduction extends BaseEntity {
@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 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.sql.Timestamp;
/**
* 商家飞机表
*
* @author xxx
* @since 2020-10-19
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "McPlain对象")
public class McPlain extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotNull(message = "飞机类型ID不能为空")
@ApiModelProperty("飞机类型ID")
private Long ptId;
@NotNull(message = "状态,0-正常,1-禁用,99-删除不能为空")
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
@NotNull(message = "创建时间(时间戳)不能为空")
@ApiModelProperty("创建时间(时间戳)")
private Timestamp createTime;
@ApiModelProperty("更新时间(时间戳)")
private Timestamp updateTime;
@NotNull(message = "商家ID不能为空")
@ApiModelProperty("商家ID")
private Long mcId;
@NotNull(message = "数量不能为空")
@ApiModelProperty("数量")
private Integer amount;
@NotNull(message = "所在地城市ID不能为空")
@ApiModelProperty("所在地城市ID")
private Long cityId;
}
......@@ -81,6 +81,9 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("更新时间")
private Timestamp updateTime;
@ApiModelProperty("付款时间")
private Timestamp userRechargeTime;
@ApiModelProperty("货物名称")
private String goodsName;
......
package com.jumeirah.common.entity.base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName ImgJson
* @Descripteion 请写点注释吧!
* @Date 2020/10/22 11:21
* @Version 1.0
**/
@Data
@ApiModel(value = "图片json对象")
public class ImgJson implements Serializable {
@ApiModelProperty("地址url")
private String url;
@ApiModelProperty("高")
private Long height;
@ApiModelProperty("宽")
private Long width;
}
package com.jumeirah.common.enums;
import io.geekidea.springbootplus.framework.common.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 状态,0-正常,1-完成,99-删除
*/
@Getter
@AllArgsConstructor
public enum StrokeDiscountStatusEnum implements BaseEnum {
OK(0, "正常"),
COMPLETE(1, "完成"),
CANCEL(99, "取消");
/**
* 编号
*/
private final Integer code;
/**
* 名称
*/
private final String desc;
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.vo.McPlainQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
/**
* 商家飞机表 Mapper 接口
*
* @author xxx
* @since 2020-10-19
*/
@Repository
public interface McPlainMapper extends BaseMapper<McPlain> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
McPlainQueryVo getMcPlainById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param mcPlainPageParam
* @return
*/
IPage<McPlainQueryVo> getMcPlainPageList(@Param("page") Page page, @Param("param") McPlainPageParam mcPlainPageParam);
}
package com.jumeirah.common.param;
import com.jumeirah.common.vo.CharterIntroductionImgForAppVo;
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 java.util.List;
/**
* 包机介绍
*
* @author giao
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "CharterIntroductionAddParam")
public class CharterIntroductionAddParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "包机图片url")
private List<CharterIntroductionImgForAppVo> imgList;
@ApiModelProperty(value = "包机文字")
private String text;
@ApiModelProperty("包机标题")
private String title;
@ApiModelProperty("类型 1私人;2团体;3货运;4医疗")
private Integer type;
}
package com.jumeirah.common.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;
/**
* 包机介绍
*
* @author giao
* @since 2020-10-14
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "CharterIntroductionUpdateParam")
public class CharterIntroductionUpdateParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "包机图片url, json字符串", example = "[{\"url\":\"https://picsum.photos/100/200/\",\"height\":200,\"width\":200},{\"url\":\"https://picsum.photos/100/200/\",\"height\":200,\"width\":200},{\"url\":\"https://picsum.photos/100/200/\",\"height\":200,\"width\":200}]")
private String imgUrl;
@ApiModelProperty(value = "包机文字")
private String text;
@ApiModelProperty("包机标题")
private String title;
@ApiModelProperty("类型 1私人;2团体;3货运;4医疗")
private Integer type;
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* 商家飞机表 分页参数对象
* </pre>
*
* @author xxx
* @date 2020-10-19
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商家飞机表分页参数")
public class McPlainPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
}
......@@ -28,6 +28,9 @@ public class McStrokePageParam extends BasePageOrderParam {
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("状态,-1全部,0-审核中,1-进行中,2-已完成,99-取消")
private Integer status;
@ApiModelProperty("开始时间")
private String startTime;
......
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 登录参数
*
* @author geekidea
* @date 2019-05-15
**/
@Data
@ApiModel("商家用户修改密码参数")
public class MerchantUpdatePwdParam implements Serializable {
private static final long serialVersionUID = 2854217576695117356L;
@NotBlank(message = "请输入密码")
@ApiModelProperty(value = "密码", example = "123456")
private String oldPassword;
@NotBlank(message = "请输入密码")
@ApiModelProperty(value = "密码", example = "123456")
private String newPassword;
}
package com.jumeirah.common.param.app;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* APP用户
*
* @author wei
* @since 2020-09-23
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AppUserPhoneUpdateParam")
public class AppUserPhoneUpdateParam extends BaseEntity {
private String phoneArea;
private String phone;
private String code;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.CharterIntroduction;
import com.jumeirah.common.param.CharterIntroductionAddParam;
import com.jumeirah.common.param.CharterIntroductionPageParam;
import com.jumeirah.common.param.CharterIntroductionUpdateParam;
import com.jumeirah.common.vo.CharterIntroductionQueryForAppVo;
import com.jumeirah.common.vo.CharterIntroductionQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
......@@ -18,20 +20,19 @@ public interface CharterIntroductionService extends BaseService<CharterIntroduct
/**
* 保存
*
* @param charterIntroduction
* @return
* @throws Exception
*/
boolean saveCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception;
boolean saveCharterIntroduction(CharterIntroductionAddParam charterIntroductionAddParam) throws Exception;
/**
* 修改
*
* @param charterIntroduction
* @param
* @return
* @throws Exception
*/
boolean updateCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception;
boolean updateCharterIntroduction(CharterIntroductionUpdateParam charterIntroductionUpdateParam) throws Exception;
/**
* 删除
......@@ -60,6 +61,13 @@ public interface CharterIntroductionService extends BaseService<CharterIntroduct
*/
Paging<CharterIntroductionQueryVo> getCharterIntroductionPageList(CharterIntroductionPageParam charterIntroductionPageParam) throws Exception;
/**
* 包机介绍分页-- app调用
*
* @param charterIntroductionPageParam
* @return
* @throws Exception
*/
Paging<CharterIntroductionQueryForAppVo> getCharterIntroductionForAppPageList(CharterIntroductionPageParam charterIntroductionPageParam) throws Exception;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.param.McPlainPageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import com.jumeirah.common.vo.McPlainQueryVo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 商家飞机表 服务类
*
* @author xxx
* @since 2020-10-19
*/
public interface McPlainService extends BaseService<McPlain> {
/**
* 保存
*
* @param mcPlain
* @return
* @throws Exception
*/
boolean saveMcPlain(McPlain mcPlain) throws Exception;
/**
* 修改
*
* @param mcPlain
* @return
* @throws Exception
*/
boolean updateMcPlain(McPlain mcPlain) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteMcPlain(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
McPlainQueryVo getMcPlainById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param mcPlainPageParam
* @return
* @throws Exception
*/
Paging<McPlainQueryVo> getMcPlainPageList(McPlainPageParam mcPlainPageParam) throws Exception;
}
......@@ -2,6 +2,7 @@ package com.jumeirah.common.service;
import com.jumeirah.common.entity.MerchantUser;
import com.jumeirah.common.param.MerchantLoginParam;
import com.jumeirah.common.param.MerchantUpdatePwdParam;
import com.jumeirah.common.param.MerchantUserPageParam;
import com.jumeirah.common.vo.LoginMerUserTokenVo;
import com.jumeirah.common.vo.MerchantUserQueryVo;
......@@ -37,6 +38,8 @@ public interface MerchantUserService extends BaseService<MerchantUser> {
*/
ApiResult<LoginMerUserTokenVo> login(MerchantLoginParam merchantLoginParam) throws Exception;
ApiResult<Boolean> updatePwd(MerchantUpdatePwdParam merchantUpdatePwdParam) throws Exception;
// ApiResult<Boolean> register(MerchantRegisterParam merchantRegisterParam) throws Exception;
......
......@@ -3,20 +3,32 @@ 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.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jumeirah.common.entity.CharterIntroduction;
import com.jumeirah.common.mapper.CharterIntroductionMapper;
import com.jumeirah.common.param.CharterIntroductionAddParam;
import com.jumeirah.common.param.CharterIntroductionPageParam;
import com.jumeirah.common.param.CharterIntroductionUpdateParam;
import com.jumeirah.common.service.CharterIntroductionService;
import com.jumeirah.common.vo.CharterIntroductionImgForAppVo;
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 io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.geekidea.springbootplus.framework.util.Jackson;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 包机介绍 服务实现类
*
......@@ -32,13 +44,22 @@ public class CharterIntroductionServiceImpl extends BaseServiceImpl<CharterIntro
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception {
public boolean saveCharterIntroduction(CharterIntroductionAddParam charterIntroductionAddParam) throws Exception {
CharterIntroduction charterIntroduction = new CharterIntroduction();
BeanUtils.copyProperties(charterIntroductionAddParam, charterIntroduction);
// 图片列表转json
charterIntroduction.setImgUrl(Jackson.toJsonString(charterIntroductionAddParam.getImgList()));
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
charterIntroduction.setMcId(jwtToken.getMcId());
return super.save(charterIntroduction);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateCharterIntroduction(CharterIntroduction charterIntroduction) throws Exception {
public boolean updateCharterIntroduction(CharterIntroductionUpdateParam charterIntroductionUpdateParam) throws Exception {
CharterIntroduction charterIntroduction = new CharterIntroduction();
BeanUtils.copyProperties(charterIntroductionUpdateParam, charterIntroduction);
return super.updateById(charterIntroduction);
}
......@@ -64,6 +85,22 @@ public class CharterIntroductionServiceImpl extends BaseServiceImpl<CharterIntro
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);
// 处理过的数据列表
List<CharterIntroductionQueryForAppVo> newRecords = new ArrayList<CharterIntroductionQueryForAppVo>();
// 对数据做二次处理
for (CharterIntroductionQueryForAppVo charterIntroductionQueryForAppVo : iPage.getRecords()) {
ObjectMapper objectMapper = new ObjectMapper();
JavaType javaType = objectMapper.getTypeFactory().constructCollectionType(ArrayList.class, CharterIntroductionImgForAppVo.class);
// 处理图片url, 因为数据库存的json 需要转换
List<CharterIntroductionImgForAppVo> lst = (List<CharterIntroductionImgForAppVo>) objectMapper.readValue(charterIntroductionQueryForAppVo.getImgUrl(), javaType);
charterIntroductionQueryForAppVo.setImgList(lst);
charterIntroductionQueryForAppVo.setImgUrl(null);
newRecords.add(charterIntroductionQueryForAppVo);
}
iPage.setRecords(newRecords);
return new Paging<>(iPage);
}
......
package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.McPlain;
import com.jumeirah.common.mapper.McPlainMapper;
import com.jumeirah.common.service.McPlainService;
import com.jumeirah.common.param.McPlainPageParam;
import com.jumeirah.common.vo.McPlainQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 商家飞机表 服务实现类
*
* @author xxx
* @since 2020-10-19
*/
@Slf4j
@Service
public class McPlainServiceImpl extends BaseServiceImpl<McPlainMapper, McPlain> implements McPlainService {
@Autowired
private McPlainMapper mcPlainMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveMcPlain(McPlain mcPlain) throws Exception {
return super.save(mcPlain);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateMcPlain(McPlain mcPlain) throws Exception {
return super.updateById(mcPlain);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteMcPlain(Long id) throws Exception {
return super.removeById(id);
}
@Override
public McPlainQueryVo getMcPlainById(Long id) throws Exception {
return mcPlainMapper.getMcPlainById(id);
}
@Override
public Paging<McPlainQueryVo> getMcPlainPageList(McPlainPageParam mcPlainPageParam) throws Exception {
Page<McPlainQueryVo> page = new PageInfo<>(mcPlainPageParam, OrderItem.desc(getLambdaColumn(McPlain::getCreateTime)));
IPage<McPlainQueryVo> iPage = mcPlainMapper.getMcPlainPageList(page, mcPlainPageParam);
return new Paging<McPlainQueryVo>(iPage);
}
}
package com.jumeirah.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
......@@ -10,6 +11,7 @@ import com.jumeirah.common.entity.MerchantUserPermission;
import com.jumeirah.common.enums.StateEnum;
import com.jumeirah.common.mapper.MerchantUserMapper;
import com.jumeirah.common.param.MerchantLoginParam;
import com.jumeirah.common.param.MerchantUpdatePwdParam;
import com.jumeirah.common.param.MerchantUserPageParam;
import com.jumeirah.common.service.MerchantPermissionService;
import com.jumeirah.common.service.MerchantUserPermissionService;
......@@ -31,6 +33,7 @@ import io.geekidea.springbootplus.framework.shiro.util.SaltUtil;
import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo;
import io.geekidea.springbootplus.framework.util.PasswordUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -208,6 +211,56 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
return ApiResult.ok(loginSysUserTokenVo);
}
@Override
public ApiResult<Boolean> updatePwd(MerchantUpdatePwdParam merchantUpdatePwdParam) throws Exception {
// 判断旧密码是否正确
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
MerchantUser merchantUser = this.getById(jwtToken.getUserId());
if (merchantUser == null) {
log.error("登录失败,用户名或密码错误merchantLoginParam:{}", merchantUpdatePwdParam);
return ApiResult.result(ApiCode.PWD_OR_USERNAME_ERROR, null);
}
if (StateEnum.DISABLE.getCode().equals(merchantUser.getState())) {
log.error("登录失败,禁用:{}", merchantUpdatePwdParam);
return ApiResult.result(ApiCode.LOGIN_EXCEPTION, null);
}
// 后台加密规则:sha256(sha256(123456) + salt)
String encryptPassword = PasswordUtil.encrypt(merchantUpdatePwdParam.getOldPassword(), merchantUser.getSalt());
if (!encryptPassword.equals(merchantUser.getPassword())) {
return ApiResult.result(ApiCode.PWD_OR_USERNAME_ERROR, null);
}
// 生成盐值
String salt = null;
String password = merchantUpdatePwdParam.getNewPassword();
// 如果密码为空,则设置默认密码
if (StringUtils.isBlank(password)) {
salt = springBootPlusProperties.getLoginInitSalt();
password = springBootPlusProperties.getLoginInitPassword();
} else {
salt = SaltUtil.generateSalt();
}
MerchantUser newMerchantUser = new MerchantUser();
// 密码加密
newMerchantUser.setSalt(salt);
newMerchantUser.setPassword(PasswordUtil.encrypt(password, salt));
newMerchantUser.setId(jwtToken.getUserId());
// 修改新密码
boolean updateById = this.updateById(newMerchantUser);
if (updateById) {
// 删除redis中的token,需要用户重新登陆
merchantLoginRedisService.deleteUserAllCache(jwtToken.getUsername());
return ApiResult.ok();
} else {
return ApiResult.fail();
}
}
// @Override
// public ApiResult<Boolean> register(MerchantRegisterParam merchantRegisterPram) throws Exception {
//
......
package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.StrokeDiscount;
import com.jumeirah.common.enums.StrokeDiscountStatusEnum;
import com.jumeirah.common.mapper.StrokeDiscountMapper;
import com.jumeirah.common.service.StrokeDiscountService;
import com.jumeirah.common.param.StrokeDiscountPageParam;
......@@ -44,7 +45,10 @@ public class StrokeDiscountServiceImpl extends BaseServiceImpl<StrokeDiscountMap
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteStrokeDiscount(Long id) throws Exception {
return super.removeById(id);
StrokeDiscount strokeDiscount = new StrokeDiscount();
strokeDiscount.setId(id)
.setStatus(StrokeDiscountStatusEnum.CANCEL.getCode());
return super.updateById(strokeDiscount);
}
@Override
......
package com.jumeirah.common.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.jumeirah.common.entity.base.ImgJson;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* <pre>
......@@ -18,15 +23,13 @@ import java.io.Serializable;
@Data
@Accessors(chain = true)
@ApiModel(value = "BusinessPlainQueryForAppVo对象")
@TableName(autoResultMap = true)
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;
......@@ -41,8 +44,8 @@ public class BusinessPlainQueryForAppVo implements Serializable {
@ApiModelProperty("商家头像")
private String mcHead;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
}
\ No newline at end of file
@TableField(typeHandler = FastjsonTypeHandler.class)
@ApiModelProperty("图片相关数据json (包括:路径,宽和高)")
private List<ImgJson> imgList;
}
package com.jumeirah.common.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.jumeirah.common.entity.base.ImgJson;
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;
import java.sql.Timestamp;
import java.util.List;
/**
* <pre>
......@@ -19,7 +24,8 @@ import java.util.Date;
@Data
@Accessors(chain = true)
@ApiModel(value = "BusinessPlainQueryVo对象")
public class BusinessPlainQueryVo implements Serializable {
@TableName(autoResultMap = true)
public class BusinessPlainQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
......@@ -31,9 +37,6 @@ public class BusinessPlainQueryVo implements Serializable {
@ApiModelProperty("业务类型,0-出售,1-托管")
private Integer businessType;
@ApiModelProperty("图片url")
private String imgUrl;
@ApiModelProperty("机型介绍")
private String introduction;
......@@ -50,8 +53,12 @@ public class BusinessPlainQueryVo implements Serializable {
private Integer status;
@ApiModelProperty("创建时间(时间戳)")
private Date createTime;
private Timestamp createTime;
@ApiModelProperty("更新时间(时间戳)")
private Date updateTime;
}
\ No newline at end of file
private Timestamp updateTime;
@TableField(typeHandler = FastjsonTypeHandler.class)
@ApiModelProperty("图片相关数据json (包括:路径,宽和高)")
private List<ImgJson> imgList;
}
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 = "CharterIntroductionImgForAppVo")
public class CharterIntroductionImgForAppVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("url")
private String url;
@ApiModelProperty("高")
private Integer height;
@ApiModelProperty("宽")
private Integer width;
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* <pre>
......@@ -25,7 +26,10 @@ public class CharterIntroductionQueryForAppVo implements Serializable {
private String mcName;
@ApiModelProperty("商家头像")
private String mcHead;
@ApiModelProperty("包机图片url")
@ApiModelProperty("图片")
private List<CharterIntroductionImgForAppVo> imgList;
private String imgUrl;
@ApiModelProperty("包机文字")
......@@ -34,9 +38,4 @@ public class CharterIntroductionQueryForAppVo implements Serializable {
@ApiModelProperty("包机标题")
private String title;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
}
\ No newline at end of file
......@@ -28,10 +28,10 @@ public class CharterIntroductionQueryVo implements Serializable {
@ApiModelProperty("商家ID")
private Long mcId;
@ApiModelProperty("图片高")
private Integer imageListHeight;
@ApiModelProperty("图片宽")
private Integer imageListWidth;
// @ApiModelProperty("图片高")
// private Integer imageListHeight;
// @ApiModelProperty("图片宽")
// private Integer imageListWidth;
@ApiModelProperty("状态,0-正常,1-取消,99-删除")
private Integer status;
......
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 xxx
* @date 2020-10-19
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "McPlainQueryVo对象")
public class McPlainQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("飞机类型ID")
private Long ptId;
@ApiModelProperty("飞机类型名称")
private String ptName;
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
@ApiModelProperty("创建时间(时间戳)")
private Long createTime;
@ApiModelProperty("更新时间(时间戳)")
private Long updateTime;
@ApiModelProperty("商家ID")
private Long mcId;
@ApiModelProperty("数量")
private Integer amount;
@ApiModelProperty("所在地城市ID")
private Long cityId;
@ApiModelProperty("所在地城市名称")
private String cityName;
@ApiModelProperty("飞机图片地址")
private String imgUrl;
}
......@@ -4,11 +4,27 @@
<!-- 通用查询结果列 -->
<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
id,
mc_id,
business_type,
img_url,
introduction,
name,
phone,
wechat,
status,
create_time,
update_time
</sql>
<sql id="Base_Column_ListForApp">
bp.business_type, bp.img_url, bp.introduction, bp.name, bp.phone, bp.wechat,m.`name` AS mcName
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">
......@@ -18,20 +34,31 @@
</select>
<select id="getBusinessPlainPageList" parameterType="com.jumeirah.common.param.BusinessPlainPageParam"
resultType="com.jumeirah.common.vo.BusinessPlainQueryVo">
resultMap="pageListMap">
select
<include refid="Base_Column_List"/>
from business_plain as bp
<include refid="Base_Column_List"/>
from business_plain
</select>
<resultMap id="pageListMap" type="com.jumeirah.common.vo.BusinessPlainQueryVo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="img_url" property="imgList" typeHandler="com.jumeirah.common.campusstore.ArrayJsonHandler"></result>
</resultMap>
<select id="getBusinessPlainPageListForApp" parameterType="com.jumeirah.common.param.BusinessPlainPageParam"
resultType="com.jumeirah.common.vo.BusinessPlainQueryForAppVo">
resultMap="pageListMapForApp">
select
<include refid="Base_Column_ListForApp"/>,bp.image_list_height,bp.image_list_width,m.`head` AS mcHead
<include refid="Base_Column_ListForApp"/>,
m.`head` AS mcHead
from business_plain bp
INNER JOIN merchant m ON bp.mc_id=m.id
where bp.business_type=#{param.type}
AND m.state=1 and m.audit_register_status=1
where bp.business_type = #{param.type}
AND m.state = 1
and m.audit_register_status = 1
</select>
<resultMap id="pageListMapForApp" type="com.jumeirah.common.vo.BusinessPlainQueryForAppVo">
<result column="img_url" property="imgList" typeHandler="com.jumeirah.common.campusstore.ArrayJsonHandler"></result>
</resultMap>
</mapper>
......@@ -4,10 +4,10 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, mc_id, status, create_time, update_time,type,text,img_url,image_list_height,image_list_width
id, mc_id, status, create_time,update_time,type,text,img_url
</sql>
<sql id="Base_Column_ListForApp">
title,text,img_url,ci.image_list_height,ci.image_list_width,m.head AS mcHead,m.name AS mcName
title,text,img_url,m.head AS mcHead,m.name AS mcName
</sql>
<select id="getCharterIntroductionById" resultType="com.jumeirah.common.vo.CharterIntroductionQueryVo">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jumeirah.common.mapper.McPlainMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id,
pt_id,
status,
create_time,
update_time,
mc_id,
amount,
city_id
</sql>
<select id="getMcPlainById" resultType="com.jumeirah.common.vo.McPlainQueryVo">
select
<include refid="Base_Column_List"/>
from mc_plain where id = #{id}
</select>
<select id="getMcPlainPageList" parameterType="com.jumeirah.common.param.McPlainPageParam"
resultType="com.jumeirah.common.vo.McPlainQueryVo">
select
pt.name as pt_name,
pt.img_url,
ctc.city_name_cn as city_name,
mp.*
from mc_plain mp
left join plain_type pt on pt.id = mp.pt_id
left join city_three_code ctc on ctc.id = mp.city_id
</select>
</mapper>
......@@ -128,6 +128,9 @@
LEFT JOIN app_user au ON au.id = s.user_id
LEFT JOIN plain_type pt ON pt.id = s.plain_type_id
<where>
<if test="mcStrokePageParam.status != null and mcStrokePageParam.status != -1">
AND s.status = #{mcStrokePageParam.status}
</if>
<if test="mcStrokePageParam.type != null and mcStrokePageParam.type != -1">
AND s.type = #{mcStrokePageParam.type}
</if>
......
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